code
stringlengths 2
1.05M
|
|---|
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
import createHistory from 'history/lib/createBrowserHistory';
import createMemoryHistory from 'history/lib/createMemoryHistory';
import useQueries from 'history/lib/useQueries';
const location = useQueries(canUseDOM ? createHistory : createMemoryHistory)();
export default location;
|
/*
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(document) {
'use strict';
// Grab a reference to our auto-binding template
// and give it some initial binding values
// Learn more about auto-binding templates at http://goo.gl/Dx1u2g
var app = document.querySelector('#app');
// Sets app default base URL
app.baseUrl = '/';
if (window.location.port === '') { // if production
// Uncomment app.baseURL below and
// set app.baseURL to '/your-pathname/' if running from folder in production
// app.baseUrl = '/polymer-starter-kit/';
}
app.displayInstalledToast = function() {
// Check to make sure caching is actually enabled—it won't be in the dev environment.
if (!Polymer.dom(document).querySelector('platinum-sw-cache').disabled) {
Polymer.dom(document).querySelector('#caching-complete').show();
}
};
// Listen for template bound event to know when bindings
// have resolved and content has been stamped to the page
app.addEventListener('dom-change', function() {
//console.log('Our app is ready to rock!');
});
// See https://github.com/Polymer/polymer/issues/1381
window.addEventListener('WebComponentsReady', function() {
// imports are loaded and elements have been registered
});
// Main area's paper-scroll-header-panel custom condensing transformation of
// the appName in the middle-container and the bottom title in the bottom-container.
// The appName is moved to top and shrunk on condensing. The bottom sub title
// is shrunk to nothing on condensing.
window.addEventListener('paper-header-transform', function(e) {
var appName = Polymer.dom(document).querySelector('#mainToolbar .app-name');
var middleContainer = Polymer.dom(document).querySelector('#mainToolbar .middle-container');
var bottomContainer = Polymer.dom(document).querySelector('#mainToolbar .bottom-container');
var detail = e.detail;
var heightDiff = detail.height - detail.condensedHeight;
var yRatio = Math.min(1, detail.y / heightDiff);
// appName max size when condensed. The smaller the number the smaller the condensed size.
var maxMiddleScale = 0.50;
var auxHeight = heightDiff - detail.y;
var auxScale = heightDiff / (1 - maxMiddleScale);
var scaleMiddle = Math.max(maxMiddleScale, auxHeight / auxScale + maxMiddleScale);
var scaleBottom = 1 - yRatio;
// Move/translate middleContainer
Polymer.Base.transform('translate3d(0,' + yRatio * 100 + '%,0)', middleContainer);
// Scale bottomContainer and bottom sub title to nothing and back
Polymer.Base.transform('scale(' + scaleBottom + ') translateZ(0)', bottomContainer);
// Scale middleContainer appName
Polymer.Base.transform('scale(' + scaleMiddle + ') translateZ(0)', appName);
});
// Scroll page to top and expand header
app.scrollPageToTop = function() {
app.$.headerPanelMain.scrollToTop(true);
};
app.closeDrawer = function() {
app.$.paperDrawerPanel.closeDrawer();
};
})(document);
|
var markdownlint = require('markdownlint');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.registerMultiTask('markdownlint', function task() {
var done = this.async();
markdownlint(
{ "files": this.filesSrc },
function callback(err, result) {
var resultString = err || ((result || '').toString());
if (resultString) {
grunt.fail.warn('\n' + resultString + '\n');
}
done(!err || !resultString);
});
});
grunt.initConfig({
watch: {
build: {
files: ['src/**/*.jsx'],
tasks: ['build']
},
test: {
files: ['src/**/*.jsx', 'tests/*.jsx'],
tasks: ['testOnce']
}
},
babel: {
options: { sourceRoot: 'src' },
umd: {
files: {
'tmp/reactable/lib/to_array.js': 'src/reactable/lib/to_array.jsx',
'tmp/reactable/lib/filter_props_from.js': 'src/reactable/lib/filter_props_from.jsx',
'tmp/reactable/lib/extract_data_from.js': 'src/reactable/lib/extract_data_from.jsx',
'tmp/reactable/lib/is_react_component.js': 'src/reactable/lib/is_react_component.jsx',
'tmp/reactable/lib/stringable.js': 'src/reactable/lib/stringable.jsx',
'tmp/reactable/filterer.js': 'src/reactable/filterer.jsx',
'tmp/reactable/sort.js': 'src/reactable/sort.jsx',
'tmp/reactable/td.js': 'src/reactable/td.jsx',
'tmp/reactable/tr.js': 'src/reactable/tr.jsx',
'tmp/reactable/thead.js': 'src/reactable/thead.jsx',
'tmp/reactable/tfoot.js': 'src/reactable/tfoot.jsx',
'tmp/reactable/unsafe.js': 'src/reactable/unsafe.jsx',
'tmp/reactable/th.js': 'src/reactable/th.jsx',
'tmp/reactable/paginator.js': 'src/reactable/paginator.jsx',
'tmp/reactable/table.js': 'src/reactable/table.jsx',
'tmp/reactable.js': 'src/reactable.jsx',
'build/tests/reactable_test.js': 'tests/reactable_test.jsx'
},
options: { modules: 'umdStrict' }
},
common: {
files: {
'lib/reactable/lib/to_array.js': 'src/reactable/lib/to_array.jsx',
'lib/reactable/lib/filter_props_from.js': 'src/reactable/lib/filter_props_from.jsx',
'lib/reactable/lib/extract_data_from.js': 'src/reactable/lib/extract_data_from.jsx',
'lib/reactable/lib/is_react_component.js': 'src/reactable/lib/is_react_component.jsx',
'lib/reactable/lib/stringable.js': 'src/reactable/lib/stringable.jsx',
'lib/reactable/filterer.js': 'src/reactable/filterer.jsx',
'lib/reactable/sort.js': 'src/reactable/sort.jsx',
'lib/reactable/td.js': 'src/reactable/td.jsx',
'lib/reactable/tr.js': 'src/reactable/tr.jsx',
'lib/reactable/thead.js': 'src/reactable/thead.jsx',
'lib/reactable/tfoot.js': 'src/reactable/tfoot.jsx',
'lib/reactable/unsafe.js': 'src/reactable/unsafe.jsx',
'lib/reactable/th.js': 'src/reactable/th.jsx',
'lib/reactable/paginator.js': 'src/reactable/paginator.jsx',
'lib/reactable/table.js': 'src/reactable/table.jsx',
'lib/reactable.js': 'src/reactable.jsx',
'build/tests/reactable_test.js': 'tests/reactable_test.jsx'
},
options: { modules: 'common' }
}
},
concat: {
dist: {
src: [
'tmp/reactable/lib/filter_props_from.js',
'tmp/reactable/lib/to_array.js',
'tmp/reactable/lib/stringable.js',
'tmp/reactable/lib/extract_data_from.js',
'tmp/reactable/lib/is_react_component.js',
'tmp/reactable/unsafe.js',
'tmp/reactable/filterer.js',
'tmp/reactable/sort.js',
'tmp/reactable/td.js',
'tmp/reactable/tr.js',
'tmp/reactable/th.js',
'tmp/reactable/thead.js',
'tmp/reactable/tfoot.js',
'tmp/reactable/paginator.js',
'tmp/reactable/table.js',
'tmp/reactable.js'
],
dest: 'build/reactable.js'
}
},
file_append: {
umdHack: {
files: [{
prepend: 'window.React["default"] = window.React;\n',
input: 'build/reactable.js',
output: 'build/reactable.js'
}]
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
}
},
markdownlint: {
readme: {
"src": [ "README.md" ]
}
}
});
grunt.registerTask('testOnce', ['build', 'karma']);
grunt.registerTask('test', ['testOnce', 'watch:test']);
grunt.registerTask('ci', ['testOnce', 'markdownlint:readme'])
grunt.registerTask('buildBrowser', ['babel:umd', 'concat', 'file_append:umdHack'])
grunt.registerTask('build', ['babel:common', 'buildBrowser']);
grunt.registerTask('default', ['build', 'watch:build']);
};
|
// these utilities capture some of the relatively complex logic within d3-axis which
// determines the ticks and tick formatter based on various axis and scale
// properties: https://github.com/d3/d3-axis#axis_ticks
const identity = d => d;
const tryApply = (scale, fn, args, defaultVal) =>
scale[fn] ? scale[fn].apply(scale, args) : defaultVal;
const ticksArrayForAxis = axis =>
axis.tickValues() ??
tryApply(
axis.scale(),
'ticks',
axis.tickArguments(),
axis.scale().domain()
);
const tickFormatterForAxis = axis =>
axis.tickFormat() ??
tryApply(axis.scale(), 'tickFormat', axis.tickArguments(), identity);
export { ticksArrayForAxis, tickFormatterForAxis };
|
var Twitter = require('../lib/Twitter');
var twitterStreamClient = new Twitter.StreamClient(
'CONSUMER_KEY',
'CONSUMER_SECRET',
'TOKEN',
'TOKEN_SECRET'
);
twitterStreamClient.on('close', function() {
console.log('Connection closed.');
});
twitterStreamClient.on('end', function() {
console.log('End of Line.');
});
twitterStreamClient.on('error', function(error) {
console.log('Error: ' + (error.code ? error.code + ' ' + error.message : error.message));
});
twitterStreamClient.on('deleteTweet', function(data) {
console.log(data);
});
twitterStreamClient.start(['baseball', 'basketball', 'football', 'hockey']);
|
#!/usr/bin/env node
// simple command-line validation
var JaySchema = require('../lib/jayschema.js')
, fs = require('fs')
, path = require('path')
;
// support Node 0.6.x
var existsSync = fs.existsSync || path.existsSync;
var META_SCHEMA_PATH = path.join(__dirname, '..', 'lib', 'suites', 'draft-04',
'json-schema-draft-v4.json');
var META_SCHEMA = require(META_SCHEMA_PATH);
var instance = process.argv[2];
var schema = process.argv[3] || META_SCHEMA_PATH;
var syntax = function() {
console.log('Syntax: jayschema <instance> [<schema>]');
console.log('\tif <schema> is omitted, the <instance> will be validated');
console.log('\tagainst the JSON Schema Draft v4 meta-schema');
};
if (!instance || !schema) {
return syntax();
}
if (!existsSync(instance)) {
console.error('ERR: instance', '"' + instance + '"', 'not found');
return;
}
if (!existsSync(schema)) {
console.error('ERR: schema', '"' + schema + '"', 'not found');
return;
}
var instanceRaw = fs.readFileSync(instance);
var schemaRaw = fs.readFileSync(schema);
try {
var instanceJson = JSON.parse(instanceRaw);
} catch (e) {
console.error('ERR: instance is not valid JSON');
return;
}
try {
var schemaJson = JSON.parse(schemaRaw);
} catch (e) {
console.error('ERR: schema is not valid JSON');
return;
}
var js = new JaySchema();
var schemaErrors = js.validate(schemaJson, META_SCHEMA);
if (schemaErrors.length) {
console.error('ERR: schema is not valid JSON Schema Draft v4');
console.log(require('util').inspect(schemaErrors, false, null));
return;
}
var result = js.validate(instanceJson, schemaJson);
if (result.length === 0) {
console.log('validation OK');
} else {
console.log('validation errors:');
console.log(require('util').inspect(result, false, null));
}
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'contextmenu', 'ar', {
options: 'خصائص قائمة السياق'
});
|
/* @flow */
import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers'
function hasConditionDirective (el: ASTElement): boolean {
for (const attr in el.attrsMap) {
if (/^v\-if|v\-else|v\-else\-if$/.test(attr)) {
return true
}
}
return false
}
function getPrevMatch (el: ASTElement): any {
if (el.parent && el.parent.children) {
const prev: Object = el.parent.children[el.parent.children.length - 1]
return prev.attrsMap['[[match]]']
}
}
export function preTransformVIf (el: ASTElement, options: WeexCompilerOptions) {
if (hasConditionDirective(el)) {
let exp
const ifExp = getAndRemoveAttr(el, 'v-if', true /* remove from attrsMap */)
const elseifExp = getAndRemoveAttr(el, 'v-else-if', true)
// don't need the value, but remove it to avoid being generated as a
// custom directive
getAndRemoveAttr(el, 'v-else', true)
if (ifExp) {
exp = ifExp
} else {
const prevMatch = getPrevMatch(el)
if (prevMatch) {
exp = elseifExp
? `!(${prevMatch}) && (${elseifExp})` // v-else-if
: `!(${prevMatch})` // v-else
} else if (process.env.NODE_ENV !== 'production' && options.warn) {
options.warn(
`v-${elseifExp ? ('else-if="' + elseifExp + '"') : 'else'} ` +
`used on element <${el.tag}> without corresponding v-if.`
)
return
}
}
addRawAttr(el, '[[match]]', exp)
}
}
|
type User = {
name?: string;
email?: string;
}
export default function demo (name, email): string {
const user: User = {
name: ("foo": string),
email: ("bar@example.com": string),
something (): User {
this.name = name;
return this;
},
other: function (): string {
const foo = () => {
this.email = 'test@example.com';
return 'foo';
};
return foo();
}
};
return user.something().other();
}
|
var Converter = require("../libs/core/Converter.js");
var assert = require("assert");
var fs = require("fs");
var file = __dirname + "/data/testData";
var trailCommaData = __dirname + "/data/trailingComma";
describe("CSV Converter", function () {
it("should create new instance of csv", function () {
var obj = new Converter();
assert(obj);
});
it("should read from a stream", function (done) {
var obj = new Converter();
var stream = fs.createReadStream(file);
obj.on("end_parsed", function (obj) {
assert(obj.length === 2);
done();
});
stream.pipe(obj);
});
it("should emit record_parsed message once a row is parsed.", function (done) {
var obj = new Converter();
var stream = fs.createReadStream(file);
obj.on("record_parsed", function (resultRow) {
assert(resultRow);
});
obj.on("end", function () {
done();
});
stream.pipe(obj);
});
it("should emit end_parsed message once it is finished.", function (done) {
var obj = new Converter();
obj.on("end_parsed", function (result) {
assert(result);
assert(result.length === 2);
assert(result[0].date);
assert(result[0].employee);
assert(result[0].employee.name);
assert(result[0].employee.age);
assert(result[0].employee.number);
assert(result[0].employee.key.length === 2);
assert(result[0].address.length === 2);
done();
});
fs.createReadStream(file).pipe(obj);
});
it("should handle traling comma gracefully", function (done) {
var stream = fs.createReadStream(trailCommaData);
var obj = new Converter();
obj.on("end_parsed", function (result) {
assert(result);
assert(result.length > 0);
done();
});
stream.pipe(obj);
});
it("should handle comma in column which is surrounded by qoutes", function (done) {
var testData = __dirname + "/data/dataWithComma";
var rs = fs.createReadStream(testData);
var obj = new Converter({
"quote": "#"
});
obj.on("end_parsed", function (result) {
assert(result[0].col1 === "\"Mini. Sectt");
assert(result[3].col2 === "125001,fenvkdsf");
// console.log(result);
done();
});
rs.pipe(obj);
});
it("should be able to convert a csv to column array data", function (done) {
var columArrData = __dirname + "/data/columnArray";
var rs = fs.createReadStream(columArrData);
var result = {};
var csvConverter = new Converter();
//end_parsed will be emitted once parsing finished
csvConverter.on("end_parsed", function () {
assert(result.TIMESTAMP.length === 5);
done();
});
//record_parsed will be emitted each time a row has been parsed.
csvConverter.on("record_parsed", function (resultRow, rawRow, rowIndex) {
for (var key in resultRow) {
if (resultRow.hasOwnProperty(key)){
if (!result[key] || !(result[key] instanceof Array)) {
result[key] = [];
}
result[key][rowIndex] = resultRow[key];
}
}
});
rs.pipe(csvConverter);
});
it("should be able to convert csv string directly", function (done) {
var testData = __dirname + "/data/testData";
var data = fs.readFileSync(testData).toString();
var csvConverter = new Converter();
//end_parsed will be emitted once parsing finished
csvConverter.on("end_parsed", function (jsonObj) {
assert(jsonObj.length === 2);
});
csvConverter.fromString(data, function (err, jsonObj) {
assert(jsonObj.length === 2);
done();
});
});
it("should be able to convert csv string without callback provided", function (done) {
var testData = __dirname + "/data/testData";
var data = fs.readFileSync(testData).toString();
var csvConverter = new Converter();
//end_parsed will be emitted once parsing finished
csvConverter.on("end_parsed", function (jsonObj) {
assert(jsonObj.length === 2);
done();
});
csvConverter.fromString(data);
});
it("should be able to handle columns with double quotes", function (done) {
var testData = __dirname + "/data/dataWithQoutes";
var data = fs.readFileSync(testData).toString();
var csvConverter = new Converter();
csvConverter.on("end_parsed", function () {});
csvConverter.fromString(data, function (err, jsonObj) {
//console.log(jsonObj);
assert(jsonObj[0].TIMESTAMP === '13954264"22', JSON.stringify(jsonObj[0].TIMESTAMP));
assert(jsonObj[1].TIMESTAMP === 'abc, def, ccc', JSON.stringify(jsonObj[1].TIMESTAMP));
done();
});
});
it("should be able to handle columns with two double quotes", function (done) {
var testData = __dirname + "/data/twodoublequotes";
var data = fs.readFileSync(testData).toString();
var csvConverter = new Converter();
csvConverter.on("end_parsed", function () {});
csvConverter.fromString(data, function (err, jsonObj) {
assert(jsonObj[0].data === "xyabcde", jsonObj);
assert(jsonObj[0].uuid === "fejal\"eifa", jsonObj);
assert(jsonObj[0].fieldA === "bnej\"\"falkfe", jsonObj);
done();
});
});
it("should handle empty csv file", function (done) {
var testData = __dirname + "/data/emptyFile";
var rs = fs.createReadStream(testData);
var csvConverter = new Converter();
csvConverter.on("end_parsed", function (jsonObj) {
assert(jsonObj.length === 0);
done();
});
rs.pipe(csvConverter);
});
it ("should parse large csv file",function (done){
var testData=__dirname+"/data/large-csv-sample.csv";
var rs = fs.createReadStream(testData);
var csvConverter = new Converter({
constructResult:false
});
var count = 0;
csvConverter.on("record_parsed", function () {
//console.log(arguments);
count++;
});
csvConverter.on("end_parsed", function () {
assert(count === 5290);
done();
});
rs.pipe(csvConverter);
});
it ("should parse data and covert to specific types",function (done){
var testData = __dirname + "/data/dataWithType";
var rs = fs.createReadStream(testData);
var csvConverter=new Converter();
csvConverter.on("record_parsed",function (d){
assert(typeof d.column1 === "number");
assert(typeof d.column2 === "string");
assert(d.colume4 === "someinvaliddate");
assert(d.column5.hello === "world");
assert(d.column6 === '{"hello":"world"}');
assert(d.column7 === "1234");
assert(d.column8 === "abcd");
assert(d.column9 === true);
});
csvConverter.on("end_parsed",function (){
done();
});
rs.pipe(csvConverter);
});
it ("should turn off field type check",function (done){
var testData = __dirname + "/data/dataWithType";
var rs = fs.createReadStream(testData);
var csvConverter = new Converter({
checkType:false
});
csvConverter.on("record_parsed",function (d){
assert(typeof d.column1 === "string");
assert(typeof d.column2 === "string");
assert( d["date#column3"] === "2012-01-01");
assert(d["date#colume4"] === "someinvaliddate");
assert(d.column5 === '{"hello":"world"}');
assert(d["string#column6"] === '{"hello":"world"}');
assert(d["string#column7"] === "1234");
assert(d["number#column8"] === "abcd");
assert(d.column9 === "true");
});
csvConverter.on("end_parsed",function (){
done();
});
rs.pipe(csvConverter);
});
it ("should emit data event correctly",function (done){
var testData = __dirname + "/data/large-csv-sample.csv";
var rs = fs.createReadStream(testData);
var csvConverter = new Converter({
constructResult: false
});
var count = 0;
csvConverter.on("data", function (d) {
count++;
});
csvConverter.on("end",function (){
assert(count === 5290);
done();
});
rs.pipe(csvConverter);
});
it ("should process column with linebreaks",function (done){
var testData = __dirname + "/data/lineBreak";
var rs = fs.createReadStream(testData);
var csvConverter = new Converter({
constructResult: false
});
csvConverter.on("record_parsed",function (d){
assert(d.Period === 13);
assert(d["Apparent age"] === "Unknown");
done();
});
rs.pipe(csvConverter);
});
it ("should stream to array string",function (done){
var testData = __dirname + "/data/dataDiffDelimiter";
var rs = fs.createReadStream(testData);
var data = "";
var st = rs.pipe(new Converter({ constructResult: false, delimiter: ';', trim: true, toArrayString:true}));
st.on("data",function (d){
data += d.toString("utf8");
});
st.on("end",function (){
var obj = JSON.parse(data);
assert(obj.length === 2);
assert(obj[0].annee === 2015029);
assert(obj[1].annee === 2015028);
done();
});
});
it ("be able to ignore empty columns",function (done){
var testData = __dirname + "/data/dataIgnoreEmpty";
var rs = fs.createReadStream(testData);
var st = rs.pipe(new Converter({ignoreEmpty:true}));
st.on("end_parsed",function (res){
var j = res[0];
assert (j.col2.length === 1);
assert(j.col2[0] === "d3");
assert(j.col4.col3 === undefined);
assert(j.col4.col5 === "world");
done();
});
});
});
|
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "@angular/core", "../../util/util", "./item", "../list/list", "../../platform/platform", "./item-options"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var util_1 = require("../../util/util");
var item_1 = require("./item");
var list_1 = require("../list/list");
var platform_1 = require("../../platform/platform");
var item_options_1 = require("./item-options");
var /** @type {?} */ SWIPE_MARGIN = 30;
var /** @type {?} */ ELASTIC_FACTOR = 0.55;
var /** @type {?} */ ITEM_SIDE_FLAG_NONE = 0;
var /** @type {?} */ ITEM_SIDE_FLAG_LEFT = 1 << 0;
var /** @type {?} */ ITEM_SIDE_FLAG_RIGHT = 1 << 1;
var /** @type {?} */ ITEM_SIDE_FLAG_BOTH = ITEM_SIDE_FLAG_LEFT | ITEM_SIDE_FLAG_RIGHT;
/**
* \@name ItemSliding
* \@description
* A sliding item is a list item that can be swiped to reveal buttons. It requires
* an [Item](../Item) component as a child and a [List](../../list/List) component as
* a parent. All buttons to reveal can be placed in the `<ion-item-options>` element.
*
* \@usage
* ```html
* <ion-list>
* <ion-item-sliding #item>
* <ion-item>
* Item
* </ion-item>
* <ion-item-options side="left">
* <button ion-button (click)="favorite(item)">Favorite</button>
* <button ion-button color="danger" (click)="share(item)">Share</button>
* </ion-item-options>
*
* <ion-item-options side="right">
* <button ion-button (click)="unread(item)">Unread</button>
* </ion-item-options>
* </ion-item-sliding>
* </ion-list>
* ```
*
* ### Swipe Direction
* By default, the buttons are revealed when the sliding item is swiped from right to left,
* so the buttons are placed in the right side. But it's also possible to reveal them
* in the right side (sliding from left to right) by setting the `side` attribute
* on the `ion-item-options` element. Up to 2 `ion-item-options` can used at the same time
* in order to reveal two different sets of buttons depending the swipping direction.
*
* ```html
* <ion-item-options side="right">
* <button ion-button (click)="archive(item)">
* <ion-icon name="archive"></ion-icon>
* Archive
* </button>
* </ion-item-options>
*
* <ion-item-options side="left">
* <button ion-button (click)="archive(item)">
* <ion-icon name="archive"></ion-icon>
* Archive
* </button>
* </ion-item-options>
* ```
*
* ### Listening for events (ionDrag) and (ionSwipe)
* It's possible to know the current relative position of the sliding item by subscribing
* to the (ionDrag)` event.
*
* ```html
* <ion-item-sliding (ionDrag)="logDrag($event)">
* <ion-item>Item</ion-item>
* <ion-item-options>
* <button ion-button>Favorite</button>
* </ion-item-options>
* </ion-item-sliding>
* ```
*
* ### Button Layout
* If an icon is placed with text in the option button, by default it will
* display the icon on top of the text. This can be changed to display the icon
* to the left of the text by setting `icon-left` as an attribute on the
* `<ion-item-options>` element.
*
* ```html
* <ion-item-options icon-left>
* <button ion-button (click)="archive(item)">
* <ion-icon name="archive"></ion-icon>
* Archive
* </button>
* </ion-item-options>
*
* ```
*
*
* \@demo /docs/demos/src/item-sliding/
* @see {\@link /docs/components#lists List Component Docs}
* @see {\@link ../Item Item API Docs}
* @see {\@link ../../list/List List API Docs}
*/
var ItemSliding = (function () {
/**
* @param {?} list
* @param {?} _plt
* @param {?} _renderer
* @param {?} _elementRef
* @param {?} _zone
*/
function ItemSliding(list, _plt, _renderer, _elementRef, _zone) {
this._plt = _plt;
this._renderer = _renderer;
this._elementRef = _elementRef;
this._zone = _zone;
this._openAmount = 0;
this._startX = 0;
this._optsWidthRightSide = 0;
this._optsWidthLeftSide = 0;
this._tmr = null;
this._optsDirty = true;
this._state = 2 /* Disabled */;
/**
* \@output {event} Emitted when the sliding position changes.
* It reports the relative position.
*
* ```ts
* ondrag(item) {
* let percent = item.getSlidingPercent();
* if (percent > 0) {
* // positive
* console.log('right side');
* } else {
* // negative
* console.log('left side');
* }
* if (Math.abs(percent) > 1) {
* console.log('overscroll');
* }
* }
* ```
*
*/
this.ionDrag = new core_1.EventEmitter();
list && list.containsSlidingItem(true);
_elementRef.nativeElement.$ionComponent = this;
this.setElementClass('item-wrapper', true);
}
Object.defineProperty(ItemSliding.prototype, "_itemOptions", {
/**
* @param {?} itemOptions
* @return {?}
*/
set: function (itemOptions) {
var /** @type {?} */ sides = 0;
// Reset left and right options in case they were removed
this._leftOptions = this._rightOptions = null;
for (var _i = 0, _a = itemOptions.toArray(); _i < _a.length; _i++) {
var item = _a[_i];
if (item.isRightSide()) {
this._rightOptions = item;
sides |= ITEM_SIDE_FLAG_RIGHT;
}
else {
this._leftOptions = item;
sides |= ITEM_SIDE_FLAG_LEFT;
}
}
this._optsDirty = true;
this._sides = sides;
},
enumerable: true,
configurable: true
});
/**
* @hidden
* @return {?}
*/
ItemSliding.prototype.getOpenAmount = function () {
return this._openAmount;
};
/**
* @hidden
* @return {?}
*/
ItemSliding.prototype.getSlidingPercent = function () {
var /** @type {?} */ openAmount = this._openAmount;
if (openAmount > 0) {
return openAmount / this._optsWidthRightSide;
}
else if (openAmount < 0) {
return openAmount / this._optsWidthLeftSide;
}
else {
return 0;
}
};
/**
* @hidden
* @param {?} startX
* @return {?}
*/
ItemSliding.prototype.startSliding = function (startX) {
if (this._tmr) {
this._plt.cancelTimeout(this._tmr);
this._tmr = null;
}
if (this._openAmount === 0) {
this._optsDirty = true;
this._setState(4 /* Enabled */);
}
this._startX = startX + this._openAmount;
this.item.setElementStyle(this._plt.Css.transition, 'none');
};
/**
* @hidden
* @param {?} x
* @return {?}
*/
ItemSliding.prototype.moveSliding = function (x) {
if (this._optsDirty) {
this.calculateOptsWidth();
return;
}
var /** @type {?} */ openAmount = (this._startX - x);
switch (this._sides) {
case ITEM_SIDE_FLAG_RIGHT:
openAmount = Math.max(0, openAmount);
break;
case ITEM_SIDE_FLAG_LEFT:
openAmount = Math.min(0, openAmount);
break;
case ITEM_SIDE_FLAG_BOTH: break;
case ITEM_SIDE_FLAG_NONE: return;
default:
(void 0) /* assert */;
break;
}
if (openAmount > this._optsWidthRightSide) {
var /** @type {?} */ optsWidth = this._optsWidthRightSide;
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
}
else if (openAmount < -this._optsWidthLeftSide) {
var /** @type {?} */ optsWidth = -this._optsWidthLeftSide;
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
}
this._setOpenAmount(openAmount, false);
return openAmount;
};
/**
* @hidden
* @param {?} velocity
* @return {?}
*/
ItemSliding.prototype.endSliding = function (velocity) {
var /** @type {?} */ restingPoint = (this._openAmount > 0)
? this._optsWidthRightSide
: -this._optsWidthLeftSide;
// Check if the drag didn't clear the buttons mid-point
// and we aren't moving fast enough to swipe open
var /** @type {?} */ isResetDirection = (this._openAmount > 0) === !(velocity < 0);
var /** @type {?} */ isMovingFast = Math.abs(velocity) > 0.3;
var /** @type {?} */ isOnCloseZone = Math.abs(this._openAmount) < Math.abs(restingPoint / 2);
if (util_1.swipeShouldReset(isResetDirection, isMovingFast, isOnCloseZone)) {
restingPoint = 0;
}
this._setOpenAmount(restingPoint, true);
this.fireSwipeEvent();
return restingPoint;
};
/**
* @hidden
* @return {?}
*/
ItemSliding.prototype.fireSwipeEvent = function () {
var _this = this;
if (this._state & 32 /* SwipeRight */) {
this._zone.run(function () { return _this._rightOptions.ionSwipe.emit(_this); });
}
else if (this._state & 64 /* SwipeLeft */) {
this._zone.run(function () { return _this._leftOptions.ionSwipe.emit(_this); });
}
};
/**
* @hidden
* @return {?}
*/
ItemSliding.prototype.calculateOptsWidth = function () {
if (!this._optsDirty) {
return;
}
this._optsWidthRightSide = 0;
if (this._rightOptions) {
this._optsWidthRightSide = this._rightOptions.width();
(void 0) /* assert */;
}
this._optsWidthLeftSide = 0;
if (this._leftOptions) {
this._optsWidthLeftSide = this._leftOptions.width();
(void 0) /* assert */;
}
this._optsDirty = false;
};
/**
* @param {?} openAmount
* @param {?} isFinal
* @return {?}
*/
ItemSliding.prototype._setOpenAmount = function (openAmount, isFinal) {
var _this = this;
var /** @type {?} */ platform = this._plt;
if (this._tmr) {
platform.cancelTimeout(this._tmr);
this._tmr = null;
}
this._openAmount = openAmount;
if (isFinal) {
this.item.setElementStyle(platform.Css.transition, '');
}
else {
if (openAmount > 0) {
var /** @type {?} */ state = (openAmount >= (this._optsWidthRightSide + SWIPE_MARGIN))
? 8 /* Right */ | 32 /* SwipeRight */
: 8 /* Right */;
this._setState(state);
}
else if (openAmount < 0) {
var /** @type {?} */ state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
? 16 /* Left */ | 64 /* SwipeLeft */
: 16 /* Left */;
this._setState(state);
}
}
if (openAmount === 0) {
this._tmr = platform.timeout(function () {
_this._setState(2 /* Disabled */);
_this._tmr = null;
}, 600);
this.item.setElementStyle(platform.Css.transform, '');
return;
}
this.item.setElementStyle(platform.Css.transform, "translate3d(" + -openAmount + "px,0,0)");
var /** @type {?} */ ionDrag = this.ionDrag;
if (ionDrag.observers.length > 0) {
ionDrag.emit(this);
}
};
/**
* @param {?} state
* @return {?}
*/
ItemSliding.prototype._setState = function (state) {
if (state === this._state) {
return;
}
this.setElementClass('active-slide', (state !== 2 /* Disabled */));
this.setElementClass('active-options-right', !!(state & 8 /* Right */));
this.setElementClass('active-options-left', !!(state & 16 /* Left */));
this.setElementClass('active-swipe-right', !!(state & 32 /* SwipeRight */));
this.setElementClass('active-swipe-left', !!(state & 64 /* SwipeLeft */));
this._state = state;
};
/**
* Close the sliding item. Items can also be closed from the [List](../../list/List).
*
* The sliding item can be closed by grabbing a reference to `ItemSliding`. In the
* below example, the template reference variable `slidingItem` is placed on the element
* and passed to the `share` method.
*
* ```html
* <ion-list>
* <ion-item-sliding #slidingItem>
* <ion-item>
* Item
* </ion-item>
* <ion-item-options>
* <button ion-button (click)="share(slidingItem)">Share</button>
* </ion-item-options>
* </ion-item-sliding>
* </ion-list>
* ```
*
* ```ts
* import { Component } from '\@angular/core';
* import { ItemSliding } from 'ionic-angular';
*
* \@Component({...})
* export class MyClass {
* constructor() { }
*
* share(slidingItem: ItemSliding) {
* slidingItem.close();
* }
* }
* ```
* @return {?}
*/
ItemSliding.prototype.close = function () {
this._setOpenAmount(0, true);
};
/**
* @hidden
* @param {?} cssClass
* @param {?} shouldAdd
* @return {?}
*/
ItemSliding.prototype.setElementClass = function (cssClass, shouldAdd) {
this._renderer.setElementClass(this._elementRef.nativeElement, cssClass, shouldAdd);
};
return ItemSliding;
}());
ItemSliding.decorators = [
{ type: core_1.Component, args: [{
selector: 'ion-item-sliding',
template: "\n <ng-content select=\"ion-item,[ion-item]\"></ng-content>\n <ng-content select=\"ion-item-options\"></ng-content>\n ",
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
encapsulation: core_1.ViewEncapsulation.None
},] },
];
/**
* @nocollapse
*/
ItemSliding.ctorParameters = function () { return [
{ type: list_1.List, decorators: [{ type: core_1.Optional },] },
{ type: platform_1.Platform, },
{ type: core_1.Renderer, },
{ type: core_1.ElementRef, },
{ type: core_1.NgZone, },
]; };
ItemSliding.propDecorators = {
'item': [{ type: core_1.ContentChild, args: [item_1.Item,] },],
'ionDrag': [{ type: core_1.Output },],
'_itemOptions': [{ type: core_1.ContentChildren, args: [core_1.forwardRef(function () { return item_options_1.ItemOptions; }),] },],
};
exports.ItemSliding = ItemSliding;
function ItemSliding_tsickle_Closure_declarations() {
/** @type {?} */
ItemSliding.decorators;
/**
* @nocollapse
* @type {?}
*/
ItemSliding.ctorParameters;
/** @type {?} */
ItemSliding.propDecorators;
/** @type {?} */
ItemSliding.prototype._openAmount;
/** @type {?} */
ItemSliding.prototype._startX;
/** @type {?} */
ItemSliding.prototype._optsWidthRightSide;
/** @type {?} */
ItemSliding.prototype._optsWidthLeftSide;
/** @type {?} */
ItemSliding.prototype._sides;
/** @type {?} */
ItemSliding.prototype._tmr;
/** @type {?} */
ItemSliding.prototype._leftOptions;
/** @type {?} */
ItemSliding.prototype._rightOptions;
/** @type {?} */
ItemSliding.prototype._optsDirty;
/** @type {?} */
ItemSliding.prototype._state;
/**
* @hidden
* @type {?}
*/
ItemSliding.prototype.item;
/**
* \@output {event} Emitted when the sliding position changes.
* It reports the relative position.
*
* ```ts
* ondrag(item) {
* let percent = item.getSlidingPercent();
* if (percent > 0) {
* // positive
* console.log('right side');
* } else {
* // negative
* console.log('left side');
* }
* if (Math.abs(percent) > 1) {
* console.log('overscroll');
* }
* }
* ```
*
* @type {?}
*/
ItemSliding.prototype.ionDrag;
/** @type {?} */
ItemSliding.prototype._plt;
/** @type {?} */
ItemSliding.prototype._renderer;
/** @type {?} */
ItemSliding.prototype._elementRef;
/** @type {?} */
ItemSliding.prototype._zone;
}
});
//# sourceMappingURL=item-sliding.js.map
|
/* ========================================================================
* xeditable.js
* Page/renders: forms-xeditable.html
* Plugins used: x-editable
* ======================================================================== */
'use strict';
(function (factory) {
if (typeof define === 'function' && define.amd) {
define([
'xeditable'
], factory);
} else {
factory();
}
}(function () {
$(function () {
// text
// ================================
$('#xe_username').editable({
title: 'Enter username'
});
// textarea
// ================================
$('#xe_comments').editable({
title: 'Enter comments',
rows: 5
});
// select
// ================================
$('#xe_status').editable({
value: 2,
source: [
{value: 1, text: 'Active'},
{value: 2, text: 'Blocked'},
{value: 3, text: 'Deleted'}
]
});
// Checklist
// ================================
$('#xe_checklist').editable({
value: [1],
source: [
{value: 1, text: 'option1'},
{value: 2, text: 'option2'},
{value: 3, text: 'option3'}
]
});
// Combodate
// ================================
$('#xe_combodate').editable({
format: 'YYYY-MM-DD',
viewformat: 'DD.MM.YYYY',
template: 'D / MMMM / YYYY',
combodate: {
minYear: 2000,
maxYear: 2015,
minuteStep: 1
}
});
// Dateui
// ================================
$('#xe_dateui').editable({
format: 'yyyy-mm-dd',
viewformat: 'dd/mm/yyyy',
datepicker: {
weekStart: 1
}
});
// Typehead
// ================================
$('#xe_typehead').editable({
value: 'ru',
typeahead: {
name: 'country',
local: [
{value: 'ru', tokens: ['Russia']},
{value: 'gb', tokens: ['Great Britain']},
{value: 'us', tokens: ['United States']}
],
template: function(item) {
return item.tokens[0] + ' (' + item.value + ')';
}
}
});
});
}));
|
/* global angular */
'use strict';
angular.module('storm')
.config(['localStorageServiceProvider', function(localStorageServiceProvider) {
localStorageServiceProvider.setPrefix('Storm');
}]);
|
var fs = require('fs');
var coffee = require('coffee-script');
var cjsx = require('coffee-react-transform');
var transformed = false;
function transform() {
if (transformed) {
return;
}
require.extensions['.coffee'] = require.extensions['.cjsx'] = function(module, filename) {
var src = fs.readFileSync(filename, {encoding: 'utf8'});
try {
src = coffee.compile(cjsx(src), { 'bare': true });
} catch (e) {
throw new Error('Error transforming ' + filename + ' from CJSX: ' + e.toString());
}
module._compile(src, filename);
};
transformed = true;
}
module.exports = {
transform: transform
};
|
function TextCreator( totalSize ){
totalSize = totalSize || 100;
this.params = {
size: totalSize ,
type: "20pt GeoSans",
color: "rgba( 255 , 255 , 255 , 0.95 )",
crispness: 1,
margin: totalSize / 10,
square: false
}
this.font = "GeoSans";
}
TextCreator.prototype.createTexture = function( string , params ){
var canvas = document.createElement('canvas');
/*canvas.style.position = 'fixed';
canvas.style.zIndex = '999';
document.body.appendChild( canvas );*/
var ctx = canvas.getContext( '2d' );
var params = {
color: this.params.color,
size: this.params.size,
crispness: this.params.crispness,
square: this.params.square,
margin: this.params.size / 10
}
var size = params.size;
var color = params.color;
// This is the factor the canvas will be scaled
// up by, which basically equates to 'crispness'
var scaleFactor = params.crispness;
// To make sure that the text is crisp,
// need to draw it large and scale down
var fullSize = scaleFactor * size;
// If you want a margin, you can define it in the params
if( !params.margin )
margin = size*.5;
else
margin = params.margin;
// Gets how wide the tesxt is
ctx.font = fullSize + "pt " + this.font;
var textWidth = ctx.measureText(string).width;
// Can choose to make a square texture if we want to
if( !params.square ){
canvas.width = textWidth + margin;
canvas.height = fullSize + margin;
}else{
canvas.width = textWidth + margin;
canvas.height = textWidth + margin;
}
ctx.font = fullSize + "pt " + this.font;
// Gives us a background instead of transparent background
if( params.backgroundColor ) {
ctx.fillStyle = params.backgroundColor;
ctx.fillRect(
canvas.width / 2 - textWidth / 2 - margin / 2,
canvas.height / 2 - fullSize / 2 - + margin / 2,
textWidth + margin,
fullSize + margin
);
}
// Makes sure our text is centered
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.fillStyle = color;
ctx.fillText(string, canvas.width / 2, canvas.height / 2);
// Creates a texture
var texture = new THREE.Texture(canvas);
texture.scaledWidth = canvas.width;
texture.scaledHeight = canvas.height;
if( texture.scaledWidth > texture.scaleHeight ){
texture.scaledWidth /= texture.scaledWidth;
texture.scaledHeight /= texture.scaledWidth;
}else{
texture.scaledWidth /= texture.scaledHeight;
texture.scaledHeight /= texture.scaledHeight;
}
texture.needsUpdate = true;
return texture;
}
TextCreator.prototype.createMesh = function( string , params ){
var params = {
color: this.params.color,
size: this.params.size,
crispness: this.params.crispness
}
var texture = this.createTexture( string , params );
var material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
side: THREE.DoubleSide,
//blending: THREE.AdditiveBlending,
opacity: .3,
color: 0xffffFF
});
var geo = new THREE.PlaneGeometry(
texture.scaledWidth / params.crispness,
texture.scaledHeight / params.crispness
);
var mesh = new THREE.Mesh(geo, material);
mesh.scale.multiplyScalar( params.size );
mesh.scaledWidth = texture.scaledWidth;
mesh.scaledHeight = texture.scaledHeight;
// Assigning the texture
mesh.string = string;
return mesh;
}
|
/* global location */
/* Centralized place to reference utilities since utils is exposed to the user. */
var debug = require('./debug');
var deepAssign = require('deep-assign');
var device = require('./device');
var objectAssign = require('object-assign');
var objectPool = require('./object-pool');
var warn = debug('utils:warn');
module.exports.bind = require('./bind');
module.exports.coordinates = require('./coordinates');
module.exports.debug = debug;
module.exports.device = device;
module.exports.entity = require('./entity');
module.exports.forceCanvasResizeSafariMobile = require('./forceCanvasResizeSafariMobile');
module.exports.material = require('./material');
module.exports.objectPool = objectPool;
module.exports.split = require('./split').split;
module.exports.styleParser = require('./styleParser');
module.exports.trackedControls = require('./tracked-controls');
module.exports.checkHeadsetConnected = function () {
warn('`utils.checkHeadsetConnected` has moved to `utils.device.checkHeadsetConnected`');
return device.checkHeadsetConnected(arguments);
};
module.exports.isGearVR = function () {
warn('`utils.isGearVR` has moved to `utils.device.isGearVR`');
return device.isGearVR(arguments);
};
module.exports.isIOS = function () {
warn('`utils.isIOS` has moved to `utils.device.isIOS`');
return device.isIOS(arguments);
};
module.exports.isMobile = function () {
warn('`utils.isMobile has moved to `utils.device.isMobile`');
return device.isMobile(arguments);
};
/**
* Returns throttle function that gets called at most once every interval.
*
* @param {function} functionToThrottle
* @param {number} minimumInterval - Minimal interval between calls (milliseconds).
* @param {object} optionalContext - If given, bind function to throttle to this context.
* @returns {function} Throttled function.
*/
module.exports.throttle = function (functionToThrottle, minimumInterval, optionalContext) {
var lastTime;
if (optionalContext) {
functionToThrottle = module.exports.bind(functionToThrottle, optionalContext);
}
return function () {
var time = Date.now();
var sinceLastTime = typeof lastTime === 'undefined' ? minimumInterval : time - lastTime;
if (typeof lastTime === 'undefined' || (sinceLastTime >= minimumInterval)) {
lastTime = time;
functionToThrottle.apply(null, arguments);
}
};
};
/**
* Returns throttle function that gets called at most once every interval.
* Uses the time/timeDelta timestamps provided by the global render loop for better perf.
*
* @param {function} functionToThrottle
* @param {number} minimumInterval - Minimal interval between calls (milliseconds).
* @param {object} optionalContext - If given, bind function to throttle to this context.
* @returns {function} Throttled function.
*/
module.exports.throttleTick = function (functionToThrottle, minimumInterval, optionalContext) {
var lastTime;
if (optionalContext) {
functionToThrottle = module.exports.bind(functionToThrottle, optionalContext);
}
return function (time, delta) {
var sinceLastTime = typeof lastTime === 'undefined' ? delta : time - lastTime;
if (typeof lastTime === 'undefined' || (sinceLastTime >= minimumInterval)) {
lastTime = time;
functionToThrottle(time, sinceLastTime);
}
};
};
/**
* Returns debounce function that gets called only once after a set of repeated calls.
*
* @param {function} functionToDebounce
* @param {number} wait - Time to wait for repeated function calls (milliseconds).
* @param {boolean} immediate - Calls the function immediately regardless of if it should be waiting.
* @returns {function} Debounced function.
*/
module.exports.debounce = function (func, wait, immediate) {
var timeout;
return function () {
var context = this;
var args = arguments;
var later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};
/**
* Mix the properties of source object(s) into a destination object.
*
* @param {object} dest - The object to which properties will be copied.
* @param {...object} source - The object(s) from which properties will be copied.
*/
module.exports.extend = objectAssign;
module.exports.extendDeep = deepAssign;
module.exports.clone = function (obj) {
return JSON.parse(JSON.stringify(obj));
};
/**
* Checks if two values are equal.
* Includes objects and arrays and nested objects and arrays.
* Try to keep this function performant as it will be called often to see if a component
* should be updated.
*
* @param {object} a - First object.
* @param {object} b - Second object.
* @returns {boolean} Whether two objects are deeply equal.
*/
var deepEqual = (function () {
var arrayPool = objectPool.createPool(function () { return []; });
return function (a, b) {
var key;
var keysA;
var keysB;
var i;
var valA;
var valB;
// If not objects or arrays, compare as values.
if (a === undefined || b === undefined || a === null || b === null ||
!(a && b && (a.constructor === Object && b.constructor === Object) ||
(a.constructor === Array && b.constructor === Array))) {
return a === b;
}
// Different number of keys, not equal.
keysA = arrayPool.use();
keysB = arrayPool.use();
keysA.length = 0;
keysB.length = 0;
for (key in a) { keysA.push(key); }
for (key in b) { keysB.push(key); }
if (keysA.length !== keysB.length) {
arrayPool.recycle(keysA);
arrayPool.recycle(keysB);
return false;
}
// Return `false` at the first sign of inequality.
for (i = 0; i < keysA.length; ++i) {
valA = a[keysA[i]];
valB = b[keysA[i]];
// Check nested array and object.
if ((typeof valA === 'object' || typeof valB === 'object') ||
(Array.isArray(valA) && Array.isArray(valB))) {
if (valA === valB) { continue; }
if (!deepEqual(valA, valB)) {
arrayPool.recycle(keysA);
arrayPool.recycle(keysB);
return false;
}
} else if (valA !== valB) {
arrayPool.recycle(keysA);
arrayPool.recycle(keysB);
return false;
}
}
arrayPool.recycle(keysA);
arrayPool.recycle(keysB);
return true;
};
})();
module.exports.deepEqual = deepEqual;
/**
* Computes the difference between two objects.
*
* @param {object} a - First object to compare (e.g., oldData).
* @param {object} b - Second object to compare (e.g., newData).
* @returns {object}
* Difference object where set of keys note which values were not equal, and values are
* `b`'s values.
*/
module.exports.diff = (function () {
var keys = [];
return function (a, b, targetObject) {
var aVal;
var bVal;
var bKey;
var diff;
var key;
var i;
var isComparingObjects;
diff = targetObject || {};
// Collect A keys.
keys.length = 0;
for (key in a) { keys.push(key); }
if (!b) { return diff; }
// Collect B keys.
for (bKey in b) {
if (keys.indexOf(bKey) === -1) {
keys.push(bKey);
}
}
for (i = 0; i < keys.length; i++) {
key = keys[i];
aVal = a[key];
bVal = b[key];
isComparingObjects = aVal && bVal &&
aVal.constructor === Object && bVal.constructor === Object;
if ((isComparingObjects && !deepEqual(aVal, bVal)) ||
(!isComparingObjects && aVal !== bVal)) {
diff[key] = bVal;
}
}
return diff;
};
})();
/**
* Returns whether we should capture this keyboard event for keyboard shortcuts.
* @param {Event} event Event object.
* @returns {Boolean} Whether the key event should be captured.
*/
module.exports.shouldCaptureKeyEvent = function (event) {
if (event.metaKey) { return false; }
return document.activeElement === document.body;
};
/**
* Splits a string into an array based on a delimiter.
*
* @param {string=} [str=''] Source string
* @param {string=} [delimiter=' '] Delimiter to use
* @returns {array} Array of delimited strings
*/
module.exports.splitString = function (str, delimiter) {
if (typeof delimiter === 'undefined') { delimiter = ' '; }
// First collapse the whitespace (or whatever the delimiter is).
var regex = new RegExp(delimiter, 'g');
str = (str || '').replace(regex, delimiter);
// Then split.
return str.split(delimiter);
};
/**
* Extracts data from the element given an object that contains expected keys.
*
* @param {Element} Source element.
* @param {Object} [defaults={}] Object of default key-value pairs.
* @returns {Object}
*/
module.exports.getElData = function (el, defaults) {
defaults = defaults || {};
var data = {};
Object.keys(defaults).forEach(copyAttribute);
function copyAttribute (key) {
if (el.hasAttribute(key)) {
data[key] = el.getAttribute(key);
}
}
return data;
};
/**
* Retrieves querystring value.
* @param {String} name Name of querystring key.
* @return {String} Value
*/
module.exports.getUrlParameter = function (name) {
// eslint-disable-next-line no-useless-escape
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
/**
* Detects whether context is within iframe.
*/
module.exports.isIframed = function () {
return window.top !== window.self;
};
/**
* Finds all elements under the element that have the isScene
* property set to true
*/
module.exports.findAllScenes = function (el) {
var matchingElements = [];
var allElements = el.getElementsByTagName('*');
for (var i = 0, n = allElements.length; i < n; i++) {
if (allElements[i].isScene) {
// Element exists with isScene set.
matchingElements.push(allElements[i]);
}
}
return matchingElements;
};
// Must be at bottom to avoid circular dependency.
module.exports.srcLoader = require('./src-loader');
|
define(['angular', './controllers', 'moment', './expenses/employeeExpensesModule'], function(angular, controllers, moment) {
'use strict';
var employee = angular.module('trackr.employee', ['trackr.employee.expenses']);
employee.config(['$stateProvider', function($stateProvider) {
$stateProvider
.state('app.trackr.employee', {
url: '/employee',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.TITLE',
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/employee.tpl.html'
}
}
})
.state('app.trackr.employee.self', {
url: '/self',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.TEXT_EDIT_PROFILE',
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/self.tpl.html',
controller: 'trackr.employee.controllers.self'
}
}
})
.state('app.trackr.employee.timesheet', {
url: '/timesheet',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.TEXT_EDIT_TIMESHEET',
resolve: {
holidays: ['employee', 'Restangular', function(employee, Restangular) {
var start = moment().startOf('year');
var end = moment().endOf('year').add('month', 1);
return Restangular.allUrl('holidays', 'api/holidays/search/findByFederalStateAndDayBetween')
.getList({
state: employee.federalState.name,
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD')
});
}]
},
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/timesheet/timesheet.tpl.html',
controller: 'trackr.employee.controllers.timesheet'
}
}
})
.state('app.trackr.employee.timesheet.overview', {
url: '/overview',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.TEXT_TIMESHEET_OVERVIEW',
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/timesheet/timesheetOverview.tpl.html',
controller: 'trackr.employee.controllers.timesheet-overview'
}
}
})
.state('app.trackr.employee.vacation', {
url: '/vacation',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.TEXT_VACATION',
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/vacation/list.tpl.html',
controller: 'trackr.employee.controllers.vacation-list'
},
'new@app.trackr.employee.vacation': {
templateUrl: 'src/modules/trackr/employee/vacation/new.tpl.html',
controller: 'trackr.employee.controllers.vacation-new'
}
}
})
.state('app.trackr.employee.address_book', {
url: '/address_book',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.ADDRESS_BOOK.TITLE',
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/address_book/address_book.tpl.html',
controller: 'trackr.employee.controllers.address_book'
}
}
})
.state('app.trackr.employee.sick-days', {
url: '/sick-days',
breadcrumbTranslateCode: 'PAGES.EMPLOYEE.SICK_DAYS.TITLE',
views: {
'center@app': {
templateUrl: 'src/modules/trackr/employee/sick_days/sick-days.tpl.html',
controller: 'trackr.employee.controllers.sick-days'
}
}
});
}]);
controllers.init(employee);
return employee;
});
|
// This file is intentionally left empty. See .externs.js.
|
(function () {
'use strict';
var module = angular.module('fim.base');
module.factory('i18n', function () {
var PKAnnouncementBlockPassed = true;
var messages = {
"recipient_unknown": "The recipient account is an unknown account, meaning it has never had an incoming or outgoing transaction. Please double check your recipient address before submitting.",
"recipient_unknown_pka": "The recipient account is an unknown account, meaning it has never had an incoming or outgoing transaction. To submit this request you must supply the recipient public key also.",
// "recipient_no_public_key_pka": "The recipient account does not have a public key, meaning it has never had an outgoing transaction. The account has a balance of __nxt__ __symbol__. To submit this request you must supply the recipient public key also.",
"recipient_malformed": "The recipient account is malformed, please adjust.",
"recipient_info": "The recipient account has a public key and a balance of __nxt__ __symbol__.",
"recipient_no_public_key": "The recipient account does not have a public key, meaning it has never had an outgoing transaction. The account has a balance of __nxt__ __symbol__. Please double check your recipient address before submitting.",
"recipient_problem": "There is a problem with the recipient account: __problem__",
"recipient_malformed_suggestion": "The recipient address is malformed, did you mean __recipient__",
"recipient_malformed_suggestion_plural": "The recipient address is malformed, did you mean any of the following: __multiple__",
"error_signature_verification_client": "Could not verify signature (client side).",
"error_signature_verification_server": "Could not verify signature (server side).",
};
return {
format: function (id, args) {
if (PKAnnouncementBlockPassed && ((id+'_pka') in messages)) {
id = id+'_pka';
}
var msg = messages[id];
if (args) {
for (var x in args) {
msg = msg.replace(x, args[x]);
}
}
return msg;
}
};
});
})();
|
/**
* Middleware dependencies
*
* This middleware depends on the following to be run first:
*
* - req.login() (passport)
* - determineProvider
*/
/**
* Module dependencies
*/
var Role = require('../models/Role')
var mailer = require('../boot/mailer').getMailer()
var settings = require('../boot/settings')
var url = require('url')
/**
* Require verified email middleware
*/
module.exports = function (options) {
options = options || {}
options = {
force: options.force || false,
view: options.view || 'requireVerifiedEmail',
locals: options.locals || {}
}
return function requireVerifiedEmail (req, res, next) {
Role.listByUsers(req.user, function (err, roles) {
if (err) { return next(err) }
var isAuthority = roles && roles.some(function (role) {
return role.name === 'authority'
})
if (req.user.emailVerified || isAuthority) {
next()
} else if (!req.provider.emailVerification.enable) {
next()
} else if (!options.force && !req.provider.emailVerification.require) {
next()
} else {
var resendURL = url.parse(settings.issuer)
resendURL.pathname = 'email/resend'
resendURL.query = {
email: req.user.email
}
if (req.connectParams) {
resendURL.query.redirect_uri = req.connectParams.redirect_uri
resendURL.query.client_id = req.connectParams.client_id
resendURL.query.response_type = req.connectParams.response_type
resendURL.query.scope = req.connectParams.scope
}
var existingUserMsg = 'E-mail verification is required to proceed'
var newUserMsg = 'Congratulations on creating your user account! ' +
"All that's left now is to verify your e-mail."
var isNewUser = req.flash('isNewUser').indexOf(true) !== -1
var locals = {
error: options.locals.error === undefined
? (!isNewUser ? existingUserMsg : undefined) : options.locals.error,
message: options.locals.message === undefined
? (isNewUser ? newUserMsg : undefined) : options.locals.message,
from: options.locals.from || mailer.from,
resendURL: options.locals.resendURL || url.format(resendURL)
}
res.render(options.view, locals)
}
})
}
}
|
import React, { PropTypes, Component } from 'react'
import { Link } from 'react-router'
export default class MenuListItem extends Component {
static propTypes = {
icon: PropTypes.string.isRequired,
isExternal: PropTypes.bool,
link: PropTypes.string.isRequired,
text: PropTypes.string.isRequired
};
static defaultProps = { isExternal: false };
render () {
return (
<li className="pure-menu-item">
{this.renderLink()}
</li>
)
}
renderLink () {
if (this.props.isExternal)
return (
<a href={this.props.link} target="_blank" className="pure-menu-link">
<i className={this.props.icon}></i> {this.props.text}
</a>
)
else
return (
<Link to={this.props.link} className="pure-menu-link">
<i className={this.props.icon}></i> {this.props.text}
</Link>
)
}
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
When "continue Identifier" is evaluated Identifier must be label in the
label set of an enclosing (but not crossing function boundaries)
IterationStatement
es5id: 12.7_A5_T3
description: Identifier is within loop label
negative: SyntaxError
---*/
LABEL_OUT : var x=0, y=0;
LABEL_DO_LOOP : do {
LABEL_IN : x++;
if(x===10)break;
continue LABEL_IN;
LABEL_IN_2 : y++;
function IN_DO_FUNC(){}
} while(0);
LABEL_ANOTHER_LOOP : do {
;
} while(0);
function OUT_FUNC(){}
|
// This file has been autogenerated.
exports.setEnvironment = function() {
process.env['AZURE_TEST_LOCATION'] = 'West US';
process.env['AZURE_SUBSCRIPTION_ID'] = 'b4871d65-b439-4433-8702-08fa2cc15808';
};
exports.scopes = [[function (nock) {
var result =
nock('http://management.azure.com:443')
.get('/subscriptions/b4871d65-b439-4433-8702-08fa2cc15808/resourceGroups/cdnTestGroup7477/providers/Microsoft.Cdn/profiles?api-version=2016-04-02')
.reply(200, "{\r\n \"value\":[\r\n \r\n ]\r\n}", { 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-length': '28',
'content-type': 'application/json; odata.metadata=minimal; odata.streaming=true',
expires: '-1',
'x-ms-request-id': '961de473-28b5-4486-b756-299f3bf3a07a',
'x-ms-client-request-id': 'ceaf0a4b-a28d-4704-b169-d726b5c6da54',
'odata-version': '4.0',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
server: 'Microsoft-IIS/8.5',
'x-aspnet-version': '4.0.30319',
'x-powered-by': 'ASP.NET',
'x-ms-ratelimit-remaining-subscription-reads': '14991',
'x-ms-correlation-request-id': 'db314f6e-a1e0-4c9d-a5d5-6c7f18148c0b',
'x-ms-routing-request-id': 'CENTRALUS:20160511T223954Z:db314f6e-a1e0-4c9d-a5d5-6c7f18148c0b',
date: 'Wed, 11 May 2016 22:39:54 GMT',
connection: 'close' });
return result; },
function (nock) {
var result =
nock('https://management.azure.com:443')
.get('/subscriptions/b4871d65-b439-4433-8702-08fa2cc15808/resourceGroups/cdnTestGroup7477/providers/Microsoft.Cdn/profiles?api-version=2016-04-02')
.reply(200, "{\r\n \"value\":[\r\n \r\n ]\r\n}", { 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-length': '28',
'content-type': 'application/json; odata.metadata=minimal; odata.streaming=true',
expires: '-1',
'x-ms-request-id': '961de473-28b5-4486-b756-299f3bf3a07a',
'x-ms-client-request-id': 'ceaf0a4b-a28d-4704-b169-d726b5c6da54',
'odata-version': '4.0',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
server: 'Microsoft-IIS/8.5',
'x-aspnet-version': '4.0.30319',
'x-powered-by': 'ASP.NET',
'x-ms-ratelimit-remaining-subscription-reads': '14991',
'x-ms-correlation-request-id': 'db314f6e-a1e0-4c9d-a5d5-6c7f18148c0b',
'x-ms-routing-request-id': 'CENTRALUS:20160511T223954Z:db314f6e-a1e0-4c9d-a5d5-6c7f18148c0b',
date: 'Wed, 11 May 2016 22:39:54 GMT',
connection: 'close' });
return result; }]];
|
YUI.add('series-line-stacked', function (Y, NAME) {
/**
* Provides functionality for creatiing a stacked line series.
*
* @module charts
* @submodule series-line-stacked
*/
/**
* StackedLineSeries creates line graphs in which the different series are stacked along a value axis
* to indicate their contribution to a cumulative total.
*
* @class StackedLineSeries
* @constructor
* @extends LineSeries
* @uses StackingUtil
* @param {Object} config (optional) Configuration parameters.
* @submodule series-line-stacked
*/
Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], {
/**
* @protected
*
* Calculates the coordinates for the series. Overrides base implementation.
*
* @method setAreaData
*/
setAreaData: function()
{
Y.StackedLineSeries.superclass.setAreaData.apply(this);
this._stackCoordinates.apply(this);
}
}, {
ATTRS: {
/**
* Read-only attribute indicating the type of series.
*
* @attribute type
* @type String
* @default stackedLine
*/
type: {
value:"stackedLine"
}
}
});
}, 'patched-v3.18.0', {"requires": ["series-stacked", "series-line"]});
|
.ɵɵelementStart(0, "div");\n // SOURCE: "/ng_if_simple.ts" <div *
…
.ɵɵtext(1);\n // SOURCE: "/ng_if_simple.ts" {{ name }}
…
// TODO: Work out how to fix the broken segment for the last item in a template
.ɵɵelem // SOURCE: "/ng_if_simple.ts" </div>'
…
.ɵɵtextInterpolate(ctx_r0.name);\n }\n}\n\n // SOURCE: "/ng_if_simple.ts" {{ name }}
…
.ɵɵtemplate(0, TestCmp_div_0_Template, 2, 1, "div", 0) // SOURCE: "/ng_if_simple.ts" <div *
…
.ɵɵproperty("ngIf", ctx.showMessage()) // SOURCE: "/ng_if_simple.ts" ngIf="showMessage()">
|
Package.describe({
name: 'rocketchat:ui',
version: '0.1.0',
// Brief, one-line summary of the package.
summary: '',
// URL to the Git repository containing the source code for this package.
git: '',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
documentation: 'README.md'
});
Package.onUse(function(api) {
api.use([
'accounts-base',
'mongo',
'session',
'jquery',
'tracker',
'reactive-var',
'ecmascript',
'templating',
'coffeescript',
'underscore',
'rocketchat:lib',
'raix:push',
'raix:ui-dropped-event'
]);
api.use('kadira:flow-router', 'client');
// LIB FILES
api.addFiles('lib/getAvatarUrlFromUsername.coffee');
api.addFiles('lib/accountBox.coffee', 'client');
api.addFiles('lib/accounts.coffee', 'client');
api.addFiles('lib/avatar.coffee', 'client');
api.addFiles('lib/chatMessages.coffee', 'client');
api.addFiles('lib/collections.coffee', 'client');
api.addFiles('lib/customEventPolyfill.js', 'client');
api.addFiles('lib/fileUpload.coffee', 'client');
api.addFiles('lib/fireEvent.js', 'client');
api.addFiles('lib/iframeCommands.js', 'client');
api.addFiles('lib/menu.coffee', 'client');
api.addFiles('lib/modal.coffee', 'client');
api.addFiles('lib/Modernizr.js', 'client');
api.addFiles('lib/msgTyping.coffee', 'client');
api.addFiles('lib/notification.coffee', 'client');
api.addFiles('lib/parentTemplate.js', 'client');
api.addFiles('lib/readMessages.coffee', 'client');
api.addFiles('lib/rocket.coffee', 'client');
api.addFiles('lib/RoomHistoryManager.coffee', 'client');
api.addFiles('lib/RoomManager.coffee', 'client');
api.addFiles('lib/sideNav.coffee', 'client');
api.addFiles('lib/tapi18n.coffee', 'client');
api.addFiles('lib/textarea-autogrow.js', 'client');
api.addFiles('lib/codeMirror/codeMirror.js', 'client');
// LIB CORDOVA
api.addFiles('lib/cordova/facebook-login.coffee', 'client');
api.addFiles('lib/cordova/keyboard-fix.coffee', 'client');
api.addFiles('lib/cordova/push.coffee', 'client');
api.addFiles('lib/cordova/urls.coffee', 'client');
api.addFiles('lib/cordova/user-state.js', 'client');
// LIB RECORDERJS
api.addFiles('lib/recorderjs/audioRecorder.coffee', 'client');
api.addFiles('lib/recorderjs/videoRecorder.coffee', 'client');
api.addFiles('lib/recorderjs/recorder.js', 'client');
// TEXTAREA CURSOR MANAGEMENT
api.addFiles('lib/textarea-cursor/set-cursor-position.js', 'client');
// TEMPLATE FILES
api.addFiles('views/cmsPage.html', 'client');
api.addFiles('views/fxos.html', 'client');
api.addFiles('views/modal.html', 'client');
api.addFiles('views/404/roomNotFound.html', 'client');
api.addFiles('views/404/invalidSecretURL.html', 'client');
api.addFiles('views/app/audioNotification.html', 'client');
api.addFiles('views/app/burger.html', 'client');
api.addFiles('views/app/home.html', 'client');
api.addFiles('views/app/notAuthorized.html', 'client');
api.addFiles('views/app/pageContainer.html', 'client');
api.addFiles('views/app/pageSettingsContainer.html', 'client');
api.addFiles('views/app/privateHistory.html', 'client');
api.addFiles('views/app/room.html', 'client');
api.addFiles('views/app/roomSearch.html', 'client');
api.addFiles('views/app/secretURL.html', 'client');
api.addFiles('views/app/userSearch.html', 'client');
api.addFiles('views/app/videoCall/videoButtons.html', 'client');
api.addFiles('views/app/videoCall/videoCall.html', 'client');
api.addFiles('views/app/photoswipe.html', 'client');
api.addFiles('views/cmsPage.coffee', 'client');
api.addFiles('views/fxos.coffee', 'client');
api.addFiles('views/modal.coffee', 'client');
api.addFiles('views/404/roomNotFound.coffee', 'client');
api.addFiles('views/app/burger.coffee', 'client');
api.addFiles('views/app/home.coffee', 'client');
api.addFiles('views/app/mobileMessageMenu.js', 'client');
api.addFiles('views/app/privateHistory.coffee', 'client');
api.addFiles('views/app/room.coffee', 'client');
api.addFiles('views/app/roomSearch.coffee', 'client');
api.addFiles('views/app/secretURL.coffee', 'client');
api.addFiles('views/app/videoCall/videoButtons.coffee', 'client');
api.addFiles('views/app/videoCall/videoCall.coffee', 'client');
api.addFiles('views/app/photoswipe.js', 'client');
});
|
/*!
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.5.3
*
* Copyright KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 07.11.2018
*/
(function (global, factory) {
if (typeof define === 'function' && define.amd)
define(function() { return factory(global, global.document, undefined); });
else if (typeof module === 'object' && typeof module.exports === 'object')
module.exports = factory(global, global.document, undefined);
else
factory(global, global.document, undefined);
}(typeof window !== 'undefined' ? window : this,
function(window, document, undefined) {
'use strict';
var PLUGINNAME = 'OverlayScrollbars';
var TYPES = {
o : 'object',
f : 'function',
a : 'array',
s : 'string',
b : 'boolean',
n : 'number',
u : 'undefined',
z : 'null'
//d : 'date',
//e : 'error',
//r : 'regexp',
//y : 'symbol'
};
var LEXICON = {
c : 'class',
s : 'style',
i : 'id',
l : 'length',
p : 'prototype',
oH : 'offsetHeight',
cH : 'clientHeight',
sH : 'scrollHeight',
oW : 'offsetWidth',
cW : 'clientWidth',
sW : 'scrollWidth'
};
var COMPATIBILITY = {
/**
* Gets the current window width.
* @returns {Number|number} The current window width in pixel.
*/
wW: function() {
return window.innerWidth || document.documentElement[LEXICON.cW] || document.body[LEXICON.cW];
},
/**
* Gets the current window height.
* @returns {Number|number} The current window height in pixel.
*/
wH: function() {
return window.innerHeight || document.documentElement[LEXICON.cH] || document.body[LEXICON.cH];
},
/**
* Gets the MutationObserver Object or undefined if not supported.
* @returns {MutationObserver|*|undefined} The MutationsObserver Object or undefined.
*/
mO: function() {
return window.MutationObserver || window.WebKitMutationObserver || window.WebkitMutationObserver || window.MozMutationObserver || undefined;
},
/**
* Gets the ResizeObserver Object or undefined if not supported.
* @returns {MutationObserver|*|undefined} The ResizeObserver Object or undefined.
*/
rO: function() {
return window.ResizeObserver || window.WebKitResizeObserver || window.WebkitResizeObserver || window.MozResizeObserver || undefined;
},
/**
* Gets the RequestAnimationFrame method or it's corresponding polyfill.
* @returns {*|Function} The RequestAnimationFrame method or it's corresponding polyfill.
*/
rAF: function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (func) {
return window.setTimeout(func, 1000 / 60);
};
},
/**
* Gets the CancelAnimationFrame method or it's corresponding polyfill.
* @returns {*|Function} The CancelAnimationFrame method or it's corresponding polyfill.
*/
cAF: function() {
return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (id) {
return window.clearTimeout(id);
};
},
/**
* Gets the current time.
* @returns {number} The current time.
*/
now: function() {
return Date.now() || new Date().getTime();
},
/**
* Stops the propagation of the given event.
* @param event The event of which the propagation shall be stoped.
*/
stpP: function(event) {
if(event.stopPropagation)
event.stopPropagation();
else
event.cancelBubble = true;
},
/**
* Prevents the default action of the given event.
* @param event The event of which the default action shall be prevented.
*/
prvD: function(event) {
if(event.preventDefault && event.cancelable)
event.preventDefault();
else
event.returnValue = false;
},
/**
* Gets the pageX and pageY values of the given mouse event.
* @param event The mouse event of which the pageX and pageX shall be got.
* @returns {x: number, y: number} x = pageX value, y = pageY value.
*/
page: function(event) {
event = event.originalEvent || event;
var strPage = 'page';
var strClient = 'client';
var strX = 'X';
var strY = 'Y';
var target = event.target || event.srcElement || document;
var eventDoc = target.ownerDocument || document;
var doc = eventDoc.documentElement;
var body = eventDoc.body;
//if touch event return return pageX/Y of it
if(event.touches !== undefined) {
var touch = event.touches[0];
return {
x : touch[strPage + strX],
y : touch[strPage + strY]
}
}
// Calculate pageX/Y if not native supported
if (!event[strPage + strX] && event[strClient + strX] && event[strClient + strX] != null) {
return {
x : event[strClient + strX] +
(doc && doc.scrollLeft || body && body.scrollLeft || 0) -
(doc && doc.clientLeft || body && body.clientLeft || 0),
y : event[strClient + strY] +
(doc && doc.scrollTop || body && body.scrollTop || 0) -
(doc && doc.clientTop || body && body.clientTop || 0)
}
}
return {
x : event[strPage + strX],
y : event[strPage + strY]
};
},
/**
* Gets the clicked mouse button of the given mouse event.
* @param event The mouse event of which the clicked button shal be got.
* @returns {number} The number of the clicked mouse button. (1 : leftButton | 2 : middleButton | 3 : rightButton)
*/
mBtn: function(event) {
if (!event.which && event.button !== undefined)
return (event.button & 1 ? 1 : (event.button & 2 ? 3 : (event.button & 4 ? 2 : 0)));
else
return event.which;
},
/**
* Checks whether a item is in the given array and returns its index.
* @param item The item of which the position in the array shall be determined.
* @param arr The array.
* @returns {number} The zero based index of the item or -1 if the item isn't in the array.
*/
inA : function(item, arr) {
for (var i = 0; i < arr[LEXICON.l]; i++)
//Sometiems in IE a "SCRIPT70" Permission denied error occurs if HTML elements in a iFrame are compared
try {
if (arr[i] === item)
return i;
}
catch(e) { }
return -1;
},
/**
* Returns true if the given value is a array.
* @param arr The potential array.
* @returns {boolean} True if the given value is a array, false otherwise.
*/
isA: function(arr) {
var def = Array.isArray;
return def ? def(arr) : this.type(arr) == TYPES.a;
},
/**
* Determine the internal JavaScript [[Class]] of the given object.
* @param obj The object of which the type shall be determined.
* @returns {string} The type of the given object.
*/
type: function(obj) {
if (obj === undefined)
return obj + "";
if (obj === null)
return obj + "";
return Object[LEXICON.p].toString.call(obj).replace(/^\[object (.+)\]$/, '$1').toLowerCase();
},
bind: function(func, thisObj) {
if (typeof func != TYPES.f) {
throw "Can't bind function!";
// closest thing possible to the ECMAScript 5
// internal IsCallable function
//throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var proto = LEXICON.p;
var aArgs = Array[proto].slice.call(arguments, 2);
var fNOP = function() {};
var fBound = function() { return func.apply(this instanceof fNOP ? this : thisObj, aArgs.concat(Array[proto].slice.call(arguments))); };
if (func[proto])
fNOP[proto] = func[proto]; // Function.prototype doesn't have a prototype property
fBound[proto] = new fNOP();
return fBound;
}
};
var JQUERY = window.jQuery;
var EASING = (function() {
var _math = window.Math;
var _easingsMath = {
p : _math.PI,
c : _math.cos,
s : _math.sin,
w : _math.pow,
t : _math.sqrt,
n : _math.asin,
a : _math.abs,
o : 1.70158
};
/*
x : current percent (0 - 1),
t : current time (duration * percent),
b : start value (from),
c : end value (to),
d : duration
easingName : function(x, t, b, c, d) { return easedValue; }
*/
return {
swing: function (x, t, b, c, d) {
return 0.5 - _easingsMath.c(x * _easingsMath.p) / 2;
},
linear: function(x, t, b, c, d) {
return x;
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
return ((t/=d/2) < 1) ? c/2*t*t + b : -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
return ((t/=d/2) < 1) ? c/2*t*t*t + b : c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
return ((t/=d/2) < 1) ? c/2*t*t*t*t + b : -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
return ((t/=d/2) < 1) ? c/2*t*t*t*t*t + b : c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * _easingsMath.c(t/d * (_easingsMath.p/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * _easingsMath.s(t/d * (_easingsMath.p/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (_easingsMath.c(_easingsMath.p*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * _easingsMath.w(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-_easingsMath.w(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * _easingsMath.w(2, 10 * (t - 1)) + b;
return c/2 * (-_easingsMath.w(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (_easingsMath.t(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * _easingsMath.t(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
return ((t/=d/2) < 1) ? -c/2 * (_easingsMath.t(1 - t*t) - 1) + b : c/2 * (_easingsMath.t(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=_easingsMath.o;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < _easingsMath.a(c)) { a=c; var s=p/4; }
else var s = p/(2*_easingsMath.p) * _easingsMath.n (c/a);
return -(a*_easingsMath.w(2,10*(t-=1)) * _easingsMath.s( (t*d-s)*(2*_easingsMath.p)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=_easingsMath.o;var p=0;var a=c;
if (t==0) return b;
if ((t/=d)==1) return b+c;
if (!p) p=d*.3;
if (a < _easingsMath.a(c)) { a=c; var s=p/4; }
else var s = p/(2*_easingsMath.p) * _easingsMath.n (c/a);
return a*_easingsMath.w(2,-10*t) * _easingsMath.s( (t*d-s)*(2*_easingsMath.p)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=_easingsMath.o;var p=0;var a=c;
if (t==0) return b;
if ((t/=d/2)==2) return b+c;
if (!p) p=d*(.3*1.5);
if (a < _easingsMath.a(c)) { a=c; var s=p/4; }
else var s = p/(2*_easingsMath.p) * _easingsMath.n (c/a);
if (t < 1) return -.5*(a*_easingsMath.w(2,10*(t-=1)) * _easingsMath.s( (t*d-s)*(2*_easingsMath.p)/p )) + b;
return a*_easingsMath.w(2,-10*(t-=1)) * _easingsMath.s( (t*d-s)*(2*_easingsMath.p)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
s = s || _easingsMath.o;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
s = s || _easingsMath.o;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
s = s || _easingsMath.o;
return ((t/=d/2) < 1) ? c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b : c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - this.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
var o = 7.5625;
if ((t/=d) < (1/2.75)) {
return c*(o*t*t) + b;
} else if (t < (2/2.75)) {
return c*(o*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(o*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(o*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
return (t < d/2) ? this.easeInBounce (x, t*2, 0, c, d) * .5 + b : this.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
};
/*
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright © 2001 Robert Penner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
})();
var FRAMEWORK = (function() {
var _rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
var _strSpace = ' ';
var _strEmpty = '';
var _strScrollLeft = 'scrollLeft';
var _strScrollTop = 'scrollTop';
var _animations = [ ];
var _type = COMPATIBILITY.type;
var _cssNumber = {
"animationIterationCount": true,
"columnCount": true,
"fillOpacity": true,
"flexGrow": true,
"flexShrink": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"order": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
};
var extend = function() {
var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {},
i = 1,
length = arguments[LEXICON.l],
deep = false;
// Handle a deep copy situation
if (_type(target) == TYPES.b) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if (_type(target) != TYPES.o && !_type(target) == TYPES.f) {
target = {};
}
// extend jQuery itself if only one argument is passed
if (length === i) {
target = FakejQuery;
--i;
}
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target === copy) {
continue;
}
// Recurse if we're merging plain objects or arrays
if (deep && copy && (isPlainObject(copy) || (copyIsArray = COMPATIBILITY.isA(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && COMPATIBILITY.isA(src) ? src : [];
} else {
clone = src && isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[name] = extend(deep, clone, copy);
// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
// Return the modified object
return target;
};
var inArray = function(item, arr, fromIndex) {
for (var i = fromIndex || 0; i < arr[LEXICON.l]; i++)
if (arr[i] === item)
return i;
return -1;
}
var isFunction = function(obj) {
return _type(obj) == TYPES.f;
};
var isEmptyObject = function(obj) {
for (var name in obj )
return false;
return true;
};
var isPlainObject = function(obj) {
if (!obj || _type(obj) != TYPES.o)
return false;
var key;
var proto = LEXICON.p;
var hasOwnProperty = Object[proto].hasOwnProperty;
var hasOwnConstructor = hasOwnProperty.call(obj, 'constructor');
var hasIsPrototypeOf = obj.constructor && obj.constructor[proto] && hasOwnProperty.call(obj.constructor[proto], 'isPrototypeOf');
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
return false;
}
for (key in obj) { /**/ }
return _type(key) == TYPES.u || hasOwnProperty.call(obj, key);
};
var each = function(obj, callback) {
var i = 0;
if (isArrayLike(obj)) {
for (; i < obj[LEXICON.l]; i++) {
if (callback.call(obj[i], i, obj[i]) === false)
break;
}
}
else {
for (i in obj) {
if (callback.call(obj[i], i, obj[i]) === false)
break;
}
}
return obj;
};
var FakejQuery = function (selector) {
if(arguments[LEXICON.l] === 0)
return this;
var base = new FakejQuery();
var elements = selector;
var i = 0;
var elms;
var el;
if(_type(selector) == TYPES.s) {
elements = [ ];
if(selector.charAt(0) === '<') {
el = document.createElement('div');
el.innerHTML = selector;
elms = el.children;
}
else {
elms = document.querySelectorAll(selector);
}
for(; i < elms[LEXICON.l]; i++)
elements.push(elms[i]);
}
if(elements) {
if(_type(elements) != TYPES.s && !isArrayLike(elements))
elements = [ elements ];
for(i = 0; i < elements[LEXICON.l]; i++)
base[i] = elements[i];
base[LEXICON.l] = elements[LEXICON.l];
}
return base;
};
function isArrayLike(obj) {
var length = !!obj && [LEXICON.l] in obj && obj[LEXICON.l];
var t = _type(obj);
//|| obj === window = self added!
return isFunction(t) || obj === window ? false : (t == TYPES.a || length === 0 || _type(length) == TYPES.n && length > 0 && (length - 1) in obj);
}
function stripAndCollapse(value) {
var tokens = value.match(_rnothtmlwhite) || [];
return tokens.join(_strSpace);
}
function matches(elem, selector) {
var nodeList = (elem.parentNode || document).querySelectorAll(selector) || [];
var i = nodeList[LEXICON.l];
while (i--)
if (nodeList[i] == elem)
return true;
return false;
}
function insertAdjacentElement(el, strategy, child) {
if(_type(child) == TYPES.a) {
for(var i = 0; i < child[LEXICON.l]; i++)
insertAdjacentElement(el, strategy, child[i]);
}
else if(_type(child) == TYPES.s)
el.insertAdjacentHTML(strategy, child);
else
el.insertAdjacentElement(strategy, child.nodeType ? child : child[0]);
}
function setCSSVal(el, prop, val) {
try {
if(el[LEXICON.s][prop] !== undefined)
el[LEXICON.s][prop] = parseCSSVal(prop, val);
} catch(e) { }
}
function parseCSSVal(prop, val) {
if(!_cssNumber[prop.toLowerCase()] && _type(val) == TYPES.n)
val += 'px';
return val;
}
function startNextAnimationInQ(animObj, removeFromQ) {
var index;
var nextAnim;
if(removeFromQ !== false)
animObj.q.splice(0, 1);
if(animObj.q[LEXICON.l] > 0) {
nextAnim = animObj.q[0];
animate(animObj.el, nextAnim.props, nextAnim.duration, nextAnim.easing, nextAnim.complete, true);
}
else {
index = inArray(animObj, _animations);
if(index > -1)
_animations.splice(index, 1);
}
}
function setAnimationValue(el, prop, value) {
if(prop === _strScrollLeft || prop === _strScrollTop)
el[prop] = value;
else
setCSSVal(el, prop, value);
}
function animate(el, props, options, easing, complete, guaranteedNext) {
var hasOptions = isPlainObject(options);
var from = { };
var to = { };
var i = 0;
var key;
var animObj;
var start;
var progress;
var step;
var specialEasing;
var duration;
if(hasOptions) {
easing = options.easing;
start = options.start;
progress = options.progress;
step = options.step;
specialEasing = options.specialEasing;
complete = options.complete;
duration = options.duration;
}
else
duration = options;
specialEasing = specialEasing || { };
duration = duration || 400;
easing = easing || 'swing';
guaranteedNext = guaranteedNext || false;
for(; i < _animations[LEXICON.l]; i++) {
if(_animations[i].el === el) {
animObj = _animations[i];
break;
}
}
if(!animObj) {
animObj = {
el : el,
q : []
};
_animations.push(animObj);
}
for (key in props) {
if(key === _strScrollLeft || key === _strScrollTop)
from[key] = el[key];
else
from[key] = FakejQuery(el).css(key);
}
for (key in from) {
if(from[key] !== props[key] && props[key] !== undefined)
to[key] = props[key];
}
if(!isEmptyObject(to)) {
var timeNow;
var end;
var percent;
var fromVal;
var toVal;
var easedVal;
var timeStart;
var frame;
var elapsed;
var qPos = guaranteedNext ? 0 : inArray(qObj, animObj.q);
var qObj = {
props : to,
duration : hasOptions ? options : duration,
easing : easing,
complete : complete
};
if (qPos === -1) {
qPos = animObj.q[LEXICON.l];
animObj.q.push(qObj);
}
if(qPos === 0) {
if(duration > 0) {
timeStart = COMPATIBILITY.now();
frame = function() {
timeNow = COMPATIBILITY.now();
elapsed = (timeNow - timeStart);
end = qObj.stop || elapsed >= duration;
percent = 1 - ((Math.max(0, timeStart + duration - timeNow) / duration) || 0);
for(key in to) {
fromVal = parseFloat(from[key]);
toVal = parseFloat(to[key]);
easedVal = (toVal - fromVal) * EASING[specialEasing[key] || easing](percent, percent * duration, 0, 1, duration) + fromVal;
setAnimationValue(el, key, easedVal);
if(isFunction(step)) {
step(easedVal, {
elem : el,
prop : key,
start : fromVal,
now : easedVal,
end : toVal,
pos : percent,
options : {
easing : easing,
speacialEasing : specialEasing,
duration : duration,
complete : complete,
step : step
},
startTime : timeStart
});
}
}
if(isFunction(progress))
progress({ }, percent, Math.max(0, duration - elapsed));
if (end) {
startNextAnimationInQ(animObj);
if(isFunction(complete))
complete();
}
else
qObj.frame = COMPATIBILITY.rAF()(frame);
};
qObj.frame = COMPATIBILITY.rAF()(frame);
}
else {
for(key in to)
setAnimationValue(el, key, to[key]);
startNextAnimationInQ(animObj);
}
}
}
else if(guaranteedNext)
startNextAnimationInQ(animObj);
}
function stop(el, clearQ, jumpToEnd) {
var animObj;
var qObj;
var key;
var i = 0;
for(; i < _animations[LEXICON.l]; i++) {
animObj = _animations[i];
if(animObj.el === el) {
if(animObj.q[LEXICON.l] > 0) {
qObj = animObj.q[0];
qObj.stop = true;
COMPATIBILITY.cAF()(qObj.frame);
animObj.q.splice(0, 1);
if(jumpToEnd)
for(key in qObj.props)
setAnimationValue(el, key, qObj.props[key]);
if(clearQ)
animObj.q = [ ];
else
startNextAnimationInQ(animObj, false);
}
break;
}
}
}
FakejQuery[LEXICON.p] = {
//EVENTS:
on : function(eventName, handler) {
eventName = (eventName || _strEmpty).match(_rnothtmlwhite) || [_strEmpty];
var eventNameLength = eventName[LEXICON.l];
var i = 0;
var el;
return this.each(function() {
el = this;
try {
if (el.addEventListener) {
for (; i < eventNameLength; i++)
el.addEventListener(eventName[i], handler);
}
else if(el.detachEvent) {
for (; i < eventNameLength; i++)
el.attachEvent('on' + eventName[i], handler);
}
} catch (e) { }
});
},
off : function(eventName, handler) {
eventName = (eventName || _strEmpty).match(_rnothtmlwhite) || [_strEmpty];
var eventNameLength = eventName[LEXICON.l];
var i = 0;
var el;
return this.each(function() {
el = this;
try {
if (el.removeEventListener) {
for (; i < eventNameLength; i++)
el.removeEventListener(eventName[i], handler);
}
else if(el.detachEvent) {
for (; i < eventNameLength; i++)
el.detachEvent('on' + eventName[i], handler);
}
} catch (e) { }
});
},
one : function (eventName, handler) {
eventName = (eventName || _strEmpty).match(_rnothtmlwhite) || [_strEmpty];
return this.each(function() {
var el = FakejQuery(this);
FakejQuery.each(eventName, function(i, oneEventName) {
var oneHandler = function(e) {
handler.call(this, e);
el.off(oneEventName, oneHandler);
};
el.on(oneEventName, oneHandler);
});
});
},
trigger : function(eventName) {
var el;
var event;
return this.each(function() {
el = this;
if (document.createEvent) {
event = document.createEvent('HTMLEvents');
event.initEvent(eventName, true, false);
el.dispatchEvent(event);
}
else {
el.fireEvent("on" + eventName);
}
});
},
//DOM NODE INSERTING / REMOVING:
append : function(child) {
return this.each(function() { insertAdjacentElement(this, 'beforeend', child); });
},
prepend : function(child) {
return this.each(function() { insertAdjacentElement(this, 'afterbegin', child); });
},
before : function(child) {
return this.each(function() { insertAdjacentElement(this, 'beforebegin', child); });
},
after : function(child) {
return this.each(function() { insertAdjacentElement(this, 'afterend', child); });
},
remove : function() {
return this.each(function() {
var el = this;
var parentNode = el.parentNode;
if(parentNode != null)
parentNode.removeChild(el);
});
},
unwrap : function() {
var parents = [ ];
var i;
var el;
var parent;
this.each(function() {
parent = this.parentNode;
if(inArray(parent, parents) === - 1)
parents.push(parent);
});
for(i = 0; i < parents[LEXICON.l]; i++) {
el = parents[i];
parent = el.parentNode;
while (el.firstChild)
parent.insertBefore(el.firstChild, el);
parent.removeChild(el);
}
return this;
},
wrapAll : function(wrapperHTML) {
var i;
var nodes = this;
var wrapper = FakejQuery(wrapperHTML)[0];
var deepest = wrapper;
var parent = nodes[0].parentNode;
var previousSibling = nodes[0].previousSibling;
while(deepest.childNodes[LEXICON.l] > 0)
deepest = deepest.childNodes[0];
for (i = 0; nodes[LEXICON.l] - i; deepest.firstChild === nodes[0] && i++)
deepest.appendChild(nodes[i]);
var nextSibling = previousSibling ? previousSibling.nextSibling : parent.firstChild;
parent.insertBefore(wrapper, nextSibling);
return this;
},
wrapInner : function(wrapperHTML) {
return this.each(function() {
var el = FakejQuery(this);
var contents = el.contents();
if (contents[LEXICON.l])
contents.wrapAll(wrapperHTML);
else
el.append(wrapperHTML);
});
},
wrap : function(wrapperHTML) {
return this.each(function() { FakejQuery(this).wrapAll(wrapperHTML); });
},
//DOM NODE MANIPULATION / INFORMATION:
css : function(styles, val) {
var el;
var key;
var cptStyle;
var getCptStyle = window.getComputedStyle;
if(_type(styles) == TYPES.s) {
if(val === undefined) {
el = this[0];
cptStyle = getCptStyle ? getCptStyle(el, null) : el.currentStyle[styles];
//https://bugzilla.mozilla.org/show_bug.cgi?id=548397 can be null sometimes if iframe with display: none (firefox only!)
return getCptStyle ? cptStyle != null ? cptStyle.getPropertyValue(styles) : el[LEXICON.s][styles] : cptStyle;
}
else {
return this.each(function() {
setCSSVal(this, styles, val);
});
}
}
else {
return this.each(function() {
for(key in styles)
setCSSVal(this, key, styles[key]);
});
}
},
hasClass : function(className) {
var elem, i = 0;
var classNamePrepared = _strSpace + className + _strSpace;
var classList;
while ((elem = this[ i++ ])) {
classList = elem.classList;
if(classList && classList.contains(className))
return true;
else if (elem.nodeType === 1 && (_strSpace + stripAndCollapse(elem.className + _strEmpty) + _strSpace).indexOf(classNamePrepared) > -1)
return true;
}
return false;
},
addClass : function(className) {
var classes;
var elem;
var cur;
var curValue;
var clazz;
var finalValue;
var supportClassList;
var elmClassList;
var i = 0;
var v = 0;
if (className) {
classes = className.match( _rnothtmlwhite ) || [];
while ((elem = this[i++])) {
elmClassList = elem.classList;
if(supportClassList === undefined)
supportClassList = elmClassList !== undefined;
if(supportClassList) {
while ((clazz = classes[v++]))
elmClassList.add(clazz);
}
else {
curValue = elem.className + _strEmpty;
cur = elem.nodeType === 1 && (_strSpace + stripAndCollapse(curValue) + _strSpace);
if (cur) {
while ((clazz = classes[v++]))
if (cur.indexOf(_strSpace + clazz + _strSpace) < 0)
cur += clazz + _strSpace;
finalValue = stripAndCollapse(cur);
if (curValue !== finalValue)
elem.className = finalValue;
}
}
}
}
return this;
},
removeClass : function(className) {
var classes;
var elem;
var cur;
var curValue;
var clazz;
var finalValue;
var supportClassList;
var elmClassList;
var i = 0;
var v = 0;
if (className) {
classes = className.match(_rnothtmlwhite) || [];
while ((elem = this[i++])) {
elmClassList = elem.classList;
if(supportClassList === undefined)
supportClassList = elmClassList !== undefined;
if(supportClassList) {
while ((clazz = classes[v++]))
elmClassList.remove(clazz);
}
else {
curValue = elem.className + _strEmpty;
cur = elem.nodeType === 1 && (_strSpace + stripAndCollapse(curValue) + _strSpace);
if (cur) {
while ((clazz = classes[v++]))
while (cur.indexOf(_strSpace + clazz + _strSpace) > -1)
cur = cur.replace(_strSpace + clazz + _strSpace, _strSpace);
finalValue = stripAndCollapse(cur);
if (curValue !== finalValue)
elem.className = finalValue;
}
}
}
}
return this;
},
hide : function() {
return this.each(function() { this[LEXICON.s].display = 'none'; });
},
show : function() {
return this.each(function() { this[LEXICON.s].display = 'block'; });
},
attr : function(attrName, value) {
var i = 0;
var el;
while (el = this[i++]) {
if(value === undefined)
return el.getAttribute(attrName);
el.setAttribute(attrName, value);
}
return this;
},
removeAttr : function(attrName) {
return this.each(function() { this.removeAttribute(attrName); });
},
offset : function() {
var el = this[0];
var rect = el.getBoundingClientRect();
var scrollLeft = window.pageXOffset || document.documentElement[_strScrollLeft];
var scrollTop = window.pageYOffset || document.documentElement[_strScrollTop];
return {
top: rect.top + scrollTop,
left: rect.left + scrollLeft
};
},
position : function() {
var el = this[0];
return {
top: el.offsetTop,
left: el.offsetLeft
};
},
scrollLeft : function(value) {
var i = 0;
var el;
while (el = this[i++]) {
if(value === undefined)
return el[_strScrollLeft];
el[_strScrollLeft] = value;
}
return this;
},
scrollTop : function(value) {
var i = 0;
var el;
while (el = this[i++]) {
if(value === undefined)
return el[_strScrollTop];
el[_strScrollTop] = value;
}
return this;
},
val : function(value) {
var el = this[0];
if(!value)
return el.value;
el.value = value;
return this;
},
//DOM TRAVERSAL / FILTERING:
first : function() {
return this.eq(0);
},
last : function() {
return this.eq(-1);
},
eq : function(index) {
return FakejQuery(this[index >= 0 ? index : this[LEXICON.l] + index]);
},
find : function(selector) {
var children = [ ];
var i;
this.each(function() {
var el = this;
var ch = el.querySelectorAll(selector);
for(i = 0; i < ch[LEXICON.l]; i++)
children.push(ch[i]);
});
return FakejQuery(children);
},
children : function(selector) {
var children = [ ];
var el;
var ch;
var i;
this.each(function() {
ch = this.children;
for(i = 0; i < ch[LEXICON.l]; i++) {
el = ch[i];
if(selector) {
if((el.matches && el.matches(selector)) || matches(el, selector))
children.push(el);
}
else
children.push(el);
}
});
return FakejQuery(children);
},
parent : function(selector) {
var parents = [ ];
var parent;
this.each(function() {
parent = this.parentNode;
if(selector ? FakejQuery(parent).is(selector) : true)
parents.push(parent);
});
return FakejQuery(parents);
},
is : function(selector) {
var el;
var i;
for(i = 0; i < this[LEXICON.l]; i++) {
el = this[i];
if(selector === ":visible")
return !!(el[LEXICON.oW] || el[LEXICON.oH] || el.getClientRects()[LEXICON.l]);
if(selector === ":hidden")
return !!!(el[LEXICON.oW] || el[LEXICON.oH] || el.getClientRects()[LEXICON.l]);
if((el.matches && el.matches(selector)) || matches(el, selector))
return true;
}
return false;
},
contents : function() {
var contents = [ ];
var childs;
var i;
this.each(function() {
childs = this.childNodes;
for(i = 0; i < childs[LEXICON.l]; i++)
contents.push(childs[i]);
});
return FakejQuery(contents);
},
each : function(callback) {
return each(this, callback);
},
//ANIMATION:
animate : function(props, duration, easing, complete) {
return this.each(function() { animate(this, props, duration, easing, complete); });
},
stop : function(clearQ, jump) {
return this.each(function() { stop(this, clearQ, jump); });
}
};
extend(FakejQuery, {
extend : extend,
inArray : inArray,
isEmptyObject : isEmptyObject,
isPlainObject : isPlainObject,
each : each
});
return FakejQuery;
})();
var INSTANCES = (function() {
var _targets = [ ];
var _instancePropertyString = '__overlayScrollbars__';
/**
* Register, unregister or get a certain (or all) instances.
* Register: Pass the target and the instance.
* Unregister: Pass the target and null.
* Get Instance: Pass the target from which the instance shall be got.
* Get Targets: Pass no arguments.
* @param target The target to which the instance shall be registered / from which the instance shall be unregistered / the instance shall be got
* @param instance The instance.
* @returns {*|void} Returns the instance from the given target.
*/
return function (target, instance) {
var argLen = arguments[LEXICON.l];
if(argLen < 1) {
//return all targets
return _targets;
}
else {
if(instance) {
//register instance
target[_instancePropertyString] = instance;
_targets.push(target);
}
else {
var index = COMPATIBILITY.inA(target, _targets);
if (index > -1) {
if(argLen > 1) {
//unregister instance
delete target[_instancePropertyString];
_targets.splice(index, 1);
}
else {
//get instance from target
return _targets[index][_instancePropertyString];
}
}
}
}
}
})();
var PLUGIN = (function() {
var _pluginsGlobals;
var _pluginsAutoUpdateLoop;
var _pluginsExtensions = [ ];
var _pluginsOptions = (function() {
var possibleTemplateTypes = [
TYPES.b, //boolean
TYPES.n, //number
TYPES.s, //string
TYPES.a, //array
TYPES.o, //object
TYPES.f, //function
TYPES.z //null
];
var restrictedStringsSplit = " ";
var restrictedStringsPossibilitiesSplit = ":";
var classNameAllowedValues = [TYPES.z, TYPES.s];
var numberAllowedValues = TYPES.n;
var booleanNullAllowedValues = [TYPES.z, TYPES.b];
var booleanTrueTemplate = [true, TYPES.b];
var booleanFalseTemplate = [false, TYPES.b];
var callbackTemplate = [null, [TYPES.z, TYPES.f]];
var resizeAllowedValues = 'n:none b:both h:horizontal v:vertical';
var overflowBehaviorAllowedValues = 'v-h:visible-hidden v-s:visible-scroll s:scroll h:hidden';
var scrollbarsVisibilityAllowedValues = 'v:visible h:hidden a:auto';
var scrollbarsAutoHideAllowedValues = 'n:never s:scroll l:leave m:move';
var optionsDefaultsAndTemplate = {
className: ['os-theme-dark', classNameAllowedValues], //null || string
resize: ['none', resizeAllowedValues], //none || both || horizontal || vertical || n || b || h || v
sizeAutoCapable: booleanTrueTemplate, //true || false
clipAlways: booleanTrueTemplate, //true || false
normalizeRTL: booleanTrueTemplate, //true || false
paddingAbsolute: booleanFalseTemplate, //true || false
autoUpdate: [null, booleanNullAllowedValues], //true || false || null
autoUpdateInterval: [33, numberAllowedValues], //number
nativeScrollbarsOverlaid: {
showNativeScrollbars: booleanFalseTemplate, //true || false
initialize: booleanTrueTemplate //true || false
},
overflowBehavior: {
x: ['scroll', overflowBehaviorAllowedValues], //visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s
y: ['scroll', overflowBehaviorAllowedValues] //visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s
},
scrollbars: {
visibility: ['auto', scrollbarsVisibilityAllowedValues], //visible || hidden || auto || v || h || a
autoHide: ['never', scrollbarsAutoHideAllowedValues], //never || scroll || leave || move || n || s || l || m
autoHideDelay: [800, numberAllowedValues], //number
dragScrolling: booleanTrueTemplate, //true || false
clickScrolling: booleanFalseTemplate, //true || false
touchSupport: booleanTrueTemplate //true || false
},
textarea: {
dynWidth: booleanFalseTemplate, //true || false
dynHeight: booleanFalseTemplate //true || false
},
callbacks: {
onInitialized: callbackTemplate, //null || function
onInitializationWithdrawn: callbackTemplate, //null || function
onDestroyed: callbackTemplate, //null || function
onScrollStart: callbackTemplate, //null || function
onScroll: callbackTemplate, //null || function
onScrollStop: callbackTemplate, //null || function
onOverflowChanged: callbackTemplate, //null || function
onOverflowAmountChanged: callbackTemplate, //null || function
onDirectionChanged: callbackTemplate, //null || function
onContentSizeChanged: callbackTemplate, //null || function
onHostSizeChanged: callbackTemplate, //null || function
onUpdated: callbackTemplate //null || function
}
};
var convert = function(template) {
var recursive = function(obj) {
var key;
var val;
var valType;
for(key in obj) {
if(!obj.hasOwnProperty(key))
continue;
val = obj[key];
valType = COMPATIBILITY.type(val);
if(valType == TYPES.a)
obj[key] = val[template ? 1 : 0];
else if(valType == TYPES.o)
obj[key] = recursive(val);
}
return obj;
};
return recursive(FRAMEWORK.extend(true, { }, optionsDefaultsAndTemplate));
};
return {
//defaults
d : convert(),
//template
t : convert(true),
//validate
/**
* Validates the passed object by the passed template.
* @param obj The object which shall be validated.
* @param template The template which defines the allowed values and types.
* @param writeErrors True if errors shall be logged to the console.
* @param usePreparedValues True if the validated main values shall be returned in the validated object, false otherwise.
* @param keepForeignProps True if properties which aren't in the template shall be added to the validated object, false otherwise.
* @returns {{}} A object which contains only the valid properties of the passed original object.
*/
v : function (obj, template, writeErrors, usePreparedValues, keepForeignProps) {
var validatedOptions = { };
var objectCopy = FRAMEWORK.extend(true, { }, obj);
var checkObjectProps = function(data, template, validatedOptions, prevPropName) {
for (var prop in template) {
if (template.hasOwnProperty(prop) && data.hasOwnProperty(prop)) {
var isValid = false;
var templateValue = template[prop];
var templateValueType = COMPATIBILITY.type(templateValue);
var templateTypes = COMPATIBILITY.type(templateValue) != TYPES.a ? [ templateValue ] : templateValue;
var dataValue = data[prop];
var dataValueType = COMPATIBILITY.type(dataValue);
var propPrefix = prevPropName ? prevPropName + "." : "";
var error = "The option \"" + propPrefix + prop + "\" wasn't set, because";
var errorPossibleTypes = [ ];
var errorRestrictedStrings = [ ];
var restrictedStringValuesSplit;
var restrictedStringValuesPossibilitiesSplit;
var isRestrictedValue;
var mainPossibility;
var currType;
var i;
var v;
var j;
//if the template has a object as value, it means that the options are complex (verschachtelt)
if(templateValueType == TYPES.o) {
validatedOptions[prop] = { };
checkObjectProps(dataValue, templateValue, validatedOptions[prop], propPrefix + prop);
if(FRAMEWORK.isEmptyObject(dataValue))
delete data[prop];
}
else {
for(i = 0; i < templateTypes.length; i++) {
currType = templateTypes[i];
templateValueType = COMPATIBILITY.type(currType);
//if currtype is string and starts with restrictedStringPrefix and end with restrictedStringSuffix
isRestrictedValue = templateValueType == TYPES.s && FRAMEWORK.inArray(currType, possibleTemplateTypes) === -1;
if(isRestrictedValue) {
errorPossibleTypes.push(TYPES.s);
//split it into a array which contains all possible values for example: ["y:yes", "n:no", "m:maybe"]
restrictedStringValuesSplit = currType.split(restrictedStringsSplit);
errorRestrictedStrings = errorRestrictedStrings.concat(restrictedStringValuesSplit);
for(v = 0; v < restrictedStringValuesSplit.length; v++) {
//split the possible values into their possibiliteis for example: ["y", "yes"] -> the first is always the mainPossibility
restrictedStringValuesPossibilitiesSplit = restrictedStringValuesSplit[v].split(restrictedStringsPossibilitiesSplit);
mainPossibility = restrictedStringValuesPossibilitiesSplit[0];
for(j = 0; j < restrictedStringValuesPossibilitiesSplit.length; j++) {
//if any possibility matches with the dataValue, its valid
if(dataValue === restrictedStringValuesPossibilitiesSplit[j]) {
isValid = true;
break;
}
}
if(isValid)
break;
}
}
else {
errorPossibleTypes.push(currType);
if(dataValueType === currType) {
isValid = true;
break;
}
}
}
if(isValid) {
validatedOptions[prop] = isRestrictedValue && usePreparedValues ? mainPossibility : dataValue;
}
else if(writeErrors) {
console.warn(error + " it doesn't accept the type [ " + dataValueType.toUpperCase() + " ] with the value of \"" + dataValue + "\".\r\n" +
"Accepted types are: [ " + errorPossibleTypes.join(", ").toUpperCase() + " ]." +
(errorRestrictedStrings.length > 0 ? "\r\nValid strings are: [ " + errorRestrictedStrings.join(", ").split(restrictedStringsPossibilitiesSplit).join(", ") + " ]." : ""));
}
delete data[prop];
}
}
}
};
checkObjectProps(objectCopy, template, validatedOptions);
//add values which aren't specified in the template to the finished validated object to prevent them from being discarded
if(keepForeignProps)
FRAMEWORK.extend(true, validatedOptions, objectCopy);
else if(!FRAMEWORK.isEmptyObject(objectCopy) && writeErrors)
console.warn("The following options are discarded due to invalidity:\r\n" + JSON.stringify(objectCopy, null, 2));
return validatedOptions;
}
}
}());
/**
* Initializes the object which contains global information about the plugin and each instance of it.
*/
function initOverlayScrollbarsStatics() {
if(!_pluginsGlobals)
_pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions.d);
if(!_pluginsAutoUpdateLoop)
_pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals);
}
/**
* The global object for the OverlayScrollbars objects. It contains resources which every OverlayScrollbars object needs. This object is initialized only once: if the first OverlayScrollbars object gets initialized.
* @param defaultOptions
* @constructor
*/
function OverlayScrollbarsGlobals(defaultOptions) {
var _base = this;
var strOverflow = 'overflow';
var strHidden = 'hidden';
var strScroll = 'scroll';
var bodyElement = FRAMEWORK('body');
var scrollbarDummyElement = FRAMEWORK('<div id="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>');
var scrollbarDummyElement0 = scrollbarDummyElement[0];
var dummyContainerChild = FRAMEWORK(scrollbarDummyElement.children('div').eq(0));
bodyElement.append(scrollbarDummyElement);
scrollbarDummyElement.hide().show(); //fix IE8 bug (incorrect measuring)
var nativeScrollbarSize = calcNativeScrollbarSize(scrollbarDummyElement0);
var nativeScrollbarIsOverlaid = {
x: nativeScrollbarSize.x === 0,
y: nativeScrollbarSize.y === 0
};
FRAMEWORK.extend(_base, {
defaultOptions : defaultOptions,
autoUpdateLoop : false,
autoUpdateRecommended : !COMPATIBILITY.mO(),
nativeScrollbarSize : nativeScrollbarSize,
nativeScrollbarIsOverlaid : nativeScrollbarIsOverlaid,
nativeScrollbarStyling : (function() {
scrollbarDummyElement.addClass('os-viewport-native-scrollbars-invisible');
//fix opera bug: scrollbar styles will only appear if overflow value is scroll or auto during the activation of the style.
//and set overflow to scroll
scrollbarDummyElement.css(strOverflow, strHidden).hide().css(strOverflow, strScroll).show();
return (scrollbarDummyElement0[LEXICON.oH] - scrollbarDummyElement0[LEXICON.cH]) === 0 && (scrollbarDummyElement0[LEXICON.oW] - scrollbarDummyElement0[LEXICON.cW]) === 0;
})(),
overlayScrollbarDummySize : { x: 30, y: 30 },
msie : (function() {
var ua = window.navigator.userAgent;
var strIndexOf = 'indexOf';
var strSubString = 'substring';
var msie = ua[strIndexOf]('MSIE ');
var trident = ua[strIndexOf]('Trident/');
var edge = ua[strIndexOf]('Edge/');
var rv = ua[strIndexOf]('rv:');
var result;
var parseInt = window.parseInt;
// IE 10 or older => return version number
if (msie > 0)
result = parseInt(ua[strSubString](msie + 5, ua[strIndexOf]('.', msie)), 10);
// IE 11 => return version number
else if (trident > 0)
result = parseInt(ua[strSubString](rv + 3, ua[strIndexOf]('.', rv)), 10);
// Edge (IE 12+) => return version number
else if (edge > 0)
result = parseInt(ua[strSubString](edge + 5, ua[strIndexOf]('.', edge)), 10);
// other browser
return result;
})(),
cssCalc : (function() {
var dummy = document.createElement('div');
var props = ['calc', '-webkit-calc', '-moz-calc', '-o-calc'];
var i;
var prop;
for (i = 0; i < props.length; ++i) {
prop = props[i];
dummy[LEXICON.s].cssText = 'width:' + prop + '(1px);';
if (dummy[LEXICON.s].length)
return prop;
}
return null;
})(),
restrictedMeasuring : (function() {
//https://bugzilla.mozilla.org/show_bug.cgi?id=1439305
scrollbarDummyElement.css(strOverflow, strHidden);
var scrollSize = {
w : scrollbarDummyElement0[LEXICON.sW],
h : scrollbarDummyElement0[LEXICON.sH]
};
scrollbarDummyElement.css(strOverflow, 'visible');
var scrollSize2 = {
w : scrollbarDummyElement0[LEXICON.sW],
h : scrollbarDummyElement0[LEXICON.sH]
};
return (scrollSize.w - scrollSize2.w) !== 0 || (scrollSize.h - scrollSize2.h) !== 0;
})(),
rtlScrollBehavior : (function() {
scrollbarDummyElement.css({ 'overflow-y' : strHidden, 'overflow-x' : strScroll, 'direction' : 'rtl' }).scrollLeft(0);
var dummyContainerOffset = scrollbarDummyElement.offset();
var dummyContainerChildOffset = dummyContainerChild.offset();
scrollbarDummyElement.scrollLeft(999);
var dummyContainerScrollOffsetAfterScroll = dummyContainerChild.offset();
return {
//origin direction = determines if the zero scroll position is on the left or right side
//'i' means 'invert' (i === true means that the axis must be inverted to be correct)
//true = on the left side
//false = on the right side
i : dummyContainerOffset.left === dummyContainerChildOffset.left,
//negative = determines if the maximum scroll is positive or negative
//'n' means 'negate' (n === true means that the axis must be negated to be correct)
//true = negative
//false = positive
n : dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left === 0
};
})(),
supportTransform : detectCSSFeature('transform'),
supportTransition : detectCSSFeature('transition'),
supportPassiveEvents : (function() {
var supportsPassive = false;
try {
window.addEventListener('test', null, Object.defineProperty({ }, 'passive', {
get: function() {
supportsPassive = true;
}
}));
} catch (e) { }
return supportsPassive;
})(),
supportResizeObserver : !!COMPATIBILITY.rO(),
supportMutationObserver : !!COMPATIBILITY.mO()
});
scrollbarDummyElement.removeAttr(LEXICON.s).remove();
//Catch zoom event:
(function () {
if(nativeScrollbarIsOverlaid.x && nativeScrollbarIsOverlaid.y)
return;
var abs = Math.abs;
var windowWidth = COMPATIBILITY.wW();
var windowHeight = COMPATIBILITY.wH();
var windowDpr = getWindowDPR();
var onResize = function() {
if(INSTANCES().length > 0) {
var newW = COMPATIBILITY.wW();
var newH = COMPATIBILITY.wH();
var deltaW = newW - windowWidth;
var deltaH = newH - windowHeight;
if (deltaW === 0 && deltaH === 0)
return;
var deltaWRatio = Math.round(newW / (windowWidth / 100.0));
var deltaHRatio = Math.round(newH / (windowHeight / 100.0));
var absDeltaW = abs(deltaW);
var absDeltaH = abs(deltaH);
var absDeltaWRatio = abs(deltaWRatio);
var absDeltaHRatio = abs(deltaHRatio);
var newDPR = getWindowDPR();
var deltaIsBigger = absDeltaW > 2 && absDeltaH > 2;
var difference = !differenceIsBiggerThanOne(absDeltaWRatio, absDeltaHRatio);
var dprChanged = newDPR !== windowDpr && windowDpr > 0;
var isZoom = deltaIsBigger && difference && dprChanged;
var oldScrollbarSize = _base.nativeScrollbarSize;
var newScrollbarSize;
if (isZoom) {
bodyElement.append(scrollbarDummyElement);
newScrollbarSize = _base.nativeScrollbarSize = calcNativeScrollbarSize(scrollbarDummyElement[0]);
scrollbarDummyElement.remove();
if(oldScrollbarSize.x !== newScrollbarSize.x || oldScrollbarSize.y !== newScrollbarSize.y) {
FRAMEWORK.each(INSTANCES(), function () {
if(INSTANCES(this))
INSTANCES(this).update('zoom');
});
}
}
windowWidth = newW;
windowHeight = newH;
windowDpr = newDPR;
}
};
function differenceIsBiggerThanOne(valOne, valTwo) {
var absValOne = abs(valOne);
var absValTwo = abs(valTwo);
return !(absValOne === absValTwo || absValOne + 1 === absValTwo || absValOne - 1 === absValTwo);
}
function getWindowDPR() {
var dDPI = window.screen.deviceXDPI || 0;
var sDPI = window.screen.logicalXDPI || 1;
return window.devicePixelRatio || (dDPI / sDPI);
}
FRAMEWORK(window).on('resize', onResize);
})();
function detectCSSFeature(featurename) {
var feature = false;
var domPrefixes = 'Webkit Moz ms O'.split(' ');
var elm = document.createElement('div');
var featurenameCapital = null;
var i = 0;
featurename = featurename.toLowerCase();
if (elm[LEXICON.s][featurename] !== undefined)
feature = true;
if (!feature) {
featurenameCapital = featurename.charAt(0).toUpperCase() + featurename.substr(1);
for (; i < domPrefixes.length; i++) {
if (elm[LEXICON.s][domPrefixes[i] + featurenameCapital] !== undefined) {
feature = true;
break;
}
}
}
return feature;
}
function calcNativeScrollbarSize(measureElement) {
return {
x: measureElement[LEXICON.oH] - measureElement[LEXICON.cH],
y: measureElement[LEXICON.oW] - measureElement[LEXICON.cW]
};
}
}
/**
* The object which manages the auto update loop for all OverlayScrollbars objects. This object is initialized only once: if the first OverlayScrollbars object gets initialized.
* @constructor
*/
function OverlayScrollbarsAutoUpdateLoop(globals) {
var _base = this;
var _strAutoUpdate = 'autoUpdate';
var _strAutoUpdateInterval = _strAutoUpdate + 'Interval';
var _strLength = LEXICON.l;
var _loopingInstances = [ ];
var _loopingInstancesIntervalCache = [ ];
var _loopIsActive = false;
var _loopIntervalDefault = 33;
var _loopInterval = _loopIntervalDefault;
var _loopTimeOld = COMPATIBILITY.now();
var _loopID;
/**
* The auto update loop which will run every 50 milliseconds or less if the update interval of a instance is lower than 50 milliseconds.
*/
var loop = function() {
if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
_loopID = COMPATIBILITY.rAF()(function () {
loop();
});
var timeNew = COMPATIBILITY.now();
var timeDelta = timeNew - _loopTimeOld;
if (timeDelta > _loopInterval) {
_loopTimeOld = timeNew - (timeDelta % _loopInterval);
var lowestInterval = _loopIntervalDefault;
for(var i = 0; i < _loopingInstances[_strLength]; i++) {
var instance = _loopingInstances[i];
if (instance !== undefined) {
var instanceOptions = instance.options();
var instanceAutoUpdateAllowed = instanceOptions[_strAutoUpdate];
var instanceAutoUpdateInterval = Math.max(1, instanceOptions[_strAutoUpdateInterval]);
var now = COMPATIBILITY.now();
if ((instanceAutoUpdateAllowed === true || instanceAutoUpdateAllowed === null) && (now - _loopingInstancesIntervalCache[i]) > instanceAutoUpdateInterval) {
instance.update('auto');
_loopingInstancesIntervalCache[i] = new Date(now += instanceAutoUpdateInterval);
}
lowestInterval = Math.max(1, Math.min(lowestInterval, instanceAutoUpdateInterval));
}
}
_loopInterval = lowestInterval;
}
} else {
_loopInterval = _loopIntervalDefault;
}
};
/**
* Add OverlayScrollbars instance to the auto update loop. Only successful if the instance isn't already added.
* @param instance The instance which shall be updated in a loop automatically.
*/
_base.add = function(instance) {
if(FRAMEWORK.inArray(instance, _loopingInstances) === -1) {
_loopingInstances.push(instance);
_loopingInstancesIntervalCache.push(COMPATIBILITY.now());
if (_loopingInstances[_strLength] > 0 && !_loopIsActive) {
_loopIsActive = true;
globals.autoUpdateLoop = _loopIsActive;
loop();
}
}
};
/**
* Remove OverlayScrollbars instance from the auto update loop. Only successful if the instance was added before.
* @param instance The instance which shall be updated in a loop automatically.
*/
_base.remove = function(instance) {
var index = FRAMEWORK.inArray(instance, _loopingInstances);
if(index > -1) {
//remove from loopingInstances list
_loopingInstancesIntervalCache.splice(index, 1);
_loopingInstances.splice(index, 1);
//correct update loop behavior
if (_loopingInstances[_strLength] === 0 && _loopIsActive) {
_loopIsActive = false;
globals.autoUpdateLoop = _loopIsActive;
if(_loopID !== undefined) {
COMPATIBILITY.cAF()(_loopID);
_loopID = -1;
}
}
}
};
}
/**
* A object which manages the scrollbars visibility of the target element.
* @param pluginTargetElement The element from which the scrollbars shall be hidden.
* @param options The custom options.
* @param extensions The custom extensions.
* @param globals
* @param autoUpdateLoop
* @returns {*}
* @constructor
*/
function OverlayScrollbarsInstance(pluginTargetElement, options, extensions, globals, autoUpdateLoop) {
//if passed element is no HTML element: skip and return
if(!isHTMLElement(pluginTargetElement))
return;
//if passed element is already initialized: set passed options if there are any and return its instance
if(INSTANCES(pluginTargetElement)) {
var inst = INSTANCES(pluginTargetElement);
inst.options(options);
return inst;
}
//make correct instanceof
var _base = new window[PLUGINNAME]();
var _frameworkProto = FRAMEWORK[LEXICON.p];
//globals:
var _nativeScrollbarIsOverlaid;
var _overlayScrollbarDummySize;
var _rtlScrollBehavior;
var _autoUpdateRecommended;
var _msieVersion;
var _nativeScrollbarStyling;
var _cssCalc;
var _nativeScrollbarSize;
var _supportTransition;
var _supportTransform;
var _supportPassiveEvents;
var _supportResizeObserver;
var _restrictedMeasuring;
//general readonly:
var _initialized;
var _destroyed;
var _isTextarea;
var _isBody;
var _documentMixed;
//general:
var _isBorderBox;
var _sizeAutoObserverAdded;
var _paddingX;
var _paddingY;
var _borderX;
var _borderY;
var _marginX;
var _marginY;
var _isRTL;
var _isSleeping;
var _contentBorderSize = { };
var _scrollHorizontalInfo = { };
var _scrollVerticalInfo = { };
var _viewportSize = { };
var _nativeScrollbarMinSize = { };
//scroll
var _scrollStopDelay = 175;
var _scrollStopTimeoutId;
//naming:
var _strMinusHidden = '-hidden';
var _strMarginMinus = 'margin-';
var _strPaddingMinus = 'padding-';
var _strBorderMinus = 'border-';
var _strTop = 'top';
var _strRight = 'right';
var _strBottom = 'bottom';
var _strLeft = 'left';
var _strMinMinus = 'min-';
var _strMaxMinus = 'max-';
var _strWidth = 'width';
var _strHeight = 'height';
var _strFloat = 'float';
var _strEmpty = '';
var _strAuto = 'auto';
var _strScroll = 'scroll';
var _strHundredPercent = '100%';
var _strX = 'x';
var _strY = 'y';
var _strDot = '.';
var _strSpace = ' ';
var _strScrollbar = 'scrollbar';
var _strMinusHorizontal = '-horizontal';
var _strMinusVertical = '-vertical';
var _strScrollLeft = _strScroll + 'Left';
var _strScrollTop = _strScroll + 'Top';
var _strMouseTouchDownEvent = 'mousedown touchstart';
var _strMouseTouchUpEvent = 'mouseup touchend touchcancel';
var _strMouseTouchMoveEvent = 'mousemove touchmove';
var _strMouseTouchEnter = 'mouseenter';
var _strMouseTouchLeave = 'mouseleave';
var _strKeyDownEvent = 'keydown';
var _strKeyUpEvent = 'keyup';
var _strSelectStartEvent = 'selectstart';
var _strTransitionEndEvent = 'transitionend webkitTransitionEnd oTransitionEnd';
var _strResizeObserverProperty = '__overlayScrollbarsRO__';
//class names:
var _cassNamesPrefix = 'os-';
var _classNameHTMLElement = _cassNamesPrefix + 'html';
var _classNameHostElement = _cassNamesPrefix + 'host';
var _classNameHostTextareaElement = _classNameHostElement + '-textarea';
var _classNameHostScrollbarHorizontalHidden = _classNameHostElement + '-' + _strScrollbar + _strMinusHorizontal + _strMinusHidden;
var _classNameHostScrollbarVerticalHidden = _classNameHostElement + '-' + _strScrollbar + _strMinusVertical + _strMinusHidden;
var _classNameHostTransition = _classNameHostElement + '-transition';
var _classNameHostRTL = _classNameHostElement + '-rtl';
var _classNameHostResizeDisabled = _classNameHostElement + '-resize-disabled';
var _classNameHostScrolling = _classNameHostElement + '-scrolling';
var _classNameHostOverflow = _classNameHostElement + '-overflow';
var _classNameHostOverflowX = _classNameHostOverflow + '-x';
var _classNameHostOverflowY = _classNameHostOverflow + '-y';
var _classNameTextareaElement = _cassNamesPrefix + 'textarea';
var _classNameTextareaCoverElement = _classNameTextareaElement + '-cover';
var _classNamePaddingElement = _cassNamesPrefix + 'padding';
var _classNameViewportElement = _cassNamesPrefix + 'viewport';
var _classNameViewportNativeScrollbarsInvisible = _classNameViewportElement + '-native-scrollbars-invisible';
var _classNameViewportNativeScrollbarsOverlaid = _classNameViewportElement + '-native-scrollbars-overlaid';
var _classNameContentElement = _cassNamesPrefix + 'content';
var _classNameContentArrangeElement = _cassNamesPrefix + 'content-arrange';
var _classNameContentGlueElement = _cassNamesPrefix + 'content-glue';
var _classNameSizeAutoObserverElement = _cassNamesPrefix + 'size-auto-observer';
var _classNameResizeObserverElement = _cassNamesPrefix + 'resize-observer';
var _classNameResizeObserverItemElement = _cassNamesPrefix + 'resize-observer-item';
var _classNameResizeObserverItemFinalElement = _classNameResizeObserverItemElement + '-final';
var _classNameTextInherit = _cassNamesPrefix + 'text-inherit';
var _classNameScrollbar = _cassNamesPrefix + _strScrollbar;
var _classNameScrollbarTrack = _classNameScrollbar + '-track';
var _classNameScrollbarTrackOff = _classNameScrollbarTrack + '-off';
var _classNameScrollbarHandle = _classNameScrollbar + '-handle';
var _classNameScrollbarHandleOff = _classNameScrollbarHandle + '-off';
var _classNameScrollbarUnusable = _classNameScrollbar + '-unusable';
var _classNameScrollbarAutoHidden = _classNameScrollbar + '-' + _strAuto + _strMinusHidden;
var _classNameScrollbarCorner = _classNameScrollbar + '-corner';
var _classNameScrollbarCornerResize = _classNameScrollbarCorner + '-resize';
var _classNameScrollbarCornerResizeB = _classNameScrollbarCornerResize + '-both';
var _classNameScrollbarCornerResizeH = _classNameScrollbarCornerResize + _strMinusHorizontal;
var _classNameScrollbarCornerResizeV = _classNameScrollbarCornerResize + _strMinusVertical;
var _classNameScrollbarHorizontal = _classNameScrollbar + _strMinusHorizontal;
var _classNameScrollbarVertical = _classNameScrollbar + _strMinusVertical;
var _classNameDragging = _cassNamesPrefix + 'dragging';
var _classNameThemeNone = _cassNamesPrefix + 'theme-none';
//options:
var _defaultOptions;
var _currentOptions;
var _currentPreparedOptions;
//extensions:
var _extensions = { };
var _extensionsPrivateMethods = "added removed on contract";
//update
var _lastUpdateTime;
var _swallowedUpdateParams = { };
var _swallowedUpdateTimeout;
var _swallowUpdateLag = 42;
var _imgs = [ ];
//DOM elements:
var _windowElement;
var _documentElement;
var _htmlElement;
var _bodyElement;
var _targetElement; //the target element of this OverlayScrollbars object
var _hostElement; //the host element of this OverlayScrollbars object -> may be the same as targetElement
var _sizeAutoObserverElement; //observes size auto changes
var _sizeObserverElement; //observes size and padding changes
var _contentGlueElement; //has always the size of the content element
var _paddingElement; //manages the padding
var _viewportElement; //is the viewport of our scrollbar model
var _contentArrangeElement; //is needed for correct sizing of the content element (only if native scrollbars are overlays)
var _contentElement; //the element which holds the content
var _textareaCoverElement; //only applied if target is a textarea element. Used for correct size calculation and for prevention of uncontrolled scrolling
var _scrollbarCornerElement;
var _scrollbarHorizontalElement;
var _scrollbarHorizontalTrackElement;
var _scrollbarHorizontalHandleElement;
var _scrollbarVerticalElement;
var _scrollbarVerticalTrackElement;
var _scrollbarVerticalHandleElement;
//Cache:
var _hostSizeCache;
var _contentScrollSizeCache;
var _arrangeContentSizeCache;
var _hasOverflowCache;
var _hideOverflowCache;
var _widthAutoCache;
var _heightAutoCache;
var _cssMaxValueCache;
var _cssBoxSizingCache;
var _cssPaddingCache;
var _cssBorderCache;
var _cssMarginCache;
var _cssDirectionCache;
var _cssDirectionDetectedCache;
var _paddingAbsoluteCache;
var _clipAlwaysCache;
var _contentGlueSizeCache;
var _overflowBehaviorCache;
var _overflowAmountCache;
var _ignoreOverlayScrollbarHidingCache;
var _autoUpdateCache;
var _sizeAutoCapableCache;
var _textareaAutoWrappingCache;
var _textareaInfoCache;
var _updateAutoHostElementIdCache;
var _updateAutoHostElementClassCache;
var _updateAutoHostElementStyleCache;
var _updateAutoHostElementVisibleCache;
var _updateAutoTargetElementRowsCache;
var _updateAutoTargetElementColsCache;
var _updateAutoTargetElementWrapCache;
var _contentElementScrollSizeChangeDetectedCache;
var _hostElementSizeChangeDetectedCache;
var _scrollbarsVisibilityCache;
var _scrollbarsAutoHideCache;
var _scrollbarsClickScrollingCache;
var _scrollbarsDragScrollingCache;
var _resizeCache;
var _normalizeRTLCache;
var _classNameCache;
var _oldClassName;
var _textareaDynHeightCache;
var _textareaDynWidthCache;
var _bodyMinSizeCache;
var _viewportScrollSizeCache;
var _displayIsHiddenCache;
//MutationObserver:
var _mutationObserverContentLag = 11;
var _mutationObserverHost;
var _mutationObserverContent;
var _mutationObserverConnected;
var _supportMutationObserver;
//textarea:
var _textareaKeyDownRestrictedKeyCodes = [
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, //F1 to F12
33, 34, //page up, page down
37, 38, 39, 40, //left, up, right, down arrows
16, 17, 18, 19, 20, 144 //Shift, Ctrl, Alt, Pause, CapsLock, NumLock
];
var _textareaKeyDownKeyCodesList = [ ];
var _textareaUpdateIntervalID;
var _textareaHasFocus;
//scrollbars:
var _scrollbarsAutoHideTimeoutId;
var _scrollbarsAutoHideMoveTimeoutId;
var _scrollbarsAutoHideDelay;
var _scrollbarsAutoHideNever;
var _scrollbarsAutoHideScroll;
var _scrollbarsAutoHideMove;
var _scrollbarsAutoHideLeave;
var _scrollbarsTouchSupport;
var _scrollbarsAutoHideFlagScrollAndHovered;
//resize
var _resizeReconnectMutationObserver;
var _resizeNone;
var _resizeBoth;
var _resizeHorizontal;
var _resizeVertical;
var _resizeDragStartPosition = { };
var _resizeDragStartSize = { };
//==== Add / Remove Passive Event Listener ====//
/**
* Adds a passive event listener to the given element.
* @param element The element to which the event listener shall be applied.
* @param eventNames The name(s) of the event listener.
* @param listener The listener method which shall be called.
*/
function addPassiveEventListener(element, eventNames, listener) {
var events = eventNames.split(_strSpace);
for (var i = 0; i < events.length; i++)
element[0].addEventListener(events[i], listener, {passive: true});
}
/**
* Removes a passive event listener to the given element.
* @param element The element from which the event listener shall be removed.
* @param eventNames The name(s) of the event listener.
* @param listener The listener method which shall be removed.
*/
function removePassiveEventListener(element, eventNames, listener) {
var events = eventNames.split(_strSpace);
for (var i = 0; i < events.length; i++)
element[0].removeEventListener(events[i], listener, {passive: true});
}
//==== Add / Remove / Freeze / Unfreeze Resize Observer ====//
/**
* Adds a resize observer to the given element.
* @param targetElement The element to which the resize observer shall be applied.
* @param onElementResizedCallback The callback which is fired every time the resize observer registers a size change.
*/
function addResizeObserver(targetElement, onElementResizedCallback) {
var constMaximum = 3333333;
var resizeObserver = COMPATIBILITY.rO();
var strAnimationStartEvent = 'animationstart mozAnimationStart webkitAnimationStart MSAnimationStart';
var strChildNodes = 'childNodes';
var callback = function () {
targetElement[_strScrollTop](constMaximum)[_strScrollLeft](_isRTL ? _rtlScrollBehavior.n ? -constMaximum : _rtlScrollBehavior.i ? 0 : constMaximum : constMaximum);
onElementResizedCallback();
};
if (_supportResizeObserver) {
var element = targetElement.append(generateDiv(_classNameResizeObserverElement + ' observed')).contents()[0];
var observer = element[_strResizeObserverProperty] = new resizeObserver(callback);
observer.observe(element);
}
else {
if (_msieVersion > 9 || !_autoUpdateRecommended) {
targetElement.prepend(
generateDiv(_classNameResizeObserverElement,
generateDiv({ className : _classNameResizeObserverItemElement, dir : "ltr" },
generateDiv(_classNameResizeObserverItemElement,
generateDiv(_classNameResizeObserverItemFinalElement)
) +
generateDiv(_classNameResizeObserverItemElement,
generateDiv({ className : _classNameResizeObserverItemFinalElement, style : 'width: 200%; height: 200%' })
)
)
)
);
var observerElement = targetElement[0][strChildNodes][0][strChildNodes][0];
var shrinkElement = FRAMEWORK(observerElement[strChildNodes][1]);
var expandElement = FRAMEWORK(observerElement[strChildNodes][0]);
var expandElementChild = FRAMEWORK(expandElement[0][strChildNodes][0]);
var widthCache = observerElement[LEXICON.oW];
var heightCache = observerElement[LEXICON.oH];
var isDirty;
var rAFId;
var currWidth;
var currHeight;
var factor = 2;
var nativeScrollbarSize = globals.nativeScrollbarSize; //care don't make changes to this object!!!
var reset = function () {
/*
var sizeResetWidth = observerElement[LEXICON.oW] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
var sizeResetHeight = observerElement[LEXICON.oH] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
var expandChildCSS = {};
expandChildCSS[_strWidth] = sizeResetWidth;
expandChildCSS[_strHeight] = sizeResetHeight;
expandElementChild.css(expandChildCSS);
expandElement[_strScrollLeft](sizeResetWidth)[_strScrollTop](sizeResetHeight);
shrinkElement[_strScrollLeft](sizeResetWidth)[_strScrollTop](sizeResetHeight);
*/
expandElement[_strScrollLeft](constMaximum)[_strScrollTop](constMaximum);
shrinkElement[_strScrollLeft](constMaximum)[_strScrollTop](constMaximum);
};
var onResized = function () {
rAFId = 0;
if (!isDirty)
return;
widthCache = currWidth;
heightCache = currHeight;
callback();
};
var onScroll = function (event) {
currWidth = observerElement[LEXICON.oW];
currHeight = observerElement[LEXICON.oH];
isDirty = currWidth != widthCache || currHeight != heightCache;
if (event && isDirty && !rAFId) {
COMPATIBILITY.cAF()(rAFId);
rAFId = COMPATIBILITY.rAF()(onResized);
}
else if(!event)
onResized();
reset();
if (event) {
COMPATIBILITY.prvD(event);
COMPATIBILITY.stpP(event);
}
return false;
};
var expandChildCSS = {};
var observerElementCSS = {};
observerElementCSS[_strTop] = (-((nativeScrollbarSize.y + 1) * factor));
observerElementCSS[_strRight] = (nativeScrollbarSize.x * -factor);
observerElementCSS[_strBottom] = (nativeScrollbarSize.y * -factor);
observerElementCSS[_strLeft] = (-((nativeScrollbarSize.x + 1) * factor));
FRAMEWORK(observerElement).css(observerElementCSS);
expandElement.on(_strScroll, onScroll);
shrinkElement.on(_strScroll, onScroll);
targetElement.on(strAnimationStartEvent, function () {
onScroll(false);
});
//lets assume that the divs will never be that large and a constant value is enough
expandChildCSS[_strWidth] = constMaximum;
expandChildCSS[_strHeight] = constMaximum;
expandElementChild.css(expandChildCSS);
reset();
}
else {
var doc = _documentElement[0];
var attachEvent = doc.attachEvent;
var isIE = _msieVersion !== undefined;
if (attachEvent) {
targetElement.prepend(generateDiv(_classNameResizeObserverElement));
findFirst(targetElement, _strDot + _classNameResizeObserverElement)[0].attachEvent('onresize', callback);
}
else {
var obj = doc.createElement(TYPES.o);
obj.setAttribute('tabindex', '-1');
obj.setAttribute(LEXICON.c, _classNameResizeObserverElement);
obj.onload = function () {
var wnd = this.contentDocument.defaultView;
wnd.addEventListener('resize', callback);
wnd.document.documentElement.style.display = 'none';
};
obj.type = 'text/html';
if (isIE)
targetElement.prepend(obj);
obj.data = 'about:blank';
if (!isIE)
targetElement.prepend(obj);
targetElement.on(strAnimationStartEvent, callback);
}
}
}
//direction change detection:
if (targetElement[0] === _sizeObserverElement[0]) {
var directionChanged = function () {
var dir = _hostElement.css('direction');
var css = {};
var scrollLeftValue = 0;
var result = false;
if (dir !== _cssDirectionDetectedCache) {
if (dir === 'ltr') {
css[_strLeft] = 0;
css[_strRight] = _strAuto;
scrollLeftValue = constMaximum;
}
else {
css[_strLeft] = _strAuto;
css[_strRight] = 0;
scrollLeftValue = _rtlScrollBehavior.n ? -constMaximum : _rtlScrollBehavior.i ? 0 : constMaximum;
}
_sizeObserverElement.children().eq(0).css(css);
targetElement[_strScrollLeft](scrollLeftValue)[_strScrollTop](constMaximum);
_cssDirectionDetectedCache = dir;
result = true;
}
return result;
};
directionChanged();
targetElement.on(_strScroll, function (event) {
if (directionChanged())
update();
COMPATIBILITY.prvD(event);
COMPATIBILITY.stpP(event);
return false;
});
}
}
/**
* Removes a resize observer from the given element.
* @param targetElement The element to which the target resize observer is applied.
*/
function removeResizeObserver(targetElement) {
if (_supportResizeObserver) {
var element = targetElement.contents()[0];
element[_strResizeObserverProperty].disconnect();
delete element[_strResizeObserverProperty];
}
else {
remove(targetElement.children(_strDot + _classNameResizeObserverElement).eq(0));
}
}
/**
* Freezes the given resize observer.
* @param targetElement The element to which the target resize observer is applied.
*/
function freezeResizeObserver(targetElement) {
if (targetElement !== undefined) {
/*
if (_supportResizeObserver) {
var element = targetElement.contents()[0];
element[_strResizeObserverProperty].unobserve(element);
}
else {
targetElement = targetElement.children(_strDot + _classNameResizeObserverElement).eq(0);
var w = targetElement.css(_strWidth);
var h = targetElement.css(_strHeight);
var css = {};
css[_strWidth] = w;
css[_strHeight] = h;
targetElement.css(css);
}
*/
}
}
/**
* Unfreezes the given resize observer.
* @param targetElement The element to which the target resize observer is applied.
*/
function unfreezeResizeObserver(targetElement) {
if (targetElement !== undefined) {
/*
if (_supportResizeObserver) {
var element = targetElement.contents()[0];
element[_strResizeObserverProperty].observe(element);
}
else {
var css = { };
css[_strHeight] = _strEmpty;
css[_strWidth] = _strEmpty;
targetElement.children(_strDot + _classNameResizeObserverElement).eq(0).css(css);
}
*/
}
}
//==== Connect / Disconnect Mutation Observer ====//
/**
* Connects the MutationObservers if they are supported.
*/
function mutationObserversConnect() {
if (_supportMutationObserver && !_mutationObserverConnected) {
_mutationObserverHost.observe(_hostElement[0], {
attributes: true,
attributeOldValue: true,
attributeFilter: [LEXICON.i, LEXICON.c, LEXICON.s]
});
_mutationObserverContent.observe(_isTextarea ? _targetElement[0] : _contentElement[0], {
attributes: true,
attributeOldValue: true,
subtree: !_isTextarea,
childList: !_isTextarea,
characterData: !_isTextarea,
attributeFilter: _isTextarea ? ['wrap', 'cols', 'rows'] : [LEXICON.i, LEXICON.c, LEXICON.s]
});
_mutationObserverConnected = true;
}
}
/**
* Disconnects the MutationObservers if they are supported.
*/
function mutationObserversDisconnect() {
if (_supportMutationObserver && _mutationObserverConnected) {
_mutationObserverHost.disconnect();
_mutationObserverContent.disconnect();
_mutationObserverConnected = false;
}
}
//==== Events of elements ====//
/**
* This method gets called every time the host element gets resized. IMPORTANT: Padding changes are detected too!!
* It refreshes the hostResizedEventArgs and the hostSizeResizeCache.
* If there are any size changes, the update method gets called.
*/
function hostOnResized() {
if (_isSleeping)
return;
var measureElement = _sizeObserverElement[0];
var hostSize = {
w: measureElement[LEXICON.sW],
h: measureElement[LEXICON.sH]
};
if (_initialized) {
var changed = checkCacheDouble(hostSize, _hostElementSizeChangeDetectedCache);
_hostElementSizeChangeDetectedCache = hostSize;
if (changed)
update(true, false);
}
else {
_hostElementSizeChangeDetectedCache = hostSize;
}
}
/**
* The mouse enter event of the host element. This event is only needed for the autoHide feature.
*/
function hostOnMouseEnter() {
if (_scrollbarsAutoHideLeave)
refreshScrollbarsAutoHide(true);
}
/**
* The mouse leave event of the host element. This event is only needed for the autoHide feature.
*/
function hostOnMouseLeave() {
if (_scrollbarsAutoHideLeave && !_bodyElement.hasClass(_classNameDragging))
refreshScrollbarsAutoHide(false);
}
/**
* The mouse move event of the host element. This event is only needed for the autoHide "move" feature.
*/
function hostOnMouseMove() {
if (_scrollbarsAutoHideMove) {
refreshScrollbarsAutoHide(true);
clearTimeout(_scrollbarsAutoHideMoveTimeoutId);
_scrollbarsAutoHideMoveTimeoutId = setTimeout(function () {
if (_scrollbarsAutoHideMove && !_destroyed)
refreshScrollbarsAutoHide(false);
}, 100);
}
}
/**
* The scroll event of the viewport element. That is the main scroll event. It controls also the "scroll", "scrollStart" and "scrollStop" callbacks.
* @param event The scroll event.
*/
function viewportOnScroll(event) {
if (_isSleeping)
return;
if (_scrollStopTimeoutId !== undefined)
clearTimeout(_scrollStopTimeoutId);
else {
if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)
refreshScrollbarsAutoHide(true);
if (!nativeOverlayScrollbarsAreActive())
addClass(_hostElement, _classNameHostScrolling);
callCallback("onScrollStart", event);
}
refreshScrollbarHandleOffset(true, _viewportElement[_strScrollLeft]());
refreshScrollbarHandleOffset(false, _viewportElement[_strScrollTop]());
callCallback("onScroll", event);
_scrollStopTimeoutId = setTimeout(function () {
if(!_destroyed) {
viewportOnScrollStop();
callCallback("onScrollStop", event);
}
}, _scrollStopDelay);
}
/**
* This method gets called if the scroll event stopped for a specified amount of time.
*/
function viewportOnScrollStop() {
clearTimeout(_scrollStopTimeoutId);
_scrollStopTimeoutId = undefined;
if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)
refreshScrollbarsAutoHide(false);
if (!nativeOverlayScrollbarsAreActive())
removeClass(_hostElement, _classNameHostScrolling);
}
/**
* The key input event of the textarea element.
*/
function textareaOnInput() {
textareaUpdate();
_base.update(_strAuto);
}
/**
* The key down event of the textarea element. Is only applied if the input event isn't fully supported.
* @param event The key down event.
*/
function textareaOnKeyDown(event) {
var keyCode = event.keyCode;
if (textareaIsRestrictedKeyCode(keyCode))
return;
if (_textareaKeyDownKeyCodesList.length === 0) {
var action = function () {
textareaUpdate();
_base.update(_strAuto);
};
action();
_textareaUpdateIntervalID = setInterval(action, 1000 / 60);
}
if (FRAMEWORK.inArray(keyCode, _textareaKeyDownKeyCodesList) === -1)
_textareaKeyDownKeyCodesList.push(keyCode);
}
/**
* The key up event of the textarea element. Is only applied if the input event isn't fully supported.
* @param event The key up event.
*/
function textareaOnKeyUp(event) {
var keyCode = event.keyCode;
if (textareaIsRestrictedKeyCode(keyCode))
return;
var index = FRAMEWORK.inArray(keyCode, _textareaKeyDownKeyCodesList);
if (index > -1)
_textareaKeyDownKeyCodesList.splice(index, 1);
if (_textareaKeyDownKeyCodesList.length === 0) {
textareaUpdate();
_base.update(_strAuto);
clearInterval(_textareaUpdateIntervalID);
}
}
/**
* The drop event of the textarea element.
*/
function textareaOnDrop() {
setTimeout(function () {
if(!_destroyed) {
textareaUpdate();
_base.update(_strAuto);
}
}, 50);
}
/**
* The focus event of the textarea element.
*/
function textareaOnFocus() {
_textareaHasFocus = true;
}
/**
* The focus out event of the textarea element.
*/
function textareaOnFocusOut() {
_textareaHasFocus = false;
clearInterval(_textareaUpdateIntervalID);
_textareaKeyDownKeyCodesList = [ ];
textareaUpdate();
_base.update(_strAuto);
}
/**
* The scroll event of the textarea element.
* @param event The scroll event.
*/
function textareaOnScroll(event) {
_targetElement[_strScrollLeft](_rtlScrollBehavior.i && _normalizeRTLCache ? 9999999 : 0);
_targetElement[_strScrollTop](0);
COMPATIBILITY.prvD(event);
COMPATIBILITY.stpP(event);
return false;
}
/**
* The mouse down event of the scrollbar corner element.
* @param event The mouse down event.
*/
function scrollbarCornerOnMouseDown(event) {
if (_isSleeping)
return;
var originalEvent = event.originalEvent || event;
var isTouchEvent = originalEvent.touches !== undefined;
if (COMPATIBILITY.mBtn(event) === 1 || isTouchEvent) {
if (_mutationObserverConnected) {
_resizeReconnectMutationObserver = true;
mutationObserversDisconnect();
}
_resizeDragStartPosition = COMPATIBILITY.page(event);
_resizeDragStartSize.w = _hostElement[0][LEXICON.oW] - (!_isBorderBox ? _paddingX : 0);
_resizeDragStartSize.h = _hostElement[0][LEXICON.oH] - (!_isBorderBox ? _paddingY : 0);
_documentElement.on(_strSelectStartEvent, documentOnSelectStart)
.on(_strMouseTouchMoveEvent, scrollbarCornerOnResize)
.on(_strMouseTouchUpEvent, scrollbarCornerOnResized);
addClass(_bodyElement, _classNameDragging);
if (_scrollbarCornerElement.setCapture)
_scrollbarCornerElement.setCapture();
COMPATIBILITY.prvD(event);
COMPATIBILITY.stpP(event);
}
}
/**
* The mouse move event if the scrollbar corner element is resizable and gets dragged.
* @param event The mouse move event.
*/
function scrollbarCornerOnResize(event) {
var pageOffset = COMPATIBILITY.page(event);
var hostElementCSS = { };
if (_resizeHorizontal || _resizeBoth)
hostElementCSS[_strWidth] = (_resizeDragStartSize.w + pageOffset.x - _resizeDragStartPosition.x);
if (_resizeVertical || _resizeBoth)
hostElementCSS[_strHeight] = (_resizeDragStartSize.h + pageOffset.y - _resizeDragStartPosition.y);
_hostElement.css(hostElementCSS);
COMPATIBILITY.stpP(event);
}
/**
* The mouse up event if the scrollbar corner element is resizable and was dragged and now the mouse button is released.
* @param event The mouse up event.
*/
function scrollbarCornerOnResized(event) {
var eventIsTrusted = event !== undefined;
_documentElement.off(_strSelectStartEvent, documentOnSelectStart)
.off(_strMouseTouchMoveEvent, scrollbarCornerOnResize)
.off(_strMouseTouchUpEvent, scrollbarCornerOnResized);
removeClass(_bodyElement, _classNameDragging);
if (_scrollbarCornerElement.releaseCapture)
_scrollbarCornerElement.releaseCapture();
if (eventIsTrusted) {
if (_resizeReconnectMutationObserver)
mutationObserversConnect();
_base.update(_strAuto);
}
_resizeReconnectMutationObserver = false;
}
/**
* Prevents text from deselection if attached to the document element on the mousedown event of a DOM element.
* @param event The select start event.
*/
function documentOnSelectStart(event) {
COMPATIBILITY.prvD(event);
return false;
}
/**
* A callback which will be called after a img element has downloaded its src asynchronous.
*/
function imgOnLoad() {
update();
}
//==== Update Detection ====//
/**
* Measures the min width and min height of the body element and refreshes the related cache.
* @returns {boolean} True if the min width or min height has changed, false otherwise.
*/
function bodyMinSizeChanged() {
var bodyMinSize = {};
if (_isBody && _contentArrangeElement) {
bodyMinSize.w = parseToZeroOrNumber(_contentArrangeElement.css(_strMinMinus + _strWidth));
bodyMinSize.h = parseToZeroOrNumber(_contentArrangeElement.css(_strMinMinus + _strHeight));
bodyMinSize.c = checkCacheDouble(bodyMinSize, _bodyMinSizeCache);
bodyMinSize.f = true; //flag for "measured at least once"
}
_bodyMinSizeCache = bodyMinSize;
return bodyMinSize.c || false;
}
/**
* Returns true if the class names really changed (new class without plugin host prefix)
* @param oldCassNames The old ClassName string.
* @param newClassNames The new ClassName string.
* @returns {boolean} True if the class names has really changed, false otherwise.
*/
function hostClassNamesChanged(oldCassNames, newClassNames) {
var currClasses = (newClassNames !== undefined && newClassNames !== null) ? newClassNames.split(_strSpace) : _strEmpty;
var oldClasses = (oldCassNames !== undefined && oldCassNames !== null) ? oldCassNames.split(_strSpace) : _strEmpty;
if (currClasses === _strEmpty && oldClasses === _strEmpty)
return false;
var diff = getArrayDifferences(oldClasses, currClasses);
var changed = false;
var oldClassNames = _oldClassName !== undefined && _oldClassName !== null ? _oldClassName.split(_strSpace) : [_strEmpty];
var currClassNames = _classNameCache !== undefined && _classNameCache !== null ? _classNameCache.split(_strSpace) : [_strEmpty];
//remove none theme from diff list to prevent update
var idx = FRAMEWORK.inArray(_classNameThemeNone, diff);
var curr = diff[i];
var i;
var v;
var o;
var c;
if (idx > -1)
diff.splice(idx, 1);
for (i = 0; i < diff.length; i++) {
curr = diff[i];
if (curr.indexOf(_classNameHostElement) !== 0) {
o = true;
c = true;
for (v = 0; v < oldClassNames.length; v++) {
if (curr === oldClassNames[v]) {
o = false;
break;
}
}
for (v = 0; v < currClassNames.length; v++) {
if (curr === currClassNames[v]) {
c = false;
break;
}
}
if (o && c) {
changed = true;
break;
}
}
}
return changed;
}
/**
* Returns true if the given mutation is not from a from the plugin generated element. If the target element is a textarea the mutation is always unknown.
* @param mutation The mutation which shall be checked.
* @returns {boolean} True if the mutation is from a unknown element, false otherwise.
*/
function isUnknownMutation(mutation) {
var attributeName = mutation.attributeName;
var mutationTarget = mutation.target;
var mutationType = mutation.type;
var strClosest = 'closest';
if (mutationTarget === _contentElement[0])
return attributeName === null;
if (mutationType === 'attributes' && (attributeName === LEXICON.c || attributeName === LEXICON.s) && !_isTextarea) {
//only do it of browser support it natively
if (typeof mutationTarget[strClosest] != TYPES.f)
return true;
if (mutationTarget[strClosest](_strDot + _classNameResizeObserverElement) !== null ||
mutationTarget[strClosest](_strDot + _classNameScrollbar) !== null ||
mutationTarget[strClosest](_strDot + _classNameScrollbarCorner) !== null)
return false;
}
return true;
}
/**
* Returns true if the content size was changed since the last time this method was called.
* @returns {boolean} True if the content size was changed, false otherwise.
*/
function updateAutoContentSizeChanged() {
if (_isSleeping)
return false;
var float;
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
var setCSS = !_mutationObserverConnected && _widthAutoCache && !_isTextarea;
var viewportScrollSize = { };
var css = { };
//fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1439305, it only works with "clipAlways : true"
//it can work with "clipAlways : false" too, but we had to set the overflow of the viewportElement to hidden every time before measuring
if(_restrictedMeasuring) {
viewportScrollSize = {
x : _viewportElement[0][LEXICON.sW],
y : _viewportElement[0][LEXICON.sH]
}
}
if (setCSS) {
float = _contentElement.css(_strFloat);
css[_strFloat] = _isRTL ? _strRight : _strLeft;
css[_strWidth] = _strAuto;
_contentElement.css(css);
}
var contentElementScrollSize = {
w: getContentMeasureElement()[LEXICON.sW] + textareaValueLength,
h: getContentMeasureElement()[LEXICON.sH] + textareaValueLength
};
if (setCSS) {
css[_strFloat] = float;
css[_strWidth] = _strHundredPercent;
_contentElement.css(css);
}
var bodyMinSizeC = bodyMinSizeChanged();
var changed = checkCacheDouble(contentElementScrollSize, _contentElementScrollSizeChangeDetectedCache);
var viewportScrollSizeChanged = checkCacheDouble(viewportScrollSize, _viewportScrollSizeCache, _strX, _strY);
_contentElementScrollSizeChangeDetectedCache = contentElementScrollSize;
_viewportScrollSizeCache = viewportScrollSize;
return changed || bodyMinSizeC || viewportScrollSizeChanged;
}
/**
* Returns true if the host element attributes (id, class, style) was changed since the last time this method was called.
* @returns {boolean}
*/
function meaningfulAttrsChanged() {
if (_isSleeping || _mutationObserverConnected)
return false;
var hostElementId = _hostElement.attr(LEXICON.i) || _strEmpty;
var hostElementIdChanged = checkCacheSingle(hostElementId, _updateAutoHostElementIdCache);
var hostElementClass = _hostElement.attr(LEXICON.c) || _strEmpty;
var hostElementClassChanged = checkCacheSingle(hostElementClass, _updateAutoHostElementClassCache);
var hostElementStyle = _hostElement.attr(LEXICON.s) || _strEmpty;
var hostElementStyleChanged = checkCacheSingle(hostElementStyle, _updateAutoHostElementStyleCache);
var hostElementVisible = _hostElement.is(':visible') || _strEmpty;
var hostElementVisibleChanged = checkCacheSingle(hostElementVisible, _updateAutoHostElementVisibleCache);
var targetElementRows = _isTextarea ? (_targetElement.attr('rows') || _strEmpty) : _strEmpty;
var targetElementRowsChanged = checkCacheSingle(targetElementRows, _updateAutoTargetElementRowsCache);
var targetElementCols = _isTextarea ? (_targetElement.attr('cols') || _strEmpty) : _strEmpty;
var targetElementColsChanged = checkCacheSingle(targetElementCols, _updateAutoTargetElementColsCache);
var targetElementWrap = _isTextarea ? (_targetElement.attr('wrap') || _strEmpty) : _strEmpty;
var targetElementWrapChanged = checkCacheSingle(targetElementWrap, _updateAutoTargetElementWrapCache);
_updateAutoHostElementIdCache = hostElementId;
if (hostElementClassChanged)
hostElementClassChanged = hostClassNamesChanged(_updateAutoHostElementClassCache, hostElementClass);
_updateAutoHostElementClassCache = hostElementClass;
_updateAutoHostElementStyleCache = hostElementStyle;
_updateAutoHostElementVisibleCache = hostElementVisible;
_updateAutoTargetElementRowsCache = targetElementRows;
_updateAutoTargetElementColsCache = targetElementCols;
_updateAutoTargetElementWrapCache = targetElementWrap;
return hostElementIdChanged || hostElementClassChanged || hostElementStyleChanged || hostElementVisibleChanged || targetElementRowsChanged || targetElementColsChanged || targetElementWrapChanged;
}
/**
* Checks is a CSS Property of a child element is affecting the scroll size of the content.
* @param propertyName The CSS property name.
* @returns {boolean} True if the property is affecting the content scroll size, false otherwise.
*/
function isSizeAffectingCSSProperty(propertyName) {
if (!_initialized)
return true;
var flexGrow = 'flex-grow';
var flexShrink = 'flex-shrink';
var flexBasis = 'flex-basis';
var affectingPropsX = [
_strWidth,
_strMinMinus + _strWidth,
_strMaxMinus + _strWidth,
_strMarginMinus + _strLeft,
_strMarginMinus + _strRight,
_strLeft,
_strRight,
'font-weight',
'word-spacing',
flexGrow,
flexShrink,
flexBasis
];
var affectingPropsXContentBox = [
_strPaddingMinus + _strLeft,
_strPaddingMinus + _strRight,
_strBorderMinus + _strLeft + _strWidth,
_strBorderMinus + _strRight + _strWidth
];
var affectingPropsY = [
_strHeight,
_strMinMinus + _strHeight,
_strMaxMinus + _strHeight,
_strMarginMinus + _strTop,
_strMarginMinus + _strBottom,
_strTop,
_strBottom,
'line-height',
flexGrow,
flexShrink,
flexBasis
];
var affectingPropsYContentBox = [
_strPaddingMinus + _strTop,
_strPaddingMinus + _strBottom,
_strBorderMinus + _strTop + _strWidth,
_strBorderMinus + _strBottom + _strWidth
];
var _strS = 's';
var _strVS = 'v-s';
var checkX = _overflowBehaviorCache.x === _strS || _overflowBehaviorCache.x === _strVS;
var checkY = _overflowBehaviorCache.y === _strS || _overflowBehaviorCache.y === _strVS;
var sizeIsAffected = false;
var checkPropertyName = function (arr, name) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === name)
return true;
}
return false;
};
if (checkY) {
sizeIsAffected = checkPropertyName(affectingPropsY, propertyName);
if (!sizeIsAffected && !_isBorderBox)
sizeIsAffected = checkPropertyName(affectingPropsYContentBox, propertyName);
}
if (checkX && !sizeIsAffected) {
sizeIsAffected = checkPropertyName(affectingPropsX, propertyName);
if (!sizeIsAffected && !_isBorderBox)
sizeIsAffected = checkPropertyName(affectingPropsXContentBox, propertyName);
}
return sizeIsAffected;
}
//==== Update ====//
/**
* Updates the variables and size of the textarea element, and manages the scroll on new line or new character.
*/
function textareaUpdate() {
if (_isSleeping)
return;
var wrapAttrOff = !_textareaAutoWrappingCache;
var minWidth = _viewportSize.w - (!_isBorderBox && !_paddingAbsoluteCache && _widthAutoCache ? _paddingY + _borderY : 0);
var minHeight = _viewportSize.h - (!_isBorderBox && !_paddingAbsoluteCache && _heightAutoCache ? _paddingY + _borderY : 0);
var css = { };
var doMeasure = _widthAutoCache || wrapAttrOff;
var measureElement = _targetElement[0];
var origWidth;
var width;
var origHeight;
var height;
//reset min size
css[_strMinMinus + _strWidth] = _strEmpty;
css[_strMinMinus + _strHeight] = _strEmpty;
//set width auto
css[_strWidth] = _strAuto;
_targetElement.css(css);
//measure width
origWidth = measureElement[LEXICON.oW];
width = doMeasure ? Math.max(origWidth, measureElement[LEXICON.sW] - 1) : 1;
width += (_widthAutoCache ? _marginX + (!_isBorderBox ? wrapAttrOff ? 0 : _paddingX + _borderX : 0) : 0);
//set measured width and height auto
css[_strWidth] = _widthAutoCache ? width : _strHundredPercent;
css[_strHeight] = _strAuto; //_strAuto
_targetElement.css(css);
//measure height
origHeight = measureElement[LEXICON.oH];
height = Math.max(origHeight, measureElement[LEXICON.sH] - 1);
//append correct size values
css[_strWidth] = width;
css[_strHeight] = height;
_textareaCoverElement.css(css);
//apply min width / min height to prevent textarea collapsing
css[_strMinMinus + _strWidth] = minWidth + (!_isBorderBox && _widthAutoCache ? _paddingX + _borderX : 0);
css[_strMinMinus + _strHeight] = minHeight + (!_isBorderBox && _heightAutoCache ? _paddingY + _borderY : 0);
_targetElement.css(css);
return {
ow: origWidth,
oh: origHeight,
dw: width,
dh: height
};
}
/**
* Updates the plugin and DOM to the current options.
* This method should only be called if a update is 100% required.
* @param hostSizeChanged True if this method was called due to a host size change.
* @param contentSizeChanged True if this method was called due to a content size change.
* @param force True if every property shall be updated and the cache shall be ignored.
* @param preventSwallowing True if this method shall be executed event if it could be swallowed.
*/
function update(hostSizeChanged, contentSizeChanged, force, preventSwallowing) {
var now = COMPATIBILITY.now();
var swallow = _swallowUpdateLag > 0 && _initialized && (now - _lastUpdateTime) < _swallowUpdateLag && (!_heightAutoCache && !_widthAutoCache) && !preventSwallowing;
var displayIsHidden = _hostElement.is(':hidden');
var displayIsHiddenChanged = checkCacheSingle(displayIsHidden, _displayIsHiddenCache, force);
_displayIsHiddenCache = displayIsHidden;
clearTimeout(_swallowedUpdateTimeout);
if (swallow) {
_swallowedUpdateParams.h = hostSizeChanged;
_swallowedUpdateParams.c = contentSizeChanged;
_swallowedUpdateParams.f = force;
_swallowedUpdateTimeout = setTimeout(update, _swallowUpdateLag);
}
//abort update due to:
//destroyed
//swallowing
//sleeping
//host is hidden or has false display
if (_destroyed || swallow || _isSleeping || (_initialized && !force && displayIsHidden) || _hostElement.css('display') === 'inline')
return;
_lastUpdateTime = now;
hostSizeChanged = hostSizeChanged || _swallowedUpdateParams.h;
contentSizeChanged = contentSizeChanged || _swallowedUpdateParams.c;
force = force || _swallowedUpdateParams.f;
_swallowedUpdateParams = {};
hostSizeChanged = hostSizeChanged === undefined ? false : hostSizeChanged;
contentSizeChanged = contentSizeChanged === undefined ? false : contentSizeChanged;
force = force === undefined ? false : force;
//if scrollbar styling is possible and native scrollbars aren't overlaid the scrollbar styling will be applied which hides the native scrollbars completely.
if (_nativeScrollbarStyling && !(_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y)) {
//native scrollbars are hidden, so change the values to zero
_nativeScrollbarSize.x = 0;
_nativeScrollbarSize.y = 0;
}
else {
//refresh native scrollbar size (in case of zoom)
_nativeScrollbarSize = extend(true, {}, globals.nativeScrollbarSize);
}
// Scrollbar padding is needed for firefox, because firefox hides scrollbar automatically if the size of the div is too small.
// The calculation: [scrollbar size +3 *3]
// (+3 because of possible decoration e.g. borders, margins etc., but only if native scrollbar is NOT a overlaid scrollbar)
// (*3 because (1)increase / (2)decrease -button and (3)resize handle)
_nativeScrollbarMinSize = {
x: (_nativeScrollbarSize.x + (_nativeScrollbarIsOverlaid.x ? 0 : 3)) * 3,
y: (_nativeScrollbarSize.y + (_nativeScrollbarIsOverlaid.y ? 0 : 3)) * 3
};
freezeResizeObserver(_sizeObserverElement);
freezeResizeObserver(_sizeAutoObserverElement);
//save current scroll offset
var currScroll = {
l: _viewportElement[_strScrollLeft](),
t: _viewportElement[_strScrollTop]()
};
var currentPreparedOptionsScrollbars = _currentPreparedOptions.scrollbars;
var currentPreparedOptionsTextarea = _currentPreparedOptions.textarea;
//scrollbars visibility:
var scrollbarsVisibility = currentPreparedOptionsScrollbars.visibility;
var scrollbarsVisibilityChanged = checkCacheSingle(scrollbarsVisibility, _scrollbarsVisibilityCache, force);
//scrollbars autoHide:
var scrollbarsAutoHide = currentPreparedOptionsScrollbars.autoHide;
var scrollbarsAutoHideChanged = checkCacheSingle(scrollbarsAutoHide, _scrollbarsAutoHideCache, force);
//scrollbars click scrolling
var scrollbarsClickScrolling = currentPreparedOptionsScrollbars.clickScrolling;
var scrollbarsClickScrollingChanged = checkCacheSingle(scrollbarsClickScrolling, _scrollbarsClickScrollingCache, force);
//scrollbars drag scrolling
var scrollbarsDragScrolling = currentPreparedOptionsScrollbars.dragScrolling;
var scrollbarsDragScrollingChanged = checkCacheSingle(scrollbarsDragScrolling, _scrollbarsDragScrollingCache, force);
//className
var className = _currentPreparedOptions.className;
var classNameChanged = checkCacheSingle(className, _classNameCache, force);
//resize
var resize = _currentPreparedOptions.resize;
var resizeChanged = checkCacheSingle(resize, _resizeCache, force) && !_isBody; //body can't be resized since the window itself acts as resize possibility.
//textarea AutoWrapping
var textareaAutoWrapping = _isTextarea ? _targetElement.attr('wrap') !== 'off' : false;
var textareaAutoWrappingChanged = checkCacheSingle(textareaAutoWrapping, _textareaAutoWrappingCache, force);
//paddingAbsolute
var paddingAbsolute = _currentPreparedOptions.paddingAbsolute;
var paddingAbsoluteChanged = checkCacheSingle(paddingAbsolute, _paddingAbsoluteCache, force);
//clipAlways
var clipAlways = _currentPreparedOptions.clipAlways;
var clipAlwaysChanged = checkCacheSingle(clipAlways, _clipAlwaysCache, force);
//sizeAutoCapable
var sizeAutoCapable = _currentPreparedOptions.sizeAutoCapable && !_isBody; //body can never be size auto, because it shall be always as big as the viewport.
var sizeAutoCapableChanged = checkCacheSingle(sizeAutoCapable, _sizeAutoCapableCache, force);
//showNativeScrollbars
var ignoreOverlayScrollbarHiding = _currentPreparedOptions.nativeScrollbarsOverlaid.showNativeScrollbars;
var ignoreOverlayScrollbarHidingChanged = checkCacheSingle(ignoreOverlayScrollbarHiding, _ignoreOverlayScrollbarHidingCache);
//autoUpdate
var autoUpdate = _currentPreparedOptions.autoUpdate;
var autoUpdateChanged = checkCacheSingle(autoUpdate, _autoUpdateCache);
//overflowBehavior
var overflowBehavior = _currentPreparedOptions.overflowBehavior;
var overflowBehaviorChanged = checkCacheDouble(overflowBehavior, _overflowBehaviorCache, _strX, _strY, force);
//dynWidth:
var textareaDynWidth = currentPreparedOptionsTextarea.dynWidth;
var textareaDynWidthChanged = checkCacheSingle(_textareaDynWidthCache, textareaDynWidth);
//dynHeight:
var textareaDynHeight = currentPreparedOptionsTextarea.dynHeight;
var textareaDynHeightChanged = checkCacheSingle(_textareaDynHeightCache, textareaDynHeight);
//scrollbars visibility
_scrollbarsAutoHideNever = scrollbarsAutoHide === 'n';
_scrollbarsAutoHideScroll = scrollbarsAutoHide === 's';
_scrollbarsAutoHideMove = scrollbarsAutoHide === 'm';
_scrollbarsAutoHideLeave = scrollbarsAutoHide === 'l';
//scrollbars autoHideDelay
_scrollbarsAutoHideDelay = currentPreparedOptionsScrollbars.autoHideDelay;
//scrollbars support touch
_scrollbarsTouchSupport = currentPreparedOptionsScrollbars.touchSupport;
//old className
_oldClassName = _classNameCache;
//resize
_resizeNone = resize === 'n';
_resizeBoth = resize === 'b';
_resizeHorizontal = resize === 'h';
_resizeVertical = resize === 'v';
//normalizeRTL
_normalizeRTLCache = _currentPreparedOptions.normalizeRTL;
//ignore overlay scrollbar hiding
ignoreOverlayScrollbarHiding = ignoreOverlayScrollbarHiding && (_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y);
//refresh options cache
_scrollbarsVisibilityCache = scrollbarsVisibility;
_scrollbarsAutoHideCache = scrollbarsAutoHide;
_scrollbarsClickScrollingCache = scrollbarsClickScrolling;
_scrollbarsDragScrollingCache = scrollbarsDragScrolling;
_classNameCache = className;
_resizeCache = resize;
_textareaAutoWrappingCache = textareaAutoWrapping;
_paddingAbsoluteCache = paddingAbsolute;
_clipAlwaysCache = clipAlways;
_sizeAutoCapableCache = sizeAutoCapable;
_ignoreOverlayScrollbarHidingCache = ignoreOverlayScrollbarHiding;
_autoUpdateCache = autoUpdate;
_overflowBehaviorCache = extend(true, {}, overflowBehavior);
_textareaDynWidthCache = textareaDynWidth;
_textareaDynHeightCache = textareaDynHeight;
_hasOverflowCache = _hasOverflowCache || { x: false, y: false };
//set correct class name to the host element
if (classNameChanged) {
removeClass(_hostElement, _oldClassName + _strSpace + _classNameThemeNone);
addClass(_hostElement, className !== undefined && className !== null && className.length > 0 ? className : _classNameThemeNone);
}
//set correct auto Update
if (autoUpdateChanged) {
if (autoUpdate === true) {
mutationObserversDisconnect();
autoUpdateLoop.add(_base);
}
else if (autoUpdate === null) {
if (_autoUpdateRecommended) {
mutationObserversDisconnect();
autoUpdateLoop.add(_base);
}
else {
autoUpdateLoop.remove(_base);
mutationObserversConnect();
}
}
else {
autoUpdateLoop.remove(_base);
mutationObserversConnect();
}
}
//activate or deactivate size auto capability
if (sizeAutoCapableChanged) {
if (sizeAutoCapable) {
if (_contentGlueElement === undefined) {
_contentGlueElement = FRAMEWORK(generateDiv(_classNameContentGlueElement));
_paddingElement.before(_contentGlueElement);
}
if (_sizeAutoObserverAdded) {
_sizeAutoObserverElement.show();
}
else {
_sizeAutoObserverElement = FRAMEWORK(generateDiv(_classNameSizeAutoObserverElement));
_contentGlueElement.before(_sizeAutoObserverElement);
var oldSize = {w: -1, h: -1};
addResizeObserver(_sizeAutoObserverElement, function () {
var newSize = {
w: _sizeAutoObserverElement[0][LEXICON.oW],
h: _sizeAutoObserverElement[0][LEXICON.oH]
};
if (checkCacheDouble(newSize, oldSize)) {
if (_initialized && (_heightAutoCache && newSize.h > 0) || (_widthAutoCache && newSize.w > 0)) {
update();
}
else if (_initialized && (!_heightAutoCache && newSize.h === 0) || (!_widthAutoCache && newSize.w === 0)) {
update();
}
}
oldSize = newSize;
});
_sizeAutoObserverAdded = true;
//fix heightAuto detector bug if height is fixed but contentHeight is 0.
//the probability this bug will ever happen is very very low, thats why its ok if we use calc which isn't supported in IE8.
if (_cssCalc !== null)
_sizeAutoObserverElement.css(_strHeight, _cssCalc + '(100% + 1px)');
}
}
else {
if (_sizeAutoObserverAdded)
_sizeAutoObserverElement.hide();
}
}
//if force, update all resizeObservers too
if (force) {
_sizeObserverElement.find('*').trigger(_strScroll);
if (_sizeAutoObserverAdded)
_sizeAutoObserverElement.find('*').trigger(_strScroll);
}
//detect direction:
var cssDirection = _hostElement.css('direction');
var cssDirectionChanged = checkCacheSingle(cssDirection, _cssDirectionCache, force);
//detect box-sizing:
var boxSizing = _hostElement.css('box-sizing');
var boxSizingChanged = checkCacheSingle(boxSizing, _cssBoxSizingCache, force);
//detect padding:
var padding = {
c: force,
t: parseToZeroOrNumber(_hostElement.css(_strPaddingMinus + _strTop)),
r: parseToZeroOrNumber(_hostElement.css(_strPaddingMinus + _strRight)),
b: parseToZeroOrNumber(_hostElement.css(_strPaddingMinus + _strBottom)),
l: parseToZeroOrNumber(_hostElement.css(_strPaddingMinus + _strLeft))
};
//width + height auto detecting var:
var sizeAutoObserverElementBCRect;
//exception occurs in IE8 sometimes (unknown exception)
try {
sizeAutoObserverElementBCRect = _sizeAutoObserverAdded ? _sizeAutoObserverElement[0].getBoundingClientRect() : null;
} catch (ex) {
return;
}
_isRTL = cssDirection === 'rtl';
_isBorderBox = (boxSizing === 'border-box');
var isRTLLeft = _isRTL ? _strLeft : _strRight;
var isRTLRight = _isRTL ? _strRight : _strLeft;
var hostElement = _hostElement[0];
var paddingElement = _paddingElement[0];
//detect width auto:
var widthAutoResizeDetection = false;
var widthAutoObserverDetection = (_sizeAutoObserverAdded && (_hostElement.css(_strFloat) !== 'none' /*|| _isTextarea */)) ? (Math.round(sizeAutoObserverElementBCRect.right - sizeAutoObserverElementBCRect.left) === 0) && (!paddingAbsolute ? (hostElement[LEXICON.cW] - _paddingX) > 0 : true) : false;
if (sizeAutoCapable && !widthAutoObserverDetection) {
var tmpCurrHostWidth = hostElement[LEXICON.oW];
var tmpCurrContentGlueWidth = _contentGlueElement.css(_strWidth);
_contentGlueElement.css(_strWidth, _strAuto);
var tmpNewHostWidth = hostElement[LEXICON.oW];
_contentGlueElement.css(_strWidth, tmpCurrContentGlueWidth);
widthAutoResizeDetection = tmpCurrHostWidth !== tmpNewHostWidth;
if (!widthAutoResizeDetection) {
_contentGlueElement.css(_strWidth, tmpCurrHostWidth + 1);
tmpNewHostWidth = hostElement[LEXICON.oW];
_contentGlueElement.css(_strWidth, tmpCurrContentGlueWidth);
widthAutoResizeDetection = tmpCurrHostWidth !== tmpNewHostWidth;
}
}
var widthAuto = (widthAutoObserverDetection || widthAutoResizeDetection) && sizeAutoCapable && !displayIsHidden;
var widthAutoChanged = checkCacheSingle(widthAuto, _widthAutoCache, force);
var wasWidthAuto = !widthAuto && _widthAutoCache;
//detect height auto:
var heightAuto = _sizeAutoObserverAdded && !displayIsHidden ? (Math.round(sizeAutoObserverElementBCRect.bottom - sizeAutoObserverElementBCRect.top) === 0) /* && (!paddingAbsolute && (_msieVersion > 9 || !_msieVersion) ? true : true) */ : false;
var heightAutoChanged = checkCacheSingle(heightAuto, _heightAutoCache, force);
var wasHeightAuto = !heightAuto && _heightAutoCache;
//detect border:
//we need the border only if border box and auto size
var strMinusWidth = '-' + _strWidth;
var updateBorderX = (widthAuto && _isBorderBox) || !_isBorderBox;
var updateBorderY = (heightAuto && _isBorderBox) || !_isBorderBox;
var border = {
c: force,
t: updateBorderY ? parseToZeroOrNumber(_hostElement.css(_strBorderMinus + _strTop + strMinusWidth), true) : 0,
r: updateBorderX ? parseToZeroOrNumber(_hostElement.css(_strBorderMinus + _strRight + strMinusWidth), true) : 0,
b: updateBorderY ? parseToZeroOrNumber(_hostElement.css(_strBorderMinus + _strBottom + strMinusWidth), true) : 0,
l: updateBorderX ? parseToZeroOrNumber(_hostElement.css(_strBorderMinus + _strLeft + strMinusWidth), true) : 0
};
//detect margin:
var margin = {
c: force,
t: parseToZeroOrNumber(_hostElement.css(_strMarginMinus + _strTop)),
r: parseToZeroOrNumber(_hostElement.css(_strMarginMinus + _strRight)),
b: parseToZeroOrNumber(_hostElement.css(_strMarginMinus + _strBottom)),
l: parseToZeroOrNumber(_hostElement.css(_strMarginMinus + _strLeft))
};
//detect css max width & height:
var cssMaxValue = {
h: String(_hostElement.css(_strMaxMinus + _strHeight)),
w: String(_hostElement.css(_strMaxMinus + _strWidth))
};
//vars to apply correct css
var contentElementCSS = { };
var contentGlueElementCSS = { };
//funcs
var getHostSize = function() {
return {
w: hostElement[LEXICON.cW],
h: hostElement[LEXICON.cH]
};
};
var getViewportSize = function() {
var brect = paddingElement.getBoundingClientRect()
return brect[_strWidth]
? {
w: brect[_strWidth],
h: brect[_strHeight]
} : {
w: paddingElement[LEXICON.oW],
h: paddingElement[LEXICON.oH]
};
};
//set info for padding
_paddingX = padding.l + padding.r;
_paddingY = padding.t + padding.b;
padding.ax = paddingAbsolute ? _paddingX : 0;
padding.ay = paddingAbsolute ? _paddingY : 0;
padding.c = checkCacheTRBL(padding, _cssPaddingCache);
//set info for border
_borderX = border.l + border.r;
_borderY = border.t + border.b;
border.c = checkCacheTRBL(border, _cssBorderCache);
//set info for margin
_marginX = margin.l + margin.r;
_marginY = margin.t + margin.b;
margin.c = checkCacheTRBL(margin, _cssMarginCache);
//set info for css max value
cssMaxValue.ih = parseToZeroOrNumber(cssMaxValue.h); //ih = integer height
cssMaxValue.iw = parseToZeroOrNumber(cssMaxValue.w); //iw = integer width
cssMaxValue.ch = cssMaxValue.h.indexOf('px') > -1; //ch = correct height
cssMaxValue.cw = cssMaxValue.w.indexOf('px') > -1; //cw = correct width
cssMaxValue.c = checkCacheDouble(cssMaxValue, _cssMaxValueCache, force);
//refresh cache
_cssDirectionCache = cssDirection;
_cssBoxSizingCache = boxSizing;
_widthAutoCache = widthAuto;
_heightAutoCache = heightAuto;
_cssPaddingCache = padding;
_cssBorderCache = border;
_cssMarginCache = margin;
_cssMaxValueCache = cssMaxValue;
//IEFix direction changed
if (cssDirectionChanged && _sizeAutoObserverAdded)
_sizeAutoObserverElement.css(_strFloat, isRTLRight);
//apply padding:
if (padding.c || cssDirectionChanged || paddingAbsoluteChanged || widthAutoChanged || heightAutoChanged || boxSizingChanged || sizeAutoCapableChanged) {
var paddingElementCSS = {};
var textareaCSS = {};
setTopRightBottomLeft(contentGlueElementCSS, _strMarginMinus, [-padding.t, -padding.r, -padding.b, -padding.l]);
if (paddingAbsolute) {
setTopRightBottomLeft(paddingElementCSS, _strEmpty, [padding.t, padding.r, padding.b, padding.l]);
if (_isTextarea)
setTopRightBottomLeft(textareaCSS, _strPaddingMinus);
else
setTopRightBottomLeft(contentElementCSS, _strPaddingMinus);
}
else {
setTopRightBottomLeft(paddingElementCSS, _strEmpty);
if (_isTextarea)
setTopRightBottomLeft(textareaCSS, _strPaddingMinus, [padding.t, padding.r, padding.b, padding.l]);
else
setTopRightBottomLeft(contentElementCSS, _strPaddingMinus, [padding.t, padding.r, padding.b, padding.l]);
}
_paddingElement.css(paddingElementCSS);
_targetElement.css(textareaCSS);
}
//viewport size is padding container because it never has padding, margin and a border.
_viewportSize = getViewportSize();
//update Textarea
var textareaSize = _isTextarea ? textareaUpdate() : false;
//fix height auto / width auto in cooperation with current padding & boxSizing behavior:
if (heightAuto && (heightAutoChanged || paddingAbsoluteChanged || boxSizingChanged || cssMaxValue.c || padding.c || border.c)) {
if (cssMaxValue.cw)
contentElementCSS[_strMaxMinus + _strHeight] =
(cssMaxValue.ch ? (cssMaxValue.ih - padding.ay + (_isBorderBox ? -_borderY : _paddingY))
: _strEmpty);
contentElementCSS[_strHeight] = _strAuto;
}
else if (heightAutoChanged || paddingAbsoluteChanged) {
contentElementCSS[_strMaxMinus + _strHeight] = _strEmpty;
contentElementCSS[_strHeight] = _strHundredPercent;
}
if (widthAuto && (widthAutoChanged || paddingAbsoluteChanged || boxSizingChanged || cssMaxValue.c || padding.c || border.c || cssDirectionChanged)) {
if (cssMaxValue.cw)
contentElementCSS[_strMaxMinus + _strWidth] =
(cssMaxValue.cw ? (cssMaxValue.iw - padding.ax + (_isBorderBox ? -_borderX : _paddingX)) +
(_nativeScrollbarIsOverlaid.y /*&& _hasOverflowCache.y && widthAuto */ ? _overlayScrollbarDummySize.y : 0)
: _strEmpty);
contentElementCSS[_strWidth] = _strAuto;
contentGlueElementCSS[_strMaxMinus + _strWidth] = _strHundredPercent; //IE Fix
}
else if (widthAutoChanged || paddingAbsoluteChanged) {
contentElementCSS[_strMaxMinus + _strWidth] = _strEmpty;
contentElementCSS[_strWidth] = _strHundredPercent;
contentElementCSS[_strFloat] = _strEmpty;
contentGlueElementCSS[_strMaxMinus + _strWidth] = _strEmpty; //IE Fix
}
if (widthAuto) {
if (!cssMaxValue.cw)
contentElementCSS[_strMaxMinus + _strWidth] = _strEmpty;
contentGlueElementCSS[_strWidth] = _isTextarea && textareaDynWidth ? textareaSize.dw : _strAuto;
contentElementCSS[_strWidth] = _strAuto;
contentElementCSS[_strFloat] = isRTLRight;
}
if (heightAuto) {
if (!cssMaxValue.ch)
contentElementCSS[_strMaxMinus + _strHeight] = _strEmpty;
//fix dyn height collapse bug: (doesn't works for width!)
//contentGlueElementCSS[_strHeight] = _isTextarea && textareaDynHeight ? textareaSize.dh : _strAuto;
contentGlueElementCSS[_strHeight] = _isTextarea ? textareaDynHeight ? textareaSize.dh : _strAuto : _contentElement[0][LEXICON.cH];
}
if (sizeAutoCapable)
_contentGlueElement.css(contentGlueElementCSS);
_contentElement.css(contentElementCSS);
//CHECKPOINT HERE ~
contentElementCSS = {};
contentGlueElementCSS = {};
//if [content(host) client / scroll size, or target element direction, or content(host) max-sizes] changed, or force is true
if (hostSizeChanged || contentSizeChanged || cssDirectionChanged || boxSizingChanged || paddingAbsoluteChanged || widthAutoChanged || widthAuto || heightAutoChanged || heightAuto || cssMaxValue.c || ignoreOverlayScrollbarHidingChanged || overflowBehaviorChanged || clipAlwaysChanged || resizeChanged || scrollbarsVisibilityChanged || textareaDynWidthChanged || textareaDynHeightChanged || textareaAutoWrappingChanged || force) {
var strOverflow = 'overflow';
var strOverflowX = strOverflow + '-x';
var strOverflowY = strOverflow + '-y';
var strHidden = 'hidden';
var strVisible = 'visible';
//decide whether the content overflow must get hidden for correct overflow measuring, it MUST be always hidden if the height is auto
var hideOverflow4CorrectMeasuring = _restrictedMeasuring ?
(_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) || //it must be hidden if native scrollbars are overlaid
(_viewportSize.w < _nativeScrollbarMinSize.y || _viewportSize.h < _nativeScrollbarMinSize.x) || //it must be hidden if host-element is too small
heightAuto || displayIsHiddenChanged //it must be hidden if height is auto or display was change
: heightAuto; //if there is not the restricted Measuring bug, it must be hidden if the height is auto
//Reset the viewport (very important for natively overlaid scrollbars and zoom change
var viewportElementResetCSS = {};
var resetXTmp = _hasOverflowCache.y && _hideOverflowCache.ys && !ignoreOverlayScrollbarHiding ? (_nativeScrollbarIsOverlaid.y ? _viewportElement.css(isRTLLeft) : -_nativeScrollbarSize.y) : 0;
var resetBottomTmp = _hasOverflowCache.x && _hideOverflowCache.xs && !ignoreOverlayScrollbarHiding ? (_nativeScrollbarIsOverlaid.x ? _viewportElement.css(_strBottom) : -_nativeScrollbarSize.x) : 0;
setTopRightBottomLeft(viewportElementResetCSS, _strEmpty);
_viewportElement.css(viewportElementResetCSS);
if(hideOverflow4CorrectMeasuring)
_contentElement.css(strOverflow, strHidden);
//measure several sizes:
var contentMeasureElement = getContentMeasureElement();
//in Firefox content element has to have overflow hidden, else element margins aren't calculated properly, this element prevents this bug, but only if scrollbars aren't overlaid
var contentMeasureElementGuaranty = _restrictedMeasuring && !hideOverflow4CorrectMeasuring ? _viewportElement[0] : contentMeasureElement;
var clientSize = {
w: contentMeasureElement[LEXICON.cW],
h: contentMeasureElement[LEXICON.cH]
};
var scrollSize = {
w: Math.max(contentMeasureElement[LEXICON.sW], contentMeasureElementGuaranty[LEXICON.sW]),
h: Math.max(contentMeasureElement[LEXICON.sH], contentMeasureElementGuaranty[LEXICON.sH])
};
var contentClientSize = {
w: _isTextarea && textareaSize && !textareaDynWidth ? textareaSize.ow : widthAuto ? clientSize.w : scrollSize.w,
h: _isTextarea && textareaSize && !textareaDynHeight ? textareaSize.oh : heightAuto ? clientSize.h : scrollSize.h
};
//apply the correct viewport style and measure viewport size
viewportElementResetCSS[_strBottom] = wasHeightAuto ? _strEmpty : resetBottomTmp;
viewportElementResetCSS[isRTLLeft] = wasWidthAuto ? _strEmpty : resetXTmp;
_viewportElement.css(viewportElementResetCSS);
//viewport size is padding container because it never has padding, margin and a border.
_viewportSize = getViewportSize();
//measure and correct several sizes
//has to be clientSize because offsetSize respect borders.
var hostSize = getHostSize();
var contentGlueSize = {
w: Math.max(contentClientSize.w + padding.ax, hostSize.w - _paddingX) - (textareaDynWidth ? (_isTextarea && widthAuto ? _marginX + (!_isBorderBox ? _paddingX + _borderX : 0) : 0) : 0),
h: Math.max(contentClientSize.h + padding.ay, hostSize.h - _paddingY)
};
contentGlueSize.c = checkCacheDouble(contentGlueSize, _contentGlueSizeCache, force);
_contentGlueSizeCache = contentGlueSize;
//apply correct contentGlue size
if (sizeAutoCapable) {
//size contentGlue correctly to make sure the element has correct size if the sizing switches to auto
if (contentGlueSize.c || (heightAuto || widthAuto)) {
contentGlueElementCSS[_strWidth] = contentGlueSize.w;
contentGlueElementCSS[_strHeight] = contentGlueSize.h;
}
var maxWidth = contentGlueElementCSS[_strWidth] + (_isBorderBox ? _borderX : -_paddingX);
var maxHeight = contentGlueElementCSS[_strHeight] + (_isBorderBox ? _borderY : -_paddingX);
var textareaCoverCSS = {};
//make contentGlue size -1 if element is not auto sized, to make sure that a resize event happens when the element shrinks
if (!widthAuto || (!widthAuto && border.c))
contentGlueElementCSS[_strWidth] = hostSize.w - (_isBorderBox ? 0 : _paddingX + _borderX) - 1 - _marginX;
if (!heightAuto || (!heightAuto && border.c))
contentGlueElementCSS[_strHeight] = hostSize.h - (_isBorderBox ? 0 : _paddingY + _borderY) - 1 - _marginY;
//if size is auto and host is same size as max size, make content glue size +1 to make sure size changes will be detected
if (cssMaxValue.cw && cssMaxValue.iw === maxWidth)
contentGlueElementCSS[_strWidth] = maxWidth + (_isBorderBox ? 0 : _paddingX) + 1;
if (cssMaxValue.ch && cssMaxValue.ih === maxHeight)
contentGlueElementCSS[_strHeight] = maxHeight + (_isBorderBox ? 0 : _paddingY) + 1;
//if size is auto and host is smaller than size as min size, make content glue size -1 to make sure size changes will be detected (this is only needed if padding is 0)
if (widthAuto && (clientSize.w < _viewportSize.w || _isTextarea && !textareaAutoWrapping) && _paddingX === 0) {
if (_isTextarea)
textareaCoverCSS[_strWidth] = parseToZeroOrNumber(_textareaCoverElement.css(_strWidth)) - 1;
contentGlueElementCSS[_strWidth] -= 1;
}
if (heightAuto && (clientSize.h < _viewportSize.h || _isTextarea) && _paddingY === 0) {
if (_isTextarea)
textareaCoverCSS[_strHeight] = parseToZeroOrNumber(_textareaCoverElement.css(_strHeight)) - 1;
contentGlueElementCSS[_strHeight] -= 1;
}
//make sure content glue size at least 1
if (contentClientSize.h > 0) {
contentGlueElementCSS[_strWidth] = Math.max(1, contentGlueElementCSS[_strWidth]);
contentGlueElementCSS[_strHeight] = Math.max(1, contentGlueElementCSS[_strHeight]);
}
if (_isTextarea)
_textareaCoverElement.css(textareaCoverCSS);
_contentGlueElement.css(contentGlueElementCSS);
}
if (widthAuto)
contentElementCSS[_strWidth] = _strHundredPercent;
if (widthAuto && !_isBorderBox && !_mutationObserverConnected)
contentElementCSS[_strFloat] = 'none';
//apply and reset content style
_contentElement.css(contentElementCSS);
contentElementCSS = {};
//measure again, but this time all correct sizes:
var contentBCRect = contentMeasureElement.getBoundingClientRect();
var contentBCRectW = contentBCRect[_strWidth] || 0;
var contentBCRectH = contentBCRect[_strHeight] || 0;
var contentScrollSize = {
w: Math.max(contentMeasureElement[LEXICON.sW], contentMeasureElementGuaranty[LEXICON.sW]) + parseToZeroOrNumber(contentBCRectW) - contentBCRectW,
h: Math.max(contentMeasureElement[LEXICON.sH], contentMeasureElementGuaranty[LEXICON.sH]) + parseToZeroOrNumber(contentBCRectH) - contentBCRectH
};
contentScrollSize.c = contentSizeChanged = checkCacheDouble(contentScrollSize, _contentScrollSizeCache, force);
_contentScrollSizeCache = contentScrollSize;
if(hideOverflow4CorrectMeasuring)
_contentElement.css(strOverflow, _strEmpty);
//refresh viewport size after correct measuring
_viewportSize = getViewportSize();
//has to be clientSize because offsetSize respect borders.
hostSize = getHostSize();
hostSizeChanged = checkCacheDouble(hostSize, _hostSizeCache);
_hostSizeCache = hostSize;
var overflowBehaviorIsVS = {
x: overflowBehavior.x === 'v-s',
y: overflowBehavior.y === 'v-s'
};
var overflowBehaviorIsVH = {
x: overflowBehavior.x === 'v-h',
y: overflowBehavior.y === 'v-h'
};
var overflowBehaviorIsS = {
x: overflowBehavior.x === 's',
y: overflowBehavior.y === 's'
};
var overflowAmount = {
x: Math.max(0, Math.round((contentScrollSize.w - _viewportSize.w) * 100) / 100),
y: Math.max(0, Math.round((contentScrollSize.h - _viewportSize.h) * 100) / 100)
};
var hideOverflowForceTextarea = _isTextarea && (_viewportSize.w === 0 || _viewportSize.h === 0);
var hideOverflowForceRounding = (_viewportElement[0].scrollLeftMax === 0 && overflowAmount.x > 0 && overflowAmount.x < 1) || (_viewportElement[0].scrollTopMax === 0 && overflowAmount.y > 0 && overflowAmount.y < 1);
if (hideOverflowForceTextarea || hideOverflowForceRounding)
overflowAmount.x = overflowAmount.y = 0;
var hasOverflow = {
x: overflowAmount.x > 0,
y: overflowAmount.y > 0
};
//hideOverflow:
//x || y : true === overflow is hidden by "overflow: scroll" OR "overflow: hidden"
//xs || ys : true === overflow is hidden by "overflow: scroll"
var hideOverflow = {x: hasOverflow.x, y: hasOverflow.y};
if (overflowBehaviorIsVS.x || overflowBehaviorIsVH.x)
hideOverflow.x = (hasOverflow.y && !overflowBehaviorIsVS.y && !overflowBehaviorIsVH.y);
if (overflowBehaviorIsVS.y || overflowBehaviorIsVH.y)
hideOverflow.y = (hasOverflow.x && !overflowBehaviorIsVS.x && !overflowBehaviorIsVH.x);
hideOverflow.xs = hideOverflow.x ? (overflowBehaviorIsS.x || overflowBehaviorIsVS.x) : false;
hideOverflow.ys = hideOverflow.y ? (overflowBehaviorIsS.y || overflowBehaviorIsVS.y) : false;
var canScroll = {
x: hasOverflow.x && hideOverflow.xs,
y: hasOverflow.y && hideOverflow.ys
};
var previousOverflow = _overflowAmountCache;
overflowAmount.c = checkCacheDouble(overflowAmount, _overflowAmountCache, _strX, _strY, force);
_overflowAmountCache = overflowAmount;
hasOverflow.c = checkCacheDouble(hasOverflow, _hasOverflowCache, _strX, _strY, force);
_hasOverflowCache = hasOverflow;
hideOverflow.c = checkCacheDouble(hideOverflow, _hideOverflowCache, _strX, _strY, force);
_hideOverflowCache = hideOverflow;
//if native scrollbar is overlay at x OR y axis, prepare DOM
if (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) {
var borderDesign = 'px solid transparent';
var contentArrangeElementCSS = { };
var arrangeContent = { };
var arrangeChanged = force;
if (hasOverflow.x || hasOverflow.y) {
arrangeContent.w = _nativeScrollbarIsOverlaid.y && hasOverflow.y ? contentScrollSize.w + _overlayScrollbarDummySize.y : _strEmpty;
arrangeContent.h = _nativeScrollbarIsOverlaid.x && hasOverflow.x ? contentScrollSize.h + _overlayScrollbarDummySize.x : _strEmpty;
arrangeChanged = checkCacheSingle(arrangeContent, _arrangeContentSizeCache, force);
_arrangeContentSizeCache = arrangeContent;
}
if (hasOverflow.c || hideOverflow.c || contentScrollSize.c || cssDirectionChanged || widthAutoChanged || heightAutoChanged || widthAuto || heightAuto || ignoreOverlayScrollbarHidingChanged) {
contentElementCSS[_strMarginMinus + isRTLRight] = contentElementCSS[_strBorderMinus + isRTLRight] = _strEmpty;
if (_nativeScrollbarIsOverlaid.x && hasOverflow.x && hideOverflow.xs) {
contentElementCSS[_strMarginMinus + _strBottom] = heightAuto ? (ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.x) : _strEmpty;
contentElementCSS[_strBorderMinus + _strBottom] = (!heightAuto && !ignoreOverlayScrollbarHiding) ? (_overlayScrollbarDummySize.x + borderDesign) : _strEmpty;
}
else {
arrangeContent.h =
contentElementCSS[_strMarginMinus + _strBottom] =
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
arrangeChanged = true;
}
if (_nativeScrollbarIsOverlaid.y && hasOverflow.y && hideOverflow.ys) {
contentElementCSS[_strMarginMinus + isRTLLeft] = widthAuto ? (ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.y) : _strEmpty;
contentElementCSS[_strBorderMinus + isRTLLeft] = (/* !widthAuto && */ !ignoreOverlayScrollbarHiding) ? (_overlayScrollbarDummySize.y + borderDesign) : _strEmpty;
}
else {
arrangeContent.w =
contentElementCSS[_strMarginMinus + isRTLLeft] =
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
arrangeChanged = true;
}
}
if (ignoreOverlayScrollbarHiding) {
arrangeContent.w = arrangeContent.h = _strEmpty;
arrangeChanged = true;
}
if (arrangeChanged) {
contentArrangeElementCSS[_strWidth] = hideOverflow.y ? arrangeContent.w : _strEmpty;
contentArrangeElementCSS[_strHeight] = hideOverflow.x ? arrangeContent.h : _strEmpty;
if (!_contentArrangeElement) {
_contentArrangeElement = FRAMEWORK(generateDiv(_classNameContentArrangeElement));
_viewportElement.prepend(_contentArrangeElement);
}
_contentArrangeElement.css(contentArrangeElementCSS);
}
_contentElement.css(contentElementCSS);
}
var viewportElementCSS = {};
var paddingElementCSS = {};
if (hostSizeChanged || hasOverflow.c || hideOverflow.c || contentScrollSize.c || overflowBehaviorChanged || boxSizingChanged || ignoreOverlayScrollbarHidingChanged || cssDirectionChanged || clipAlwaysChanged || heightAutoChanged) {
viewportElementCSS[isRTLRight] = _strEmpty;
var resetScrollbarHidingX = function () {
viewportElementCSS[_strBottom] = _strEmpty;
_contentBorderSize.h = 0;
};
var resetScrollbarHidingY = function () {
viewportElementCSS[isRTLLeft] = _strEmpty;
_contentBorderSize.w = 0;
};
if (hasOverflow.x && hideOverflow.xs) {
viewportElementCSS[strOverflowX] = _strScroll;
if (!ignoreOverlayScrollbarHiding) {
viewportElementCSS[_strBottom] = -(_nativeScrollbarIsOverlaid.x ? _overlayScrollbarDummySize.x : _nativeScrollbarSize.x);
_contentBorderSize.h = _nativeScrollbarIsOverlaid.x ? _overlayScrollbarDummySize.y : 0;
}
else
resetScrollbarHidingX();
} else {
viewportElementCSS[strOverflowX] = _strEmpty;
resetScrollbarHidingX();
}
if (hasOverflow.y && hideOverflow.ys) {
viewportElementCSS[strOverflowY] = _strScroll;
if (!ignoreOverlayScrollbarHiding) {
viewportElementCSS[isRTLLeft] = -(_nativeScrollbarIsOverlaid.y ? _overlayScrollbarDummySize.y : _nativeScrollbarSize.y);
_contentBorderSize.w = _nativeScrollbarIsOverlaid.y ? _overlayScrollbarDummySize.x : 0;
}
else
resetScrollbarHidingY();
} else {
viewportElementCSS[strOverflowY] = _strEmpty;
resetScrollbarHidingY();
}
// if the scroll container is too small and if there is any overflow with not overlay scrollbar, make viewport element greater in size (Firefox hide Scrollbars fix)
// because firefox starts hiding scrollbars on too small elements
// with this behavior the overflow calculation may be incorrect or the scrollbars would appear suddenly
// https://bugzilla.mozilla.org/show_bug.cgi?id=292284
if ((_viewportSize.h < _nativeScrollbarMinSize.x || _viewportSize.w < _nativeScrollbarMinSize.y)
&& ((hasOverflow.x && hideOverflow.x && !_nativeScrollbarIsOverlaid.x) || (hasOverflow.y && hideOverflow.y && !_nativeScrollbarIsOverlaid.y))) {
viewportElementCSS[_strPaddingMinus + _strTop] = _nativeScrollbarMinSize.x;
viewportElementCSS[_strMarginMinus + _strTop] = -_nativeScrollbarMinSize.x;
viewportElementCSS[_strPaddingMinus + isRTLRight] = _nativeScrollbarMinSize.y;
viewportElementCSS[_strMarginMinus + isRTLRight] = -_nativeScrollbarMinSize.y;
}
else {
viewportElementCSS[_strPaddingMinus + _strTop] =
viewportElementCSS[_strMarginMinus + _strTop] =
viewportElementCSS[_strPaddingMinus + isRTLRight] =
viewportElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
}
viewportElementCSS[_strPaddingMinus + isRTLLeft] =
viewportElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
//if there is any overflow (x OR y axis) and this overflow shall be hidden, make overflow hidden, else overflow visible
if ((hasOverflow.x && hideOverflow.x) || (hasOverflow.y && hideOverflow.y) || hideOverflowForceTextarea) {
//only hide if is Textarea
if (_isTextarea && hideOverflowForceTextarea) {
paddingElementCSS[strOverflowX] =
paddingElementCSS[strOverflowY] = strHidden;
}
}
else {
if (!clipAlways || (overflowBehaviorIsVH.x || overflowBehaviorIsVS.x || overflowBehaviorIsVH.y || overflowBehaviorIsVS.y)) {
//only un-hide if Textarea
if (_isTextarea) {
paddingElementCSS[strOverflowX] =
paddingElementCSS[strOverflowY] = _strEmpty;
}
viewportElementCSS[strOverflowX] =
viewportElementCSS[strOverflowY] = strVisible;
}
}
_paddingElement.css(paddingElementCSS);
_viewportElement.css(viewportElementCSS);
viewportElementCSS = { };
//force soft redraw in webkit because without the scrollbars will may appear because DOM wont be redrawn under special conditions
if ((hasOverflow.c || boxSizingChanged || widthAutoChanged || heightAutoChanged) && !(_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y)) {
var element = _contentElement[0];
var elementStyle = element[LEXICON.s];
var dump;
elementStyle.webkitTransform = 'scale(1)';
elementStyle.display = 'run-in';
dump = element[LEXICON.oH];
elementStyle.display = _strEmpty; //|| dump; //use dump to prevent it from deletion if minify
elementStyle.webkitTransform = _strEmpty;
}
//force hard redraw in webkit if native overlaid scrollbars shall appear
if (ignoreOverlayScrollbarHidingChanged && ignoreOverlayScrollbarHiding) {
//_hostElement.hide();
//var dump = hostElement[LEXICON.oH];
//_hostElement.show();
}
}
//change to direction RTL and width auto Bugfix in Webkit
//without this fix, the DOM still thinks the scrollbar is LTR and thus the content is shifted to the left
contentElementCSS = {};
if (cssDirectionChanged || widthAutoChanged || heightAutoChanged) {
if (_isRTL && widthAuto) {
var floatTmp = _contentElement.css(_strFloat);
var posLeftWithoutFloat = Math.round(_contentElement.css(_strFloat, _strEmpty).css(_strLeft, _strEmpty).position().left);
_contentElement.css(_strFloat, floatTmp);
var posLeftWithFloat = Math.round(_contentElement.position().left);
if (posLeftWithoutFloat !== posLeftWithFloat)
contentElementCSS[_strLeft] = posLeftWithoutFloat;
}
else {
contentElementCSS[_strLeft] = _strEmpty;
}
}
_contentElement.css(contentElementCSS);
//scrollbars management:
var scrollbarsVisibilityVisible = scrollbarsVisibility === 'v';
var scrollbarsVisibilityHidden = scrollbarsVisibility === 'h';
var scrollbarsVisibilityAuto = scrollbarsVisibility === 'a';
var showScrollbarH = COMPATIBILITY.bind(refreshScrollbarAppearance, 0, true, true, canScroll.x);
var showScrollbarV = COMPATIBILITY.bind(refreshScrollbarAppearance, 0, false, true, canScroll.y);
var hideScrollbarH = COMPATIBILITY.bind(refreshScrollbarAppearance, 0, true, false, canScroll.x);
var hideScrollbarV = COMPATIBILITY.bind(refreshScrollbarAppearance, 0, false, false, canScroll.y);
//manage class name which indicates scrollable overflow
if (hideOverflow.x || hideOverflow.y)
addClass(_hostElement, _classNameHostOverflow);
else
removeClass(_hostElement, _classNameHostOverflow);
if (hideOverflow.x)
addClass(_hostElement, _classNameHostOverflowX);
else
removeClass(_hostElement, _classNameHostOverflowX);
if (hideOverflow.y)
addClass(_hostElement, _classNameHostOverflowY);
else
removeClass(_hostElement, _classNameHostOverflowY);
//add or remove rtl class name for styling purposes
if (cssDirectionChanged) {
if (_isRTL)
addClass(_hostElement, _classNameHostRTL);
else
removeClass(_hostElement, _classNameHostRTL);
}
//manage the resize feature (CSS3 resize "polyfill" for this plugin)
if (_isBody)
addClass(_hostElement, _classNameHostResizeDisabled);
if (resizeChanged) {
var addCornerEvents = function () { _scrollbarCornerElement.on(_strMouseTouchDownEvent, scrollbarCornerOnMouseDown); };
var removeCornerEvents = function () { _scrollbarCornerElement.off(_strMouseTouchDownEvent, scrollbarCornerOnMouseDown); };
if (_resizeNone) {
addClass(_hostElement, _classNameHostResizeDisabled);
removeClass(_scrollbarCornerElement, [
_classNameScrollbarCornerResize,
_classNameScrollbarCornerResizeB,
_classNameScrollbarCornerResizeH,
_classNameScrollbarCornerResizeV].join(_strSpace));
removeCornerEvents();
}
else {
removeClass(_hostElement, _classNameHostResizeDisabled);
addClass(_scrollbarCornerElement, _classNameScrollbarCornerResize);
if (_resizeBoth)
addClass(_scrollbarCornerElement, _classNameScrollbarCornerResizeB);
else if (_resizeHorizontal)
addClass(_scrollbarCornerElement, _classNameScrollbarCornerResizeH);
else if (_resizeVertical)
addClass(_scrollbarCornerElement, _classNameScrollbarCornerResizeV);
removeCornerEvents();
addCornerEvents();
}
}
//manage the scrollbars general visibility + the scrollbar interactivity (unusable class name)
if (scrollbarsVisibilityChanged || overflowBehaviorChanged || hideOverflow.c || hasOverflow.c || ignoreOverlayScrollbarHidingChanged) {
if (ignoreOverlayScrollbarHiding) {
if (ignoreOverlayScrollbarHidingChanged) {
removeClass(_hostElement, _classNameHostScrolling);
if (ignoreOverlayScrollbarHiding) {
hideScrollbarH();
hideScrollbarV();
}
}
}
else if (scrollbarsVisibilityAuto) {
if (canScroll.x)
showScrollbarH();
else
hideScrollbarH();
if (canScroll.y)
showScrollbarV();
else
hideScrollbarV();
}
else if (scrollbarsVisibilityVisible) {
showScrollbarH();
showScrollbarV();
}
else if (scrollbarsVisibilityHidden) {
hideScrollbarH();
hideScrollbarV();
}
}
//manage the scrollbars auto hide feature (auto hide them after specific actions)
if (scrollbarsAutoHideChanged || ignoreOverlayScrollbarHidingChanged) {
var addMouseTouchEvents = function (move) {
if (_supportPassiveEvents) {
if(move)
addPassiveEventListener(_hostElement, _strMouseTouchMoveEvent, hostOnMouseMove);
else {
addPassiveEventListener(_hostElement, _strMouseTouchEnter, hostOnMouseEnter);
addPassiveEventListener(_hostElement, _strMouseTouchLeave, hostOnMouseLeave);
}
}
else {
if(move)
_hostElement.on(_strMouseTouchMoveEvent, hostOnMouseMove);
else {
_hostElement.on(_strMouseTouchEnter, hostOnMouseEnter)
.on(_strMouseTouchLeave, hostOnMouseLeave);
}
}
//if the plugin is initialized and the mouse is over the host element, make the scrollbars visible
if(!_initialized)
_hostElement.one("mouseover", hostOnMouseEnter);
};
var removeMouseTouchEvents = function () {
if (_supportPassiveEvents) {
removePassiveEventListener(_hostElement, _strMouseTouchMoveEvent, hostOnMouseMove);
removePassiveEventListener(_hostElement, _strMouseTouchEnter, hostOnMouseEnter);
removePassiveEventListener(_hostElement, _strMouseTouchLeave, hostOnMouseLeave);
}
else {
_hostElement.off(_strMouseTouchMoveEvent, hostOnMouseMove)
.off(_strMouseTouchEnter, hostOnMouseEnter)
.off(_strMouseTouchLeave, hostOnMouseLeave);
}
};
if (_scrollbarsAutoHideLeave || _scrollbarsAutoHideMove) {
removeMouseTouchEvents();
addMouseTouchEvents(_scrollbarsAutoHideMove);
}
else {
removeMouseTouchEvents();
}
if (_scrollbarsAutoHideNever)
refreshScrollbarsAutoHide(true);
else
refreshScrollbarsAutoHide(false, true);
}
//manage scrollbars handle length and offset
if (hostSizeChanged || overflowAmount.c || heightAutoChanged || widthAutoChanged || resizeChanged || boxSizingChanged || paddingAbsoluteChanged || ignoreOverlayScrollbarHidingChanged || cssDirectionChanged) {
refreshScrollbarHandleLength(true);
refreshScrollbarHandleOffset(true, currScroll.l);
refreshScrollbarHandleLength(false);
refreshScrollbarHandleOffset(false, currScroll.t);
}
//manage interactivity
if (scrollbarsClickScrollingChanged)
refreshScrollbarsInteractive(true, scrollbarsClickScrolling);
if (scrollbarsDragScrollingChanged)
refreshScrollbarsInteractive(false, scrollbarsDragScrolling);
//handle scroll
if (_isTextarea && contentSizeChanged) {
var textareaInfo = getTextareaInfo();
if (textareaInfo) {
var textareaRowsChanged = _textareaInfoCache === undefined ? true : textareaInfo.rows !== _textareaInfoCache.rows;
var cursorRow = textareaInfo.cR;
var cursorCol = textareaInfo.cC;
var widestRow = textareaInfo.w;
var lastRow = textareaInfo.r;
var lastCol = textareaInfo.c;
var cursorPos = textareaInfo.p;
var cursorMax = textareaInfo.m;
var cursorIsLastPosition = (cursorMax === cursorPos && _textareaHasFocus);
var doScroll = {
x: (!textareaAutoWrapping && (cursorCol === lastCol && cursorRow === widestRow)) ? _overflowAmountCache.x : -1,
y: (textareaAutoWrapping ? cursorIsLastPosition || textareaRowsChanged && (previousOverflow !== undefined ? (currScroll.t === previousOverflow.y) : false) : (cursorIsLastPosition || textareaRowsChanged) && cursorRow === lastRow) ? _overflowAmountCache.y : -1
};
var doScrollX = doScroll.x > -1;
var doScrollY = doScroll.y > -1;
if (doScrollX || doScrollY) {
if (doScrollY)
_viewportElement[_strScrollTop](doScroll.y);
if (doScrollX) {
if (_isRTL && _normalizeRTLCache && _rtlScrollBehavior.i)
_viewportElement[_strScrollLeft](0); //if inverted, scroll to 0 -> normalized this means to max scroll offset.
else
_viewportElement[_strScrollLeft](doScroll.x);
}
}
}
_textareaInfoCache = textareaInfo;
}
else if (!_isTextarea) {
if (_isRTL && _rtlScrollBehavior.i && _nativeScrollbarIsOverlaid.y && hasOverflow.x && _normalizeRTLCache)
currScroll.l += _contentBorderSize.w || 0;
_viewportElement[_strScrollLeft](currScroll.l);
_viewportElement[_strScrollTop](currScroll.t);
}
if (cssDirectionChanged) {
callCallback("onDirectionChanged", {
isRTL: _isRTL,
dir: cssDirection
});
}
if (hostSizeChanged) {
callCallback("onHostSizeChanged", {
width: _hostSizeCache.w,
height: _hostSizeCache.h
});
}
if (contentSizeChanged) {
callCallback("onContentSizeChanged", {
width: _contentScrollSizeCache.w,
height: _contentScrollSizeCache.h
});
}
if (hasOverflow.c || hideOverflow.c) {
callCallback("onOverflowChanged", {
x: hasOverflow.x,
y: hasOverflow.y,
xScrollable: hideOverflow.xs,
yScrollable: hideOverflow.ys,
clipped: hideOverflow.x || hideOverflow.y
});
}
if (overflowAmount.c) {
callCallback("onOverflowAmountChanged", {
x: overflowAmount.x,
y: overflowAmount.y
});
}
}
//fix body min size
if (_isBody && (_hasOverflowCache.c || _bodyMinSizeCache.c)) {
//its possible that no min size was measured until now, because the content arrange element was just added now, in this case, measure now the min size.
if (!_bodyMinSizeCache.f)
bodyMinSizeChanged();
if (_nativeScrollbarIsOverlaid.y && _hasOverflowCache.x)
_contentElement.css(_strMinMinus + _strWidth, _bodyMinSizeCache.w + _overlayScrollbarDummySize.y);
if (_nativeScrollbarIsOverlaid.x && _hasOverflowCache.y)
_contentElement.css(_strMinMinus + _strHeight, _bodyMinSizeCache.h + _overlayScrollbarDummySize.x);
_bodyMinSizeCache.c = false;
}
unfreezeResizeObserver(_sizeObserverElement);
unfreezeResizeObserver(_sizeAutoObserverElement);
callCallback("onUpdated", { forced: force });
}
//==== Options ====//
/**
* Sets new options but doesn't call the update method.
* @param newOptions The object which contains the new options.
*/
function setOptions(newOptions) {
_currentOptions = extend(true, {}, _currentOptions, _pluginsOptions.v(newOptions, _pluginsOptions.t, true));
_currentPreparedOptions = extend(true, {}, _currentPreparedOptions, _pluginsOptions.v(newOptions, _pluginsOptions.t, false, true));
}
//==== Scrollbars ====//
/**
* Builds all scrollbars if they aren't already build.
*/
function buildScrollbars() {
_scrollbarHorizontalElement = FRAMEWORK(generateDiv(_classNameScrollbar + _strSpace + _classNameScrollbarHorizontal));
_scrollbarHorizontalTrackElement = FRAMEWORK(generateDiv(_classNameScrollbarTrack));
_scrollbarHorizontalHandleElement = FRAMEWORK(generateDiv(_classNameScrollbarHandle));
_scrollbarVerticalElement = FRAMEWORK(generateDiv(_classNameScrollbar + _strSpace + _classNameScrollbarVertical));
_scrollbarVerticalTrackElement = FRAMEWORK(generateDiv(_classNameScrollbarTrack));
_scrollbarVerticalHandleElement = FRAMEWORK(generateDiv(_classNameScrollbarHandle));
_scrollbarHorizontalElement.append(_scrollbarHorizontalTrackElement);
_scrollbarHorizontalTrackElement.append(_scrollbarHorizontalHandleElement);
_scrollbarVerticalElement.append(_scrollbarVerticalTrackElement);
_scrollbarVerticalTrackElement.append(_scrollbarVerticalHandleElement);
_paddingElement.after(_scrollbarVerticalElement);
_paddingElement.after(_scrollbarHorizontalElement);
//scrollbar events
if (_supportTransition) {
_scrollbarHorizontalElement.on(_strTransitionEndEvent, function (event) {
if (event.target !== _scrollbarHorizontalElement[0])
return;
refreshScrollbarHandleLength(true);
refreshScrollbarHandleOffset(true, _viewportElement[_strScrollLeft]());
});
_scrollbarVerticalElement.on(_strTransitionEndEvent, function (event) {
if (event.target !== _scrollbarVerticalElement[0])
return;
refreshScrollbarHandleLength(false);
refreshScrollbarHandleOffset(false, _viewportElement[_strScrollTop]());
});
}
initScrollbarInteractivity(true);
initScrollbarInteractivity(false);
_scrollbarCornerElement = FRAMEWORK(generateDiv(_classNameScrollbarCorner));
_hostElement.append(_scrollbarCornerElement);
}
/**
* Initializes all scrollbar interactivity. (track and handle dragging, clicking, scrolling)
* @param isHorizontal True if the target scrollbar is the horizontal scrollbar, false if the target scrollbar is the vertical scrollbar.
*/
function initScrollbarInteractivity(isHorizontal) {
var scrollbarVars = getScrollbarVars(isHorizontal);
var insideIFrame = _windowElement.top !== _windowElement;
var mouseDownScroll;
var mouseDownOffset;
var xy = scrollbarVars.xy;
var XY = scrollbarVars.XY;
var scroll = _strScroll + scrollbarVars.LT;
var strActive = 'active';
var trackTimeout;
var scrollDurationFactor = 1;
var increaseDecreaseScrollAmountKeyCodes = [ 16, 17 ]; //shift, ctrl
function increaseTrackScrollAmount() {
scrollDurationFactor = 0.5;
};
function decreaseTrackScrollAmount() {
scrollDurationFactor = 1;
};
function documentKeyDown(event) {
if (FRAMEWORK.inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)
increaseTrackScrollAmount();
};
function documentKeyUp(event) {
if (FRAMEWORK.inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)
decreaseTrackScrollAmount();
};
function onMouseTouchDownContinue(event) {
var originalEvent = event.originalEvent || event;
var isTouchEvent = originalEvent.touches !== undefined;
return _isSleeping || nativeOverlayScrollbarsAreActive() || !_scrollbarsDragScrollingCache || (isTouchEvent && !_scrollbarsTouchSupport) ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;
};
function handleDragMove(event) {
if(!onMouseTouchDownContinue(event)) {
documentMouseTouchUp(event);
return;
}
var trackLength = scrollbarVars.i.tl;
var handleLength = scrollbarVars.i.hl;
var scrollRange = scrollbarVars.i.ms;
var scrollRaw = (_msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]) - mouseDownOffset; //use screen coordinates in EDGE & IE because the page values are incorrect in frames.
var scrollDeltaPercent = scrollRaw / (trackLength - handleLength);
var scrollDelta = (scrollRange * scrollDeltaPercent);
scrollDelta = isFinite(scrollDelta) ? scrollDelta : 0;
if (_isRTL && isHorizontal && !_rtlScrollBehavior.i)
scrollDelta *= -1;
_viewportElement[scroll](mouseDownScroll + scrollDelta);
if (!_supportPassiveEvents)
COMPATIBILITY.prvD(event);
};
function documentMouseTouchUp(event) {
event = event || event.originalEvent;
removeClass(_bodyElement, _classNameDragging);
removeClass(scrollbarVars.h, strActive);
removeClass(scrollbarVars.t, strActive);
removeClass(scrollbarVars.s, strActive);
_documentElement.off(_strMouseTouchMoveEvent, handleDragMove)
.off(_strMouseTouchUpEvent, documentMouseTouchUp)
.off(_strKeyDownEvent, documentKeyDown)
.off(_strKeyUpEvent, documentKeyUp)
.off(_strSelectStartEvent, documentOnSelectStart);
decreaseTrackScrollAmount();
mouseDownScroll = undefined;
mouseDownOffset = undefined;
if (trackTimeout !== undefined) {
_base.scrollStop();
clearTimeout(trackTimeout);
trackTimeout = undefined;
}
var rect = _hostElement[0].getBoundingClientRect();
var mouseInsideHost = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
//if mouse is outside host element
if (!mouseInsideHost)
hostOnMouseLeave();
if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)
refreshScrollbarsAutoHide(false);
};
function onHandleMouseTouchDown(event) {
mouseDownScroll = _viewportElement[scroll]();
mouseDownScroll = mouseDownScroll === undefined ? 0 : mouseDownScroll;
if (_isRTL && isHorizontal && !_rtlScrollBehavior.n || !_isRTL)
mouseDownScroll = mouseDownScroll < 0 ? 0 : mouseDownScroll;
mouseDownOffset = _msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]; //use screen coordinates in EDGE & IE because the page values are incorrect in frames.
addClass(_bodyElement, _classNameDragging);
addClass(scrollbarVars.h, strActive);
addClass(scrollbarVars.s, strActive);
_documentElement.on(_strMouseTouchMoveEvent, handleDragMove)
.on(_strMouseTouchUpEvent, documentMouseTouchUp)
.on(_strSelectStartEvent, documentOnSelectStart);
if(_msieVersion || !_documentMixed)
COMPATIBILITY.prvD(event);
COMPATIBILITY.stpP(event);
};
scrollbarVars.h.on(_strMouseTouchDownEvent, function(event) {
if (onMouseTouchDownContinue(event))
onHandleMouseTouchDown(event);
});
scrollbarVars.t.on(_strMouseTouchDownEvent, function(event) {
if (onMouseTouchDownContinue(event)) {
var scrollDistance = _viewportSize[scrollbarVars._wh];
var trackOffset = scrollbarVars.t.offset()[scrollbarVars.lt];
var ctrlKey = event.ctrlKey;
var instantScroll = event.shiftKey;
var instantScrollTransition = instantScroll && ctrlKey;
var isFirstIteration = true;
var easing = 'linear';
var decreaseScroll;
var finishedCondition;
var scrollAction = function () {
if(!_destroyed) {
var mouseOffset = mouseDownOffset - trackOffset;
var trackLength = scrollbarVars.i.tl;
var handleOffset = scrollbarVars.i.ho;
var handleLength = scrollbarVars.i.hl;
var scrollRange = scrollbarVars.i.ms;
var scrollDuration = 270 * scrollDurationFactor;
var timeoutDelay = isFirstIteration ? Math.max(400, scrollDuration) : scrollDuration;
var instantScrollPosition = scrollRange * ((mouseOffset - (handleLength / 2)) / (trackLength - handleLength)); // 100% * positionPercent
var rtlIsNormal = _isRTL && isHorizontal && ((!_rtlScrollBehavior.i && !_rtlScrollBehavior.n) || _normalizeRTLCache);
var decreaseScrollCondition = rtlIsNormal ? handleOffset < mouseOffset : handleOffset > mouseOffset;
var scrollObj = { };
if(instantScroll) {
instantScrollPosition = isFinite(instantScrollPosition) ? instantScrollPosition : 0;
if (_isRTL && isHorizontal && !_rtlScrollBehavior.i)
instantScrollPosition = (scrollRange - instantScrollPosition);
if(instantScrollTransition) {
scrollObj.n = false;
scrollObj[xy] = instantScrollPosition;
_base.scroll(scrollObj, 130, easing, function() { onHandleMouseTouchDown(event); });
}
else {
_viewportElement[scroll](instantScrollPosition);
onHandleMouseTouchDown(event);
}
}
else {
decreaseScroll = isFirstIteration ? decreaseScrollCondition : decreaseScroll;
finishedCondition = rtlIsNormal ? decreaseScroll ? handleOffset + handleLength >= mouseOffset : handleOffset <= mouseOffset : decreaseScroll ? handleOffset <= mouseOffset : handleOffset + handleLength >= mouseOffset;
scrollObj[xy] = decreaseScroll ? '-=' + scrollDistance : '+=' + scrollDistance;
_base.scrollStop();
_base.scroll(scrollObj, scrollDuration, easing);
if (finishedCondition) {
clearTimeout(trackTimeout);
_base.scrollStop();
trackTimeout = undefined;
}
else
trackTimeout = setTimeout(scrollAction, timeoutDelay);
isFirstIteration = false;
}
}
};
if (ctrlKey)
increaseTrackScrollAmount();
mouseDownOffset = COMPATIBILITY.page(event)[xy];
addClass(_bodyElement, _classNameDragging);
addClass(scrollbarVars.t, strActive);
addClass(scrollbarVars.s, strActive);
_documentElement.on(_strMouseTouchUpEvent, documentMouseTouchUp)
.on(_strKeyDownEvent, documentKeyDown)
.on(_strKeyUpEvent, documentKeyUp)
.on(_strSelectStartEvent, documentOnSelectStart);
scrollAction();
COMPATIBILITY.prvD(event);
COMPATIBILITY.stpP(event);
}
}).on(_strMouseTouchEnter, function() { //make sure both scrollbars will stay visible if one scrollbar is hovered if autoHide is "scroll".
if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove) {
_scrollbarsAutoHideFlagScrollAndHovered = true;
refreshScrollbarsAutoHide(true);
}
}).on(_strMouseTouchLeave, function() {
if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove) {
_scrollbarsAutoHideFlagScrollAndHovered = false;
refreshScrollbarsAutoHide(false);
}
});
scrollbarVars.s.on(_strMouseTouchDownEvent, function(event) {
COMPATIBILITY.stpP(event);
});
}
/**
* Shows or hides the given scrollbar and applied a class name which indicates if the scrollbar is scrollable or not.
* @param isHorizontal True if the horizontal scrollbar is the target, false if the vertical scrollbar is the target.
* @param shallBeVisible True if the scrollbar shall be shown, false if hidden.
* @param canScroll True if the scrollbar is scrollable, false otherwise.
*/
function refreshScrollbarAppearance(isHorizontal, shallBeVisible, canScroll) {
var scrollbarClassName = isHorizontal ? _classNameHostScrollbarHorizontalHidden : _classNameHostScrollbarVerticalHidden;
var scrollbarElement = isHorizontal ? _scrollbarHorizontalElement : _scrollbarVerticalElement;
if (shallBeVisible)
removeClass(_hostElement, scrollbarClassName);
else
addClass(_hostElement, scrollbarClassName);
if (canScroll)
removeClass(scrollbarElement, _classNameScrollbarUnusable);
else
addClass(scrollbarElement, _classNameScrollbarUnusable);
}
/**
* Autoshows / autohides both scrollbars with.
* @param shallBeVisible True if the scrollbars shall be autoshown (only the case if they are hidden by a autohide), false if the shall be auto hidden.
* @param delayfree True if the scrollbars shall be hidden without a delay, false or undefined otherwise.
*/
function refreshScrollbarsAutoHide(shallBeVisible, delayfree) {
clearTimeout(_scrollbarsAutoHideTimeoutId);
if (shallBeVisible) {
//if(_hasOverflowCache.x && _hideOverflowCache.xs)
removeClass(_scrollbarHorizontalElement, _classNameScrollbarAutoHidden);
//if(_hasOverflowCache.y && _hideOverflowCache.ys)
removeClass(_scrollbarVerticalElement, _classNameScrollbarAutoHidden);
}
else {
var strActive = 'active';
var hide = function () {
if (!_scrollbarsAutoHideFlagScrollAndHovered && !_destroyed) {
var anyActive = _scrollbarHorizontalHandleElement.hasClass(strActive) || _scrollbarVerticalHandleElement.hasClass(strActive);
if (!anyActive && (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove || _scrollbarsAutoHideLeave))
addClass(_scrollbarHorizontalElement, _classNameScrollbarAutoHidden);
if (!anyActive && (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove || _scrollbarsAutoHideLeave))
addClass(_scrollbarVerticalElement, _classNameScrollbarAutoHidden);
}
};
if (_scrollbarsAutoHideDelay > 0 && delayfree !== true)
_scrollbarsAutoHideTimeoutId = setTimeout(hide, _scrollbarsAutoHideDelay);
else
hide();
}
}
/**
* Refreshes the handle length of the given scrollbar.
* @param isHorizontal True if the horizontal scrollbar handle shall be refreshed, false if the vertical one shall be refreshed.
*/
function refreshScrollbarHandleLength(isHorizontal) {
var handleCSS = {};
var scrollbarVars = getScrollbarVars(isHorizontal);
var digit = 1000000;
//get and apply intended handle length
var handleRatio = Math.min(1, (_hostSizeCache[scrollbarVars._wh] - (_paddingAbsoluteCache ? (isHorizontal ? _paddingX : _paddingY) : 0)) / _contentScrollSizeCache[scrollbarVars._wh]);
handleCSS[scrollbarVars.wh] = (Math.floor(handleRatio * 100 * digit) / digit) + "%"; //the last * digit / digit is for flooring to the 4th digit
if (!nativeOverlayScrollbarsAreActive())
scrollbarVars.h.css(handleCSS);
//measure the handle length to respect min & max length
scrollbarVars.i.hl = scrollbarVars.h[0]['offset' + scrollbarVars.WH]; //hl = handle length
scrollbarVars.i.hlr = handleRatio; //hr = handle length ratio
}
/**
* Refreshes the handle offset of the given scrollbar.
* @param isHorizontal True if the horizontal scrollbar handle shall be refreshed, false if the vertical one shall be refreshed.
* @param currentScroll The current scroll offset of the given scrollbar axis. (if isHorizontal ? scrollLeft : scrollTop)
*/
function refreshScrollbarHandleOffset(isHorizontal, currentScroll) {
var isRTLisHorizontal = _isRTL && isHorizontal;
var handleCSS = {};
var scrollbarVars = getScrollbarVars(isHorizontal);
var strTranslateBrace = 'translate(';
var strTransform = 'transform';
var translateValue;
//measure the handle length to respect min & max length
//DONT use the variable '_contentScrollSizeCache[scrollbarVars._wh]' instead of '_viewportElement[0]['scroll' + scrollbarVars.WH]'
// because its a bit behind during the small delay when content size updates
//(delay = _mutationObserverContentLag, if its 0 then this var could be used)
var maxScroll = _viewportElement[0][_strScroll + scrollbarVars.WH] - _viewportElement[0]['client' + scrollbarVars.WH];
var handleLength = scrollbarVars.i.hl;
var trackLength = scrollbarVars.t[0]['offset' + scrollbarVars.WH];
var handleTrackDiff = trackLength - handleLength;
var offset = handleTrackDiff;
var transformOffset;
var posRatio;
//if rtl scroll max is negative
if (_rtlScrollBehavior.n && isRTLisHorizontal)
maxScroll *= -1;
posRatio = currentScroll / maxScroll;
posRatio = isNaN(posRatio) ? 0 : Math.min(1, posRatio);
scrollbarVars.i.ms = maxScroll; //ms = max scroll
scrollbarVars.i.cs = currentScroll; //cs = current scroll
scrollbarVars.i.csr = posRatio; //csr = current scroll Ratio
offset *= posRatio;
offset = isNaN(offset) ? 0 : offset;
if (isRTLisHorizontal && !_rtlScrollBehavior.i)
offset = trackLength - handleLength - offset;
offset = Math.max(0, offset);
if (_supportTransform) {
transformOffset = isRTLisHorizontal ? -(trackLength - handleLength - offset) : offset; //in px
//transformOffset = (transformOffset / trackLength * 100) * (trackLength / handleLength); //in %
translateValue = isHorizontal ? strTranslateBrace + transformOffset + 'px, 0)' : strTranslateBrace + '0, ' + transformOffset + 'px)';
handleCSS['-webkit-' + strTransform] = translateValue;
handleCSS['-moz-' + strTransform] = translateValue;
handleCSS['-ms-' + strTransform] = translateValue;
handleCSS['-o-' + strTransform] = translateValue;
handleCSS[strTransform] = translateValue;
}
else
handleCSS[scrollbarVars.lt] = offset;
//only apply css if offset has changed and overflow exists.
if (!nativeOverlayScrollbarsAreActive())
scrollbarVars.h.css(handleCSS);
scrollbarVars.i.ho = offset; //ho = handle offset
scrollbarVars.i.tl = trackLength; //tl = track length
}
/**
* Refreshes the interactivity of the given scrollbar element.
* @param isTrack True if the track element is the target, false if the handle element is the target.
* @param value True for interactivity false for no interactivity.
*/
function refreshScrollbarsInteractive(isTrack, value) {
var action = value ? 'removeClass' : 'addClass';
var element1 = isTrack ? _scrollbarHorizontalTrackElement : _scrollbarHorizontalHandleElement;
var element2 = isTrack ? _scrollbarVerticalTrackElement : _scrollbarVerticalHandleElement;
var className = isTrack ? _classNameScrollbarTrackOff : _classNameScrollbarHandleOff;
element1[action](className);
element2[action](className);
}
/**
* Returns a object which is used for fast access for specific variables.
* @param isHorizontal True if the horizontal scrollbar vars shall be accessed, false if the vertical scrollbar vars shall be accessed.
* @returns {{wh: string, WH: string, lt: string, _wh: string, _lt: string, t: *, h: *, c: {}, s: *}}
*/
function getScrollbarVars(isHorizontal) {
return {
wh: isHorizontal ? _strWidth : _strHeight,
WH: isHorizontal ? 'Width' : 'Height',
lt: isHorizontal ? _strLeft : _strTop,
LT: isHorizontal ? 'Left' : 'Top',
xy: isHorizontal ? _strX : _strY,
XY: isHorizontal ? 'X' : 'Y',
_wh: isHorizontal ? 'w' : 'h',
_lt: isHorizontal ? 'l' : 't',
t: isHorizontal ? _scrollbarHorizontalTrackElement : _scrollbarVerticalTrackElement,
h: isHorizontal ? _scrollbarHorizontalHandleElement : _scrollbarVerticalHandleElement,
s: isHorizontal ? _scrollbarHorizontalElement : _scrollbarVerticalElement,
i: isHorizontal ? _scrollHorizontalInfo : _scrollVerticalInfo
};
}
//==== Utils ====//
/**
* Calls the callback with the given name. The Context of this callback is always _base (this).
* @param name The name of the target which shall be called.
* @param args The args with which the callback shall be called.
*/
function callCallback(name, args) {
if(_initialized) {
var callback = _currentPreparedOptions.callbacks[name];
var extensionOnName = name;
var ext;
if(extensionOnName.substr(0, 2) === "on")
extensionOnName = extensionOnName.substr(2, 1).toLowerCase() + extensionOnName.substr(3);
if(type(callback) == TYPES.f)
callback.call(_base, args);
FRAMEWORK.each(_extensions, function() {
ext = this;
if(type(ext.on) == TYPES.f)
ext.on(extensionOnName, args);
});
}
}
/**
* Sets the "top, right, bottom, left" properties, with a given prefix, of the given css object.
* @param targetCSSObject The css object to which the values shall be applied.
* @param prefix The prefix of the "top, right, bottom, left" css properties. (example: 'padding-' is a valid prefix)
* @param values A array of values which shall be applied to the "top, right, bottom, left" -properties. The array order is [top, right, bottom, left].
* If this argument is undefined the value '' (empty string) will be applied to all properties.
*/
function setTopRightBottomLeft(targetCSSObject, prefix, values) {
if (values === undefined)
values = [_strEmpty, _strEmpty, _strEmpty, _strEmpty];
targetCSSObject[prefix + _strTop] = values[0];
targetCSSObject[prefix + _strRight] = values[1];
targetCSSObject[prefix + _strBottom] = values[2];
targetCSSObject[prefix + _strLeft] = values[3];
}
/**
* Checks whether the given object is a HTMLElement.
* @param o The object which shall be checked.
* @returns {boolean} True the given object is a HTMLElement, false otherwise.
*/
function isHTMLElement(o) {
var strOwnerDocument = 'ownerDocument';
var strHTMLElement = 'HTMLElement';
var wnd = o && o[strOwnerDocument] ? (o[strOwnerDocument].parentWindow || window) : window;
return (
typeof wnd[strHTMLElement] == TYPES.o ? o instanceof wnd[strHTMLElement] : //DOM2
o && typeof o == TYPES.o && o !== null && o.nodeType === 1 && typeof o.nodeName == TYPES.s
);
}
/**
* Compares 2 arrays and returns the differences between them as a array.
* @param a1 The first array which shall be compared.
* @param a2 The second array which shall be compared.
* @returns {Array} The differences between the two arrays.
*/
function getArrayDifferences(a1, a2) {
var a = [ ];
var diff = [ ];
var i;
var k;
for (i = 0; i < a1.length; i++)
a[a1[i]] = true;
for (i = 0; i < a2.length; i++) {
if (a[a2[i]])
delete a[a2[i]];
else
a[a2[i]] = true;
}
for (k in a)
diff.push(k);
return diff;
}
/**
* Returns Zero or the number to which the value can be parsed.
* @param value The value which shall be parsed.
* @param toFloat Indicates whether the number shall be parsed to a float.
*/
function parseToZeroOrNumber(value, toFloat) {
var num = toFloat ? window.parseFloat(value) : window.parseInt(value);
return isNaN(num) ? 0 : num;
}
/**
* Gets several information of the textarea and returns them as a object or undefined if the browser doesn't support it.
* @returns {{cursorRow: Number, cursorCol, rows: Number, cols: number, wRow: number, pos: number, max : number}} or undefined if not supported.
*/
function getTextareaInfo() {
//read needed values
var textareaCursorPosition = _targetElement[0].selectionStart;
if (textareaCursorPosition === undefined)
return;
var strLength = 'length';
var textareaValue = _targetElement.val();
var textareaLength = textareaValue[strLength];
var textareaRowSplit = textareaValue.split("\n");
var textareaLastRow = textareaRowSplit[strLength];
var textareaCurrentCursorRowSplit = textareaValue.substr(0, textareaCursorPosition).split("\n");
var widestRow = 0;
var textareaLastCol = 0;
var cursorRow = textareaCurrentCursorRowSplit[strLength];
var cursorCol = textareaCurrentCursorRowSplit[textareaCurrentCursorRowSplit[strLength] - 1][strLength];
var rowCols;
var i;
//get widest Row and the last column of the textarea
for (i = 0; i < textareaRowSplit[strLength]; i++) {
rowCols = textareaRowSplit[i][strLength];
if (rowCols > textareaLastCol) {
widestRow = i + 1;
textareaLastCol = rowCols;
}
}
return {
cR: cursorRow, //cursorRow
cC: cursorCol, //cursorCol
r: textareaLastRow, //rows
c: textareaLastCol, //cols
w: widestRow, //wRow
p: textareaCursorPosition, //pos
m: textareaLength //max
};
}
/**
* Checks the given key code and returns a boolean which is indicating if the given key code is a restricted one.
* @param keyCode The key code which shall be checked.
* @returns {boolean} True if the given key code is restricted, false otherwise.
*/
function textareaIsRestrictedKeyCode(keyCode) {
for (var i = 0; i < _textareaKeyDownRestrictedKeyCodes.length; i++) {
if (keyCode === _textareaKeyDownRestrictedKeyCodes[i])
return true;
}
return false;
}
/**
* Determines whether native overlay scrollbars are active.
* @returns {boolean} True if native overlay scrollbars are active, false otherwise.
*/
function nativeOverlayScrollbarsAreActive() {
return (_ignoreOverlayScrollbarHidingCache && (_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y));
}
/**
* Gets the element which is used to measure the content size.
* @returns {*} TextareaCover if target element is textarea else the ContentElement.
*/
function getContentMeasureElement() {
return _isTextarea ? _textareaCoverElement[0] : _contentElement[0];
}
/**
* Generates a string which represents a HTML div with the given classes or attributes.
* @param classesOrAttrs The class of the div as string or a object which represents the attributes of the div. (The class attribute can also be written as "className".)
* @param content The content of the div as string.
* @returns {string} The concated string which represents a HTML div and its content.
*/
function generateDiv(classesOrAttrs, content) {
return '<div ' + (classesOrAttrs ? type(classesOrAttrs) == TYPES.s ?
'class="' + classesOrAttrs + '"' :
(function() {
var key;
var attrs = '';
if(FRAMEWORK.isPlainObject(classesOrAttrs)) {
for (key in classesOrAttrs)
attrs += (key === 'className' ? 'class' : key) + '="' + classesOrAttrs[key] + '" ';
}
return attrs;
})() :
_strEmpty) +
'>' +
(content ? content : _strEmpty) +
'</div>';
}
/**
* Gets the value of the given property from the given object.
* @param obj The object from which the property value shall be got.
* @param path The property of which the value shall be got.
* @returns {*} Returns the value of the searched property or undefined of the property wasn't found.
*/
function getObjectPropVal(obj, path) {
var splits = path.split(_strDot);
var i = 0;
var val;
for(; i < splits.length; i++) {
if(!obj.hasOwnProperty(splits[i]))
return;
val = obj[splits[i]];
if(i < splits.length && type(val) == TYPES.o)
obj = val;
}
return val;
}
/**
* Sets the value of the given property from the given object.
* @param obj The object from which the property value shall be set.
* @param path The property of which the value shall be set.
* @param val The value of the property which shall be set.
*/
function setObjectPropVal(obj, path, val) {
var splits = path.split(_strDot);
var splitsLength = splits.length;
var i = 0;
var extendObj = { };
var extendObjRoot = extendObj;
for(; i < splitsLength; i++)
extendObj = extendObj[splits[i]] = i + 1 < splitsLength ? { } : val;
FRAMEWORK.extend(obj, extendObjRoot, true);
}
//==== Utils Cache ====//
/**
* Compares two values and returns the result of the comparison as a boolean.
* @param current The first value which shall be compared.
* @param cache The second value which shall be compared.
* @param force If true the returned value is always true.
* @returns {boolean} True if both variables aren't equal or some of them is undefined or when the force parameter is true, false otherwise.
*/
function checkCacheSingle(current, cache, force) {
if (force === true)
return force;
if (cache === undefined)
return true;
else if (current !== cache)
return true;
return false;
}
/**
* Compares two objects with two properties and returns the result of the comparison as a boolean.
* @param current The first object which shall be compared.
* @param cache The second object which shall be compared.
* @param prop1 The name of the first property of the objects which shall be compared.
* @param prop2 The name of the second property of the objects which shall be compared.
* @param force If true the returned value is always true.
* @returns {boolean} True if both variables aren't equal or some of them is undefined or when the force parameter is true, false otherwise.
*/
function checkCacheDouble(current, cache, prop1, prop2, force) {
if (force === true)
return force;
if (prop2 === undefined && force === undefined) {
if (prop1 === true)
return prop1;
else
prop1 = undefined;
}
prop1 = prop1 === undefined ? 'w' : prop1;
prop2 = prop2 === undefined ? 'h' : prop2;
if (cache === undefined)
return true;
else if (current[prop1] !== cache[prop1] || current[prop2] !== cache[prop2])
return true;
return false;
}
/**
* Compares two objects which have four properties and returns the result of the comparison as a boolean.
* @param current The first object with four properties.
* @param cache The second object with four properties.
* @returns {boolean} True if both objects aren't equal or some of them is undefined, false otherwise.
*/
function checkCacheTRBL(current, cache) {
if (cache === undefined)
return true;
else if (current.t !== cache.t ||
current.r !== cache.r ||
current.b !== cache.b ||
current.l !== cache.l)
return true;
return false;
}
//==== Shortcuts ====//
/**
* jQuery type method shortcut.
*/
function type(obj) {
return COMPATIBILITY.type(obj);
}
/**
* jQuery extend method shortcut.
*/
function extend() {
return FRAMEWORK.extend.apply(this, arguments);
}
/**
* jQuery addClass method shortcut.
*/
function addClass(el, classes) {
return _frameworkProto.addClass.call(el, classes);
}
/**
* jQuery removeClass method shortcut.
*/
function removeClass(el, classes) {
return _frameworkProto.removeClass.call(el, classes);
}
/**
* jQuery remove method shortcut.
*/
function remove(el) {
return _frameworkProto.remove.call(el);
}
/**
* Finds the first child element with the given selector of the given element.
* @param el The root element from which the selector shall be valid.
* @param selector The selector of the searched element.
* @returns {*} The first element which is a child of the given element and matches the givens selector.
*/
function findFirst(el, selector) {
return _frameworkProto.find.call(el, selector).eq(0);
}
//==== API ====//
/**
* Puts the instance to sleep. It wont respond to any changes in the DOM and won't update. Scrollbar Interactivity is also disabled as well as the resize handle.
* This behavior can be reset by calling the update method.
*/
_base.sleep = function () {
_isSleeping = true;
};
/**
* Updates the plugin and DOM to the current options.
* This method should only be called if a update is 100% required.
* @param force True if every property shall be updated and the cache shall be ignored.
* !INTERNAL USAGE! : force can be a string "auto", "auto+" or "zoom" too
* if this is the case then before a real update the content size and host element attributes gets checked, and if they changed only then the update method will be called.
*/
_base.update = function (force) {
var attrsChanged;
var contentSizeC;
var isString = type(force) == TYPES.s;
var imgElementSelector = 'img';
var imgElementLoadEvent = 'load';
if(isString) {
if (force.indexOf(_strAuto) === 0) {
attrsChanged = meaningfulAttrsChanged();
contentSizeC = updateAutoContentSizeChanged();
if (attrsChanged || contentSizeC)
update(false, contentSizeC, false, force.slice(-1) == "+");
}
else if (force === 'zoom')
update(true, true);
}
else {
force = _isSleeping || force;
_isSleeping = false;
update(false, false, force, true);
}
if(!_isTextarea) {
_contentElement.find(imgElementSelector).each(function(i, el) {
var index = COMPATIBILITY.inA(el, _imgs);
if (index === -1)
FRAMEWORK(el).off(imgElementLoadEvent, imgOnLoad).on(imgElementLoadEvent, imgOnLoad);
});
}
};
/**
Gets or sets the current options. The update method will be called automatically if new options were set.
* @param newOptions If new options are given, then the new options will be set, if new options aren't given (undefined or a not a plain object) then the current options will be returned.
* @param value If new options is a property path string, then this value will be used to set the option to which the property path string leads.
* @returns {*}
*/
_base.options = function (newOptions, value) {
//return current options if newOptions are undefined or empty
if (FRAMEWORK.isEmptyObject(newOptions) || !FRAMEWORK.isPlainObject(newOptions)) {
if (type(newOptions) == TYPES.s) {
if (arguments.length >= 2) {
var option = { };
setObjectPropVal(option, newOptions, value);
setOptions(option);
update();
return;
}
else
return getObjectPropVal(_currentOptions, newOptions);
}
else
return _currentOptions;
}
setOptions(newOptions);
var isSleepingTmp = _isSleeping || false;
_isSleeping = false;
update();
_isSleeping = isSleepingTmp;
};
/**
* Restore the DOM, disconnects all observers, remove all resize observers and destroy all methods.
*/
_base.destroy = function () {
_destroyed = true;
autoUpdateLoop.remove(_base);
mutationObserversDisconnect();
removeResizeObserver(_sizeObserverElement);
if (_sizeAutoObserverAdded)
removeResizeObserver(_sizeAutoObserverElement);
for(var extName in _extensions)
_base.removeExt(extName);
remove(_sizeObserverElement);
if (_contentGlueElement !== undefined)
remove(_contentGlueElement);
if (_contentArrangeElement !== undefined)
remove(_contentArrangeElement);
if (_sizeAutoObserverAdded)
remove(_sizeAutoObserverElement);
if (_supportPassiveEvents) {
removePassiveEventListener(_hostElement, _strMouseTouchMoveEvent, hostOnMouseMove);
removePassiveEventListener(_hostElement, _strMouseTouchEnter, hostOnMouseEnter);
removePassiveEventListener(_hostElement, _strMouseTouchLeave, hostOnMouseLeave);
}
else {
_hostElement.off(_strMouseTouchMoveEvent, hostOnMouseMove)
.off(_strMouseTouchEnter, hostOnMouseEnter)
.off(_strMouseTouchLeave, hostOnMouseLeave);
}
remove(_scrollbarHorizontalElement);
remove(_scrollbarVerticalElement);
if(_scrollbarCornerElement)
remove(_scrollbarCornerElement);
if (!_resizeNone)
scrollbarCornerOnResized();
_contentElement.contents()
.unwrap()
.unwrap()
.unwrap();
if (_isBody)
removeClass(_htmlElement, _classNameHTMLElement);
if (_isTextarea) {
_targetElement.off(_strScroll, textareaOnScroll)
.off('drop', textareaOnDrop)
.off('focus', textareaOnFocus)
.off('focusout', textareaOnFocusOut);
if (_msieVersion > 9 || !_autoUpdateRecommended)
_targetElement.off('input', textareaOnInput);
else {
_targetElement.off(_strKeyDownEvent, textareaOnKeyDown)
.off(_strKeyUpEvent, textareaOnKeyUp);
}
remove(_textareaCoverElement);
removeClass(_targetElement, _classNameTextareaElement + _strSpace + _classNameTextInherit)
.unwrap()
.removeAttr(LEXICON.s);
remove(_hostElement);
}
else {
removeClass(_targetElement, _classNameHostElement);
removeClass(_hostElement, [
_classNameHostElement,
_classNameHostResizeDisabled,
_classNameHostRTL,
_classNameHostScrollbarHorizontalHidden,
_classNameHostScrollbarVerticalHidden,
_classNameHostTransition,
_classNameHostScrolling,
_classNameHostOverflow,
_classNameHostOverflowX,
_classNameHostOverflowY,
_classNameThemeNone,
_classNameCache].join(_strSpace));
}
for(var i = 0; i < _imgs.length; i++)
FRAMEWORK(_imgs[i]).off('load', imgOnLoad);
_imgs = undefined;
INSTANCES(pluginTargetElement, 0);
callCallback("onDestroyed");
for (var property in _base)
delete _base[property];
_base = undefined;
};
/**
* Scrolls to a given position or element.
* @param coordinates
* 1. Can be "coordinates" which looks like:
* { x : ?, y : ? } OR Object with x and y properties
* { left : ?, top : ? } OR Object with left and top properties
* { l : ?, t : ? } OR Object with l and t properties
* [ ?, ? ] OR Array where the first two element are the coordinates (first is x, second is y)
* ? A single value which stays for both axis
* A value can be a number, a string or a calculation.
*
* Operators:
* [NONE] The current scroll will be overwritten by the value.
* '+=' The value will be added to the current scroll offset
* '-=' The value will be subtracted from the current scroll offset
* '*=' The current scroll wil be multiplicated by the value.
* '/=' The current scroll wil be divided by the value.
*
* Units:
* [NONE] The value is the final scroll amount. final = (value * 1)
* 'px' Same as none
* '%' The value is dependent on the current scroll value. final = ((currentScrollValue / 100) * value)
* 'vw' The value is multiplicated by the viewport width. final = (value * viewportWidth)
* 'vh' The value is multiplicated by the viewport height. final = (value * viewportHeight)
*
* example final values:
* 200, '200px', '50%', '1vw', '1vh', '+=200', '/=1vw', '*=2px', '-=5vh', '+=33%', '+= 50% - 2px', '-= 1vw - 50%'
*
* 2. Can be a HTML or jQuery element:
* The final scroll offset is the offset (without margin) of the given HTML / jQuery element.
*
* 3. Can be a object with a HTML or jQuery element with additional settings:
* {
* el : [HTMLElement, jQuery element], MUST be specified, else this object isn't valid.
* scroll : [string, array, object], Default value is 'always'.
* block : [string, array, object], Default value is 'begin'.
* margin : [number, boolean array, object] Default value is false.
* }
*
* Possible scroll settings are:
* 'always' Scrolls always.
* 'ifneeded' Scrolls only if the element isnt fully in view.
* 'never' Scrolls never.
*
* Possible block settings are:
* 'begin' Both axis shall be docked to the "begin" edge. - The element will be docked to the top and left edge of the viewport.
* 'end' Both axis shall be docked to the "end" edge. - The element will be docked to the bottom and right edge of the viewport. (If direction is RTL to the bottom and left edge.)
* 'center' Both axis shall be docked to "center". - The element will be centered in the viewport.
* 'nearest' The element will be docked to the nearest edge(s).
*
* Possible margin settings are: -- The actual margin of the element wont be affect, this option affects only the final scroll offset.
* [BOOLEAN] If true the css margin of the element will be used, if false no margin will be used.
* [NUMBER] The margin will be used for all edges.
*
* @param duration The duration of the scroll animation, OR a jQuery animation configuration object.
* @param easing The animation easing.
* @param complete The animation complete callback.
* @returns
* {
* x: {position: *, ratio: (number|*), max: (number|*), handleOffset: (number|*), handleLength: *, handleLengthRatio: (number|*), trackLength: *, isRTL: *, isRTLNormalized: *},
* y: {position: *, ratio: (number|*), max: (number|*), handleOffset: (number|*), handleLength: *, handleLengthRatio: (number|*), trackLength: *}
* }
*/
_base.scroll = function (coordinates, duration, easing, complete) {
if (arguments.length === 0 || coordinates === undefined) {
var infoX = _scrollHorizontalInfo;
var infoY = _scrollVerticalInfo;
var normalizeInvert = _normalizeRTLCache && _isRTL && _rtlScrollBehavior.i;
var normalizeNegate = _normalizeRTLCache && _isRTL && _rtlScrollBehavior.n;
var scrollX = infoX.cs;
var scrollXRatio = infoX.csr;
var maxScrollX = infoX.ms;
scrollXRatio = normalizeInvert ? 1 - scrollXRatio : scrollXRatio;
scrollX = normalizeInvert ? maxScrollX - scrollX : scrollX;
scrollX *= normalizeNegate ? -1 : 1;
maxScrollX *= normalizeNegate ? -1 : 1;
return {
x: {
position: scrollX,
ratio: scrollXRatio,
max: maxScrollX,
handleOffset: infoX.ho,
handleLength: infoX.hl,
handleLengthRatio: infoX.hlr,
trackLength: infoX.tl,
isRTL: _isRTL,
isRTLNormalized: _normalizeRTLCache
},
y: {
position: infoY.cs,
ratio: infoY.csr,
max: infoY.ms,
handleOffset: infoY.ho,
handleLength: infoY.hl,
handleLengthRatio: infoY.hlr,
trackLength: infoY.tl
}
};
}
var normalizeRTL = _normalizeRTLCache;
var coordinatesXAxisProps = [_strX, _strLeft, 'l'];
var coordinatesYAxisProps = [_strY, _strTop, 't'];
var coordinatesOperators = ['+=', '-=', '*=', '/='];
var i;
var finalScroll = { };
var doScrollLeft;
var doScrollTop;
var animationOptions;
var durationIsObject = type(duration) == TYPES.o;
var strEnd = 'end';
var strBegin = 'begin';
var strCenter = 'center';
var strNearest = 'nearest';
var strAlways = 'always';
var strNever = 'never';
var strIfNeeded = 'ifneeded';
var strLength = LEXICON.l;
var settingsAxis;
var settingsScroll;
var settingsBlock;
var settingsMargin;
var finalElement;
var elementObjSettingsAxisValues = [_strX, _strY, 'xy', 'yx'];
var elementObjSettingsBlockValues = [strBegin, strEnd, strCenter, strNearest];
var elementObjSettingsScrollValues = [strAlways, strNever, strIfNeeded];
var coordinatesIsElementObj = coordinates.hasOwnProperty('el');
var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates;
var possibleElementIsJQuery = possibleElement instanceof FRAMEWORK || JQUERY ? possibleElement instanceof JQUERY : false;
var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement);
var checkSettingsStringValue = function (currValue, allowedValues) {
for (i = 0; i < allowedValues[strLength]; i++) {
if (currValue === allowedValues[i])
return true;
}
return false;
};
var getRawScroll = function (coordinates) {
var rawScroll = {};
if (type(coordinates) == TYPES.a && coordinates[strLength] > 0) {
rawScroll.x = coordinates[0];
rawScroll.y = coordinates[1];
}
else if (type(coordinates) == TYPES.s || type(coordinates) == TYPES.n) {
rawScroll.x = coordinates;
rawScroll.y = coordinates;
}
else if (type(coordinates) == TYPES.o) {
normalizeRTL = type(coordinates.n) == TYPES.b ? coordinates.n : normalizeRTL;
coordinates = extend({}, coordinates);
i = 0;
for (var key in coordinates) {
if (coordinates.hasOwnProperty(key)) {
if (i > 2)
delete coordinates[key];
i++;
}
}
var getRawScrollValue = function (isX) {
var coordinateProps = isX ? coordinatesXAxisProps : coordinatesYAxisProps;
for (i = 0; i < coordinateProps[strLength]; i++) {
if (coordinateProps[i] in coordinates) {
return coordinates[coordinateProps[i]];
}
}
};
rawScroll.x = getRawScrollValue(true);
rawScroll.y = getRawScrollValue(false);
}
return rawScroll;
};
var getFinalScroll = function (isX, rawScroll) {
var isString = type(rawScroll) == TYPES.s;
if(isString)
_base.update(_strAuto + "+");
var operator;
var amount;
var scrollInfo = isX ? _scrollHorizontalInfo : _scrollVerticalInfo;
var currScroll = scrollInfo.cs;
var maxScroll = scrollInfo.ms;
var mult = ' * ';
var finalValue;
var isRTLisX = _isRTL && isX;
var normalizeShortcuts = isRTLisX && _rtlScrollBehavior.n && !normalizeRTL;
var strReplace = 'replace';
if (isString) {
//check operator
if (rawScroll[strLength] > 2) {
var possibleOperator = rawScroll.substr(0, 2);
for (i = 0; i < coordinatesOperators[strLength]; i++) {
if (possibleOperator === coordinatesOperators[i]) {
operator = coordinatesOperators[i];
break;
}
}
}
//calculate units and shortcuts
rawScroll = operator !== undefined ? rawScroll.substr(2) : rawScroll;
rawScroll = rawScroll[strReplace](/min/g, 0); //'min' = 0%
rawScroll = rawScroll[strReplace](/</g, 0); //'<' = 0%
rawScroll = rawScroll[strReplace](/max/g, (normalizeShortcuts ? '-' : _strEmpty) + _strHundredPercent); //'max' = 100%
rawScroll = rawScroll[strReplace](/>/g, (normalizeShortcuts ? '-' : _strEmpty) + _strHundredPercent); //'>' = 100%
rawScroll = rawScroll[strReplace](/px/g, _strEmpty);
rawScroll = rawScroll[strReplace](/%/g, mult + (maxScroll * (isRTLisX && _rtlScrollBehavior.n ? -1 : 1) / 100.0));
rawScroll = rawScroll[strReplace](/vw/g, mult + _viewportSize.w);
rawScroll = rawScroll[strReplace](/vh/g, mult + _viewportSize.h);
amount = parseToZeroOrNumber(parseToZeroOrNumber(window.eval(rawScroll), true).toFixed());
}
else {
amount = rawScroll;
}
if (amount !== undefined && !isNaN(amount) && type(amount) == TYPES.n) {
var normalizeIsRTLisX = normalizeRTL && isRTLisX;
var operatorCurrScroll = currScroll * (normalizeIsRTLisX && _rtlScrollBehavior.n ? -1 : 1);
var invert = normalizeIsRTLisX && _rtlScrollBehavior.i;
var negate = normalizeIsRTLisX && _rtlScrollBehavior.n;
operatorCurrScroll = invert ? (maxScroll - operatorCurrScroll) : operatorCurrScroll;
switch (operator) {
case '+=':
finalValue = operatorCurrScroll + amount;
break;
case '-=':
finalValue = operatorCurrScroll - amount;
break;
case '*=':
finalValue = operatorCurrScroll * amount;
break;
case '/=':
finalValue = operatorCurrScroll / amount;
break;
default:
finalValue = amount;
break;
}
finalValue = invert ? maxScroll - finalValue : finalValue;
finalValue *= negate ? -1 : 1;
finalValue = isRTLisX && _rtlScrollBehavior.n ? Math.min(0, Math.max(maxScroll, finalValue)) : Math.max(0, Math.min(maxScroll, finalValue));
}
return finalValue === currScroll ? undefined : finalValue;
};
var getPerAxisValue = function (value, valueInternalType, defaultValue, allowedValues) {
var resultDefault = [ defaultValue, defaultValue ];
var valueType = type(value);
var valueArrLength;
var valueArrItem;
//value can be [ string, or array of two strings ]
if (valueType == valueInternalType) {
value = [value, value];
}
else if (valueType == TYPES.a) {
valueArrLength = value[strLength];
if (valueArrLength > 2 || valueArrLength < 1)
value = resultDefault;
else {
if (valueArrLength === 1)
value[1] = defaultValue;
for (i = 0; i < valueArrLength; i++) {
valueArrItem = value[i];
if (type(valueArrItem) != valueInternalType || !checkSettingsStringValue(valueArrItem, allowedValues)) {
value = resultDefault;
break;
}
}
}
}
else if (valueType == TYPES.o)
value = [ value[_strX]|| defaultValue, value[_strY] || defaultValue];
else
value = resultDefault;
return { x : value[0], y : value[1] };
};
var generateMargin = function (marginTopRightBottomLeftArray) {
var result = [ ];
var currValue;
var currValueType;
var valueDirections = [ _strTop, _strRight, _strBottom, _strLeft ];
for(i = 0; i < marginTopRightBottomLeftArray[strLength]; i++) {
if(i === valueDirections[strLength])
break;
currValue = marginTopRightBottomLeftArray[i];
currValueType = type(currValue);
if(currValueType == TYPES.b)
result.push(currValue ? parseToZeroOrNumber(finalElement.css(_strMarginMinus + valueDirections[i])) : 0);
else
result.push(currValueType == TYPES.n ? currValue : 0);
}
return result;
};
if (possibleElementIsJQuery || possibleElementIsHTMLElement) {
//get settings
var margin = coordinatesIsElementObj ? coordinates.margin : 0;
var axis = coordinatesIsElementObj ? coordinates.axis : 0;
var scroll = coordinatesIsElementObj ? coordinates.scroll : 0;
var block = coordinatesIsElementObj ? coordinates.block : 0;
var marginDefault = [ 0, 0, 0, 0 ];
var marginType = type(margin);
var marginLength;
finalElement = possibleElementIsJQuery ? possibleElement : FRAMEWORK(possibleElement);
if (finalElement[strLength] === 0)
return;
_base.update(_strAuto + "+");
//margin can be [ boolean, number, array of 2, array of 4, object ]
if (marginType == TYPES.n || marginType == TYPES.b)
margin = generateMargin([margin, margin, margin, margin]);
else if (marginType == TYPES.a) {
marginLength = margin[strLength];
if(marginLength === 2)
margin = generateMargin([margin[0], margin[1], margin[0], margin[1]]);
else if(marginLength >= 4)
margin = generateMargin(margin);
else
margin = marginDefault;
}
else if (marginType == TYPES.o)
margin = generateMargin([margin[_strTop], margin[_strRight], margin[_strBottom], margin[_strLeft]]);
else
margin = marginDefault;
//block = type(block) === TYPES.b ? block ? [ strNearest, strBegin ] : [ strNearest, strEnd ] : block;
settingsAxis = checkSettingsStringValue(axis, elementObjSettingsAxisValues) ? axis : 'xy';
settingsScroll = getPerAxisValue(scroll, TYPES.s, strAlways, elementObjSettingsScrollValues);
settingsBlock = getPerAxisValue(block, TYPES.s, strBegin, elementObjSettingsBlockValues);
settingsMargin = margin;
var viewportScroll = {
l: _scrollHorizontalInfo.cs,
t: _scrollVerticalInfo.cs
};
// use padding element instead of viewport element because padding element has never padding, margin or position applied.
var viewportOffset = _paddingElement.offset();
//get coordinates
var elementOffset = finalElement.offset();
var doNotScroll = {
x : settingsScroll.x == strNever || settingsAxis == _strY,
y : settingsScroll.y == strNever || settingsAxis == _strX
};
elementOffset[_strTop] -= settingsMargin[0];
elementOffset[_strLeft] -= settingsMargin[3];
var elementScrollCoordinates = {
x: Math.round(elementOffset[_strLeft] - viewportOffset[_strLeft] + viewportScroll.l),
y: Math.round(elementOffset[_strTop] - viewportOffset[_strTop] + viewportScroll.t)
};
if (_isRTL) {
if (!_rtlScrollBehavior.n && !_rtlScrollBehavior.i)
elementScrollCoordinates.x = Math.round(viewportOffset[_strLeft] - elementOffset[_strLeft] + viewportScroll.l);
if (_rtlScrollBehavior.n && normalizeRTL)
elementScrollCoordinates.x *= -1;
if (_rtlScrollBehavior.i && normalizeRTL)
elementScrollCoordinates.x = Math.round(viewportOffset[_strLeft] - elementOffset[_strLeft] + (_scrollHorizontalInfo.ms - viewportScroll.l));
}
//measuring is required
if (settingsBlock.x != strBegin || settingsBlock.y != strBegin || settingsScroll.x == strIfNeeded || settingsScroll.y == strIfNeeded || _isRTL) {
var measuringElm = finalElement[0];
var rawElementSize = _supportTransform ? measuringElm.getBoundingClientRect() : {
width : measuringElm[LEXICON.oW],
height : measuringElm[LEXICON.oH]
};
var elementSize = {
w: rawElementSize[_strWidth] + settingsMargin[3] + settingsMargin[1],
h: rawElementSize[_strHeight] + settingsMargin[0] + settingsMargin[2]
};
var finalizeBlock = function(isX) {
var vars = getScrollbarVars(isX);
var wh = vars._wh;
var lt = vars.lt;
var xy = vars.xy;
var blockIsEnd = settingsBlock[xy] == (isX ? _isRTL ? strBegin : strEnd : strEnd);
var blockIsCenter = settingsBlock[xy] == strCenter;
var blockIsNearest = settingsBlock[xy] == strNearest;
var scrollNever = settingsScroll[xy] == strNever;
var scrollIfNeeded = settingsScroll[xy] == strIfNeeded;
var vpSize = _viewportSize[wh];
var vpOffset = viewportOffset[lt];
var elSize = elementSize[wh];
var elOffset = elementOffset[lt];
var divide = blockIsCenter ? 2 : 1;
var elementCenterOffset = elOffset + (elSize / 2);
var viewportCenterOffset = vpOffset + (vpSize / 2);
var isInView =
elSize <= vpSize
&& elOffset >= vpOffset
&& elOffset + elSize <= vpOffset + vpSize;
if(scrollNever)
doNotScroll[xy] = true;
else if(!doNotScroll[xy]) {
if (blockIsNearest || scrollIfNeeded) {
doNotScroll[xy] = scrollIfNeeded ? isInView : false;
blockIsEnd = elSize < vpSize ? elementCenterOffset > viewportCenterOffset : elementCenterOffset < viewportCenterOffset;
}
elementScrollCoordinates[xy] -= blockIsEnd || blockIsCenter ? ((vpSize / divide) - (elSize / divide)) * (isX && _isRTL && normalizeRTL ? -1 : 1) : 0;
}
};
finalizeBlock(true);
finalizeBlock(false);
}
if (doNotScroll.y)
delete elementScrollCoordinates.y;
if (doNotScroll.x)
delete elementScrollCoordinates.x;
coordinates = elementScrollCoordinates;
}
finalScroll[_strScrollLeft] = getFinalScroll(true, getRawScroll(coordinates).x);
finalScroll[_strScrollTop] = getFinalScroll(false, getRawScroll(coordinates).y);
doScrollLeft = finalScroll[_strScrollLeft] !== undefined;
doScrollTop = finalScroll[_strScrollTop] !== undefined;
if ((doScrollLeft || doScrollTop) && (duration > 0 || durationIsObject)) {
if (durationIsObject)
_viewportElement.animate(finalScroll, duration);
else {
animationOptions = {
duration: duration,
complete: complete
};
if (type(easing) == TYPES.a) {
var specialEasing = {};
specialEasing[_strScrollLeft] = easing[0];
specialEasing[_strScrollTop] = easing[1];
animationOptions.specialEasing = specialEasing;
}
else {
animationOptions.easing = easing;
}
_viewportElement.animate(finalScroll, animationOptions);
}
}
else {
if (doScrollLeft)
_viewportElement[_strScrollLeft](finalScroll[_strScrollLeft]);
if (doScrollTop)
_viewportElement[_strScrollTop](finalScroll[_strScrollTop]);
}
};
/**
* Stops all scroll animations.
* @returns {*} The current OverlayScrollbars instance (for chaining).
*/
_base.scrollStop = function (param1, param2, param3) {
_viewportElement.stop(param1, param2, param3);
return _base;
};
/**
* Returns all relevant elements.
* @param elementName The name of the element which shall be returned.
* @returns {{target: *, host: *, padding: *, viewport: *, content: *, scrollbarHorizontal: {scrollbar: *, track: *, handle: *}, scrollbarVertical: {scrollbar: *, track: *, handle: *}, scrollbarCorner: *} | *}
*/
_base.getElements = function (elementName) {
var obj = {
target: _targetElement[0],
host: _hostElement[0],
padding: _paddingElement[0],
viewport: _viewportElement[0],
content: _contentElement[0],
scrollbarHorizontal: {
scrollbar: _scrollbarHorizontalElement[0],
track: _scrollbarHorizontalTrackElement[0],
handle: _scrollbarHorizontalHandleElement[0]
},
scrollbarVertical: {
scrollbar: _scrollbarVerticalElement[0],
track: _scrollbarVerticalTrackElement[0],
handle: _scrollbarVerticalHandleElement[0]
},
scrollbarCorner: _scrollbarCornerElement[0]
};
return type(elementName) == TYPES.s ? getObjectPropVal(obj, elementName) : obj;
};
/**
* Returns a object which describes the current state of this instance.
* @param stateProperty A specific property from the state object which shall be returned.
* @returns {{widthAuto, heightAuto, overflowAmount, hideOverflow, hasOverflow, contentScrollSize, viewportSize, hostSize, autoUpdate} | *}
*/
_base.getState = function (stateProperty) {
var prepare = function (obj) {
if (!FRAMEWORK.isPlainObject(obj))
return obj;
var extended = extend(true, {}, obj);
var changePropertyName = function (from, to) {
if (extended.hasOwnProperty(from)) {
extended[to] = extended[from];
delete extended[from];
}
};
changePropertyName('w', _strWidth); //change w to width
changePropertyName('h', _strHeight); //change h to height
delete extended.c; //delete c (the 'changed' prop)
return extended;
};
var obj = {
sleeping: prepare(_isSleeping) || false,
autoUpdate: prepare(!_mutationObserverConnected),
widthAuto: prepare(_widthAutoCache),
heightAuto: prepare(_heightAutoCache),
padding: prepare(_cssPaddingCache),
overflowAmount: prepare(_overflowAmountCache),
hideOverflow: prepare(_hideOverflowCache),
hasOverflow: prepare(_hasOverflowCache),
contentScrollSize: prepare(_contentScrollSizeCache),
viewportSize: prepare(_viewportSize),
hostSize: prepare(_hostSizeCache),
documentMixed : prepare(_documentMixed)
};
return type(stateProperty) == TYPES.s ? getObjectPropVal(obj, stateProperty) : obj;
};
/**
* Gets all or specific extension instance.
* @param extName The name of the extension from which the instance shall be got.
* @returns {{}} The instance of the extension with the given name or undefined if the instance couldn't be found.
*/
_base.ext = function(extName) {
var result;
var privateMethods = _extensionsPrivateMethods.split(' ');
var i = 0;
if(type(extName) == TYPES.s) {
if(_extensions.hasOwnProperty(extName)) {
result = extend(true, {}, _extensions[extName]);
for (; i < privateMethods.length; i++)
delete result[privateMethods[i]];
}
}
else {
result = { };
for(i in _extensions)
result[i] = extend(true, { }, _base.ext(i));
}
return result;
};
/**
* Adds a extension to this instance.
* @param extName The name of the extension which shall be added.
* @param extensionOptions The extension options which shall be used.
* @returns {{}} The instance of the added extension or undefined if the extension couldn't be added properly.
*/
_base.addExt = function(extName, extensionOptions) {
var registeredExtensionObj = window[PLUGINNAME].extension(extName);
var instance;
var instanceAdded;
var instanceContract;
var contractResult;
var contractFulfilled = true;
if(registeredExtensionObj) {
if(!_extensions.hasOwnProperty(extName)) {
instance = registeredExtensionObj.extension.call(_base,
extend(true, { }, registeredExtensionObj.defaultOptions),
FRAMEWORK,
COMPATIBILITY);
if (instance) {
instanceContract = instance.contract;
if (type(instanceContract) == TYPES.f) {
contractResult = instanceContract(window);
contractFulfilled = type(contractResult) == TYPES.b ? contractResult : contractFulfilled;
}
if(contractFulfilled) {
_extensions[extName] = instance;
instanceAdded = instance.added;
if(type(instanceAdded) == TYPES.f)
instanceAdded(extensionOptions);
return _base.ext(extName);
}
}
}
else
return _base.ext(extName);
}
else
console.warn("A extension with the name \"" + extName + "\" isn't registered.");
};
/**
* Removes a extension from this instance.
* @param extName The name of the extension which shall be removed.
* @returns {boolean} True if the extension was removed, false otherwise e.g. if the extension wasn't added before.
*/
_base.removeExt = function(extName) {
var instance = _extensions[extName];
var instanceRemoved;
if(instance) {
delete _extensions[extName];
instanceRemoved = instance.removed;
if(type(instanceRemoved) == TYPES.f)
instanceRemoved();
return true;
}
return false;
};
/**
* Constructs the plugin.
* @param targetElement The element to which the plugin shall be applied.
* @param options The initial options of the plugin.
* @param extensions The extension(s) which shall be added right after the initialization.
* @returns {boolean} True if the plugin was successfully initialized, false otherwise.
*/
function construct(targetElement, options, extensions) {
_defaultOptions = globals.defaultOptions;
_nativeScrollbarStyling = globals.nativeScrollbarStyling;
_nativeScrollbarSize = extend(true, {}, globals.nativeScrollbarSize);
_nativeScrollbarIsOverlaid = extend(true, {}, globals.nativeScrollbarIsOverlaid);
_overlayScrollbarDummySize = extend(true, {}, globals.overlayScrollbarDummySize);
_rtlScrollBehavior = extend(true, {}, globals.rtlScrollBehavior);
//parse & set options but don't update
setOptions(extend(true, { }, _defaultOptions, options));
//check if the plugin hasn't to be initialized
if (_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.x && !_currentPreparedOptions.nativeScrollbarsOverlaid.initialize) {
callCallback("onInitializationWithdrawn");
return false;
}
_cssCalc = globals.cssCalc;
_msieVersion = globals.msie;
_autoUpdateRecommended = globals.autoUpdateRecommended;
_supportTransition = globals.supportTransition;
_supportTransform = globals.supportTransform;
_supportPassiveEvents = globals.supportPassiveEvents;
_supportResizeObserver = globals.supportResizeObserver;
_supportMutationObserver = globals.supportMutationObserver;
_restrictedMeasuring = globals.restrictedMeasuring;
_documentElement = FRAMEWORK(targetElement.ownerDocument);
_windowElement = FRAMEWORK(_documentElement[0].defaultView || _documentElement[0].parentWindow);
_htmlElement = findFirst(_documentElement, 'html');
_bodyElement = findFirst(_htmlElement, 'body');
_targetElement = FRAMEWORK(targetElement);
_isTextarea = _targetElement.is('textarea');
_isBody = _targetElement.is('body');
_documentMixed = _documentElement[0] !== document;
var initBodyScroll;
if (_isBody) {
initBodyScroll = {};
initBodyScroll.l = Math.max(_targetElement[_strScrollLeft](), _htmlElement[_strScrollLeft](), _windowElement[_strScrollLeft]());
initBodyScroll.t = Math.max(_targetElement[_strScrollTop](), _htmlElement[_strScrollTop](), _windowElement[_strScrollTop]());
}
//build Hide-scrollbars DOM
if (_isTextarea) {
_targetElement.wrap(generateDiv(_classNameHostTextareaElement));
addClass(_targetElement, _classNameTextareaElement + _strSpace + _classNameTextInherit);
_hostElement = _targetElement.parent();
var hostElementCSS = {};
if (!_currentPreparedOptions.sizeAutoCapable) {
hostElementCSS[_strWidth] = _targetElement.css(_strWidth);
hostElementCSS[_strHeight] = _targetElement.css(_strHeight);
}
_hostElement.css(hostElementCSS)
.wrapInner(generateDiv(_classNameContentElement + _strSpace + _classNameTextInherit))
.wrapInner(generateDiv(_classNameViewportElement + _strSpace + _classNameTextInherit))
.wrapInner(generateDiv(_classNamePaddingElement + _strSpace + _classNameTextInherit));
_contentElement = findFirst(_hostElement, _strDot + _classNameContentElement);
_viewportElement = findFirst(_hostElement, _strDot + _classNameViewportElement);
_paddingElement = findFirst(_hostElement, _strDot + _classNamePaddingElement);
_textareaCoverElement = FRAMEWORK(generateDiv(_classNameTextareaCoverElement));
_contentElement.prepend(_textareaCoverElement);
_targetElement.on(_strScroll, textareaOnScroll)
.on('drop', textareaOnDrop)
.on('focus', textareaOnFocus)
.on('focusout', textareaOnFocusOut);
if (_msieVersion > 9 || !_autoUpdateRecommended) {
_targetElement.on('input', textareaOnInput);
}
else {
_targetElement.on(_strKeyDownEvent, textareaOnKeyDown)
.on(_strKeyUpEvent, textareaOnKeyUp);
}
} else {
addClass(_targetElement, _classNameHostElement);
_hostElement = _targetElement;
_hostElement.wrapInner(generateDiv(_classNameContentElement))
.wrapInner(generateDiv(_classNameViewportElement))
.wrapInner(generateDiv(_classNamePaddingElement));
_contentElement = findFirst(_hostElement, _strDot + _classNameContentElement);
_viewportElement = findFirst(_hostElement, _strDot + _classNameViewportElement);
_paddingElement = findFirst(_hostElement, _strDot + _classNamePaddingElement);
//add transitionend event
_contentElement.on(_strTransitionEndEvent, function (event) {
if (_autoUpdateCache === true)
return;
event = event.originalEvent || event;
if (isSizeAffectingCSSProperty(event.propertyName))
update(_strAuto);
});
}
buildScrollbars();
//add scroll event
if (_supportPassiveEvents)
addPassiveEventListener(_viewportElement, _strScroll, viewportOnScroll);
else
_viewportElement.on(_strScroll, viewportOnScroll);
if (_nativeScrollbarStyling)
addClass(_viewportElement, _nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y ? _classNameViewportNativeScrollbarsOverlaid : _classNameViewportNativeScrollbarsInvisible);
//build mutation observers
if (_supportMutationObserver) {
var mutationObserver = COMPATIBILITY.mO();
var contentLastUpdate = COMPATIBILITY.now();
var mutationTarget;
var mutationAttrName;
var contentTimeout;
var now;
var sizeAuto;
var action;
_mutationObserverHost = new mutationObserver(function (mutations) {
if (!_initialized || _isSleeping)
return;
var doUpdate = false;
//var doUpdateScrollbars = false;
var mutation;
FRAMEWORK.each(mutations, function () {
mutation = this;
mutationTarget = mutation.target;
mutationAttrName = mutation.attributeName;
if (mutationAttrName === LEXICON.c)
doUpdate = hostClassNamesChanged(mutation.oldValue, mutationTarget.className);
else if (mutationAttrName === LEXICON.s)
doUpdate = mutation.oldValue !== mutationTarget[LEXICON.s].cssText;
else
doUpdate = true;
if (doUpdate)
return false;
});
if (doUpdate)
_base.update(_strAuto);
/*
if(doUpdateScrollbars) {
refreshScrollbarHandleLength(true);
refreshScrollbarHandleOffset(true, _scrollHorizontalInfo.cs);
refreshScrollbarHandleLength(false);
refreshScrollbarHandleOffset(false, _scrollVerticalInfo.cs);
}
*/
});
_mutationObserverContent = new mutationObserver(function (mutations) {
if (!_initialized || _isSleeping)
return;
var doUpdate = false;
var mutation;
FRAMEWORK.each(mutations, function () {
mutation = this;
doUpdate = isUnknownMutation(mutation);
return !doUpdate;
});
if (doUpdate) {
now = COMPATIBILITY.now();
sizeAuto = (_heightAutoCache || _widthAutoCache);
action = function () {
if(!_destroyed) {
contentLastUpdate = now;
//if cols, rows or wrap attr was changed
if (_isTextarea)
textareaUpdate();
if (sizeAuto)
update();
else
_base.update(_strAuto);
}
};
clearTimeout(contentTimeout);
if (_mutationObserverContentLag <= 0 || now - contentLastUpdate > _mutationObserverContentLag || !sizeAuto)
action();
else
contentTimeout = setTimeout(action, _mutationObserverContentLag);
}
});
}
//build resize observer for the host element
if (_isBody) {
addClass(_htmlElement, _classNameHTMLElement);
//apply the body scroll to handle it right in the update method
_viewportElement[_strScrollLeft](initBodyScroll.l);
_viewportElement[_strScrollTop](initBodyScroll.t);
}
_sizeObserverElement = FRAMEWORK(generateDiv('os-resize-observer-host'));
_hostElement.prepend(_sizeObserverElement);
addResizeObserver(_sizeObserverElement, hostOnResized);
//update for the first time
hostOnResized(); //initialize cache for host size
_base.update(_strAuto); //initialize cache for content
//add the transition class for transitions AFTER the first update (for preventing unwanted transitions)
setTimeout(function () {
if (_supportTransition && !_destroyed)
addClass(_hostElement, _classNameHostTransition)
}, 333);
//the plugin is initialized now!
_initialized = true;
callCallback("onInitialized");
//add extensions
if(type(extensions) == TYPES.s)
extensions = [ extensions ];
if(COMPATIBILITY.isA(extensions))
FRAMEWORK.each(extensions, function () {_base.addExt(this); });
else if(FRAMEWORK.isPlainObject(extensions))
FRAMEWORK.each(extensions, function (key, value) { _base.addExt(key, value); });
return _initialized;
}
if (construct(pluginTargetElement, options, extensions)) {
INSTANCES(pluginTargetElement, _base);
return _base;
}
_base = undefined;
}
/**
* Initializes a new OverlayScrollbarsInstance object or changes options if already initialized or returns the current instance.
* @param pluginTargetElements The elements to which the Plugin shall be initialized.
* @param options The custom options with which the plugin shall be initialized.
* @param extensions The extension(s) which shall be added right after initialization.
* @returns {*}
*/
window[PLUGINNAME] = function(pluginTargetElements, options, extensions) {
if(arguments.length === 0)
return this;
initOverlayScrollbarsStatics();
var arr = [ ];
var inst;
var result;
if(FRAMEWORK.isPlainObject(options)) {
if (pluginTargetElements && pluginTargetElements.length) {
FRAMEWORK.each(pluginTargetElements, function () {
inst = this;
if(inst !== undefined)
arr.push(OverlayScrollbarsInstance(inst, options, extensions, _pluginsGlobals, _pluginsAutoUpdateLoop));
});
result = arr.length > 1 ? arr : arr[0];
}
else
result = OverlayScrollbarsInstance(pluginTargetElements, options, extensions, _pluginsGlobals, _pluginsAutoUpdateLoop);
}
else if(pluginTargetElements) {
if(pluginTargetElements.length && pluginTargetElements.length > 0) {
FRAMEWORK.each(pluginTargetElements, function() {
inst = INSTANCES(this);
if(options === '!') {
if(inst instanceof window[PLUGINNAME])
arr.push(inst);
}
else
arr.push(inst);
});
result = arr.length > 1 ? arr : arr[0];
}
else
result = INSTANCES(pluginTargetElements);
}
return result;
};
/**
* Returns a object which contains global information about the plugin and each instance of it.
* The returned object is just a copy, that means that changes to the returned object won't have any effect to the original object.
*/
window[PLUGINNAME].globals = function () {
initOverlayScrollbarsStatics();
var globals = FRAMEWORK.extend(true, { }, _pluginsGlobals);
delete globals['msie'];
return globals;
};
/**
* Gets or Sets the default options for each new plugin initialization.
* @param newDefaultOptions The object with which the default options shall be extended.
*/
window[PLUGINNAME].defaultOptions = function(newDefaultOptions) {
initOverlayScrollbarsStatics();
var currDefaultOptions = _pluginsGlobals.defaultOptions;
if(newDefaultOptions === undefined)
return FRAMEWORK.extend(true, { }, currDefaultOptions);
//set the new default options
_pluginsGlobals.defaultOptions = FRAMEWORK.extend(true, { }, currDefaultOptions , _pluginsOptions.v(newDefaultOptions, _pluginsOptions.t, true));
};
/**
* Registers, Unregisters or returns a extension.
* Register: Pass the name and the extension. (defaultOptions is optional)
* Unregister: Pass the name and anything except a function as extension parameter.
* Get extension: Pass the name of the extension which shall be got.
* Get all extensions: Pass no arguments.
* @param extensionName The name of the extension which shall be registered, unregistered or returned.
* @param extension A function which generates the instance of the extension or anything other to remove a already registered extension.
* @param defaultOptions The default options which shall be used for the registered extension.
*/
window[PLUGINNAME].extension = function(extensionName, extension, defaultOptions) {
var extNameTypeString = COMPATIBILITY.type(extensionName) == TYPES.s;
var argLen = arguments[LEXICON.l];
var i = 0;
if(argLen < 1 || !extNameTypeString) {
//return a copy of all extension objects
return FRAMEWORK.extend(true, { length : _pluginsExtensions[LEXICON.l] }, _pluginsExtensions);
}
else if(extNameTypeString) {
if(COMPATIBILITY.type(extension) == TYPES.f) {
//register extension
_pluginsExtensions.push({
name : extensionName,
extension : extension,
defaultOptions : defaultOptions
});
}
else {
for(; i < _pluginsExtensions[LEXICON.l]; i++) {
if (_pluginsExtensions[i].name === extensionName) {
if(argLen > 1)
_pluginsExtensions.splice(i, 1); //remove extension
else
return FRAMEWORK.extend(true, { }, _pluginsExtensions[i]); //return extension with the given name
}
}
}
}
};
return window[PLUGINNAME];
})();
if(JQUERY && JQUERY.fn) {
/**
* The jQuery initialization interface.
* @param options The initial options for the construction of the plugin. To initialize the plugin, this option has to be a object! If it isn't a object, the instance(s) are returned and the plugin wont be initialized.
* @param extensions The extension(s) which shall be added right after initialization.
* @returns {*} After initialization it returns the jQuery element array, else it returns the instance(s) of the elements which are selected.
*/
JQUERY.fn.overlayScrollbars = function (options, extensions) {
var _elements = this;
if(JQUERY.isPlainObject(options)) {
JQUERY.each(_elements, function() { PLUGIN(this, options, extensions); });
return _elements;
}
else
return PLUGIN(_elements, options);
};
}
return PLUGIN;
}
));
|
version https://git-lfs.github.com/spec/v1
oid sha256:824191b014bfc0ab7e59b4c9eeeca852e6788c6a6c8120ef6c151e36e6f13d76
size 31258
|
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_sl=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(e){return e}};return e.locale(_,null,!0),_});
|
ccm_enableUserProfileMenu=function(){var a=$("#ccm-account-menu-container"),b=$("#ccm-account-menu");if(b.length){if(0==a.length)var a=$("<div />").appendTo(document.body);a.addClass("ccm-ui").attr("id","ccm-account-menu-container"),$("#ccm-account-menu").appendTo(a);var c=$(document).height(),d=$("#ccm-account-menu").offset().top;c>200&&200>c-d&&$("#ccm-account-menu").addClass("dropup")}};
|
require('../../modules/es.weak-set');
require('../../modules/esnext.weak-set.delete-all');
module.exports = require('../../internals/entry-unbind')('WeakSet', 'deleteAll');
|
module.exports = {
authenticate: true,
func: function () { }
}
|
/**
* @author alteredq / http://alteredqualia.com/
* @author Lewy Blue https://github.com/looeee
*
* The model is expected to follow real world car proportions. You can try unusual car types
* but your results may be unexpected. Scaled models are also not supported.
*
* Defaults are rough estimates for a real world scale car model
*
*/
THREE.CarControls = ( function ( ) {
// private variables
var steeringWheelSpeed = 1.5;
var maxSteeringRotation = 0.6;
var acceleration = 0;
var maxSpeedReverse, accelerationReverse, deceleration;
var controlKeys = { LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, BRAKE: 32 };
var wheelOrientation = 0;
var carOrientation = 0;
var root = null;
var frontLeftWheelRoot = null;
var frontRightWheelRoot = null;
var frontLeftWheel = new THREE.Group();
var frontRightWheel = new THREE.Group();
var backLeftWheel = null;
var backRightWheel = null;
var steeringWheel = null;
var wheelDiameter = 1;
var length = 1;
var loaded = false;
var controls = {
brake: false,
moveForward: false,
moveBackward: false,
moveLeft: false,
moveRight: false
};
function CarControls( maxSpeed, acceleration, brakePower, turningRadius, keys ) {
this.enabled = true;
this.elemNames = {
flWheel: 'wheel_fl',
frWheel: 'wheel_fr',
rlWheel: 'wheel_rl',
rrWheel: 'wheel_rr',
steeringWheel: 'steering_wheel', // set to null to disable
};
// km/hr
this.maxSpeed = maxSpeed || 180;
maxSpeedReverse = - this.maxSpeed * 0.25;
// m/s
this.acceleration = acceleration || 10;
accelerationReverse = this.acceleration * 0.5;
// metres
this.turningRadius = turningRadius || 6;
// m/s
deceleration = this.acceleration * 2;
// multiplied with deceleration, so breaking deceleration = ( acceleration * 2 * brakePower ) m/s
this.brakePower = brakePower || 10;
// exposed so that a user can use this for various effect, e.g blur
this.speed = 0;
// keys used to control car - by default the arrow keys and space to brake
controlKeys = keys || controlKeys;
// local axes of rotation - these are likely to vary between models
this.wheelRotationAxis = 'x';
this.wheelTurnAxis = 'z';
this.steeringWheelTurnAxis = 'y';
document.addEventListener( 'keydown', this.onKeyDown, false );
document.addEventListener( 'keyup', this.onKeyUp, false );
}
CarControls.prototype = {
constructor: CarControls,
onKeyDown: function ( event ) {
switch ( event.keyCode ) {
case controlKeys.BRAKE:
controls.brake = true;
controls.moveForward = false;
controls.moveBackward = false;
break;
case controlKeys.UP: controls.moveForward = true; break;
case controlKeys.DOWN: controls.moveBackward = true; break;
case controlKeys.LEFT: controls.moveLeft = true; break;
case controlKeys.RIGHT: controls.moveRight = true; break;
}
},
onKeyUp: function ( event ) {
switch ( event.keyCode ) {
case controlKeys.BRAKE: controls.brake = false; break;
case controlKeys.UP: controls.moveForward = false; break;
case controlKeys.DOWN: controls.moveBackward = false; break;
case controlKeys.LEFT: controls.moveLeft = false; break;
case controlKeys.RIGHT: controls.moveRight = false; break;
}
},
dispose: function () {
document.removeEventListener( 'keydown', this.onKeyDown, false );
document.removeEventListener( 'keyup', this.onKeyUp, false );
},
update: function ( delta ) {
if ( ! loaded || ! this.enabled ) return;
var brakingDeceleration = 1;
if ( controls.brake ) brakingDeceleration = this.brakePower;
if ( controls.moveForward ) {
this.speed = THREE.Math.clamp( this.speed + delta * this.acceleration, maxSpeedReverse, this.maxSpeed );
acceleration = THREE.Math.clamp( acceleration + delta, - 1, 1 );
}
if ( controls.moveBackward ) {
this.speed = THREE.Math.clamp( this.speed - delta * accelerationReverse, maxSpeedReverse, this.maxSpeed );
acceleration = THREE.Math.clamp( acceleration - delta, - 1, 1 );
}
if ( controls.moveLeft ) {
wheelOrientation = THREE.Math.clamp( wheelOrientation + delta * steeringWheelSpeed, - maxSteeringRotation, maxSteeringRotation );
}
if ( controls.moveRight ) {
wheelOrientation = THREE.Math.clamp( wheelOrientation - delta * steeringWheelSpeed, - maxSteeringRotation, maxSteeringRotation );
}
// this.speed decay
if ( ! ( controls.moveForward || controls.moveBackward ) ) {
if ( this.speed > 0 ) {
var k = exponentialEaseOut( this.speed / this.maxSpeed );
this.speed = THREE.Math.clamp( this.speed - k * delta * deceleration * brakingDeceleration, 0, this.maxSpeed );
acceleration = THREE.Math.clamp( acceleration - k * delta, 0, 1 );
} else {
var k = exponentialEaseOut( this.speed / maxSpeedReverse );
this.speed = THREE.Math.clamp( this.speed + k * delta * accelerationReverse * brakingDeceleration, maxSpeedReverse, 0 );
acceleration = THREE.Math.clamp( acceleration + k * delta, - 1, 0 );
}
}
// steering decay
if ( ! ( controls.moveLeft || controls.moveRight ) ) {
if ( wheelOrientation > 0 ) {
wheelOrientation = THREE.Math.clamp( wheelOrientation - delta * steeringWheelSpeed, 0, maxSteeringRotation );
} else {
wheelOrientation = THREE.Math.clamp( wheelOrientation + delta * steeringWheelSpeed, - maxSteeringRotation, 0 );
}
}
var forwardDelta = - this.speed * delta;
carOrientation -= ( forwardDelta * this.turningRadius * 0.02 ) * wheelOrientation;
// movement of car
root.position.x += Math.sin( carOrientation ) * forwardDelta * length;
root.position.z += Math.cos( carOrientation ) * forwardDelta * length;
// angle of car
root.rotation.y = carOrientation;
// wheels rolling
var angularSpeedRatio = - 2 / wheelDiameter;
var wheelDelta = forwardDelta * angularSpeedRatio * length;
frontLeftWheel.rotation[ this.wheelRotationAxis ] -= wheelDelta;
frontRightWheel.rotation[ this.wheelRotationAxis ] -= wheelDelta;
backLeftWheel.rotation[ this.wheelRotationAxis ] -= wheelDelta;
backRightWheel.rotation[ this.wheelRotationAxis ] -= wheelDelta;
// rotation while steering
frontLeftWheelRoot.rotation[ this.wheelTurnAxis ] = wheelOrientation;
frontRightWheelRoot.rotation[ this.wheelTurnAxis ] = wheelOrientation;
steeringWheel.rotation[ this.steeringWheelTurnAxis ] = - wheelOrientation * 6;
},
setModel: function ( model, elemNames ) {
if ( elemNames ) this.elemNames = elemNames;
root = model;
this.setupWheels();
this.computeDimensions();
loaded = true;
},
setupWheels: function () {
frontLeftWheelRoot = root.getObjectByName( this.elemNames.flWheel );
frontRightWheelRoot = root.getObjectByName( this.elemNames.frWheel );
backLeftWheel = root.getObjectByName( this.elemNames.rlWheel );
backRightWheel = root.getObjectByName( this.elemNames.rrWheel );
if ( this.elemNames.steeringWheel !== null ) steeringWheel = root.getObjectByName( this.elemNames.steeringWheel );
while ( frontLeftWheelRoot.children.length > 0 ) frontLeftWheel.add( frontLeftWheelRoot.children[ 0 ] );
while ( frontRightWheelRoot.children.length > 0 ) frontRightWheel.add( frontRightWheelRoot.children[ 0 ] );
frontLeftWheelRoot.add( frontLeftWheel );
frontRightWheelRoot.add( frontRightWheel );
},
computeDimensions: function () {
var bb = new THREE.Box3().setFromObject( frontLeftWheelRoot );
var size = new THREE.Vector3();
bb.getSize( size );
wheelDiameter = Math.max( size.x, size.y, size.z );
bb.setFromObject( root );
size = bb.getSize( size );
length = Math.max( size.x, size.y, size.z );
}
};
function exponentialEaseOut( k ) {
return k === 1 ? 1 : - Math.pow( 2, - 10 * k ) + 1;
}
return CarControls;
} )();
|
module.exports={title:"Swift",hex:"FA7343",source:"https://developer.apple.com/develop/",svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Swift icon</title><path d="M21.984 16.348c.056-.112.056-.224.112-.336 1.346-5.272-1.851-11.44-7.347-14.693 2.412 3.253 3.365 7.122 2.524 10.599-.056.28-.168.617-.28.897a5.173 5.173 0 0 1-.45-.28S11.104 9.17 5.273 3.282c-.169-.168 3.14 4.71 6.841 8.58-1.738-1.01-6.673-4.542-9.758-7.403.337.617.842 1.234 1.346 1.851 2.58 3.309 5.945 7.346 9.983 10.43-2.86 1.74-6.842 1.851-10.88 0-1.01-.448-1.85-1.009-2.804-1.682 1.682 2.636 4.318 5.048 7.459 6.337 3.757 1.627 7.57 1.515 10.318 0h.057c.112-.056.224-.112.336-.224 1.346-.673 3.982-1.402 5.44 1.402.392.785 1.121-2.86-1.626-6.225z"/></svg>'};
|
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require('./src/test_lib/test_lib'));
__export(require('./src/test_lib/utils'));
__export(require('./src/test_lib/fake_async'));
__export(require('./src/test_lib/test_component_builder'));
__export(require('./debug'));
exports.__esModule = true;
//# sourceMappingURL=test_lib.js.map
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.1.1 (c) Oliver Folkerd */
var DataTree = function DataTree(table) {
this.table = table;
this.indent = 10;
this.field = "";
this.collapseEl = null;
this.expandEl = null;
this.branchEl = null;
this.startOpen = function () {};
this.displayIndex = 0;
};
DataTree.prototype.initialize = function () {
var dummyEl = null,
options = this.table.options;
this.field = options.dataTreeChildField;
this.indent = options.dataTreeChildIndent;
if (options.dataTreeBranchElement) {
if (options.dataTreeBranchElement === true) {
this.branchEl = document.createElement("div");
this.branchEl.classList.add("tabulator-data-tree-branch");
} else {
if (typeof options.dataTreeBranchElement === "string") {
dummyEl = document.createElement("div");
dummyEl.innerHTML = options.dataTreeBranchElement;
this.branchEl = dummyEl.firstChild;
} else {
this.branchEl = options.dataTreeBranchElement;
}
}
}
if (options.dataTreeCollapseElement) {
if (typeof options.dataTreeCollapseElement === "string") {
dummyEl = document.createElement("div");
dummyEl.innerHTML = options.dataTreeCollapseElement;
this.collapseEl = dummyEl.firstChild;
} else {
this.collapseEl = options.dataTreeCollapseElement;
}
} else {
this.collapseEl = document.createElement("div");
this.collapseEl.classList.add("tabulator-data-tree-control");
this.collapseEl.innerHTML = "<div class='tabulator-data-tree-control-collapse'></div>";
}
if (options.dataTreeExpandElement) {
if (typeof options.dataTreeExpandElement === "string") {
dummyEl = document.createElement("div");
dummyEl.innerHTML = options.dataTreeExpandElement;
this.expandEl = dummyEl.firstChild;
} else {
this.expandEl = options.dataTreeExpandElement;
}
} else {
this.expandEl = document.createElement("div");
this.expandEl.classList.add("tabulator-data-tree-control");
this.expandEl.innerHTML = "<div class='tabulator-data-tree-control-expand'></div>";
}
switch (_typeof(options.dataTreeStartExpanded)) {
case "boolean":
this.startOpen = function (row, index) {
return options.dataTreeStartExpanded;
};
break;
case "function":
this.startOpen = options.dataTreeStartExpanded;
break;
default:
this.startOpen = function (row, index) {
return options.dataTreeStartExpanded[index];
};
break;
}
};
DataTree.prototype.initializeRow = function (row) {
var children = typeof row.getData()[this.field] !== "undefined";
row.modules.dataTree = {
index: 0,
open: children ? this.startOpen(row.getComponent(), 0) : false,
controlEl: false,
branchEl: false,
parent: false,
children: children
};
};
DataTree.prototype.layoutRow = function (row) {
var cell = row.getCells()[0],
el = cell.getElement(),
config = row.modules.dataTree;
el.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + config.index * this.indent + "px";
if (config.branchEl) {
config.branchEl.parentNode.removeChild(config.branchEl);
}
this.generateControlElement(row, el);
if (config.index && this.branchEl) {
config.branchEl = this.branchEl.cloneNode(true);
el.insertBefore(config.branchEl, el.firstChild);
el.style.paddingLeft = parseInt(el.style.paddingLeft) + (config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1) + "px";
}
};
DataTree.prototype.generateControlElement = function (row, el) {
var _this = this;
var config = row.modules.dataTree,
el = el || row.getCells()[0].getElement(),
oldControl = config.controlEl;
if (config.children !== false) {
if (config.open) {
config.controlEl = this.collapseEl.cloneNode(true);
config.controlEl.addEventListener("click", function (e) {
e.stopPropagation();
_this.collapseRow(row);
});
} else {
config.controlEl = this.expandEl.cloneNode(true);
config.controlEl.addEventListener("click", function (e) {
e.stopPropagation();
_this.expandRow(row);
});
}
config.controlEl.addEventListener("mousedown", function (e) {
e.stopPropagation();
});
if (oldControl && oldControl.parentNode === el) {
oldControl.parentNode.replaceChild(config.controlEl, oldControl);
} else {
el.insertBefore(config.controlEl, el.firstChild);
}
}
};
DataTree.prototype.setDisplayIndex = function (index) {
this.displayIndex = index;
};
DataTree.prototype.getDisplayIndex = function () {
return this.displayIndex;
};
DataTree.prototype.getRows = function (rows) {
var _this2 = this;
var output = [];
rows.forEach(function (row, i) {
var config = row.modules.dataTree.children,
children;
output.push(row);
if (!config.index && config.children !== false) {
children = _this2.getChildren(row);
children.forEach(function (child) {
output.push(child);
});
}
});
return output;
};
DataTree.prototype.getChildren = function (row) {
var _this3 = this;
var config = row.modules.dataTree,
output = [];
if (config.children !== false && config.open) {
if (!Array.isArray(config.children)) {
config.children = this.generateChildren(row);
}
config.children.forEach(function (child) {
output.push(child);
var subChildren = _this3.getChildren(child);
subChildren.forEach(function (sub) {
output.push(sub);
});
});
}
return output;
};
DataTree.prototype.generateChildren = function (row) {
var _this4 = this;
var children = [];
row.getData()[this.field].forEach(function (childData) {
var childRow = new Row(childData || {}, _this4.table.rowManager);
childRow.modules.dataTree.index = row.modules.dataTree.index + 1;
childRow.modules.dataTree.parent = row;
childRow.modules.dataTree.open = _this4.startOpen(row, childRow.modules.dataTree.index);
children.push(childRow);
});
return children;
};
DataTree.prototype.expandRow = function (row, silent) {
var config = row.modules.dataTree;
if (config.children !== false) {
config.open = true;
row.reinitialize();
this.table.rowManager.refreshActiveData("tree", false, true);
this.table.options.dataTreeRowExpanded(row.getComponent(), row.modules.dataTree.index);
}
};
DataTree.prototype.collapseRow = function (row) {
var config = row.modules.dataTree;
if (config.children !== false) {
config.open = false;
row.reinitialize();
this.table.rowManager.refreshActiveData("tree", false, true);
this.table.options.dataTreeRowCollapsed(row.getComponent(), row.modules.dataTree.index);
}
};
DataTree.prototype.toggleRow = function (row) {
var config = row.modules.dataTree;
if (config.children !== false) {
if (config.open) {
this.collapseRow(row);
} else {
this.expandRow(row);
}
}
};
DataTree.prototype.getTreeParent = function (row) {
return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
};
DataTree.prototype.getTreeChildren = function (row) {
var config = row.modules.dataTree,
output = [];
if (config.children) {
if (!Array.isArray(config.children)) {
config.children = this.generateChildren(row);
}
config.children.forEach(function (childRow) {
if (childRow instanceof Row) {
output.push(childRow.getComponent());
}
});
}
return output;
};
DataTree.prototype.checkForRestyle = function (cell) {
if (!cell.row.cells.indexOf(cell)) {
if (cell.row.modules.dataTree.children !== false) {
cell.row.reinitialize();
}
}
};
Tabulator.prototype.registerModule("dataTree", DataTree);
|
module.exports=/[\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058F\uFB13-\uFB17]/
|
var fs = require('fs'),
path = require('path');
/**
* Returns a function that looks in a specified path relative to the current
* directory, and returns all .js modules it (recursively).
*
* ####Example:
*
* var importRoutes = keystone.importer(__dirname);
*
* var routes = {
* site: importRoutes('./site'),
* api: importRoutes('./api')
* };
*
* @param {String} rel__dirname
* @api public
*/
function dispatchImporter(rel__dirname) {
function importer(from) {
var imported = {};
var joinPath = function() {
return '.' + path.sep + path.join.apply(path, arguments);
};
var fsPath = joinPath(path.relative(process.cwd(), rel__dirname), from);
fs.readdirSync(fsPath).forEach(function(name) {
var info = fs.statSync(path.join(fsPath, name));
// recur
if (info.isDirectory()) {
imported[name] = importer(joinPath(from, name));
} else {
// only import files that we can `require`
var ext = path.extname(name);
var base = path.basename(name, ext);
if (require.extensions[ext]) {
imported[base] = require(path.join(rel__dirname, from, name));
}
}
return imported;
});
return imported;
}
return importer;
}
module.exports = dispatchImporter;
|
import { getOwner, OWNER } from 'ember-utils';
import { ENV } from 'ember-environment';
import { get, isFeatureEnabled } from 'ember-metal';
import { Registry } from '../index';
import { factory } from 'internal-test-helpers';
import { LOOKUP_FACTORY, FACTORY_FOR } from 'container';
let originalModelInjections;
QUnit.module('Container', {
setup() {
originalModelInjections = ENV.MODEL_FACTORY_INJECTIONS;
},
teardown() {
ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections;
}
});
function lookupFactory(name, container, options) {
return container[LOOKUP_FACTORY](name, options);
}
QUnit.test('A registered factory returns the same instance each time', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
let postController = container.lookup('controller:post');
ok(postController instanceof PostController, 'The lookup is an instance of the factory');
equal(postController, container.lookup('controller:post'));
});
QUnit.test('A registered factory is returned from lookupFactory', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
let PostControllerFactory = lookupFactory('controller:post', container);
ok(PostControllerFactory, 'factory is returned');
ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController');
});
QUnit.test('A registered factory is returned from lookupFactory is the same factory each time', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
let Post1 = lookupFactory('controller:post', container);
let Post2 = lookupFactory('controller:post', container);
deepEqual(Post1, Post2, 'The return of lookupFactory is always the same');
});
QUnit.test('A factory returned from lookupFactory has a debugkey', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
let PostFactory = lookupFactory('controller:post', container);
equal(PostFactory._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey');
});
QUnit.test('fallback for to create time injections if factory has no extend', function() {
let registry = new Registry();
let container = registry.container();
let AppleController = factory();
let PostController = factory();
PostController.extend = undefined; // remove extend
registry.register('controller:apple', AppleController);
registry.register('controller:post', PostController);
registry.injection('controller:post', 'apple', 'controller:apple');
let postController = container.lookup('controller:post');
equal(postController._debugContainerKey, 'controller:post', 'instance receives _debugContainerKey');
ok(postController.apple instanceof AppleController, 'instance receives an apple of instance AppleController');
});
QUnit.test('The descendants of a factory returned from lookupFactory have a container and debugkey', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let instance;
registry.register('controller:post', PostController);
instance = lookupFactory('controller:post', container).create();
equal(instance._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey');
ok(instance instanceof PostController, 'factory instance is instance of factory');
});
QUnit.test('A registered factory returns a fresh instance if singleton: false is passed as an option', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
let postController1 = container.lookup('controller:post');
let postController2 = container.lookup('controller:post', { singleton: false });
let postController3 = container.lookup('controller:post', { singleton: false });
let postController4 = container.lookup('controller:post');
equal(postController1.toString(), postController4.toString(), 'Singleton factories looked up normally return the same value');
notEqual(postController1.toString(), postController2.toString(), 'Singleton factories are not equal to factories looked up with singleton: false');
notEqual(postController2.toString(), postController3.toString(), 'Two factories looked up with singleton: false are not equal');
notEqual(postController3.toString(), postController4.toString(), 'A singleton factory looked up after a factory called with singleton: false is not equal');
ok(postController1 instanceof PostController, 'All instances are instances of the registered factory');
ok(postController2 instanceof PostController, 'All instances are instances of the registered factory');
ok(postController3 instanceof PostController, 'All instances are instances of the registered factory');
ok(postController4 instanceof PostController, 'All instances are instances of the registered factory');
});
QUnit.test('A factory type with a registered injection\'s instances receive that injection', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let Store = factory();
registry.register('controller:post', PostController);
registry.register('store:main', Store);
registry.typeInjection('controller', 'store', 'store:main');
let postController = container.lookup('controller:post');
let store = container.lookup('store:main');
equal(postController.store, store);
});
QUnit.test('An individual factory with a registered injection receives the injection', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let Store = factory();
registry.register('controller:post', PostController);
registry.register('store:main', Store);
registry.injection('controller:post', 'store', 'store:main');
let postController = container.lookup('controller:post');
let store = container.lookup('store:main');
equal(store._debugContainerKey, 'store:main');
equal(postController._debugContainerKey, 'controller:post');
equal(postController.store, store, 'has the correct store injected');
});
QUnit.test('A factory with both type and individual injections', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let Store = factory();
let Router = factory();
registry.register('controller:post', PostController);
registry.register('store:main', Store);
registry.register('router:main', Router);
registry.injection('controller:post', 'store', 'store:main');
registry.typeInjection('controller', 'router', 'router:main');
let postController = container.lookup('controller:post');
let store = container.lookup('store:main');
let router = container.lookup('router:main');
equal(postController.store, store);
equal(postController.router, router);
});
QUnit.test('A factory with both type and individual factoryInjections', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let Store = factory();
let Router = factory();
registry.register('controller:post', PostController);
registry.register('store:main', Store);
registry.register('router:main', Router);
registry.factoryInjection('controller:post', 'store', 'store:main');
registry.factoryTypeInjection('controller', 'router', 'router:main');
let PostControllerFactory = lookupFactory('controller:post', container);
let store = container.lookup('store:main');
let router = container.lookup('router:main');
equal(PostControllerFactory.store, store, 'PostControllerFactory has the instance of store');
equal(PostControllerFactory.router, router, 'PostControllerFactory has the route instance');
});
QUnit.test('A non-singleton instance is never cached', function() {
let registry = new Registry();
let container = registry.container();
let PostView = factory();
registry.register('view:post', PostView, { singleton: false });
let postView1 = container.lookup('view:post');
let postView2 = container.lookup('view:post');
ok(postView1 !== postView2, 'Non-singletons are not cached');
});
QUnit.test('A non-instantiated property is not instantiated', function() {
let registry = new Registry();
let container = registry.container();
let template = function() {};
registry.register('template:foo', template, { instantiate: false });
equal(container.lookup('template:foo'), template);
});
QUnit.test('A failed lookup returns undefined', function() {
let registry = new Registry();
let container = registry.container();
equal(container.lookup('doesnot:exist'), undefined);
});
QUnit.test('An invalid factory throws an error', function() {
let registry = new Registry();
let container = registry.container();
registry.register('controller:foo', {});
throws(() => {
container.lookup('controller:foo');
}, /Failed to create an instance of \'controller:foo\'/);
});
QUnit.test('Injecting a failed lookup raises an error', function() {
ENV.MODEL_FACTORY_INJECTIONS = true;
let registry = new Registry();
let container = registry.container();
let fooInstance = {};
let fooFactory = {};
let Foo = {
create(args) { return fooInstance; },
extend(args) { return fooFactory; }
};
registry.register('model:foo', Foo);
registry.injection('model:foo', 'store', 'store:main');
throws(() => {
container.lookup('model:foo');
});
});
QUnit.test('Injecting a falsy value does not raise an error', function() {
let registry = new Registry();
let container = registry.container();
let ApplicationController = factory();
registry.register('controller:application', ApplicationController);
registry.register('user:current', null, { instantiate: false });
registry.injection('controller:application', 'currentUser', 'user:current');
strictEqual(container.lookup('controller:application').currentUser, null);
});
QUnit.test('The container returns same value each time even if the value is falsy', function() {
let registry = new Registry();
let container = registry.container();
registry.register('falsy:value', null, { instantiate: false });
strictEqual(container.lookup('falsy:value'), container.lookup('falsy:value'));
});
QUnit.test('Destroying the container destroys any cached singletons', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let PostView = factory();
let template = function() {};
registry.register('controller:post', PostController);
registry.register('view:post', PostView, { singleton: false });
registry.register('template:post', template, { instantiate: false });
registry.injection('controller:post', 'postView', 'view:post');
let postController = container.lookup('controller:post');
let postView = postController.postView;
ok(postView instanceof PostView, 'The non-singleton was injected');
container.destroy();
ok(postController.isDestroyed, 'Singletons are destroyed');
ok(!postView.isDestroyed, 'Non-singletons are not destroyed');
});
QUnit.test('The container can use a registry hook to resolve factories lazily', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.resolver = {
resolve(fullName) {
if (fullName === 'controller:post') {
return PostController;
}
}
};
let postController = container.lookup('controller:post');
ok(postController instanceof PostController, 'The correct factory was provided');
});
QUnit.test('The container normalizes names before resolving', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.normalizeFullName = function(fullName) {
return 'controller:post';
};
registry.register('controller:post', PostController);
let postController = container.lookup('controller:normalized');
ok(postController instanceof PostController, 'Normalizes the name before resolving');
});
QUnit.test('The container normalizes names when looking factory up', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.normalizeFullName = function(fullName) {
return 'controller:post';
};
registry.register('controller:post', PostController);
let fact = lookupFactory('controller:normalized', container);
equal(fact.toString() === PostController.extend().toString(), true, 'Normalizes the name when looking factory up');
});
QUnit.test('Options can be registered that should be applied to a given factory', function() {
let registry = new Registry();
let container = registry.container();
let PostView = factory();
registry.resolver = {
resolve(fullName) {
if (fullName === 'view:post') {
return PostView;
}
}
};
registry.options('view:post', { instantiate: true, singleton: false });
let postView1 = container.lookup('view:post');
let postView2 = container.lookup('view:post');
ok(postView1 instanceof PostView, 'The correct factory was provided');
ok(postView2 instanceof PostView, 'The correct factory was provided');
ok(postView1 !== postView2, 'The two lookups are different');
});
QUnit.test('Options can be registered that should be applied to all factories for a given type', function() {
let registry = new Registry();
let container = registry.container();
let PostView = factory();
registry.resolver = {
resolve(fullName) {
if (fullName === 'view:post') {
return PostView;
}
}
};
registry.optionsForType('view', { singleton: false });
let postView1 = container.lookup('view:post');
let postView2 = container.lookup('view:post');
ok(postView1 instanceof PostView, 'The correct factory was provided');
ok(postView2 instanceof PostView, 'The correct factory was provided');
ok(postView1 !== postView2, 'The two lookups are different');
});
QUnit.test('An injected non-singleton instance is never cached', function() {
let registry = new Registry();
let container = registry.container();
let PostView = factory();
let PostViewHelper = factory();
registry.register('view:post', PostView, { singleton: false });
registry.register('view_helper:post', PostViewHelper, { singleton: false });
registry.injection('view:post', 'viewHelper', 'view_helper:post');
let postView1 = container.lookup('view:post');
let postView2 = container.lookup('view:post');
ok(postView1.viewHelper !== postView2.viewHelper, 'Injected non-singletons are not cached');
});
QUnit.test('Factory resolves are cached', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let resolveWasCalled = [];
registry.resolve = function(fullName) {
resolveWasCalled.push(fullName);
return PostController;
};
deepEqual(resolveWasCalled, []);
lookupFactory('controller:post', container);
deepEqual(resolveWasCalled, ['controller:post']);
lookupFactory('controller:post', container);
deepEqual(resolveWasCalled, ['controller:post']);
});
QUnit.test('factory for non extendables (MODEL) resolves are cached', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
let resolveWasCalled = [];
registry.resolve = function(fullName) {
resolveWasCalled.push(fullName);
return PostController;
};
deepEqual(resolveWasCalled, []);
lookupFactory('model:post', container);
deepEqual(resolveWasCalled, ['model:post']);
lookupFactory('model:post', container);
deepEqual(resolveWasCalled, ['model:post']);
});
QUnit.test('factory for non extendables resolves are cached', function() {
let registry = new Registry();
let container = registry.container();
let PostController = {};
let resolveWasCalled = [];
registry.resolve = function(fullName) {
resolveWasCalled.push(fullName);
return PostController;
};
deepEqual(resolveWasCalled, []);
lookupFactory('foo:post', container);
deepEqual(resolveWasCalled, ['foo:post']);
lookupFactory('foo:post', container);
deepEqual(resolveWasCalled, ['foo:post']);
});
QUnit.test('The `_onLookup` hook is called on factories when looked up the first time', function() {
expect(2);
let registry = new Registry();
let container = registry.container();
let Apple = factory();
Apple.reopenClass({
_onLookup(fullName) {
equal(fullName, 'apple:main', 'calls lazy injection method with the lookup full name');
equal(this, Apple, 'calls lazy injection method in the factory context');
}
});
registry.register('apple:main', Apple);
lookupFactory('apple:main', container);
lookupFactory('apple:main', container);
});
QUnit.test('A factory\'s lazy injections are validated when first instantiated', function() {
let registry = new Registry();
let container = registry.container();
let Apple = factory();
let Orange = factory();
Apple.reopenClass({
_lazyInjections() {
return ['orange:main', 'banana:main'];
}
});
registry.register('apple:main', Apple);
registry.register('orange:main', Orange);
throws(() => {
container.lookup('apple:main');
}, /Attempting to inject an unknown injection: 'banana:main'/);
});
QUnit.test('Lazy injection validations are cached', function() {
expect(1);
let registry = new Registry();
let container = registry.container();
let Apple = factory();
let Orange = factory();
Apple.reopenClass({
_lazyInjections() {
ok(true, 'should call lazy injection method');
return ['orange:main'];
}
});
registry.register('apple:main', Apple);
registry.register('orange:main', Orange);
container.lookup('apple:main');
container.lookup('apple:main');
});
QUnit.test('An object with its owner pre-set should be returned from ownerInjection', function() {
let owner = { };
let registry = new Registry();
let container = registry.container({ owner });
let result = container.ownerInjection();
equal(result[OWNER], owner, 'owner is properly included');
});
QUnit.test('A deprecated `container` property is appended to every object instantiated from an extendable factory', function() {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
let postController = container.lookup('controller:post');
expectDeprecation(() => {
get(postController, 'container');
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.');
expectDeprecation(() => {
let c = postController.container;
strictEqual(c, container);
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.');
});
// This is testing that container was passed as an option
QUnit.test('A deprecated `container` property is appended to every object instantiated from a non-extendable factory, and a fake container is available during instantiation.', function() {
if (!isFeatureEnabled('ember-factory-for')) {
expect(8);
} else {
expect(1);
ok(true, '[SKIPPED] This will be removed when `factoryFor` lands.');
}
let owner = {};
let registry = new Registry();
let container = registry.container({ owner });
// Define a simple non-extendable factory
function PostController(options) {
this.container = options.container;
}
PostController.create = function(options) {
ok(options.container, 'fake container has been injected and is available during `create`.');
expectDeprecation(() => {
options.container.lookup('abc:one');
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `lookup` instead.');
expectDeprecation(() => {
options.container.lookupFactory('abc:two');
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `_lookupFactory` instead.');
// non-deprecated usage of `lookup` and `_lookupFactory`
owner.lookup = function(fullName) {
equal(fullName, 'abc:one', 'lookup on owner called properly');
};
owner._lookupFactory = function(fullName) {
equal(fullName, 'abc:two', '_lookupFactory on owner called properly');
};
let foundOwner = getOwner(options);
foundOwner.lookup('abc:one');
foundOwner._lookupFactory('abc:two');
return new PostController(options);
};
registry.register('controller:post', PostController);
if (!isFeatureEnabled('ember-factory-for')) {
let postController = container.lookup('controller:post');
expectDeprecation(() => {
get(postController, 'container');
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.');
expectDeprecation(() => {
let c = postController.container;
strictEqual(c, container, 'Injected container is now regular (not fake) container, but access is still deprecated.');
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.');
}
});
QUnit.test('An extendable factory can provide `container` upon create, with a deprecation', function(assert) {
let registry = new Registry();
let container = registry.container();
registry.register('controller:post', factory());
let PostController = lookupFactory('controller:post', container);
let postController;
expectDeprecation(() => {
postController = PostController.create({
container: 'foo'
});
}, /Providing the \`container\` property to .+ is deprecated. Please use \`Ember.setOwner\` or \`owner.ownerInjection\(\)\` instead to provide an owner to the instance being created/);
expectDeprecation(() => {
let c = postController.container;
assert.equal(c, 'foo', 'the `container` provided to `.create`was used');
}, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.');
});
QUnit.test('lookupFactory passes options through to expandlocallookup', function(assert) {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
registry.expandLocalLookup = function(fullName, options) {
assert.ok(true, 'expandLocalLookup was called');
assert.equal(fullName, 'foo:bar');
assert.deepEqual(options, { source: 'baz:qux' });
return 'controller:post';
};
let PostControllerFactory = lookupFactory('foo:bar', container, { source: 'baz:qux' });
assert.ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController');
});
QUnit.test('lookup passes options through to expandlocallookup', function(assert) {
let registry = new Registry();
let container = registry.container();
let PostController = factory();
registry.register('controller:post', PostController);
registry.expandLocalLookup = function(fullName, options) {
assert.ok(true, 'expandLocalLookup was called');
assert.equal(fullName, 'foo:bar');
assert.deepEqual(options, { source: 'baz:qux' });
return 'controller:post';
};
let PostControllerLookupResult = container.lookup('foo:bar', { source: 'baz:qux' });
assert.ok(PostControllerLookupResult instanceof PostController);
});
QUnit.test('#[FACTORY_FOR] class is the injected factory', (assert) => {
let registry = new Registry();
let container = registry.container();
let Component = factory();
registry.register('component:foo-bar', Component);
let factoryCreator = container[FACTORY_FOR]('component:foo-bar');
if (isFeatureEnabled('ember-no-double-extend')) {
assert.deepEqual(factoryCreator.class, Component, 'No double extend');
} else {
assert.deepEqual(factoryCreator.class, lookupFactory('component:foo-bar', container), 'Double extended class');
}
});
if (isFeatureEnabled('ember-factory-for')) {
QUnit.test('#factoryFor must supply a fullname', (assert) => {
let registry = new Registry();
let container = registry.container();
assert.throws(() => {
container.factoryFor('chad-bar');
}, /Invalid Fullname, expected: 'type:name' got: chad-bar/);
});
QUnit.test('#factoryFor returns a factory creator', (assert) => {
let registry = new Registry();
let container = registry.container();
let Component = factory();
registry.register('component:foo-bar', Component);
let factoryCreator = container.factoryFor('component:foo-bar');
assert.ok(factoryCreator.create);
assert.ok(factoryCreator.class);
});
QUnit.test('#factoryFor class returns the factory function', (assert) => {
let registry = new Registry();
let container = registry.container();
let Component = factory();
registry.register('component:foo-bar', Component);
let factoryCreator = container.factoryFor('component:foo-bar');
assert.deepEqual(factoryCreator.class, Component, 'No double extend');
});
QUnit.test('#factoryFor instance have a common parent', (assert) => {
let registry = new Registry();
let container = registry.container();
let Component = factory();
registry.register('component:foo-bar', Component);
let factoryCreator1 = container.factoryFor('component:foo-bar');
let factoryCreator2 = container.factoryFor('component:foo-bar');
let instance1 = factoryCreator1.create({ foo: 'foo' });
let instance2 = factoryCreator2.create({ bar: 'bar' });
assert.deepEqual(instance1.constructor, instance2.constructor);
});
QUnit.test('#factoryFor created instances come with instance injections', (assert) => {
let registry = new Registry();
let container = registry.container();
let Component = factory();
let Ajax = factory();
registry.register('component:foo-bar', Component);
registry.register('util:ajax', Ajax);
registry.injection('component:foo-bar', 'ajax', 'util:ajax');
let componentFactory = container.factoryFor('component:foo-bar');
let component = componentFactory.create();
assert.ok(component.ajax);
assert.ok(component.ajax instanceof Ajax);
});
QUnit.test('#factoryFor options passed to create clobber injections', (assert) => {
let registry = new Registry();
let container = registry.container();
let Component = factory();
let Ajax = factory();
registry.register('component:foo-bar', Component);
registry.register('util:ajax', Ajax);
registry.injection('component:foo-bar', 'ajax', 'util:ajax');
let componentFactory = container.factoryFor('component:foo-bar');
let instrance = componentFactory.create({ ajax: 'fetch' });
assert.equal(instrance.ajax, 'fetch');
});
}
|
/*
* Copyright 2012 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Definitions for node's querystring module.
* @see http://nodejs.org/api/querystring.html
* @see https://github.com/joyent/node/blob/master/lib/querystring.js
* @externs
* @author Daniel Wirtz <dcode@dcode.io>
*/
/**
BEGIN_NODE_INCLUDE
var querystring = require('querystring');
END_NODE_INCLUDE
*/
/**
* @type {Object.<string,*>}
*/
var querystring = {};
/**
* @param {Object.<string,*>} obj
* @param {string=} sep
* @param {string=} eq
* @return {string}
* @nosideeffects
*/
querystring.stringify = function(obj, sep, eq) {};
/**
* @param {string} str
* @param {string=} sep
* @param {string=} eq
* @param {*=} options
* @nosideeffects
*/
querystring.parse = function(str, sep, eq, options) {};
/**
* @param {string} str
* @return {string}
*/
querystring.escape = function(str) {};
/**
* @param {string} str
* @return {string}
*/
querystring.unescape = function(str) {};
/**
* @param {buffer.Buffer} s
* @param {boolean} decodeSpaces
*/
querystring.unescapeBuffer = function(s, decodeSpaces) {};
|
/**
* list.spec.js
* (c) 2013~ Alan Hong
* summernote may be freely distributed under the MIT license./
*/
define([
'chai',
'jquery',
'summernote/base/core/list'
], function (chai, $, list) {
'use strict';
var expect = chai.expect;
describe('base:core.list', function () {
describe('head', function () {
it('should return the first element', function () {
expect(list.head([1, 2, 3])).to.be.equal(1);
});
});
describe('last', function () {
it('should return the last element', function () {
expect(list.last([1, 2, 3])).to.be.equal(3);
});
});
describe('initial', function () {
it('should exclude last element', function () {
expect(list.initial([1, 2, 3])).to.deep.equal([1, 2]);
});
});
describe('tail', function () {
it('should exclude first element', function () {
expect(list.tail([1, 2, 3])).to.deep.equal([2, 3]);
});
});
var isEven = function (num) {
return num % 2 === 0;
};
describe('find', function () {
it('should return first matched element', function () {
expect(list.find([1, 2, 3], isEven)).to.be.equal(2);
});
});
describe('all', function () {
it('should return false if all elements are not even', function () {
expect(list.all([1, 2, 3], isEven)).to.be.false;
});
it('should return true if all elements are even', function () {
expect(list.all([2, 4], isEven)).to.be.true;
});
});
describe('all', function () {
it('should return false if the element is not contained', function () {
expect(list.contains([1, 2, 3], 4)).to.be.false;
});
it('should return true if the element is contained', function () {
expect(list.contains([1, 2, 4], 4)).to.be.true;
});
});
describe('sum', function () {
it('should return sum of all elements', function () {
expect(list.sum([1, 2, 3])).to.be.equal(6);
});
it('should return sum of all elements iterated', function () {
var result = list.sum([1, 2, 3], function (v) { return v * 2; });
expect(result).to.be.equal(12);
});
});
describe('from', function () {
it('should return an array of childNodes', function () {
var $cont, $b, $u, $s, $i;
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
$b = $cont.find('b');
$u = $cont.find('u');
$s = $cont.find('s');
$i = $cont.find('i');
expect(list.from($cont[0].childNodes)).to.deep.equal([$b[0], $u[0], $s[0], $i[0]]);
});
});
describe('clusterBy', function () {
it('should cluster by equality 1', function () {
var aaClustered = list.clusterBy([1, 1, 2, 2, 3], function (itemA, itemB) {
return itemA === itemB;
});
expect(aaClustered).to.deep.equal([[1, 1], [2, 2], [3]]);
});
it('should cluster by equality 2', function () {
var aaClustered = list.clusterBy([1, 2, 2, 1, 3], function (itemA, itemB) {
return itemA === itemB;
});
expect(aaClustered).to.deep.equal([[1], [2, 2], [1], [3]]);
});
});
describe('compact', function () {
it('should remove all elements has falsy value', function () {
expect(list.compact([0, 1, false, 2, '', 3])).to.deep.equal([1, 2, 3]);
});
});
describe('unique', function () {
it('should return duplicate-free version of array', function () {
expect(list.unique([1, 2, 3, 3, 2, 1])).to.deep.equal([1, 2, 3]);
});
});
});
});
|
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.0.5 (2019-05-09)
*/
(function () {
var colorpicker = (function (domGlobals) {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
global.add('colorpicker', function () {
domGlobals.console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration');
});
function Plugin () {
}
return Plugin;
}(window));
})();
|
/** @license React v16.7.0-alpha.0
* react.production.min.js
*
* 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.
*/
'use strict';var k=require("object-assign"),l="function"===typeof Symbol&&Symbol.for,p=l?Symbol.for("react.element"):60103,q=l?Symbol.for("react.portal"):60106,r=l?Symbol.for("react.fragment"):60107,t=l?Symbol.for("react.strict_mode"):60108,u=l?Symbol.for("react.profiler"):60114,v=l?Symbol.for("react.provider"):60109,w=l?Symbol.for("react.context"):60110,x=l?Symbol.for("react.concurrent_mode"):60111,y=l?Symbol.for("react.forward_ref"):60112,z=l?Symbol.for("react.suspense"):60113,A=l?Symbol.for("react.memo"):
60115,aa=l?Symbol.for("react.lazy"):60116,B="function"===typeof Symbol&&Symbol.iterator;function ba(a,b,d,c,e,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var m=[d,c,e,g,h,f],n=0;a=Error(b.replace(/%s/g,function(){return m[n++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
function C(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);ba(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E={};
function F(a,b,d){this.props=a;this.context=b;this.refs=E;this.updater=d||D}F.prototype.isReactComponent={};F.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?C("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};F.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function G(){}G.prototype=F.prototype;function H(a,b,d){this.props=a;this.context=b;this.refs=E;this.updater=d||D}var I=H.prototype=new G;
I.constructor=H;k(I,F.prototype);I.isPureReactComponent=!0;var J={current:null,currentDispatcher:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};
function M(a,b,d){var c=void 0,e={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)K.call(b,c)&&!L.hasOwnProperty(c)&&(e[c]=b[c]);var f=arguments.length-2;if(1===f)e.children=d;else if(1<f){for(var m=Array(f),n=0;n<f;n++)m[n]=arguments[n+2];e.children=m}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===e[c]&&(e[c]=f[c]);return{$$typeof:p,type:a,key:g,ref:h,props:e,_owner:J.current}}
function ca(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function N(a){return"object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var O=/\/+/g,P=[];function Q(a,b,d,c){if(P.length){var e=P.pop();e.result=a;e.keyPrefix=b;e.func=d;e.context=c;e.count=0;return e}return{result:a,keyPrefix:b,func:d,context:c,count:0}}
function R(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>P.length&&P.push(a)}
function S(a,b,d,c){var e=typeof a;if("undefined"===e||"boolean"===e)a=null;var g=!1;if(null===a)g=!0;else switch(e){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return d(c,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){e=a[h];var f=b+T(e,h);g+=S(e,f,d,c)}else if(null===a||"object"!==typeof a?f=null:(f=B&&a[B]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),h=
0;!(e=a.next()).done;)e=e.value,f=b+T(e,h++),g+=S(e,f,d,c);else"object"===e&&(d=""+a,C("31","[object Object]"===d?"object with keys {"+Object.keys(a).join(", ")+"}":d,""));return g}function U(a,b,d){return null==a?0:S(a,"",b,d)}function T(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function da(a,b){a.func.call(a.context,b,a.count++)}
function ea(a,b,d){var c=a.result,e=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?V(a,c,d,function(a){return a}):null!=a&&(N(a)&&(a=ca(a,e+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+d)),c.push(a))}function V(a,b,d,c,e){var g="";null!=d&&(g=(""+d).replace(O,"$&/")+"/");b=Q(b,g,c,e);U(a,ea,b);R(b)}function W(){var a=J.currentDispatcher;null===a?C("298"):void 0;return a}
var X={Children:{map:function(a,b,d){if(null==a)return a;var c=[];V(a,c,null,b,d);return c},forEach:function(a,b,d){if(null==a)return a;b=Q(null,null,b,d);U(a,da,b);R(b)},count:function(a){return U(a,function(){return null},null)},toArray:function(a){var b=[];V(a,b,null,function(a){return a});return b},only:function(a){N(a)?void 0:C("143");return a}},createRef:function(){return{current:null}},Component:F,PureComponent:H,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
_currentValue:a,_currentValue2:a,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:y,render:a}},lazy:function(a){return{$$typeof:aa,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:A,type:a,compare:void 0===b?null:b}},Fragment:r,StrictMode:t,Suspense:z,createElement:M,cloneElement:function(a,b,d){null===a||void 0===a?C("267",a):void 0;var c=void 0,e=k({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==
b.ref&&(h=b.ref,f=J.current);void 0!==b.key&&(g=""+b.key);var m=void 0;a.type&&a.type.defaultProps&&(m=a.type.defaultProps);for(c in b)K.call(b,c)&&!L.hasOwnProperty(c)&&(e[c]=void 0===b[c]&&void 0!==m?m[c]:b[c])}c=arguments.length-2;if(1===c)e.children=d;else if(1<c){m=Array(c);for(var n=0;n<c;n++)m[n]=arguments[n+2];e.children=m}return{$$typeof:p,type:a.type,key:g,ref:h,props:e,_owner:f}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.7.0-alpha.0",
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:J,assign:k}};X.ConcurrentMode=x;X.Profiler=u;X.useCallback=function(a,b){return W().useCallback(a,b)};X.useContext=function(a,b){return W().useContext(a,b)};X.useEffect=function(a,b){return W().useEffect(a,b)};X.useImperativeMethods=function(a,b,d){return W().useImperativeMethods(a,b,d)};X.useLayoutEffect=function(a,b){return W().useLayoutEffect(a,b)};X.useMemo=function(a,b){return W().useMemo(a,b)};
X.useMutationEffect=function(a,b){return W().useMutationEffect(a,b)};X.useReducer=function(a,b,d){return W().useReducer(a,b,d)};X.useRef=function(a){return W().useRef(a)};X.useState=function(a){return W().useState(a)};var Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z;
|
import {
FileLoader,
Loader,
ShapePath
} from 'three';
class FontLoader extends Loader {
constructor( manager ) {
super( manager );
}
load( url, onLoad, onProgress, onError ) {
const scope = this;
const loader = new FileLoader( this.manager );
loader.setPath( this.path );
loader.setRequestHeader( this.requestHeader );
loader.setWithCredentials( scope.withCredentials );
loader.load( url, function ( text ) {
let json;
try {
json = JSON.parse( text );
} catch ( e ) {
console.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' );
json = JSON.parse( text.substring( 65, text.length - 2 ) );
}
const font = scope.parse( json );
if ( onLoad ) onLoad( font );
}, onProgress, onError );
}
parse( json ) {
return new Font( json );
}
}
//
class Font {
constructor( data ) {
this.type = 'Font';
this.data = data;
}
generateShapes( text, size = 100 ) {
const shapes = [];
const paths = createPaths( text, size, this.data );
for ( let p = 0, pl = paths.length; p < pl; p ++ ) {
Array.prototype.push.apply( shapes, paths[ p ].toShapes() );
}
return shapes;
}
}
function createPaths( text, size, data ) {
const chars = Array.from( text );
const scale = size / data.resolution;
const line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale;
const paths = [];
let offsetX = 0, offsetY = 0;
for ( let i = 0; i < chars.length; i ++ ) {
const char = chars[ i ];
if ( char === '\n' ) {
offsetX = 0;
offsetY -= line_height;
} else {
const ret = createPath( char, scale, offsetX, offsetY, data );
offsetX += ret.offsetX;
paths.push( ret.path );
}
}
return paths;
}
function createPath( char, scale, offsetX, offsetY, data ) {
const glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
if ( ! glyph ) {
console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' );
return;
}
const path = new ShapePath();
let x, y, cpx, cpy, cpx1, cpy1, cpx2, cpy2;
if ( glyph.o ) {
const outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) );
for ( let i = 0, l = outline.length; i < l; ) {
const action = outline[ i ++ ];
switch ( action ) {
case 'm': // moveTo
x = outline[ i ++ ] * scale + offsetX;
y = outline[ i ++ ] * scale + offsetY;
path.moveTo( x, y );
break;
case 'l': // lineTo
x = outline[ i ++ ] * scale + offsetX;
y = outline[ i ++ ] * scale + offsetY;
path.lineTo( x, y );
break;
case 'q': // quadraticCurveTo
cpx = outline[ i ++ ] * scale + offsetX;
cpy = outline[ i ++ ] * scale + offsetY;
cpx1 = outline[ i ++ ] * scale + offsetX;
cpy1 = outline[ i ++ ] * scale + offsetY;
path.quadraticCurveTo( cpx1, cpy1, cpx, cpy );
break;
case 'b': // bezierCurveTo
cpx = outline[ i ++ ] * scale + offsetX;
cpy = outline[ i ++ ] * scale + offsetY;
cpx1 = outline[ i ++ ] * scale + offsetX;
cpy1 = outline[ i ++ ] * scale + offsetY;
cpx2 = outline[ i ++ ] * scale + offsetX;
cpy2 = outline[ i ++ ] * scale + offsetY;
path.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy );
break;
}
}
}
return { offsetX: glyph.ha * scale, path: path };
}
Font.prototype.isFont = true;
export { FontLoader, Font };
|
export function foo () {
return 'FUBAR';
}
|
// Copyright 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
function ArrayReduction(array, path, reduceFn, initial) {
this.array = array;
this.path = path ? path.trim() : undefined;
this.reduceFn = reduceFn;
this.initial = initial;
this.arrayObserver = new ArrayObserver(array, this.handleSplices, this);
this.observers = this.path ? [] : undefined;
this.handleSplices([{
index: 0,
removed: [],
addedCount: array.length
}]);
}
ArrayReduction.prototype = {
updateObservers: function(splices) {
for (var i = 0; i < splices.length; i++) {
var splice = splices[i];
var added = [];
for (var j = 0; j < splice.addedCount; j++) {
added.push(new PathObserver(this.array[splice.index + j], this.path,
this.reduce, this));
}
var spliceArgs = [splice.index, splice.removed.length].concat(added);
var removed = Array.prototype.splice.apply(this.observers, spliceArgs);
for (var j = 0; j < removed.length; j++) {
removed[j].close();
}
}
},
handleSplices: function(splices) {
if (this.observers)
this.updateObservers(splices);
this.reduce();
},
reduce: function() {
this.value = this.array.reduce(this.reduceFn, this.initial);
},
close: function() {
this.observers.forEach(function(observer) {
observer.close();
});
this.arrayObserver.close();
},
deliver: function() {
this.arrayObserver.deliver();
this.observers.forEach(function(observer) {
observer.deliver();
});
}
}
ArrayReduction.defineProperty = function(object, name, descriptor) {
var observer = new ArrayReduction(descriptor.array, descriptor.path,
descriptor.reduce,
descriptor.initial);
Object.defineProperty(object, name, {
get: function() {
observer.deliver();
return observer.value;
}
});
if (Observer.hasObjectObserve)
return observer;
var value = observer.value;
Object.defineProperty(observer, 'value', {
get: function() {
return value;
},
set: function(newValue) {
if (Observer.hasObjectObserve) {
Object.getNotifier(object).notify({
object: object,
type: 'updated',
name: name,
oldValue: value
});
}
value = newValue;
}
})
return observer;
}
|
'use strict';
function ClientError(code, message) {
this.code = code;
this.message = message;
};
ClientError.prototype.toString = function() {
return '<ClientError:' + this.code + ' ' + this.message + '>';
};
module.exports = ClientError;
|
/**
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
* Build: `lodash modularize exports="amd" -o ./compat/`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
define(['../objects/defaults', './escape', '../internals/escapeStringChar', '../objects/keys', '../internals/reInterpolate', './templateSettings', '../objects/values'], function(defaults, escape, escapeStringChar, keys, reInterpolate, templateSettings, values) {
/** Used as a safe reference for `undefined` in pre ES5 environments */
var undefined;
/** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/**
* Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals
*/
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to ensure capturing order of template delimiters */
var reNoMatch = /($^)/;
/** Used to match unescaped characters in compiled string literals */
var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
/**
* A micro-templating method that handles arbitrary delimiters, preserves
* whitespace, and correctly escapes quotes within interpolated code.
*
* Note: In the development build, `_.template` utilizes sourceURLs for easier
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
*
* For more information on precompiling templates see:
* http://lodash.com/custom-builds
*
* For more information on Chrome extension sandboxes see:
* http://developer.chrome.com/stable/extensions/sandboxingEval.html
*
* @static
* @memberOf _
* @category Utilities
* @param {string} text The template text.
* @param {Object} data The data object used to populate the text.
* @param {Object} [options] The options object.
* @param {RegExp} [options.escape] The "escape" delimiter.
* @param {RegExp} [options.evaluate] The "evaluate" delimiter.
* @param {Object} [options.imports] An object to import into the template as local variables.
* @param {RegExp} [options.interpolate] The "interpolate" delimiter.
* @param {string} [sourceURL] The sourceURL of the template's compiled source.
* @param {string} [variable] The data object variable name.
* @returns {Function|string} Returns a compiled function when no `data` object
* is given, else it returns the interpolated text.
* @example
*
* // using the "interpolate" delimiter to create a compiled template
* var compiled = _.template('hello <%= name %>');
* compiled({ 'name': 'fred' });
* // => 'hello fred'
*
* // using the "escape" delimiter to escape HTML in data property values
* _.template('<b><%- value %></b>', { 'value': '<script>' });
* // => '<b><script></b>'
*
* // using the "evaluate" delimiter to generate HTML
* var list = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>';
* _.template(list, { 'people': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
* _.template('hello ${ name }', { 'name': 'pebbles' });
* // => 'hello pebbles'
*
* // using the internal `print` function in "evaluate" delimiters
* _.template('<% print("hello " + name); %>!', { 'name': 'barney' });
* // => 'hello barney!'
*
* // using a custom template delimiters
* _.templateSettings = {
* 'interpolate': /{{([\s\S]+?)}}/g
* };
*
* _.template('hello {{ name }}!', { 'name': 'mustache' });
* // => 'hello mustache!'
*
* // using the `imports` option to import jQuery
* var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
* // => '<li>fred</li><li>barney</li>'
*
* // using the `sourceURL` option to specify a custom sourceURL for the template
* var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
* // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
*
* // using the `variable` option to ensure a with-statement isn't used in the compiled template
* var compiled = _.template('hi <%= data.name %>!', null, { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* var __t, __p = '', __e = _.escape;
* __p += 'hi ' + ((__t = ( data.name )) == null ? '' : __t) + '!';
* return __p;
* }
*
* // using the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and a stack trace
* fs.writeFileSync(path.join(cwd, 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(text, data, options) {
// based on John Resig's `tmpl` implementation
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT
var settings = templateSettings.imports._.templateSettings || templateSettings;
text = String(text || '');
// avoid missing dependencies when `iteratorTemplate` is not defined
options = defaults({}, options, settings);
var imports = defaults({}, options.imports, settings.imports),
importsKeys = keys(imports),
importsValues = values(imports);
var isEvaluating,
index = 0,
interpolate = options.interpolate || reNoMatch,
source = "__p += '";
// compile the regexp to match each delimiter
var reDelimiters = RegExp(
(options.escape || reNoMatch).source + '|' +
interpolate.source + '|' +
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
(options.evaluate || reNoMatch).source + '|$'
, 'g');
text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
interpolateValue || (interpolateValue = esTemplateValue);
// escape characters that cannot be included in string literals
source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);
// replace delimiters with snippets
if (escapeValue) {
source += "' +\n__e(" + escapeValue + ") +\n'";
}
if (evaluateValue) {
isEvaluating = true;
source += "';\n" + evaluateValue + ";\n__p += '";
}
if (interpolateValue) {
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
}
index = offset + match.length;
// the JS engine embedded in Adobe products requires returning the `match`
// string in order to produce the correct `offset` value
return match;
});
source += "';\n";
// if `variable` is not specified, wrap a with-statement around the generated
// code to add the data object to the top of the scope chain
var variable = options.variable,
hasVariable = variable;
if (!hasVariable) {
variable = 'obj';
source = 'with (' + variable + ') {\n' + source + '\n}\n';
}
// cleanup code by stripping empty strings
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
.replace(reEmptyStringTrailing, '$1;');
// frame code as the function body
source = 'function(' + variable + ') {\n' +
(hasVariable ? '' : variable + ' || (' + variable + ' = {});\n') +
"var __t, __p = '', __e = _.escape" +
(isEvaluating
? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n"
: ';\n'
) +
source +
'return __p\n}';
try {
var result = Function(importsKeys, 'return ' + source ).apply(undefined, importsValues);
} catch(e) {
e.source = source;
throw e;
}
if (data) {
return result(data);
}
// provide the compiled function's source by its `toString` method, in
// supported environments, or the `source` property as a convenience for
// inlining compiled templates during the build process
result.source = source;
return result;
}
return template;
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.8.2.7_A6;
* @section: 15.8.2.7;
* @assertion: Cosine is a periodic function with period 2*PI;
* @description: Checking if Math.cos(x) equals to Math.cos(x+n*2*Math.PI) with precision 0.000000000003, where n is an integer from 1 to 100 and x is one of 10 float point values from -Math.PI to +Math.PI;
*/
// CHECK#1
prec = 0.000000000003;
//prec = 0.000000000000001;
period = 2*Math.PI;
pernum = 100;
a = -pernum * period;
b = pernum * period;
snum = 9;
step = period/snum + 0.0;
x = new Array();
for (i = 0; i < snum; i++)
{
x[i] = a + i*step;
}
x[9] = a + period;
var curval;
var curx;
var j;
for (i = 0; i < snum; i++)
{
curval = Math.cos(x[i]);
curx = x[i] + period;
j = 0;
while (curx <= b)
{
curx += period;
j++;
if (Math.abs(Math.cos(curx) - curval) >= prec)
{
$FAIL("#1: cos is found out to not be periodic:\n Math.abs(Math.cos(" + x[i] + ") - Math.cos(" + x[i] + " + 2*Math.PI*" + j + ")) >= " + prec + "\n Math.cos(" + x[i] + ") === " + curval + "\n Math.cos(" + curx + ") === " + Math.cos(curx));
}
}
}
|
import React, {Component, PropTypes} from 'react';
import warning from 'warning';
function getStyles(props, context) {
const {
baseTheme,
table,
} = context.muiTheme;
return {
root: {
backgroundColor: table.backgroundColor,
width: '100%',
borderCollapse: 'collapse',
borderSpacing: 0,
tableLayout: 'fixed',
fontFamily: baseTheme.fontFamily,
},
bodyTable: {
height: (props.fixedHeader || props.fixedFooter) ? props.height : 'auto',
overflowX: 'hidden',
overflowY: 'auto',
},
tableWrapper: {
height: (props.fixedHeader || props.fixedFooter) ? 'auto' : props.height,
overflow: 'auto',
},
};
}
class Table extends Component {
static propTypes = {
/**
* Set to true to indicate that all rows should be selected.
*/
allRowsSelected: PropTypes.bool,
/**
* Override the inline-styles of the body's table element.
*/
bodyStyle: PropTypes.object,
/**
* Children passed to table.
*/
children: PropTypes.node,
/**
* The css class name of the root element.
*/
className: PropTypes.string,
/**
* If true, the footer will appear fixed below the table.
* The default value is true.
*/
fixedFooter: PropTypes.bool,
/**
* If true, the header will appear fixed above the table.
* The default value is true.
*/
fixedHeader: PropTypes.bool,
/**
* Override the inline-styles of the footer's table element.
*/
footerStyle: PropTypes.object,
/**
* Override the inline-styles of the header's table element.
*/
headerStyle: PropTypes.object,
/**
* The height of the table.
*/
height: PropTypes.string,
/**
* If true, multiple table rows can be selected.
* CTRL/CMD+Click and SHIFT+Click are valid actions.
* The default value is false.
*/
multiSelectable: PropTypes.bool,
/**
* Called when a row cell is clicked.
* rowNumber is the row number and columnId is
* the column number or the column key.
*/
onCellClick: PropTypes.func,
/**
* Called when a table cell is hovered.
* rowNumber is the row number of the hovered row
* and columnId is the column number or the column key of the cell.
*/
onCellHover: PropTypes.func,
/**
* Called when a table cell is no longer hovered.
* rowNumber is the row number of the row and columnId
* is the column number or the column key of the cell.
*/
onCellHoverExit: PropTypes.func,
/**
* Called when a table row is hovered.
* rowNumber is the row number of the hovered row.
*/
onRowHover: PropTypes.func,
/**
* Called when a table row is no longer hovered.
* rowNumber is the row number of the row that is no longer hovered.
*/
onRowHoverExit: PropTypes.func,
/**
* Called when a row is selected.
* selectedRows is an array of all row selections.
* IF all rows have been selected, the string "all"
* will be returned instead to indicate that all rows have been selected.
*/
onRowSelection: PropTypes.func,
/**
* If true, table rows can be selected.
* If multiple row selection is desired, enable multiSelectable.
* The default value is true.
*/
selectable: PropTypes.bool,
/**
* Override the inline-styles of the root element.
*/
style: PropTypes.object,
/**
* Override the inline-styles of the table's wrapper element.
*/
wrapperStyle: PropTypes.object,
};
static defaultProps = {
allRowsSelected: false,
fixedFooter: true,
fixedHeader: true,
height: 'inherit',
multiSelectable: false,
selectable: true,
};
static contextTypes = {
muiTheme: PropTypes.object.isRequired,
};
state = {
allRowsSelected: false,
};
componentWillMount() {
if (this.props.allRowsSelected) {
this.setState({allRowsSelected: true});
}
}
isScrollbarVisible() {
const tableDivHeight = this.refs.tableDiv.clientHeight;
const tableBodyHeight = this.refs.tableBody.clientHeight;
return tableBodyHeight > tableDivHeight;
}
createTableHeader(base) {
return React.cloneElement(
base,
{
enableSelectAll: base.props.enableSelectAll && this.props.selectable && this.props.multiSelectable,
onSelectAll: this.onSelectAll,
selectAllSelected: this.state.allRowsSelected,
}
);
}
createTableBody(base) {
return React.cloneElement(
base,
{
allRowsSelected: this.state.allRowsSelected,
multiSelectable: this.props.multiSelectable,
onCellClick: this.onCellClick,
onCellHover: this.onCellHover,
onCellHoverExit: this.onCellHoverExit,
onRowHover: this.onRowHover,
onRowHoverExit: this.onRowHoverExit,
onRowSelection: this.onRowSelection,
selectable: this.props.selectable,
style: Object.assign({height: this.props.height}, base.props.style),
}
);
}
createTableFooter(base) {
return base;
}
onCellClick = (rowNumber, columnNumber, event) => {
if (this.props.onCellClick) this.props.onCellClick(rowNumber, columnNumber, event);
};
onCellHover = (rowNumber, columnNumber, event) => {
if (this.props.onCellHover) this.props.onCellHover(rowNumber, columnNumber, event);
};
onCellHoverExit = (rowNumber, columnNumber, event) => {
if (this.props.onCellHoverExit) this.props.onCellHoverExit(rowNumber, columnNumber, event);
};
onRowHover = (rowNumber) => {
if (this.props.onRowHover) this.props.onRowHover(rowNumber);
};
onRowHoverExit = (rowNumber) => {
if (this.props.onRowHoverExit) this.props.onRowHoverExit(rowNumber);
};
onRowSelection = (selectedRows) => {
if (this.state.allRowsSelected) this.setState({allRowsSelected: false});
if (this.props.onRowSelection) this.props.onRowSelection(selectedRows);
};
onSelectAll = () => {
if (this.props.onRowSelection) {
if (!this.state.allRowsSelected) {
this.props.onRowSelection('all');
} else {
this.props.onRowSelection('none');
}
}
this.setState({allRowsSelected: !this.state.allRowsSelected});
};
render() {
const {
children,
className,
fixedFooter,
fixedHeader,
style,
wrapperStyle,
headerStyle,
bodyStyle,
footerStyle,
} = this.props;
const {prepareStyles} = this.context.muiTheme;
const styles = getStyles(this.props, this.context);
let tHead;
let tFoot;
let tBody;
React.Children.forEach(children, (child) => {
if (!React.isValidElement(child)) return;
const {muiName} = child.type;
if (muiName === 'TableBody') {
tBody = this.createTableBody(child);
} else if (muiName === 'TableHeader') {
tHead = this.createTableHeader(child);
} else if (muiName === 'TableFooter') {
tFoot = this.createTableFooter(child);
} else {
warning(false,
`Material-UI: Children of the Table component must be TableBody or TableHeader or TableFooter.
Nothing is rendered.`);
}
});
// If we could not find a table-header and a table-body, do not attempt to display anything.
if (!tBody && !tHead) return null;
const mergedTableStyle = Object.assign(styles.root, style);
let headerTable;
let footerTable;
let inlineHeader;
let inlineFooter;
if (fixedHeader) {
headerTable = (
<div style={prepareStyles(Object.assign({}, headerStyle))}>
<table className={className} style={mergedTableStyle}>
{tHead}
</table>
</div>
);
} else {
inlineHeader = tHead;
}
if (tFoot !== undefined) {
if (fixedFooter) {
footerTable = (
<div style={prepareStyles(Object.assign({}, footerStyle))}>
<table className={className} style={prepareStyles(mergedTableStyle)}>
{tFoot}
</table>
</div>
);
} else {
inlineFooter = tFoot;
}
}
return (
<div style={prepareStyles(Object.assign(styles.tableWrapper, wrapperStyle))}>
{headerTable}
<div style={prepareStyles(Object.assign(styles.bodyTable, bodyStyle))} ref="tableDiv">
<table className={className} style={mergedTableStyle} ref="tableBody">
{inlineHeader}
{inlineFooter}
{tBody}
</table>
</div>
{footerTable}
</div>
);
}
}
export default Table;
|
import test from 'ava';
import padStart from './padStart';
test('String.prototype.padStart', t => {
const str = 'abc';
t.true(padStart.call(str, 10) === ' abc');
t.true(padStart.call(str, 10, 'foo') === 'foofoofabc');
t.true(padStart.call(str, 6, '123465') === '123abc');
t.true(padStart.call(str, 8, '0') === '00000abc');
t.true(padStart.call(str, 1) === 'abc');
});
|
const { loadRules } = require('../../lib/load-rules')
const rulesConstants = loadRules()
const enabledRules = {}
rulesConstants.forEach(rule => {
if (!rule.meta.deprecated && rule.meta.recommended) {
enabledRules[rule.ruleId] = rule.meta.defaultSetup
}
})
module.exports = { rules: enabledRules }
|
/*************************************************************
*
* MathJax/jax/output/SVG/fonts/Latin-Modern/Latin/Regular/Main.js
*
* Copyright (c) 2013-2016 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.OutputJax['SVG'].FONTDATA.FONTS['LatinModernMathJax_Latin'] = {
directory: 'Latin/Regular',
family: 'LatinModernMathJax_Latin',
id: 'LATINMODERNLATIN',
0x20: [0,0,332,0,0,''],
0xA0: [0,0,332,0,0,''],
0xA1: [500,216,278,86,192,'192 447c0 -29 -24 -53 -53 -53s-53 24 -53 53s24 53 53 53s53 -24 53 -53zM192 -165c0 -33 -27 -51 -53 -51s-53 18 -53 51l39 456c1 17 4 22 14 22c12 0 13 -8 14 -23l38 -444'],
0xA2: [476,45,444,34,415,'415 119c0 -10 -30 -124 -156 -130v-19c0 -8 -6 -15 -15 -15c-8 0 -15 7 -15 15v20c-107 10 -195 105 -195 226c0 117 82 219 195 231v14c0 8 7 15 15 15c9 0 15 -7 15 -15v-13c74 -3 145 -41 145 -107c0 -30 -20 -47 -46 -47c-28 0 -46 20 -46 46c0 13 6 43 47 46 c-30 31 -80 36 -100 37v-409c38 0 101 13 130 105c2 6 4 10 13 10c3 0 13 0 13 -10zM229 18v403c-50 -11 -112 -62 -112 -203c0 -134 61 -187 112 -200'],
0xA4: [492,-8,778,147,630,'624 15c-14 -14 -27 -1 -37 9l-75 74c-33 -27 -76 -44 -123 -44s-90 17 -124 44l-74 -74c-10 -10 -23 -23 -38 -9c-14 14 0 27 10 37l74 75c-27 33 -44 76 -44 123s17 90 44 124l-74 74c-10 10 -24 24 -10 38c15 14 28 1 38 -9l75 -75c33 27 76 44 123 44s89 -17 123 -44 l74 74c10 10 23 23 38 9c14 -14 0 -27 -10 -37l-74 -74c28 -34 44 -77 44 -124s-16 -90 -43 -123l74 -75c10 -10 23 -23 9 -37zM544 250c0 86 -69 156 -155 156s-156 -70 -156 -156s70 -156 156 -156s155 70 155 156'],
0xA6: [750,250,278,119,159,'159 343c0 -9 -10 -15 -20 -15s-20 6 -20 15v374c0 14 0 33 20 33s20 -19 20 -33v-374zM159 -217c0 -14 0 -33 -20 -33s-20 19 -20 33v374c0 9 10 15 20 15s20 -6 20 -15v-374'],
0xA9: [683,0,683,0,683,'683 342c0 -189 -153 -342 -341 -342c-189 0 -342 153 -342 342c0 188 153 341 342 341c188 0 341 -153 341 -341zM643 342c0 166 -135 301 -301 301c-167 0 -302 -135 -302 -301c0 -167 135 -302 302 -302c166 0 301 135 301 302zM489 282c0 -64 -54 -141 -143 -141 c-103 0 -192 87 -192 201c0 112 89 200 192 200c52 0 81 -28 101 -47l28 40c4 7 8 7 8 7c6 0 6 -4 6 -13v-131c0 -11 0 -13 -8 -13s-8 2 -9 9c-11 81 -60 131 -120 131c-34 0 -141 -19 -141 -184c0 -164 108 -182 141 -182c60 0 119 45 124 123c0 6 0 9 6 9c7 0 7 -4 7 -9'],
0xAA: [705,-333,449,35,414,'414 454c0 -57 -51 -66 -69 -66c-39 0 -62 29 -65 57c-16 -33 -55 -61 -110 -61c-53 0 -135 18 -135 74c0 31 21 67 84 91c53 21 112 23 155 25v26c0 63 -48 90 -89 90c-27 0 -68 -8 -91 -32c39 -1 43 -24 43 -32c0 -19 -15 -33 -39 -33c-22 0 -38 12 -38 33 c0 46 58 79 126 79c41 0 83 -11 116 -38c30 -26 30 -53 30 -83v-140c0 -3 3 -35 31 -35c9 0 30 4 30 45v39h21v-39zM399 344c0 -6 -7 -11 -15 -11h-319c-8 0 -15 5 -15 11c0 5 7 10 15 10h319c8 0 15 -5 15 -10zM274 490v70c-139 -4 -174 -63 -174 -101c0 -35 34 -60 76 -60 c37 0 98 24 98 91'],
0xAB: [483,0,556,111,444,'277 10c0 -6 -4 -10 -10 -10h-2c-4 0 -8 3 -9 7c-30 85 -78 163 -142 228c-2 1 -3 4 -3 7c0 0 1 5 3 7c64 64 112 142 142 228c1 4 5 6 9 6h2c6 0 10 -4 10 -10v-2c-19 -81 -51 -158 -94 -229c43 -71 75 -149 94 -230v-2zM444 10c0 -6 -4 -10 -10 -10h-2c-4 0 -8 3 -9 7 c-30 85 -78 163 -142 228c-2 1 -3 4 -3 7c0 0 1 5 3 7c64 64 112 142 142 228c1 4 5 6 9 6h2c6 0 10 -4 10 -10v-2c-19 -81 -51 -158 -94 -229c43 -71 75 -149 94 -230v-2'],
0xB6: [694,194,611,56,582,'582 674c0 -20 -19 -20 -33 -20h-50v-815c0 -14 0 -33 -20 -33s-20 19 -20 33v815h-70v-815c0 -14 0 -33 -20 -33s-20 19 -20 33v391c-128 5 -293 76 -293 233c0 126 110 231 250 231h243c14 0 33 0 33 -20'],
0xB8: [5,200,444,89,356,'356 -133c0 -67 -133 -67 -241 -67h-26v26h13c75 0 170 0 170 41c0 32 -39 41 -76 41v97h52v-71c54 0 108 -20 108 -67'],
0xBA: [705,-333,419,24,396,'396 542c0 -89 -85 -158 -187 -158c-98 0 -185 67 -185 158c0 87 81 163 186 163c102 0 186 -74 186 -163zM381 344c0 -6 -7 -11 -15 -11h-312c-9 0 -15 5 -15 11c0 5 6 10 15 10h312c8 0 15 -5 15 -10zM326 547c0 27 0 67 -22 97c-22 31 -58 46 -95 46 c-33 0 -73 -15 -96 -47c-20 -31 -20 -69 -20 -96c0 -25 0 -68 21 -99c23 -32 60 -46 96 -46c42 0 79 20 97 51c19 31 19 69 19 94'],
0xBB: [483,0,556,112,445,'445 242c0 -3 -3 -7 -3 -7c-64 -65 -112 -143 -142 -228c-1 -4 -5 -7 -9 -7h-2c-6 0 -10 4 -10 10v2c18 81 50 159 94 230c-44 71 -76 148 -94 229v2c0 6 4 10 10 10h2c4 0 8 -2 9 -6c30 -86 78 -164 142 -228c1 -2 3 -7 3 -7zM278 242c0 -3 -3 -7 -3 -7 c-64 -65 -112 -143 -142 -228c-1 -4 -5 -7 -9 -7h-2c-6 0 -10 4 -10 10v2c18 81 50 159 94 230c-44 71 -76 148 -94 229v2c0 6 4 10 10 10h2c4 0 8 -2 9 -6c30 -86 78 -164 142 -228c1 -2 3 -7 3 -7'],
0xBF: [500,205,472,56,415,'415 -72c0 -80 -87 -133 -193 -133c-134 0 -166 78 -166 135c0 62 33 90 51 106c103 88 103 196 103 237v16c0 18 0 24 12 24c3 0 12 0 13 -12v-24c0 -76 -7 -168 -70 -257c-15 -21 -26 -36 -26 -97c0 -49 0 -106 86 -106c49 0 123 17 153 68c-36 -4 -55 21 -55 45 c0 26 18 46 46 46c23 0 46 -14 46 -48zM275 447c0 -29 -24 -53 -53 -53s-53 24 -53 53s24 53 53 53s53 -24 53 -53'],
0xC0: [909,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM444 767l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0xC1: [909,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM512 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0xC2: [869,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM526 752l-12 -16l-140 66l-140 -66l-10 16l151 117'],
0xC3: [829,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM542 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xC4: [831,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM319 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM529 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xC5: [892,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM438 804c0 41 -25 58 -63 58c-39 0 -63 -18 -63 -58c0 -41 25 -58 63 -58c39 0 63 18 63 58zM471 805c0 -49 -41 -89 -97 -89c-51 0 -95 38 -95 89c0 44 39 87 97 87c54 0 95 -41 95 -87'],
0xC6: [683,0,903,32,874,'874 258l-42 -258h-493v31c66 0 77 0 77 45v237h-161l-75 -210c-5 -13 -5 -14 -5 -22c0 -25 24 -49 74 -50v-31l-115 3c-40 0 -80 -2 -102 -3v31c70 0 99 28 113 67l198 553c-13 0 -27 1 -40 1h-45v31h560l28 -225h-25c-16 136 -36 194 -178 194h-95 c-47 0 -49 -7 -49 -40v-268h85c94 0 103 33 103 117h25v-265h-25c0 84 -9 117 -103 117h-85v-242c0 -33 2 -40 49 -40h95c168 0 181 79 206 227h25zM416 344v260c0 16 0 43 -41 44l-109 -304h150'],
0xC7: [705,200,722,56,665,'665 233c0 -111 -90 -244 -242 -254v-45c54 0 108 -20 108 -67c0 -67 -133 -67 -241 -67h-26v26h13c75 0 170 0 170 41c0 32 -39 41 -76 41v72c-172 17 -315 167 -315 362c0 204 161 363 348 363c96 0 147 -50 184 -86l50 74c8 12 12 12 16 12c11 0 11 -7 11 -24v-237 c0 -21 0 -24 -16 -24c-14 0 -14 3 -16 17c-20 146 -109 237 -218 237c-61 0 -256 -34 -256 -333c0 -298 196 -332 257 -332c109 0 216 82 224 225c1 10 1 16 12 16c13 0 13 -7 13 -17'],
0xC8: [909,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM409 767l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0xC9: [909,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM477 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0xCA: [869,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 752l-12 -16l-140 66l-140 -66l-10 16l151 117'],
0xCB: [831,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM284 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM494 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xCC: [909,0,361,28,333,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM250 767l-14 -21l-170 94c-11 5 -20 15 -22 27 c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0xCD: [909,0,361,28,333,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM318 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21 l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0xCE: [869,0,361,28,333,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM332 752l-12 -16l-140 66l-140 -66l-10 16l151 117'],
0xCF: [831,0,361,28,335,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM125 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48 c0 22 18 47 49 47c27 0 48 -23 48 -47zM335 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xD0: [683,0,764,35,707,'707 336c0 -188 -138 -336 -306 -336h-366v31h24c77 0 79 11 79 47v249h-103v30h103v248c0 36 -2 47 -79 47h-24v31h366c171 0 306 -157 306 -347zM607 336c0 78 -9 164 -52 223c-51 71 -120 93 -182 93h-100c-47 0 -49 -7 -49 -40v-255h158v-30h-158v-256 c0 -33 2 -40 49 -40h101c101 0 158 58 178 85c36 49 55 109 55 220'],
0xD1: [829,0,750,33,716,'716 652c-103 0 -103 -47 -103 -74v-552c0 -19 0 -26 -14 -26c-7 0 -8 1 -17 13l-408 600c-4 6 -5 7 -10 12v-520c0 -27 0 -74 103 -74v-31l-117 3l-117 -3v31c103 0 103 47 103 74v522c0 19 -1 20 -24 23c-15 1 -35 2 -50 2h-29v31h170c19 0 20 -1 29 -13l353 -519v427 c0 27 0 74 -103 74v31l117 -3l117 3v-31zM542 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xD2: [909,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM458 767l-14 -21l-170 94 c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0xD3: [909,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM526 867c-2 -12 -11 -22 -22 -27l-170 -94 l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0xD4: [869,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM540 752l-12 -16l-140 66l-140 -66l-10 16 l151 117'],
0xD5: [829,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM556 814c-51 -56 -70 -78 -108 -78 c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xD6: [831,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM333 784c0 -23 -18 -48 -49 -48 c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM543 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xD8: [739,56,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-88 0 -147 33 -188 62l-68 -96l-20 14l8 11l60 89c-44 37 -124 132 -124 281c0 206 153 366 332 366c94 0 157 -43 181 -58c5 -5 7 -5 7 -5l68 97l21 -14l-69 -101c75 -70 125 -161 125 -285zM554 607c-19 20 -74 76 -166 76 c-70 0 -144 -36 -191 -111c-49 -78 -52 -177 -52 -233c0 -128 26 -193 61 -242zM632 339c0 64 -5 171 -62 247l-347 -510c43 -49 104 -76 166 -76c72 0 141 38 185 100c56 81 58 188 58 239'],
0xD9: [909,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM467 767l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0xDA: [909,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM535 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0xDB: [869,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM549 752l-12 -16l-140 66l-140 -66l-10 16l151 117'],
0xDC: [831,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM342 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM552 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xDD: [909,0,750,11,738,'738 652c-32 0 -91 -4 -128 -65l-193 -314v-193c0 -39 3 -49 80 -49h23v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v195l-210 342c-16 26 -24 37 -92 37h-18v31l130 -3c39 0 112 0 148 3v-31c-45 0 -70 -4 -70 -25c0 -5 0 -7 7 -17l181 -295 l165 268c4 6 10 19 10 30c0 20 -16 39 -57 39v31l115 -3c27 0 67 1 98 3v-31zM512 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0xDE: [683,0,625,36,569,'569 365c0 -97 -86 -187 -208 -187h-139v-98c0 -24 0 -41 28 -46c21 -3 46 -3 75 -3v-31l-145 3l-144 -3v31c26 0 52 0 71 3c31 4 32 17 32 46v523c0 24 0 41 -28 46c-21 3 -46 3 -75 3v31l145 -3l144 3v-31c-26 0 -52 0 -71 -3c-31 -4 -32 -17 -32 -46v-50h129 c148 0 218 -103 218 -188zM469 366c0 20 -4 68 -36 110c-36 46 -77 46 -100 46h-111v-313h106c97 0 141 87 141 157'],
0xDF: [705,11,500,28,471,'471 174c0 -112 -89 -185 -175 -185c-58 0 -95 36 -95 76c0 25 19 37 36 37c20 0 36 -14 36 -36c0 -24 -19 -34 -30 -36c18 -17 41 -19 50 -19c38 0 103 33 103 162c0 104 -40 226 -159 236c-9 1 -9 11 -9 11c0 10 7 10 16 11c89 8 124 69 124 133c0 88 -55 119 -96 119 c-20 0 -100 -11 -100 -125v-558c-18 3 -35 3 -46 3l-98 -3v31c67 0 78 0 78 45v324h-78v31h78v125c0 100 89 149 166 149c99 0 171 -67 171 -142c0 -58 -44 -119 -133 -144c129 -53 161 -173 161 -245'],
0xE0: [698,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM312 528l-17 -18l-152 122c-9 7 -17 18 -17 30c0 18 18 36 36 36 c15 0 26 -11 30 -17'],
0xE1: [698,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM374 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153 c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0xE2: [692,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM402 530l-13 -14l-139 108l-139 -108l-13 14l152 162'],
0xE3: [651,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM417 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23 c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xE4: [652,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM210 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48 c0 22 18 47 49 47c27 0 48 -23 48 -47zM388 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xE5: [705,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM313 617c0 41 -25 58 -63 58c-39 0 -63 -18 -63 -58 c0 -41 25 -58 63 -58c39 0 63 18 63 58zM346 618c0 -49 -41 -89 -97 -89c-51 0 -95 38 -95 89c0 44 39 87 97 87c54 0 95 -41 95 -87'],
0xE6: [448,11,722,45,693,'693 119c0 -19 -42 -130 -155 -130c-30 0 -108 8 -167 89c-24 -49 -86 -89 -167 -89c-67 0 -159 24 -159 103c0 96 119 158 281 158v48c0 87 -55 128 -106 128c-36 0 -83 -14 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 67 71 113 151 113c64 0 124 -29 153 -77c51 61 107 77 151 77c109 0 167 -85 167 -196c0 -21 -3 -21 -25 -21h-273c0 -217 137 -217 147 -217c62 0 108 47 123 97c5 16 6 20 15 20c5 0 13 -2 13 -12zM627 252c-2 39 -7 174 -102 174c-36 0 -119 -28 -129 -174h231z M338 132c0 3 0 11 -3 22c-9 31 -9 51 -9 75c-162 -6 -204 -83 -204 -137c0 -47 40 -81 87 -81c72 0 129 57 129 121'],
0xE7: [448,200,444,34,415,'415 119c0 -9 -29 -117 -145 -129v-56c54 0 108 -20 108 -67c0 -67 -133 -67 -241 -67h-26v26h13c75 0 170 0 170 41c0 32 -39 41 -76 41v83c-102 16 -184 108 -184 225c0 124 92 232 217 232c77 0 153 -39 153 -107c0 -30 -20 -47 -46 -47c-28 0 -46 20 -46 46 c0 13 6 43 47 46c-35 36 -98 37 -107 37c-53 0 -135 -42 -135 -205c0 -161 88 -204 141 -204c37 0 102 12 131 105c2 6 4 10 13 10c3 0 13 0 13 -10'],
0xE8: [698,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM284 528l-17 -18l-152 122c-9 7 -17 18 -17 30c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0xE9: [698,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM346 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0xEA: [692,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM374 530l-13 -14l-139 108l-139 -108l-13 14l152 162'],
0xEB: [652,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM182 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM360 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xEC: [698,0,278,15,247,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM201 528l-17 -18l-152 122c-9 7 -17 18 -17 30c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0xED: [698,0,278,33,263,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM263 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0xEE: [692,0,278,-13,291,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM291 530l-13 -14l-139 108l-139 -108l-13 14l152 162'],
0xEF: [652,0,278,2,277,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM99 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM277 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48 c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xF1: [651,0,556,32,535,'535 0l-112 3l-113 -3v31c67 0 78 0 78 45v233c0 57 -11 111 -74 111c-64 0 -135 -56 -135 -160v-184c0 -45 11 -45 78 -45v-31l-112 3l-113 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l141 11v-105c28 62 75 105 148 105c58 0 91 -20 105 -37 c31 -36 31 -67 31 -153v-191c1 -30 26 -30 78 -30v-31zM445 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xF2: [698,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM312 528l-17 -18l-152 122c-9 7 -17 18 -17 30c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0xF3: [698,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM374 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0xF4: [692,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM402 530l-13 -14l-139 108l-139 -108l-13 14l152 162'],
0xF5: [651,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM417 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xF6: [652,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM210 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM388 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xF8: [534,102,500,35,464,'464 213c0 -124 -96 -224 -215 -224c-42 0 -79 14 -102 27l-68 -118l-19 12l7 10l62 108c-54 38 -94 105 -94 185c0 129 96 235 215 235c43 0 81 -15 104 -30l66 116l19 -12l-67 -116c38 -28 92 -95 92 -193zM338 392c-18 16 -49 34 -89 34c-36 0 -86 -17 -116 -69 c-27 -45 -29 -101 -29 -143c0 -56 5 -113 42 -155zM395 214c0 41 -2 114 -41 160l-191 -332c28 -24 62 -31 87 -31c39 0 87 18 116 64s29 106 29 139'],
0xF9: [698,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM340 528l-17 -18l-152 122c-9 7 -17 18 -17 30 c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0xFA: [698,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM402 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18 l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0xFB: [692,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM430 530l-13 -14l-139 108l-139 -108l-13 14 l152 162'],
0xFC: [652,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM238 605c0 -23 -18 -48 -49 -48 c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM416 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0xFD: [698,205,528,19,508,'508 400c-16 0 -67 -1 -93 -64l-176 -427c-24 -57 -65 -114 -128 -114c-50 0 -92 36 -92 81c0 30 22 43 42 43c23 0 42 -16 42 -42c0 -16 -8 -38 -39 -42c19 -18 42 -18 47 -18c64 0 92 69 114 124l25 59l-150 365c-14 35 -33 35 -81 35v31c30 -2 70 -3 97 -3l109 3v-31 c-19 0 -56 0 -56 -26c0 -4 2 -8 6 -18l111 -269l101 246c5 12 6 14 6 24c0 25 -16 42 -47 43v31l87 -3c23 0 52 1 75 3v-31zM388 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0xFE: [694,194,556,28,521,'521 216c0 -129 -104 -227 -223 -227c-76 0 -118 54 -123 70v-9v-168c0 -45 11 -45 78 -45v-31l-113 3l-112 -3v31c67 0 78 0 78 45v714c0 49 -8 56 -78 56v31l144 11v-318c20 22 62 66 140 66c112 0 209 -99 209 -226zM438 216c0 113 -61 201 -134 201 c-51 0 -100 -29 -129 -80v-223c0 -20 0 -21 14 -42c27 -41 65 -61 105 -61c74 0 144 84 144 205'],
0xFF: [652,205,528,19,508,'508 400c-16 0 -67 -1 -93 -64l-176 -427c-24 -57 -65 -114 -128 -114c-50 0 -92 36 -92 81c0 30 22 43 42 43c23 0 42 -16 42 -42c0 -16 -8 -38 -39 -42c19 -18 42 -18 47 -18c64 0 92 69 114 124l25 59l-150 365c-14 35 -33 35 -81 35v31c30 -2 70 -3 97 -3l109 3v-31 c-19 0 -56 0 -56 -26c0 -4 2 -8 6 -18l111 -269l101 246c5 12 6 14 6 24c0 25 -16 42 -47 43v31l87 -3c23 0 52 1 75 3v-31zM224 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM402 605c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48 c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0x100: [787,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM556 756h-361v31h361v-31'],
0x101: [620,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM431 589h-361v31h361v-31'],
0x102: [918,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM525 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22'],
0x103: [690,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM400 690c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22 c2 -85 65 -134 128 -134c59 0 125 47 127 134h22'],
0x104: [716,211,750,32,717,'717 0c-38 2 -77 4 -116 4c-35 -24 -72 -59 -72 -99c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90c0 52 33 91 81 124c-39 0 -91 -1 -120 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131 c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31zM458 259l-113 325l-112 -325h225'],
0x105: [448,211,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-11 0 -21 2 -29 6c-35 -24 -73 -55 -73 -95c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90c0 52 51 106 100 136c-16 16 -26 39 -28 61c-19 -47 -65 -87 -131 -87 c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200 c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129'],
0x106: [909,22,722,56,665,'665 233c0 -116 -98 -255 -261 -255c-186 0 -348 157 -348 364c0 204 161 363 348 363c96 0 147 -50 184 -86l50 74c8 12 12 12 16 12c11 0 11 -7 11 -24v-237c0 -21 0 -24 -16 -24c-14 0 -14 3 -16 17c-20 146 -109 237 -218 237c-61 0 -256 -34 -256 -333 c0 -298 196 -332 257 -332c109 0 216 82 224 225c1 10 1 16 12 16c13 0 13 -7 13 -17zM534 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x107: [698,11,444,34,415,'415 119c0 -10 -32 -130 -166 -130c-116 0 -215 99 -215 227c0 124 92 232 217 232c77 0 153 -39 153 -107c0 -30 -20 -47 -46 -47c-28 0 -46 20 -46 46c0 13 6 43 47 46c-35 36 -98 37 -107 37c-53 0 -135 -42 -135 -205c0 -161 88 -204 141 -204c37 0 102 12 131 105 c2 6 4 10 13 10c3 0 13 0 13 -10zM368 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0x10C: [869,22,722,56,665,'665 233c0 -116 -98 -255 -261 -255c-186 0 -348 157 -348 364c0 204 161 363 348 363c96 0 147 -50 184 -86l50 74c8 12 12 12 16 12c11 0 11 -7 11 -24v-237c0 -21 0 -24 -16 -24c-14 0 -14 3 -16 17c-20 146 -109 237 -218 237c-61 0 -256 -34 -256 -333 c0 -298 196 -332 257 -332c109 0 216 82 224 225c1 10 1 16 12 16c13 0 13 -7 13 -17zM548 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x10D: [692,11,444,34,415,'415 119c0 -10 -32 -130 -166 -130c-116 0 -215 99 -215 227c0 124 92 232 217 232c77 0 153 -39 153 -107c0 -30 -20 -47 -46 -47c-28 0 -46 20 -46 46c0 13 6 43 47 46c-35 36 -98 37 -107 37c-53 0 -135 -42 -135 -205c0 -161 88 -204 141 -204c37 0 102 12 131 105 c2 6 4 10 13 10c3 0 13 0 13 -10zM396 678l-152 -162l-152 162l13 14l139 -108l139 108'],
0x10E: [869,0,764,35,707,'707 336c0 -188 -138 -336 -306 -336h-366v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31h366c171 0 306 -157 306 -347zM607 336c0 78 -9 164 -52 223c-51 71 -120 93 -182 93h-100c-47 0 -49 -7 -49 -40v-541c0 -33 2 -40 49 -40h101c101 0 158 58 178 85 c36 49 55 109 55 220zM474 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x10F: [694,11,556,34,574,'527 0l-147 -11v66c-25 -32 -70 -66 -134 -66c-114 0 -212 99 -212 226c0 129 105 227 223 227c54 0 97 -26 126 -62v216c0 49 -8 56 -78 56v31l144 11v-607c0 -49 8 -56 78 -56v-31zM380 118v205c0 18 0 20 -11 37c-31 45 -73 60 -108 60c-54 0 -92 -33 -113 -64 c-29 -45 -31 -105 -31 -142c0 -41 3 -98 29 -139c24 -38 60 -64 105 -64c43 0 88 22 118 70c11 17 11 19 11 37zM574 615c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40 c30 0 48 -31 48 -79'],
0x110: [683,0,764,35,707,'707 336c0 -188 -138 -336 -306 -336h-366v31h24c77 0 79 11 79 47v249h-103v30h103v248c0 36 -2 47 -79 47h-24v31h366c171 0 306 -157 306 -347zM607 336c0 78 -9 164 -52 223c-51 71 -120 93 -182 93h-100c-47 0 -49 -7 -49 -40v-255h158v-30h-158v-256 c0 -33 2 -40 49 -40h101c101 0 158 58 178 85c36 49 55 109 55 220'],
0x112: [787,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM521 756h-361v31h361v-31'],
0x113: [620,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM403 589h-361v31h361v-31'],
0x116: [864,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM393 811c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x117: [657,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM275 604c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x118: [680,211,681,33,652,'652 258l-42 -258h-115c-39 -28 -66 -55 -66 -95c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90c0 52 32 94 77 121h-425v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25 c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133c172 0 195 73 220 227h25'],
0x119: [448,211,444,28,415,'415 119c0 -16 -33 -101 -120 -124c-38 -21 -76 -50 -76 -90c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90c0 43 31 80 66 110c-111 6 -209 101 -209 231c0 125 92 228 208 228c125 0 179 -97 179 -196 c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237'],
0x11A: [869,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x11B: [692,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM374 678l-152 -162l-152 162l13 14l139 -108l139 108'],
0x11E: [918,22,785,56,735,'735 242c-65 0 -69 -5 -69 -44v-174c0 -15 0 -23 -9 -23c-11 0 -51 40 -64 62c-34 -59 -114 -85 -187 -85c-190 0 -350 159 -350 364s162 363 348 363c99 0 153 -54 185 -86l50 74c8 12 12 12 16 12c11 0 11 -7 11 -24v-237c0 -21 0 -24 -16 -24c-14 0 -14 3 -16 17 c-20 147 -111 237 -218 237c-60 0 -257 -33 -257 -332c0 -298 198 -333 263 -333c28 0 155 9 155 121v64c0 37 -3 48 -93 48h-32v31c36 -3 121 -3 161 -3l122 3v-31zM542 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134 c59 0 125 47 127 134h22'],
0x11F: [690,206,500,28,485,'485 404c0 -23 -19 -30 -29 -30c-16 0 -29 12 -29 29c0 12 5 23 16 27c-3 1 -10 1 -10 1c-18 0 -54 -5 -90 -39c25 -23 41 -60 41 -97c0 -77 -69 -146 -162 -146c-19 0 -60 3 -99 31c-17 -20 -17 -43 -17 -47c0 -32 21 -63 53 -67c7 -1 50 -1 75 -1c61 0 119 0 172 -28 c51 -28 65 -79 65 -114c0 -78 -104 -129 -222 -129c-122 0 -221 55 -221 127c0 40 32 83 92 100c-31 20 -44 58 -44 89c0 35 18 68 31 83c-25 21 -47 59 -47 103c0 77 69 146 162 146c22 0 64 -3 106 -36c42 41 86 47 106 47c39 0 51 -32 51 -49zM309 296 c0 23 0 123 -87 123c-40 0 -63 -28 -71 -40c-15 -25 -16 -57 -16 -84c0 -23 0 -123 87 -123c40 0 63 28 71 40c15 25 16 57 16 84zM419 -79c0 86 -112 86 -198 86h-59c-44 -3 -82 -40 -82 -86c0 -53 69 -104 170 -104c98 0 169 50 169 104zM365 690 c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22'],
0x122: [705,290,785,56,735,'735 242c-65 0 -69 -5 -69 -44v-174c0 -15 0 -23 -9 -23c-11 0 -51 40 -64 62c-34 -59 -114 -85 -187 -85c-190 0 -350 159 -350 364s162 363 348 363c99 0 153 -54 185 -86l50 74c8 12 12 12 16 12c11 0 11 -7 11 -24v-237c0 -21 0 -24 -16 -24c-14 0 -14 3 -16 17 c-20 147 -111 237 -218 237c-60 0 -257 -33 -257 -332c0 -298 198 -333 263 -333c28 0 155 9 155 121v64c0 37 -3 48 -93 48h-32v31c36 -3 121 -3 161 -3l122 3v-31zM436 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141 c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x123: [738,206,500,28,485,'259 554c0 -20 -14 -40 -40 -40c-30 0 -48 31 -48 79c0 86 59 145 68 145c4 0 8 -3 8 -8c0 -3 -1 -4 -5 -8c-33 -36 -54 -81 -53 -141c8 8 19 12 30 12c27 0 40 -20 40 -39zM485 404c0 -23 -19 -30 -29 -30c-16 0 -29 12 -29 29c0 12 5 23 16 27c-3 1 -10 1 -10 1 c-18 0 -54 -5 -90 -39c25 -23 41 -60 41 -97c0 -77 -69 -146 -162 -146c-19 0 -60 3 -99 31c-17 -20 -17 -43 -17 -47c0 -32 21 -63 53 -67c7 -1 50 -1 75 -1c61 0 119 0 172 -28c51 -28 65 -79 65 -114c0 -78 -104 -129 -222 -129c-122 0 -221 55 -221 127 c0 40 32 83 92 100c-31 20 -44 58 -44 89c0 35 18 68 31 83c-25 21 -47 59 -47 103c0 77 69 146 162 146c22 0 64 -3 106 -36c42 41 86 47 106 47c39 0 51 -32 51 -49zM309 296c0 23 0 123 -87 123c-40 0 -63 -28 -71 -40c-15 -25 -16 -57 -16 -84c0 -23 0 -123 87 -123 c40 0 63 28 71 40c15 25 16 57 16 84zM419 -79c0 86 -112 86 -198 86h-59c-44 -3 -82 -40 -82 -86c0 -53 69 -104 170 -104c98 0 169 50 169 104'],
0x128: [829,0,361,15,348,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM348 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23 c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x129: [651,0,278,-27,306,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM306 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78 c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x12A: [787,0,361,1,362,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM362 756h-361v31h361v-31'],
0x12B: [620,0,278,-41,320,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM320 589h-361v31h361v-31'],
0x12E: [683,211,361,28,333,'333 -115c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90s39 93 82 124h-6c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31 c-23 2 -65 3 -102 3c-21 -11 -40 -26 -56 -44c-14 -16 -23 -34 -23 -54c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7'],
0x12F: [669,211,278,24,253,'181 616c0 -32 -25 -53 -53 -53c-31 0 -53 26 -53 53c0 26 22 53 53 53c28 0 53 -21 53 -53zM253 -115c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90c0 45 39 92 81 123l-72 -2v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31 l-95 3c-21 -11 -40 -26 -56 -44c-14 -16 -24 -34 -24 -54c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7'],
0x130: [864,0,361,28,333,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM234 811c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53 c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x132: [683,22,839,28,790,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM790 652c-63 0 -77 0 -77 -41v-444c0 -34 0 -36 -1 -44 c-11 -75 -84 -145 -186 -145c-89 0 -160 60 -160 134c0 44 34 58 56 58c28 0 56 -20 56 -56c0 -26 -12 -56 -64 -56c36 -58 104 -58 110 -58c53 0 103 56 103 148v456c0 35 0 48 -98 48h-36v31c38 -3 126 -3 168 -3l129 3v-31'],
0x133: [657,205,556,33,461,'182 604c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53zM460 -50c0 -91 -62 -155 -137 -155c-57 0 -113 28 -113 80c0 26 18 46 46 46s46 -20 46 -46c0 -27 -20 -41 -35 -45c26 -13 49 -13 54 -13c64 0 73 86 73 131v396 c0 49 -9 56 -86 56v31l152 11v-492zM247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM461 604c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x136: [683,290,778,33,736,'736 0l-115 3c-38 0 -108 0 -143 -3v31c20 0 59 0 59 30c0 12 -9 25 -15 34l-181 268l-116 -110v-175c0 -36 2 -47 79 -47h24v-31c-35 3 -110 3 -148 3s-112 0 -147 -3v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24 c-77 0 -79 -11 -79 -47v-318l313 299c8 7 18 17 18 33c0 9 -6 32 -46 33v31c34 -3 91 -3 127 -3c27 0 59 0 85 3v-31c-81 -1 -134 -52 -142 -60l-180 -173l231 -340c30 -44 51 -48 105 -48v-31zM433 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8 c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x137: [694,290,528,28,511,'511 0c-29 2 -58 3 -87 3l-108 -3v31c19 0 36 4 36 23c0 18 -42 74 -119 180l-64 -55v-103c0 -45 11 -45 78 -45v-31l-110 3l-109 -3v31c67 0 78 0 78 45v520c0 49 -8 56 -78 56v31l144 11v-480l141 122c8 7 22 19 22 39c0 13 -10 24 -29 25v31c14 -1 76 -3 112 -3 c28 0 41 0 70 3v-31c-21 -1 -63 -3 -126 -54c-10 -8 -81 -68 -81 -72c0 -3 5 -9 6 -11l127 -179c38 -53 60 -53 97 -53v-31zM308 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40 c30 0 48 -31 48 -79'],
0x139: [909,0,625,33,582,'582 258l-28 -258h-521v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31c35 -3 113 -3 152 -3c41 0 132 0 168 3v-31h-33c-95 0 -95 -14 -95 -48v-533c0 -33 2 -40 49 -40h82c176 0 190 125 201 227h25zM322 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130 c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x13A: [920,0,278,33,276,'255 0l-111 3l-111 -3v31c67 0 78 0 78 45v520c0 49 -8 56 -78 56v31l144 11v-618c0 -45 11 -45 78 -45v-31zM276 878c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x13B: [683,290,625,33,582,'582 258l-28 -258h-521v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31c35 -3 113 -3 152 -3c41 0 132 0 168 3v-31h-33c-95 0 -95 -14 -95 -48v-533c0 -33 2 -40 49 -40h82c176 0 190 125 201 227h25zM357 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8 c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x13C: [694,290,278,33,255,'255 0l-111 3l-111 -3v31c67 0 78 0 78 45v520c0 49 -8 56 -78 56v31l144 11v-618c0 -45 11 -45 78 -45v-31zM183 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40 c30 0 48 -31 48 -79'],
0x13D: [683,0,625,33,582,'582 258l-28 -258h-521v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31c35 -3 113 -3 152 -3c41 0 132 0 168 3v-31h-33c-95 0 -95 -14 -95 -48v-533c0 -33 2 -40 49 -40h82c176 0 190 125 201 227h25zM497 604c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8 c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x13E: [694,0,278,33,302,'255 0l-111 3l-111 -3v31c67 0 78 0 78 45v520c0 49 -8 56 -78 56v31l144 11v-618c0 -45 11 -45 78 -45v-31zM302 615c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40 c30 0 48 -31 48 -79'],
0x141: [683,0,625,33,582,'582 258l-28 -258h-521v31h24c77 0 79 11 79 47v221l-67 -54l-22 25l89 71v264c0 36 -2 47 -79 47h-24v31c35 -3 113 -3 152 -3c41 0 132 0 168 3v-31h-33c-95 0 -95 -14 -95 -48v-193l159 126l20 -26l-179 -142v-298c0 -33 2 -40 49 -40h82c176 0 190 125 201 227h25'],
0x142: [694,0,336,48,286,'286 419l-81 -61v-282c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v234l-75 -56l-16 20l91 68v254c0 49 -8 56 -78 56v31l144 11v-302l65 48'],
0x143: [909,0,750,33,716,'716 652c-103 0 -103 -47 -103 -74v-552c0 -19 0 -26 -14 -26c-7 0 -8 1 -17 13l-408 600c-4 6 -5 7 -10 12v-520c0 -27 0 -74 103 -74v-31l-117 3l-117 -3v31c103 0 103 47 103 74v522c0 19 -1 20 -24 23c-15 1 -35 2 -50 2h-29v31h170c19 0 20 -1 29 -13l353 -519v427 c0 27 0 74 -103 74v31l117 -3l117 3v-31zM512 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x144: [698,0,556,32,535,'535 0l-112 3l-113 -3v31c67 0 78 0 78 45v233c0 57 -11 111 -74 111c-64 0 -135 -56 -135 -160v-184c0 -45 11 -45 78 -45v-31l-112 3l-113 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l141 11v-105c28 62 75 105 148 105c58 0 91 -20 105 -37 c31 -36 31 -67 31 -153v-191c1 -30 26 -30 78 -30v-31zM402 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0x145: [683,290,750,33,716,'716 652c-103 0 -103 -47 -103 -74v-552c0 -19 0 -26 -14 -26c-7 0 -8 1 -17 13l-408 600c-4 6 -5 7 -10 12v-520c0 -27 0 -74 103 -74v-31l-117 3l-117 -3v31c103 0 103 47 103 74v522c0 19 -1 20 -24 23c-15 1 -35 2 -50 2h-29v31h170c19 0 20 -1 29 -13l353 -519v427 c0 27 0 74 -103 74v31l117 -3l117 3v-31zM419 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x146: [442,290,556,32,535,'535 0l-112 3l-113 -3v31c67 0 78 0 78 45v233c0 57 -11 111 -74 111c-64 0 -135 -56 -135 -160v-184c0 -45 11 -45 78 -45v-31l-112 3l-113 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l141 11v-105c28 62 75 105 148 105c58 0 91 -20 105 -37 c31 -36 31 -67 31 -153v-191c1 -30 26 -30 78 -30v-31zM322 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x147: [869,0,750,33,716,'716 652c-103 0 -103 -47 -103 -74v-552c0 -19 0 -26 -14 -26c-7 0 -8 1 -17 13l-408 600c-4 6 -5 7 -10 12v-520c0 -27 0 -74 103 -74v-31l-117 3l-117 -3v31c103 0 103 47 103 74v522c0 19 -1 20 -24 23c-15 1 -35 2 -50 2h-29v31h170c19 0 20 -1 29 -13l353 -519v427 c0 27 0 74 -103 74v31l117 -3l117 3v-31zM526 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x148: [692,0,556,32,535,'535 0l-112 3l-113 -3v31c67 0 78 0 78 45v233c0 57 -11 111 -74 111c-64 0 -135 -56 -135 -160v-184c0 -45 11 -45 78 -45v-31l-112 3l-113 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l141 11v-105c28 62 75 105 148 105c58 0 91 -20 105 -37 c31 -36 31 -67 31 -153v-191c1 -30 26 -30 78 -30v-31zM430 678l-152 -162l-152 162l13 14l139 -108l139 108'],
0x14A: [705,22,750,28,713,'713 342c0 -179 -58 -364 -213 -364c-25 0 -46 21 -46 46s21 46 46 46s46 -21 46 -46v-7c65 46 65 196 65 325c0 165 -55 337 -198 337c-80 0 -150 -43 -188 -108v-493c0 -36 3 -47 82 -47h26v-31c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527 c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c15 0 29 1 44 3v-68c45 55 112 90 188 90c178 0 300 -173 300 -363'],
0x14B: [442,216,506,32,457,'457 69c0 -138 -33 -285 -151 -285c-20 0 -35 15 -35 35c0 19 15 35 35 35c18 0 33 -15 34 -33c48 35 48 150 48 248v240c0 57 -11 111 -74 111c-64 0 -135 -56 -135 -160v-184c0 -45 11 -45 78 -45v-31l-112 3l-113 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31 l141 11v-105c28 62 75 105 148 105c58 0 91 -20 105 -37c31 -36 31 -67 31 -153v-183'],
0x14C: [787,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM570 756h-361v31h361v-31'],
0x14D: [620,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM431 589h-361v31h361v-31'],
0x150: [932,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM392 898c0 -10 -3 -14 -12 -26l-92 -126 c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34zM559 898c0 -10 -3 -14 -12 -26l-92 -126c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34'],
0x151: [697,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM253 663c0 -10 -3 -14 -12 -26l-92 -126c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34zM420 663c0 -10 -3 -14 -12 -26l-92 -126c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34'],
0x152: [705,22,1014,70,985,'985 258l-42 -258h-387c-16 0 -29 0 -77 -11c-37 -8 -54 -11 -79 -11c-172 0 -330 152 -330 361c0 211 158 366 330 366c11 0 28 0 70 -10c55 -12 69 -12 86 -12h373l28 -225h-25c-16 135 -38 194 -181 194h-112c-47 0 -49 -7 -49 -40v-242h108c100 0 114 31 114 117h25 v-265h-25c0 86 -14 117 -114 117h-108v-268c0 -33 2 -40 49 -40h110c171 0 186 78 211 227h25zM514 341c0 108 0 193 -5 237c-6 57 -17 105 -105 105c-126 0 -234 -139 -234 -329c0 -198 105 -354 234 -354c84 0 99 43 106 109c4 46 4 105 4 232'],
0x153: [448,11,778,28,749,'749 119c0 -19 -42 -130 -155 -130c-61 0 -133 31 -177 104c-33 -56 -96 -104 -176 -104c-115 0 -213 100 -213 230s99 229 213 229c76 0 139 -44 175 -101c40 67 103 101 166 101c109 0 167 -85 167 -196c0 -21 -3 -21 -25 -21h-273c0 -217 137 -217 147 -217 c62 0 108 47 123 97c5 16 6 20 15 20c5 0 13 -2 13 -12zM683 252c-2 39 -7 174 -102 174c-36 0 -119 -28 -129 -174h231zM382 223c0 195 -122 203 -140 203c-25 0 -137 -10 -137 -203c0 -203 115 -212 137 -212c32 0 140 21 140 212'],
0x154: [909,22,736,35,732,'732 88c0 -28 -17 -110 -95 -110c-30 0 -85 6 -126 42c-41 38 -41 78 -41 143c0 67 0 98 -38 134c-35 34 -77 34 -93 34h-115v-253c0 -36 2 -47 79 -47h24v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31h314 c147 0 261 -84 261 -180c0 -78 -78 -139 -175 -163c55 -19 104 -52 122 -116l13 -80c14 -93 22 -144 71 -144c25 0 60 18 66 89c1 7 1 16 12 16c13 0 13 -11 13 -17zM507 503c0 145 -112 149 -202 149c-20 0 -49 0 -59 -2c-22 -3 -22 -15 -22 -38v-259h111 c148 0 172 81 172 150zM505 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x155: [698,0,392,28,364,'364 381c0 -32 -25 -44 -43 -44c-22 0 -43 15 -43 43c0 26 20 38 23 39c-2 1 -4 1 -11 1c-76 0 -118 -89 -118 -188v-154c0 -36 2 -47 76 -47h21v-31c-40 3 -87 3 -127 3l-114 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l139 11v-110c14 43 50 110 123 110 c43 0 74 -29 74 -61zM320 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0x156: [683,290,736,35,732,'732 88c0 -28 -17 -110 -95 -110c-30 0 -85 6 -126 42c-41 38 -41 78 -41 143c0 67 0 98 -38 134c-35 34 -77 34 -93 34h-115v-253c0 -36 2 -47 79 -47h24v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31h314 c147 0 261 -84 261 -180c0 -78 -78 -139 -175 -163c55 -19 104 -52 122 -116l13 -80c14 -93 22 -144 71 -144c25 0 60 18 66 89c1 7 1 16 12 16c13 0 13 -11 13 -17zM507 503c0 145 -112 149 -202 149c-20 0 -49 0 -59 -2c-22 -3 -22 -15 -22 -38v-259h111 c148 0 172 81 172 150zM412 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x157: [442,290,392,28,364,'364 381c0 -32 -25 -44 -43 -44c-22 0 -43 15 -43 43c0 26 20 38 23 39c-2 1 -4 1 -11 1c-76 0 -118 -89 -118 -188v-154c0 -36 2 -47 76 -47h21v-31c-40 3 -87 3 -127 3l-114 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l139 11v-110c14 43 50 110 123 110 c43 0 74 -29 74 -61zM183 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x158: [869,22,736,35,732,'732 88c0 -28 -17 -110 -95 -110c-30 0 -85 6 -126 42c-41 38 -41 78 -41 143c0 67 0 98 -38 134c-35 34 -77 34 -93 34h-115v-253c0 -36 2 -47 79 -47h24v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v527c0 36 -2 47 -79 47h-24v31h314 c147 0 261 -84 261 -180c0 -78 -78 -139 -175 -163c55 -19 104 -52 122 -116l13 -80c14 -93 22 -144 71 -144c25 0 60 18 66 89c1 7 1 16 12 16c13 0 13 -11 13 -17zM507 503c0 145 -112 149 -202 149c-20 0 -49 0 -59 -2c-22 -3 -22 -15 -22 -38v-259h111 c148 0 172 81 172 150zM519 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x159: [692,0,392,28,364,'364 381c0 -32 -25 -44 -43 -44c-22 0 -43 15 -43 43c0 26 20 38 23 39c-2 1 -4 1 -11 1c-76 0 -118 -89 -118 -188v-154c0 -36 2 -47 76 -47h21v-31c-40 3 -87 3 -127 3l-114 -3v31c67 0 78 0 78 45v268c0 49 -8 56 -78 56v31l139 11v-110c14 43 50 110 123 110 c43 0 74 -29 74 -61zM348 678l-152 -162l-152 162l13 14l139 -108l139 108'],
0x15A: [909,22,556,56,499,'499 186c0 -110 -80 -208 -197 -208c-89 0 -153 36 -184 70c-33 -53 -36 -57 -36 -57c-7 -11 -8 -13 -15 -13c-11 0 -11 7 -11 24v200c0 18 0 25 13 25c3 0 11 0 12 -10c1 -36 4 -100 62 -154c53 -49 129 -54 158 -54c84 0 134 72 134 143c0 33 -10 66 -31 92 c-28 37 -58 44 -85 51c-70 17 -121 29 -132 33c-78 27 -131 100 -131 183c0 106 84 194 195 194c89 0 130 -41 160 -70l35 57c7 12 8 13 15 13c11 0 11 -7 11 -24v-201c0 -19 0 -24 -13 -24c-11 0 -11 6 -12 12c-6 45 -28 209 -195 209c-78 0 -132 -61 -132 -131 c0 -58 39 -112 101 -127l128 -31c84 -20 150 -102 150 -202zM415 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x15B: [698,11,394,33,360,'360 128c0 -72 -46 -139 -161 -139c-21 0 -66 1 -110 43c-18 -19 -18 -21 -20 -23c-19 -19 -20 -20 -25 -20c-11 0 -11 7 -11 24v132c0 18 0 25 13 25c10 0 11 -4 14 -17c19 -85 55 -142 139 -142c78 0 113 40 113 91c0 72 -82 88 -104 92c-72 14 -100 20 -132 46 c-27 22 -43 50 -43 85c0 56 38 123 160 123c15 0 56 0 94 -28c4 3 14 12 17 16c13 12 15 12 20 12c11 0 11 -7 11 -24v-101c0 -19 0 -24 -13 -24c0 0 -11 0 -12 9c-2 31 -7 121 -117 121c-86 0 -112 -41 -112 -76c0 -58 67 -71 123 -82c42 -8 81 -16 114 -48 c12 -12 42 -42 42 -95zM321 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0x15E: [705,200,556,56,499,'499 186c0 -109 -79 -207 -195 -208v-44c53 0 108 -20 108 -67c0 -67 -134 -67 -242 -67h-26v26h13c75 0 171 0 171 41c0 32 -40 41 -76 41v74c-63 10 -109 39 -134 66c-33 -53 -36 -57 -36 -57c-7 -11 -8 -13 -15 -13c-11 0 -11 7 -11 24v200c0 18 0 25 13 25 c3 0 11 0 12 -10c1 -36 4 -100 62 -154c53 -49 129 -54 158 -54c84 0 134 72 134 143c0 33 -10 66 -31 92c-28 37 -58 44 -85 51c-70 17 -121 29 -132 33c-78 27 -131 100 -131 183c0 106 84 194 195 194c89 0 130 -41 160 -70l35 57c7 12 8 13 15 13c11 0 11 -7 11 -24 v-201c0 -19 0 -24 -13 -24c-11 0 -11 6 -12 12c-6 45 -28 209 -195 209c-78 0 -132 -61 -132 -131c0 -58 39 -112 101 -127l128 -31c84 -20 150 -102 150 -202'],
0x15F: [448,200,394,33,360,'360 128c0 -67 -39 -129 -137 -138v-56c54 0 108 -20 108 -67c0 -67 -133 -67 -241 -67h-26v26h13c75 0 170 0 170 41c0 32 -39 41 -76 41v83c-23 3 -53 13 -82 41c-18 -19 -18 -21 -20 -23c-19 -19 -20 -20 -25 -20c-11 0 -11 7 -11 24v132c0 18 0 25 13 25 c10 0 11 -4 14 -17c19 -85 55 -142 139 -142c78 0 113 40 113 91c0 72 -82 88 -104 92c-72 14 -100 20 -132 46c-27 22 -43 50 -43 85c0 56 38 123 160 123c15 0 56 0 94 -28c4 3 14 12 17 16c13 12 15 12 20 12c11 0 11 -7 11 -24v-101c0 -19 0 -24 -13 -24 c0 0 -11 0 -12 9c-2 31 -7 121 -117 121c-86 0 -112 -41 -112 -76c0 -58 67 -71 123 -82c42 -8 81 -16 114 -48c12 -12 42 -42 42 -95'],
0x160: [869,22,556,56,499,'499 186c0 -110 -80 -208 -197 -208c-89 0 -153 36 -184 70c-33 -53 -36 -57 -36 -57c-7 -11 -8 -13 -15 -13c-11 0 -11 7 -11 24v200c0 18 0 25 13 25c3 0 11 0 12 -10c1 -36 4 -100 62 -154c53 -49 129 -54 158 -54c84 0 134 72 134 143c0 33 -10 66 -31 92 c-28 37 -58 44 -85 51c-70 17 -121 29 -132 33c-78 27 -131 100 -131 183c0 106 84 194 195 194c89 0 130 -41 160 -70l35 57c7 12 8 13 15 13c11 0 11 -7 11 -24v-201c0 -19 0 -24 -13 -24c-11 0 -11 6 -12 12c-6 45 -28 209 -195 209c-78 0 -132 -61 -132 -131 c0 -58 39 -112 101 -127l128 -31c84 -20 150 -102 150 -202zM429 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x161: [692,11,394,33,360,'360 128c0 -72 -46 -139 -161 -139c-21 0 -66 1 -110 43c-18 -19 -18 -21 -20 -23c-19 -19 -20 -20 -25 -20c-11 0 -11 7 -11 24v132c0 18 0 25 13 25c10 0 11 -4 14 -17c19 -85 55 -142 139 -142c78 0 113 40 113 91c0 72 -82 88 -104 92c-72 14 -100 20 -132 46 c-27 22 -43 50 -43 85c0 56 38 123 160 123c15 0 56 0 94 -28c4 3 14 12 17 16c13 12 15 12 20 12c11 0 11 -7 11 -24v-101c0 -19 0 -24 -13 -24c0 0 -11 0 -12 9c-2 31 -7 121 -117 121c-86 0 -112 -41 -112 -76c0 -58 67 -71 123 -82c42 -8 81 -16 114 -48 c12 -12 42 -42 42 -95zM349 678l-152 -162l-152 162l13 14l139 -108l139 108'],
0x162: [677,200,722,36,685,'685 452h-25c-14 161 -29 194 -180 194c-19 0 -46 0 -57 -2c-18 -4 -18 -18 -18 -38v-527c0 -34 0 -48 105 -48h40v-31c-34 3 -112 3 -163 3v-69c54 0 108 -20 108 -67c0 -67 -133 -67 -241 -67h-26v26h13c75 0 170 0 170 41c0 32 -39 41 -76 41v95c-52 0 -129 0 -164 -3 v31h40c105 0 105 14 105 48v527c0 23 0 34 -21 38c-10 2 -36 2 -54 2c-151 0 -166 -33 -180 -194h-25l19 225h611'],
0x163: [615,200,389,19,347,'347 -133c0 -67 -133 -67 -241 -67h-26v26h13c75 0 170 0 170 41c0 32 -39 41 -76 41v88c-39 11 -83 44 -83 128v276h-85v22c98 4 128 111 129 193h25v-184h143v-31h-143v-278c0 -17 0 -108 67 -108c37 0 67 38 67 112v55h25v-57c0 -62 -26 -131 -93 -135v-55 c54 0 108 -20 108 -67'],
0x164: [869,0,722,36,685,'685 452h-25c-14 161 -29 194 -180 194c-19 0 -46 0 -57 -2c-18 -4 -18 -18 -18 -38v-527c0 -34 0 -48 105 -48h40v-31c-41 3 -144 3 -190 3s-148 0 -189 -3v31h40c105 0 105 14 105 48v527c0 23 0 34 -21 38c-10 2 -36 2 -54 2c-151 0 -166 -33 -180 -194h-25l19 225 h611zM512 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x165: [692,11,389,19,332,'332 124c0 -64 -28 -135 -99 -135c-36 0 -129 12 -129 135v276h-85v22c98 4 128 111 129 193h25v-184h143v-31h-143v-278c0 -17 0 -108 67 -108c37 0 67 38 67 112v55h25v-57zM298 613c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141 c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x168: [829,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM565 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x169: [651,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM445 636c-51 -56 -70 -78 -108 -78 c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x16A: [787,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM579 756h-361v31h361v-31'],
0x16B: [620,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM459 589h-361v31h361v-31'],
0x16E: [892,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM461 804c0 41 -25 58 -63 58c-39 0 -63 -18 -63 -58c0 -41 25 -58 63 -58c39 0 63 18 63 58zM494 805c0 -49 -41 -89 -97 -89c-51 0 -95 38 -95 89c0 44 39 87 97 87c54 0 95 -41 95 -87'],
0x16F: [705,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM341 617c0 41 -25 58 -63 58 c-39 0 -63 -18 -63 -58c0 -41 25 -58 63 -58c39 0 63 18 63 58zM374 618c0 -49 -41 -89 -97 -89c-51 0 -95 38 -95 89c0 44 39 87 97 87c54 0 95 -41 95 -87'],
0x170: [932,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM401 898c0 -10 -3 -14 -12 -26l-92 -126c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34zM568 898c0 -10 -3 -14 -12 -26l-92 -126c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29 c19 0 37 -16 37 -34'],
0x171: [697,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM281 663c0 -10 -3 -14 -12 -26l-92 -126 c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34zM448 663c0 -10 -3 -14 -12 -26l-92 -126c-2 1 -17 9 -21 12l54 145c5 12 11 29 34 29c19 0 37 -16 37 -34'],
0x172: [683,211,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207h-10c-7 -6 -14 -12 -20 -19c-14 -16 -24 -34 -24 -54c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90 c0 36 25 74 57 103c-116 21 -207 121 -207 246v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31'],
0x173: [442,211,556,32,555,'555 -115c-16 -57 -68 -96 -118 -96c-64 0 -111 44 -111 90c0 40 29 80 65 111v89c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355 c0 -49 8 -56 78 -56v-31l-99 -8c-15 -9 -28 -21 -39 -33c-14 -16 -23 -34 -23 -54c0 -46 51 -69 87 -69c32 0 60 20 77 56c5 10 20 5 17 -7'],
0x178: [831,0,750,11,738,'738 652c-32 0 -91 -4 -128 -65l-193 -314v-193c0 -39 3 -49 80 -49h23v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v195l-210 342c-16 26 -24 37 -92 37h-18v31l130 -3c39 0 112 0 148 3v-31c-45 0 -70 -4 -70 -25c0 -5 0 -7 7 -17l181 -295 l165 268c4 6 10 19 10 30c0 20 -16 39 -57 39v31l115 -3c27 0 67 1 98 3v-31zM319 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47zM529 784c0 -23 -18 -48 -49 -48c-27 0 -48 23 -48 48c0 22 18 47 49 47c27 0 48 -23 48 -47'],
0x179: [909,0,611,56,560,'560 267l-17 -267h-461c-21 0 -26 0 -26 17c0 8 0 9 7 20l389 615h-157c-164 0 -194 -81 -201 -194h-25l11 225h448c20 0 26 0 26 -16c0 -7 0 -8 -7 -19l-388 -614h164c185 0 204 94 212 233h25zM443 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130 c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x17A: [698,0,444,28,401,'401 187l-17 -187h-330c-19 0 -26 0 -26 14c0 5 0 7 9 18l279 377h-114c-110 0 -129 -37 -135 -139h-25l11 161h320c18 0 26 0 26 -13c0 -4 0 -6 -9 -17l-278 -376h118c116 0 137 44 146 162h25zM346 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17 c18 0 36 -18 36 -36'],
0x17B: [864,0,611,56,560,'560 267l-17 -267h-461c-21 0 -26 0 -26 17c0 8 0 9 7 20l389 615h-157c-164 0 -194 -81 -201 -194h-25l11 225h448c20 0 26 0 26 -16c0 -7 0 -8 -7 -19l-388 -614h164c185 0 204 94 212 233h25zM359 811c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53 c30 0 53 -26 53 -53'],
0x17C: [657,0,444,28,401,'401 187l-17 -187h-330c-19 0 -26 0 -26 14c0 5 0 7 9 18l279 377h-114c-110 0 -129 -37 -135 -139h-25l11 161h320c18 0 26 0 26 -13c0 -4 0 -6 -9 -17l-278 -376h118c116 0 137 44 146 162h25zM275 604c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53 c30 0 53 -26 53 -53'],
0x17D: [869,0,611,56,560,'560 267l-17 -267h-461c-21 0 -26 0 -26 17c0 8 0 9 7 20l389 615h-157c-164 0 -194 -81 -201 -194h-25l11 225h448c20 0 26 0 26 -16c0 -7 0 -8 -7 -19l-388 -614h164c185 0 204 94 212 233h25zM457 853l-151 -117l-151 117l12 16l140 -66l140 66'],
0x17E: [692,0,444,28,401,'401 187l-17 -187h-330c-19 0 -26 0 -26 14c0 5 0 7 9 18l279 377h-114c-110 0 -129 -37 -135 -139h-25l11 161h320c18 0 26 0 26 -13c0 -4 0 -6 -9 -17l-278 -376h118c116 0 137 44 146 162h25zM374 678l-152 -162l-152 162l13 14l139 -108l139 108'],
0x17F: [705,0,306,33,357,'357 635c0 -24 -15 -44 -44 -44c-27 0 -43 20 -43 43c0 25 18 38 30 42c-15 7 -33 7 -33 7c-44 0 -89 -48 -89 -136v-469c0 -36 2 -47 76 -47h21v-31c-40 3 -87 3 -127 3l-114 -3v31c67 0 78 0 78 45v324h-79v31h79v115c0 106 85 159 155 159c53 0 90 -33 90 -70'],
0x1A0: [789,22,778,55,720,'720 339c0 -95 -33 -186 -97 -255c-61 -66 -146 -106 -235 -106c-90 0 -174 40 -235 106c-64 69 -98 160 -98 255s34 188 98 259c60 67 145 107 235 107c67 0 132 -23 186 -62c23 5 42 21 53 42c-4 -1 -8 -2 -13 -2c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -30 53 -63 c0 -48 -28 -91 -69 -103c8 -8 17 -16 25 -25c64 -71 97 -164 97 -259zM617 355c0 82 -14 165 -61 231c-39 56 -100 94 -168 94s-129 -38 -169 -94c-47 -66 -61 -149 -61 -231c0 -87 13 -177 61 -250c39 -58 99 -101 169 -101c69 0 130 43 168 101c48 73 61 163 61 250'],
0x1A1: [536,11,500,28,488,'488 473c0 -50 -30 -95 -74 -104c37 -44 56 -99 56 -157c0 -59 -23 -116 -65 -158c-41 -41 -97 -65 -156 -65s-115 24 -157 65c-41 42 -64 99 -64 158c0 62 22 122 64 166c41 44 98 69 157 69c54 0 106 -21 145 -57c24 5 44 21 55 42c-4 -1 -9 -2 -13 -2 c-36 0 -53 27 -53 53c0 27 17 53 53 53c31 0 52 -30 52 -63zM387 224c0 50 -2 103 -31 144c-24 36 -64 57 -107 57s-83 -21 -107 -57c-29 -41 -31 -94 -31 -144c0 -53 1 -108 31 -152c23 -36 64 -58 107 -58s84 22 107 58c29 44 31 99 31 152'],
0x1AF: [789,22,750,33,726,'726 725c0 -62 -52 -108 -114 -115v-382c0 -66 -22 -129 -65 -177c-41 -46 -98 -73 -159 -73c-66 0 -131 26 -178 73c-48 47 -74 110 -74 177v389c0 12 -6 25 -17 30c-18 6 -57 6 -86 6v30l147 -3l147 3v-30c-29 0 -68 0 -85 -6c-12 -5 -18 -18 -18 -30v-389 c0 -65 11 -117 42 -158c29 -38 75 -62 122 -62c53 0 102 23 138 63c37 42 56 98 56 157v361c0 19 -10 37 -26 48c-23 14 -50 16 -77 16v30l118 -3c5 0 10 1 15 3v-48c34 5 64 23 79 51c-5 -2 -11 -3 -18 -3c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -31 53 -64'],
0x1B0: [536,11,556,32,571,'571 471c0 -60 -53 -101 -116 -111v-274c0 -17 0 -37 13 -46s42 -9 65 -9v-31l-144 -11v89c-23 -52 -67 -89 -123 -89c-48 0 -87 7 -118 32c-27 23 -39 60 -39 100v223c0 18 0 37 -13 47c-13 9 -42 9 -64 9v30l147 12v-321c0 -44 2 -69 15 -85c15 -18 41 -25 74 -25 c67 0 117 66 118 147v191c0 16 -1 33 -13 42c-13 9 -42 9 -65 9v30l147 12v-53c32 6 59 20 75 42c-4 0 -8 -1 -12 -1c-35 0 -53 27 -53 53c0 27 18 53 53 53c32 0 53 -31 53 -65'],
0x218: [705,290,556,56,499,'499 186c0 -110 -80 -208 -197 -208c-89 0 -153 36 -184 70c-33 -53 -36 -57 -36 -57c-7 -11 -8 -13 -15 -13c-11 0 -11 7 -11 24v200c0 18 0 25 13 25c3 0 11 0 12 -10c1 -36 4 -100 62 -154c53 -49 129 -54 158 -54c84 0 134 72 134 143c0 33 -10 66 -31 92 c-28 37 -58 44 -85 51c-70 17 -121 29 -132 33c-78 27 -131 100 -131 183c0 106 84 194 195 194c89 0 130 -41 160 -70l35 57c7 12 8 13 15 13c11 0 11 -7 11 -24v-201c0 -19 0 -24 -13 -24c-11 0 -11 6 -12 12c-6 45 -28 209 -195 209c-78 0 -132 -61 -132 -131 c0 -58 39 -112 101 -127l128 -31c84 -20 150 -102 150 -202zM322 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x219: [448,290,394,33,360,'360 128c0 -72 -46 -139 -161 -139c-21 0 -66 1 -110 43c-18 -19 -18 -21 -20 -23c-19 -19 -20 -20 -25 -20c-11 0 -11 7 -11 24v132c0 18 0 25 13 25c10 0 11 -4 14 -17c19 -85 55 -142 139 -142c78 0 113 40 113 91c0 72 -82 88 -104 92c-72 14 -100 20 -132 46 c-27 22 -43 50 -43 85c0 56 38 123 160 123c15 0 56 0 94 -28c4 3 14 12 17 16c13 12 15 12 20 12c11 0 11 -7 11 -24v-101c0 -19 0 -24 -13 -24c0 0 -11 0 -12 9c-2 31 -7 121 -117 121c-86 0 -112 -41 -112 -76c0 -58 67 -71 123 -82c42 -8 81 -16 114 -48 c12 -12 42 -42 42 -95zM241 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x21A: [677,290,722,36,685,'685 452h-25c-14 161 -29 194 -180 194c-19 0 -46 0 -57 -2c-18 -4 -18 -18 -18 -38v-527c0 -34 0 -48 105 -48h40v-31c-41 3 -144 3 -190 3s-148 0 -189 -3v31h40c105 0 105 14 105 48v527c0 23 0 34 -21 38c-10 2 -36 2 -54 2c-151 0 -166 -33 -180 -194h-25l19 225 h611zM405 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x21B: [615,290,389,19,332,'332 124c0 -64 -28 -135 -99 -135c-36 0 -129 12 -129 135v276h-85v22c98 4 128 111 129 193h25v-184h143v-31h-143v-278c0 -17 0 -108 67 -108c37 0 67 38 67 112v55h25v-57zM238 -145c0 -86 -59 -145 -68 -145c-4 0 -8 3 -8 8c0 3 1 4 5 8c33 36 54 81 53 141 c-8 -8 -19 -12 -30 -12c-27 0 -40 20 -40 39c0 20 14 40 40 40c30 0 48 -31 48 -79'],
0x1EA0: [716,200,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM428 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EA1: [448,200,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM303 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53 c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EA2: [967,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM472 900c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30 c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EA3: [709,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM347 642c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19 c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EA4: [1052,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM526 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM478 1010c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EA5: [832,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM353 790 c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EA6: [1052,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM526 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM478 910l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EA7: [832,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM353 690 l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EA8: [1078,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM526 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM569 1011c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13 c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EA9: [858,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM444 791 c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30 c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EAA: [1002,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM526 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM542 987c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25 c44 0 82 48 82 48'],
0x1EAB: [782,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM417 767 c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EAC: [869,200,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM526 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM428 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EAD: [692,200,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM402 530l-13 -14l-139 108l-139 -108l-13 14l152 162zM303 -147 c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EAE: [1101,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM525 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM478 1059c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EAF: [873,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM400 690c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22 c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM353 831c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EB0: [1101,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM525 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM479 959l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EB1: [873,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM400 690c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22 c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM354 731l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EB2: [1127,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM525 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM473 1060c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19 c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EB3: [899,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM400 690c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22 c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM348 832c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18 c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EB4: [1051,0,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM525 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM542 1036c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15 c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EB5: [823,11,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM400 690c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22 c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM417 808c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EB6: [918,200,750,32,717,'717 0l-131 3c-38 0 -108 0 -144 -3v31c27 0 83 0 83 30c0 4 -2 10 -3 14l-53 153h-247l-46 -131c-1 -2 -2 -12 -2 -15c0 -26 25 -51 75 -51v-31l-115 3l-102 -3v31c54 1 94 16 112 67l207 598c5 14 8 20 24 20s18 -7 23 -20l216 -625c11 -33 25 -40 85 -40h18v-31z M458 259l-113 325l-112 -325h225zM525 918c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM428 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EB7: [690,200,500,32,483,'483 89c0 -81 -61 -95 -82 -95c-47 0 -74 42 -78 82c-19 -47 -65 -87 -131 -87c-63 0 -160 25 -160 106c0 44 25 96 100 130c63 30 133 33 184 36v37c0 89 -57 128 -106 128c-32 0 -81 -11 -108 -46c46 -1 51 -34 51 -46c0 -26 -18 -46 -46 -46c-26 0 -46 17 -46 47 c0 66 69 113 151 113c48 0 98 -16 137 -55c36 -37 36 -76 36 -118v-200c0 -5 4 -50 37 -50c11 0 36 6 36 64v56h25v-56zM316 140v100c-165 -6 -207 -89 -207 -144c0 -50 41 -85 90 -85c45 0 117 34 117 129zM400 690c-2 -105 -72 -172 -150 -172c-74 0 -147 64 -149 172h22 c2 -85 65 -134 128 -134c59 0 125 47 127 134h22zM303 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EB8: [680,200,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM393 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EB9: [448,200,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM275 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EBA: [967,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM437 900c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30 c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EBB: [709,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM319 642c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18 c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EBC: [829,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM507 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EBD: [651,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM389 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EBE: [1052,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM443 1010c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EBF: [832,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM373 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM325 790c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EC0: [1052,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM443 910l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EC1: [832,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM373 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM325 690l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EC2: [1078,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM534 1011c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13 c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EC3: [858,11,444,28,416,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM373 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM416 791c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35 c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EC4: [1002,0,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM507 987c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EC5: [782,11,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM373 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM389 767c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23 c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EC6: [869,200,681,33,652,'652 258l-42 -258h-577v31h24c77 0 79 11 79 47v524c0 36 -2 47 -79 47h-24v31h563l28 -225h-25c-16 139 -43 194 -196 194h-129c-47 0 -49 -7 -49 -40v-240h90c97 0 108 31 108 117h25v-265h-25c0 85 -11 117 -108 117h-90v-267c0 -33 2 -40 49 -40h133 c172 0 195 73 220 227h25zM491 752l-12 -16l-140 66l-140 -66l-10 16l151 117zM393 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EC7: [692,200,444,28,415,'415 119c0 -19 -45 -130 -167 -130c-115 0 -220 97 -220 231c0 125 92 228 208 228c125 0 179 -97 179 -196c0 -21 -3 -21 -25 -21h-279c0 -36 0 -102 30 -150c23 -37 63 -67 113 -67c10 0 100 0 135 103c2 8 4 14 13 14c5 0 13 -2 13 -12zM349 252 c0 39 -10 174 -113 174c-34 0 -118 -25 -124 -174h237zM374 530l-13 -14l-139 108l-139 -108l-13 14l152 162zM275 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EC8: [967,0,361,28,333,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM278 900c0 -19 -12 -35 -30 -43 c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66 c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EC9: [709,0,278,33,247,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM236 642c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27 c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1ECA: [683,200,361,28,333,'333 0c-35 3 -114 3 -153 3c-38 0 -117 0 -152 -3v31h26c79 0 82 11 82 47v527c0 36 -3 47 -82 47h-26v31c35 -3 114 -3 153 -3c38 0 117 0 152 3v-31h-26c-79 0 -82 -11 -82 -47v-527c0 -36 3 -47 82 -47h26v-31zM234 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53 c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1ECB: [657,200,278,33,247,'247 0c-34 1 -69 3 -104 3l-110 -3v31c67 0 78 0 78 45v269c0 49 -9 55 -74 55v31l140 11v-367c0 -39 4 -44 70 -44v-31zM192 604c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53zM192 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53 c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1ECC: [705,200,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM442 -147c0 -25 -20 -53 -54 -53 c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1ECD: [448,200,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM303 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1ECE: [967,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM486 900c0 -19 -12 -35 -30 -43 c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66 c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1ECF: [709,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM347 642c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30 c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1ED0: [1052,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM540 752l-12 -16l-140 66l-140 -66l-10 16 l151 117zM492 1010c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1ED1: [832,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM353 790c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1ED2: [1052,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM540 752l-12 -16l-140 66l-140 -66l-10 16 l151 117zM492 910l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1ED3: [832,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM353 690l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1ED4: [1078,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM540 752l-12 -16l-140 66l-140 -66l-10 16 l151 117zM583 1011c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29 c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1ED5: [858,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM444 791c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35 c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1ED6: [1002,22,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM540 752l-12 -16l-140 66l-140 -66l-10 16 l151 117zM556 987c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1ED7: [782,11,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM401 532l-12 -16l-140 66l-140 -66l-10 16l151 117zM417 767c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25 c44 0 82 48 82 48'],
0x1ED8: [869,200,778,56,721,'721 339c0 -202 -151 -361 -333 -361c-178 0 -332 156 -332 361c0 206 153 366 332 366c182 0 333 -162 333 -366zM618 353c0 256 -143 327 -230 327c-83 0 -229 -68 -229 -327c0 -261 134 -349 230 -349c92 0 229 84 229 349zM540 752l-12 -16l-140 66l-140 -66l-10 16 l151 117zM442 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1ED9: [692,200,500,28,471,'471 214c0 -127 -101 -225 -222 -225c-117 0 -221 96 -221 225c0 125 97 234 222 234c121 0 221 -106 221 -234zM388 222c0 38 0 96 -26 139s-69 65 -113 65c-40 0 -87 -21 -114 -67c-24 -44 -24 -98 -24 -137c0 -36 0 -97 25 -141c27 -46 71 -67 114 -67 c50 0 94 29 116 74c22 44 22 98 22 134zM402 530l-13 -14l-139 108l-139 -108l-13 14l152 162zM303 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EDA: [909,22,778,55,720,'720 339c0 -95 -33 -186 -97 -255c-61 -66 -146 -106 -235 -106c-90 0 -174 40 -235 106c-64 69 -98 160 -98 255s34 188 98 259c60 67 145 107 235 107c67 0 132 -23 186 -62c23 5 42 21 53 42c-4 -1 -8 -2 -13 -2c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -30 53 -63 c0 -48 -28 -91 -69 -103c8 -8 17 -16 25 -25c64 -71 97 -164 97 -259zM617 355c0 82 -14 165 -61 231c-39 56 -100 94 -168 94s-129 -38 -169 -94c-47 -66 -61 -149 -61 -231c0 -87 13 -177 61 -250c39 -58 99 -101 169 -101c69 0 130 43 168 101c48 73 61 163 61 250z M498 867c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EDB: [698,11,500,28,488,'488 473c0 -50 -30 -95 -74 -104c37 -44 56 -99 56 -157c0 -59 -23 -116 -65 -158c-41 -41 -97 -65 -156 -65s-115 24 -157 65c-41 42 -64 99 -64 158c0 62 22 122 64 166c41 44 98 69 157 69c54 0 106 -21 145 -57c24 5 44 21 55 42c-4 -1 -9 -2 -13 -2 c-36 0 -53 27 -53 53c0 27 17 53 53 53c31 0 52 -30 52 -63zM387 224c0 50 -2 103 -31 144c-24 36 -64 57 -107 57s-83 -21 -107 -57c-29 -41 -31 -94 -31 -144c0 -53 1 -108 31 -152c23 -36 64 -58 107 -58s84 22 107 58c29 44 31 99 31 152zM346 662c0 -12 -8 -23 -17 -30 l-152 -122l-17 18l120 153c4 6 15 17 30 17c18 0 36 -18 36 -36'],
0x1EDC: [909,22,778,55,720,'720 339c0 -95 -33 -186 -97 -255c-61 -66 -146 -106 -235 -106c-90 0 -174 40 -235 106c-64 69 -98 160 -98 255s34 188 98 259c60 67 145 107 235 107c67 0 132 -23 186 -62c23 5 42 21 53 42c-4 -1 -8 -2 -13 -2c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -30 53 -63 c0 -48 -28 -91 -69 -103c8 -8 17 -16 25 -25c64 -71 97 -164 97 -259zM617 355c0 82 -14 165 -61 231c-39 56 -100 94 -168 94s-129 -38 -169 -94c-47 -66 -61 -149 -61 -231c0 -87 13 -177 61 -250c39 -58 99 -101 169 -101c69 0 130 43 168 101c48 73 61 163 61 250z M458 767l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EDD: [698,11,500,28,488,'488 473c0 -50 -30 -95 -74 -104c37 -44 56 -99 56 -157c0 -59 -23 -116 -65 -158c-41 -41 -97 -65 -156 -65s-115 24 -157 65c-41 42 -64 99 -64 158c0 62 22 122 64 166c41 44 98 69 157 69c54 0 106 -21 145 -57c24 5 44 21 55 42c-4 -1 -9 -2 -13 -2 c-36 0 -53 27 -53 53c0 27 17 53 53 53c31 0 52 -30 52 -63zM387 224c0 50 -2 103 -31 144c-24 36 -64 57 -107 57s-83 -21 -107 -57c-29 -41 -31 -94 -31 -144c0 -53 1 -108 31 -152c23 -36 64 -58 107 -58s84 22 107 58c29 44 31 99 31 152zM312 528l-17 -18l-152 122 c-9 7 -17 18 -17 30c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0x1EDE: [967,22,778,55,720,'720 339c0 -95 -33 -186 -97 -255c-61 -66 -146 -106 -235 -106c-90 0 -174 40 -235 106c-64 69 -98 160 -98 255s34 188 98 259c60 67 145 107 235 107c67 0 132 -23 186 -62c23 5 42 21 53 42c-4 -1 -8 -2 -13 -2c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -30 53 -63 c0 -48 -28 -91 -69 -103c8 -8 17 -16 25 -25c64 -71 97 -164 97 -259zM617 355c0 82 -14 165 -61 231c-39 56 -100 94 -168 94s-129 -38 -169 -94c-47 -66 -61 -149 -61 -231c0 -87 13 -177 61 -250c39 -58 99 -101 169 -101c69 0 130 43 168 101c48 73 61 163 61 250z M486 900c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30 c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EDF: [709,11,500,28,488,'488 473c0 -50 -30 -95 -74 -104c37 -44 56 -99 56 -157c0 -59 -23 -116 -65 -158c-41 -41 -97 -65 -156 -65s-115 24 -157 65c-41 42 -64 99 -64 158c0 62 22 122 64 166c41 44 98 69 157 69c54 0 106 -21 145 -57c24 5 44 21 55 42c-4 -1 -9 -2 -13 -2 c-36 0 -53 27 -53 53c0 27 17 53 53 53c31 0 52 -30 52 -63zM387 224c0 50 -2 103 -31 144c-24 36 -64 57 -107 57s-83 -21 -107 -57c-29 -41 -31 -94 -31 -144c0 -53 1 -108 31 -152c23 -36 64 -58 107 -58s84 22 107 58c29 44 31 99 31 152zM347 642 c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30 c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EE0: [829,22,778,55,720,'720 339c0 -95 -33 -186 -97 -255c-61 -66 -146 -106 -235 -106c-90 0 -174 40 -235 106c-64 69 -98 160 -98 255s34 188 98 259c60 67 145 107 235 107c67 0 132 -23 186 -62c23 5 42 21 53 42c-4 -1 -8 -2 -13 -2c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -30 53 -63 c0 -48 -28 -91 -69 -103c8 -8 17 -16 25 -25c64 -71 97 -164 97 -259zM617 355c0 82 -14 165 -61 231c-39 56 -100 94 -168 94s-129 -38 -169 -94c-47 -66 -61 -149 -61 -231c0 -87 13 -177 61 -250c39 -58 99 -101 169 -101c69 0 130 43 168 101c48 73 61 163 61 250z M556 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EE1: [651,11,500,28,488,'488 473c0 -50 -30 -95 -74 -104c37 -44 56 -99 56 -157c0 -59 -23 -116 -65 -158c-41 -41 -97 -65 -156 -65s-115 24 -157 65c-41 42 -64 99 -64 158c0 62 22 122 64 166c41 44 98 69 157 69c54 0 106 -21 145 -57c24 5 44 21 55 42c-4 -1 -9 -2 -13 -2 c-36 0 -53 27 -53 53c0 27 17 53 53 53c31 0 52 -30 52 -63zM387 224c0 50 -2 103 -31 144c-24 36 -64 57 -107 57s-83 -21 -107 -57c-29 -41 -31 -94 -31 -144c0 -53 1 -108 31 -152c23 -36 64 -58 107 -58s84 22 107 58c29 44 31 99 31 152zM417 636 c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EE2: [789,200,778,55,720,'720 339c0 -95 -33 -186 -97 -255c-61 -66 -146 -106 -235 -106c-90 0 -174 40 -235 106c-64 69 -98 160 -98 255s34 188 98 259c60 67 145 107 235 107c67 0 132 -23 186 -62c23 5 42 21 53 42c-4 -1 -8 -2 -13 -2c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -30 53 -63 c0 -48 -28 -91 -69 -103c8 -8 17 -16 25 -25c64 -71 97 -164 97 -259zM617 355c0 82 -14 165 -61 231c-39 56 -100 94 -168 94s-129 -38 -169 -94c-47 -66 -61 -149 -61 -231c0 -87 13 -177 61 -250c39 -58 99 -101 169 -101c69 0 130 43 168 101c48 73 61 163 61 250z M442 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EE3: [536,200,500,28,488,'488 473c0 -50 -30 -95 -74 -104c37 -44 56 -99 56 -157c0 -59 -23 -116 -65 -158c-41 -41 -97 -65 -156 -65s-115 24 -157 65c-41 42 -64 99 -64 158c0 62 22 122 64 166c41 44 98 69 157 69c54 0 106 -21 145 -57c24 5 44 21 55 42c-4 -1 -9 -2 -13 -2 c-36 0 -53 27 -53 53c0 27 17 53 53 53c31 0 52 -30 52 -63zM387 224c0 50 -2 103 -31 144c-24 36 -64 57 -107 57s-83 -21 -107 -57c-29 -41 -31 -94 -31 -144c0 -53 1 -108 31 -152c23 -36 64 -58 107 -58s84 22 107 58c29 44 31 99 31 152zM303 -147 c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EE4: [683,200,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM451 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EE5: [442,200,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM331 -147c0 -25 -20 -53 -54 -53 c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EE6: [967,22,750,33,716,'716 652c-103 0 -103 -45 -103 -78v-320c0 -40 0 -49 -3 -69c-17 -114 -107 -207 -222 -207c-136 0 -252 109 -252 250v377c0 36 -2 47 -79 47h-24v31c35 -3 110 -3 148 -3s112 0 147 3v-31h-24c-77 0 -79 -11 -79 -47v-381c0 -190 118 -215 165 -215 c95 0 192 80 192 222v347c0 27 0 74 -103 74v31l119 -3l118 3v-31zM495 900c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18 c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EE7: [709,11,556,32,535,'535 0l-144 -11v90c-29 -62 -73 -90 -129 -90c-152 0 -152 91 -152 169v150c0 89 0 92 -78 92v31l147 11v-332c0 -52 4 -99 88 -99c73 0 121 68 121 155v178c0 49 -8 56 -78 56v31l147 11v-355c0 -49 8 -56 78 -56v-31zM375 642c0 -19 -12 -35 -30 -43 c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66 c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EE8: [909,22,750,33,726,'726 725c0 -62 -52 -108 -114 -115v-382c0 -66 -22 -129 -65 -177c-41 -46 -98 -73 -159 -73c-66 0 -131 26 -178 73c-48 47 -74 110 -74 177v389c0 12 -6 25 -17 30c-18 6 -57 6 -86 6v30l147 -3l147 3v-30c-29 0 -68 0 -85 -6c-12 -5 -18 -18 -18 -30v-389 c0 -65 11 -117 42 -158c29 -38 75 -62 122 -62c53 0 102 23 138 63c37 42 56 98 56 157v361c0 19 -10 37 -26 48c-23 14 -50 16 -77 16v30l118 -3c5 0 10 1 15 3v-48c34 5 64 23 79 51c-5 -2 -11 -3 -18 -3c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -31 53 -64zM507 867 c-2 -12 -11 -22 -22 -27l-170 -94l-14 21l145 130c4 4 14 12 26 12c22 0 39 -20 35 -42'],
0x1EE9: [698,11,556,32,571,'571 471c0 -60 -53 -101 -116 -111v-274c0 -17 0 -37 13 -46s42 -9 65 -9v-31l-144 -11v89c-23 -52 -67 -89 -123 -89c-48 0 -87 7 -118 32c-27 23 -39 60 -39 100v223c0 18 0 37 -13 47c-13 9 -42 9 -64 9v30l147 12v-321c0 -44 2 -69 15 -85c15 -18 41 -25 74 -25 c67 0 117 66 118 147v191c0 16 -1 33 -13 42c-13 9 -42 9 -65 9v30l147 12v-53c32 6 59 20 75 42c-4 0 -8 -1 -12 -1c-35 0 -53 27 -53 53c0 27 18 53 53 53c32 0 53 -31 53 -65zM379 662c0 -12 -8 -23 -17 -30l-152 -122l-17 18l120 153c4 6 15 17 30 17 c18 0 36 -18 36 -36'],
0x1EEA: [909,22,750,33,726,'726 725c0 -62 -52 -108 -114 -115v-382c0 -66 -22 -129 -65 -177c-41 -46 -98 -73 -159 -73c-66 0 -131 26 -178 73c-48 47 -74 110 -74 177v389c0 12 -6 25 -17 30c-18 6 -57 6 -86 6v30l147 -3l147 3v-30c-29 0 -68 0 -85 -6c-12 -5 -18 -18 -18 -30v-389 c0 -65 11 -117 42 -158c29 -38 75 -62 122 -62c53 0 102 23 138 63c37 42 56 98 56 157v361c0 19 -10 37 -26 48c-23 14 -50 16 -77 16v30l118 -3c5 0 10 1 15 3v-48c34 5 64 23 79 51c-5 -2 -11 -3 -18 -3c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -31 53 -64zM467 767 l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EEB: [698,11,556,32,571,'571 471c0 -60 -53 -101 -116 -111v-274c0 -17 0 -37 13 -46s42 -9 65 -9v-31l-144 -11v89c-23 -52 -67 -89 -123 -89c-48 0 -87 7 -118 32c-27 23 -39 60 -39 100v223c0 18 0 37 -13 47c-13 9 -42 9 -64 9v30l147 12v-321c0 -44 2 -69 15 -85c15 -18 41 -25 74 -25 c67 0 117 66 118 147v191c0 16 -1 33 -13 42c-13 9 -42 9 -65 9v30l147 12v-53c32 6 59 20 75 42c-4 0 -8 -1 -12 -1c-35 0 -53 27 -53 53c0 27 18 53 53 53c32 0 53 -31 53 -65zM345 528l-17 -18l-152 122c-9 7 -17 18 -17 30c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0x1EEC: [967,22,750,33,726,'726 725c0 -62 -52 -108 -114 -115v-382c0 -66 -22 -129 -65 -177c-41 -46 -98 -73 -159 -73c-66 0 -131 26 -178 73c-48 47 -74 110 -74 177v389c0 12 -6 25 -17 30c-18 6 -57 6 -86 6v30l147 -3l147 3v-30c-29 0 -68 0 -85 -6c-12 -5 -18 -18 -18 -30v-389 c0 -65 11 -117 42 -158c29 -38 75 -62 122 -62c53 0 102 23 138 63c37 42 56 98 56 157v361c0 19 -10 37 -26 48c-23 14 -50 16 -77 16v30l118 -3c5 0 10 1 15 3v-48c34 5 64 23 79 51c-5 -2 -11 -3 -18 -3c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -31 53 -64zM495 900 c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30 c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EED: [709,11,556,32,571,'571 471c0 -60 -53 -101 -116 -111v-274c0 -17 0 -37 13 -46s42 -9 65 -9v-31l-144 -11v89c-23 -52 -67 -89 -123 -89c-48 0 -87 7 -118 32c-27 23 -39 60 -39 100v223c0 18 0 37 -13 47c-13 9 -42 9 -64 9v30l147 12v-321c0 -44 2 -69 15 -85c15 -18 41 -25 74 -25 c67 0 117 66 118 147v191c0 16 -1 33 -13 42c-13 9 -42 9 -65 9v30l147 12v-53c32 6 59 20 75 42c-4 0 -8 -1 -12 -1c-35 0 -53 27 -53 53c0 27 18 53 53 53c32 0 53 -31 53 -65zM380 642c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10 c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EEE: [829,22,750,33,726,'726 725c0 -62 -52 -108 -114 -115v-382c0 -66 -22 -129 -65 -177c-41 -46 -98 -73 -159 -73c-66 0 -131 26 -178 73c-48 47 -74 110 -74 177v389c0 12 -6 25 -17 30c-18 6 -57 6 -86 6v30l147 -3l147 3v-30c-29 0 -68 0 -85 -6c-12 -5 -18 -18 -18 -30v-389 c0 -65 11 -117 42 -158c29 -38 75 -62 122 -62c53 0 102 23 138 63c37 42 56 98 56 157v361c0 19 -10 37 -26 48c-23 14 -50 16 -77 16v30l118 -3c5 0 10 1 15 3v-48c34 5 64 23 79 51c-5 -2 -11 -3 -18 -3c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -31 53 -64zM565 814 c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EEF: [651,11,556,32,571,'571 471c0 -60 -53 -101 -116 -111v-274c0 -17 0 -37 13 -46s42 -9 65 -9v-31l-144 -11v89c-23 -52 -67 -89 -123 -89c-48 0 -87 7 -118 32c-27 23 -39 60 -39 100v223c0 18 0 37 -13 47c-13 9 -42 9 -64 9v30l147 12v-321c0 -44 2 -69 15 -85c15 -18 41 -25 74 -25 c67 0 117 66 118 147v191c0 16 -1 33 -13 42c-13 9 -42 9 -65 9v30l147 12v-53c32 6 59 20 75 42c-4 0 -8 -1 -12 -1c-35 0 -53 27 -53 53c0 27 18 53 53 53c32 0 53 -31 53 -65zM450 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25 c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EF0: [789,200,750,33,726,'726 725c0 -62 -52 -108 -114 -115v-382c0 -66 -22 -129 -65 -177c-41 -46 -98 -73 -159 -73c-66 0 -131 26 -178 73c-48 47 -74 110 -74 177v389c0 12 -6 25 -17 30c-18 6 -57 6 -86 6v30l147 -3l147 3v-30c-29 0 -68 0 -85 -6c-12 -5 -18 -18 -18 -30v-389 c0 -65 11 -117 42 -158c29 -38 75 -62 122 -62c53 0 102 23 138 63c37 42 56 98 56 157v361c0 19 -10 37 -26 48c-23 14 -50 16 -77 16v30l118 -3c5 0 10 1 15 3v-48c34 5 64 23 79 51c-5 -2 -11 -3 -18 -3c-35 0 -53 27 -53 53s18 53 53 53c31 0 53 -31 53 -64zM428 -147 c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EF1: [536,200,556,32,571,'571 471c0 -60 -53 -101 -116 -111v-274c0 -17 0 -37 13 -46s42 -9 65 -9v-31l-144 -11v89c-23 -52 -67 -89 -123 -89c-48 0 -87 7 -118 32c-27 23 -39 60 -39 100v223c0 18 0 37 -13 47c-13 9 -42 9 -64 9v30l147 12v-321c0 -44 2 -69 15 -85c15 -18 41 -25 74 -25 c67 0 117 66 118 147v191c0 16 -1 33 -13 42c-13 9 -42 9 -65 9v30l147 12v-53c32 6 59 20 75 42c-4 0 -8 -1 -12 -1c-35 0 -53 27 -53 53c0 27 18 53 53 53c32 0 53 -31 53 -65zM331 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EF2: [909,0,750,11,738,'738 652c-32 0 -91 -4 -128 -65l-193 -314v-193c0 -39 3 -49 80 -49h23v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v195l-210 342c-16 26 -24 37 -92 37h-18v31l130 -3c39 0 112 0 148 3v-31c-45 0 -70 -4 -70 -25c0 -5 0 -7 7 -17l181 -295 l165 268c4 6 10 19 10 30c0 20 -16 39 -57 39v31l115 -3c27 0 67 1 98 3v-31zM444 767l-14 -21l-170 94c-11 5 -20 15 -22 27c-4 22 13 42 35 42c12 0 22 -8 26 -12'],
0x1EF3: [698,205,528,19,508,'508 400c-16 0 -67 -1 -93 -64l-176 -427c-24 -57 -65 -114 -128 -114c-50 0 -92 36 -92 81c0 30 22 43 42 43c23 0 42 -16 42 -42c0 -16 -8 -38 -39 -42c19 -18 42 -18 47 -18c64 0 92 69 114 124l25 59l-150 365c-14 35 -33 35 -81 35v31c30 -2 70 -3 97 -3l109 3v-31 c-19 0 -56 0 -56 -26c0 -4 2 -8 6 -18l111 -269l101 246c5 12 6 14 6 24c0 25 -16 42 -47 43v31l87 -3c23 0 52 1 75 3v-31zM326 528l-17 -18l-152 122c-9 7 -17 18 -17 30c0 18 18 36 36 36c15 0 26 -11 30 -17'],
0x1EF4: [683,200,750,11,738,'738 652c-32 0 -91 -4 -128 -65l-193 -314v-193c0 -39 3 -49 80 -49h23v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v195l-210 342c-16 26 -24 37 -92 37h-18v31l130 -3c39 0 112 0 148 3v-31c-45 0 -70 -4 -70 -25c0 -5 0 -7 7 -17l181 -295 l165 268c4 6 10 19 10 30c0 20 -16 39 -57 39v31l115 -3c27 0 67 1 98 3v-31zM428 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EF5: [431,205,528,19,508,'508 400c-16 0 -67 -1 -93 -64l-176 -427c-24 -57 -65 -114 -128 -114c-50 0 -92 36 -92 81c0 30 22 43 42 43c23 0 42 -16 42 -42c0 -16 -8 -38 -39 -42c19 -18 42 -18 47 -18c64 0 92 69 114 124l25 59l-150 365c-14 35 -33 35 -81 35v31c30 -2 70 -3 97 -3l109 3v-31 c-19 0 -56 0 -56 -26c0 -4 2 -8 6 -18l111 -269l101 246c5 12 6 14 6 24c0 25 -16 42 -47 43v31l87 -3c23 0 52 1 75 3v-31zM449 -147c0 -25 -20 -53 -54 -53c-30 0 -53 26 -53 53c0 25 20 53 54 53c30 0 53 -26 53 -53'],
0x1EF6: [967,0,750,11,738,'738 652c-32 0 -91 -4 -128 -65l-193 -314v-193c0 -39 3 -49 80 -49h23v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v195l-210 342c-16 26 -24 37 -92 37h-18v31l130 -3c39 0 112 0 148 3v-31c-45 0 -70 -4 -70 -25c0 -5 0 -7 7 -17l181 -295 l165 268c4 6 10 19 10 30c0 20 -16 39 -57 39v31l115 -3c27 0 67 1 98 3v-31zM472 900c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27c0 19 -1 29 -8 35c-11 10 -27 13 -42 13 c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EF7: [709,205,528,19,508,'508 400c-16 0 -67 -1 -93 -64l-176 -427c-24 -57 -65 -114 -128 -114c-50 0 -92 36 -92 81c0 30 22 43 42 43c23 0 42 -16 42 -42c0 -16 -8 -38 -39 -42c19 -18 42 -18 47 -18c64 0 92 69 114 124l25 59l-150 365c-14 35 -33 35 -81 35v31c30 -2 70 -3 97 -3l109 3v-31 c-19 0 -56 0 -56 -26c0 -4 2 -8 6 -18l111 -269l101 246c5 12 6 14 6 24c0 25 -16 42 -47 43v31l87 -3c23 0 52 1 75 3v-31zM361 642c0 -19 -12 -35 -30 -43c-40 -20 -64 -42 -64 -70v-19c0 -6 -4 -10 -10 -10c-5 0 -10 4 -10 10v19c0 33 20 63 48 86c8 6 12 16 12 27 c0 19 -1 29 -8 35c-11 10 -27 13 -42 13c-23 0 -43 -7 -56 -18c14 -2 25 -13 25 -30c0 -18 -14 -29 -29 -29c-16 0 -30 11 -30 30c0 41 43 66 90 66c29 0 54 -4 75 -16c18 -11 29 -30 29 -51'],
0x1EF8: [829,0,750,11,738,'738 652c-32 0 -91 -4 -128 -65l-193 -314v-193c0 -39 3 -49 80 -49h23v-31c-36 3 -107 3 -146 3s-110 0 -146 -3v31h24c77 0 79 11 79 47v195l-210 342c-16 26 -24 37 -92 37h-18v31l130 -3c39 0 112 0 148 3v-31c-45 0 -70 -4 -70 -25c0 -5 0 -7 7 -17l181 -295 l165 268c4 6 10 19 10 30c0 20 -16 39 -57 39v31l115 -3c27 0 67 1 98 3v-31zM542 814c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0x1EF9: [651,205,528,19,508,'508 400c-16 0 -67 -1 -93 -64l-176 -427c-24 -57 -65 -114 -128 -114c-50 0 -92 36 -92 81c0 30 22 43 42 43c23 0 42 -16 42 -42c0 -16 -8 -38 -39 -42c19 -18 42 -18 47 -18c64 0 92 69 114 124l25 59l-150 365c-14 35 -33 35 -81 35v31c30 -2 70 -3 97 -3l109 3v-31 c-19 0 -56 0 -56 -26c0 -4 2 -8 6 -18l111 -269l101 246c5 12 6 14 6 24c0 25 -16 42 -47 43v31l87 -3c23 0 52 1 75 3v-31zM431 636c-51 -56 -70 -78 -108 -78c-17 0 -35 7 -62 23c-17 10 -42 25 -65 25c-44 0 -82 -48 -82 -48l-16 15c51 56 70 78 108 78 c17 0 35 -7 62 -23c17 -10 42 -25 65 -25c44 0 82 48 82 48'],
0xFB00: [705,0,583,27,628,'628 635c0 -24 -15 -44 -44 -44c-27 0 -43 20 -43 43c0 25 18 38 30 42c-15 7 -30 7 -33 7c-45 0 -93 -47 -93 -136v-116h118v-31h-115v-322c0 -36 2 -47 76 -47h21v-31c-40 3 -87 3 -127 3l-114 -3v31c67 0 78 0 78 45v324h-210v-324c0 -45 11 -45 78 -45v-31l-111 3 l-111 -3v31c67 0 78 0 78 45v324h-79v31h79v114c0 108 116 160 211 160c27 0 83 -5 112 -42c5 4 49 42 108 42c56 0 91 -34 91 -70zM393 664c0 0 -28 19 -77 19c-65 0 -147 -42 -147 -139v-113h213v115c0 12 0 21 3 34c-27 9 -28 34 -28 40c0 28 20 41 36 44'],
0xFB01: [705,0,556,27,527,'527 0l-111 3l-111 -3v31c67 0 78 0 78 45v270c0 41 -7 54 -53 54h-158v-324c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v324h-79v31h79v114c0 109 119 160 212 160c74 0 129 -42 129 -101c0 -30 -23 -46 -46 -46c-19 0 -45 13 -45 46c0 16 6 44 47 46 c-20 23 -56 33 -86 33c-62 0 -148 -40 -148 -139v-113h118c14 0 16 0 18 1c0 0 2 1 18 2l126 9v-367c0 -45 11 -45 78 -45v-31'],
0xFB02: [705,0,556,27,527,'527 0l-111 3l-111 -3v31c67 0 78 0 78 45v324h-211v-324c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v324h-79v31h79v114c0 104 109 160 214 160c11 0 52 0 84 -14c4 -2 5 -3 9 -3l36 6v-618c0 -45 11 -45 78 -45v-31zM383 431v164c-17 6 -25 21 -25 39 c0 26 16 36 25 40c-28 9 -55 9 -64 9c-74 0 -150 -46 -150 -139v-113h214'],
0xFB03: [705,0,833,27,804,'804 0l-111 3l-111 -3v31c67 0 78 0 78 45v270c0 41 -7 54 -53 54h-158v-324c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v324h-211v-324c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v324h-79v31h79v114c0 109 117 160 211 160 c50 0 92 -20 115 -55c18 15 75 55 163 55c74 0 129 -42 129 -101c0 -30 -23 -46 -46 -46c-19 0 -45 13 -45 46c0 16 6 44 47 46c-20 23 -56 33 -86 33c-62 0 -148 -40 -148 -139v-113h118c14 0 16 0 18 1l105 8l39 3v-367c0 -45 11 -45 78 -45v-31zM401 650 c-27 28 -62 33 -86 33c-59 0 -146 -39 -146 -139v-113h214v130c-18 5 -30 21 -30 43c0 20 9 44 48 46'],
0xFB04: [705,0,833,27,804,'804 0l-111 3l-111 -3v31c67 0 78 0 78 45v324h-211v-324c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v324h-211v-324c0 -45 11 -45 78 -45v-31l-111 3l-111 -3v31c67 0 78 0 78 45v324h-79v31h79v114c0 107 114 160 212 160c41 0 97 -11 118 -52 c37 30 91 52 161 52c11 0 52 0 84 -14c4 -2 5 -3 9 -3l36 6v-618c0 -45 11 -45 78 -45v-31zM394 664c-26 16 -60 19 -77 19c-67 0 -148 -42 -148 -139v-113h214v114c0 11 0 24 3 35c-22 8 -28 25 -28 40c0 33 26 42 36 44zM660 431v164c-17 6 -25 21 -25 39 c0 26 16 36 25 40c-28 9 -55 9 -64 9c-74 0 -150 -46 -150 -139v-113h214']
};
MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Latin/Regular/Main.js");
|
describe('zoom left animation', function() {
var prefixes = {
'-webkit-transform': true,
'-moz-transform': true,
'-o-transform': true,
'transform': true
};
var transform;
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
beforeEach(module('fx.animations'));
it("should zoom-left in", function(done) {
inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) {
var element = $compile('<div class="fx-zoom-left">zoom-left</div>')($rootScope);
$rootElement.append(element);
angular.element($document[0].body).append($rootElement);
$rootScope.$digest();
$animate.enabled(true);
$animate.enter(element, $rootElement);
$rootScope.$digest();
$timeout.flush();
$window.setTimeout(function(){
angular.forEach(prefixes, function(bool, prefix){
if(element.css(prefix)){
transform = prefix;
}
});
expect(element.css('opacity')).to.be('1');
expect(element.css(transform)).to.be('matrix(1, 0, 0, 1, 0, 0)');
done();
},500);
});
});
it('should zoom-left out', function(done){
inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) {
var element = $compile('<div class="fx-zoom-left">zoom-left</div>')($rootScope);
$rootElement.append(element);
angular.element($document[0].body).append($rootElement);
$rootScope.$digest();
$animate.enabled(true);
$animate.leave(element);
$rootScope.$digest();
$timeout.flush();
$window.setTimeout(function(){
expect(element.css('opacity')).to.be('0');
done();
},500);
});
});
it('should zoom-left move', function(done){
inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) {
var element = $compile('<div class="fx-zoom-left">zoom-left</div>')($rootScope);
$rootElement.append(element);
angular.element($document[0].body).append($rootElement);
$rootScope.$digest();
$animate.enabled(true);
$animate.move(element, $rootElement);
$rootScope.$digest();
$timeout.flush();
$window.setTimeout(function(){
angular.forEach(prefixes, function(bool, prefix){
if(element.css(prefix)){
transform = prefix;
}
});
expect(element.css('opacity')).to.be('1');
expect(element.css(transform)).to.be('matrix(1, 0, 0, 1, 0, 0)');
done();
},500);
});
});
xit('should zoom-left removeClass', function(done){
inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) {
var element = $compile('<div class="fx-zoom-left ng-hide">zoom-left</div>')($rootScope);
$rootElement.append(element);
angular.element($document[0].body).append($rootElement);
$rootScope.$digest();
$animate.enabled(true);
$animate.removeClass(element, 'ng-hide');
$rootScope.$digest();
$window.setTimeout(function(){
angular.forEach(prefixes, function(bool, prefix){
if(element.css(prefix)){
transform = prefix;
}
});
expect(element.css('opacity')).to.be('1');
expect(element.css(transform)).to.be('matrix(1, 0, 0, 1, 0, 0)');
done();
},500);
});
});
xit('should zoom-left addClass', function(done){
inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) {
var element = $compile('<div class="fx-zoom-left">zoom-left</div>')($rootScope);
$rootElement.append(element);
angular.element($document[0].body).append($rootElement);
$rootScope.$digest();
$animate.enabled(true);
$animate.addClass(element, 'ng-hide');
$rootScope.$digest();
$window.setTimeout(function(){
expect(element.css('opacity')).to.be('0');
done();
},500);
});
});
});
|
const configPath = '_CFG_PATH_'; // root category is application 'index.html' destination
const xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', configPath, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if(xmlhttp.status == 200) {
const config = JSON.parse(xmlhttp.responseText);
const versionKey = config.versionKey;
const currentVer = JSON.parse(localStorage.getItem(versionKey));
if (currentVer != config.version) {
validateStorageType(config.storages);
config.storages.forEach(function(storage){
if (storage.isActive) {
const type = storage.type;
const removed = storage.remove;
const excluded = storage.exclude;
/* Validate storage */
validateCollectionTypes(removed, excluded);
validateKeysCollections(removed, excluded);
/* Removing & excluding */
if (removed.length) {
deleteSpecificStorageItems(type, removed);
} else if (excluded.length) {
deleteSpecificStorageItems(type, excluded, true);
} else {
clearStorageByKey(type);
}
}
});
/* Set a new build version and reload page. */
localStorage.setItem(versionKey, JSON.stringify(config.version));
location.reload(true);
} else {
console.info('You have an actual build:', currentVer);
}
} else {
throw new Error('Can\'t read app-version-manager configuration. Reason: file not found.');
}
}
};
xmlhttp.send(null);
/* Internal data */
const storage = {
'local': 'localStorage',
'session': 'sessionStorage',
'cookie': 'cookie'
};
const supportedStorages = ["localStorage", "sessionStorage", "cookie"];
const message = {
KEYS_COLLECTION_VALIDATION_ERROR: "Only one collection[] 'remove' or 'exclude' for each storage may be defined.",
KEYS_VALIDATION_ERROR: "Remove keys shouldn't contain any excepted key.",
STORAGE_VALIDATION_ERROR: "Storage[] array should'n be null or empty!"
};
/* Cookie */
function clearCookies() {
var cookies = document.cookie.split(";");
for(var i=0; i < cookies.length; i++) {
var equals = cookies[i].indexOf("=");
var name = equals > -1 ? cookies[i].substr(0, equals) : cookies[i];
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
function getCookies() {
var cookies = {};
if (document.cookie && document.cookie != '') {
var split = document.cookie.split(';');
for (var i = 0; i < split.length; i++) {
var name_value = split[i].split("=");
name_value[0] = name_value[0].replace(/^ /, '');
cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]);
}
}
return cookies;
}
/* Remove methods */
function clearAll(storages) {
storageInList(storages, storage.local) && localStorage.clear();
storageInList(storages, storage.session) && sessionStorage.clear();
storageInList(storages, storage.cookie) && clearCookies();
}
function clearStorageByKey(key) {
switch (key) {
case storage.local:
localStorage.clear();
break;
case storage.session:
sessionStorage.clear();
break;
case storage.cookie:
clearCookies();
break;
}
}
function deleteStorageItemsExceptArray(storages, allKeys, exceptedKeys) {
var keys = allKeys.filter(function(item){
!~exceptedKeys.indexOf(item);
});
deleteSpecificStorageItems(storages, keys);
}
function deleteSpecificStorageItems(type, removed, opposite) {
var cookies = Object.keys(getCookies());
if (type == storage.local) {
Object.keys(localStorage).forEach(function (name) {
if (opposite) {
if (~Object.keys(localStorage).indexOf(name) && !~removed.indexOf(name)) {
localStorage.removeItem(name);
}
} else {
if (~removed.indexOf(name)) {
localStorage.removeItem(name);
}
}
});
}
if (type == storage.session) {
Object.keys(sessionStorage).forEach(function(name) {
if (opposite) {
if (~Object.keys(sessionStorage).indexOf(name) && !~removed.indexOf(name)) {
sessionStorage.removeItem(name);
}
} else {
if (~removed.indexOf(name)) {
sessionStorage.removeItem(name);
}
}
});
}
if (type == storage.cookie) {
cookies.forEach(function(name) {
if (opposite) {
if (~cookies.indexOf(name) && !~removed.indexOf(name)) {
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
} else {
if (~removed.indexOf(name)) {
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
}
});
}
}
/* Validation */
function storageInList(storages, storageKey) {
return !!~storages.indexOf(storageKey) || !storages.length;
}
function validateKeysCollections(removedList, excludedList) {
var isExist = removedList.some(function(item){
return ~excludedList.indexOf(item);
});
if (isExist) {
throw new Error(message.KEYS_VALIDATION_ERROR);
}
}
function validateStorage(storages) {
if (!storages || !storages.length) {
throw new Error(message.STORAGE_VALIDATION_ERROR);
}
}
function validateStorageType(storages) {
storages.forEach(function (storage) {
if (!~supportedStorages.indexOf(storage.type)) {
throw new Error("Incorrect storage type: '" + storage.type +"'. It should be the following: localStorage, sessionStorage, cookie.");
}
});
}
function validateCollectionTypes(removedList, excludedList) {
if (excludedList.length && removedList.length) {
console.warn('See \'https://github.com/asduser/app-version-manager\' for details.');
throw new Error(message.KEYS_COLLECTION_VALIDATION_ERROR);
}
}
|
import { RenderingTestCase, moduleFor, strip, runTask } from 'internal-test-helpers';
import { set } from '@ember/-internals/metal';
moduleFor(
'SVG element tests',
class extends RenderingTestCase {
['@test unquoted viewBox property is output'](assert) {
let viewBoxString = '0 0 100 100';
this.render('<div><svg viewBox={{model.viewBoxString}}></svg></div>', {
model: {
viewBoxString,
},
});
this.assertInnerHTML(strip`
<div>
<svg viewBox="${viewBoxString}"></svg>
</div>
`);
runTask(() => this.rerender());
this.assertInnerHTML(strip`
<div>
<svg viewBox="${viewBoxString}"></svg>
</div>
`);
runTask(() => set(this.context, 'model.viewBoxString', null));
assert.equal(this.firstChild.getAttribute('svg'), null);
runTask(() => set(this.context, 'model', { viewBoxString }));
this.assertInnerHTML(strip`
<div>
<svg viewBox="${viewBoxString}"></svg>
</div>
`);
}
['@test quoted viewBox property is output'](assert) {
let viewBoxString = '0 0 100 100';
this.render('<div><svg viewBox="{{model.viewBoxString}}"></svg></div>', {
model: {
viewBoxString,
},
});
this.assertInnerHTML(strip`
<div>
<svg viewBox="${viewBoxString}"></svg>
</div>
`);
runTask(() => this.rerender());
this.assertInnerHTML(strip`
<div>
<svg viewBox="${viewBoxString}"></svg>
</div>
`);
runTask(() => set(this.context, 'model.viewBoxString', null));
assert.equal(this.firstChild.getAttribute('svg'), null);
runTask(() => set(this.context, 'model', { viewBoxString }));
this.assertInnerHTML(strip`
<div>
<svg viewBox="${viewBoxString}"></svg>
</div>
`);
}
['@test quoted viewBox property is concat']() {
let viewBoxString = '100 100';
this.render('<div><svg viewBox="0 0 {{model.viewBoxString}}"></svg></div>', {
model: {
viewBoxString,
},
});
this.assertInnerHTML(strip`
<div>
<svg viewBox="0 0 ${viewBoxString}"></svg>
</div>
`);
runTask(() => this.rerender());
this.assertInnerHTML(strip`
<div>
<svg viewBox="0 0 ${viewBoxString}"></svg>
</div>
`);
runTask(() => set(this.context, 'model.viewBoxString', '200 200'));
this.assertInnerHTML(strip`
<div>
<svg viewBox="0 0 200 200"></svg>
</div>
`);
runTask(() => set(this.context, 'model', { viewBoxString }));
this.assertInnerHTML(strip`
<div>
<svg viewBox="0 0 ${viewBoxString}"></svg>
</div>
`);
}
['@test class is output']() {
this.render("<div><svg class='{{model.color}} tall'></svg></div>", {
model: {
color: 'blue',
},
});
this.assertInnerHTML(strip`
<div>
<svg class="blue tall"></svg>
</div>
`);
runTask(() => this.rerender());
this.assertInnerHTML(strip`
<div>
<svg class="blue tall"></svg>
</div>
`);
runTask(() => set(this.context, 'model.color', 'yellow'));
this.assertInnerHTML(strip`
<div>
<svg class="yellow tall"></svg>
</div>
`);
runTask(() => set(this.context, 'model', { color: 'blue' }));
this.assertInnerHTML(strip`
<div>
<svg class="blue tall"></svg>
</div>
`);
}
}
);
|
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
'use strict';
angular.module('marketplace-credentials', ['ngStorage'])
.controller('MarketplaceCredentialsController', ['$scope', '$state', '$http', '$localStorage', '$rootScope', '$sce',
function ($scope, $state, $http, $localStorage, $rootScope, $sce) {
$scope.showCredsForm = false;
$scope.user = {
username : $localStorage.marketplaceUsername ? $localStorage.marketplaceUsername : '',
password : '',
submitted : false
};
$scope.upgradeProcessError = false;
$http.get('index.php/select-version/installedSystemPackage', {'responseType' : 'json'})
.success(function (data) {
if (data.responseType == 'error') {
$scope.upgradeProcessError = true;
$scope.upgradeProcessErrorMessage = $sce.trustAsHtml(data.error);
} else {
if (!$rootScope.authRequest || !$rootScope.isMarketplaceAuthorized) {
$scope.isHiddenSpinner = false;
$http.post('index.php/marketplace/check-auth', [])
.success(function (response) {
if (response.success) {
$localStorage.marketplaceUsername = $scope.user.username = response.data.username;
$localStorage.isMarketplaceAuthorized = true;
$scope.nextState();
} else {
$localStorage.isMarketplaceAuthorized = false;
$scope.showCredsForm = true;
}
$rootScope.isMarketplaceAuthorized = $localStorage.isMarketplaceAuthorized;
$rootScope.authRequest = true;
});
} else {
$rootScope.isMarketplaceAuthorized = $localStorage.isMarketplaceAuthorized;
$scope.nextState();
}
}
})
.error(function (data) {
$scope.upgradeProcessError = true;
});
$scope.errors = false;
$scope.saveAuthJson = function () {
if ($scope.auth.$valid) {
$http.post('index.php/marketplace/save-auth-json', $scope.user)
.success(function (data) {
$scope.saveAuthJson.result = data;
if ($scope.saveAuthJson.result.success) {
$scope.logout = false;
$localStorage.isMarketplaceAuthorized = true;
$scope.errors = false;
$scope.nextState();
} else {
$localStorage.isMarketplaceAuthorized = false;
$scope.errors = true;
}
$rootScope.isMarketplaceAuthorized = $localStorage.isMarketplaceAuthorized;
$localStorage.marketplaceUsername = $scope.user.username;
})
.error(function (data) {
$scope.saveAuthJson.failed = data;
$localStorage.isMarketplaceAuthorized = false;
$scope.errors = true;
});
} else {
$scope.validate();
}
};
$scope.validate = function() {
if ($scope.user.$valid) {
$scope.user.submitted = false;
} else {
$scope.user.submitted = true;
}
}
}]);
|
/******/ (function(modules) { // webpackBootstrap
/******/ var parentHotUpdateCallback = this["webpackHotUpdate"];
/******/ this["webpackHotUpdate"] =
/******/ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
/******/ hotAddUpdateChunk(chunkId, moreModules);
/******/ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
/******/ }
/******/
/******/ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
/******/ var head = document.getElementsByTagName("head")[0];
/******/ var script = document.createElement("script");
/******/ script.type = "text/javascript";
/******/ script.charset = "utf-8";
/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js";
/******/ head.appendChild(script);
/******/ }
/******/
/******/ function hotDownloadManifest(callback) { // eslint-disable-line no-unused-vars
/******/ if(typeof XMLHttpRequest === "undefined")
/******/ return callback(new Error("No browser support"));
/******/ try {
/******/ var request = new XMLHttpRequest();
/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json";
/******/ request.open("GET", requestPath, true);
/******/ request.timeout = 10000;
/******/ request.send(null);
/******/ } catch(err) {
/******/ return callback(err);
/******/ }
/******/ request.onreadystatechange = function() {
/******/ if(request.readyState !== 4) return;
/******/ if(request.status === 0) {
/******/ // timeout
/******/ callback(new Error("Manifest request to " + requestPath + " timed out."));
/******/ } else if(request.status === 404) {
/******/ // no update available
/******/ callback();
/******/ } else if(request.status !== 200 && request.status !== 304) {
/******/ // other failure
/******/ callback(new Error("Manifest request to " + requestPath + " failed."));
/******/ } else {
/******/ // success
/******/ try {
/******/ var update = JSON.parse(request.responseText);
/******/ } catch(e) {
/******/ callback(e);
/******/ return;
/******/ }
/******/ callback(null, update);
/******/ }
/******/ };
/******/ }
/******/
/******/
/******/ var hotApplyOnUpdate = true;
/******/ var hotCurrentHash = "5da53d58bcd0f13e146c"; // eslint-disable-line no-unused-vars
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars
/******/
/******/ function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars
/******/ var me = installedModules[moduleId];
/******/ if(!me) return __webpack_require__;
/******/ var fn = function(request) {
/******/ if(me.hot.active) {
/******/ if(installedModules[request]) {
/******/ if(installedModules[request].parents.indexOf(moduleId) < 0)
/******/ installedModules[request].parents.push(moduleId);
/******/ if(me.children.indexOf(request) < 0)
/******/ me.children.push(request);
/******/ } else hotCurrentParents = [moduleId];
/******/ } else {
/******/ console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
/******/ hotCurrentParents = [];
/******/ }
/******/ return __webpack_require__(request);
/******/ };
/******/ for(var name in __webpack_require__) {
/******/ if(Object.prototype.hasOwnProperty.call(__webpack_require__, name)) {
/******/ fn[name] = __webpack_require__[name];
/******/ }
/******/ }
/******/ fn.e = function(chunkId, callback) {
/******/ if(hotStatus === "ready")
/******/ hotSetStatus("prepare");
/******/ hotChunksLoading++;
/******/ __webpack_require__.e(chunkId, function() {
/******/ try {
/******/ callback.call(null, fn);
/******/ } finally {
/******/ finishChunkLoading();
/******/ }
/******/
/******/ function finishChunkLoading() {
/******/ hotChunksLoading--;
/******/ if(hotStatus === "prepare") {
/******/ if(!hotWaitingFilesMap[chunkId]) {
/******/ hotEnsureUpdateChunk(chunkId);
/******/ }
/******/ if(hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ hotUpdateDownloaded();
/******/ }
/******/ }
/******/ }
/******/ });
/******/ };
/******/ return fn;
/******/ }
/******/
/******/ function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars
/******/ var hot = {
/******/ // private stuff
/******/ _acceptedDependencies: {},
/******/ _declinedDependencies: {},
/******/ _selfAccepted: false,
/******/ _selfDeclined: false,
/******/ _disposeHandlers: [],
/******/
/******/ // Module API
/******/ active: true,
/******/ accept: function(dep, callback) {
/******/ if(typeof dep === "undefined")
/******/ hot._selfAccepted = true;
/******/ else if(typeof dep === "function")
/******/ hot._selfAccepted = dep;
/******/ else if(typeof dep === "object")
/******/ for(var i = 0; i < dep.length; i++)
/******/ hot._acceptedDependencies[dep[i]] = callback;
/******/ else
/******/ hot._acceptedDependencies[dep] = callback;
/******/ },
/******/ decline: function(dep) {
/******/ if(typeof dep === "undefined")
/******/ hot._selfDeclined = true;
/******/ else if(typeof dep === "number")
/******/ hot._declinedDependencies[dep] = true;
/******/ else
/******/ for(var i = 0; i < dep.length; i++)
/******/ hot._declinedDependencies[dep[i]] = true;
/******/ },
/******/ dispose: function(callback) {
/******/ hot._disposeHandlers.push(callback);
/******/ },
/******/ addDisposeHandler: function(callback) {
/******/ hot._disposeHandlers.push(callback);
/******/ },
/******/ removeDisposeHandler: function(callback) {
/******/ var idx = hot._disposeHandlers.indexOf(callback);
/******/ if(idx >= 0) hot._disposeHandlers.splice(idx, 1);
/******/ },
/******/
/******/ // Management API
/******/ check: hotCheck,
/******/ apply: hotApply,
/******/ status: function(l) {
/******/ if(!l) return hotStatus;
/******/ hotStatusHandlers.push(l);
/******/ },
/******/ addStatusHandler: function(l) {
/******/ hotStatusHandlers.push(l);
/******/ },
/******/ removeStatusHandler: function(l) {
/******/ var idx = hotStatusHandlers.indexOf(l);
/******/ if(idx >= 0) hotStatusHandlers.splice(idx, 1);
/******/ },
/******/
/******/ //inherit from previous dispose call
/******/ data: hotCurrentModuleData[moduleId]
/******/ };
/******/ return hot;
/******/ }
/******/
/******/ var hotStatusHandlers = [];
/******/ var hotStatus = "idle";
/******/
/******/ function hotSetStatus(newStatus) {
/******/ hotStatus = newStatus;
/******/ for(var i = 0; i < hotStatusHandlers.length; i++)
/******/ hotStatusHandlers[i].call(null, newStatus);
/******/ }
/******/
/******/ // while downloading
/******/ var hotWaitingFiles = 0;
/******/ var hotChunksLoading = 0;
/******/ var hotWaitingFilesMap = {};
/******/ var hotRequestedFilesMap = {};
/******/ var hotAvailibleFilesMap = {};
/******/ var hotCallback;
/******/
/******/ // The update info
/******/ var hotUpdate, hotUpdateNewHash;
/******/
/******/ function toModuleId(id) {
/******/ var isNumber = (+id) + "" === id;
/******/ return isNumber ? +id : id;
/******/ }
/******/
/******/ function hotCheck(apply, callback) {
/******/ if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status");
/******/ if(typeof apply === "function") {
/******/ hotApplyOnUpdate = false;
/******/ callback = apply;
/******/ } else {
/******/ hotApplyOnUpdate = apply;
/******/ callback = callback || function(err) {
/******/ if(err) throw err;
/******/ };
/******/ }
/******/ hotSetStatus("check");
/******/ hotDownloadManifest(function(err, update) {
/******/ if(err) return callback(err);
/******/ if(!update) {
/******/ hotSetStatus("idle");
/******/ callback(null, null);
/******/ return;
/******/ }
/******/
/******/ hotRequestedFilesMap = {};
/******/ hotAvailibleFilesMap = {};
/******/ hotWaitingFilesMap = {};
/******/ for(var i = 0; i < update.c.length; i++)
/******/ hotAvailibleFilesMap[update.c[i]] = true;
/******/ hotUpdateNewHash = update.h;
/******/
/******/ hotSetStatus("prepare");
/******/ hotCallback = callback;
/******/ hotUpdate = {};
/******/ var chunkId = 0;
/******/ { // eslint-disable-line no-lone-blocks
/******/ /*globals chunkId */
/******/ hotEnsureUpdateChunk(chunkId);
/******/ }
/******/ if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ hotUpdateDownloaded();
/******/ }
/******/ });
/******/ }
/******/
/******/ function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars
/******/ if(!hotAvailibleFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
/******/ return;
/******/ hotRequestedFilesMap[chunkId] = false;
/******/ for(var moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ hotUpdate[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(--hotWaitingFiles === 0 && hotChunksLoading === 0) {
/******/ hotUpdateDownloaded();
/******/ }
/******/ }
/******/
/******/ function hotEnsureUpdateChunk(chunkId) {
/******/ if(!hotAvailibleFilesMap[chunkId]) {
/******/ hotWaitingFilesMap[chunkId] = true;
/******/ } else {
/******/ hotRequestedFilesMap[chunkId] = true;
/******/ hotWaitingFiles++;
/******/ hotDownloadUpdateChunk(chunkId);
/******/ }
/******/ }
/******/
/******/ function hotUpdateDownloaded() {
/******/ hotSetStatus("ready");
/******/ var callback = hotCallback;
/******/ hotCallback = null;
/******/ if(!callback) return;
/******/ if(hotApplyOnUpdate) {
/******/ hotApply(hotApplyOnUpdate, callback);
/******/ } else {
/******/ var outdatedModules = [];
/******/ for(var id in hotUpdate) {
/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
/******/ outdatedModules.push(toModuleId(id));
/******/ }
/******/ }
/******/ callback(null, outdatedModules);
/******/ }
/******/ }
/******/
/******/ function hotApply(options, callback) {
/******/ if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status");
/******/ if(typeof options === "function") {
/******/ callback = options;
/******/ options = {};
/******/ } else if(options && typeof options === "object") {
/******/ callback = callback || function(err) {
/******/ if(err) throw err;
/******/ };
/******/ } else {
/******/ options = {};
/******/ callback = callback || function(err) {
/******/ if(err) throw err;
/******/ };
/******/ }
/******/
/******/ function getAffectedStuff(module) {
/******/ var outdatedModules = [module];
/******/ var outdatedDependencies = {};
/******/
/******/ var queue = outdatedModules.slice();
/******/ while(queue.length > 0) {
/******/ var moduleId = queue.pop();
/******/ var module = installedModules[moduleId];
/******/ if(!module || module.hot._selfAccepted)
/******/ continue;
/******/ if(module.hot._selfDeclined) {
/******/ return new Error("Aborted because of self decline: " + moduleId);
/******/ }
/******/ if(moduleId === 0) {
/******/ return;
/******/ }
/******/ for(var i = 0; i < module.parents.length; i++) {
/******/ var parentId = module.parents[i];
/******/ var parent = installedModules[parentId];
/******/ if(parent.hot._declinedDependencies[moduleId]) {
/******/ return new Error("Aborted because of declined dependency: " + moduleId + " in " + parentId);
/******/ }
/******/ if(outdatedModules.indexOf(parentId) >= 0) continue;
/******/ if(parent.hot._acceptedDependencies[moduleId]) {
/******/ if(!outdatedDependencies[parentId])
/******/ outdatedDependencies[parentId] = [];
/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]);
/******/ continue;
/******/ }
/******/ delete outdatedDependencies[parentId];
/******/ outdatedModules.push(parentId);
/******/ queue.push(parentId);
/******/ }
/******/ }
/******/
/******/ return [outdatedModules, outdatedDependencies];
/******/ }
/******/
/******/ function addAllToSet(a, b) {
/******/ for(var i = 0; i < b.length; i++) {
/******/ var item = b[i];
/******/ if(a.indexOf(item) < 0)
/******/ a.push(item);
/******/ }
/******/ }
/******/
/******/ // at begin all updates modules are outdated
/******/ // the "outdated" status can propagate to parents if they don't accept the children
/******/ var outdatedDependencies = {};
/******/ var outdatedModules = [];
/******/ var appliedUpdate = {};
/******/ for(var id in hotUpdate) {
/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
/******/ var moduleId = toModuleId(id);
/******/ var result = getAffectedStuff(moduleId);
/******/ if(!result) {
/******/ if(options.ignoreUnaccepted)
/******/ continue;
/******/ hotSetStatus("abort");
/******/ return callback(new Error("Aborted because " + moduleId + " is not accepted"));
/******/ }
/******/ if(result instanceof Error) {
/******/ hotSetStatus("abort");
/******/ return callback(result);
/******/ }
/******/ appliedUpdate[moduleId] = hotUpdate[moduleId];
/******/ addAllToSet(outdatedModules, result[0]);
/******/ for(var moduleId in result[1]) {
/******/ if(Object.prototype.hasOwnProperty.call(result[1], moduleId)) {
/******/ if(!outdatedDependencies[moduleId])
/******/ outdatedDependencies[moduleId] = [];
/******/ addAllToSet(outdatedDependencies[moduleId], result[1][moduleId]);
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ // Store self accepted outdated modules to require them later by the module system
/******/ var outdatedSelfAcceptedModules = [];
/******/ for(var i = 0; i < outdatedModules.length; i++) {
/******/ var moduleId = outdatedModules[i];
/******/ if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted)
/******/ outdatedSelfAcceptedModules.push({
/******/ module: moduleId,
/******/ errorHandler: installedModules[moduleId].hot._selfAccepted
/******/ });
/******/ }
/******/
/******/ // Now in "dispose" phase
/******/ hotSetStatus("dispose");
/******/ var queue = outdatedModules.slice();
/******/ while(queue.length > 0) {
/******/ var moduleId = queue.pop();
/******/ var module = installedModules[moduleId];
/******/ if(!module) continue;
/******/
/******/ var data = {};
/******/
/******/ // Call dispose handlers
/******/ var disposeHandlers = module.hot._disposeHandlers;
/******/ for(var j = 0; j < disposeHandlers.length; j++) {
/******/ var cb = disposeHandlers[j];
/******/ cb(data);
/******/ }
/******/ hotCurrentModuleData[moduleId] = data;
/******/
/******/ // disable module (this disables requires from this module)
/******/ module.hot.active = false;
/******/
/******/ // remove module from cache
/******/ delete installedModules[moduleId];
/******/
/******/ // remove "parents" references from all children
/******/ for(var j = 0; j < module.children.length; j++) {
/******/ var child = installedModules[module.children[j]];
/******/ if(!child) continue;
/******/ var idx = child.parents.indexOf(moduleId);
/******/ if(idx >= 0) {
/******/ child.parents.splice(idx, 1);
/******/ }
/******/ }
/******/ }
/******/
/******/ // remove outdated dependency from module children
/******/ for(var moduleId in outdatedDependencies) {
/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
/******/ var module = installedModules[moduleId];
/******/ var moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ for(var j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ var dependency = moduleOutdatedDependencies[j];
/******/ var idx = module.children.indexOf(dependency);
/******/ if(idx >= 0) module.children.splice(idx, 1);
/******/ }
/******/ }
/******/ }
/******/
/******/ // Not in "apply" phase
/******/ hotSetStatus("apply");
/******/
/******/ hotCurrentHash = hotUpdateNewHash;
/******/
/******/ // insert new code
/******/ for(var moduleId in appliedUpdate) {
/******/ if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {
/******/ modules[moduleId] = appliedUpdate[moduleId];
/******/ }
/******/ }
/******/
/******/ // call accept handlers
/******/ var error = null;
/******/ for(var moduleId in outdatedDependencies) {
/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
/******/ var module = installedModules[moduleId];
/******/ var moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ var callbacks = [];
/******/ for(var i = 0; i < moduleOutdatedDependencies.length; i++) {
/******/ var dependency = moduleOutdatedDependencies[i];
/******/ var cb = module.hot._acceptedDependencies[dependency];
/******/ if(callbacks.indexOf(cb) >= 0) continue;
/******/ callbacks.push(cb);
/******/ }
/******/ for(var i = 0; i < callbacks.length; i++) {
/******/ var cb = callbacks[i];
/******/ try {
/******/ cb(outdatedDependencies);
/******/ } catch(err) {
/******/ if(!error)
/******/ error = err;
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ // Load self accepted modules
/******/ for(var i = 0; i < outdatedSelfAcceptedModules.length; i++) {
/******/ var item = outdatedSelfAcceptedModules[i];
/******/ var moduleId = item.module;
/******/ hotCurrentParents = [moduleId];
/******/ try {
/******/ __webpack_require__(moduleId);
/******/ } catch(err) {
/******/ if(typeof item.errorHandler === "function") {
/******/ try {
/******/ item.errorHandler(err);
/******/ } catch(err) {
/******/ if(!error)
/******/ error = err;
/******/ }
/******/ } else if(!error)
/******/ error = err;
/******/ }
/******/ }
/******/
/******/ // handle errors in accept handlers and self accepted module load
/******/ if(error) {
/******/ hotSetStatus("fail");
/******/ return callback(error);
/******/ }
/******/
/******/ hotSetStatus("idle");
/******/ callback(null, outdatedModules);
/******/ }
/******/ // 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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false,
/******/ hot: hotCreateModule(moduleId),
/******/ parents: hotCurrentParents,
/******/ children: []
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // __webpack_hash__
/******/ __webpack_require__.h = function() { return hotCurrentHash; };
/******/ // Load entry module and return exports
/******/ return hotCreateRequire(0)(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(1);
document.write(__webpack_require__(5));
var i = 0;
var a = setInterval(function(){
i++;
console.log(i);
}, 500);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(2);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(4)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept(2, function() {
var newContent = __webpack_require__(2);
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(3)();
// imports
// module
exports.push([module.id, "body {\n background: red;\n}", ""]);
// exports
/***/ },
/* 3 */
/***/ function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function() {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
var result = [];
for(var i = 0; i < this.length; i++) {
var item = this[i];
if(item[2]) {
result.push("@media " + item[2] + "{" + item[1] + "}");
} else {
result.push(item[1]);
}
}
return result.join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var stylesInDom = {},
memoize = function(fn) {
var memo;
return function () {
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
return memo;
};
},
isOldIE = memoize(function() {
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
}),
getHeadElement = memoize(function () {
return document.head || document.getElementsByTagName("head")[0];
}),
singletonElement = null,
singletonCounter = 0,
styleElementsInsertedAtTop = [];
module.exports = function(list, options) {
if(false) {
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
}
options = options || {};
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
// By default, add <style> tags to the bottom of <head>.
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
var styles = listToStyles(list);
addStylesToDom(styles, options);
return function update(newList) {
var mayRemove = [];
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
domStyle.refs--;
mayRemove.push(domStyle);
}
if(newList) {
var newStyles = listToStyles(newList);
addStylesToDom(newStyles, options);
}
for(var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i];
if(domStyle.refs === 0) {
for(var j = 0; j < domStyle.parts.length; j++)
domStyle.parts[j]();
delete stylesInDom[domStyle.id];
}
}
};
}
function addStylesToDom(styles, options) {
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
if(domStyle) {
domStyle.refs++;
for(var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j]);
}
for(; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j], options));
}
} else {
var parts = [];
for(var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j], options));
}
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
}
}
}
function listToStyles(list) {
var styles = [];
var newStyles = {};
for(var i = 0; i < list.length; i++) {
var item = list[i];
var id = item[0];
var css = item[1];
var media = item[2];
var sourceMap = item[3];
var part = {css: css, media: media, sourceMap: sourceMap};
if(!newStyles[id])
styles.push(newStyles[id] = {id: id, parts: [part]});
else
newStyles[id].parts.push(part);
}
return styles;
}
function insertStyleElement(options, styleElement) {
var head = getHeadElement();
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
if (options.insertAt === "top") {
if(!lastStyleElementInsertedAtTop) {
head.insertBefore(styleElement, head.firstChild);
} else if(lastStyleElementInsertedAtTop.nextSibling) {
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
} else {
head.appendChild(styleElement);
}
styleElementsInsertedAtTop.push(styleElement);
} else if (options.insertAt === "bottom") {
head.appendChild(styleElement);
} else {
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
}
}
function removeStyleElement(styleElement) {
styleElement.parentNode.removeChild(styleElement);
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
if(idx >= 0) {
styleElementsInsertedAtTop.splice(idx, 1);
}
}
function createStyleElement(options) {
var styleElement = document.createElement("style");
styleElement.type = "text/css";
insertStyleElement(options, styleElement);
return styleElement;
}
function createLinkElement(options) {
var linkElement = document.createElement("link");
linkElement.rel = "stylesheet";
insertStyleElement(options, linkElement);
return linkElement;
}
function addStyle(obj, options) {
var styleElement, update, remove;
if (options.singleton) {
var styleIndex = singletonCounter++;
styleElement = singletonElement || (singletonElement = createStyleElement(options));
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
} else if(obj.sourceMap &&
typeof URL === "function" &&
typeof URL.createObjectURL === "function" &&
typeof URL.revokeObjectURL === "function" &&
typeof Blob === "function" &&
typeof btoa === "function") {
styleElement = createLinkElement(options);
update = updateLink.bind(null, styleElement);
remove = function() {
removeStyleElement(styleElement);
if(styleElement.href)
URL.revokeObjectURL(styleElement.href);
};
} else {
styleElement = createStyleElement(options);
update = applyToTag.bind(null, styleElement);
remove = function() {
removeStyleElement(styleElement);
};
}
update(obj);
return function updateStyle(newObj) {
if(newObj) {
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
return;
update(obj = newObj);
} else {
remove();
}
};
}
var replaceText = (function () {
var textStore = [];
return function (index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join('\n');
};
})();
function applyToSingletonTag(styleElement, index, remove, obj) {
var css = remove ? "" : obj.css;
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css);
} else {
var cssNode = document.createTextNode(css);
var childNodes = styleElement.childNodes;
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index]);
} else {
styleElement.appendChild(cssNode);
}
}
}
function applyToTag(styleElement, obj) {
var css = obj.css;
var media = obj.media;
var sourceMap = obj.sourceMap;
if(media) {
styleElement.setAttribute("media", media)
}
if(styleElement.styleSheet) {
styleElement.styleSheet.cssText = css;
} else {
while(styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild);
}
styleElement.appendChild(document.createTextNode(css));
}
}
function updateLink(linkElement, obj) {
var css = obj.css;
var media = obj.media;
var sourceMap = obj.sourceMap;
if(sourceMap) {
// http://stackoverflow.com/a/26603875
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
}
var blob = new Blob([css], { type: "text/css" });
var oldSrc = linkElement.href;
linkElement.href = URL.createObjectURL(blob);
if(oldSrc)
URL.revokeObjectURL(oldSrc);
}
/***/ },
/* 5 */
/***/ function(module, exports) {
module.exports = "It works from content.js.";
/***/ }
/******/ ]);
|
require('./init.js');
var assert = require('assert');
var db, DummyModel, odb;
describe('connections', function () {
before(function () {
require('./init.js');
odb = getDataSource({collation: 'utf8_general_ci', createDatabase: true});
db = odb;
});
it('should use utf8 charset', function (done) {
var test_set = /utf8/;
var test_collo = /utf8_general_ci/;
var test_set_str = 'utf8';
var test_set_collo = 'utf8_general_ci';
charsetTest(test_set, test_collo, test_set_str, test_set_collo, done);
});
it('should disconnect first db', function (done) {
db.disconnect(function () {
odb = getDataSource();
done();
});
});
it('should use latin1 charset', function (done) {
var test_set = /latin1/;
var test_collo = /latin1_general_ci/;
var test_set_str = 'latin1';
var test_set_collo = 'latin1_general_ci';
charsetTest(test_set, test_collo, test_set_str, test_set_collo, done);
});
it('should drop db and disconnect all', function (done) {
db.connector.execute('DROP DATABASE IF EXISTS ' + db.settings.database, function (err) {
db.disconnect(function () {
done();
});
});
});
});
function charsetTest(test_set, test_collo, test_set_str, test_set_collo, done) {
query('DROP DATABASE IF EXISTS ' + odb.settings.database, function (err) {
assert.ok(!err);
odb.disconnect(function () {
db = getDataSource({collation: test_set_collo, createDatabase: true});
DummyModel = db.define('DummyModel', {string: String});
db.automigrate(function () {
var q = 'SELECT DEFAULT_COLLATION_NAME' +
' FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = ' +
db.driver.escape(db.settings.database) + ' LIMIT 1';
db.connector.execute(q, function (err, r) {
assert.ok(!err);
assert.ok(r[0].DEFAULT_COLLATION_NAME.match(test_collo));
db.connector.execute('SHOW VARIABLES LIKE "character_set%"', function (err, r) {
assert.ok(!err);
var hit_all = 0;
for (var result in r) {
hit_all += matchResult(r[result], 'character_set_connection', test_set);
hit_all += matchResult(r[result], 'character_set_database', test_set);
hit_all += matchResult(r[result], 'character_set_results', test_set);
hit_all += matchResult(r[result], 'character_set_client', test_set);
}
assert.equal(hit_all, 4);
});
db.connector.execute('SHOW VARIABLES LIKE "collation%"', function (err, r) {
assert.ok(!err);
var hit_all = 0;
for (var result in r) {
hit_all += matchResult(r[result], 'collation_connection', test_set);
hit_all += matchResult(r[result], 'collation_database', test_set);
}
assert.equal(hit_all, 2);
done();
});
});
});
});
});
}
function matchResult(result, variable_name, match) {
if (result.Variable_name === variable_name) {
assert.ok(result.Value.match(match));
return 1;
}
return 0;
}
var query = function (sql, cb) {
odb.connector.execute(sql, cb);
};
|
exports.a = function() {
return "a";
};
exports.b = require("./using_exports_b").b;
|
import React from 'react';
import Button from '../src/Button';
import Dropdown from '../src/Dropdown';
import NavItem from '../src/NavItem';
export default
<Dropdown trigger={
<Button>Drop me!</Button>
}>
<NavItem>one</NavItem>
<NavItem>two</NavItem>
<NavItem divider />
<NavItem>three</NavItem>
</Dropdown>;
|
/**
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _createClass = require('babel-runtime/helpers/create-class')['default'];
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];
var _Object$keys = require('babel-runtime/core-js/object/keys')['default'];
var _Object$freeze = require('babel-runtime/core-js/object/freeze')['default'];
var _Object$create = require('babel-runtime/core-js/object/create')['default'];
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default'];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];
var _interopRequireWildcard = require('babel-runtime/helpers/interop-require-wildcard')['default'];
Object.defineProperty(exports, '__esModule', {
value: true
});
var _CoreManager = require('./CoreManager');
var _CoreManager2 = _interopRequireDefault(_CoreManager);
var _canBeSerialized = require('./canBeSerialized');
var _canBeSerialized2 = _interopRequireDefault(_canBeSerialized);
var _decode = require('./decode');
var _decode2 = _interopRequireDefault(_decode);
var _encode = require('./encode');
var _encode2 = _interopRequireDefault(_encode);
var _equals = require('./equals');
var _equals2 = _interopRequireDefault(_equals);
var _escape2 = require('./escape');
var _escape3 = _interopRequireDefault(_escape2);
var _ObjectState = require('./ObjectState');
var ObjectState = _interopRequireWildcard(_ObjectState);
var _ParseACL = require('./ParseACL');
var _ParseACL2 = _interopRequireDefault(_ParseACL);
var _parseDate = require('./parseDate');
var _parseDate2 = _interopRequireDefault(_parseDate);
var _ParseError = require('./ParseError');
var _ParseError2 = _interopRequireDefault(_ParseError);
var _ParseFile = require('./ParseFile');
var _ParseFile2 = _interopRequireDefault(_ParseFile);
var _ParseOp = require('./ParseOp');
var _ParsePromise = require('./ParsePromise');
var _ParsePromise2 = _interopRequireDefault(_ParsePromise);
var _ParseQuery = require('./ParseQuery');
var _ParseQuery2 = _interopRequireDefault(_ParseQuery);
var _ParseRelation = require('./ParseRelation');
var _ParseRelation2 = _interopRequireDefault(_ParseRelation);
var _unique = require('./unique');
var _unique2 = _interopRequireDefault(_unique);
var _unsavedChildren = require('./unsavedChildren');
var _unsavedChildren2 = _interopRequireDefault(_unsavedChildren);
// Mapping of class names to constructors, so we can populate objects from the
// server with appropriate subclasses of ParseObject
var classMap = {};
// Global counter for generating unique local Ids
var localCount = 0;
// Global counter for generating unique Ids for non-single-instance objects
var objectCount = 0;
// On web clients, objects are single-instance: any two objects with the same Id
// will have the same attributes. However, this may be dangerous default
// behavior in a server scenario
var singleInstance = !_CoreManager2['default'].get('IS_NODE');
function getServerUrlPath() {
var serverUrl = _CoreManager2['default'].get('SERVER_URL');
if (serverUrl[serverUrl.length - 1] !== '/') {
serverUrl += '/';
}
var url = serverUrl.replace(/https?:\/\//, '');
return url.substr(url.indexOf('/'));
}
/**
* Creates a new model with defined attributes.
*
* <p>You won't normally call this method directly. It is recommended that
* you use a subclass of <code>Parse.Object</code> instead, created by calling
* <code>extend</code>.</p>
*
* <p>However, if you don't want to use a subclass, or aren't sure which
* subclass is appropriate, you can use this form:<pre>
* var object = new Parse.Object("ClassName");
* </pre>
* That is basically equivalent to:<pre>
* var MyClass = Parse.Object.extend("ClassName");
* var object = new MyClass();
* </pre></p>
*
* @class Parse.Object
* @constructor
* @param {String} className The class name for the object
* @param {Object} attributes The initial set of data to store in the object.
* @param {Object} options The options for this object instance.
*/
var ParseObject = (function () {
function ParseObject(className, attributes, options) {
_classCallCheck(this, ParseObject);
// Enable legacy initializers
if (typeof this.initialize === 'function') {
this.initialize.apply(this, arguments);
}
var toSet = null;
this._objCount = objectCount++;
if (typeof className === 'string') {
this.className = className;
if (attributes && typeof attributes === 'object') {
toSet = attributes;
}
} else if (className && typeof className === 'object') {
this.className = className.className;
toSet = {};
for (var attr in className) {
if (attr !== 'className') {
toSet[attr] = className[attr];
}
}
if (attributes && typeof attributes === 'object') {
options = attributes;
}
}
if (toSet && !this.set(toSet, options)) {
throw new Error('Can\'t create an invalid Parse Object');
}
}
/** Prototype getters / setters **/
_createClass(ParseObject, [{
key: '_getId',
/** Private methods **/
/**
* Returns a local or server Id used uniquely identify this object
*/
value: function _getId() {
if (typeof this.id === 'string') {
return this.id;
}
if (typeof this._localId === 'string') {
return this._localId;
}
var localId = 'local' + String(localCount++);
this._localId = localId;
return localId;
}
/**
* Returns a local or server Id used to pull data from the Object State store
* If single instance objects are disabled, it will use the object's unique
* count to separate its data from other objects with the same server Id.
*/
}, {
key: '_getStateIdentifier',
value: function _getStateIdentifier() {
if (typeof this.id === 'string') {
if (singleInstance) {
return this.id;
}
return this.id + '_' + String(this._objCount);
}
return this._getId();
}
}, {
key: '_getServerData',
value: function _getServerData() {
return ObjectState.getServerData(this.className, this._getStateIdentifier());
}
}, {
key: '_clearServerData',
value: function _clearServerData() {
var serverData = this._getServerData();
var unset = {};
for (var attr in serverData) {
unset[attr] = undefined;
}
ObjectState.setServerData(this.className, this._getStateIdentifier(), unset);
}
}, {
key: '_getPendingOps',
value: function _getPendingOps() {
return ObjectState.getPendingOps(this.className, this._getStateIdentifier());
}
}, {
key: '_clearPendingOps',
value: function _clearPendingOps() {
var pending = this._getPendingOps();
var latest = pending[pending.length - 1];
var keys = _Object$keys(latest);
keys.forEach(function (key) {
delete latest[key];
});
}
}, {
key: '_getDirtyObjectAttributes',
value: function _getDirtyObjectAttributes() {
var attributes = this.attributes;
var objectCache = ObjectState.getObjectCache(this.className, this._getStateIdentifier());
var dirty = {};
for (var attr in attributes) {
var val = attributes[attr];
if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) {
// Due to the way browsers construct maps, the key order will not change
// unless the object is changed
try {
var json = (0, _encode2['default'])(val, false, true);
var stringified = JSON.stringify(json);
if (objectCache[attr] !== stringified) {
dirty[attr] = val;
}
} catch (e) {
// Error occurred, possibly by a nested unsaved pointer in a mutable container
// No matter how it happened, it indicates a change in the attribute
dirty[attr] = val;
}
}
}
return dirty;
}
}, {
key: '_toFullJSON',
value: function _toFullJSON(seen) {
var json = this.toJSON(seen);
json.__type = 'Object';
json.className = this.className;
return json;
}
}, {
key: '_getSaveJSON',
value: function _getSaveJSON() {
var pending = this._getPendingOps();
var dirtyObjects = this._getDirtyObjectAttributes();
var json = {};
var attr;
for (attr in dirtyObjects) {
json[attr] = new _ParseOp.SetOp(dirtyObjects[attr]).toJSON();
}
for (attr in pending[0]) {
json[attr] = pending[0][attr].toJSON();
}
return json;
}
}, {
key: '_getSaveParams',
value: function _getSaveParams() {
var method = this.id ? 'PUT' : 'POST';
var body = this._getSaveJSON();
var path = 'classes/' + this.className;
if (this.id) {
path += '/' + this.id;
} else if (this.className === '_User') {
path = 'users';
}
return {
method: method,
body: body,
path: path
};
}
}, {
key: '_finishFetch',
value: function _finishFetch(serverData) {
if (!this.id && serverData.objectId) {
this.id = serverData.objectId;
}
ObjectState.initializeState(this.className, this._getStateIdentifier());
var decoded = {};
for (var attr in serverData) {
if (attr === 'ACL') {
decoded[attr] = new _ParseACL2['default'](serverData[attr]);
} else if (attr !== 'objectId') {
decoded[attr] = (0, _decode2['default'])(serverData[attr]);
if (decoded[attr] instanceof _ParseRelation2['default']) {
decoded[attr]._ensureParentAndKey(this, attr);
}
}
}
if (decoded.createdAt && typeof decoded.createdAt === 'string') {
decoded.createdAt = (0, _parseDate2['default'])(decoded.createdAt);
}
if (decoded.updatedAt && typeof decoded.updatedAt === 'string') {
decoded.updatedAt = (0, _parseDate2['default'])(decoded.updatedAt);
}
if (!decoded.updatedAt && decoded.createdAt) {
decoded.updatedAt = decoded.createdAt;
}
ObjectState.commitServerChanges(this.className, this._getStateIdentifier(), decoded);
}
}, {
key: '_setExisted',
value: function _setExisted(existed) {
var state = ObjectState.getState(this.className, this._getStateIdentifier());
if (state) {
state.existed = existed;
}
}
}, {
key: '_migrateId',
value: function _migrateId(serverId) {
if (this._localId && serverId) {
var oldState = ObjectState.removeState(this.className, this._getStateIdentifier());
this.id = serverId;
delete this._localId;
if (oldState) {
ObjectState.initializeState(this.className, this._getStateIdentifier(), oldState);
}
}
}
}, {
key: '_handleSaveResponse',
value: function _handleSaveResponse(response, status) {
var changes = {};
var attr;
var pending = ObjectState.popPendingState(this.className, this._getStateIdentifier());
for (attr in pending) {
if (pending[attr] instanceof _ParseOp.RelationOp) {
changes[attr] = pending[attr].applyTo(undefined, this, attr);
} else if (!(attr in response)) {
// Only SetOps and UnsetOps should not come back with results
changes[attr] = pending[attr].applyTo(undefined);
}
}
for (attr in response) {
if ((attr === 'createdAt' || attr === 'updatedAt') && typeof response[attr] === 'string') {
changes[attr] = (0, _parseDate2['default'])(response[attr]);
} else if (attr === 'ACL') {
changes[attr] = new _ParseACL2['default'](response[attr]);
} else if (attr !== 'objectId') {
changes[attr] = (0, _decode2['default'])(response[attr]);
}
}
if (changes.createdAt && !changes.updatedAt) {
changes.updatedAt = changes.createdAt;
}
this._migrateId(response.objectId);
if (status !== 201) {
this._setExisted(true);
}
ObjectState.commitServerChanges(this.className, this._getStateIdentifier(), changes);
}
}, {
key: '_handleSaveError',
value: function _handleSaveError() {
var pending = this._getPendingOps();
ObjectState.mergeFirstPendingState(this.className, this._getStateIdentifier());
}
/** Public methods **/
}, {
key: 'initialize',
value: function initialize() {}
// NOOP
/**
* Returns a JSON version of the object suitable for saving to Parse.
* @method toJSON
* @return {Object}
*/
}, {
key: 'toJSON',
value: function toJSON(seen) {
var seenEntry = this.id ? this.className + ':' + this.id : this;
var seen = seen || [seenEntry];
var json = {};
var attrs = this.attributes;
for (var attr in attrs) {
if ((attr === 'createdAt' || attr === 'updatedAt') && attrs[attr].toJSON) {
json[attr] = attrs[attr].toJSON();
} else {
json[attr] = (0, _encode2['default'])(attrs[attr], false, false, seen);
}
}
var pending = this._getPendingOps();
for (var attr in pending[0]) {
json[attr] = pending[0][attr].toJSON();
}
if (this.id) {
json.objectId = this.id;
}
return json;
}
/**
* Determines whether this ParseObject is equal to another ParseObject
* @method equals
* @return {Boolean}
*/
}, {
key: 'equals',
value: function equals(other) {
if (this === other) {
return true;
}
return other instanceof ParseObject && this.className === other.className && this.id === other.id && typeof this.id !== 'undefined';
}
/**
* Returns true if this object has been modified since its last
* save/refresh. If an attribute is specified, it returns true only if that
* particular attribute has been modified since the last save/refresh.
* @method dirty
* @param {String} attr An attribute name (optional).
* @return {Boolean}
*/
}, {
key: 'dirty',
value: function dirty(attr) {
if (!this.id) {
return true;
}
var pendingOps = this._getPendingOps();
var dirtyObjects = this._getDirtyObjectAttributes();
if (attr) {
if (dirtyObjects.hasOwnProperty(attr)) {
return true;
}
for (var i = 0; i < pendingOps.length; i++) {
if (pendingOps[i].hasOwnProperty(attr)) {
return true;
}
}
return false;
}
if (_Object$keys(pendingOps[0]).length !== 0) {
return true;
}
if (_Object$keys(dirtyObjects).length !== 0) {
return true;
}
return false;
}
/**
* Returns an array of keys that have been modified since last save/refresh
* @method dirtyKeys
* @return {Array of string}
*/
}, {
key: 'dirtyKeys',
value: function dirtyKeys() {
var pendingOps = this._getPendingOps();
var keys = {};
for (var i = 0; i < pendingOps.length; i++) {
for (var attr in pendingOps[i]) {
keys[attr] = true;
}
}
var dirtyObjects = this._getDirtyObjectAttributes();
for (var attr in dirtyObjects) {
keys[attr] = true;
}
return _Object$keys(keys);
}
/**
* Gets a Pointer referencing this Object.
* @method toPointer
* @return {Object}
*/
}, {
key: 'toPointer',
value: function toPointer() {
if (!this.id) {
throw new Error('Cannot create a pointer to an unsaved ParseObject');
}
return {
__type: 'Pointer',
className: this.className,
objectId: this.id
};
}
/**
* Gets the value of an attribute.
* @method get
* @param {String} attr The string name of an attribute.
*/
}, {
key: 'get',
value: function get(attr) {
return this.attributes[attr];
}
/**
* Gets a relation on the given class for the attribute.
* @method relation
* @param String attr The attribute to get the relation for.
*/
}, {
key: 'relation',
value: function relation(attr) {
var value = this.get(attr);
if (value) {
if (!(value instanceof _ParseRelation2['default'])) {
throw new Error('Called relation() on non-relation field ' + attr);
}
value._ensureParentAndKey(this, attr);
return value;
}
return new _ParseRelation2['default'](this, attr);
}
/**
* Gets the HTML-escaped value of an attribute.
* @method escape
* @param {String} attr The string name of an attribute.
*/
}, {
key: 'escape',
value: function escape(attr) {
var val = this.attributes[attr];
if (val == null) {
return '';
}
var str = val;
if (typeof val !== 'string') {
if (typeof val.toString !== 'function') {
return '';
}
val = val.toString();
}
return (0, _escape3['default'])(val);
}
/**
* Returns <code>true</code> if the attribute contains a value that is not
* null or undefined.
* @method has
* @param {String} attr The string name of the attribute.
* @return {Boolean}
*/
}, {
key: 'has',
value: function has(attr) {
var attributes = this.attributes;
if (attributes.hasOwnProperty(attr)) {
return attributes[attr] != null;
}
return false;
}
/**
* Sets a hash of model attributes on the object.
*
* <p>You can call it with an object containing keys and values, or with one
* key and value. For example:<pre>
* gameTurn.set({
* player: player1,
* diceRoll: 2
* }, {
* error: function(gameTurnAgain, error) {
* // The set failed validation.
* }
* });
*
* game.set("currentPlayer", player2, {
* error: function(gameTurnAgain, error) {
* // The set failed validation.
* }
* });
*
* game.set("finished", true);</pre></p>
*
* @method set
* @param {String} key The key to set.
* @param {} value The value to give it.
* @param {Object} options A set of options for the set.
* The only supported option is <code>error</code>.
* @return {Boolean} true if the set succeeded.
*/
}, {
key: 'set',
value: function set(key, value, options) {
var changes = {};
var newOps = {};
if (key && typeof key === 'object') {
changes = key;
options = value;
} else if (typeof key === 'string') {
changes[key] = value;
} else {
return this;
}
options = options || {};
var readonly = [];
if (typeof this.constructor.readOnlyAttributes === 'function') {
readonly = readonly.concat(this.constructor.readOnlyAttributes());
}
for (var k in changes) {
if (k === 'createdAt' || k === 'updatedAt') {
// This property is read-only, but for legacy reasons we silently
// ignore it
continue;
}
if (readonly.indexOf(k) > -1) {
throw new Error('Cannot modify readonly attribute: ' + k);
}
if (options.unset) {
newOps[k] = new _ParseOp.UnsetOp();
} else if (changes[k] instanceof _ParseOp.Op) {
newOps[k] = changes[k];
} else if (changes[k] && typeof changes[k] === 'object' && typeof changes[k].__op === 'string') {
newOps[k] = (0, _ParseOp.opFromJSON)(changes[k]);
} else if (k === 'objectId' || k === 'id') {
this.id = changes[k];
} else if (k === 'ACL' && typeof changes[k] === 'object' && !(changes[k] instanceof _ParseACL2['default'])) {
newOps[k] = new _ParseOp.SetOp(new _ParseACL2['default'](changes[k]));
} else {
newOps[k] = new _ParseOp.SetOp(changes[k]);
}
}
// Calculate new values
var currentAttributes = this.attributes;
var newValues = {};
for (var attr in newOps) {
if (newOps[attr] instanceof _ParseOp.RelationOp) {
newValues[attr] = newOps[attr].applyTo(currentAttributes[attr], this, attr);
} else if (!(newOps[attr] instanceof _ParseOp.UnsetOp)) {
newValues[attr] = newOps[attr].applyTo(currentAttributes[attr]);
}
}
// Validate changes
if (!options.ignoreValidation) {
var validation = this.validate(newValues);
if (validation) {
if (typeof options.error === 'function') {
options.error(this, validation);
}
return false;
}
}
// Consolidate Ops
var pendingOps = this._getPendingOps();
var last = pendingOps.length - 1;
for (var attr in newOps) {
var nextOp = newOps[attr].mergeWith(pendingOps[last][attr]);
ObjectState.setPendingOp(this.className, this._getStateIdentifier(), attr, nextOp);
}
return this;
}
/**
* Remove an attribute from the model. This is a noop if the attribute doesn't
* exist.
* @method unset
* @param {String} attr The string name of an attribute.
*/
}, {
key: 'unset',
value: function unset(attr, options) {
options = options || {};
options.unset = true;
return this.set(attr, null, options);
}
/**
* Atomically increments the value of the given attribute the next time the
* object is saved. If no amount is specified, 1 is used by default.
*
* @method increment
* @param attr {String} The key.
* @param amount {Number} The amount to increment by (optional).
*/
}, {
key: 'increment',
value: function increment(attr, amount) {
if (typeof amount === 'undefined') {
amount = 1;
}
if (typeof amount !== 'number') {
throw new Error('Cannot increment by a non-numeric amount.');
}
return this.set(attr, new _ParseOp.IncrementOp(amount));
}
/**
* Atomically add an object to the end of the array associated with a given
* key.
* @method add
* @param attr {String} The key.
* @param item {} The item to add.
*/
}, {
key: 'add',
value: function add(attr, item) {
return this.set(attr, new _ParseOp.AddOp([item]));
}
/**
* Atomically add an object to the array associated with a given key, only
* if it is not already present in the array. The position of the insert is
* not guaranteed.
*
* @method addUnique
* @param attr {String} The key.
* @param item {} The object to add.
*/
}, {
key: 'addUnique',
value: function addUnique(attr, item) {
return this.set(attr, new _ParseOp.AddUniqueOp([item]));
}
/**
* Atomically remove all instances of an object from the array associated
* with a given key.
*
* @method remove
* @param attr {String} The key.
* @param item {} The object to remove.
*/
}, {
key: 'remove',
value: function remove(attr, item) {
return this.set(attr, new _ParseOp.RemoveOp([item]));
}
/**
* Returns an instance of a subclass of Parse.Op describing what kind of
* modification has been performed on this field since the last time it was
* saved. For example, after calling object.increment("x"), calling
* object.op("x") would return an instance of Parse.Op.Increment.
*
* @method op
* @param attr {String} The key.
* @returns {Parse.Op} The operation, or undefined if none.
*/
}, {
key: 'op',
value: function op(attr) {
var pending = this._getPendingOps();
for (var i = pending.length; i--;) {
if (pending[i][attr]) {
return pending[i][attr];
}
}
}
/**
* Creates a new model with identical attributes to this one.
* @method clone
* @return {Parse.Object}
*/
}, {
key: 'clone',
value: function clone() {
var clone = new this.constructor();
if (!clone.className) {
clone.className = this.className;
}
if (clone.set) {
clone.set(this.attributes);
}
return clone;
}
/**
* Returns true if this object has never been saved to Parse.
* @method isNew
* @return {Boolean}
*/
}, {
key: 'isNew',
value: function isNew() {
return !this.id;
}
/**
* Returns true if this object was created by the Parse server when the
* object might have already been there (e.g. in the case of a Facebook
* login)
* @method existed
* @return {Boolean}
*/
}, {
key: 'existed',
value: function existed() {
if (!this.id) {
return false;
}
var state = ObjectState.getState(this.className, this._getStateIdentifier());
if (state) {
return state.existed;
}
return false;
}
/**
* Checks if the model is currently in a valid state.
* @method isValid
* @return {Boolean}
*/
}, {
key: 'isValid',
value: function isValid() {
return !this.validate(this.attributes);
}
/**
* You should not call this function directly unless you subclass
* <code>Parse.Object</code>, in which case you can override this method
* to provide additional validation on <code>set</code> and
* <code>save</code>. Your implementation should return
*
* @method validate
* @param {Object} attrs The current data to validate.
* @return {} False if the data is valid. An error object otherwise.
* @see Parse.Object#set
*/
}, {
key: 'validate',
value: function validate(attrs) {
if (attrs.hasOwnProperty('ACL') && !(attrs.ACL instanceof _ParseACL2['default'])) {
return new _ParseError2['default'](_ParseError2['default'].OTHER_CAUSE, 'ACL must be a Parse ACL.');
}
for (var key in attrs) {
if (!/^[A-Za-z][0-9A-Za-z_]*$/.test(key)) {
return new _ParseError2['default'](_ParseError2['default'].INVALID_KEY_NAME);
}
}
return false;
}
/**
* Returns the ACL for this object.
* @method getACL
* @returns {Parse.ACL} An instance of Parse.ACL.
* @see Parse.Object#get
*/
}, {
key: 'getACL',
value: function getACL() {
var acl = this.get('ACL');
if (acl instanceof _ParseACL2['default']) {
return acl;
}
return null;
}
/**
* Sets the ACL to be used for this object.
* @method setACL
* @param {Parse.ACL} acl An instance of Parse.ACL.
* @param {Object} options Optional Backbone-like options object to be
* passed in to set.
* @return {Boolean} Whether the set passed validation.
* @see Parse.Object#set
*/
}, {
key: 'setACL',
value: function setACL(acl, options) {
return this.set('ACL', acl, options);
}
/**
* Clears all attributes on a model
* @method clear
*/
}, {
key: 'clear',
value: function clear() {
var attributes = this.attributes;
var erasable = {};
var readonly = ['createdAt', 'updatedAt'];
if (typeof this.constructor.readOnlyAttributes === 'function') {
readonly = readonly.concat(this.constructor.readOnlyAttributes());
}
for (var attr in attributes) {
if (readonly.indexOf(attr) < 0) {
erasable[attr] = true;
}
}
return this.set(erasable, { unset: true });
}
/**
* Fetch the model from the server. If the server's representation of the
* model differs from its current attributes, they will be overriden.
*
* @method fetch
* @param {Object} options A Backbone-style callback object.
* Valid options are:<ul>
* <li>success: A Backbone-style success callback.
* <li>error: An Backbone-style error callback.
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
* be used for this request.
* <li>sessionToken: A valid session token, used for making a request on
* behalf of a specific user.
* </ul>
* @return {Parse.Promise} A promise that is fulfilled when the fetch
* completes.
*/
}, {
key: 'fetch',
value: function fetch(options) {
options = options || {};
var fetchOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
fetchOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
fetchOptions.sessionToken = options.sessionToken;
}
var controller = _CoreManager2['default'].getObjectController();
return controller.fetch(this, true, fetchOptions)._thenRunCallbacks(options);
}
/**
* Set a hash of model attributes, and save the model to the server.
* updatedAt will be updated when the request returns.
* You can either call it as:<pre>
* object.save();</pre>
* or<pre>
* object.save(null, options);</pre>
* or<pre>
* object.save(attrs, options);</pre>
* or<pre>
* object.save(key, value, options);</pre>
*
* For example, <pre>
* gameTurn.save({
* player: "Jake Cutter",
* diceRoll: 2
* }, {
* success: function(gameTurnAgain) {
* // The save was successful.
* },
* error: function(gameTurnAgain, error) {
* // The save failed. Error is an instance of Parse.Error.
* }
* });</pre>
* or with promises:<pre>
* gameTurn.save({
* player: "Jake Cutter",
* diceRoll: 2
* }).then(function(gameTurnAgain) {
* // The save was successful.
* }, function(error) {
* // The save failed. Error is an instance of Parse.Error.
* });</pre>
*
* @method save
* @param {Object} options A Backbone-style callback object.
* Valid options are:<ul>
* <li>success: A Backbone-style success callback.
* <li>error: An Backbone-style error callback.
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
* be used for this request.
* <li>sessionToken: A valid session token, used for making a request on
* behalf of a specific user.
* </ul>
* @return {Parse.Promise} A promise that is fulfilled when the save
* completes.
*/
}, {
key: 'save',
value: function save(arg1, arg2, arg3) {
var _this = this;
var attrs;
var options;
if (typeof arg1 === 'object' || typeof arg1 === 'undefined') {
attrs = arg1;
options = arg2;
} else {
attrs = {};
attrs[arg1] = arg2;
options = arg3;
}
// Support save({ success: function() {}, error: function() {} })
if (!options && attrs) {
options = {};
if (typeof attrs.success === 'function') {
options.success = attrs.success;
delete attrs.success;
}
if (typeof attrs.error === 'function') {
options.error = attrs.error;
delete attrs.error;
}
}
if (attrs) {
var validation = this.validate(attrs);
if (validation) {
if (options && typeof options.error === 'function') {
options.error(this, validation);
}
return _ParsePromise2['default'].error(validation);
}
this.set(attrs, options);
}
options = options || {};
var saveOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
saveOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
saveOptions.sessionToken = options.sessionToken;
}
var controller = _CoreManager2['default'].getObjectController();
var unsaved = (0, _unsavedChildren2['default'])(this);
return controller.save(unsaved, saveOptions).then(function () {
return controller.save(_this, saveOptions);
})._thenRunCallbacks(options, this);
}
/**
* Destroy this model on the server if it was already persisted.
* If `wait: true` is passed, waits for the server to respond
* before removal.
*
* @method destroy
* @param {Object} options A Backbone-style callback object.
* Valid options are:<ul>
* <li>success: A Backbone-style success callback
* <li>error: An Backbone-style error callback.
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
* be used for this request.
* <li>sessionToken: A valid session token, used for making a request on
* behalf of a specific user.
* </ul>
* @return {Parse.Promise} A promise that is fulfilled when the destroy
* completes.
*/
}, {
key: 'destroy',
value: function destroy(options) {
options = options || {};
var destroyOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
destroyOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
destroyOptions.sessionToken = options.sessionToken;
}
if (!this.id) {
return _ParsePromise2['default'].as()._thenRunCallbacks(options);
}
return _CoreManager2['default'].getObjectController().destroy(this, destroyOptions)._thenRunCallbacks(options);
}
/** Static methods **/
}, {
key: 'attributes',
get: function get() {
return _Object$freeze(ObjectState.estimateAttributes(this.className, this._getStateIdentifier()));
}
/**
* The first time this object was saved on the server.
* @property createdAt
* @type Date
*/
}, {
key: 'createdAt',
get: function get() {
return this._getServerData().createdAt;
}
/**
* The last time this object was updated on the server.
* @property updatedAt
* @type Date
*/
}, {
key: 'updatedAt',
get: function get() {
return this._getServerData().updatedAt;
}
}], [{
key: '_clearAllState',
value: function _clearAllState() {
ObjectState._clearAllState();
}
/**
* Fetches the given list of Parse.Object.
* If any error is encountered, stops and calls the error handler.
*
* <pre>
* Parse.Object.fetchAll([object1, object2, ...], {
* success: function(list) {
* // All the objects were fetched.
* },
* error: function(error) {
* // An error occurred while fetching one of the objects.
* },
* });
* </pre>
*
* @method fetchAll
* @param {Array} list A list of <code>Parse.Object</code>.
* @param {Object} options A Backbone-style callback object.
* @static
* Valid options are:<ul>
* <li>success: A Backbone-style success callback.
* <li>error: An Backbone-style error callback.
* </ul>
*/
}, {
key: 'fetchAll',
value: function fetchAll(list, options) {
var options = options || {};
var queryOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
queryOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
queryOptions.sessionToken = options.sessionToken;
}
return _CoreManager2['default'].getObjectController().fetch(list, true, queryOptions)._thenRunCallbacks(options);
}
/**
* Fetches the given list of Parse.Object if needed.
* If any error is encountered, stops and calls the error handler.
*
* <pre>
* Parse.Object.fetchAllIfNeeded([object1, ...], {
* success: function(list) {
* // Objects were fetched and updated.
* },
* error: function(error) {
* // An error occurred while fetching one of the objects.
* },
* });
* </pre>
*
* @method fetchAllIfNeeded
* @param {Array} list A list of <code>Parse.Object</code>.
* @param {Object} options A Backbone-style callback object.
* @static
* Valid options are:<ul>
* <li>success: A Backbone-style success callback.
* <li>error: An Backbone-style error callback.
* </ul>
*/
}, {
key: 'fetchAllIfNeeded',
value: function fetchAllIfNeeded(list, options) {
var options = options || {};
var queryOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
queryOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
queryOptions.sessionToken = options.sessionToken;
}
return _CoreManager2['default'].getObjectController().fetch(list, false, queryOptions)._thenRunCallbacks(options);
}
/**
* Destroy the given list of models on the server if it was already persisted.
*
* <p>Unlike saveAll, if an error occurs while deleting an individual model,
* this method will continue trying to delete the rest of the models if
* possible, except in the case of a fatal error like a connection error.
*
* <p>In particular, the Parse.Error object returned in the case of error may
* be one of two types:
*
* <ul>
* <li>A Parse.Error.AGGREGATE_ERROR. This object's "errors" property is an
* array of other Parse.Error objects. Each error object in this array
* has an "object" property that references the object that could not be
* deleted (for instance, because that object could not be found).</li>
* <li>A non-aggregate Parse.Error. This indicates a serious error that
* caused the delete operation to be aborted partway through (for
* instance, a connection failure in the middle of the delete).</li>
* </ul>
*
* <pre>
* Parse.Object.destroyAll([object1, object2, ...], {
* success: function() {
* // All the objects were deleted.
* },
* error: function(error) {
* // An error occurred while deleting one or more of the objects.
* // If this is an aggregate error, then we can inspect each error
* // object individually to determine the reason why a particular
* // object was not deleted.
* if (error.code === Parse.Error.AGGREGATE_ERROR) {
* for (var i = 0; i < error.errors.length; i++) {
* console.log("Couldn't delete " + error.errors[i].object.id +
* "due to " + error.errors[i].message);
* }
* } else {
* console.log("Delete aborted because of " + error.message);
* }
* },
* });
* </pre>
*
* @method destroyAll
* @param {Array} list A list of <code>Parse.Object</code>.
* @param {Object} options A Backbone-style callback object.
* @static
* Valid options are:<ul>
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
* be used for this request.
* <li>sessionToken: A valid session token, used for making a request on
* behalf of a specific user.
* </ul>
* @return {Parse.Promise} A promise that is fulfilled when the destroyAll
* completes.
*/
}, {
key: 'destroyAll',
value: function destroyAll(list, options) {
var options = options || {};
var destroyOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
destroyOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
destroyOptions.sessionToken = options.sessionToken;
}
return _CoreManager2['default'].getObjectController().destroy(list, destroyOptions)._thenRunCallbacks(options);
}
/**
* Saves the given list of Parse.Object.
* If any error is encountered, stops and calls the error handler.
*
* <pre>
* Parse.Object.saveAll([object1, object2, ...], {
* success: function(list) {
* // All the objects were saved.
* },
* error: function(error) {
* // An error occurred while saving one of the objects.
* },
* });
* </pre>
*
* @method saveAll
* @param {Array} list A list of <code>Parse.Object</code>.
* @param {Object} options A Backbone-style callback object.
* @static
* Valid options are:<ul>
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
* be used for this request.
* <li>sessionToken: A valid session token, used for making a request on
* behalf of a specific user.
* </ul>
*/
}, {
key: 'saveAll',
value: function saveAll(list, options) {
var options = options || {};
var saveOptions = {};
if (options.hasOwnProperty('useMasterKey')) {
saveOptions.useMasterKey = options.useMasterKey;
}
if (options.hasOwnProperty('sessionToken')) {
saveOptions.sessionToken = options.sessionToken;
}
return _CoreManager2['default'].getObjectController().save(list, saveOptions)._thenRunCallbacks(options);
}
/**
* Creates a reference to a subclass of Parse.Object with the given id. This
* does not exist on Parse.Object, only on subclasses.
*
* <p>A shortcut for: <pre>
* var Foo = Parse.Object.extend("Foo");
* var pointerToFoo = new Foo();
* pointerToFoo.id = "myObjectId";
* </pre>
*
* @method createWithoutData
* @param {String} id The ID of the object to create a reference to.
* @static
* @return {Parse.Object} A Parse.Object reference.
*/
}, {
key: 'createWithoutData',
value: function createWithoutData(id) {
var obj = new this();
obj.id = id;
return obj;
}
/**
* Creates a new instance of a Parse Object from a JSON representation.
* @method fromJSON
* @param {Object} json The JSON map of the Object's data
* @static
* @return {Parse.Object} A Parse.Object reference
*/
}, {
key: 'fromJSON',
value: function fromJSON(json) {
if (!json.className) {
throw new Error('Cannot create an object without a className');
}
var constructor = classMap[json.className];
var o = constructor ? new constructor() : new ParseObject(json.className);
var otherAttributes = {};
for (var attr in json) {
if (attr !== 'className' && attr !== '__type') {
otherAttributes[attr] = json[attr];
}
}
o._finishFetch(otherAttributes);
if (json.objectId) {
o._setExisted(true);
}
return o;
}
/**
* Registers a subclass of Parse.Object with a specific class name.
* When objects of that class are retrieved from a query, they will be
* instantiated with this subclass.
* This is only necessary when using ES6 subclassing.
* @method registerSubclass
* @param {String} className The class name of the subclass
* @param {Class} constructor The subclass
*/
}, {
key: 'registerSubclass',
value: function registerSubclass(className, constructor) {
if (typeof className !== 'string') {
throw new TypeError('The first argument must be a valid class name.');
}
if (typeof constructor === 'undefined') {
throw new TypeError('You must supply a subclass constructor.');
}
if (typeof constructor !== 'function') {
throw new TypeError('You must register the subclass constructor. ' + 'Did you attempt to register an instance of the subclass?');
}
classMap[className] = constructor;
if (!constructor.className) {
constructor.className = className;
}
}
/**
* Creates a new subclass of Parse.Object for the given Parse class name.
*
* <p>Every extension of a Parse class will inherit from the most recent
* previous extension of that class. When a Parse.Object is automatically
* created by parsing JSON, it will use the most recent extension of that
* class.</p>
*
* <p>You should call either:<pre>
* var MyClass = Parse.Object.extend("MyClass", {
* <i>Instance methods</i>,
* initialize: function(attrs, options) {
* this.someInstanceProperty = [],
* <i>Other instance properties</i>
* }
* }, {
* <i>Class properties</i>
* });</pre>
* or, for Backbone compatibility:<pre>
* var MyClass = Parse.Object.extend({
* className: "MyClass",
* <i>Instance methods</i>,
* initialize: function(attrs, options) {
* this.someInstanceProperty = [],
* <i>Other instance properties</i>
* }
* }, {
* <i>Class properties</i>
* });</pre></p>
*
* @method extend
* @param {String} className The name of the Parse class backing this model.
* @param {Object} protoProps Instance properties to add to instances of the
* class returned from this method.
* @param {Object} classProps Class properties to add the class returned from
* this method.
* @return {Class} A new subclass of Parse.Object.
*/
}, {
key: 'extend',
value: function extend(className, protoProps, classProps) {
if (typeof className !== 'string') {
if (className && typeof className.className === 'string') {
return ParseObject.extend(className.className, className, protoProps);
} else {
throw new Error('Parse.Object.extend\'s first argument should be the className.');
}
}
var adjustedClassName = className;
if (adjustedClassName === 'User' && _CoreManager2['default'].get('PERFORM_USER_REWRITE')) {
adjustedClassName = '_User';
}
var parentProto = ParseObject.prototype;
if (this.hasOwnProperty('__super__') && this.__super__) {
parentProto = this.prototype;
} else if (classMap[adjustedClassName]) {
parentProto = classMap[adjustedClassName].prototype;
}
var ParseObjectSubclass = function ParseObjectSubclass(attributes, options) {
// Enable legacy initializers
if (typeof this.initialize === 'function') {
this.initialize.apply(this, arguments);
}
this.className = adjustedClassName;
this._objCount = objectCount++;
if (attributes && typeof attributes === 'object') {
if (!this.set(attributes || {}, options)) {
throw new Error('Can\'t create an invalid Parse Object');
}
}
};
ParseObjectSubclass.className = adjustedClassName;
ParseObjectSubclass.__super__ = parentProto;
ParseObjectSubclass.prototype = _Object$create(parentProto, {
constructor: {
value: ParseObjectSubclass,
enumerable: false,
writable: true,
configurable: true
}
});
if (protoProps) {
for (var prop in protoProps) {
if (prop !== 'className') {
_Object$defineProperty(ParseObjectSubclass.prototype, prop, {
value: protoProps[prop],
enumerable: false,
writable: true,
configurable: true
});
}
}
}
if (classProps) {
for (var prop in classProps) {
if (prop !== 'className') {
_Object$defineProperty(ParseObjectSubclass, prop, {
value: classProps[prop],
enumerable: false,
writable: true,
configurable: true
});
}
}
}
ParseObjectSubclass.extend = function (name, protoProps, classProps) {
if (typeof name === 'string') {
return ParseObject.extend.call(ParseObjectSubclass, name, protoProps, classProps);
}
return ParseObject.extend.call(ParseObjectSubclass, adjustedClassName, name, protoProps);
};
ParseObjectSubclass.createWithoutData = ParseObject.createWithoutData;
classMap[adjustedClassName] = ParseObjectSubclass;
return ParseObjectSubclass;
}
/**
* Enable single instance objects, where any local objects with the same Id
* share the same attributes, and stay synchronized with each other.
* This is disabled by default in server environments, since it can lead to
* security issues.
* @method enableSingleInstance
*/
}, {
key: 'enableSingleInstance',
value: function enableSingleInstance() {
singleInstance = true;
}
/**
* Disable single instance objects, where any local objects with the same Id
* share the same attributes, and stay synchronized with each other.
* When disabled, you can have two instances of the same object in memory
* without them sharing attributes.
* @method disableSingleInstance
*/
}, {
key: 'disableSingleInstance',
value: function disableSingleInstance() {
singleInstance = false;
}
}]);
return ParseObject;
})();
exports['default'] = ParseObject;
_CoreManager2['default'].setObjectController({
fetch: function fetch(target, forceFetch, options) {
if (Array.isArray(target)) {
if (target.length < 1) {
return _ParsePromise2['default'].as([]);
}
var objs = [];
var ids = [];
var className = null;
var results = [];
var error = null;
target.forEach(function (el, i) {
if (error) {
return;
}
if (!className) {
className = el.className;
}
if (className !== el.className) {
error = new _ParseError2['default'](_ParseError2['default'].INVALID_CLASS_NAME, 'All objects should be of the same class');
}
if (!el.id) {
error = new _ParseError2['default'](_ParseError2['default'].MISSING_OBJECT_ID, 'All objects must have an ID');
}
if (forceFetch || _Object$keys(el._getServerData()).length === 0) {
ids.push(el.id);
objs.push(el);
}
results.push(el);
});
if (error) {
return _ParsePromise2['default'].error(error);
}
var query = new _ParseQuery2['default'](className);
query.containedIn('objectId', ids);
query._limit = ids.length;
return query.find(options).then(function (objects) {
var idMap = {};
objects.forEach(function (o) {
idMap[o.id] = o;
});
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
if (!obj || !obj.id || !idMap[obj.id]) {
if (forceFetch) {
return _ParsePromise2['default'].error(new _ParseError2['default'](_ParseError2['default'].OBJECT_NOT_FOUND, 'All objects must exist on the server.'));
}
}
}
if (!singleInstance) {
// If single instance objects are disabled, we need to replace the
for (var i = 0; i < results.length; i++) {
var obj = results[i];
if (obj && obj.id && idMap[obj.id]) {
var id = obj.id;
obj._finishFetch(idMap[id].toJSON());
results[i] = idMap[id];
}
}
}
return _ParsePromise2['default'].as(results);
});
} else {
var RESTController = _CoreManager2['default'].getRESTController();
return RESTController.request('GET', 'classes/' + target.className + '/' + target._getId(), {}, options).then(function (response, status, xhr) {
if (target instanceof ParseObject) {
target._clearPendingOps();
target._finishFetch(response);
}
return target;
});
}
},
destroy: function destroy(target, options) {
var RESTController = _CoreManager2['default'].getRESTController();
if (Array.isArray(target)) {
if (target.length < 1) {
return _ParsePromise2['default'].as([]);
}
var batches = [[]];
target.forEach(function (obj) {
if (!obj.id) {
return;
}
batches[batches.length - 1].push(obj);
if (batches[batches.length - 1].length >= 20) {
batches.push([]);
}
});
if (batches[batches.length - 1].length === 0) {
// If the last batch is empty, remove it
batches.pop();
}
var deleteCompleted = _ParsePromise2['default'].as();
var errors = [];
batches.forEach(function (batch) {
deleteCompleted = deleteCompleted.then(function () {
return RESTController.request('POST', 'batch', {
requests: batch.map(function (obj) {
return {
method: 'DELETE',
path: getServerUrlPath() + 'classes/' + obj.className + '/' + obj._getId(),
body: {}
};
})
}, options).then(function (results) {
for (var i = 0; i < results.length; i++) {
if (results[i] && results[i].hasOwnProperty('error')) {
var err = new _ParseError2['default'](results[i].error.code, results[i].error.error);
err.object = batch[i];
errors.push(err);
}
}
});
});
});
return deleteCompleted.then(function () {
if (errors.length) {
var aggregate = new _ParseError2['default'](_ParseError2['default'].AGGREGATE_ERROR);
aggregate.errors = errors;
return _ParsePromise2['default'].error(aggregate);
}
return _ParsePromise2['default'].as(target);
});
} else if (target instanceof ParseObject) {
return RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then(function () {
return _ParsePromise2['default'].as(target);
});
}
return _ParsePromise2['default'].as(target);
},
save: function save(target, options) {
var RESTController = _CoreManager2['default'].getRESTController();
if (Array.isArray(target)) {
if (target.length < 1) {
return _ParsePromise2['default'].as([]);
}
var unsaved = target.concat();
for (var i = 0; i < target.length; i++) {
if (target[i] instanceof ParseObject) {
unsaved = unsaved.concat((0, _unsavedChildren2['default'])(target[i], true));
}
}
unsaved = (0, _unique2['default'])(unsaved);
var filesSaved = _ParsePromise2['default'].as();
var pending = [];
unsaved.forEach(function (el) {
if (el instanceof _ParseFile2['default']) {
filesSaved = filesSaved.then(function () {
return el.save();
});
} else if (el instanceof ParseObject) {
pending.push(el);
}
});
return filesSaved.then(function () {
var objectError = null;
return _ParsePromise2['default']._continueWhile(function () {
return pending.length > 0;
}, function () {
var batch = [];
var nextPending = [];
pending.forEach(function (el) {
if (batch.length < 20 && (0, _canBeSerialized2['default'])(el)) {
batch.push(el);
} else {
nextPending.push(el);
}
});
pending = nextPending;
if (batch.length < 1) {
return _ParsePromise2['default'].error(new _ParseError2['default'](_ParseError2['default'].OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
}
// Queue up tasks for each object in the batch.
// When every task is ready, the API request will execute
var batchReturned = new _ParsePromise2['default']();
var batchReady = [];
var batchTasks = [];
batch.forEach(function (obj, index) {
var ready = new _ParsePromise2['default']();
batchReady.push(ready);
var task = function task() {
ready.resolve();
return batchReturned.then(function (responses, status) {
if (responses[index].hasOwnProperty('success')) {
obj._handleSaveResponse(responses[index].success, status);
} else {
if (!objectError && responses[index].hasOwnProperty('error')) {
var serverError = responses[index].error;
objectError = new _ParseError2['default'](serverError.code, serverError.error);
// Cancel the rest of the save
pending = [];
}
obj._handleSaveError();
}
});
};
ObjectState.pushPendingState(obj.className, obj._getStateIdentifier());
batchTasks.push(ObjectState.enqueueTask(obj.className, obj._getStateIdentifier(), task));
});
_ParsePromise2['default'].when(batchReady).then(function () {
// Kick off the batch request
return RESTController.request('POST', 'batch', {
requests: batch.map(function (obj) {
var params = obj._getSaveParams();
params.path = getServerUrlPath() + params.path;
return params;
})
}, options);
}).then(function (response, status, xhr) {
batchReturned.resolve(response, status);
});
return _ParsePromise2['default'].when(batchTasks);
}).then(function () {
if (objectError) {
return _ParsePromise2['default'].error(objectError);
}
return _ParsePromise2['default'].as(target);
});
});
} else if (target instanceof ParseObject) {
// copying target lets Flow guarantee the pointer isn't modified elsewhere
var targetCopy = target;
var task = function task() {
var params = targetCopy._getSaveParams();
return RESTController.request(params.method, params.path, params.body, options).then(function (response, status) {
targetCopy._handleSaveResponse(response, status);
}, function (error) {
targetCopy._handleSaveError();
return _ParsePromise2['default'].error(error);
});
};
ObjectState.pushPendingState(target.className, target._getStateIdentifier());
return ObjectState.enqueueTask(target.className, target._getStateIdentifier(), task).then(function () {
return target;
}, function (error) {
return error;
});
}
return _ParsePromise2['default'].as();
}
});
module.exports = exports['default'];
/**
* The ID of this object, unique within its class.
* @property id
* @type String
*/
|
angular.module('blog').controller('NewPostController', function($scope, $http, $state, $rootScope, $cookieStore) {
$scope.isProcessing = false;
$scope.postError = '';
$scope.createPost = function(post) {
if ($scope.container.postForm.$valid) {
$scope.isProcessing = true;
var token = $cookieStore.get('blog_session_token');
$http.defaults.headers.common.Token = token;
$http.post('/api/posts/createpost', post)
.success(function(data, status, headers, config) {
$scope.postError = '';
$scope.isProcessing = false;
//$state.go('root.home');
$state.go('root.viewPost', { id: data.postId });
})
.error(function(data, status, headers, config) {
$scope.postError = data.error;
$scope.isProcessing = false;
});
}
}
});
|
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "type"];
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { elementTypeAcceptingRef, refType } from '@material-ui/utils';
import { unstable_composeClasses as composeClasses } from '@material-ui/unstyled';
import styled from '../styles/styled';
import useThemeProps from '../styles/useThemeProps';
import useForkRef from '../utils/useForkRef';
import useEventCallback from '../utils/useEventCallback';
import useIsFocusVisible from '../utils/useIsFocusVisible';
import TouchRipple from './TouchRipple';
import buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const useUtilityClasses = styleProps => {
const {
disabled,
focusVisible,
focusVisibleClassName,
classes
} = styleProps;
const slots = {
root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']
};
const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
if (focusVisible && focusVisibleClassName) {
composedClasses.root += ` ${focusVisibleClassName}`;
}
return composedClasses;
};
export const ButtonBaseRoot = styled('button', {
name: 'MuiButtonBase',
slot: 'Root',
overridesResolver: (props, styles) => styles.root
})({
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
position: 'relative',
boxSizing: 'border-box',
WebkitTapHighlightColor: 'transparent',
backgroundColor: 'transparent',
// Reset default value
// We disable the focus ring for mouse, touch and keyboard users.
outline: 0,
border: 0,
margin: 0,
// Remove the margin in Safari
borderRadius: 0,
padding: 0,
// Remove the padding in Firefox
cursor: 'pointer',
userSelect: 'none',
verticalAlign: 'middle',
MozAppearance: 'none',
// Reset
WebkitAppearance: 'none',
// Reset
textDecoration: 'none',
// So we take precedent over the style of a native <a /> element.
color: 'inherit',
'&::-moz-focus-inner': {
borderStyle: 'none' // Remove Firefox dotted outline.
},
[`&.${buttonBaseClasses.disabled}`]: {
pointerEvents: 'none',
// Disable link interactions
cursor: 'default'
},
'@media print': {
colorAdjust: 'exact'
}
});
/**
* `ButtonBase` contains as few styles as possible.
* It aims to be a simple building block for creating a button.
* It contains a load of style reset and some focus/ripple logic.
*/
const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {
const props = useThemeProps({
props: inProps,
name: 'MuiButtonBase'
});
const {
action,
centerRipple = false,
children,
className,
component = 'button',
disabled = false,
disableRipple = false,
disableTouchRipple = false,
focusRipple = false,
LinkComponent = 'a',
onBlur,
onClick,
onContextMenu,
onDragLeave,
onFocus,
onFocusVisible,
onKeyDown,
onKeyUp,
onMouseDown,
onMouseLeave,
onMouseUp,
onTouchEnd,
onTouchMove,
onTouchStart,
tabIndex = 0,
TouchRippleProps,
type
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const buttonRef = React.useRef(null);
const rippleRef = React.useRef(null);
const {
isFocusVisibleRef,
onFocus: handleFocusVisible,
onBlur: handleBlurVisible,
ref: focusVisibleRef
} = useIsFocusVisible();
const [focusVisible, setFocusVisible] = React.useState(false);
if (disabled && focusVisible) {
setFocusVisible(false);
}
React.useEffect(() => {
isFocusVisibleRef.current = focusVisible;
}, [focusVisible, isFocusVisibleRef]);
React.useImperativeHandle(action, () => ({
focusVisible: () => {
setFocusVisible(true);
buttonRef.current.focus();
}
}), []);
React.useEffect(() => {
if (focusVisible && focusRipple && !disableRipple) {
rippleRef.current.pulsate();
}
}, [disableRipple, focusRipple, focusVisible]);
function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
return useEventCallback(event => {
if (eventCallback) {
eventCallback(event);
}
const ignore = skipRippleAction;
if (!ignore && rippleRef.current) {
rippleRef.current[rippleAction](event);
}
return true;
});
}
const handleMouseDown = useRippleHandler('start', onMouseDown);
const handleContextMenu = useRippleHandler('stop', onContextMenu);
const handleDragLeave = useRippleHandler('stop', onDragLeave);
const handleMouseUp = useRippleHandler('stop', onMouseUp);
const handleMouseLeave = useRippleHandler('stop', event => {
if (focusVisible) {
event.preventDefault();
}
if (onMouseLeave) {
onMouseLeave(event);
}
});
const handleTouchStart = useRippleHandler('start', onTouchStart);
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
const handleTouchMove = useRippleHandler('stop', onTouchMove);
const handleBlur = useRippleHandler('stop', event => {
handleBlurVisible(event);
if (isFocusVisibleRef.current === false) {
setFocusVisible(false);
}
if (onBlur) {
onBlur(event);
}
}, false);
const handleFocus = useEventCallback(event => {
// Fix for https://github.com/facebook/react/issues/7769
if (!buttonRef.current) {
buttonRef.current = event.currentTarget;
}
handleFocusVisible(event);
if (isFocusVisibleRef.current === true) {
setFocusVisible(true);
if (onFocusVisible) {
onFocusVisible(event);
}
}
if (onFocus) {
onFocus(event);
}
});
const isNonNativeButton = () => {
const button = buttonRef.current;
return component && component !== 'button' && !(button.tagName === 'A' && button.href);
};
/**
* IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
*/
const keydownRef = React.useRef(false);
const handleKeyDown = useEventCallback(event => {
// Check if key is already down to avoid repeats being counted as multiple activations
if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
keydownRef.current = true;
rippleRef.current.stop(event, () => {
rippleRef.current.start(event);
});
}
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
event.preventDefault();
}
if (onKeyDown) {
onKeyDown(event);
} // Keyboard accessibility for non interactive elements
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
event.preventDefault();
if (onClick) {
onClick(event);
}
}
});
const handleKeyUp = useEventCallback(event => {
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
// https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
keydownRef.current = false;
rippleRef.current.stop(event, () => {
rippleRef.current.pulsate(event);
});
}
if (onKeyUp) {
onKeyUp(event);
} // Keyboard accessibility for non interactive elements
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
onClick(event);
}
});
let ComponentProp = component;
if (ComponentProp === 'button' && (other.href || other.to)) {
ComponentProp = LinkComponent;
}
const buttonProps = {};
if (ComponentProp === 'button') {
buttonProps.type = type === undefined ? 'button' : type;
buttonProps.disabled = disabled;
} else {
if (!other.href && !other.to) {
buttonProps.role = 'button';
}
if (disabled) {
buttonProps['aria-disabled'] = disabled;
}
}
const handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
const handleRef = useForkRef(ref, handleOwnRef);
const [mountedState, setMountedState] = React.useState(false);
React.useEffect(() => {
setMountedState(true);
}, []);
const enableTouchRipple = mountedState && !disableRipple && !disabled;
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line react-hooks/rules-of-hooks
React.useEffect(() => {
if (enableTouchRipple && !rippleRef.current) {
console.error(['Material-UI: The `component` prop provided to ButtonBase is invalid.', 'Please make sure the children prop is rendered in this custom component.'].join('\n'));
}
}, [enableTouchRipple]);
}
const styleProps = _extends({}, props, {
centerRipple,
component,
disabled,
disableRipple,
disableTouchRipple,
focusRipple,
tabIndex,
focusVisible
});
const classes = useUtilityClasses(styleProps);
return /*#__PURE__*/_jsxs(ButtonBaseRoot, _extends({
as: ComponentProp,
className: clsx(classes.root, className),
styleProps: styleProps,
onBlur: handleBlur,
onClick: onClick,
onContextMenu: handleContextMenu,
onFocus: handleFocus,
onKeyDown: handleKeyDown,
onKeyUp: handleKeyUp,
onMouseDown: handleMouseDown,
onMouseLeave: handleMouseLeave,
onMouseUp: handleMouseUp,
onDragLeave: handleDragLeave,
onTouchEnd: handleTouchEnd,
onTouchMove: handleTouchMove,
onTouchStart: handleTouchStart,
ref: handleRef,
tabIndex: disabled ? -1 : tabIndex,
type: type
}, buttonProps, other, {
children: [children, enableTouchRipple ?
/*#__PURE__*/
/* TouchRipple is only needed client-side, x2 boost on the server. */
_jsx(TouchRipple, _extends({
ref: rippleRef,
center: centerRipple
}, TouchRippleProps)) : null]
}));
});
process.env.NODE_ENV !== "production" ? ButtonBase.propTypes
/* remove-proptypes */
= {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* A ref for imperative actions.
* It currently only supports `focusVisible()` action.
*/
action: refType,
/**
* If `true`, the ripples are centered.
* They won't start at the cursor interaction position.
* @default false
*/
centerRipple: PropTypes.bool,
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: elementTypeAcceptingRef,
/**
* If `true`, the component is disabled.
* @default false
*/
disabled: PropTypes.bool,
/**
* If `true`, the ripple effect is disabled.
*
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
* @default false
*/
disableRipple: PropTypes.bool,
/**
* If `true`, the touch ripple effect is disabled.
* @default false
*/
disableTouchRipple: PropTypes.bool,
/**
* If `true`, the base button will have a keyboard focus ripple.
* @default false
*/
focusRipple: PropTypes.bool,
/**
* This prop can help identify which element has keyboard focus.
* The class name will be applied when the element gains the focus through keyboard interaction.
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/master/explainer.md).
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
* if needed.
*/
focusVisibleClassName: PropTypes.string,
/**
* @ignore
*/
href: PropTypes
/* @typescript-to-proptypes-ignore */
.any,
/**
* The component used to render a link when the `href` prop is provided.
* @default 'a'
*/
LinkComponent: PropTypes.elementType,
/**
* @ignore
*/
onBlur: PropTypes.func,
/**
* @ignore
*/
onClick: PropTypes.func,
/**
* @ignore
*/
onContextMenu: PropTypes.func,
/**
* @ignore
*/
onDragLeave: PropTypes.func,
/**
* @ignore
*/
onFocus: PropTypes.func,
/**
* Callback fired when the component is focused with a keyboard.
* We trigger a `onFocus` callback too.
*/
onFocusVisible: PropTypes.func,
/**
* @ignore
*/
onKeyDown: PropTypes.func,
/**
* @ignore
*/
onKeyUp: PropTypes.func,
/**
* @ignore
*/
onMouseDown: PropTypes.func,
/**
* @ignore
*/
onMouseLeave: PropTypes.func,
/**
* @ignore
*/
onMouseUp: PropTypes.func,
/**
* @ignore
*/
onTouchEnd: PropTypes.func,
/**
* @ignore
*/
onTouchMove: PropTypes.func,
/**
* @ignore
*/
onTouchStart: PropTypes.func,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.object,
/**
* @default 0
*/
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* Props applied to the `TouchRipple` element.
*/
TouchRippleProps: PropTypes.object,
/**
* @ignore
*/
type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string])
} : void 0;
export default ButtonBase;
|
angular.module('merchello.directives').directive('detachedContentType', function() {
return {
restrict: 'E',
replace: true,
terminal: false,
scope: {
entityType: '@'
},
templateUrl: '/App_Plugins/Merchello/Backoffice/Merchello/Directives/detachedcontenttype.list.tpl.html',
controller: 'Merchello.Directives.DetachedContentTypeListController'
};
});
|
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup Market Market
* @ingroup UnaModules
*
* @{
*/
function BxMarketManageTools(oOptions) {
this._iSearchTimeoutId = false;
this._sActionsUrl = oOptions.sActionUrl;
this._sObjNameGrid = oOptions.sObjNameGrid;
this._sObjName = oOptions.sObjName == undefined ? 'oBxMarketManageTools' : oOptions.sObjName;
this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
}
BxMarketManageTools.prototype.onChangeFilter = function(oFilter) {
var $this = this;
var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
if(sValueSearch == _t('_sys_grid_search'))
sValueSearch = '';
clearTimeout($this._iSearchTimeoutId);
$this._iSearchTimeoutId = setTimeout(function () {
glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
}, 500);
};
BxMarketManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
if($(oButton).hasClass('bx-btn-disabled'))
return false;
bx_menu_popup(sMenuObject, oButton, {}, {
content_id: $(oButton).attr('bx_grid_action_data')
});
};
BxMarketManageTools.prototype.onClickDelete = function(iContentId) {
$('.bx-popup-applied:visible').dolPopupHide();
glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
};
/** @} */
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: "Evaluate the production ArrayLiteral: [ AssignmentExpression ]"
es5id: 11.1.4_A1.3
description: >
Checking various properteis and contents of the array defined with
"var array = [1,2,3,4,5]"
---*/
var array = [1,2,3,4,5];
//CHECK#1
if (typeof array !== "object") {
$ERROR('#1: var array = [1,2,3,4,5]; typeof array === "object". Actual: ' + (typeof array));
}
//CHECK#2
if (array instanceof Array !== true) {
$ERROR('#2: var array = [1,2,3,4,5]; array instanceof Array === true');
}
//CHECK#3
if (array.toString !== Array.prototype.toString) {
$ERROR('#3: var array = [1,2,3,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));
}
//CHECK#4
if (array.length !== 5) {
$ERROR('#4: var array = [1,2,3,4,5]; array.length === 5. Actual: ' + (array.length));
}
//CHECK#5
if (array[0] !== 1) {
$ERROR('#5: var array = [1,2,3,4,5]; array[0] === 1. Actual: ' + (array[0]));
}
//CHECK#6
if (array[1] !== 2) {
$ERROR('#6: var array = [1,2,3,4,5]; array[1] === 2. Actual: ' + (array[1]));
}
//CHECK#7
if (array[2] !== 3) {
$ERROR('#7: var array = [1,2,3,4,5]; array[2] === 3. Actual: ' + (array[2]));
}
//CHECK#8
if (array[3] !== 4) {
$ERROR('#8: var array = [1,2,3,4,5]; array[3] === 4. Actual: ' + (array[3]));
}
//CHECK#9
if (array[4] !== 5) {
$ERROR('#9: var array = [1,2,3,4,5]; array[4] === 5. Actual: ' + (array[4]));
}
|
// { "framework": "Vue" }
/******/ (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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
var __vue_exports__, __vue_options__
var __vue_styles__ = []
/* script */
__vue_exports__ = __webpack_require__(485)
/* template */
var __vue_template__ = __webpack_require__(486)
__vue_options__ = __vue_exports__ = __vue_exports__ || {}
if (
typeof __vue_exports__.default === "object" ||
typeof __vue_exports__.default === "function"
) {
if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
__vue_options__ = __vue_exports__ = __vue_exports__.default
}
if (typeof __vue_options__ === "function") {
__vue_options__ = __vue_options__.options
}
__vue_options__.__file = "/Users/bobning/work/source/weex_fork/examples/vue/modules/storage.vue"
__vue_options__.render = __vue_template__.render
__vue_options__.staticRenderFns = __vue_template__.staticRenderFns
__vue_options__.style = __vue_options__.style || {}
__vue_styles__.forEach(function (module) {
for (var name in module) {
__vue_options__.style[name] = module[name]
}
})
module.exports = __vue_exports__
module.exports.el = 'true'
new Vue(module.exports)
/***/ },
/***/ 381:
/***/ function(module, exports, __webpack_require__) {
var __vue_exports__, __vue_options__
var __vue_styles__ = []
/* styles */
__vue_styles__.push(__webpack_require__(382)
)
/* script */
__vue_exports__ = __webpack_require__(383)
/* template */
var __vue_template__ = __webpack_require__(384)
__vue_options__ = __vue_exports__ = __vue_exports__ || {}
if (
typeof __vue_exports__.default === "object" ||
typeof __vue_exports__.default === "function"
) {
if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
__vue_options__ = __vue_exports__ = __vue_exports__.default
}
if (typeof __vue_options__ === "function") {
__vue_options__ = __vue_options__.options
}
__vue_options__.__file = "/Users/bobning/work/source/weex_fork/examples/vue/include/panel.vue"
__vue_options__.render = __vue_template__.render
__vue_options__.staticRenderFns = __vue_template__.staticRenderFns
__vue_options__.style = __vue_options__.style || {}
__vue_styles__.forEach(function (module) {
for (var name in module) {
__vue_options__.style[name] = module[name]
}
})
module.exports = __vue_exports__
/***/ },
/***/ 382:
/***/ function(module, exports) {
module.exports = {
"panel": {
"marginBottom": 20,
"backgroundColor": "#ffffff",
"borderColor": "#dddddd",
"borderWidth": 1
},
"panel-primary": {
"borderColor": "rgb(40,96,144)"
},
"panel-success": {
"borderColor": "rgb(76,174,76)"
},
"panel-info": {
"borderColor": "rgb(70,184,218)"
},
"panel-warning": {
"borderColor": "rgb(238,162,54)"
},
"panel-danger": {
"borderColor": "rgb(212,63,58)"
},
"panel-header": {
"backgroundColor": "#f5f5f5",
"fontSize": 40,
"color": "#333333"
},
"panel-header-primary": {
"backgroundColor": "rgb(40,96,144)",
"color": "#ffffff"
},
"panel-header-success": {
"backgroundColor": "rgb(92,184,92)",
"color": "#ffffff"
},
"panel-header-info": {
"backgroundColor": "rgb(91,192,222)",
"color": "#ffffff"
},
"panel-header-warning": {
"backgroundColor": "rgb(240,173,78)",
"color": "#ffffff"
},
"panel-header-danger": {
"backgroundColor": "rgb(217,83,79)",
"color": "#ffffff"
}
}
/***/ },
/***/ 383:
/***/ function(module, exports) {
'use strict';
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
module.exports = {
props: {
type: { default: 'default' },
title: { default: '' },
paddingBody: { default: 20 },
paddingHead: { default: 20 },
dataClass: { default: '' }, // FIXME transfer class
border: { default: 0 }
}
};
/***/ },
/***/ 384:
/***/ function(module, exports) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _h('div', {
class: ['panel', 'panel-' + _vm.type],
style: {
borderWidth: _vm.border
}
}, [_h('text', {
class: ['panel-header', 'panel-header-' + _vm.type],
style: {
paddingTop: _vm.paddingHead,
paddingBottom: _vm.paddingHead,
paddingLeft: _vm.paddingHead * 1.5,
paddingRight: _vm.paddingHead * 1.5
}
}, [_vm._s(_vm.title)]), _h('div', {
class: ['panel-body', 'panel-body-' + _vm.type],
style: {
paddingTop: _vm.paddingBody,
paddingBottom: _vm.paddingBody,
paddingLeft: _vm.paddingBody * 1.5,
paddingRight: _vm.paddingBody * 1.5
}
}, [_vm._t("default")])])
},staticRenderFns: []}
module.exports.render._withStripped = true
/***/ },
/***/ 485:
/***/ function(module, exports, __webpack_require__) {
'use strict';
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var storage = __weex_require_module__('storage');
module.exports = {
data: function data() {
return {
setItemResult: 'loading',
getItemResult: 'loading',
removeItemResult: 'loading',
lengthResult: 'loading',
getAllKeysResult: 'loading'
};
},
components: {
panel: __webpack_require__(381)
},
created: function created() {
var me = this;
//setItem
storage.setItem('foo', 'foo-value', function (e) {
console.log('set [foo<->foo-value]:' + JSON.stringify(e));
me.setItemResult = 'foo:' + JSON.stringify(e) + '\n';
});
storage.setItem('bar', 'bar-value', function (e) {
console.log('set [bar<->bar-value]:' + JSON.stringify(e));
me.setItemResult = me.setItemResult + 'bar:' + JSON.stringify(e);
});
//getItem
storage.getItem('foo', function (e) {
console.log('get foo result:' + JSON.stringify(e));
me.getItemResult = 'get foo,value is ' + e.data + '\n';
});
storage.getItem('bar', function (e) {
console.log('get bar result:' + JSON.stringify(e));
me.getItemResult += 'get bar,value is ' + e.data;
});
//length
storage.length(function (e) {
console.log('length:' + JSON.stringify(e));
me.lengthResult = 'current length is ' + e.data;
});
//getAllKeys
storage.getAllKeys(function (e) {
console.log('getAllKeys:' + JSON.stringify(e));
me.getAllKeysResult = '' + e.data;
//me.getAllKeysResult +=' '+ typeof e.data
});
//removeItem
storage.removeItem('foo', function (e) {
console.log('remove foo:' + JSON.stringify(e));
me.removeItemResult = 'remove item foo ' + e.result;
});
}
};
/***/ },
/***/ 486:
/***/ function(module, exports) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _h('scroller', [_h('panel', {
attrs: {
"title": "storage API",
"type": "primary"
}
}, [_h('panel', {
attrs: {
"title": "setItem"
}
}, [_h('text', [_vm._s(_vm.setItemResult)])]), _h('panel', {
attrs: {
"title": "getItem"
}
}, [_h('text', [_vm._s(_vm.getItemResult)])]), _h('panel', {
attrs: {
"title": "length"
}
}, [_h('text', [_vm._s(_vm.lengthResult)])]), _h('panel', {
attrs: {
"title": "getAllKeys"
}
}, [_h('text', [_vm._s(_vm.getAllKeysResult)])]), _h('panel', {
attrs: {
"title": "removeItem"
}
}, [_h('text', [_vm._s(_vm.removeItemResult)])])])])
},staticRenderFns: []}
module.exports.render._withStripped = true
/***/ }
/******/ });
|
exports.BattleScripts = {
init: function () {
var battleFormeIDs = {'Mega':1, 'Mega-X':1, 'Mega-Y':1};
// due to a happy coincidence, no other Pokémon having HP as its min xor max stat changes forme in-battle
var battleAltFormes = [];
for (var i in this.data.Pokedex) {
var dexEntry = this.data.Pokedex[i];
if (dexEntry.forme in battleFormeIDs) {
// should be processed after their base forme is
battleAltFormes.push(i);
continue;
}
var maxValue = dexEntry.baseStats[Object.max(dexEntry.baseStats)];
var minValue = dexEntry.baseStats[Object.min(dexEntry.baseStats)];
if (maxValue === minValue) continue;
var modStats = {};
for (var statID in dexEntry.baseStats) {
if (dexEntry.baseStats[statID] === maxValue) {
modStats[statID] = minValue;
} else if (dexEntry.baseStats[statID] === minValue) {
modStats[statID] = maxValue;
} else {
modStats[statID] = dexEntry.baseStats[statID];
}
}
this.modData('Pokedex', i).baseStats = modStats;
}
// megas inherit the swapped HP from the base forme and ignore it for their own swap
for (var i = 0, len = battleAltFormes.length; i < len; i++) {
var dexEntry = this.data.Pokedex[battleAltFormes[i]];
var swappableStats = Object.reject(dexEntry.baseStats, 'hp');
var maxValue = swappableStats[Object.max(swappableStats)];
var minValue = swappableStats[Object.min(swappableStats)];
if (maxValue === minValue) continue;
var modStats = {'hp': this.data.Pokedex[toId(dexEntry.baseSpecies)].baseStats['hp']};
for (var statID in swappableStats) {
if (swappableStats[statID] === maxValue) {
modStats[statID] = minValue;
} else if (swappableStats[statID] === minValue) {
modStats[statID] = maxValue;
} else {
modStats[statID] = swappableStats[statID];
}
}
this.modData('Pokedex', battleAltFormes[i]).baseStats = modStats;
}
}
};
|
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
// @remove-on-eject-end
'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
// Webpack uses `publicPath` to determine where the app is being served from.
// In development, we always serve from the root. This makes config easier.
const publicPath = '/';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.
const publicUrl = '';
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
// The production configuration is different and lives in a separate file.
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.
devtool: 'cheap-module-source-map',
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.
entry: [
// Include an alternative client for WebpackDevServer. A client's job is to
// connect to WebpackDevServer by a socket and get notified about changes.
// When you save a file, the client will either apply hot updates (in case
// of CSS changes), or refresh the page (in case of JS changes). When you
// make a syntax error, this client will display a syntax error overlay.
// Note: instead of the default WebpackDevServer client, we use a custom one
// to bring better experience for Create React App users. You can replace
// the line below with these two lines if you prefer the stock client:
// require.resolve('webpack-dev-server/client') + '?/',
// require.resolve('webpack/hot/dev-server'),
require.resolve('react-dev-utils/webpackHotDevClient'),
// We ship a few polyfills by default:
require.resolve('./polyfills'),
// Errors should be considered fatal in development
require.resolve('react-error-overlay'),
// Finally, this is your app's code:
paths.appIndexJs,
// We include the app code last so that if there is a runtime error during
// initialization, it doesn't blow up the WebpackDevServer client, and
// changing JS code would still trigger a refresh.
],
output: {
// Next line is not used in dev but WebpackDevServer crashes without it:
path: paths.appBuild,
// Add /* filename */ comments to generated require()s in the output.
pathinfo: true,
// This does not produce a real file. It's just the virtual path that is
// served by WebpackDevServer in development. This is the JS bundle
// containing code from all our entry points, and the Webpack runtime.
filename: 'static/js/bundle.js',
// There are also additional JS chunk files if you use code splitting.
chunkFilename: 'static/js/[name].chunk.js',
// This is the URL that app is served from. We use "/" in development.
publicPath: publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx'],
alias: {
// @remove-on-eject-begin
// Resolve Babel runtime relative to react-scripts.
// It usually still works on npm 3 without this but it would be
// unfortunate to rely on, as react-scripts could be symlinked,
// and thus babel-runtime might not be resolvable from the source.
'babel-runtime': path.dirname(
require.resolve('babel-runtime/package.json')
),
// @remove-on-eject-end
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
// @remove-on-eject-begin
baseConfig: {
extends: [require.resolve('eslint-config-react-app')],
},
ignore: false,
useEslintrc: false,
// @remove-on-eject-end
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
// ** ADDING/UPDATING LOADERS **
// The "file" loader handles all assets unless explicitly excluded.
// The `exclude` list *must* be updated with every change to loader extensions.
// When adding a new loader, you must add its `test`
// as a new entry in the `exclude` list for "file" loader.
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
{
exclude: [
/\.html$/,
/\.(js|jsx)$/,
/\.css$/,
/\.json$/,
/\.bmp$/,
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
// @remove-on-eject-begin
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
// @remove-on-eject-end
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
},
},
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production, we use a plugin to extract that CSS to a file, but
// in development "style" loader enables hot editing of CSS.
{
test: /\.css$/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
],
},
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "file" loader exclusion list.
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In development, this will be an empty string.
new InterpolateHtmlPlugin(env.raw),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
}),
// Add module names to factory functions so they appear in browser profiler.
new webpack.NamedModulesPlugin(),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
new webpack.DefinePlugin(env.stringified),
// This is necessary to emit hot updates (currently CSS only):
new webpack.HotModuleReplacementPlugin(),
// Watcher doesn't work well if you mistype casing in a path so we use
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebookincubator/create-react-app/issues/240
new CaseSensitivePathsPlugin(),
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebookincubator/create-react-app/issues/186
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
},
// Turn off performance hints during development because we don't do any
// splitting or minification in interest of speed. These warnings become
// cumbersome.
performance: {
hints: false,
},
};
|
/*
* Copyright (c) 2009 WiQuery team
*
* 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.
*/
/** English translation */
jQuery(function($) {
$.ui.dialog.wiquery.regional['en'] = {
okButton: 'Ok',
cancelButton: 'Cancel',
questionTitle: 'Question',
waitTitle: 'Please wait',
errorTitle: 'Error',
warningTitle: 'Warning'
};
});
|
/**
* @file
* Some basic behaviors and utility functions for Views UI.
*/
(function ($, Drupal, drupalSettings) {
"use strict";
/**
* @namespace
*/
Drupal.viewsUi = {};
/**
* Improve the user experience of the views edit interface.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches toggling of SQL rewrite warning on the corresponding checkbox.
*/
Drupal.behaviors.viewsUiEditView = {
attach: function () {
// Only show the SQL rewrite warning when the user has chosen the
// corresponding checkbox.
$('[data-drupal-selector="edit-query-options-disable-sql-rewrite"]').on('click', function () {
$('.sql-rewrite-warning').toggleClass('js-hide');
});
}
};
/**
* In the add view wizard, use the view name to prepopulate form fields such
* as page title and menu link.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches behavior for prepopulating page title and menu links, based on
* view name.
*/
Drupal.behaviors.viewsUiAddView = {
attach: function (context) {
var $context = $(context);
// Set up regular expressions to allow only numbers, letters, and dashes.
var exclude = new RegExp('[^a-z0-9\\-]+', 'g');
var replace = '-';
var suffix;
// The page title, block title, and menu link fields can all be
// prepopulated with the view name - no regular expression needed.
var $fields = $context.find('[id^="edit-page-title"], [id^="edit-block-title"], [id^="edit-page-link-properties-title"]');
if ($fields.length) {
if (!this.fieldsFiller) {
this.fieldsFiller = new Drupal.viewsUi.FormFieldFiller($fields);
}
else {
// After an AJAX response, this.fieldsFiller will still have event
// handlers bound to the old version of the form fields (which don't
// exist anymore). The event handlers need to be unbound and then
// rebound to the new markup. Note that jQuery.live is difficult to
// make work in this case because the IDs of the form fields change
// on every AJAX response.
this.fieldsFiller.rebind($fields);
}
}
// Prepopulate the path field with a URLified version of the view name.
var $pathField = $context.find('[id^="edit-page-path"]');
if ($pathField.length) {
if (!this.pathFiller) {
this.pathFiller = new Drupal.viewsUi.FormFieldFiller($pathField, exclude, replace);
}
else {
this.pathFiller.rebind($pathField);
}
}
// Populate the RSS feed field with a URLified version of the view name,
// and an .xml suffix (to make it unique).
var $feedField = $context.find('[id^="edit-page-feed-properties-path"]');
if ($feedField.length) {
if (!this.feedFiller) {
suffix = '.xml';
this.feedFiller = new Drupal.viewsUi.FormFieldFiller($feedField, exclude, replace, suffix);
}
else {
this.feedFiller.rebind($feedField);
}
}
}
};
/**
* Constructor for the {@link Drupal.viewsUi.FormFieldFiller} object.
*
* Prepopulates a form field based on the view name.
*
* @constructor
*
* @param {jQuery} $target
* A jQuery object representing the form field or fields to prepopulate.
* @param {bool} [exclude=false]
* A regular expression representing characters to exclude from
* the target field.
* @param {string} [replace='']
* A string to use as the replacement value for disallowed characters.
* @param {string} [suffix='']
* A suffix to append at the end of the target field content.
*/
Drupal.viewsUi.FormFieldFiller = function ($target, exclude, replace, suffix) {
/**
*
* @type {jQuery}
*/
this.source = $('#edit-label');
/**
*
* @type {jQuery}
*/
this.target = $target;
/**
*
* @type {bool}
*/
this.exclude = exclude || false;
/**
*
* @type {string}
*/
this.replace = replace || '';
/**
*
* @type {string}
*/
this.suffix = suffix || '';
// Create bound versions of this instance's object methods to use as event
// handlers. This will let us easily unbind those specific handlers later
// on. NOTE: jQuery.proxy will not work for this because it assumes we want
// only one bound version of an object method, whereas we need one version
// per object instance.
var self = this;
/**
* Populate the target form field with the altered source field value.
*
* @return {*}
* The result of the _populate call, which should be undefined.
*/
this.populate = function () { return self._populate.call(self); };
/**
* Stop prepopulating the form fields.
*
* @return {*}
* The result of the _unbind call, which should be undefined.
*/
this.unbind = function () { return self._unbind.call(self); };
this.bind();
// Object constructor; no return value.
};
$.extend(Drupal.viewsUi.FormFieldFiller.prototype, /** @lends Drupal.viewsUi.FormFieldFiller# */{
/**
* Bind the form-filling behavior.
*/
bind: function () {
this.unbind();
// Populate the form field when the source changes.
this.source.on('keyup.viewsUi change.viewsUi', this.populate);
// Quit populating the field as soon as it gets focus.
this.target.on('focus.viewsUi', this.unbind);
},
/**
* Get the source form field value as altered by the passed-in parameters.
*
* @return {string}
* The source form field value.
*/
getTransliterated: function () {
var from = this.source.val();
if (this.exclude) {
from = from.toLowerCase().replace(this.exclude, this.replace);
}
return from;
},
/**
* Populate the target form field with the altered source field value.
*/
_populate: function () {
var transliterated = this.getTransliterated();
var suffix = this.suffix;
this.target.each(function (i) {
// Ensure that the maxlength is not exceeded by prepopulating the field.
var maxlength = $(this).attr('maxlength') - suffix.length;
$(this).val(transliterated.substr(0, maxlength) + suffix);
});
},
/**
* Stop prepopulating the form fields.
*/
_unbind: function () {
this.source.off('keyup.viewsUi change.viewsUi', this.populate);
this.target.off('focus.viewsUi', this.unbind);
},
/**
* Bind event handlers to new form fields, after they're replaced via Ajax.
*
* @param {jQuery} $fields
* Fields to rebind functionality to.
*/
rebind: function ($fields) {
this.target = $fields;
this.bind();
}
});
/**
* Adds functionality for the add item form.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches the functionality in {@link Drupal.viewsUi.AddItemForm} to the
* forms in question.
*/
Drupal.behaviors.addItemForm = {
attach: function (context) {
var $context = $(context);
var $form = $context;
// The add handler form may have an id of views-ui-add-handler-form--n.
if (!$context.is('form[id^="views-ui-add-handler-form"]')) {
$form = $context.find('form[id^="views-ui-add-handler-form"]');
}
if ($form.once('views-ui-add-handler-form').length) {
// If we we have an unprocessed views-ui-add-handler-form, let's
// instantiate.
new Drupal.viewsUi.AddItemForm($form);
}
}
};
/**
* Constructs a new AddItemForm.
*
* @constructor
*
* @param {jQuery} $form
* The form element used.
*/
Drupal.viewsUi.AddItemForm = function ($form) {
/**
*
* @type {jQuery}
*/
this.$form = $form;
this.$form.find('.views-filterable-options :checkbox').on('click', $.proxy(this.handleCheck, this));
/**
* Find the wrapper of the displayed text.
*/
this.$selected_div = this.$form.find('.views-selected-options').parent();
this.$selected_div.hide();
/**
*
* @type {Array}
*/
this.checkedItems = [];
};
/**
* Handles a checkbox check.
*
* @param {jQuery.Event} event
* The event triggered.
*/
Drupal.viewsUi.AddItemForm.prototype.handleCheck = function (event) {
var $target = $(event.target);
var label = $.trim($target.next().text());
// Add/remove the checked item to the list.
if ($target.is(':checked')) {
this.$selected_div.show().css('display', 'block');
this.checkedItems.push(label);
}
else {
var position = $.inArray(label, this.checkedItems);
// Delete the item from the list and make sure that the list doesn't have
// undefined items left.
for (var i = 0; i < this.checkedItems.length; i++) {
if (i === position) {
this.checkedItems.splice(i, 1);
i--;
break;
}
}
// Hide it again if none item is selected.
if (this.checkedItems.length === 0) {
this.$selected_div.hide();
}
}
this.refreshCheckedItems();
};
/**
* Refresh the display of the checked items.
*/
Drupal.viewsUi.AddItemForm.prototype.refreshCheckedItems = function () {
// Perhaps we should precache the text div, too.
this.$selected_div.find('.views-selected-options')
.html(this.checkedItems.join(', '))
.trigger('dialogContentResize');
};
/**
* The input field items that add displays must be rendered as `<input>`
* elements. The following behavior detaches the `<input>` elements from the
* DOM, wraps them in an unordered list, then appends them to the list of
* tabs.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Fixes the input elements needed.
*/
Drupal.behaviors.viewsUiRenderAddViewButton = {
attach: function (context) {
// Build the add display menu and pull the display input buttons into it.
var $menu = $(context).find('#views-display-menu-tabs').once('views-ui-render-add-view-button');
if (!$menu.length) {
return;
}
var $addDisplayDropdown = $('<li class="add"><a href="#"><span class="icon add"></span>' + Drupal.t('Add') + '</a><ul class="action-list" style="display:none;"></ul></li>');
var $displayButtons = $menu.nextAll('input.add-display').detach();
$displayButtons.appendTo($addDisplayDropdown.find('.action-list')).wrap('<li>')
.parent().eq(0).addClass('first').end().eq(-1).addClass('last');
// Remove the 'Add ' prefix from the button labels since they're being
// placed in an 'Add' dropdown. @todo This assumes English, but so does
// $addDisplayDropdown above. Add support for translation.
$displayButtons.each(function () {
var label = $(this).val();
if (label.substr(0, 4) === 'Add ') {
$(this).val(label.substr(4));
}
});
$addDisplayDropdown.appendTo($menu);
// Add the click handler for the add display button.
$menu.find('li.add > a').on('click', function (event) {
event.preventDefault();
var $trigger = $(this);
Drupal.behaviors.viewsUiRenderAddViewButton.toggleMenu($trigger);
});
// Add a mouseleave handler to close the dropdown when the user mouses
// away from the item. We use mouseleave instead of mouseout because
// the user is going to trigger mouseout when she moves from the trigger
// link to the sub menu items.
// We use the live binder because the open class on this item will be
// toggled on and off and we want the handler to take effect in the cases
// that the class is present, but not when it isn't.
$('li.add', $menu).on('mouseleave', function (event) {
var $this = $(this);
var $trigger = $this.children('a[href="#"]');
if ($this.children('.action-list').is(':visible')) {
Drupal.behaviors.viewsUiRenderAddViewButton.toggleMenu($trigger);
}
});
}
};
/**
* Toggle menu visibility.
*
* @param {jQuery} $trigger
* The element where the toggle was triggered.
*
*
* @note [@jessebeach] I feel like the following should be a more generic
* function and not written specifically for this UI, but I'm not sure
* where to put it.
*/
Drupal.behaviors.viewsUiRenderAddViewButton.toggleMenu = function ($trigger) {
$trigger.parent().toggleClass('open');
$trigger.next().slideToggle('fast');
};
/**
* Add search options to the views ui.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches {@link Drupal.viewsUi.OptionsSearch} to the views ui filter
* options.
*/
Drupal.behaviors.viewsUiSearchOptions = {
attach: function (context) {
var $context = $(context);
var $form = $context;
// The add handler form may have an id of views-ui-add-handler-form--n.
if (!$context.is('form[id^="views-ui-add-handler-form"]')) {
$form = $context.find('form[id^="views-ui-add-handler-form"]');
}
// Make sure we don't add more than one event handler to the same form.
if ($form.once('views-ui-filter-options').length) {
new Drupal.viewsUi.OptionsSearch($form);
}
}
};
/**
* Constructor for the viewsUi.OptionsSearch object.
*
* The OptionsSearch object filters the available options on a form according
* to the user's search term. Typing in "taxonomy" will show only those
* options containing "taxonomy" in their label.
*
* @constructor
*
* @param {jQuery} $form
* The form element.
*/
Drupal.viewsUi.OptionsSearch = function ($form) {
/**
*
* @type {jQuery}
*/
this.$form = $form;
/**
* Add a keyup handler to the search box.
*/
this.$searchBox = this.$form.find('[data-drupal-selector="edit-override-controls-options-search"]');
this.$searchBox.on('keyup', $.proxy(this.handleKeyup, this));
/**
* Get a list of option labels and their corresponding divs and maintain it
* in memory, so we have as little overhead as possible at keyup time.
*/
this.options = this.getOptions(this.$form.find('.filterable-option'));
// Restripe on initial loading.
this.handleKeyup();
// Trap the ENTER key in the search box so that it doesn't submit the form.
this.$searchBox.on('keypress', function (event) {
if (event.which === 13) {
event.preventDefault();
}
});
};
$.extend(Drupal.viewsUi.OptionsSearch.prototype, /** @lends Drupal.viewsUi.OptionsSearch# */{
/**
* Assemble a list of all the filterable options on the form.
*
* @param {jQuery} $allOptions
* A jQuery object representing the rows of filterable options to be
* shown and hidden depending on the user's search terms.
*
* @return {Array}
* An array of all the filterable options.
*/
getOptions: function ($allOptions) {
var $label;
var $description;
var $option;
var options = [];
var length = $allOptions.length;
for (var i = 0; i < length; i++) {
$option = $($allOptions[i]);
$label = $option.find('label');
$description = $option.find('div.description');
options[i] = {
// Search on the lowercase version of the label text + description.
searchText: $label.text().toLowerCase() + " " + $description.text().toLowerCase(),
// Maintain a reference to the jQuery object for each row, so we don't
// have to create a new object inside the performance-sensitive keyup
// handler.
$div: $option
};
}
return options;
},
/**
* Keyup handler for the search box that hides or shows the relevant
* options.
*
* @param {jQuery.Event} event
* The keyup event.
*/
handleKeyup: function (event) {
var found;
var option;
var zebraClass;
// Determine the user's search query. The search text has been converted
// to lowercase.
var search = this.$searchBox.val().toLowerCase();
var words = search.split(' ');
var wordsLength = words.length;
// Start the counter for restriping rows.
var zebraCounter = 0;
// Search through the search texts in the form for matching text.
var length = this.options.length;
for (var i = 0; i < length; i++) {
// Use a local variable for the option being searched, for performance.
option = this.options[i];
found = true;
// Each word in the search string has to match the item in order for the
// item to be shown.
for (var j = 0; j < wordsLength; j++) {
if (option.searchText.indexOf(words[j]) === -1) {
found = false;
}
}
if (found) {
zebraClass = (zebraCounter % 2) ? 'odd' : 'even';
// Show the checkbox row, and restripe it.
option.$div.removeClass('even odd');
option.$div.addClass(zebraClass);
option.$div.show();
zebraCounter++;
}
else {
// The search string wasn't found; hide this item.
option.$div.hide();
}
}
}
});
/**
* Preview functionality in the views edit form.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches the preview functionality to the view edit form.
*/
Drupal.behaviors.viewsUiPreview = {
attach: function (context) {
// Only act on the edit view form.
var $contextualFiltersBucket = $(context).find('.views-display-column .views-ui-display-tab-bucket.argument');
if ($contextualFiltersBucket.length === 0) {
return;
}
// If the display has no contextual filters, hide the form where you
// enter the contextual filters for the live preview. If it has contextual
// filters, show the form.
var $contextualFilters = $contextualFiltersBucket.find('.views-display-setting a');
if ($contextualFilters.length) {
$('#preview-args').parent().show();
}
else {
$('#preview-args').parent().hide();
}
// Executes an initial preview.
if ($('#edit-displays-live-preview').once('edit-displays-live-preview').is(':checked')) {
$('#preview-submit').once('edit-displays-live-preview').trigger('click');
}
}
};
/**
* Rearranges the filters.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attach handlers to make it possible to rearange the filters in the form
* in question.
* @see Drupal.viewsUi.RearrangeFilterHandler
*/
Drupal.behaviors.viewsUiRearrangeFilter = {
attach: function (context) {
// Only act on the rearrange filter form.
if (typeof Drupal.tableDrag === 'undefined' || typeof Drupal.tableDrag['views-rearrange-filters'] === 'undefined') {
return;
}
var $context = $(context);
var $table = $context.find('#views-rearrange-filters').once('views-rearrange-filters');
var $operator = $context.find('.form-item-filter-groups-operator').once('views-rearrange-filters');
if ($table.length) {
new Drupal.viewsUi.RearrangeFilterHandler($table, $operator);
}
}
};
/**
* Improve the UI of the rearrange filters dialog box.
*
* @constructor
*
* @param {jQuery} $table
* The table in the filter form.
* @param {jQuery} $operator
* The filter groups operator element.
*/
Drupal.viewsUi.RearrangeFilterHandler = function ($table, $operator) {
/**
* Keep a reference to the `<table>` being altered and to the div containing
* the filter groups operator dropdown (if it exists).
*/
this.table = $table;
/**
*
* @type {jQuery}
*/
this.operator = $operator;
/**
*
* @type {bool}
*/
this.hasGroupOperator = this.operator.length > 0;
/**
* Keep a reference to all draggable rows within the table.
*
* @type {jQuery}
*/
this.draggableRows = $table.find('.draggable');
/**
* Keep a reference to the buttons for adding and removing filter groups.
*
* @type {jQuery}
*/
this.addGroupButton = $('input#views-add-group');
/**
* @type {jQuery}
*/
this.removeGroupButtons = $table.find('input.views-remove-group');
// Add links that duplicate the functionality of the (hidden) add and remove
// buttons.
this.insertAddRemoveFilterGroupLinks();
// When there is a filter groups operator dropdown on the page, create
// duplicates of the dropdown between each pair of filter groups.
if (this.hasGroupOperator) {
/**
* @type {jQuery}
*/
this.dropdowns = this.duplicateGroupsOperator();
this.syncGroupsOperators();
}
// Add methods to the tableDrag instance to account for operator cells
// (which span multiple rows), the operator labels next to each filter
// (e.g., "And" or "Or"), the filter groups, and other special aspects of
// this tableDrag instance.
this.modifyTableDrag();
// Initialize the operator labels (e.g., "And" or "Or") that are displayed
// next to the filters in each group, and bind a handler so that they change
// based on the values of the operator dropdown within that group.
this.redrawOperatorLabels();
$table.find('.views-group-title select')
.once('views-rearrange-filter-handler')
.on('change.views-rearrange-filter-handler', $.proxy(this, 'redrawOperatorLabels'));
// Bind handlers so that when a "Remove" link is clicked, we:
// - Update the rowspans of cells containing an operator dropdown (since
// they need to change to reflect the number of rows in each group).
// - Redraw the operator labels next to the filters in the group (since the
// filter that is currently displayed last in each group is not supposed
// to have a label display next to it).
$table.find('a.views-groups-remove-link')
.once('views-rearrange-filter-handler')
.on('click.views-rearrange-filter-handler', $.proxy(this, 'updateRowspans'))
.on('click.views-rearrange-filter-handler', $.proxy(this, 'redrawOperatorLabels'));
};
$.extend(Drupal.viewsUi.RearrangeFilterHandler.prototype, /** @lends Drupal.viewsUi.RearrangeFilterHandler# */{
/**
* Insert links that allow filter groups to be added and removed.
*/
insertAddRemoveFilterGroupLinks: function () {
// Insert a link for adding a new group at the top of the page, and make
// it match the action link styling used in a typical page.html.twig.
// Since Drupal does not provide a theme function for this markup this is
// the best we can do.
$('<ul class="action-links"><li><a id="views-add-group-link" href="#">' + this.addGroupButton.val() + '</a></li></ul>')
.prependTo(this.table.parent())
// When the link is clicked, dynamically click the hidden form button
// for adding a new filter group.
.once('views-rearrange-filter-handler')
.on('click.views-rearrange-filter-handler', $.proxy(this, 'clickAddGroupButton'));
// Find each (visually hidden) button for removing a filter group and
// insert a link next to it.
var length = this.removeGroupButtons.length;
var i;
for (i = 0; i < length; i++) {
var $removeGroupButton = $(this.removeGroupButtons[i]);
var buttonId = $removeGroupButton.attr('id');
$('<a href="#" class="views-remove-group-link">' + Drupal.t('Remove group') + '</a>')
.insertBefore($removeGroupButton)
// When the link is clicked, dynamically click the corresponding form
// button.
.once('views-rearrange-filter-handler')
.on('click.views-rearrange-filter-handler', {buttonId: buttonId}, $.proxy(this, 'clickRemoveGroupButton'));
}
},
/**
* Dynamically click the button that adds a new filter group.
*
* @param {jQuery.Event} event
* The event triggered.
*/
clickAddGroupButton: function (event) {
// Due to conflicts between Drupal core's AJAX system and the Views AJAX
// system, the only way to get this to work seems to be to trigger both
// the mousedown and submit events.
this.addGroupButton
.trigger('mousedown')
.trigger('submit');
event.preventDefault();
},
/**
* Dynamically click a button for removing a filter group.
*
* @param {jQuery.Event} event
* Event being triggered, with event.data.buttonId set to the ID of the
* form button that should be clicked.
*/
clickRemoveGroupButton: function (event) {
this.table.find('#' + event.data.buttonId).trigger('mousedown').trigger('submit');
event.preventDefault();
},
/**
* Move the groups operator so that it's between the first two groups, and
* duplicate it between any subsequent groups.
*
* @return {jQuery}
* An operator element.
*/
duplicateGroupsOperator: function () {
var dropdowns;
var newRow;
var titleRow;
var titleRows = $('tr.views-group-title').once('duplicateGroupsOperator');
if (!titleRows.length) {
return this.operator;
}
// Get rid of the explanatory text around the operator; its placement is
// explanatory enough.
this.operator.find('label').add('div.description').addClass('visually-hidden');
this.operator.find('select').addClass('form-select');
// Keep a list of the operator dropdowns, so we can sync their behavior
// later.
dropdowns = this.operator;
// Move the operator to a new row just above the second group.
titleRow = $('tr#views-group-title-2');
newRow = $('<tr class="filter-group-operator-row"><td colspan="5"></td></tr>');
newRow.find('td').append(this.operator);
newRow.insertBefore(titleRow);
var length = titleRows.length;
// Starting with the third group, copy the operator to a new row above the
// group title.
for (var i = 2; i < length; i++) {
titleRow = $(titleRows[i]);
// Make a copy of the operator dropdown and put it in a new table row.
var fakeOperator = this.operator.clone();
fakeOperator.attr('id', '');
newRow = $('<tr class="filter-group-operator-row"><td colspan="5"></td></tr>');
newRow.find('td').append(fakeOperator);
newRow.insertBefore(titleRow);
dropdowns = dropdowns.add(fakeOperator);
}
return dropdowns;
},
/**
* Make the duplicated groups operators change in sync with each other.
*/
syncGroupsOperators: function () {
if (this.dropdowns.length < 2) {
// We only have one dropdown (or none at all), so there's nothing to
// sync.
return;
}
this.dropdowns.on('change', $.proxy(this, 'operatorChangeHandler'));
},
/**
* Click handler for the operators that appear between filter groups.
*
* Forces all operator dropdowns to have the same value.
*
* @param {jQuery.Event} event
* The event triggered.
*/
operatorChangeHandler: function (event) {
var $target = $(event.target);
var operators = this.dropdowns.find('select').not($target);
// Change the other operators to match this new value.
operators.val($target.val());
},
/**
* @method
*/
modifyTableDrag: function () {
var tableDrag = Drupal.tableDrag['views-rearrange-filters'];
var filterHandler = this;
/**
* Override the row.onSwap method from tabledrag.js.
*
* When a row is dragged to another place in the table, several things
* need to occur.
* - The row needs to be moved so that it's within one of the filter
* groups.
* - The operator cells that span multiple rows need their rowspan
* attributes updated to reflect the number of rows in each group.
* - The operator labels that are displayed next to each filter need to
* be redrawn, to account for the row's new location.
*/
tableDrag.row.prototype.onSwap = function () {
if (filterHandler.hasGroupOperator) {
// Make sure the row that just got moved (this.group) is inside one
// of the filter groups (i.e. below an empty marker row or a
// draggable). If it isn't, move it down one.
var thisRow = $(this.group);
var previousRow = thisRow.prev('tr');
if (previousRow.length && !previousRow.hasClass('group-message') && !previousRow.hasClass('draggable')) {
// Move the dragged row down one.
var next = thisRow.next();
if (next.is('tr')) {
this.swap('after', next);
}
}
filterHandler.updateRowspans();
}
// Redraw the operator labels that are displayed next to each filter, to
// account for the row's new location.
filterHandler.redrawOperatorLabels();
};
/**
* Override the onDrop method from tabledrag.js.
*/
tableDrag.onDrop = function () {
// If the tabledrag change marker (i.e., the "*") has been inserted
// inside a row after the operator label (i.e., "And" or "Or")
// rearrange the items so the operator label continues to appear last.
var changeMarker = $(this.oldRowElement).find('.tabledrag-changed');
if (changeMarker.length) {
// Search for occurrences of the operator label before the change
// marker, and reverse them.
var operatorLabel = changeMarker.prevAll('.views-operator-label');
if (operatorLabel.length) {
operatorLabel.insertAfter(changeMarker);
}
}
// Make sure the "group" dropdown is properly updated when rows are
// dragged into an empty filter group. This is borrowed heavily from
// the block.js implementation of tableDrag.onDrop().
var groupRow = $(this.rowObject.element).prevAll('tr.group-message').get(0);
var groupName = groupRow.className.replace(/([^ ]+[ ]+)*group-([^ ]+)-message([ ]+[^ ]+)*/, '$2');
var groupField = $('select.views-group-select', this.rowObject.element);
if ($(this.rowObject.element).prev('tr').is('.group-message') && !groupField.is('.views-group-select-' + groupName)) {
var oldGroupName = groupField.attr('class').replace(/([^ ]+[ ]+)*views-group-select-([^ ]+)([ ]+[^ ]+)*/, '$2');
groupField.removeClass('views-group-select-' + oldGroupName).addClass('views-group-select-' + groupName);
groupField.val(groupName);
}
};
},
/**
* Redraw the operator labels that are displayed next to each filter.
*/
redrawOperatorLabels: function () {
for (var i = 0; i < this.draggableRows.length; i++) {
// Within the row, the operator labels are displayed inside the first
// table cell (next to the filter name).
var $draggableRow = $(this.draggableRows[i]);
var $firstCell = $draggableRow.find('td').eq(0);
if ($firstCell.length) {
// The value of the operator label ("And" or "Or") is taken from the
// first operator dropdown we encounter, going backwards from the
// current row. This dropdown is the one associated with the current
// row's filter group.
var operatorValue = $draggableRow.prevAll('.views-group-title').find('option:selected').html();
var operatorLabel = '<span class="views-operator-label">' + operatorValue + '</span>';
// If the next visible row after this one is a draggable filter row,
// display the operator label next to the current row. (Checking for
// visibility is necessary here since the "Remove" links hide the
// removed row but don't actually remove it from the document).
var $nextRow = $draggableRow.nextAll(':visible').eq(0);
var $existingOperatorLabel = $firstCell.find('.views-operator-label');
if ($nextRow.hasClass('draggable')) {
// If an operator label was already there, replace it with the new
// one.
if ($existingOperatorLabel.length) {
$existingOperatorLabel.replaceWith(operatorLabel);
}
// Otherwise, append the operator label to the end of the table
// cell.
else {
$firstCell.append(operatorLabel);
}
}
// If the next row doesn't contain a filter, then this is the last row
// in the group. We don't want to display the operator there (since
// operators should only display between two related filters, e.g.
// "filter1 AND filter2 AND filter3"). So we remove any existing label
// that this row has.
else {
$existingOperatorLabel.remove();
}
}
}
},
/**
* Update the rowspan attribute of each cell containing an operator
* dropdown.
*/
updateRowspans: function () {
var $row;
var $currentEmptyRow;
var draggableCount;
var $operatorCell;
var rows = $(this.table).find('tr');
var length = rows.length;
for (var i = 0; i < length; i++) {
$row = $(rows[i]);
if ($row.hasClass('views-group-title')) {
// This row is a title row.
// Keep a reference to the cell containing the dropdown operator.
$operatorCell = $row.find('td.group-operator');
// Assume this filter group is empty, until we find otherwise.
draggableCount = 0;
$currentEmptyRow = $row.next('tr');
$currentEmptyRow.removeClass('group-populated').addClass('group-empty');
// The cell with the dropdown operator should span the title row and
// the "this group is empty" row.
$operatorCell.attr('rowspan', 2);
}
else if ($row.hasClass('draggable') && $row.is(':visible')) {
// We've found a visible filter row, so we now know the group isn't
// empty.
draggableCount++;
$currentEmptyRow.removeClass('group-empty').addClass('group-populated');
// The operator cell should span all draggable rows, plus the title.
$operatorCell.attr('rowspan', draggableCount + 1);
}
}
}
});
/**
* Add a select all checkbox, which checks each checkbox at once.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches select all functionality to the views filter form.
*/
Drupal.behaviors.viewsFilterConfigSelectAll = {
attach: function (context) {
var $context = $(context);
var $selectAll = $context.find('.form-item-options-value-all').once('filterConfigSelectAll');
var $selectAllCheckbox = $selectAll.find('input[type=checkbox]');
var $checkboxes = $selectAll.closest('.form-checkboxes').find('.js-form-type-checkbox:not(.form-item-options-value-all) input[type="checkbox"]');
if ($selectAll.length) {
// Show the select all checkbox.
$selectAll.show();
$selectAllCheckbox.on('click', function () {
// Update all checkbox beside the select all checkbox.
$checkboxes.prop('checked', $(this).is(':checked'));
});
// Uncheck the select all checkbox if any of the others are unchecked.
$checkboxes.on('click', function () {
if ($(this).is('checked') === false) {
$selectAllCheckbox.prop('checked', false);
}
});
}
}
};
/**
* Remove icon class from elements that are themed as buttons or dropbuttons.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Removes the icon class from certain views elements.
*/
Drupal.behaviors.viewsRemoveIconClass = {
attach: function (context) {
$(context).find('.dropbutton').once('dropbutton-icon').find('.icon').removeClass('icon');
}
};
/**
* Change "Expose filter" buttons into checkboxes.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Changes buttons into checkboxes via {@link Drupal.viewsUi.Checkboxifier}.
*/
Drupal.behaviors.viewsUiCheckboxify = {
attach: function (context, settings) {
var $buttons = $('[data-drupal-selector="edit-options-expose-button-button"], [data-drupal-selector="edit-options-group-button-button"]').once('views-ui-checkboxify');
var length = $buttons.length;
var i;
for (i = 0; i < length; i++) {
new Drupal.viewsUi.Checkboxifier($buttons[i]);
}
}
};
/**
* Change the default widget to select the default group according to the
* selected widget for the exposed group.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Changes the default widget based on user input.
*/
Drupal.behaviors.viewsUiChangeDefaultWidget = {
attach: function (context) {
var $context = $(context);
function changeDefaultWidget(event) {
if ($(event.target).prop('checked')) {
$context.find('input.default-radios').parent().hide();
$context.find('td.any-default-radios-row').parent().hide();
$context.find('input.default-checkboxes').parent().show();
}
else {
$context.find('input.default-checkboxes').parent().hide();
$context.find('td.any-default-radios-row').parent().show();
$context.find('input.default-radios').parent().show();
}
}
// Update on widget change.
$context.find('input[name="options[group_info][multiple]"]')
.on('change', changeDefaultWidget)
// Update the first time the form is rendered.
.trigger('change');
}
};
/**
* Attaches expose filter button to a checkbox that triggers its click event.
*
* @constructor
*
* @param {HTMLElement} button
* The DOM object representing the button to be checkboxified.
*/
Drupal.viewsUi.Checkboxifier = function (button) {
this.$button = $(button);
this.$parent = this.$button.parent('div.views-expose, div.views-grouped');
this.$input = this.$parent.find('input:checkbox, input:radio');
// Hide the button and its description.
this.$button.hide();
this.$parent.find('.exposed-description, .grouped-description').hide();
this.$input.on('click', $.proxy(this, 'clickHandler'));
};
/**
* When the checkbox is checked or unchecked, simulate a button press.
*
* @param {jQuery.Event} e
* The event triggered.
*/
Drupal.viewsUi.Checkboxifier.prototype.clickHandler = function (e) {
this.$button
.trigger('click')
.trigger('submit');
};
/**
* Change the Apply button text based upon the override select state.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches behavior to change the Apply button according to the current
* state.
*/
Drupal.behaviors.viewsUiOverrideSelect = {
attach: function (context) {
$(context).find('[data-drupal-selector="edit-override-dropdown"]').once('views-ui-override-button-text').each(function () {
// Closures! :(
var $context = $(context);
var $submit = $context.find('[id^=edit-submit]');
var old_value = $submit.val();
$submit.once('views-ui-override-button-text')
.on('mouseup', function () {
$(this).val(old_value);
return true;
});
$(this).on('change', function () {
var $this = $(this);
if ($this.val() === 'default') {
$submit.val(Drupal.t('Apply (all displays)'));
}
else if ($this.val() === 'default_revert') {
$submit.val(Drupal.t('Revert to default'));
}
else {
$submit.val(Drupal.t('Apply (this display)'));
}
var $dialog = $context.closest('.ui-dialog-content');
$dialog.trigger('dialogButtonsChange');
})
.trigger('change');
});
}
};
/**
* Functionality for the remove link in the views UI.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches behavior for the remove view and remove display links.
*/
Drupal.behaviors.viewsUiHandlerRemoveLink = {
attach: function (context) {
var $context = $(context);
// Handle handler deletion by looking for the hidden checkbox and hiding
// the row.
$context.find('a.views-remove-link').once('views').on('click', function (event) {
var id = $(this).attr('id').replace('views-remove-link-', '');
$context.find('#views-row-' + id).hide();
$context.find('#views-removed-' + id).prop('checked', true);
event.preventDefault();
});
// Handle display deletion by looking for the hidden checkbox and hiding
// the row.
$context.find('a.display-remove-link').once('display').on('click', function (event) {
var id = $(this).attr('id').replace('display-remove-link-', '');
$context.find('#display-row-' + id).hide();
$context.find('#display-removed-' + id).prop('checked', true);
event.preventDefault();
});
}
};
})(jQuery, Drupal, drupalSettings);
|
/*
* Breach: bind_s.js
*
* Copyright (c) 2014, Stanislas Polu. All rights reserved.
*
* @author: spolu
*
* @log:
* - 2013-08-12 spolu Creation
*/
'use strict';
angular.module('breach.services').
factory('_req', function($http, $q, $rootScope) {
function go(httpPromise) {
$rootScope.$broadcast('loading', true);
var d = $q.defer();
httpPromise
.success(function(data, status, headers, config) {
$rootScope.$broadcast('loading', false);
d.resolve(data);
})
.error(function(data, status, headers, config) {
$rootScope.$broadcast('loading', false);
if(!data || !data.error) {
$rootScope.$broadcast('error', data);
return d.reject(data);
}
else {
var error = new Error(data.error.message);
error.name = data.error.name;
$rootScope.$broadcast('error', data.error);
return d.reject(data.error.message);
}
});
return d.promise;
};
return {
'get': function(url, config) {
return go($http.get(url, config));
},
'post': function(url, data, config) {
return go($http.post(url, data, config));
},
'put': function(url, data, config) {
return go($http.put(url, data, config));
},
'del': function(url, config) {
return go($http.delete(url, config));
}
};
});
|
define(['./filter', './negate', './_cb'], function (filter, negate, _cb) {
// Return all the elements for which a truth test fails.
function reject(obj, predicate, context) {
return filter(obj, negate(_cb(predicate)), context);
}
return reject;
});
|
var url = require('url'),
http = require('http'),
https = require('https'),
fs = require('fs'),
qs = require('querystring'),
express = require('express'),
app = express();
// Load config defaults from JSON file.
// Environment variables override defaults.
function loadConfig() {
var config = JSON.parse(fs.readFileSync(__dirname+ '/config.json', 'utf-8'));
for (var i in config) {
config[i] = process.env[i.toUpperCase()] || config[i];
}
console.log('Configuration');
console.log(config);
return config;
}
var config = loadConfig();
function authenticate(code, cb) {
var data = qs.stringify({
client_id: config.oauth_client_id,
client_secret: config.oauth_client_secret,
code: code
});
var reqOptions = {
host: config.oauth_host,
port: config.oauth_port,
path: config.oauth_path,
method: config.oauth_method,
headers: { 'content-length': data.length }
};
var body = "";
var req = https.request(reqOptions, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) { body += chunk; });
res.on('end', function() {
cb(null, qs.parse(body).access_token);
});
});
req.write(data);
req.end();
req.on('error', function(e) { cb(e.message); });
}
// Convenience for allowing CORS on routes - GET only
app.all('*', function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
});
app.get('/authenticate/:code', function(req, res) {
console.log('authenticating code:' + req.params.code);
authenticate(req.params.code, function(err, token) {
var result = err || !token ? {"error": "bad_code"} : { "token": token };
console.log(result);
res.json(result);
});
});
var port = process.env.PORT || config.port || 9999;
app.listen(port, null, function (err) {
console.log('Gatekeeper, at your service: http://localhost:' + port);
});
|
export function isPastDay(d) {
let today = new Date();
today.setHours(0, 0, 0, 0);
return d < today;
}
export function isSameDay(d1, d2) {
d1.setHours(0, 0, 0, 0);
d2.setHours(0, 0, 0, 0);
return d1.getTime() === d2.getTime();
}
export function isBetween(d, d1, d2) {
d.setHours(0, 0, 0, 0);
d1.setHours(0, 0, 0, 0);
d2.setHours(0, 0, 0, 0);
return d1 < d && d < d2;
}
|
import {I18N} from '../../src/i18n';
import {DfValueConverter} from '../../src/df';
import {EventAggregator} from 'aurelia-event-aggregator';
describe('dfvalueconverter tests', () => {
var sut, dfvc;
beforeEach(() => {
sut = new I18N(new EventAggregator());
dfvc = new DfValueConverter(sut);
});
it('should display only the date in the setup locale format by default', () => {
var testDate = new Date(2000, 0, 1, 0,0,1);
expect(dfvc.toView(testDate)).toEqual('1/1/2000');
});
it('should display date in the previously modified locale', (done) => {
sut.setLocale('de').then( () => {
var testDate = new Date(2000, 0, 1, 0,0,1);
expect(dfvc.toView(testDate)).toEqual('1.1.2000');
done();
});
});
it('should display datetime',() => {
var options = {
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit',
hour12: false
};
var testDate = new Date(2000, 0, 1, 0,0,1);
expect(dfvc.toView(testDate,options,'de')).toEqual('01.01.2000, 00:00:01');
});
});
|
define(["Tone/effect/Effect", "helper/Basic"], function (Effect, Basic) {
describe("Effect", function(){
Basic(Effect);
});
});
|
// This file was automatically generated. Do not modify.
'use strict';
goog.provide('Blockly.Msg.pt');
goog.require('Blockly.Msg');
Blockly.Msg.ADD_COMMENT = "Adicionar Comentário";
Blockly.Msg.AUTH = "Please authorize this app to enable your work to be saved and to allow it to be shared by you."; // untranslated
Blockly.Msg.CHANGE_VALUE_TITLE = "Alterar valor:";
Blockly.Msg.CHAT = "Converse com o seu colaborador, ao digitar nesta caixa!";
Blockly.Msg.COLLAPSE_ALL = "Recolher Blocos";
Blockly.Msg.COLLAPSE_BLOCK = "Colapsar Bloco";
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "cor 1";
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "cor 2";
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/";
Blockly.Msg.COLOUR_BLEND_RATIO = "proporção";
Blockly.Msg.COLOUR_BLEND_TITLE = "misturar";
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Mistura duas cores dada uma proporção (0.0 - 1.0).";
Blockly.Msg.COLOUR_PICKER_HELPURL = "http://pt.wikipedia.org/wiki/Cor";
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Escolhe uma cor da paleta de cores.";
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
Blockly.Msg.COLOUR_RANDOM_TITLE = "cor aleatória";
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Escolher cor de forma aleatória.";
Blockly.Msg.COLOUR_RGB_BLUE = "azul";
Blockly.Msg.COLOUR_RGB_GREEN = "verde";
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html";
Blockly.Msg.COLOUR_RGB_RED = "vermelho";
Blockly.Msg.COLOUR_RGB_TITLE = "pinte com";
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Cria uma cor de acordo com a quantidade especificada de vermelho, verde e azul. Todos os valores devem estar entre 0 e 100.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#Loop_Termination_Blocks";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "sair do ciclo";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "continuar com a próxima iteração do ciclo";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Sair do ciclo que está contido.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Ignora o resto deste ciclo e continua na próxima iteração.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Atenção: Este bloco só pode ser usado dentro de um ciclo.";
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://code.google.com/p/blockly/wiki/Ciclos#para_cada";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST = "na lista";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST_TAIL = ""; // untranslated
Blockly.Msg.CONTROLS_FOREACH_INPUT_ITEM = "para cada item";
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Para cada item numa lista, define a variável \"%1\" para o item e então faz algumas instruções.";
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#count_with";
Blockly.Msg.CONTROLS_FOR_INPUT_FROM_TO_BY = "de %1 até %2 de %3 em %3";
Blockly.Msg.CONTROLS_FOR_INPUT_WITH = "contar com";
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Faz com que a variável %1 assuma os valores desde o número inicial até ao número final, contando de acordo com o intervalo especificado e executa os blocos especificados.";
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Acrescente uma condição ao bloco se.";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Acrescente uma condição de excepação final para o bloco se.";
Blockly.Msg.CONTROLS_IF_HELPURL = "http://code.google.com/p/blockly/wiki/If_Then";
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Acrescente, remova ou reordene secções para reconfigurar este bloco se.";
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "senão";
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "senão se";
Blockly.Msg.CONTROLS_IF_MSG_IF = "se";
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Se um valor é verdadeiro, então realize alguns passos.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Se um valor é verdadeiro, então realize o primeiro bloco de instruções. Senão, realize o segundo bloco de instruções";
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Se o primeiro valor é verdadeiro, então realize o primeiro bloco de instruções. Senão, se o segundo valor é verdadeiro, realize o segundo bloco de instruções.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Se o primeiro valor é verdadeiro, então realize o primeiro bloco de instruções. Senão, se o segundo valor é verdadeiro, realize o segundo bloco de instruções. Se nenhum dos blocos for verdadeiro, realize o último bloco de instruções.";
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "http://pt.wikipedia.org/wiki/Estrutura_de_repeti%C3%A7%C3%A3o#Repeti.C3.A7.C3.A3o_com_vari.C3.A1vel_de_controle";
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "faça";
Blockly.Msg.CONTROLS_REPEAT_TITLE = "repita %1 vez";
Blockly.Msg.CONTROLS_REPEAT_TITLE_REPEAT = "repita";
Blockly.Msg.CONTROLS_REPEAT_TITLE_TIMES = "vezes";
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Faça algumas instruções várias vezes.";
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "http://code.google.com/p/blockly/wiki/Repeat";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "repita até";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "repita enquanto";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Enquanto um valor for falso, então faça algumas instruções.";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Enquanto um valor for verdadeiro, então faça algumas instruções.";
Blockly.Msg.DELETE_BLOCK = "Remover Bloco";
Blockly.Msg.DELETE_X_BLOCKS = "Remover %1 Blocos";
Blockly.Msg.DISABLE_BLOCK = "Desabilitar Bloco";
Blockly.Msg.DUPLICATE_BLOCK = "Duplicar";
Blockly.Msg.ENABLE_BLOCK = "Habilitar Bloco";
Blockly.Msg.EXPAND_ALL = "Expandir Blocos";
Blockly.Msg.EXPAND_BLOCK = "Expandir Bloco";
Blockly.Msg.EXTERNAL_INPUTS = "Entradas externas";
Blockly.Msg.HELP = "Ajuda";
Blockly.Msg.INLINE_INPUTS = "Entradas Internas";
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "http://en.wikipedia.org/wiki/Linked_list#Empty_lists";
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "criar lista vazia";
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Retorna uma lista, de tamanho 0, contendo nenhum registo";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "lista";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Acrescente, remova ou reordene as seções para reconfigurar este bloco lista.";
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "criar lista com";
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Acrescenta um item à lista.";
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Cria uma lista com qualquer número de itens.";
Blockly.Msg.LISTS_GET_INDEX_FIRST = "primeiro";
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# a partir do final";
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#";
Blockly.Msg.LISTS_GET_INDEX_GET = "obter";
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "obter e remover";
Blockly.Msg.LISTS_GET_INDEX_LAST = "último";
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "aleatório";
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "remover";
Blockly.Msg.LISTS_GET_INDEX_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Retorna o primeiro item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_END = "Retorna o item da lista na posição especificada. #1 é o último item.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_START = "Retorna o item na posição especificada da lista . #1 é o primeiro item.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Retorna o último item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Retorna um item aleatório de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Remove e retorna o primeiro item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "Remove e retorna o item na posição especificada de uma lista. #1 é o último item.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "Remove e retorna o item na posição especificada de uma lista. #1 é o primeiro item.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Remove e retorna o último item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Remove e retorna um item aleatório de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Remove o primeiro item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "Remove o item na posição especificada de uma lista. #1 é o ultimo item.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "Remove o item de uma posição especifica da lista. #1 é o primeiro item.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Remove o último item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Remove um item aleatório de uma lista.";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "até #, a partir do final";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "até #";
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "para o último";
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#Getting_a_sublist";
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "obtem sublista da primeira lista";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "obtem sublista de # a partir do final";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "obtem sublista de #";
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Cria uma cópia da porção especificada de uma lista.";
Blockly.Msg.LISTS_INDEX_OF_FIRST = "encontre a primeira ocorrência do item";
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#Getting_Items_from_a_List";
Blockly.Msg.LISTS_INDEX_OF_LAST = "encontre a última ocorrência do item";
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Retorna a posição da primeira/última ocorrência do item na lista. Retorna 0 se o texto não for encontrado.";
Blockly.Msg.LISTS_INLIST = "na lista";
Blockly.Msg.LISTS_IS_EMPTY_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#is_empty";
Blockly.Msg.LISTS_IS_EMPTY_TITLE = "%1 está vazia";
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#length_of";
Blockly.Msg.LISTS_LENGTH_TITLE = "tamanho de %1";
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Retorna o tamanho de uma lista.";
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#create_list_with";
Blockly.Msg.LISTS_REPEAT_TITLE = "criar lista com o item %1 repetido %2 vezes";
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Cria uma lista constituída por um dado valor repetido o número de vezes especificado.";
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#in_list_..._set";
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "como";
Blockly.Msg.LISTS_SET_INDEX_INSERT = "inserir em";
Blockly.Msg.LISTS_SET_INDEX_SET = "definir";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Insere o item no início da lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "Insere o item numa posição especificada de uma lista. #1 é o último item.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "Insere o item numa posição especificada numa lista. #1 é o primeiro item.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Insere o item no final da lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Insere o item numa posição aleatória de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Define o primeiro item de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Define o item na posição especificada de uma lista. #1 é o último item.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Define o item na posição especificada de uma lista. #1 é o primeiro item.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Define o último item de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Define um item aleatório de uma lista.";
Blockly.Msg.LISTS_TOOLTIP = "Retona verdadeiro se a lista estiver vazia.";
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "falso";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "http://code.google.com/p/blockly/wiki/True_False";
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Retorna verdadeiro ou falso.";
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "verdadeiro";
Blockly.Msg.LOGIC_COMPARE_HELPURL = "http://pt.wikipedia.org/wiki/Inequa%C3%A7%C3%A3o";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Retorna verdadeiro se ambas as entradas forem iguais entre si.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Retorna verdadeiro se a primeira entrada for maior que a segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Retorna verdadeiro se a primeira entrada for maior ou igual à segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Retorna verdadeiro se a primeira entrada for menor que a segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Retorna verdadeiro se a primeira entrada for menor ou igual à segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Retorna verdadeiro se ambas as entradas forem diferentes entre si.";
Blockly.Msg.LOGIC_NEGATE_HELPURL = "http://code.google.com/p/blockly/wiki/Not";
Blockly.Msg.LOGIC_NEGATE_TITLE = "não %1";
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Retorna verdadeiro se a entrada for falsa. Retorna falso se a entrada for verdadeira.";
Blockly.Msg.LOGIC_NULL = "nulo";
Blockly.Msg.LOGIC_NULL_HELPURL = "http://en.wikipedia.org/wiki/Nullable_type";
Blockly.Msg.LOGIC_NULL_TOOLTIP = "Retorna nulo.";
Blockly.Msg.LOGIC_OPERATION_AND = "e";
Blockly.Msg.LOGIC_OPERATION_HELPURL = "http://code.google.com/p/blockly/wiki/And_Or";
Blockly.Msg.LOGIC_OPERATION_OR = "ou";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Retorna verdadeiro se ambas as entradas forem verdadeiras.";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Retorna verdadeiro se pelo menos uma das estradas for verdadeira.";
Blockly.Msg.LOGIC_TERNARY_CONDITION = "teste";
Blockly.Msg.LOGIC_TERNARY_HELPURL = "http://en.wikipedia.org/wiki/%3F:";
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "se falso";
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "se verdadeiro";
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Avalia a condição em \"teste\". Se a condição for verdadeira retorna o valor \"se verdadeiro\", senão retorna o valor \"se falso\".";
Blockly.Msg.MATH_ADDITION_SYMBOL = "+";
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "http://pt.wikipedia.org/wiki/Aritm%C3%A9tica";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Retorna a soma de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Retorna o quociente da divisão de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Retorna a diferença de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Retorna o produto de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Retorna o primeiro número elevado à potência do segundo número.";
Blockly.Msg.MATH_CHANGE_HELPURL = "http://pt.wikipedia.org/wiki/Adi%C3%A7%C3%A3o";
Blockly.Msg.MATH_CHANGE_INPUT_BY = "por";
Blockly.Msg.MATH_CHANGE_TITLE_CHANGE = "alterar";
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Soma um número à variável \"%1\".";
Blockly.Msg.MATH_CONSTANT_HELPURL = "http://pt.wikipedia.org/wiki/Anexo:Lista_de_constantes_matem%C3%A1ticas";
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Retorna uma das constantes comuns: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), ou ∞ (infinito).";
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "http://en.wikipedia.org/wiki/Clamping_%28graphics%29";
Blockly.Msg.MATH_CONSTRAIN_TITLE = "restringe %1 inferior %2 superior %3";
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Restringe um número entre os limites especificados (inclusive).";
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷";
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "é divisível por";
Blockly.Msg.MATH_IS_EVEN = "é par";
Blockly.Msg.MATH_IS_NEGATIVE = "é negativo";
Blockly.Msg.MATH_IS_ODD = "é impar";
Blockly.Msg.MATH_IS_POSITIVE = "é positivo";
Blockly.Msg.MATH_IS_PRIME = "é primo";
Blockly.Msg.MATH_IS_TOOLTIP = "Verifica se um número é par, impar, primo, inteiro, positivo, negativo, ou se é divisível por outro número. Retorna verdadeiro ou falso.";
Blockly.Msg.MATH_IS_WHOLE = "é inteiro";
Blockly.Msg.MATH_MODULO_HELPURL = "http://pt.wikipedia.org/wiki/Opera%C3%A7%C3%A3o_m%C3%B3dulo";
Blockly.Msg.MATH_MODULO_TITLE = "resto da divisão de %1 ÷ %2";
Blockly.Msg.MATH_MODULO_TOOLTIP = "Retorna o resto da divisão de dois números.";
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×";
Blockly.Msg.MATH_NUMBER_HELPURL = "http://pt.wikipedia.org/wiki/N%C3%BAmero";
Blockly.Msg.MATH_NUMBER_TOOLTIP = "Um número.";
Blockly.Msg.MATH_ONLIST_HELPURL = ""; // untranslated
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "média de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "maior de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "mediana de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "menor de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "moda de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "item aleatório de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "desvio padrão de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "soma da lista";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Retorna a média aritmética dos valores números da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Retorna o maior número da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Retorna a mediana da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Retorna o menor número da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Retorna a lista de item(ns) mais comum(ns) da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Retorna um elemento aleatório da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Retorna o desvio padrão dos números da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Retorna a soma de todos os números da lista.";
Blockly.Msg.MATH_POWER_SYMBOL = "^";
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "http://pt.wikipedia.org/wiki/N%C3%BAmero_aleat%C3%B3rio";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "fração aleatória";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Insere uma fração aleatória entre 0.0 (inclusive) e 1.0 (exclusive).";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "http://pt.wikipedia.org/wiki/N%C3%BAmero_aleat%C3%B3rio";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "inteiro aleatório entre %1 e %2";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Retorna um número inteiro entre os dois limites especificados, inclusive.";
Blockly.Msg.MATH_ROUND_HELPURL = "http://pt.wikipedia.org/wiki/Arredondamento";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "arredonda";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "arredonda para baixo";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "arredonda para cima";
Blockly.Msg.MATH_ROUND_TOOLTIP = "Arredonda um número para cima ou para baixo.";
Blockly.Msg.MATH_SINGLE_HELPURL = "http://pt.wikipedia.org/wiki/Raiz_quadrada";
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "absoluto";
Blockly.Msg.MATH_SINGLE_OP_ROOT = "raíz quadrada";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Retorna o valor absoluto de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Retorna o número e elevado à potência de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Retorna o logarítmo natural de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Retorna o logarítmo em base 10 de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Retorna o oposto de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Retorna 10 elevado à potência de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Retorna a raiz quadrada de um número.";
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-";
Blockly.Msg.MATH_TRIG_ACOS = "acos";
Blockly.Msg.MATH_TRIG_ASIN = "asin";
Blockly.Msg.MATH_TRIG_ATAN = "atan";
Blockly.Msg.MATH_TRIG_COS = "cos";
Blockly.Msg.MATH_TRIG_HELPURL = "http://pt.wikipedia.org/wiki/Fun%C3%A7%C3%A3o_trigonom%C3%A9trica";
Blockly.Msg.MATH_TRIG_SIN = "sin";
Blockly.Msg.MATH_TRIG_TAN = "tan";
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Retorna o arco cosseno de um número.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Retorna o arco seno de um número.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Retorna o arco tangente de um número.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Retorna o cosseno de um grau (não radiano).";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Retorna o seno de um grau (não radiano).";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Retorna a tangente de um grau (não radiano).";
Blockly.Msg.ME = "Me"; // untranslated
Blockly.Msg.NEW_VARIABLE = "Nova variável...";
Blockly.Msg.NEW_VARIABLE_TITLE = "Nome da nova variável:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "allow statements"; // untranslated
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "com:";
Blockly.Msg.PROCEDURES_CALLNORETURN_CALL = ""; // untranslated
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "http://pt.wikipedia.org/wiki/Sub-rotina";
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Executa a função \"%1\".";
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "http://pt.wikipedia.org/wiki/Sub-rotina";
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Executa a função \"%1\" e usa o seu retorno.";
Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "com:";
Blockly.Msg.PROCEDURES_CREATE_DO = "Criar \"%1\"";
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "faz algo";
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "para";
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Cria uma função que não tem retorno.";
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "retorna";
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Cria uma função que possui um valor de retorno.";
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Atenção: Esta função tem parâmetros duplicados.";
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Destacar definição da função";
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "se o valor é verdadeiro, então retorna um segundo valor.";
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Atenção: Este bloco só pode ser utilizado dentro da definição de uma função.";
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "nome da entrada:";
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "entradas";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
Blockly.Msg.REMOVE_COMMENT = "Remover Comentário";
Blockly.Msg.RENAME_VARIABLE = "Renomear variável...";
Blockly.Msg.RENAME_VARIABLE_TITLE = "Renomear todas as variáveis '%1' para:";
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "acrescentar texto";
Blockly.Msg.TEXT_APPEND_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_modification";
Blockly.Msg.TEXT_APPEND_TO = "para";
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Acrescentar um pedaço de texto à variável \"%1\".";
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Adjusting_text_case";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "para minúsculas";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "para Iniciais Maiúsculas";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "para MAIÚSCULAS";
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Retorna uma cópia do texto em formato diferente.";
Blockly.Msg.TEXT_CHARAT_FIRST = "obter primeira letra";
Blockly.Msg.TEXT_CHARAT_FROM_END = "obter letra nº a partir do final";
Blockly.Msg.TEXT_CHARAT_FROM_START = "obter letra nº";
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Extracting_text";
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "no texto";
Blockly.Msg.TEXT_CHARAT_LAST = "obter última letra";
Blockly.Msg.TEXT_CHARAT_RANDOM = "obter letra aleatória";
Blockly.Msg.TEXT_CHARAT_TAIL = ""; // untranslated
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Retorna a letra na posição especificada.";
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Acrescentar um item ao texto.";
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "unir";
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Acrescenta, remove ou reordena seções para reconfigurar este bloco de texto.";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "até letra nº a partir do final";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "até letra nº";
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "até última letra";
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "http://code.google.com/p/blockly/wiki/Text#Extracting_a_region_of_text";
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "no texto";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "obter subsequência a partir da primeira letra";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "obter subsequência de tamanho # a partir do final";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "obter subsequência de tamanho #";
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = ""; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Retorna a parte especificada do texto.";
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Finding_text";
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "no texto";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "primeira ocorrência do texto";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "última ocorrência do texto";
Blockly.Msg.TEXT_INDEXOF_TAIL = ""; // untranslated
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Retorna a posição da primeira/última ocorrência do primeiro texto no segundo texto. Retorna 0 se o texto não for encontrado.";
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Checking_for_empty_text";
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 está vazio";
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Retorna verdadeiro se o texto fornecido estiver vazio.";
Blockly.Msg.TEXT_JOIN_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_creation";
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "criar texto com";
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Criar um pedaço de texto juntando qualquer número de itens.";
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_modification";
Blockly.Msg.TEXT_LENGTH_TITLE = "tamanho de %1";
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Devolve o número de letras (incluindo espaços) do texto fornecido.";
Blockly.Msg.TEXT_PRINT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Printing_text";
Blockly.Msg.TEXT_PRINT_TITLE = "imprime %1";
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Imprime o texto, número ou outro valor especificado.";
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Getting_input_from_the_user";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Pede ao utilizador um número.";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Pede ao utilizador um texto.";
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "pede um número com a mensagem";
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "Pede um texto com a mensagem";
Blockly.Msg.TEXT_TEXT_HELPURL = "http://pt.wikipedia.org/wiki/Cadeia_de_caracteres";
Blockly.Msg.TEXT_TEXT_TOOLTIP = "Uma letra, palavra ou linha de texto.";
Blockly.Msg.TEXT_TRIM_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Trimming_%28removing%29_spaces";
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "remover espaços de ambos os lados";
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "remover espaços à esquerda de";
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "remover espaços à direita";
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Retorna uma cópia do texto com os espaços removidos de uma ou ambas as extremidades.";
Blockly.Msg.VARIABLES_DEFAULT_NAME = "item";
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Criar \"definir %1\"";
Blockly.Msg.VARIABLES_GET_HELPURL = "http://code.google.com/p/blockly/wiki/Variables#Get";
Blockly.Msg.VARIABLES_GET_TAIL = ""; // untranslated
Blockly.Msg.VARIABLES_GET_TITLE = ""; // untranslated
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Retorna o valor desta variável.";
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Criar \"obter %1\"";
Blockly.Msg.VARIABLES_SET_HELPURL = "http://code.google.com/p/blockly/wiki/Variables#Set";
Blockly.Msg.VARIABLES_SET_TAIL = "para";
Blockly.Msg.VARIABLES_SET_TITLE = "definir";
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Define esta variável para o valor inserido.";
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
Blockly.Msg.VARIABLES_SET_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.VARIABLES_GET_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.PROCEDURES_CALLRETURN_CALL = Blockly.Msg.PROCEDURES_CALLNORETURN_CALL;
Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
version https://git-lfs.github.com/spec/v1
oid sha256:6c427d6f51249113e1af60de0c47c70e8a84fd1d80593ab9d0ec05d7062ee925
size 2324
|
(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],d):d(CodeMirror)})(function(d){function g(a,c,b,e){this.cm=a;this.options=e;var f={listenForChanges:!1},d;for(d in e)f[d]=e[d];f.className||(f.className="CodeMirror-search-match");this.annotation=a.annotateScrollbar(f);this.query=
c;this.caseFold=b;this.gap={from:a.firstLine(),to:a.lastLine()+1};this.matches=[];this.update=null;this.findMatches();this.annotation.update(this.matches);var g=this;a.on("change",this.changeHandler=function(a,b){g.onChange(b)})}function h(a,c,b){return a<=c?a:Math.max(c,a+b)}d.defineExtension("showMatchesOnScrollbar",function(a,c,b){"string"==typeof b&&(b={className:b});b||(b={});return new g(this,a,c,b)});g.prototype.findMatches=function(){if(this.gap){for(var a=0;a<this.matches.length;a++){var c=
this.matches[a];if(c.from.line>=this.gap.to)break;c.to.line>=this.gap.from&&this.matches.splice(a--,1)}for(var b=this.cm.getSearchCursor(this.query,d.Pos(this.gap.from,0),this.caseFold),e=this.options&&this.options.maxMatches||1E3;b.findNext();){c={from:b.from(),to:b.to()};if(c.from.line>=this.gap.to)break;this.matches.splice(a++,0,c);if(this.matches.length>e)break}this.gap=null}};g.prototype.onChange=function(a){var c=a.from.line,b=d.changeEnd(a).line,e=b-a.to.line;this.gap?(this.gap.from=Math.min(h(this.gap.from,
c,e),a.from.line),this.gap.to=Math.max(h(this.gap.to,c,e),a.from.line)):this.gap={from:a.from.line,to:b+1};if(e)for(a=0;a<this.matches.length;a++){var b=this.matches[a],f=h(b.from.line,c,e);f!=b.from.line&&(b.from=d.Pos(f,b.from.ch));f=h(b.to.line,c,e);f!=b.to.line&&(b.to=d.Pos(f,b.to.ch))}clearTimeout(this.update);var g=this;this.update=setTimeout(function(){g.updateAfterChange()},250)};g.prototype.updateAfterChange=function(){this.findMatches();this.annotation.update(this.matches)};g.prototype.clear=
function(){this.cm.off("change",this.changeHandler);this.annotation.clear()}});
|
var util = require('util');
var Q = require('q');
var mout = require('mout');
var path = require('path');
var GitResolver = require('./GitResolver');
var copy = require('../../util/copy');
var cmd = require('../../util/cmd');
function GitFsResolver(decEndpoint, config, logger) {
GitResolver.call(this, decEndpoint, config, logger);
// Ensure absolute path
this._source = path.resolve(this._config.cwd, this._source);
}
util.inherits(GitFsResolver, GitResolver);
mout.object.mixIn(GitFsResolver, GitResolver);
// -----------------
// Override the checkout function to work with the local copy
GitFsResolver.prototype._checkout = function() {
var resolution = this._resolution;
// The checkout process could be similar to the GitRemoteResolver by prepending file:// to the source
// But from my performance measures, it's faster to copy the folder and just checkout in there
this._logger.action(
'checkout',
resolution.tag || resolution.branch || resolution.commit,
{
resolution: resolution,
to: this._tempDir
}
);
// Copy files to the temporary directory first
return (
this._copy()
.then(
cmd.bind(
cmd,
'git',
[
'checkout',
'-f',
resolution.tag || resolution.branch || resolution.commit
],
{ cwd: this._tempDir }
)
)
// Cleanup unstaged files
.then(
cmd.bind(cmd, 'git', ['clean', '-f', '-d'], {
cwd: this._tempDir
})
)
);
};
GitFsResolver.prototype._copy = function() {
return copy.copyDir(this._source, this._tempDir);
};
// -----------------
// Grab refs locally
GitFsResolver.refs = function(source) {
var value;
// TODO: Normalize source because of the various available protocols?
value = this._cache.refs.get(source);
if (value) {
return Q.resolve(value);
}
value = cmd('git', ['show-ref', '--tags', '--heads'], {
cwd: source
}).spread(
function(stdout) {
var refs;
refs = stdout
.toString()
.trim() // Trim trailing and leading spaces
.replace(/[\t ]+/g, ' ') // Standardize spaces (some git versions make tabs, other spaces)
.split(/[\r\n]+/); // Split lines into an array
// Update the refs with the actual refs
this._cache.refs.set(source, refs);
return refs;
}.bind(this)
);
// Store the promise to be reused until it resolves
// to a specific value
this._cache.refs.set(source, value);
return value;
};
module.exports = GitFsResolver;
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import resolve from 'rollup-plugin-node-resolve';
const globals = {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/animations': 'ng.animations'
};
export default {
entry: '../../../dist/packages-dist/animations/@angular/animations/browser.es5.js',
dest: '../../../dist/packages-dist/animations/bundles/animations-browser.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.animations.browser',
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
|
version https://git-lfs.github.com/spec/v1
oid sha256:c7e20b0ec942c52b9fe942db3c3acda5dc857714b4adda3297b17eccb42802bc
size 5177
|
Meteor.startup(function() {
const enableQuery = {
_id: 'AutoLinker',
value: true
};
RocketChat.settings.add('AutoLinker', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nLabel: 'Enabled'});
RocketChat.settings.add('AutoLinker_StripPrefix', false, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_StripPrefix_Description', enableQuery});
RocketChat.settings.add('AutoLinker_Urls_Scheme', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery});
RocketChat.settings.add('AutoLinker_Urls_www', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery});
RocketChat.settings.add('AutoLinker_Urls_TLD', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery});
RocketChat.settings.add('AutoLinker_UrlsRegExp', '(://|www\\.).+', {type: 'string', group: 'Message', section: 'AutoLinker', public: true, enableQuery});
RocketChat.settings.add('AutoLinker_Email', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery});
RocketChat.settings.add('AutoLinker_Phone', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_Phone_Description', enableQuery});
});
|
/**
*
* Get the url of current opened website.
*
* <example>
:getUrl.js
it('should get the url of the current page', function () {
browser.url('http://webdriver.io');
var url = browser.getUrl();
console.log(url);
// outputs the following:
// "http://webdriver.io"
});
* </example>
*
* @alias browser.getUrl
* @returns {String} current page url
* @uses protocol/url
* @type property
*
*/
let getUrl = function () {
return this.unify(this.url(), {
extractValue: true
})
}
export default getUrl
|
// Zepto.js
// (c) 2010-2014 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.
var Zepto = (function() {
var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter,
document = window.document,
elementDisplay = {}, classCache = {},
cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },
fragmentRE = /^\s*<(\w+|!)[^>]*>/,
singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
rootNodeRE = /^(?:body|html)$/i,
capitalRE = /([A-Z])/g,
// special attributes that should be get/set via method calls
methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],
adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],
table = document.createElement('table'),
tableRow = document.createElement('tr'),
containers = {
'tr': document.createElement('tbody'),
'tbody': table, 'thead': table, 'tfoot': table,
'td': tableRow, 'th': tableRow,
'*': document.createElement('div')
},
readyRE = /complete|loaded|interactive/,
simpleSelectorRE = /^[\w-]*$/,
class2type = {},
toString = class2type.toString,
zepto = {},
camelize, uniq,
tempParent = document.createElement('div'),
propMap = {
'tabindex': 'tabIndex',
'readonly': 'readOnly',
'for': 'htmlFor',
'class': 'className',
'maxlength': 'maxLength',
'cellspacing': 'cellSpacing',
'cellpadding': 'cellPadding',
'rowspan': 'rowSpan',
'colspan': 'colSpan',
'usemap': 'useMap',
'frameborder': 'frameBorder',
'contenteditable': 'contentEditable'
},
isArray = Array.isArray ||
function(object){ return object instanceof Array }
zepto.matches = function(element, selector) {
if (!selector || !element || element.nodeType !== 1) return false
var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector ||
element.oMatchesSelector || element.matchesSelector
if (matchesSelector) return matchesSelector.call(element, selector)
// fall back to performing a selector:
var match, parent = element.parentNode, temp = !parent
if (temp) (parent = tempParent).appendChild(element)
match = ~zepto.qsa(parent, selector).indexOf(element)
temp && tempParent.removeChild(element)
return match
}
function type(obj) {
return obj == null ? String(obj) :
class2type[toString.call(obj)] || "object"
}
function isFunction(value) { return type(value) == "function" }
function isWindow(obj) { return obj != null && obj == obj.window }
function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }
function isObject(obj) { return type(obj) == "object" }
function isPlainObject(obj) {
return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype
}
function likeArray(obj) { return typeof obj.length == 'number' }
function compact(array) { return filter.call(array, function(item){ return item != null }) }
function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }
camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }
function dasherize(str) {
return str.replace(/::/g, '/')
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
.replace(/_/g, '-')
.toLowerCase()
}
uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }
function classRE(name) {
return name in classCache ?
classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)'))
}
function maybeAddPx(name, value) {
return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value
}
function defaultDisplay(nodeName) {
var element, display
if (!elementDisplay[nodeName]) {
element = document.createElement(nodeName)
document.body.appendChild(element)
display = getComputedStyle(element, '').getPropertyValue("display")
element.parentNode.removeChild(element)
display == "none" && (display = "block")
elementDisplay[nodeName] = display
}
return elementDisplay[nodeName]
}
function children(element) {
return 'children' in element ?
slice.call(element.children) :
$.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })
}
// `$.zepto.fragment` takes a html string and an optional tag name
// to generate DOM nodes nodes from the given html string.
// The generated DOM nodes are returned as an array.
// This function can be overriden in plugins for example to make
// it compatible with browsers that don't support the DOM fully.
zepto.fragment = function(html, name, properties) {
var dom, nodes, container
// A special case optimization for a single tag
if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))
if (!dom) {
if (html.replace) html = html.replace(tagExpanderRE, "<$1></$2>")
if (name === undefined) name = fragmentRE.test(html) && RegExp.$1
if (!(name in containers)) name = '*'
container = containers[name]
container.innerHTML = '' + html
dom = $.each(slice.call(container.childNodes), function(){
container.removeChild(this)
})
}
if (isPlainObject(properties)) {
nodes = $(dom)
$.each(properties, function(key, value) {
if (methodAttributes.indexOf(key) > -1) nodes[key](value)
else nodes.attr(key, value)
})
}
return dom
}
// `$.zepto.Z` swaps out the prototype of the given `dom` array
// of nodes with `$.fn` and thus supplying all the Zepto functions
// to the array. Note that `__proto__` is not supported on Internet
// Explorer. This method can be overriden in plugins.
zepto.Z = function(dom, selector) {
dom = dom || []
dom.__proto__ = $.fn
dom.selector = selector || ''
return dom
}
// `$.zepto.isZ` should return `true` if the given object is a Zepto
// collection. This method can be overriden in plugins.
zepto.isZ = function(object) {
return object instanceof zepto.Z
}
// `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and
// takes a CSS selector and an optional context (and handles various
// special cases).
// This method can be overriden in plugins.
zepto.init = function(selector, context) {
var dom
// If nothing given, return an empty Zepto collection
if (!selector) return zepto.Z()
// Optimize for string selectors
else if (typeof selector == 'string') {
selector = selector.trim()
// If it's a html fragment, create nodes from it
// Note: In both Chrome 21 and Firefox 15, DOM error 12
// is thrown if the fragment doesn't begin with <
if (selector[0] == '<' && fragmentRE.test(selector))
dom = zepto.fragment(selector, RegExp.$1, context), selector = null
// If there's a context, create a collection on that context first, and select
// nodes from there
else if (context !== undefined) return $(context).find(selector)
// If it's a CSS selector, use it to select nodes.
else dom = zepto.qsa(document, selector)
}
// If a function is given, call it when the DOM is ready
else if (isFunction(selector)) return $(document).ready(selector)
// If a Zepto collection is given, just return it
else if (zepto.isZ(selector)) return selector
else {
// normalize array if an array of nodes is given
if (isArray(selector)) dom = compact(selector)
// Wrap DOM nodes.
else if (isObject(selector))
dom = [selector], selector = null
// If it's a html fragment, create nodes from it
else if (fragmentRE.test(selector))
dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null
// If there's a context, create a collection on that context first, and select
// nodes from there
else if (context !== undefined) return $(context).find(selector)
// And last but no least, if it's a CSS selector, use it to select nodes.
else dom = zepto.qsa(document, selector)
}
// create a new Zepto collection from the nodes found
return zepto.Z(dom, selector)
}
// `$` will be the base `Zepto` object. When calling this
// function just call `$.zepto.init, which makes the implementation
// details of selecting nodes and creating Zepto collections
// patchable in plugins.
$ = function(selector, context){
return zepto.init(selector, context)
}
function extend(target, source, deep) {
for (key in source)
if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
if (isPlainObject(source[key]) && !isPlainObject(target[key]))
target[key] = {}
if (isArray(source[key]) && !isArray(target[key]))
target[key] = []
extend(target[key], source[key], deep)
}
else if (source[key] !== undefined) target[key] = source[key]
}
// Copy all but undefined properties from one or more
// objects to the `target` object.
$.extend = function(target){
var deep, args = slice.call(arguments, 1)
if (typeof target == 'boolean') {
deep = target
target = args.shift()
}
args.forEach(function(arg){ extend(target, arg, deep) })
return target
}
// `$.zepto.qsa` is Zepto's CSS selector implementation which
// uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.
// This method can be overriden in plugins.
zepto.qsa = function(element, selector){
var found,
maybeID = selector[0] == '#',
maybeClass = !maybeID && selector[0] == '.',
nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked
isSimple = simpleSelectorRE.test(nameOnly)
return (isDocument(element) && isSimple && maybeID) ?
( (found = element.getElementById(nameOnly)) ? [found] : [] ) :
(element.nodeType !== 1 && element.nodeType !== 9) ? [] :
slice.call(
isSimple && !maybeID ?
maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class
element.getElementsByTagName(selector) : // Or a tag
element.querySelectorAll(selector) // Or it's not simple, and we need to query all
)
}
function filtered(nodes, selector) {
return selector == null ? $(nodes) : $(nodes).filter(selector)
}
$.contains = document.documentElement.contains ?
function(parent, node) {
return parent !== node && parent.contains(node)
} :
function(parent, node) {
while (node && (node = node.parentNode))
if (node === parent) return true
return false
}
function funcArg(context, arg, idx, payload) {
return isFunction(arg) ? arg.call(context, idx, payload) : arg
}
function setAttribute(node, name, value) {
value == null ? node.removeAttribute(name) : node.setAttribute(name, value)
}
// access className property while respecting SVGAnimatedString
function className(node, value){
var klass = node.className,
svg = klass && klass.baseVal !== undefined
if (value === undefined) return svg ? klass.baseVal : klass
svg ? (klass.baseVal = value) : (node.className = value)
}
// "true" => true
// "false" => false
// "null" => null
// "42" => 42
// "42.5" => 42.5
// "08" => "08"
// JSON => parse if valid
// String => self
function deserializeValue(value) {
var num
try {
return value ?
value == "true" ||
( value == "false" ? false :
value == "null" ? null :
!/^0/.test(value) && !isNaN(num = Number(value)) ? num :
/^[\[\{]/.test(value) ? $.parseJSON(value) :
value )
: value
} catch(e) {
return value
}
}
$.type = type
$.isFunction = isFunction
$.isWindow = isWindow
$.isArray = isArray
$.isPlainObject = isPlainObject
$.isEmptyObject = function(obj) {
var name
for (name in obj) return false
return true
}
$.inArray = function(elem, array, i){
return emptyArray.indexOf.call(array, elem, i)
}
$.camelCase = camelize
$.trim = function(str) {
return str == null ? "" : String.prototype.trim.call(str)
}
// plugin compatibility
$.uuid = 0
$.support = { }
$.expr = { }
$.map = function(elements, callback){
var value, values = [], i, key
if (likeArray(elements))
for (i = 0; i < elements.length; i++) {
value = callback(elements[i], i)
if (value != null) values.push(value)
}
else
for (key in elements) {
value = callback(elements[key], key)
if (value != null) values.push(value)
}
return flatten(values)
}
$.each = function(elements, callback){
var i, key
if (likeArray(elements)) {
for (i = 0; i < elements.length; i++)
if (callback.call(elements[i], i, elements[i]) === false) return elements
} else {
for (key in elements)
if (callback.call(elements[key], key, elements[key]) === false) return elements
}
return elements
}
$.grep = function(elements, callback){
return filter.call(elements, callback)
}
if (window.JSON) $.parseJSON = JSON.parse
// Populate the class2type map
$.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase()
})
// Define methods that will be available on all
// Zepto collections
$.fn = {
// Because a collection acts like an array
// copy over these useful array functions.
forEach: emptyArray.forEach,
reduce: emptyArray.reduce,
push: emptyArray.push,
sort: emptyArray.sort,
indexOf: emptyArray.indexOf,
concat: emptyArray.concat,
// `map` and `slice` in the jQuery API work differently
// from their array counterparts
map: function(fn){
return $($.map(this, function(el, i){ return fn.call(el, i, el) }))
},
slice: function(){
return $(slice.apply(this, arguments))
},
ready: function(callback){
// need to check if document.body exists for IE as that browser reports
// document ready when it hasn't yet created the body element
if (readyRE.test(document.readyState) && document.body) callback($)
else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)
return this
},
get: function(idx){
return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]
},
toArray: function(){ return this.get() },
size: function(){
return this.length
},
remove: function(){
return this.each(function(){
if (this.parentNode != null)
this.parentNode.removeChild(this)
})
},
each: function(callback){
emptyArray.every.call(this, function(el, idx){
return callback.call(el, idx, el) !== false
})
return this
},
filter: function(selector){
if (isFunction(selector)) return this.not(this.not(selector))
return $(filter.call(this, function(element){
return zepto.matches(element, selector)
}))
},
add: function(selector,context){
return $(uniq(this.concat($(selector,context))))
},
is: function(selector){
return this.length > 0 && zepto.matches(this[0], selector)
},
not: function(selector){
var nodes=[]
if (isFunction(selector) && selector.call !== undefined)
this.each(function(idx){
if (!selector.call(this,idx)) nodes.push(this)
})
else {
var excludes = typeof selector == 'string' ? this.filter(selector) :
(likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)
this.forEach(function(el){
if (excludes.indexOf(el) < 0) nodes.push(el)
})
}
return $(nodes)
},
has: function(selector){
return this.filter(function(){
return isObject(selector) ?
$.contains(this, selector) :
$(this).find(selector).size()
})
},
eq: function(idx){
return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)
},
first: function(){
var el = this[0]
return el && !isObject(el) ? el : $(el)
},
last: function(){
var el = this[this.length - 1]
return el && !isObject(el) ? el : $(el)
},
find: function(selector){
var result, $this = this
if (!selector) result = []
else if (typeof selector == 'object')
result = $(selector).filter(function(){
var node = this
return emptyArray.some.call($this, function(parent){
return $.contains(parent, node)
})
})
else if (this.length == 1) result = $(zepto.qsa(this[0], selector))
else result = this.map(function(){ return zepto.qsa(this, selector) })
return result
},
closest: function(selector, context){
var node = this[0], collection = false
if (typeof selector == 'object') collection = $(selector)
while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))
node = node !== context && !isDocument(node) && node.parentNode
return $(node)
},
parents: function(selector){
var ancestors = [], nodes = this
while (nodes.length > 0)
nodes = $.map(nodes, function(node){
if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {
ancestors.push(node)
return node
}
})
return filtered(ancestors, selector)
},
parent: function(selector){
return filtered(uniq(this.pluck('parentNode')), selector)
},
children: function(selector){
return filtered(this.map(function(){ return children(this) }), selector)
},
contents: function() {
return this.map(function() { return slice.call(this.childNodes) })
},
siblings: function(selector){
return filtered(this.map(function(i, el){
return filter.call(children(el.parentNode), function(child){ return child!==el })
}), selector)
},
empty: function(){
return this.each(function(){ this.innerHTML = '' })
},
// `pluck` is borrowed from Prototype.js
pluck: function(property){
return $.map(this, function(el){ return el[property] })
},
show: function(){
return this.each(function(){
this.style.display == "none" && (this.style.display = '')
if (getComputedStyle(this, '').getPropertyValue("display") == "none")
this.style.display = defaultDisplay(this.nodeName)
})
},
replaceWith: function(newContent){
return this.before(newContent).remove()
},
wrap: function(structure){
var func = isFunction(structure)
if (this[0] && !func)
var dom = $(structure).get(0),
clone = dom.parentNode || this.length > 1
return this.each(function(index){
$(this).wrapAll(
func ? structure.call(this, index) :
clone ? dom.cloneNode(true) : dom
)
})
},
wrapAll: function(structure){
if (this[0]) {
$(this[0]).before(structure = $(structure))
var children
// drill down to the inmost element
while ((children = structure.children()).length) structure = children.first()
$(structure).append(this)
}
return this
},
wrapInner: function(structure){
var func = isFunction(structure)
return this.each(function(index){
var self = $(this), contents = self.contents(),
dom = func ? structure.call(this, index) : structure
contents.length ? contents.wrapAll(dom) : self.append(dom)
})
},
unwrap: function(){
this.parent().each(function(){
$(this).replaceWith($(this).children())
})
return this
},
clone: function(){
return this.map(function(){ return this.cloneNode(true) })
},
hide: function(){
return this.css("display", "none")
},
toggle: function(setting){
return this.each(function(){
var el = $(this)
;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide()
})
},
prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },
next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },
html: function(html){
return 0 in arguments ?
this.each(function(idx){
var originHtml = this.innerHTML
$(this).empty().append( funcArg(this, html, idx, originHtml) )
}) :
(0 in this ? this[0].innerHTML : null)
},
text: function(text){
return 0 in arguments ?
this.each(function(idx){
var newText = funcArg(this, text, idx, this.textContent)
this.textContent = newText == null ? '' : ''+newText
}) :
(0 in this ? this[0].textContent : null)
},
attr: function(name, value){
var result
return (typeof name == 'string' && !(1 in arguments)) ?
(!this.length || this[0].nodeType !== 1 ? undefined :
(!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result
) :
this.each(function(idx){
if (this.nodeType !== 1) return
if (isObject(name)) for (key in name) setAttribute(this, key, name[key])
else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))
})
},
removeAttr: function(name){
return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) })
},
prop: function(name, value){
name = propMap[name] || name
return (1 in arguments) ?
this.each(function(idx){
this[name] = funcArg(this, value, idx, this[name])
}) :
(this[0] && this[0][name])
},
data: function(name, value){
var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()
var data = (1 in arguments) ?
this.attr(attrName, value) :
this.attr(attrName)
return data !== null ? deserializeValue(data) : undefined
},
val: function(value){
return 0 in arguments ?
this.each(function(idx){
this.value = funcArg(this, value, idx, this.value)
}) :
(this[0] && (this[0].multiple ?
$(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :
this[0].value)
)
},
offset: function(coordinates){
if (coordinates) return this.each(function(index){
var $this = $(this),
coords = funcArg(this, coordinates, index, $this.offset()),
parentOffset = $this.offsetParent().offset(),
props = {
top: coords.top - parentOffset.top,
left: coords.left - parentOffset.left
}
if ($this.css('position') == 'static') props['position'] = 'relative'
$this.css(props)
})
if (!this.length) return null
var obj = this[0].getBoundingClientRect()
return {
left: obj.left + window.pageXOffset,
top: obj.top + window.pageYOffset,
width: Math.round(obj.width),
height: Math.round(obj.height)
}
},
css: function(property, value){
if (arguments.length < 2) {
var element = this[0], computedStyle = getComputedStyle(element, '')
if(!element) return
if (typeof property == 'string')
return element.style[camelize(property)] || computedStyle.getPropertyValue(property)
else if (isArray(property)) {
var props = {}
$.each(isArray(property) ? property: [property], function(_, prop){
props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))
})
return props
}
}
var css = ''
if (type(property) == 'string') {
if (!value && value !== 0)
this.each(function(){ this.style.removeProperty(dasherize(property)) })
else
css = dasherize(property) + ":" + maybeAddPx(property, value)
} else {
for (key in property)
if (!property[key] && property[key] !== 0)
this.each(function(){ this.style.removeProperty(dasherize(key)) })
else
css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'
}
return this.each(function(){ this.style.cssText += ';' + css })
},
index: function(element){
return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])
},
hasClass: function(name){
if (!name) return false
return emptyArray.some.call(this, function(el){
return this.test(className(el))
}, classRE(name))
},
addClass: function(name){
if (!name) return this
return this.each(function(idx){
classList = []
var cls = className(this), newName = funcArg(this, name, idx, cls)
newName.split(/\s+/g).forEach(function(klass){
if (!$(this).hasClass(klass)) classList.push(klass)
}, this)
classList.length && className(this, cls + (cls ? " " : "") + classList.join(" "))
})
},
removeClass: function(name){
return this.each(function(idx){
if (name === undefined) return className(this, '')
classList = className(this)
funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){
classList = classList.replace(classRE(klass), " ")
})
className(this, classList.trim())
})
},
toggleClass: function(name, when){
if (!name) return this
return this.each(function(idx){
var $this = $(this), names = funcArg(this, name, idx, className(this))
names.split(/\s+/g).forEach(function(klass){
(when === undefined ? !$this.hasClass(klass) : when) ?
$this.addClass(klass) : $this.removeClass(klass)
})
})
},
scrollTop: function(value){
if (!this.length) return
var hasScrollTop = 'scrollTop' in this[0]
if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset
return this.each(hasScrollTop ?
function(){ this.scrollTop = value } :
function(){ this.scrollTo(this.scrollX, value) })
},
scrollLeft: function(value){
if (!this.length) return
var hasScrollLeft = 'scrollLeft' in this[0]
if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset
return this.each(hasScrollLeft ?
function(){ this.scrollLeft = value } :
function(){ this.scrollTo(value, this.scrollY) })
},
position: function() {
if (!this.length) return
var elem = this[0],
// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= parseFloat( $(elem).css('margin-top') ) || 0
offset.left -= parseFloat( $(elem).css('margin-left') ) || 0
// Add offsetParent borders
parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0
parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0
// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
}
},
offsetParent: function() {
return this.map(function(){
var parent = this.offsetParent || document.body
while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static")
parent = parent.offsetParent
return parent
})
}
}
// for now
$.fn.detach = $.fn.remove
// Generate the `width` and `height` functions
;['width', 'height'].forEach(function(dimension){
var dimensionProperty =
dimension.replace(/./, function(m){ return m[0].toUpperCase() })
$.fn[dimension] = function(value){
var offset, el = this[0]
if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :
isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :
(offset = this.offset()) && offset[dimension]
else return this.each(function(idx){
el = $(this)
el.css(dimension, funcArg(this, value, idx, el[dimension]()))
})
}
})
function traverseNode(node, fun) {
fun(node)
for (var i = 0, len = node.childNodes.length; i < len; i++)
traverseNode(node.childNodes[i], fun)
}
// Generate the `after`, `prepend`, `before`, `append`,
// `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.
adjacencyOperators.forEach(function(operator, operatorIndex) {
var inside = operatorIndex % 2 //=> prepend, append
$.fn[operator] = function(){
// arguments can be nodes, arrays of nodes, Zepto objects and HTML strings
var argType, nodes = $.map(arguments, function(arg) {
argType = type(arg)
return argType == "object" || argType == "array" || arg == null ?
arg : zepto.fragment(arg)
}),
parent, copyByClone = this.length > 1
if (nodes.length < 1) return this
return this.each(function(_, target){
parent = inside ? target : target.parentNode
// convert all methods to a "before" operation
target = operatorIndex == 0 ? target.nextSibling :
operatorIndex == 1 ? target.firstChild :
operatorIndex == 2 ? target :
null
var parentInDocument = $.contains(document.documentElement, parent)
nodes.forEach(function(node){
if (copyByClone) node = node.cloneNode(true)
else if (!parent) return $(node).remove()
parent.insertBefore(node, target)
if (parentInDocument) traverseNode(node, function(el){
if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&
(!el.type || el.type === 'text/javascript') && !el.src)
window['eval'].call(window, el.innerHTML)
})
})
})
}
// after => insertAfter
// prepend => prependTo
// before => insertBefore
// append => appendTo
$.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){
$(html)[operator](this)
return this
}
})
zepto.Z.prototype = $.fn
// Export internal API functions in the `$.zepto` namespace
zepto.uniq = uniq
zepto.deserializeValue = deserializeValue
$.zepto = zepto
return $
})()
// If `$` is not yet defined, point it to `Zepto`
window.Zepto = Zepto
window.$ === undefined && (window.$ = Zepto)
|
var searchData=
[
['z',['Z',['../class_accelerometer.html#a5fc1b5138c555cc7c9ab7fe7b3e84e43',1,'Accelerometer::Z()'],['../class_gyrometer.html#a97ff4df7715e87ab6239929ccafbc4a3',1,'Gyrometer::Z()'],['../class_orientation.html#a04aca27a39a8cf76b641c9098e38b732',1,'Orientation::Z()']]]
];
|
/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial
Software License Agreement provided with the Software or, alternatively, in accordance with the
terms contained in a written agreement between you and Sencha.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-05-16 14:36:50 (f9be68accb407158ba2b1be2c226a6ce1f649314)
*/
/**
* @private
* Private Container class used by the {@link Ext.grid.RowEditor} to hold its buttons.
*/
Ext.define('Ext.grid.RowEditorButtons', {
extend: 'Ext.container.Container',
alias: 'widget.roweditorbuttons',
frame: true,
shrinkWrap: true,
position: 'bottom',
constructor: function(config) {
var me = this,
rowEditor = config.rowEditor,
cssPrefix = Ext.baseCSSPrefix,
plugin = rowEditor.editingPlugin;
config = Ext.apply({
baseCls: cssPrefix + 'grid-row-editor-buttons',
defaults: {
xtype: 'button',
ui: rowEditor.buttonUI,
scope: plugin,
flex: 1,
minWidth: Ext.panel.Panel.prototype.minButtonWidth
},
items: [{
cls: cssPrefix + 'row-editor-update-button',
itemId: 'update',
handler: plugin.completeEdit,
text: rowEditor.saveBtnText,
disabled: rowEditor.updateButtonDisabled
}, {
cls: cssPrefix + 'row-editor-cancel-button',
handler: plugin.cancelEdit,
text: rowEditor.cancelBtnText
}]
}, config);
me.callParent([config]);
me.addClsWithUI(me.position);
},
setButtonPosition: function(position) {
var me = this;
me.removeClsWithUI(me.position);
me.position = position;
me.addClsWithUI(position);
},
getFramingInfoCls: function(){
return this.baseCls + '-' + this.ui + '-' + this.position;
},
getFrameInfo: function() {
var frameInfo = this.callParent();
// Trick Renderable into rendering the top framing elements, even though they
// are not needed in the default "bottom" position. This allows us to flip the
// buttons into "top" position without re-rendering.
frameInfo.top = true;
return frameInfo;
}
});
|
/* */
(function(Buffer) {
module.exports = {
p: new Buffer('86F5CA03DCFEB225063FF830A0C769B9DD9D6153AD91D7CE27F787C43278B447E6533B86B18BED6E8A48B784A14C252C5BE0DBF60B86D6385BD2F12FB763ED8873ABFD3F5BA2E0A8C0A59082EAC056935E529DAF7C610467899C77ADEDFC846C881870B7B19B2B58F9BE0521A17002E3BDD6B86685EE90B3D9A1B02B782B1779', 'hex'),
q: new Buffer('996F967F6C8E388D9E28D01E205FBA957A5698B1', 'hex'),
g: new Buffer('07B0F92546150B62514BB771E2A0C0CE387F03BDA6C56B505209FF25FD3C133D89BBCD97E904E09114D9A7DEFDEADFC9078EA544D2E401AEECC40BB9FBBF78FD87995A10A1C27CB7789B594BA7EFB5C4326A9FE59A070E136DB77175464ADCA417BE5DCE2F40D10A46A3A3943F26AB7FD9C0398FF8C76EE0A56826A8A88F1DBD', 'hex'),
x: new Buffer('411602CB19A6CCC34494D79D98EF1E7ED5AF25F7', 'hex'),
y: new Buffer('5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B', 'hex')
};
})(require('buffer').Buffer);
|
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _wrapDisplayName = require('./wrapDisplayName');
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName);
var _setDisplayName = require('./setDisplayName');
var _setDisplayName2 = _interopRequireDefault(_setDisplayName);
var _mapProps = require('./mapProps');
var _mapProps2 = _interopRequireDefault(_mapProps);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var withProps = function withProps(input) {
var hoc = (0, _mapProps2.default)(function (props) {
return _extends({}, props, typeof input === 'function' ? input(props) : input);
});
if (process.env.NODE_ENV !== 'production') {
return function (BaseComponent) {
return (0, _setDisplayName2.default)((0, _wrapDisplayName2.default)(BaseComponent, 'withProps'))(hoc(BaseComponent));
};
}
return hoc;
};
exports.default = withProps;
|
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(this, function() {
return /******/ (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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(1);
module.exports = __webpack_require__(332);
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {"use strict";
__webpack_require__(2);
__webpack_require__(328);
__webpack_require__(329);
if (global._babelPolyfill) {
throw new Error("only one instance of babel-polyfill is allowed");
}
global._babelPolyfill = true;
var DEFINE_PROPERTY = "defineProperty";
function define(O, key, value) {
O[key] || Object[DEFINE_PROPERTY](O, key, {
writable: true,
configurable: true,
value: value
});
}
define(String.prototype, "padLeft", "".padStart);
define(String.prototype, "padRight", "".padEnd);
"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
[][key] && define(Array, key, Function.call.bind([][key]));
});
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(3);
__webpack_require__(53);
__webpack_require__(54);
__webpack_require__(55);
__webpack_require__(56);
__webpack_require__(58);
__webpack_require__(60);
__webpack_require__(61);
__webpack_require__(62);
__webpack_require__(63);
__webpack_require__(64);
__webpack_require__(65);
__webpack_require__(66);
__webpack_require__(67);
__webpack_require__(68);
__webpack_require__(70);
__webpack_require__(72);
__webpack_require__(74);
__webpack_require__(76);
__webpack_require__(79);
__webpack_require__(80);
__webpack_require__(81);
__webpack_require__(85);
__webpack_require__(87);
__webpack_require__(89);
__webpack_require__(92);
__webpack_require__(93);
__webpack_require__(94);
__webpack_require__(95);
__webpack_require__(97);
__webpack_require__(98);
__webpack_require__(99);
__webpack_require__(100);
__webpack_require__(101);
__webpack_require__(102);
__webpack_require__(103);
__webpack_require__(105);
__webpack_require__(106);
__webpack_require__(107);
__webpack_require__(109);
__webpack_require__(110);
__webpack_require__(111);
__webpack_require__(113);
__webpack_require__(115);
__webpack_require__(116);
__webpack_require__(117);
__webpack_require__(118);
__webpack_require__(119);
__webpack_require__(120);
__webpack_require__(121);
__webpack_require__(122);
__webpack_require__(123);
__webpack_require__(124);
__webpack_require__(125);
__webpack_require__(126);
__webpack_require__(127);
__webpack_require__(132);
__webpack_require__(133);
__webpack_require__(137);
__webpack_require__(138);
__webpack_require__(139);
__webpack_require__(140);
__webpack_require__(142);
__webpack_require__(143);
__webpack_require__(144);
__webpack_require__(145);
__webpack_require__(146);
__webpack_require__(147);
__webpack_require__(148);
__webpack_require__(149);
__webpack_require__(150);
__webpack_require__(151);
__webpack_require__(152);
__webpack_require__(153);
__webpack_require__(154);
__webpack_require__(155);
__webpack_require__(156);
__webpack_require__(158);
__webpack_require__(159);
__webpack_require__(161);
__webpack_require__(162);
__webpack_require__(168);
__webpack_require__(169);
__webpack_require__(171);
__webpack_require__(172);
__webpack_require__(173);
__webpack_require__(177);
__webpack_require__(178);
__webpack_require__(179);
__webpack_require__(180);
__webpack_require__(181);
__webpack_require__(183);
__webpack_require__(184);
__webpack_require__(185);
__webpack_require__(186);
__webpack_require__(189);
__webpack_require__(191);
__webpack_require__(192);
__webpack_require__(193);
__webpack_require__(195);
__webpack_require__(197);
__webpack_require__(199);
__webpack_require__(201);
__webpack_require__(202);
__webpack_require__(203);
__webpack_require__(207);
__webpack_require__(208);
__webpack_require__(209);
__webpack_require__(211);
__webpack_require__(221);
__webpack_require__(225);
__webpack_require__(226);
__webpack_require__(228);
__webpack_require__(229);
__webpack_require__(233);
__webpack_require__(234);
__webpack_require__(236);
__webpack_require__(237);
__webpack_require__(238);
__webpack_require__(239);
__webpack_require__(240);
__webpack_require__(241);
__webpack_require__(242);
__webpack_require__(243);
__webpack_require__(244);
__webpack_require__(245);
__webpack_require__(246);
__webpack_require__(247);
__webpack_require__(248);
__webpack_require__(249);
__webpack_require__(250);
__webpack_require__(251);
__webpack_require__(252);
__webpack_require__(253);
__webpack_require__(254);
__webpack_require__(256);
__webpack_require__(257);
__webpack_require__(258);
__webpack_require__(259);
__webpack_require__(260);
__webpack_require__(262);
__webpack_require__(263);
__webpack_require__(264);
__webpack_require__(266);
__webpack_require__(267);
__webpack_require__(268);
__webpack_require__(269);
__webpack_require__(270);
__webpack_require__(271);
__webpack_require__(272);
__webpack_require__(273);
__webpack_require__(275);
__webpack_require__(276);
__webpack_require__(278);
__webpack_require__(279);
__webpack_require__(280);
__webpack_require__(281);
__webpack_require__(284);
__webpack_require__(285);
__webpack_require__(287);
__webpack_require__(288);
__webpack_require__(289);
__webpack_require__(290);
__webpack_require__(292);
__webpack_require__(293);
__webpack_require__(294);
__webpack_require__(295);
__webpack_require__(296);
__webpack_require__(297);
__webpack_require__(298);
__webpack_require__(299);
__webpack_require__(300);
__webpack_require__(301);
__webpack_require__(303);
__webpack_require__(304);
__webpack_require__(305);
__webpack_require__(306);
__webpack_require__(307);
__webpack_require__(308);
__webpack_require__(309);
__webpack_require__(310);
__webpack_require__(311);
__webpack_require__(312);
__webpack_require__(313);
__webpack_require__(315);
__webpack_require__(316);
__webpack_require__(317);
__webpack_require__(318);
__webpack_require__(319);
__webpack_require__(320);
__webpack_require__(321);
__webpack_require__(322);
__webpack_require__(323);
__webpack_require__(324);
__webpack_require__(325);
__webpack_require__(326);
__webpack_require__(327);
module.exports = __webpack_require__(9);
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// ECMAScript 6 symbols shim
var global = __webpack_require__(4);
var has = __webpack_require__(5);
var DESCRIPTORS = __webpack_require__(6);
var $export = __webpack_require__(8);
var redefine = __webpack_require__(18);
var META = __webpack_require__(25).KEY;
var $fails = __webpack_require__(7);
var shared = __webpack_require__(21);
var setToStringTag = __webpack_require__(26);
var uid = __webpack_require__(19);
var wks = __webpack_require__(27);
var wksExt = __webpack_require__(28);
var wksDefine = __webpack_require__(29);
var enumKeys = __webpack_require__(30);
var isArray = __webpack_require__(45);
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var toObject = __webpack_require__(46);
var toIObject = __webpack_require__(33);
var toPrimitive = __webpack_require__(16);
var createDesc = __webpack_require__(17);
var _create = __webpack_require__(47);
var gOPNExt = __webpack_require__(50);
var $GOPD = __webpack_require__(52);
var $GOPS = __webpack_require__(43);
var $DP = __webpack_require__(11);
var $keys = __webpack_require__(31);
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
return _create(dP({}, 'a', {
get: function () { return dP(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (it, key, D) {
var protoDesc = gOPD(ObjectProto, key);
if (protoDesc) delete ObjectProto[key];
dP(it, key, D);
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function (tag) {
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D) {
if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if (has(AllSymbols, key)) {
if (!D.enumerable) {
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
D = _create(D, { enumerable: createDesc(0, false) });
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
anObject(it);
var keys = enumKeys(P = toIObject(P));
var i = 0;
var l = keys.length;
var key;
while (l > i) $defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P) {
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
var E = isEnum.call(this, key = toPrimitive(key, true));
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
it = toIObject(it);
key = toPrimitive(key, true);
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
var D = gOPD(it, key);
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
var names = gOPN(toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
var IS_OP = it === ObjectProto;
var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function (value) {
if (this === ObjectProto) $set.call(OPSymbols, value);
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__(51).f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__(44).f = $propertyIsEnumerable;
$GOPS.f = $getOwnPropertySymbols;
if (DESCRIPTORS && !__webpack_require__(22)) {
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function (name) {
return wrap(wks(name));
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
for (var es6Symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function (key) {
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},
useSetter: function () { setter = true; },
useSimple: function () { setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
getOwnPropertySymbols: function getOwnPropertySymbols(it) {
return $GOPS.f(toObject(it));
}
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ }),
/* 4 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 5 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(7)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 7 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var core = __webpack_require__(9);
var hide = __webpack_require__(10);
var redefine = __webpack_require__(18);
var ctx = __webpack_require__(23);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// extend global
if (target) redefine(target, key, out, type & $export.U);
// export
if (exports[key] != out) hide(exports, key, exp);
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
}
};
global.core = core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 9 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.10' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11);
var createDesc = __webpack_require__(17);
module.exports = __webpack_require__(6) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(12);
var IE8_DOM_DEFINE = __webpack_require__(14);
var toPrimitive = __webpack_require__(16);
var dP = Object.defineProperty;
exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 13 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () {
return Object.defineProperty(__webpack_require__(15)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
var document = __webpack_require__(4).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(13);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 17 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var hide = __webpack_require__(10);
var has = __webpack_require__(5);
var SRC = __webpack_require__(19)('src');
var $toString = __webpack_require__(20);
var TO_STRING = 'toString';
var TPL = ('' + $toString).split(TO_STRING);
__webpack_require__(9).inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) has(val, 'name') || hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === global) {
O[key] = val;
} else if (!safe) {
delete O[key];
hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ }),
/* 19 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(21)('native-function-to-string', Function.toString);
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(9);
var global = __webpack_require__(4);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(22) ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/* 22 */
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(24);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 24 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__(19)('meta');
var isObject = __webpack_require__(13);
var has = __webpack_require__(5);
var setDesc = __webpack_require__(11).f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !__webpack_require__(7)(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__(11).f;
var has = __webpack_require__(5);
var TAG = __webpack_require__(27)('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(21)('wks');
var uid = __webpack_require__(19);
var Symbol = __webpack_require__(4).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
exports.f = __webpack_require__(27);
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var core = __webpack_require__(9);
var LIBRARY = __webpack_require__(22);
var wksExt = __webpack_require__(28);
var defineProperty = __webpack_require__(11).f;
module.exports = function (name) {
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(31);
var gOPS = __webpack_require__(43);
var pIE = __webpack_require__(44);
module.exports = function (it) {
var result = getKeys(it);
var getSymbols = gOPS.f;
if (getSymbols) {
var symbols = getSymbols(it);
var isEnum = pIE.f;
var i = 0;
var key;
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
} return result;
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(32);
var enumBugKeys = __webpack_require__(42);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(5);
var toIObject = __webpack_require__(33);
var arrayIndexOf = __webpack_require__(37)(false);
var IE_PROTO = __webpack_require__(41)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(34);
var defined = __webpack_require__(36);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(35);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 35 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 36 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(33);
var toLength = __webpack_require__(38);
var toAbsoluteIndex = __webpack_require__(40);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(39);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 39 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(39);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(21)('keys');
var uid = __webpack_require__(19);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 42 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 43 */
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/* 44 */
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(35);
module.exports = Array.isArray || function isArray(arg) {
return cof(arg) == 'Array';
};
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(36);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(12);
var dPs = __webpack_require__(48);
var enumBugKeys = __webpack_require__(42);
var IE_PROTO = __webpack_require__(41)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(15)('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__(49).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11);
var anObject = __webpack_require__(12);
var getKeys = __webpack_require__(31);
module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__(4).document;
module.exports = document && document.documentElement;
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(33);
var gOPN = __webpack_require__(51).f;
var toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return gOPN(it);
} catch (e) {
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(32);
var hiddenKeys = __webpack_require__(42).concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return $keys(O, hiddenKeys);
};
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(44);
var createDesc = __webpack_require__(17);
var toIObject = __webpack_require__(33);
var toPrimitive = __webpack_require__(16);
var has = __webpack_require__(5);
var IE8_DOM_DEFINE = __webpack_require__(14);
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', { create: __webpack_require__(47) });
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(11).f });
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(48) });
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
var toIObject = __webpack_require__(33);
var $getOwnPropertyDescriptor = __webpack_require__(52).f;
__webpack_require__(57)('getOwnPropertyDescriptor', function () {
return function getOwnPropertyDescriptor(it, key) {
return $getOwnPropertyDescriptor(toIObject(it), key);
};
});
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(8);
var core = __webpack_require__(9);
var fails = __webpack_require__(7);
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__(46);
var $getPrototypeOf = __webpack_require__(59);
__webpack_require__(57)('getPrototypeOf', function () {
return function getPrototypeOf(it) {
return $getPrototypeOf(toObject(it));
};
});
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(5);
var toObject = __webpack_require__(46);
var IE_PROTO = __webpack_require__(41)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__(46);
var $keys = __webpack_require__(31);
__webpack_require__(57)('keys', function () {
return function keys(it) {
return $keys(toObject(it));
};
});
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 Object.getOwnPropertyNames(O)
__webpack_require__(57)('getOwnPropertyNames', function () {
return __webpack_require__(50).f;
});
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.5 Object.freeze(O)
var isObject = __webpack_require__(13);
var meta = __webpack_require__(25).onFreeze;
__webpack_require__(57)('freeze', function ($freeze) {
return function freeze(it) {
return $freeze && isObject(it) ? $freeze(meta(it)) : it;
};
});
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.17 Object.seal(O)
var isObject = __webpack_require__(13);
var meta = __webpack_require__(25).onFreeze;
__webpack_require__(57)('seal', function ($seal) {
return function seal(it) {
return $seal && isObject(it) ? $seal(meta(it)) : it;
};
});
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.15 Object.preventExtensions(O)
var isObject = __webpack_require__(13);
var meta = __webpack_require__(25).onFreeze;
__webpack_require__(57)('preventExtensions', function ($preventExtensions) {
return function preventExtensions(it) {
return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
};
});
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.12 Object.isFrozen(O)
var isObject = __webpack_require__(13);
__webpack_require__(57)('isFrozen', function ($isFrozen) {
return function isFrozen(it) {
return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
};
});
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.13 Object.isSealed(O)
var isObject = __webpack_require__(13);
__webpack_require__(57)('isSealed', function ($isSealed) {
return function isSealed(it) {
return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
};
});
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.11 Object.isExtensible(O)
var isObject = __webpack_require__(13);
__webpack_require__(57)('isExtensible', function ($isExtensible) {
return function isExtensible(it) {
return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
};
});
/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(8);
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(69) });
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = __webpack_require__(6);
var getKeys = __webpack_require__(31);
var gOPS = __webpack_require__(43);
var pIE = __webpack_require__(44);
var toObject = __webpack_require__(46);
var IObject = __webpack_require__(34);
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(7)(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
}
} return T;
} : $assign;
/***/ }),
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.10 Object.is(value1, value2)
var $export = __webpack_require__(8);
$export($export.S, 'Object', { is: __webpack_require__(71) });
/***/ }),
/* 71 */
/***/ (function(module, exports) {
// 7.2.9 SameValue(x, y)
module.exports = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};
/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(8);
$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set });
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(13);
var anObject = __webpack_require__(12);
var check = function (O, proto) {
anObject(O);
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function (test, buggy, set) {
try {
set = __webpack_require__(23)(Function.call, __webpack_require__(52).f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch (e) { buggy = true; }
return function setPrototypeOf(O, proto) {
check(O, proto);
if (buggy) O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 19.1.3.6 Object.prototype.toString()
var classof = __webpack_require__(75);
var test = {};
test[__webpack_require__(27)('toStringTag')] = 'z';
if (test + '' != '[object z]') {
__webpack_require__(18)(Object.prototype, 'toString', function toString() {
return '[object ' + classof(this) + ']';
}, true);
}
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(35);
var TAG = __webpack_require__(27)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
var $export = __webpack_require__(8);
$export($export.P, 'Function', { bind: __webpack_require__(77) });
/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var aFunction = __webpack_require__(24);
var isObject = __webpack_require__(13);
var invoke = __webpack_require__(78);
var arraySlice = [].slice;
var factories = {};
var construct = function (F, len, args) {
if (!(len in factories)) {
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
// eslint-disable-next-line no-new-func
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
} return factories[len](F, args);
};
module.exports = Function.bind || function bind(that /* , ...args */) {
var fn = aFunction(this);
var partArgs = arraySlice.call(arguments, 1);
var bound = function (/* args... */) {
var args = partArgs.concat(arraySlice.call(arguments));
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
};
if (isObject(fn.prototype)) bound.prototype = fn.prototype;
return bound;
};
/***/ }),
/* 78 */
/***/ (function(module, exports) {
// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function (fn, args, that) {
var un = that === undefined;
switch (args.length) {
case 0: return un ? fn()
: fn.call(that);
case 1: return un ? fn(args[0])
: fn.call(that, args[0]);
case 2: return un ? fn(args[0], args[1])
: fn.call(that, args[0], args[1]);
case 3: return un ? fn(args[0], args[1], args[2])
: fn.call(that, args[0], args[1], args[2]);
case 4: return un ? fn(args[0], args[1], args[2], args[3])
: fn.call(that, args[0], args[1], args[2], args[3]);
} return fn.apply(that, args);
};
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11).f;
var FProto = Function.prototype;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';
// 19.2.4.2 name
NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
configurable: true,
get: function () {
try {
return ('' + this).match(nameRE)[1];
} catch (e) {
return '';
}
}
});
/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var isObject = __webpack_require__(13);
var getPrototypeOf = __webpack_require__(59);
var HAS_INSTANCE = __webpack_require__(27)('hasInstance');
var FunctionProto = Function.prototype;
// 19.2.3.6 Function.prototype[@@hasInstance](V)
if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(11).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
if (typeof this != 'function' || !isObject(O)) return false;
if (!isObject(this.prototype)) return O instanceof this;
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
return false;
} });
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseInt = __webpack_require__(82);
// 18.2.5 parseInt(string, radix)
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
var $parseInt = __webpack_require__(4).parseInt;
var $trim = __webpack_require__(83).trim;
var ws = __webpack_require__(84);
var hex = /^[-+]?0[xX]/;
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
var string = $trim(String(str), 3);
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
} : $parseInt;
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var defined = __webpack_require__(36);
var fails = __webpack_require__(7);
var spaces = __webpack_require__(84);
var space = '[' + spaces + ']';
var non = '\u200b\u0085';
var ltrim = RegExp('^' + space + space + '*');
var rtrim = RegExp(space + space + '*$');
var exporter = function (KEY, exec, ALIAS) {
var exp = {};
var FORCE = fails(function () {
return !!spaces[KEY]() || non[KEY]() != non;
});
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
if (ALIAS) exp[ALIAS] = fn;
$export($export.P + $export.F * FORCE, 'String', exp);
};
// 1 -> String#trimLeft
// 2 -> String#trimRight
// 3 -> String#trim
var trim = exporter.trim = function (string, TYPE) {
string = String(defined(string));
if (TYPE & 1) string = string.replace(ltrim, '');
if (TYPE & 2) string = string.replace(rtrim, '');
return string;
};
module.exports = exporter;
/***/ }),
/* 84 */
/***/ (function(module, exports) {
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseFloat = __webpack_require__(86);
// 18.2.4 parseFloat(string)
$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
var $parseFloat = __webpack_require__(4).parseFloat;
var $trim = __webpack_require__(83).trim;
module.exports = 1 / $parseFloat(__webpack_require__(84) + '-0') !== -Infinity ? function parseFloat(str) {
var string = $trim(String(str), 3);
var result = $parseFloat(string);
return result === 0 && string.charAt(0) == '-' ? -0 : result;
} : $parseFloat;
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var has = __webpack_require__(5);
var cof = __webpack_require__(35);
var inheritIfRequired = __webpack_require__(88);
var toPrimitive = __webpack_require__(16);
var fails = __webpack_require__(7);
var gOPN = __webpack_require__(51).f;
var gOPD = __webpack_require__(52).f;
var dP = __webpack_require__(11).f;
var $trim = __webpack_require__(83).trim;
var NUMBER = 'Number';
var $Number = global[NUMBER];
var Base = $Number;
var proto = $Number.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_COF = cof(__webpack_require__(47)(proto)) == NUMBER;
var TRIM = 'trim' in String.prototype;
// 7.1.3 ToNumber(argument)
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
if (typeof it == 'string' && it.length > 2) {
it = TRIM ? it.trim() : $trim(it, 3);
var first = it.charCodeAt(0);
var third, radix, maxCode;
if (first === 43 || first === 45) {
third = it.charCodeAt(2);
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if (first === 48) {
switch (it.charCodeAt(1)) {
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
default: return +it;
}
for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
code = digits.charCodeAt(i);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
$Number = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
var that = this;
return that instanceof $Number
// check on 1..constructor(foo) case
&& (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
};
for (var keys = __webpack_require__(6) ? gOPN(Base) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES6 (in case, if modules with ES6 Number statics required before):
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
).split(','), j = 0, key; keys.length > j; j++) {
if (has(Base, key = keys[j]) && !has($Number, key)) {
dP($Number, key, gOPD(Base, key));
}
}
$Number.prototype = proto;
proto.constructor = $Number;
__webpack_require__(18)(global, NUMBER, $Number);
}
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
var setPrototypeOf = __webpack_require__(73).set;
module.exports = function (that, target, C) {
var S = target.constructor;
var P;
if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
setPrototypeOf(that, P);
} return that;
};
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toInteger = __webpack_require__(39);
var aNumberValue = __webpack_require__(90);
var repeat = __webpack_require__(91);
var $toFixed = 1.0.toFixed;
var floor = Math.floor;
var data = [0, 0, 0, 0, 0, 0];
var ERROR = 'Number.toFixed: incorrect invocation!';
var ZERO = '0';
var multiply = function (n, c) {
var i = -1;
var c2 = c;
while (++i < 6) {
c2 += n * data[i];
data[i] = c2 % 1e7;
c2 = floor(c2 / 1e7);
}
};
var divide = function (n) {
var i = 6;
var c = 0;
while (--i >= 0) {
c += data[i];
data[i] = floor(c / n);
c = (c % n) * 1e7;
}
};
var numToString = function () {
var i = 6;
var s = '';
while (--i >= 0) {
if (s !== '' || i === 0 || data[i] !== 0) {
var t = String(data[i]);
s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
}
} return s;
};
var pow = function (x, n, acc) {
return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
};
var log = function (x) {
var n = 0;
var x2 = x;
while (x2 >= 4096) {
n += 12;
x2 /= 4096;
}
while (x2 >= 2) {
n += 1;
x2 /= 2;
} return n;
};
$export($export.P + $export.F * (!!$toFixed && (
0.00008.toFixed(3) !== '0.000' ||
0.9.toFixed(0) !== '1' ||
1.255.toFixed(2) !== '1.25' ||
1000000000000000128.0.toFixed(0) !== '1000000000000000128'
) || !__webpack_require__(7)(function () {
// V8 ~ Android 4.3-
$toFixed.call({});
})), 'Number', {
toFixed: function toFixed(fractionDigits) {
var x = aNumberValue(this, ERROR);
var f = toInteger(fractionDigits);
var s = '';
var m = ZERO;
var e, z, j, k;
if (f < 0 || f > 20) throw RangeError(ERROR);
// eslint-disable-next-line no-self-compare
if (x != x) return 'NaN';
if (x <= -1e21 || x >= 1e21) return String(x);
if (x < 0) {
s = '-';
x = -x;
}
if (x > 1e-21) {
e = log(x * pow(2, 69, 1)) - 69;
z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
z *= 0x10000000000000;
e = 52 - e;
if (e > 0) {
multiply(0, z);
j = f;
while (j >= 7) {
multiply(1e7, 0);
j -= 7;
}
multiply(pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
divide(1 << 23);
j -= 23;
}
divide(1 << j);
multiply(1, 1);
divide(2);
m = numToString();
} else {
multiply(0, z);
multiply(1 << -e, 0);
m = numToString() + repeat.call(ZERO, f);
}
}
if (f > 0) {
k = m.length;
m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
} else {
m = s + m;
} return m;
}
});
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
var cof = __webpack_require__(35);
module.exports = function (it, msg) {
if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
return +it;
};
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var toInteger = __webpack_require__(39);
var defined = __webpack_require__(36);
module.exports = function repeat(count) {
var str = String(defined(this));
var res = '';
var n = toInteger(count);
if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
return res;
};
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $fails = __webpack_require__(7);
var aNumberValue = __webpack_require__(90);
var $toPrecision = 1.0.toPrecision;
$export($export.P + $export.F * ($fails(function () {
// IE7-
return $toPrecision.call(1, undefined) !== '1';
}) || !$fails(function () {
// V8 ~ Android 4.3-
$toPrecision.call({});
})), 'Number', {
toPrecision: function toPrecision(precision) {
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
}
});
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.1 Number.EPSILON
var $export = __webpack_require__(8);
$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
/***/ }),
/* 94 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.2 Number.isFinite(number)
var $export = __webpack_require__(8);
var _isFinite = __webpack_require__(4).isFinite;
$export($export.S, 'Number', {
isFinite: function isFinite(it) {
return typeof it == 'number' && _isFinite(it);
}
});
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var $export = __webpack_require__(8);
$export($export.S, 'Number', { isInteger: __webpack_require__(96) });
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var isObject = __webpack_require__(13);
var floor = Math.floor;
module.exports = function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.4 Number.isNaN(number)
var $export = __webpack_require__(8);
$export($export.S, 'Number', {
isNaN: function isNaN(number) {
// eslint-disable-next-line no-self-compare
return number != number;
}
});
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.5 Number.isSafeInteger(number)
var $export = __webpack_require__(8);
var isInteger = __webpack_require__(96);
var abs = Math.abs;
$export($export.S, 'Number', {
isSafeInteger: function isSafeInteger(number) {
return isInteger(number) && abs(number) <= 0x1fffffffffffff;
}
});
/***/ }),
/* 99 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.6 Number.MAX_SAFE_INTEGER
var $export = __webpack_require__(8);
$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.10 Number.MIN_SAFE_INTEGER
var $export = __webpack_require__(8);
$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseFloat = __webpack_require__(86);
// 20.1.2.12 Number.parseFloat(string)
$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $parseInt = __webpack_require__(82);
// 20.1.2.13 Number.parseInt(string, radix)
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.3 Math.acosh(x)
var $export = __webpack_require__(8);
var log1p = __webpack_require__(104);
var sqrt = Math.sqrt;
var $acosh = Math.acosh;
$export($export.S + $export.F * !($acosh
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
&& Math.floor($acosh(Number.MAX_VALUE)) == 710
// Tor Browser bug: Math.acosh(Infinity) -> NaN
&& $acosh(Infinity) == Infinity
), 'Math', {
acosh: function acosh(x) {
return (x = +x) < 1 ? NaN : x > 94906265.62425156
? Math.log(x) + Math.LN2
: log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
}
});
/***/ }),
/* 104 */
/***/ (function(module, exports) {
// 20.2.2.20 Math.log1p(x)
module.exports = Math.log1p || function log1p(x) {
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
};
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.5 Math.asinh(x)
var $export = __webpack_require__(8);
var $asinh = Math.asinh;
function asinh(x) {
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
}
// Tor Browser bug: Math.asinh(0) -> -0
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.7 Math.atanh(x)
var $export = __webpack_require__(8);
var $atanh = Math.atanh;
// Tor Browser bug: Math.atanh(-0) -> 0
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
atanh: function atanh(x) {
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
}
});
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.9 Math.cbrt(x)
var $export = __webpack_require__(8);
var sign = __webpack_require__(108);
$export($export.S, 'Math', {
cbrt: function cbrt(x) {
return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
}
});
/***/ }),
/* 108 */
/***/ (function(module, exports) {
// 20.2.2.28 Math.sign(x)
module.exports = Math.sign || function sign(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};
/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.11 Math.clz32(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
clz32: function clz32(x) {
return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
}
});
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.12 Math.cosh(x)
var $export = __webpack_require__(8);
var exp = Math.exp;
$export($export.S, 'Math', {
cosh: function cosh(x) {
return (exp(x = +x) + exp(-x)) / 2;
}
});
/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.14 Math.expm1(x)
var $export = __webpack_require__(8);
var $expm1 = __webpack_require__(112);
$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
/***/ }),
/* 112 */
/***/ (function(module, exports) {
// 20.2.2.14 Math.expm1(x)
var $expm1 = Math.expm1;
module.exports = (!$expm1
// Old FF bug
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) != -2e-17
) ? function expm1(x) {
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
} : $expm1;
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', { fround: __webpack_require__(114) });
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var sign = __webpack_require__(108);
var pow = Math.pow;
var EPSILON = pow(2, -52);
var EPSILON32 = pow(2, -23);
var MAX32 = pow(2, 127) * (2 - EPSILON32);
var MIN32 = pow(2, -126);
var roundTiesToEven = function (n) {
return n + 1 / EPSILON - 1 / EPSILON;
};
module.exports = Math.fround || function fround(x) {
var $abs = Math.abs(x);
var $sign = sign(x);
var a, result;
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
a = (1 + EPSILON32 / EPSILON) * $abs;
result = a - (a - $abs);
// eslint-disable-next-line no-self-compare
if (result > MAX32 || result != result) return $sign * Infinity;
return $sign * result;
};
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = __webpack_require__(8);
var abs = Math.abs;
$export($export.S, 'Math', {
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
var sum = 0;
var i = 0;
var aLen = arguments.length;
var larg = 0;
var arg, div;
while (i < aLen) {
arg = abs(arguments[i++]);
if (larg < arg) {
div = larg / arg;
sum = sum * div * div + 1;
larg = arg;
} else if (arg > 0) {
div = arg / larg;
sum += div * div;
} else sum += arg;
}
return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
}
});
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.18 Math.imul(x, y)
var $export = __webpack_require__(8);
var $imul = Math.imul;
// some WebKit versions fails with big numbers, some has wrong arity
$export($export.S + $export.F * __webpack_require__(7)(function () {
return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
}), 'Math', {
imul: function imul(x, y) {
var UINT16 = 0xffff;
var xn = +x;
var yn = +y;
var xl = UINT16 & xn;
var yl = UINT16 & yn;
return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
}
});
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.21 Math.log10(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
log10: function log10(x) {
return Math.log(x) * Math.LOG10E;
}
});
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.20 Math.log1p(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', { log1p: __webpack_require__(104) });
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.22 Math.log2(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
log2: function log2(x) {
return Math.log(x) / Math.LN2;
}
});
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.28 Math.sign(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', { sign: __webpack_require__(108) });
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.30 Math.sinh(x)
var $export = __webpack_require__(8);
var expm1 = __webpack_require__(112);
var exp = Math.exp;
// V8 near Chromium 38 has a problem with very small numbers
$export($export.S + $export.F * __webpack_require__(7)(function () {
return !Math.sinh(-2e-17) != -2e-17;
}), 'Math', {
sinh: function sinh(x) {
return Math.abs(x = +x) < 1
? (expm1(x) - expm1(-x)) / 2
: (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
}
});
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.33 Math.tanh(x)
var $export = __webpack_require__(8);
var expm1 = __webpack_require__(112);
var exp = Math.exp;
$export($export.S, 'Math', {
tanh: function tanh(x) {
var a = expm1(x = +x);
var b = expm1(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
}
});
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.34 Math.trunc(x)
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
trunc: function trunc(it) {
return (it > 0 ? Math.floor : Math.ceil)(it);
}
});
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var toAbsoluteIndex = __webpack_require__(40);
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem
$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
var res = [];
var aLen = arguments.length;
var i = 0;
var code;
while (aLen > i) {
code = +arguments[i++];
if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} return res.join('');
}
});
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var toIObject = __webpack_require__(33);
var toLength = __webpack_require__(38);
$export($export.S, 'String', {
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function raw(callSite) {
var tpl = toIObject(callSite.raw);
var len = toLength(tpl.length);
var aLen = arguments.length;
var res = [];
var i = 0;
while (len > i) {
res.push(String(tpl[i++]));
if (i < aLen) res.push(String(arguments[i]));
} return res.join('');
}
});
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 21.1.3.25 String.prototype.trim()
__webpack_require__(83)('trim', function ($trim) {
return function trim() {
return $trim(this, 3);
};
});
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $at = __webpack_require__(128)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(129)(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(39);
var defined = __webpack_require__(36);
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(22);
var $export = __webpack_require__(8);
var redefine = __webpack_require__(18);
var hide = __webpack_require__(10);
var Iterators = __webpack_require__(130);
var $iterCreate = __webpack_require__(131);
var setToStringTag = __webpack_require__(26);
var getPrototypeOf = __webpack_require__(59);
var ITERATOR = __webpack_require__(27)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/* 130 */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var create = __webpack_require__(47);
var descriptor = __webpack_require__(17);
var setToStringTag = __webpack_require__(26);
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(10)(IteratorPrototype, __webpack_require__(27)('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $at = __webpack_require__(128)(false);
$export($export.P, 'String', {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: function codePointAt(pos) {
return $at(this, pos);
}
});
/***/ }),
/* 133 */
/***/ (function(module, exports, __webpack_require__) {
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
'use strict';
var $export = __webpack_require__(8);
var toLength = __webpack_require__(38);
var context = __webpack_require__(134);
var ENDS_WITH = 'endsWith';
var $endsWith = ''[ENDS_WITH];
$export($export.P + $export.F * __webpack_require__(136)(ENDS_WITH), 'String', {
endsWith: function endsWith(searchString /* , endPosition = @length */) {
var that = context(this, searchString, ENDS_WITH);
var endPosition = arguments.length > 1 ? arguments[1] : undefined;
var len = toLength(that.length);
var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
var search = String(searchString);
return $endsWith
? $endsWith.call(that, search, end)
: that.slice(end - search.length, end) === search;
}
});
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__(135);
var defined = __webpack_require__(36);
module.exports = function (that, searchString, NAME) {
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__(13);
var cof = __webpack_require__(35);
var MATCH = __webpack_require__(27)('match');
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
var MATCH = __webpack_require__(27)('match');
module.exports = function (KEY) {
var re = /./;
try {
'/./'[KEY](re);
} catch (e) {
try {
re[MATCH] = false;
return !'/./'[KEY](re);
} catch (f) { /* empty */ }
} return true;
};
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
'use strict';
var $export = __webpack_require__(8);
var context = __webpack_require__(134);
var INCLUDES = 'includes';
$export($export.P + $export.F * __webpack_require__(136)(INCLUDES), 'String', {
includes: function includes(searchString /* , position = 0 */) {
return !!~context(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
$export($export.P, 'String', {
// 21.1.3.13 String.prototype.repeat(count)
repeat: __webpack_require__(91)
});
/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
'use strict';
var $export = __webpack_require__(8);
var toLength = __webpack_require__(38);
var context = __webpack_require__(134);
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];
$export($export.P + $export.F * __webpack_require__(136)(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = context(this, searchString, STARTS_WITH);
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.2 String.prototype.anchor(name)
__webpack_require__(141)('anchor', function (createHTML) {
return function anchor(name) {
return createHTML(this, 'a', 'name', name);
};
});
/***/ }),
/* 141 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var fails = __webpack_require__(7);
var defined = __webpack_require__(36);
var quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
var createHTML = function (string, tag, attribute, value) {
var S = String(defined(string));
var p1 = '<' + tag;
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
return p1 + '>' + S + '</' + tag + '>';
};
module.exports = function (NAME, exec) {
var O = {};
O[NAME] = exec(createHTML);
$export($export.P + $export.F * fails(function () {
var test = ''[NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
}), 'String', O);
};
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.3 String.prototype.big()
__webpack_require__(141)('big', function (createHTML) {
return function big() {
return createHTML(this, 'big', '', '');
};
});
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.4 String.prototype.blink()
__webpack_require__(141)('blink', function (createHTML) {
return function blink() {
return createHTML(this, 'blink', '', '');
};
});
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.5 String.prototype.bold()
__webpack_require__(141)('bold', function (createHTML) {
return function bold() {
return createHTML(this, 'b', '', '');
};
});
/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.6 String.prototype.fixed()
__webpack_require__(141)('fixed', function (createHTML) {
return function fixed() {
return createHTML(this, 'tt', '', '');
};
});
/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.7 String.prototype.fontcolor(color)
__webpack_require__(141)('fontcolor', function (createHTML) {
return function fontcolor(color) {
return createHTML(this, 'font', 'color', color);
};
});
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.8 String.prototype.fontsize(size)
__webpack_require__(141)('fontsize', function (createHTML) {
return function fontsize(size) {
return createHTML(this, 'font', 'size', size);
};
});
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.9 String.prototype.italics()
__webpack_require__(141)('italics', function (createHTML) {
return function italics() {
return createHTML(this, 'i', '', '');
};
});
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.10 String.prototype.link(url)
__webpack_require__(141)('link', function (createHTML) {
return function link(url) {
return createHTML(this, 'a', 'href', url);
};
});
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.11 String.prototype.small()
__webpack_require__(141)('small', function (createHTML) {
return function small() {
return createHTML(this, 'small', '', '');
};
});
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.12 String.prototype.strike()
__webpack_require__(141)('strike', function (createHTML) {
return function strike() {
return createHTML(this, 'strike', '', '');
};
});
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.13 String.prototype.sub()
__webpack_require__(141)('sub', function (createHTML) {
return function sub() {
return createHTML(this, 'sub', '', '');
};
});
/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.14 String.prototype.sup()
__webpack_require__(141)('sup', function (createHTML) {
return function sup() {
return createHTML(this, 'sup', '', '');
};
});
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(8);
$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(46);
var toPrimitive = __webpack_require__(16);
$export($export.P + $export.F * __webpack_require__(7)(function () {
return new Date(NaN).toJSON() !== null
|| Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
}), 'Date', {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key) {
var O = toObject(this);
var pv = toPrimitive(O);
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
}
});
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var $export = __webpack_require__(8);
var toISOString = __webpack_require__(157);
// PhantomJS / old WebKit has a broken implementations
$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
toISOString: toISOString
});
/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var fails = __webpack_require__(7);
var getTime = Date.prototype.getTime;
var $toISOString = Date.prototype.toISOString;
var lz = function (num) {
return num > 9 ? num : '0' + num;
};
// PhantomJS / old WebKit has a broken implementations
module.exports = (fails(function () {
return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
$toISOString.call(new Date(NaN));
})) ? function toISOString() {
if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
var d = this;
var y = d.getUTCFullYear();
var m = d.getUTCMilliseconds();
var s = y < 0 ? '-' : y > 9999 ? '+' : '';
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
} : $toISOString;
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
var DateProto = Date.prototype;
var INVALID_DATE = 'Invalid Date';
var TO_STRING = 'toString';
var $toString = DateProto[TO_STRING];
var getTime = DateProto.getTime;
if (new Date(NaN) + '' != INVALID_DATE) {
__webpack_require__(18)(DateProto, TO_STRING, function toString() {
var value = getTime.call(this);
// eslint-disable-next-line no-self-compare
return value === value ? $toString.call(this) : INVALID_DATE;
});
}
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
var TO_PRIMITIVE = __webpack_require__(27)('toPrimitive');
var proto = Date.prototype;
if (!(TO_PRIMITIVE in proto)) __webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(160));
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var anObject = __webpack_require__(12);
var toPrimitive = __webpack_require__(16);
var NUMBER = 'number';
module.exports = function (hint) {
if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
return toPrimitive(anObject(this), hint != NUMBER);
};
/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
var $export = __webpack_require__(8);
$export($export.S, 'Array', { isArray: __webpack_require__(45) });
/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var ctx = __webpack_require__(23);
var $export = __webpack_require__(8);
var toObject = __webpack_require__(46);
var call = __webpack_require__(163);
var isArrayIter = __webpack_require__(164);
var toLength = __webpack_require__(38);
var createProperty = __webpack_require__(165);
var getIterFn = __webpack_require__(166);
$export($export.S + $export.F * !__webpack_require__(167)(function (iter) { Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iterFn = getIterFn(O);
var length, result, step, iterator;
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for (result = new C(length); length > index; index++) {
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(12);
module.exports = function (iterator, fn, value, entries) {
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(130);
var ITERATOR = __webpack_require__(27)('iterator');
var ArrayProto = Array.prototype;
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $defineProperty = __webpack_require__(11);
var createDesc = __webpack_require__(17);
module.exports = function (object, index, value) {
if (index in object) $defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(75);
var ITERATOR = __webpack_require__(27)('iterator');
var Iterators = __webpack_require__(130);
module.exports = __webpack_require__(9).getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(27)('iterator');
var SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function () { SAFE_CLOSING = true; };
// eslint-disable-next-line no-throw-literal
Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }
module.exports = function (exec, skipClosing) {
if (!skipClosing && !SAFE_CLOSING) return false;
var safe = false;
try {
var arr = [7];
var iter = arr[ITERATOR]();
iter.next = function () { return { done: safe = true }; };
arr[ITERATOR] = function () { return iter; };
exec(arr);
} catch (e) { /* empty */ }
return safe;
};
/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var createProperty = __webpack_require__(165);
// WebKit Array.of isn't generic
$export($export.S + $export.F * __webpack_require__(7)(function () {
function F() { /* empty */ }
return !(Array.of.call(F) instanceof F);
}), 'Array', {
// 22.1.2.3 Array.of( ...items)
of: function of(/* ...args */) {
var index = 0;
var aLen = arguments.length;
var result = new (typeof this == 'function' ? this : Array)(aLen);
while (aLen > index) createProperty(result, index, arguments[index++]);
result.length = aLen;
return result;
}
});
/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.13 Array.prototype.join(separator)
var $export = __webpack_require__(8);
var toIObject = __webpack_require__(33);
var arrayJoin = [].join;
// fallback for not array-like strings
$export($export.P + $export.F * (__webpack_require__(34) != Object || !__webpack_require__(170)(arrayJoin)), 'Array', {
join: function join(separator) {
return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
}
});
/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var fails = __webpack_require__(7);
module.exports = function (method, arg) {
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call
arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
});
};
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var html = __webpack_require__(49);
var cof = __webpack_require__(35);
var toAbsoluteIndex = __webpack_require__(40);
var toLength = __webpack_require__(38);
var arraySlice = [].slice;
// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * __webpack_require__(7)(function () {
if (html) arraySlice.call(html);
}), 'Array', {
slice: function slice(begin, end) {
var len = toLength(this.length);
var klass = cof(this);
end = end === undefined ? len : end;
if (klass == 'Array') return arraySlice.call(this, begin, end);
var start = toAbsoluteIndex(begin, len);
var upTo = toAbsoluteIndex(end, len);
var size = toLength(upTo - start);
var cloned = new Array(size);
var i = 0;
for (; i < size; i++) cloned[i] = klass == 'String'
? this.charAt(start + i)
: this[start + i];
return cloned;
}
});
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var aFunction = __webpack_require__(24);
var toObject = __webpack_require__(46);
var fails = __webpack_require__(7);
var $sort = [].sort;
var test = [1, 2, 3];
$export($export.P + $export.F * (fails(function () {
// IE8-
test.sort(undefined);
}) || !fails(function () {
// V8 bug
test.sort(null);
// Old WebKit
}) || !__webpack_require__(170)($sort)), 'Array', {
// 22.1.3.25 Array.prototype.sort(comparefn)
sort: function sort(comparefn) {
return comparefn === undefined
? $sort.call(toObject(this))
: $sort.call(toObject(this), aFunction(comparefn));
}
});
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $forEach = __webpack_require__(174)(0);
var STRICT = __webpack_require__(170)([].forEach, true);
$export($export.P + $export.F * !STRICT, 'Array', {
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
forEach: function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(23);
var IObject = __webpack_require__(34);
var toObject = __webpack_require__(46);
var toLength = __webpack_require__(38);
var asc = __webpack_require__(175);
module.exports = function (TYPE, $create) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var create = $create || asc;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IObject(O);
var f = ctx(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var val, res;
for (;length > index; index++) if (NO_HOLES || index in self) {
val = self[index];
res = f(val, index, O);
if (TYPE) {
if (IS_MAP) result[index] = res; // map
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var speciesConstructor = __webpack_require__(176);
module.exports = function (original, length) {
return new (speciesConstructor(original))(length);
};
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
var isArray = __webpack_require__(45);
var SPECIES = __webpack_require__(27)('species');
module.exports = function (original) {
var C;
if (isArray(original)) {
C = original.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return C === undefined ? Array : C;
};
/***/ }),
/* 177 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $map = __webpack_require__(174)(1);
$export($export.P + $export.F * !__webpack_require__(170)([].map, true), 'Array', {
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
map: function map(callbackfn /* , thisArg */) {
return $map(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $filter = __webpack_require__(174)(2);
$export($export.P + $export.F * !__webpack_require__(170)([].filter, true), 'Array', {
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: function filter(callbackfn /* , thisArg */) {
return $filter(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 179 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $some = __webpack_require__(174)(3);
$export($export.P + $export.F * !__webpack_require__(170)([].some, true), 'Array', {
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $every = __webpack_require__(174)(4);
$export($export.P + $export.F * !__webpack_require__(170)([].every, true), 'Array', {
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $reduce = __webpack_require__(182);
$export($export.P + $export.F * !__webpack_require__(170)([].reduce, true), 'Array', {
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments[1], false);
}
});
/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__(24);
var toObject = __webpack_require__(46);
var IObject = __webpack_require__(34);
var toLength = __webpack_require__(38);
module.exports = function (that, callbackfn, aLen, memo, isRight) {
aFunction(callbackfn);
var O = toObject(that);
var self = IObject(O);
var length = toLength(O.length);
var index = isRight ? length - 1 : 0;
var i = isRight ? -1 : 1;
if (aLen < 2) for (;;) {
if (index in self) {
memo = self[index];
index += i;
break;
}
index += i;
if (isRight ? index < 0 : length <= index) {
throw TypeError('Reduce of empty array with no initial value');
}
}
for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $reduce = __webpack_require__(182);
$export($export.P + $export.F * !__webpack_require__(170)([].reduceRight, true), 'Array', {
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
reduceRight: function reduceRight(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments[1], true);
}
});
/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $indexOf = __webpack_require__(37)(false);
var $native = [].indexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', {
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
// convert -0 to +0
? $native.apply(this, arguments) || 0
: $indexOf(this, searchElement, arguments[1]);
}
});
/***/ }),
/* 185 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toIObject = __webpack_require__(33);
var toInteger = __webpack_require__(39);
var toLength = __webpack_require__(38);
var $native = [].lastIndexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', {
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
// convert -0 to +0
if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
var O = toIObject(this);
var length = toLength(O.length);
var index = length - 1;
if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
if (index < 0) index = length + index;
for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
return -1;
}
});
/***/ }),
/* 186 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
var $export = __webpack_require__(8);
$export($export.P, 'Array', { copyWithin: __webpack_require__(187) });
__webpack_require__(188)('copyWithin');
/***/ }),
/* 187 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
'use strict';
var toObject = __webpack_require__(46);
var toAbsoluteIndex = __webpack_require__(40);
var toLength = __webpack_require__(38);
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
var O = toObject(this);
var len = toLength(O.length);
var to = toAbsoluteIndex(target, len);
var from = toAbsoluteIndex(start, len);
var end = arguments.length > 2 ? arguments[2] : undefined;
var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O) O[to] = O[from];
else delete O[to];
to += inc;
from += inc;
} return O;
};
/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__(27)('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
ArrayProto[UNSCOPABLES][key] = true;
};
/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
var $export = __webpack_require__(8);
$export($export.P, 'Array', { fill: __webpack_require__(190) });
__webpack_require__(188)('fill');
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
'use strict';
var toObject = __webpack_require__(46);
var toAbsoluteIndex = __webpack_require__(40);
var toLength = __webpack_require__(38);
module.exports = function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = toLength(O.length);
var aLen = arguments.length;
var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
var end = aLen > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $export = __webpack_require__(8);
var $find = __webpack_require__(174)(5);
var KEY = 'find';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(188)(KEY);
/***/ }),
/* 192 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $export = __webpack_require__(8);
var $find = __webpack_require__(174)(6);
var KEY = 'findIndex';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(188)(KEY);
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(194)('Array');
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var dP = __webpack_require__(11);
var DESCRIPTORS = __webpack_require__(6);
var SPECIES = __webpack_require__(27)('species');
module.exports = function (KEY) {
var C = global[KEY];
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
configurable: true,
get: function () { return this; }
});
};
/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var addToUnscopables = __webpack_require__(188);
var step = __webpack_require__(196);
var Iterators = __webpack_require__(130);
var toIObject = __webpack_require__(33);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(129)(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/* 196 */
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var inheritIfRequired = __webpack_require__(88);
var dP = __webpack_require__(11).f;
var gOPN = __webpack_require__(51).f;
var isRegExp = __webpack_require__(135);
var $flags = __webpack_require__(198);
var $RegExp = global.RegExp;
var Base = $RegExp;
var proto = $RegExp.prototype;
var re1 = /a/g;
var re2 = /a/g;
// "new" creates a new object, old webkit buggy here
var CORRECT_NEW = new $RegExp(re1) !== re1;
if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function () {
re2[__webpack_require__(27)('match')] = false;
// RegExp constructor can alter flags and IsRegExp works correct with @@match
return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
}))) {
$RegExp = function RegExp(p, f) {
var tiRE = this instanceof $RegExp;
var piRE = isRegExp(p);
var fiU = f === undefined;
return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
: inheritIfRequired(CORRECT_NEW
? new Base(piRE && !fiU ? p.source : p, f)
: Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
, tiRE ? this : proto, $RegExp);
};
var proxy = function (key) {
key in $RegExp || dP($RegExp, key, {
configurable: true,
get: function () { return Base[key]; },
set: function (it) { Base[key] = it; }
});
};
for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
proto.constructor = $RegExp;
$RegExp.prototype = proto;
__webpack_require__(18)(global, 'RegExp', $RegExp);
}
__webpack_require__(194)('RegExp');
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__(12);
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var regexpExec = __webpack_require__(200);
__webpack_require__(8)({
target: 'RegExp',
proto: true,
forced: regexpExec !== /./.exec
}, {
exec: regexpExec
});
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var regexpFlags = __webpack_require__(198);
var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;
var patchedExec = nativeExec;
var LAST_INDEX = 'lastIndex';
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/,
re2 = /b*/g;
nativeExec.call(re1, 'a');
nativeExec.call(re2, 'a');
return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
})();
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
if (PATCH) {
patchedExec = function exec(str) {
var re = this;
var lastIndex, reCopy, match, i;
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
match = nativeExec.call(re, str);
if (UPDATES_LAST_INDEX_WRONG && match) {
re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
// eslint-disable-next-line no-loop-func
nativeReplace.call(match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
return match;
};
}
module.exports = patchedExec;
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(202);
var anObject = __webpack_require__(12);
var $flags = __webpack_require__(198);
var DESCRIPTORS = __webpack_require__(6);
var TO_STRING = 'toString';
var $toString = /./[TO_STRING];
var define = function (fn) {
__webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
};
// 21.2.5.14 RegExp.prototype.toString()
if (__webpack_require__(7)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
define(function toString() {
var R = anObject(this);
return '/'.concat(R.source, '/',
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
});
// FF44- RegExp#toString has a wrong name
} else if ($toString.name != TO_STRING) {
define(function toString() {
return $toString.call(this);
});
}
/***/ }),
/* 202 */
/***/ (function(module, exports, __webpack_require__) {
// 21.2.5.3 get RegExp.prototype.flags()
if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
configurable: true,
get: __webpack_require__(198)
});
/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var anObject = __webpack_require__(12);
var toLength = __webpack_require__(38);
var advanceStringIndex = __webpack_require__(204);
var regExpExec = __webpack_require__(205);
// @@match logic
__webpack_require__(206)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
return [
// `String.prototype.match` method
// https://tc39.github.io/ecma262/#sec-string.prototype.match
function match(regexp) {
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[MATCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
},
// `RegExp.prototype[@@match]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
function (regexp) {
var res = maybeCallNative($match, regexp, this);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
if (!rx.global) return regExpExec(rx, S);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A = [];
var n = 0;
var result;
while ((result = regExpExec(rx, S)) !== null) {
var matchStr = String(result[0]);
A[n] = matchStr;
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
n++;
}
return n === 0 ? null : A;
}
];
});
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var at = __webpack_require__(128)(true);
// `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? at(S, index).length : 1);
};
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var classof = __webpack_require__(75);
var builtinExec = RegExp.prototype.exec;
// `RegExpExec` abstract operation
// https://tc39.github.io/ecma262/#sec-regexpexec
module.exports = function (R, S) {
var exec = R.exec;
if (typeof exec === 'function') {
var result = exec.call(R, S);
if (typeof result !== 'object') {
throw new TypeError('RegExp exec method returned something other than an Object or null');
}
return result;
}
if (classof(R) !== 'RegExp') {
throw new TypeError('RegExp#exec called on incompatible receiver');
}
return builtinExec.call(R, S);
};
/***/ }),
/* 206 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(199);
var redefine = __webpack_require__(18);
var hide = __webpack_require__(10);
var fails = __webpack_require__(7);
var defined = __webpack_require__(36);
var wks = __webpack_require__(27);
var regexpExec = __webpack_require__(200);
var SPECIES = wks('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
// #match works fine because it just return the exec results, even if it has
// a "grops" property.
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
return ''.replace(re, '$<a>') !== '7';
});
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
var re = /(?:)/;
var originalExec = re.exec;
re.exec = function () { return originalExec.apply(this, arguments); };
var result = 'ab'.split(re);
return result.length === 2 && result[0] === 'a' && result[1] === 'b';
})();
module.exports = function (KEY, length, exec) {
var SYMBOL = wks(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
re.exec = function () { execCalled = true; return null; };
if (KEY === 'split') {
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES] = function () { return re; };
}
re[SYMBOL]('');
return !execCalled;
}) : undefined;
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
var fns = exec(
defined,
SYMBOL,
''[KEY],
function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
if (regexp.exec === regexpExec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
}
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}
);
var strfn = fns[0];
var rxfn = fns[1];
redefine(String.prototype, KEY, strfn);
hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return rxfn.call(string, this); }
);
}
};
/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var anObject = __webpack_require__(12);
var toObject = __webpack_require__(46);
var toLength = __webpack_require__(38);
var toInteger = __webpack_require__(39);
var advanceStringIndex = __webpack_require__(204);
var regExpExec = __webpack_require__(205);
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// @@replace logic
__webpack_require__(206)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
return [
// `String.prototype.replace` method
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = defined(this);
var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
var res = maybeCallNative($replace, regexp, this, replaceValue);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var functionalReplace = typeof replaceValue === 'function';
if (!functionalReplace) replaceValue = String(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S);
if (result === null) break;
results.push(result);
if (!global) break;
var matchStr = String(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = String(result[0]);
var position = max(min(toInteger(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = [matched].concat(captures, position, S);
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
var replacement = String(replaceValue.apply(undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + S.slice(nextSourcePosition);
}
];
// https://tc39.github.io/ecma262/#sec-getsubstitution
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return $replace.call(replacement, symbols, function (match, ch) {
var capture;
switch (ch.charAt(0)) {
case '$': return '$';
case '&': return matched;
case '`': return str.slice(0, position);
case "'": return str.slice(tailPos);
case '<':
capture = namedCaptures[ch.slice(1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
}
});
/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var anObject = __webpack_require__(12);
var sameValue = __webpack_require__(71);
var regExpExec = __webpack_require__(205);
// @@search logic
__webpack_require__(206)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
return [
// `String.prototype.search` method
// https://tc39.github.io/ecma262/#sec-string.prototype.search
function search(regexp) {
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[SEARCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
},
// `RegExp.prototype[@@search]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
function (regexp) {
var res = maybeCallNative($search, regexp, this);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var previousLastIndex = rx.lastIndex;
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
var result = regExpExec(rx, S);
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
return result === null ? -1 : result.index;
}
];
});
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var isRegExp = __webpack_require__(135);
var anObject = __webpack_require__(12);
var speciesConstructor = __webpack_require__(210);
var advanceStringIndex = __webpack_require__(204);
var toLength = __webpack_require__(38);
var callRegExpExec = __webpack_require__(205);
var regexpExec = __webpack_require__(200);
var fails = __webpack_require__(7);
var $min = Math.min;
var $push = [].push;
var $SPLIT = 'split';
var LENGTH = 'length';
var LAST_INDEX = 'lastIndex';
var MAX_UINT32 = 0xffffffff;
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
// @@split logic
__webpack_require__(206)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
var internalSplit;
if (
'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
'.'[$SPLIT](/()()/)[LENGTH] > 1 ||
''[$SPLIT](/.?/)[LENGTH]
) {
// based on es5-shim implementation, need to rework it
internalSplit = function (separator, limit) {
var string = String(this);
if (separator === undefined && limit === 0) return [];
// If `separator` is not a regex, use native split
if (!isRegExp(separator)) return $split.call(string, separator, limit);
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var match, lastIndex, lastLength;
while (match = regexpExec.call(separatorCopy, string)) {
lastIndex = separatorCopy[LAST_INDEX];
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index));
if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
lastLength = match[0][LENGTH];
lastLastIndex = lastIndex;
if (output[LENGTH] >= splitLimit) break;
}
if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
}
if (lastLastIndex === string[LENGTH]) {
if (lastLength || !separatorCopy.test('')) output.push('');
} else output.push(string.slice(lastLastIndex));
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
};
// Chakra, V8
} else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
internalSplit = function (separator, limit) {
return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
};
} else {
internalSplit = $split;
}
return [
// `String.prototype.split` method
// https://tc39.github.io/ecma262/#sec-string.prototype.split
function split(separator, limit) {
var O = defined(this);
var splitter = separator == undefined ? undefined : separator[SPLIT];
return splitter !== undefined
? splitter.call(separator, O, limit)
: internalSplit.call(String(O), separator, limit);
},
// `RegExp.prototype[@@split]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
//
// NOTE: This cannot be properly polyfilled in engines that don't support
// the 'y' flag.
function (regexp, limit) {
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var C = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? 'i' : '') +
(rx.multiline ? 'm' : '') +
(rx.unicode ? 'u' : '') +
(SUPPORTS_Y ? 'y' : 'g');
// ^(? + rx + ) is needed, in combination with some S slicing, to
// simulate the 'y' flag.
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
if (lim === 0) return [];
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
var p = 0;
var q = 0;
var A = [];
while (q < S.length) {
splitter.lastIndex = SUPPORTS_Y ? q : 0;
var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
var e;
if (
z === null ||
(e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
) {
q = advanceStringIndex(S, q, unicodeMatching);
} else {
A.push(S.slice(p, q));
if (A.length === lim) return A;
for (var i = 1; i <= z.length - 1; i++) {
A.push(z[i]);
if (A.length === lim) return A;
}
q = p = e;
}
}
A.push(S.slice(p));
return A;
}
];
});
/***/ }),
/* 210 */
/***/ (function(module, exports, __webpack_require__) {
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var anObject = __webpack_require__(12);
var aFunction = __webpack_require__(24);
var SPECIES = __webpack_require__(27)('species');
module.exports = function (O, D) {
var C = anObject(O).constructor;
var S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};
/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(22);
var global = __webpack_require__(4);
var ctx = __webpack_require__(23);
var classof = __webpack_require__(75);
var $export = __webpack_require__(8);
var isObject = __webpack_require__(13);
var aFunction = __webpack_require__(24);
var anInstance = __webpack_require__(212);
var forOf = __webpack_require__(213);
var speciesConstructor = __webpack_require__(210);
var task = __webpack_require__(214).set;
var microtask = __webpack_require__(215)();
var newPromiseCapabilityModule = __webpack_require__(216);
var perform = __webpack_require__(217);
var userAgent = __webpack_require__(218);
var promiseResolve = __webpack_require__(219);
var PROMISE = 'Promise';
var TypeError = global.TypeError;
var process = global.process;
var versions = process && process.versions;
var v8 = versions && versions.v8 || '';
var $Promise = global[PROMISE];
var isNode = classof(process) == 'process';
var empty = function () { /* empty */ };
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
var USE_NATIVE = !!function () {
try {
// correct subclassing with @@species support
var promise = $Promise.resolve(1);
var FakePromise = (promise.constructor = {})[__webpack_require__(27)('species')] = function (exec) {
exec(empty, empty);
};
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
return (isNode || typeof PromiseRejectionEvent == 'function')
&& promise.then(empty) instanceof FakePromise
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
// we can't detect it synchronously, so just check versions
&& v8.indexOf('6.6') !== 0
&& userAgent.indexOf('Chrome/66') === -1;
} catch (e) { /* empty */ }
}();
// helpers
var isThenable = function (it) {
var then;
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, isReject) {
if (promise._n) return;
promise._n = true;
var chain = promise._c;
microtask(function () {
var value = promise._v;
var ok = promise._s == 1;
var i = 0;
var run = function (reaction) {
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
var result, then, exited;
try {
if (handler) {
if (!ok) {
if (promise._h == 2) onHandleUnhandled(promise);
promise._h = 1;
}
if (handler === true) result = value;
else {
if (domain) domain.enter();
result = handler(value); // may throw
if (domain) {
domain.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject(TypeError('Promise-chain cycle'));
} else if (then = isThenable(result)) {
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch (e) {
if (domain && !exited) domain.exit();
reject(e);
}
};
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
promise._c = [];
promise._n = false;
if (isReject && !promise._h) onUnhandled(promise);
});
};
var onUnhandled = function (promise) {
task.call(global, function () {
var value = promise._v;
var unhandled = isUnhandled(promise);
var result, handler, console;
if (unhandled) {
result = perform(function () {
if (isNode) {
process.emit('unhandledRejection', value, promise);
} else if (handler = global.onunhandledrejection) {
handler({ promise: promise, reason: value });
} else if ((console = global.console) && console.error) {
console.error('Unhandled promise rejection', value);
}
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
} promise._a = undefined;
if (unhandled && result.e) throw result.v;
});
};
var isUnhandled = function (promise) {
return promise._h !== 1 && (promise._a || promise._c).length === 0;
};
var onHandleUnhandled = function (promise) {
task.call(global, function () {
var handler;
if (isNode) {
process.emit('rejectionHandled', promise);
} else if (handler = global.onrejectionhandled) {
handler({ promise: promise, reason: promise._v });
}
});
};
var $reject = function (value) {
var promise = this;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
promise._v = value;
promise._s = 2;
if (!promise._a) promise._a = promise._c.slice();
notify(promise, true);
};
var $resolve = function (value) {
var promise = this;
var then;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
try {
if (promise === value) throw TypeError("Promise can't be resolved itself");
if (then = isThenable(value)) {
microtask(function () {
var wrapper = { _w: promise, _d: false }; // wrap
try {
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
} catch (e) {
$reject.call(wrapper, e);
}
});
} else {
promise._v = value;
promise._s = 1;
notify(promise, false);
}
} catch (e) {
$reject.call({ _w: promise, _d: false }, e); // wrap
}
};
// constructor polyfill
if (!USE_NATIVE) {
// 25.4.3.1 Promise(executor)
$Promise = function Promise(executor) {
anInstance(this, $Promise, PROMISE, '_h');
aFunction(executor);
Internal.call(this);
try {
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
} catch (err) {
$reject.call(this, err);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor) {
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
this._s = 0; // <- state
this._d = false; // <- done
this._v = undefined; // <- value
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
this._n = false; // <- notify
};
Internal.prototype = __webpack_require__(220)($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected) {
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if (this._a) this._a.push(reaction);
if (this._s) notify(this, false);
return reaction.promise;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function (onRejected) {
return this.then(undefined, onRejected);
}
});
OwnPromiseCapability = function () {
var promise = new Internal();
this.promise = promise;
this.resolve = ctx($resolve, promise, 1);
this.reject = ctx($reject, promise, 1);
};
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
return C === $Promise || C === Wrapper
? new OwnPromiseCapability(C)
: newGenericPromiseCapability(C);
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
__webpack_require__(26)($Promise, PROMISE);
__webpack_require__(194)(PROMISE);
Wrapper = __webpack_require__(9)[PROMISE];
// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
// 25.4.4.5 Promise.reject(r)
reject: function reject(r) {
var capability = newPromiseCapability(this);
var $$reject = capability.reject;
$$reject(r);
return capability.promise;
}
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
// 25.4.4.6 Promise.resolve(x)
resolve: function resolve(x) {
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
}
});
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(167)(function (iter) {
$Promise.all(iter)['catch'](empty);
})), PROMISE, {
// 25.4.4.1 Promise.all(iterable)
all: function all(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
var values = [];
var index = 0;
var remaining = 1;
forOf(iterable, false, function (promise) {
var $index = index++;
var alreadyCalled = false;
values.push(undefined);
remaining++;
C.resolve(promise).then(function (value) {
if (alreadyCalled) return;
alreadyCalled = true;
values[$index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if (result.e) reject(result.v);
return capability.promise;
},
// 25.4.4.4 Promise.race(iterable)
race: function race(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var reject = capability.reject;
var result = perform(function () {
forOf(iterable, false, function (promise) {
C.resolve(promise).then(capability.resolve, reject);
});
});
if (result.e) reject(result.v);
return capability.promise;
}
});
/***/ }),
/* 212 */
/***/ (function(module, exports) {
module.exports = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ': incorrect invocation!');
} return it;
};
/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(23);
var call = __webpack_require__(163);
var isArrayIter = __webpack_require__(164);
var anObject = __webpack_require__(12);
var toLength = __webpack_require__(38);
var getIterFn = __webpack_require__(166);
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
var f = ctx(fn, that, entries ? 2 : 1);
var index = 0;
var length, step, iterator, result;
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
// fast case for arrays with default iterator
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
if (result === BREAK || result === RETURN) return result;
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
result = call(iterator, f, step.value, entries);
if (result === BREAK || result === RETURN) return result;
}
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(23);
var invoke = __webpack_require__(78);
var html = __webpack_require__(49);
var cel = __webpack_require__(15);
var global = __webpack_require__(4);
var process = global.process;
var setTask = global.setImmediate;
var clearTask = global.clearImmediate;
var MessageChannel = global.MessageChannel;
var Dispatch = global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer, channel, port;
var run = function () {
var id = +this;
// eslint-disable-next-line no-prototype-builtins
if (queue.hasOwnProperty(id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var listener = function (event) {
run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!setTask || !clearTask) {
setTask = function setImmediate(fn) {
var args = [];
var i = 1;
while (arguments.length > i) args.push(arguments[i++]);
queue[++counter] = function () {
// eslint-disable-next-line no-new-func
invoke(typeof fn == 'function' ? fn : Function(fn), args);
};
defer(counter);
return counter;
};
clearTask = function clearImmediate(id) {
delete queue[id];
};
// Node.js 0.8-
if (__webpack_require__(35)(process) == 'process') {
defer = function (id) {
process.nextTick(ctx(run, id, 1));
};
// Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(ctx(run, id, 1));
};
// Browsers with MessageChannel, includes WebWorkers
} else if (MessageChannel) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = listener;
defer = ctx(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
defer = function (id) {
global.postMessage(id + '', '*');
};
global.addEventListener('message', listener, false);
// IE8-
} else if (ONREADYSTATECHANGE in cel('script')) {
defer = function (id) {
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
html.removeChild(this);
run.call(id);
};
};
// Rest old browsers
} else {
defer = function (id) {
setTimeout(ctx(run, id, 1), 0);
};
}
}
module.exports = {
set: setTask,
clear: clearTask
};
/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var macrotask = __webpack_require__(214).set;
var Observer = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
var Promise = global.Promise;
var isNode = __webpack_require__(35)(process) == 'process';
module.exports = function () {
var head, last, notify;
var flush = function () {
var parent, fn;
if (isNode && (parent = process.domain)) parent.exit();
while (head) {
fn = head.fn;
head = head.next;
try {
fn();
} catch (e) {
if (head) notify();
else last = undefined;
throw e;
}
} last = undefined;
if (parent) parent.enter();
};
// Node.js
if (isNode) {
notify = function () {
process.nextTick(flush);
};
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
} else if (Observer && !(global.navigator && global.navigator.standalone)) {
var toggle = true;
var node = document.createTextNode('');
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
notify = function () {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
var promise = Promise.resolve(undefined);
notify = function () {
promise.then(flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
notify = function () {
// strange IE + webpack dev server bug - use .call(global)
macrotask.call(global, flush);
};
}
return function (fn) {
var task = { fn: fn, next: undefined };
if (last) last.next = task;
if (!head) {
head = task;
notify();
} last = task;
};
};
/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 25.4.1.5 NewPromiseCapability(C)
var aFunction = __webpack_require__(24);
function PromiseCapability(C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aFunction(resolve);
this.reject = aFunction(reject);
}
module.exports.f = function (C) {
return new PromiseCapability(C);
};
/***/ }),
/* 217 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return { e: false, v: exec() };
} catch (e) {
return { e: true, v: e };
}
};
/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var navigator = global.navigator;
module.exports = navigator && navigator.userAgent || '';
/***/ }),
/* 219 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var newPromiseCapability = __webpack_require__(216);
module.exports = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
var redefine = __webpack_require__(18);
module.exports = function (target, src, safe) {
for (var key in src) redefine(target, key, src[key], safe);
return target;
};
/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var strong = __webpack_require__(222);
var validate = __webpack_require__(223);
var MAP = 'Map';
// 23.1 Map Objects
module.exports = __webpack_require__(224)(MAP, function (get) {
return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.1.3.6 Map.prototype.get(key)
get: function get(key) {
var entry = strong.getEntry(validate(this, MAP), key);
return entry && entry.v;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function set(key, value) {
return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
}
}, strong, true);
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var dP = __webpack_require__(11).f;
var create = __webpack_require__(47);
var redefineAll = __webpack_require__(220);
var ctx = __webpack_require__(23);
var anInstance = __webpack_require__(212);
var forOf = __webpack_require__(213);
var $iterDefine = __webpack_require__(129);
var step = __webpack_require__(196);
var setSpecies = __webpack_require__(194);
var DESCRIPTORS = __webpack_require__(6);
var fastKey = __webpack_require__(25).fastKey;
var validate = __webpack_require__(223);
var SIZE = DESCRIPTORS ? '_s' : 'size';
var getEntry = function (that, key) {
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return that._i[index];
// frozen object case
for (entry = that._f; entry; entry = entry.n) {
if (entry.k == key) return entry;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = create(null); // index
that._f = undefined; // first entry
that._l = undefined; // last entry
that[SIZE] = 0; // size
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear() {
for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
entry.r = true;
if (entry.p) entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that._f = that._l = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function (key) {
var that = validate(this, NAME);
var entry = getEntry(that, key);
if (entry) {
var next = entry.n;
var prev = entry.p;
delete that._i[entry.i];
entry.r = true;
if (prev) prev.n = next;
if (next) next.p = prev;
if (that._f == entry) that._f = next;
if (that._l == entry) that._l = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /* , that = undefined */) {
validate(this, NAME);
var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.n : this._f) {
f(entry.v, entry.k, this);
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key) {
return !!getEntry(validate(this, NAME), key);
}
});
if (DESCRIPTORS) dP(C.prototype, 'size', {
get: function () {
return validate(this, NAME)[SIZE];
}
});
return C;
},
def: function (that, key, value) {
var entry = getEntry(that, key);
var prev, index;
// change existing entry
if (entry) {
entry.v = value;
// create new entry
} else {
that._l = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that._l, // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if (!that._f) that._f = entry;
if (prev) prev.n = entry;
that[SIZE]++;
// add to index
if (index !== 'F') that._i[index] = entry;
} return that;
},
getEntry: getEntry,
setStrong: function (C, NAME, IS_MAP) {
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
$iterDefine(C, NAME, function (iterated, kind) {
this._t = validate(iterated, NAME); // target
this._k = kind; // kind
this._l = undefined; // previous
}, function () {
var that = this;
var kind = that._k;
var entry = that._l;
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
// get next entry
if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
// or finish the iteration
that._t = undefined;
return step(1);
}
// return step by kind
if (kind == 'keys') return step(0, entry.k);
if (kind == 'values') return step(0, entry.v);
return step(0, [entry.k, entry.v]);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
setSpecies(NAME);
}
};
/***/ }),
/* 223 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
module.exports = function (it, TYPE) {
if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
return it;
};
/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var $export = __webpack_require__(8);
var redefine = __webpack_require__(18);
var redefineAll = __webpack_require__(220);
var meta = __webpack_require__(25);
var forOf = __webpack_require__(213);
var anInstance = __webpack_require__(212);
var isObject = __webpack_require__(13);
var fails = __webpack_require__(7);
var $iterDetect = __webpack_require__(167);
var setToStringTag = __webpack_require__(26);
var inheritIfRequired = __webpack_require__(88);
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
var Base = global[NAME];
var C = Base;
var ADDER = IS_MAP ? 'set' : 'add';
var proto = C && C.prototype;
var O = {};
var fixMethod = function (KEY) {
var fn = proto[KEY];
redefine(proto, KEY,
KEY == 'delete' ? function (a) {
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'has' ? function has(a) {
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'get' ? function get(a) {
return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
: function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
);
};
if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
new C().entries().next();
}))) {
// create collection constructor
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
redefineAll(C.prototype, methods);
meta.NEED = true;
} else {
var instance = new C();
// early implementations not supports chaining
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
// most early implementations doesn't supports iterables, most modern - not close it correctly
var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
// for early implementations -0 and +0 not the same
var BUGGY_ZERO = !IS_WEAK && fails(function () {
// V8 ~ Chromium 42- fails only with 5+ elements
var $instance = new C();
var index = 5;
while (index--) $instance[ADDER](index, index);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
C = wrapper(function (target, iterable) {
anInstance(target, C, NAME);
var that = inheritIfRequired(new Base(), target, C);
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
return that;
});
C.prototype = proto;
proto.constructor = C;
}
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
fixMethod('delete');
fixMethod('has');
IS_MAP && fixMethod('get');
}
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
// weak collections should not contains .clear method
if (IS_WEAK && proto.clear) delete proto.clear;
}
setToStringTag(C, NAME);
O[NAME] = C;
$export($export.G + $export.W + $export.F * (C != Base), O);
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
return C;
};
/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var strong = __webpack_require__(222);
var validate = __webpack_require__(223);
var SET = 'Set';
// 23.2 Set Objects
module.exports = __webpack_require__(224)(SET, function (get) {
return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value) {
return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
}
}, strong);
/***/ }),
/* 226 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var each = __webpack_require__(174)(0);
var redefine = __webpack_require__(18);
var meta = __webpack_require__(25);
var assign = __webpack_require__(69);
var weak = __webpack_require__(227);
var isObject = __webpack_require__(13);
var validate = __webpack_require__(223);
var NATIVE_WEAK_MAP = __webpack_require__(223);
var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
var WEAK_MAP = 'WeakMap';
var getWeak = meta.getWeak;
var isExtensible = Object.isExtensible;
var uncaughtFrozenStore = weak.ufstore;
var InternalMap;
var wrapper = function (get) {
return function WeakMap() {
return get(this, arguments.length > 0 ? arguments[0] : undefined);
};
};
var methods = {
// 23.3.3.3 WeakMap.prototype.get(key)
get: function get(key) {
if (isObject(key)) {
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
return data ? data[this._i] : undefined;
}
},
// 23.3.3.5 WeakMap.prototype.set(key, value)
set: function set(key, value) {
return weak.def(validate(this, WEAK_MAP), key, value);
}
};
// 23.3 WeakMap Objects
var $WeakMap = module.exports = __webpack_require__(224)(WEAK_MAP, wrapper, methods, weak, true, true);
// IE11 WeakMap frozen keys fix
if (NATIVE_WEAK_MAP && IS_IE11) {
InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
assign(InternalMap.prototype, methods);
meta.NEED = true;
each(['delete', 'has', 'get', 'set'], function (key) {
var proto = $WeakMap.prototype;
var method = proto[key];
redefine(proto, key, function (a, b) {
// store frozen objects on internal weakmap shim
if (isObject(a) && !isExtensible(a)) {
if (!this._f) this._f = new InternalMap();
var result = this._f[key](a, b);
return key == 'set' ? this : result;
// store all the rest on native weakmap
} return method.call(this, a, b);
});
});
}
/***/ }),
/* 227 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var redefineAll = __webpack_require__(220);
var getWeak = __webpack_require__(25).getWeak;
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var anInstance = __webpack_require__(212);
var forOf = __webpack_require__(213);
var createArrayMethod = __webpack_require__(174);
var $has = __webpack_require__(5);
var validate = __webpack_require__(223);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var id = 0;
// fallback for uncaught frozen keys
var uncaughtFrozenStore = function (that) {
return that._l || (that._l = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function () {
this.a = [];
};
var findUncaughtFrozen = function (store, key) {
return arrayFind(store.a, function (it) {
return it[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function (key) {
var entry = findUncaughtFrozen(this, key);
if (entry) return entry[1];
},
has: function (key) {
return !!findUncaughtFrozen(this, key);
},
set: function (key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry) entry[1] = value;
else this.a.push([key, value]);
},
'delete': function (key) {
var index = arrayFindIndex(this.a, function (it) {
return it[0] === key;
});
if (~index) this.a.splice(index, 1);
return !!~index;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = id++; // collection id
that._l = undefined; // leak store for uncaught frozen objects
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.3.3.2 WeakMap.prototype.delete(key)
// 23.4.3.3 WeakSet.prototype.delete(value)
'delete': function (key) {
if (!isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
return data && $has(data, this._i) && delete data[this._i];
},
// 23.3.3.4 WeakMap.prototype.has(key)
// 23.4.3.4 WeakSet.prototype.has(value)
has: function has(key) {
if (!isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
return data && $has(data, this._i);
}
});
return C;
},
def: function (that, key, value) {
var data = getWeak(anObject(key), true);
if (data === true) uncaughtFrozenStore(that).set(key, value);
else data[that._i] = value;
return that;
},
ufstore: uncaughtFrozenStore
};
/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var weak = __webpack_require__(227);
var validate = __webpack_require__(223);
var WEAK_SET = 'WeakSet';
// 23.4 WeakSet Objects
__webpack_require__(224)(WEAK_SET, function (get) {
return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.4.3.1 WeakSet.prototype.add(value)
add: function add(value) {
return weak.def(validate(this, WEAK_SET), value, true);
}
}, weak, false, true);
/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var $typed = __webpack_require__(230);
var buffer = __webpack_require__(231);
var anObject = __webpack_require__(12);
var toAbsoluteIndex = __webpack_require__(40);
var toLength = __webpack_require__(38);
var isObject = __webpack_require__(13);
var ArrayBuffer = __webpack_require__(4).ArrayBuffer;
var speciesConstructor = __webpack_require__(210);
var $ArrayBuffer = buffer.ArrayBuffer;
var $DataView = buffer.DataView;
var $isView = $typed.ABV && ArrayBuffer.isView;
var $slice = $ArrayBuffer.prototype.slice;
var VIEW = $typed.VIEW;
var ARRAY_BUFFER = 'ArrayBuffer';
$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
// 24.1.3.1 ArrayBuffer.isView(arg)
isView: function isView(it) {
return $isView && $isView(it) || isObject(it) && VIEW in it;
}
});
$export($export.P + $export.U + $export.F * __webpack_require__(7)(function () {
return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
}), ARRAY_BUFFER, {
// 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
slice: function slice(start, end) {
if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
var len = anObject(this).byteLength;
var first = toAbsoluteIndex(start, len);
var fin = toAbsoluteIndex(end === undefined ? len : end, len);
var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
var viewS = new $DataView(this);
var viewT = new $DataView(result);
var index = 0;
while (first < fin) {
viewT.setUint8(index++, viewS.getUint8(first++));
} return result;
}
});
__webpack_require__(194)(ARRAY_BUFFER);
/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(4);
var hide = __webpack_require__(10);
var uid = __webpack_require__(19);
var TYPED = uid('typed_array');
var VIEW = uid('view');
var ABV = !!(global.ArrayBuffer && global.DataView);
var CONSTR = ABV;
var i = 0;
var l = 9;
var Typed;
var TypedArrayConstructors = (
'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
).split(',');
while (i < l) {
if (Typed = global[TypedArrayConstructors[i++]]) {
hide(Typed.prototype, TYPED, true);
hide(Typed.prototype, VIEW, true);
} else CONSTR = false;
}
module.exports = {
ABV: ABV,
CONSTR: CONSTR,
TYPED: TYPED,
VIEW: VIEW
};
/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(4);
var DESCRIPTORS = __webpack_require__(6);
var LIBRARY = __webpack_require__(22);
var $typed = __webpack_require__(230);
var hide = __webpack_require__(10);
var redefineAll = __webpack_require__(220);
var fails = __webpack_require__(7);
var anInstance = __webpack_require__(212);
var toInteger = __webpack_require__(39);
var toLength = __webpack_require__(38);
var toIndex = __webpack_require__(232);
var gOPN = __webpack_require__(51).f;
var dP = __webpack_require__(11).f;
var arrayFill = __webpack_require__(190);
var setToStringTag = __webpack_require__(26);
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length!';
var WRONG_INDEX = 'Wrong index!';
var $ArrayBuffer = global[ARRAY_BUFFER];
var $DataView = global[DATA_VIEW];
var Math = global.Math;
var RangeError = global.RangeError;
// eslint-disable-next-line no-shadow-restricted-names
var Infinity = global.Infinity;
var BaseBuffer = $ArrayBuffer;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var BUFFER = 'buffer';
var BYTE_LENGTH = 'byteLength';
var BYTE_OFFSET = 'byteOffset';
var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
// IEEE754 conversions based on https://github.com/feross/ieee754
function packIEEE754(value, mLen, nBytes) {
var buffer = new Array(nBytes);
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
var i = 0;
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
var e, m, c;
value = abs(value);
// eslint-disable-next-line no-self-compare
if (value != value || value === Infinity) {
// eslint-disable-next-line no-self-compare
m = value != value ? 1 : 0;
e = eMax;
} else {
e = floor(log(value) / LN2);
if (value * (c = pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * pow(2, mLen);
e = e + eBias;
} else {
m = value * pow(2, eBias - 1) * pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
e = e << mLen | m;
eLen += mLen;
for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
buffer[--i] |= s * 128;
return buffer;
}
function unpackIEEE754(buffer, mLen, nBytes) {
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var nBits = eLen - 7;
var i = nBytes - 1;
var s = buffer[i--];
var e = s & 127;
var m;
s >>= 7;
for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : s ? -Infinity : Infinity;
} else {
m = m + pow(2, mLen);
e = e - eBias;
} return (s ? -1 : 1) * m * pow(2, e - mLen);
}
function unpackI32(bytes) {
return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
}
function packI8(it) {
return [it & 0xff];
}
function packI16(it) {
return [it & 0xff, it >> 8 & 0xff];
}
function packI32(it) {
return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
}
function packF64(it) {
return packIEEE754(it, 52, 8);
}
function packF32(it) {
return packIEEE754(it, 23, 4);
}
function addGetter(C, key, internal) {
dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
}
function get(view, bytes, index, isLittleEndian) {
var numIndex = +index;
var intIndex = toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = store.slice(start, start + bytes);
return isLittleEndian ? pack : pack.reverse();
}
function set(view, bytes, index, conversion, value, isLittleEndian) {
var numIndex = +index;
var intIndex = toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = conversion(+value);
for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
}
if (!$typed.ABV) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
var byteLength = toIndex(length);
this._b = arrayFill.call(new Array(byteLength), 0);
this[$LENGTH] = byteLength;
};
$DataView = function DataView(buffer, byteOffset, byteLength) {
anInstance(this, $DataView, DATA_VIEW);
anInstance(buffer, $ArrayBuffer, DATA_VIEW);
var bufferLength = buffer[$LENGTH];
var offset = toInteger(byteOffset);
if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
this[$BUFFER] = buffer;
this[$OFFSET] = offset;
this[$LENGTH] = byteLength;
};
if (DESCRIPTORS) {
addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
addGetter($DataView, BUFFER, '_b');
addGetter($DataView, BYTE_LENGTH, '_l');
addGetter($DataView, BYTE_OFFSET, '_o');
}
redefineAll($DataView[PROTOTYPE], {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1]));
},
getUint32: function getUint32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
},
getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
},
getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
},
setInt8: function setInt8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setUint8: function setUint8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packF32, value, arguments[2]);
},
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
set(this, 8, byteOffset, packF64, value, arguments[2]);
}
});
} else {
if (!fails(function () {
$ArrayBuffer(1);
}) || !fails(function () {
new $ArrayBuffer(-1); // eslint-disable-line no-new
}) || fails(function () {
new $ArrayBuffer(); // eslint-disable-line no-new
new $ArrayBuffer(1.5); // eslint-disable-line no-new
new $ArrayBuffer(NaN); // eslint-disable-line no-new
return $ArrayBuffer.name != ARRAY_BUFFER;
})) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, $ArrayBuffer);
return new BaseBuffer(toIndex(length));
};
var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
}
if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
}
// iOS Safari 7.x bug
var view = new $DataView(new $ArrayBuffer(2));
var $setInt8 = $DataView[PROTOTYPE].setInt8;
view.setInt8(0, 2147483648);
view.setInt8(1, 2147483649);
if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
setInt8: function setInt8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
}
}, true);
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
hide($DataView[PROTOTYPE], $typed.VIEW, true);
exports[ARRAY_BUFFER] = $ArrayBuffer;
exports[DATA_VIEW] = $DataView;
/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/ecma262/#sec-toindex
var toInteger = __webpack_require__(39);
var toLength = __webpack_require__(38);
module.exports = function (it) {
if (it === undefined) return 0;
var number = toInteger(it);
var length = toLength(number);
if (number !== length) throw RangeError('Wrong length!');
return length;
};
/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
$export($export.G + $export.W + $export.F * !__webpack_require__(230).ABV, {
DataView: __webpack_require__(231).DataView
});
/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Int8', 1, function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
if (__webpack_require__(6)) {
var LIBRARY = __webpack_require__(22);
var global = __webpack_require__(4);
var fails = __webpack_require__(7);
var $export = __webpack_require__(8);
var $typed = __webpack_require__(230);
var $buffer = __webpack_require__(231);
var ctx = __webpack_require__(23);
var anInstance = __webpack_require__(212);
var propertyDesc = __webpack_require__(17);
var hide = __webpack_require__(10);
var redefineAll = __webpack_require__(220);
var toInteger = __webpack_require__(39);
var toLength = __webpack_require__(38);
var toIndex = __webpack_require__(232);
var toAbsoluteIndex = __webpack_require__(40);
var toPrimitive = __webpack_require__(16);
var has = __webpack_require__(5);
var classof = __webpack_require__(75);
var isObject = __webpack_require__(13);
var toObject = __webpack_require__(46);
var isArrayIter = __webpack_require__(164);
var create = __webpack_require__(47);
var getPrototypeOf = __webpack_require__(59);
var gOPN = __webpack_require__(51).f;
var getIterFn = __webpack_require__(166);
var uid = __webpack_require__(19);
var wks = __webpack_require__(27);
var createArrayMethod = __webpack_require__(174);
var createArrayIncludes = __webpack_require__(37);
var speciesConstructor = __webpack_require__(210);
var ArrayIterators = __webpack_require__(195);
var Iterators = __webpack_require__(130);
var $iterDetect = __webpack_require__(167);
var setSpecies = __webpack_require__(194);
var arrayFill = __webpack_require__(190);
var arrayCopyWithin = __webpack_require__(187);
var $DP = __webpack_require__(11);
var $GOPD = __webpack_require__(52);
var dP = $DP.f;
var gOPD = $GOPD.f;
var RangeError = global.RangeError;
var TypeError = global.TypeError;
var Uint8Array = global.Uint8Array;
var ARRAY_BUFFER = 'ArrayBuffer';
var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var PROTOTYPE = 'prototype';
var ArrayProto = Array[PROTOTYPE];
var $ArrayBuffer = $buffer.ArrayBuffer;
var $DataView = $buffer.DataView;
var arrayForEach = createArrayMethod(0);
var arrayFilter = createArrayMethod(2);
var arraySome = createArrayMethod(3);
var arrayEvery = createArrayMethod(4);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var arrayIncludes = createArrayIncludes(true);
var arrayIndexOf = createArrayIncludes(false);
var arrayValues = ArrayIterators.values;
var arrayKeys = ArrayIterators.keys;
var arrayEntries = ArrayIterators.entries;
var arrayLastIndexOf = ArrayProto.lastIndexOf;
var arrayReduce = ArrayProto.reduce;
var arrayReduceRight = ArrayProto.reduceRight;
var arrayJoin = ArrayProto.join;
var arraySort = ArrayProto.sort;
var arraySlice = ArrayProto.slice;
var arrayToString = ArrayProto.toString;
var arrayToLocaleString = ArrayProto.toLocaleString;
var ITERATOR = wks('iterator');
var TAG = wks('toStringTag');
var TYPED_CONSTRUCTOR = uid('typed_constructor');
var DEF_CONSTRUCTOR = uid('def_constructor');
var ALL_CONSTRUCTORS = $typed.CONSTR;
var TYPED_ARRAY = $typed.TYPED;
var VIEW = $typed.VIEW;
var WRONG_LENGTH = 'Wrong length!';
var $map = createArrayMethod(1, function (O, length) {
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
});
var LITTLE_ENDIAN = fails(function () {
// eslint-disable-next-line no-undef
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
});
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
new Uint8Array(1).set({});
});
var toOffset = function (it, BYTES) {
var offset = toInteger(it);
if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
return offset;
};
var validate = function (it) {
if (isObject(it) && TYPED_ARRAY in it) return it;
throw TypeError(it + ' is not a typed array!');
};
var allocate = function (C, length) {
if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
throw TypeError('It is not a typed array constructor!');
} return new C(length);
};
var speciesFromList = function (O, list) {
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
};
var fromList = function (C, list) {
var index = 0;
var length = list.length;
var result = allocate(C, length);
while (length > index) result[index] = list[index++];
return result;
};
var addGetter = function (it, key, internal) {
dP(it, key, { get: function () { return this._d[internal]; } });
};
var $from = function from(source /* , mapfn, thisArg */) {
var O = toObject(source);
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iterFn = getIterFn(O);
var i, length, values, result, step, iterator;
if (iterFn != undefined && !isArrayIter(iterFn)) {
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
values.push(step.value);
} O = values;
}
if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var $of = function of(/* ...items */) {
var index = 0;
var length = arguments.length;
var result = allocate(this, length);
while (length > index) result[index] = arguments[index++];
return result;
};
// iOS Safari 6.x fails here
var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
var $toLocaleString = function toLocaleString() {
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
};
var proto = {
copyWithin: function copyWithin(target, start /* , end */) {
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
},
every: function every(callbackfn /* , thisArg */) {
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
return arrayFill.apply(validate(this), arguments);
},
filter: function filter(callbackfn /* , thisArg */) {
return speciesFromList(this, arrayFilter(validate(this), callbackfn,
arguments.length > 1 ? arguments[1] : undefined));
},
find: function find(predicate /* , thisArg */) {
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
findIndex: function findIndex(predicate /* , thisArg */) {
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
forEach: function forEach(callbackfn /* , thisArg */) {
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
indexOf: function indexOf(searchElement /* , fromIndex */) {
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
includes: function includes(searchElement /* , fromIndex */) {
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
join: function join(separator) { // eslint-disable-line no-unused-vars
return arrayJoin.apply(validate(this), arguments);
},
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
return arrayLastIndexOf.apply(validate(this), arguments);
},
map: function map(mapfn /* , thisArg */) {
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
},
reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduce.apply(validate(this), arguments);
},
reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduceRight.apply(validate(this), arguments);
},
reverse: function reverse() {
var that = this;
var length = validate(that).length;
var middle = Math.floor(length / 2);
var index = 0;
var value;
while (index < middle) {
value = that[index];
that[index++] = that[--length];
that[length] = value;
} return that;
},
some: function some(callbackfn /* , thisArg */) {
return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
sort: function sort(comparefn) {
return arraySort.call(validate(this), comparefn);
},
subarray: function subarray(begin, end) {
var O = validate(this);
var length = O.length;
var $begin = toAbsoluteIndex(begin, length);
return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
O.buffer,
O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
);
}
};
var $slice = function slice(start, end) {
return speciesFromList(this, arraySlice.call(validate(this), start, end));
};
var $set = function set(arrayLike /* , offset */) {
validate(this);
var offset = toOffset(arguments[1], 1);
var length = this.length;
var src = toObject(arrayLike);
var len = toLength(src.length);
var index = 0;
if (len + offset > length) throw RangeError(WRONG_LENGTH);
while (index < len) this[offset + index] = src[index++];
};
var $iterators = {
entries: function entries() {
return arrayEntries.call(validate(this));
},
keys: function keys() {
return arrayKeys.call(validate(this));
},
values: function values() {
return arrayValues.call(validate(this));
}
};
var isTAIndex = function (target, key) {
return isObject(target)
&& target[TYPED_ARRAY]
&& typeof key != 'symbol'
&& key in target
&& String(+key) == String(key);
};
var $getDesc = function getOwnPropertyDescriptor(target, key) {
return isTAIndex(target, key = toPrimitive(key, true))
? propertyDesc(2, target[key])
: gOPD(target, key);
};
var $setDesc = function defineProperty(target, key, desc) {
if (isTAIndex(target, key = toPrimitive(key, true))
&& isObject(desc)
&& has(desc, 'value')
&& !has(desc, 'get')
&& !has(desc, 'set')
// TODO: add validation descriptor w/o calling accessors
&& !desc.configurable
&& (!has(desc, 'writable') || desc.writable)
&& (!has(desc, 'enumerable') || desc.enumerable)
) {
target[key] = desc.value;
return target;
} return dP(target, key, desc);
};
if (!ALL_CONSTRUCTORS) {
$GOPD.f = $getDesc;
$DP.f = $setDesc;
}
$export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
getOwnPropertyDescriptor: $getDesc,
defineProperty: $setDesc
});
if (fails(function () { arrayToString.call({}); })) {
arrayToString = arrayToLocaleString = function toString() {
return arrayJoin.call(this);
};
}
var $TypedArrayPrototype$ = redefineAll({}, proto);
redefineAll($TypedArrayPrototype$, $iterators);
hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
redefineAll($TypedArrayPrototype$, {
slice: $slice,
set: $set,
constructor: function () { /* noop */ },
toString: arrayToString,
toLocaleString: $toLocaleString
});
addGetter($TypedArrayPrototype$, 'buffer', 'b');
addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
addGetter($TypedArrayPrototype$, 'byteLength', 'l');
addGetter($TypedArrayPrototype$, 'length', 'e');
dP($TypedArrayPrototype$, TAG, {
get: function () { return this[TYPED_ARRAY]; }
});
// eslint-disable-next-line max-statements
module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
CLAMPED = !!CLAMPED;
var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
var GETTER = 'get' + KEY;
var SETTER = 'set' + KEY;
var TypedArray = global[NAME];
var Base = TypedArray || {};
var TAC = TypedArray && getPrototypeOf(TypedArray);
var FORCED = !TypedArray || !$typed.ABV;
var O = {};
var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
var getter = function (that, index) {
var data = that._d;
return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
};
var setter = function (that, index, value) {
var data = that._d;
if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
};
var addElement = function (that, index) {
dP(that, index, {
get: function () {
return getter(this, index);
},
set: function (value) {
return setter(this, index, value);
},
enumerable: true
});
};
if (FORCED) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME, '_d');
var index = 0;
var offset = 0;
var buffer, byteLength, length, klass;
if (!isObject(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new $ArrayBuffer(byteLength);
} else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
buffer = data;
offset = toOffset($offset, BYTES);
var $len = data.byteLength;
if ($length === undefined) {
if ($len % BYTES) throw RangeError(WRONG_LENGTH);
byteLength = $len - offset;
if (byteLength < 0) throw RangeError(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (TYPED_ARRAY in data) {
return fromList(TypedArray, data);
} else {
return $from.call(TypedArray, data);
}
hide(that, '_d', {
b: buffer,
o: offset,
l: byteLength,
e: length,
v: new $DataView(buffer)
});
while (index < length) addElement(that, index++);
});
TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
hide(TypedArrayPrototype, 'constructor', TypedArray);
} else if (!fails(function () {
TypedArray(1);
}) || !fails(function () {
new TypedArray(-1); // eslint-disable-line no-new
}) || !$iterDetect(function (iter) {
new TypedArray(); // eslint-disable-line no-new
new TypedArray(null); // eslint-disable-line no-new
new TypedArray(1.5); // eslint-disable-line no-new
new TypedArray(iter); // eslint-disable-line no-new
}, true)) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME);
var klass;
// `ws` module bug, temporarily remove validation length for Uint8Array
// https://github.com/websockets/ws/pull/645
if (!isObject(data)) return new Base(toIndex(data));
if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
return $length !== undefined
? new Base(data, toOffset($offset, BYTES), $length)
: $offset !== undefined
? new Base(data, toOffset($offset, BYTES))
: new Base(data);
}
if (TYPED_ARRAY in data) return fromList(TypedArray, data);
return $from.call(TypedArray, data);
});
arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
});
TypedArray[PROTOTYPE] = TypedArrayPrototype;
if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
}
var $nativeIterator = TypedArrayPrototype[ITERATOR];
var CORRECT_ITER_NAME = !!$nativeIterator
&& ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
var $iterator = $iterators.values;
hide(TypedArray, TYPED_CONSTRUCTOR, true);
hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
hide(TypedArrayPrototype, VIEW, true);
hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
dP(TypedArrayPrototype, TAG, {
get: function () { return NAME; }
});
}
O[NAME] = TypedArray;
$export($export.G + $export.W + $export.F * (TypedArray != Base), O);
$export($export.S, NAME, {
BYTES_PER_ELEMENT: BYTES
});
$export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
from: $from,
of: $of
});
if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
$export($export.P, NAME, proto);
setSpecies(NAME);
$export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
$export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
$export($export.P + $export.F * fails(function () {
new TypedArray(1).slice();
}), NAME, { slice: $slice });
$export($export.P + $export.F * (fails(function () {
return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
}) || !fails(function () {
TypedArrayPrototype.toLocaleString.call([1, 2]);
})), NAME, { toLocaleString: $toLocaleString });
Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
};
} else module.exports = function () { /* empty */ };
/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Uint8', 1, function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 237 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Uint8', 1, function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
}, true);
/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Int16', 2, function (init) {
return function Int16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Uint16', 2, function (init) {
return function Uint16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Int32', 4, function (init) {
return function Int32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Uint32', 4, function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Float32', 4, function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(235)('Float64', 8, function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
var $export = __webpack_require__(8);
var aFunction = __webpack_require__(24);
var anObject = __webpack_require__(12);
var rApply = (__webpack_require__(4).Reflect || {}).apply;
var fApply = Function.apply;
// MS Edge argumentsList argument is optional
$export($export.S + $export.F * !__webpack_require__(7)(function () {
rApply(function () { /* empty */ });
}), 'Reflect', {
apply: function apply(target, thisArgument, argumentsList) {
var T = aFunction(target);
var L = anObject(argumentsList);
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
}
});
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
var $export = __webpack_require__(8);
var create = __webpack_require__(47);
var aFunction = __webpack_require__(24);
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
var fails = __webpack_require__(7);
var bind = __webpack_require__(77);
var rConstruct = (__webpack_require__(4).Reflect || {}).construct;
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function () {
function F() { /* empty */ }
return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
});
var ARGS_BUG = !fails(function () {
rConstruct(function () { /* empty */ });
});
$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
construct: function construct(Target, args /* , newTarget */) {
aFunction(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
if (Target == newTarget) {
// w/o altered newTarget, optimization for 0-4 arguments
switch (args.length) {
case 0: return new Target();
case 1: return new Target(args[0]);
case 2: return new Target(args[0], args[1]);
case 3: return new Target(args[0], args[1], args[2]);
case 4: return new Target(args[0], args[1], args[2], args[3]);
}
// w/o altered newTarget, lot of arguments case
var $args = [null];
$args.push.apply($args, args);
return new (bind.apply(Target, $args))();
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype;
var instance = create(isObject(proto) ? proto : Object.prototype);
var result = Function.apply.call(Target, instance, args);
return isObject(result) ? result : instance;
}
});
/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
var dP = __webpack_require__(11);
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var toPrimitive = __webpack_require__(16);
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
$export($export.S + $export.F * __webpack_require__(7)(function () {
// eslint-disable-next-line no-undef
Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
}), 'Reflect', {
defineProperty: function defineProperty(target, propertyKey, attributes) {
anObject(target);
propertyKey = toPrimitive(propertyKey, true);
anObject(attributes);
try {
dP.f(target, propertyKey, attributes);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.4 Reflect.deleteProperty(target, propertyKey)
var $export = __webpack_require__(8);
var gOPD = __webpack_require__(52).f;
var anObject = __webpack_require__(12);
$export($export.S, 'Reflect', {
deleteProperty: function deleteProperty(target, propertyKey) {
var desc = gOPD(anObject(target), propertyKey);
return desc && !desc.configurable ? false : delete target[propertyKey];
}
});
/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 26.1.5 Reflect.enumerate(target)
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var Enumerate = function (iterated) {
this._t = anObject(iterated); // target
this._i = 0; // next index
var keys = this._k = []; // keys
var key;
for (key in iterated) keys.push(key);
};
__webpack_require__(131)(Enumerate, 'Object', function () {
var that = this;
var keys = that._k;
var key;
do {
if (that._i >= keys.length) return { value: undefined, done: true };
} while (!((key = keys[that._i++]) in that._t));
return { value: key, done: false };
});
$export($export.S, 'Reflect', {
enumerate: function enumerate(target) {
return new Enumerate(target);
}
});
/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
var gOPD = __webpack_require__(52);
var getPrototypeOf = __webpack_require__(59);
var has = __webpack_require__(5);
var $export = __webpack_require__(8);
var isObject = __webpack_require__(13);
var anObject = __webpack_require__(12);
function get(target, propertyKey /* , receiver */) {
var receiver = arguments.length < 3 ? target : arguments[2];
var desc, proto;
if (anObject(target) === receiver) return target[propertyKey];
if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
? desc.value
: desc.get !== undefined
? desc.get.call(receiver)
: undefined;
if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
}
$export($export.S, 'Reflect', { get: get });
/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
var gOPD = __webpack_require__(52);
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
$export($export.S, 'Reflect', {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return gOPD.f(anObject(target), propertyKey);
}
});
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.8 Reflect.getPrototypeOf(target)
var $export = __webpack_require__(8);
var getProto = __webpack_require__(59);
var anObject = __webpack_require__(12);
$export($export.S, 'Reflect', {
getPrototypeOf: function getPrototypeOf(target) {
return getProto(anObject(target));
}
});
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.9 Reflect.has(target, propertyKey)
var $export = __webpack_require__(8);
$export($export.S, 'Reflect', {
has: function has(target, propertyKey) {
return propertyKey in target;
}
});
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.10 Reflect.isExtensible(target)
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var $isExtensible = Object.isExtensible;
$export($export.S, 'Reflect', {
isExtensible: function isExtensible(target) {
anObject(target);
return $isExtensible ? $isExtensible(target) : true;
}
});
/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.11 Reflect.ownKeys(target)
var $export = __webpack_require__(8);
$export($export.S, 'Reflect', { ownKeys: __webpack_require__(255) });
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
// all object keys, includes non-enumerable and symbols
var gOPN = __webpack_require__(51);
var gOPS = __webpack_require__(43);
var anObject = __webpack_require__(12);
var Reflect = __webpack_require__(4).Reflect;
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
var keys = gOPN.f(anObject(it));
var getSymbols = gOPS.f;
return getSymbols ? keys.concat(getSymbols(it)) : keys;
};
/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.12 Reflect.preventExtensions(target)
var $export = __webpack_require__(8);
var anObject = __webpack_require__(12);
var $preventExtensions = Object.preventExtensions;
$export($export.S, 'Reflect', {
preventExtensions: function preventExtensions(target) {
anObject(target);
try {
if ($preventExtensions) $preventExtensions(target);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
var dP = __webpack_require__(11);
var gOPD = __webpack_require__(52);
var getPrototypeOf = __webpack_require__(59);
var has = __webpack_require__(5);
var $export = __webpack_require__(8);
var createDesc = __webpack_require__(17);
var anObject = __webpack_require__(12);
var isObject = __webpack_require__(13);
function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDesc = gOPD.f(anObject(target), propertyKey);
var existingDescriptor, proto;
if (!ownDesc) {
if (isObject(proto = getPrototypeOf(target))) {
return set(proto, propertyKey, V, receiver);
}
ownDesc = createDesc(0);
}
if (has(ownDesc, 'value')) {
if (ownDesc.writable === false || !isObject(receiver)) return false;
if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
existingDescriptor.value = V;
dP.f(receiver, propertyKey, existingDescriptor);
} else dP.f(receiver, propertyKey, createDesc(0, V));
return true;
}
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
}
$export($export.S, 'Reflect', { set: set });
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.14 Reflect.setPrototypeOf(target, proto)
var $export = __webpack_require__(8);
var setProto = __webpack_require__(73);
if (setProto) $export($export.S, 'Reflect', {
setPrototypeOf: function setPrototypeOf(target, proto) {
setProto.check(target, proto);
try {
setProto.set(target, proto);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__(8);
var $includes = __webpack_require__(37)(true);
$export($export.P, 'Array', {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(188)('includes');
/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
var $export = __webpack_require__(8);
var flattenIntoArray = __webpack_require__(261);
var toObject = __webpack_require__(46);
var toLength = __webpack_require__(38);
var aFunction = __webpack_require__(24);
var arraySpeciesCreate = __webpack_require__(175);
$export($export.P, 'Array', {
flatMap: function flatMap(callbackfn /* , thisArg */) {
var O = toObject(this);
var sourceLen, A;
aFunction(callbackfn);
sourceLen = toLength(O.length);
A = arraySpeciesCreate(O, 0);
flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
return A;
}
});
__webpack_require__(188)('flatMap');
/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
var isArray = __webpack_require__(45);
var isObject = __webpack_require__(13);
var toLength = __webpack_require__(38);
var ctx = __webpack_require__(23);
var IS_CONCAT_SPREADABLE = __webpack_require__(27)('isConcatSpreadable');
function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
var targetIndex = start;
var sourceIndex = 0;
var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
var element, spreadable;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
spreadable = false;
if (isObject(element)) {
spreadable = element[IS_CONCAT_SPREADABLE];
spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
}
if (spreadable && depth > 0) {
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
} else {
if (targetIndex >= 0x1fffffffffffff) throw TypeError();
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
}
module.exports = flattenIntoArray;
/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
var $export = __webpack_require__(8);
var flattenIntoArray = __webpack_require__(261);
var toObject = __webpack_require__(46);
var toLength = __webpack_require__(38);
var toInteger = __webpack_require__(39);
var arraySpeciesCreate = __webpack_require__(175);
$export($export.P, 'Array', {
flatten: function flatten(/* depthArg = 1 */) {
var depthArg = arguments[0];
var O = toObject(this);
var sourceLen = toLength(O.length);
var A = arraySpeciesCreate(O, 0);
flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
return A;
}
});
__webpack_require__(188)('flatten');
/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/mathiasbynens/String.prototype.at
var $export = __webpack_require__(8);
var $at = __webpack_require__(128)(true);
$export($export.P, 'String', {
at: function at(pos) {
return $at(this, pos);
}
});
/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(8);
var $pad = __webpack_require__(265);
var userAgent = __webpack_require__(218);
// https://github.com/zloirock/core-js/issues/280
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
$export($export.P + $export.F * WEBKIT_BUG, 'String', {
padStart: function padStart(maxLength /* , fillString = ' ' */) {
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
}
});
/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-string-pad-start-end
var toLength = __webpack_require__(38);
var repeat = __webpack_require__(91);
var defined = __webpack_require__(36);
module.exports = function (that, maxLength, fillString, left) {
var S = String(defined(that));
var stringLength = S.length;
var fillStr = fillString === undefined ? ' ' : String(fillString);
var intMaxLength = toLength(maxLength);
if (intMaxLength <= stringLength || fillStr == '') return S;
var fillLen = intMaxLength - stringLength;
var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
return left ? stringFiller + S : S + stringFiller;
};
/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(8);
var $pad = __webpack_require__(265);
var userAgent = __webpack_require__(218);
// https://github.com/zloirock/core-js/issues/280
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
$export($export.P + $export.F * WEBKIT_BUG, 'String', {
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
}
});
/***/ }),
/* 267 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(83)('trimLeft', function ($trim) {
return function trimLeft() {
return $trim(this, 1);
};
}, 'trimStart');
/***/ }),
/* 268 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(83)('trimRight', function ($trim) {
return function trimRight() {
return $trim(this, 2);
};
}, 'trimEnd');
/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/String.prototype.matchAll/
var $export = __webpack_require__(8);
var defined = __webpack_require__(36);
var toLength = __webpack_require__(38);
var isRegExp = __webpack_require__(135);
var getFlags = __webpack_require__(198);
var RegExpProto = RegExp.prototype;
var $RegExpStringIterator = function (regexp, string) {
this._r = regexp;
this._s = string;
};
__webpack_require__(131)($RegExpStringIterator, 'RegExp String', function next() {
var match = this._r.exec(this._s);
return { value: match, done: match === null };
});
$export($export.P, 'String', {
matchAll: function matchAll(regexp) {
defined(this);
if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
var S = String(this);
var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
rx.lastIndex = toLength(regexp.lastIndex);
return new $RegExpStringIterator(rx, S);
}
});
/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(29)('asyncIterator');
/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(29)('observable');
/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-getownpropertydescriptors
var $export = __webpack_require__(8);
var ownKeys = __webpack_require__(255);
var toIObject = __webpack_require__(33);
var gOPD = __webpack_require__(52);
var createProperty = __webpack_require__(165);
$export($export.S, 'Object', {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O = toIObject(object);
var getDesc = gOPD.f;
var keys = ownKeys(O);
var result = {};
var i = 0;
var key, desc;
while (keys.length > i) {
desc = getDesc(O, key = keys[i++]);
if (desc !== undefined) createProperty(result, key, desc);
}
return result;
}
});
/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(8);
var $values = __webpack_require__(274)(false);
$export($export.S, 'Object', {
values: function values(it) {
return $values(it);
}
});
/***/ }),
/* 274 */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(6);
var getKeys = __webpack_require__(31);
var toIObject = __webpack_require__(33);
var isEnum = __webpack_require__(44).f;
module.exports = function (isEntries) {
return function (it) {
var O = toIObject(it);
var keys = getKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) {
key = keys[i++];
if (!DESCRIPTORS || isEnum.call(O, key)) {
result.push(isEntries ? [key, O[key]] : O[key]);
}
}
return result;
};
};
/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(8);
var $entries = __webpack_require__(274)(true);
$export($export.S, 'Object', {
entries: function entries(it) {
return $entries(it);
}
});
/***/ }),
/* 276 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(46);
var aFunction = __webpack_require__(24);
var $defineProperty = __webpack_require__(11);
// B.2.2.2 Object.prototype.__defineGetter__(P, getter)
__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
__defineGetter__: function __defineGetter__(P, getter) {
$defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
}
});
/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// Forced replacement prototype accessors methods
module.exports = __webpack_require__(22) || !__webpack_require__(7)(function () {
var K = Math.random();
// In FF throws only define methods
// eslint-disable-next-line no-undef, no-useless-call
__defineSetter__.call(null, K, function () { /* empty */ });
delete __webpack_require__(4)[K];
});
/***/ }),
/* 278 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(46);
var aFunction = __webpack_require__(24);
var $defineProperty = __webpack_require__(11);
// B.2.2.3 Object.prototype.__defineSetter__(P, setter)
__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
__defineSetter__: function __defineSetter__(P, setter) {
$defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
}
});
/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(46);
var toPrimitive = __webpack_require__(16);
var getPrototypeOf = __webpack_require__(59);
var getOwnPropertyDescriptor = __webpack_require__(52).f;
// B.2.2.4 Object.prototype.__lookupGetter__(P)
__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
__lookupGetter__: function __lookupGetter__(P) {
var O = toObject(this);
var K = toPrimitive(P, true);
var D;
do {
if (D = getOwnPropertyDescriptor(O, K)) return D.get;
} while (O = getPrototypeOf(O));
}
});
/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(8);
var toObject = __webpack_require__(46);
var toPrimitive = __webpack_require__(16);
var getPrototypeOf = __webpack_require__(59);
var getOwnPropertyDescriptor = __webpack_require__(52).f;
// B.2.2.5 Object.prototype.__lookupSetter__(P)
__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
__lookupSetter__: function __lookupSetter__(P) {
var O = toObject(this);
var K = toPrimitive(P, true);
var D;
do {
if (D = getOwnPropertyDescriptor(O, K)) return D.set;
} while (O = getPrototypeOf(O));
}
});
/***/ }),
/* 281 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(8);
$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(282)('Map') });
/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var classof = __webpack_require__(75);
var from = __webpack_require__(283);
module.exports = function (NAME) {
return function toJSON() {
if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
return from(this);
};
};
/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {
var forOf = __webpack_require__(213);
module.exports = function (iter, ITERATOR) {
var result = [];
forOf(iter, false, result.push, result, ITERATOR);
return result;
};
/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(8);
$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(282)('Set') });
/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
__webpack_require__(286)('Map');
/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(8);
module.exports = function (COLLECTION) {
$export($export.S, COLLECTION, { of: function of() {
var length = arguments.length;
var A = new Array(length);
while (length--) A[length] = arguments[length];
return new this(A);
} });
};
/***/ }),
/* 287 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
__webpack_require__(286)('Set');
/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
__webpack_require__(286)('WeakMap');
/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
__webpack_require__(286)('WeakSet');
/***/ }),
/* 290 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
__webpack_require__(291)('Map');
/***/ }),
/* 291 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(8);
var aFunction = __webpack_require__(24);
var ctx = __webpack_require__(23);
var forOf = __webpack_require__(213);
module.exports = function (COLLECTION) {
$export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
var mapFn = arguments[1];
var mapping, A, n, cb;
aFunction(this);
mapping = mapFn !== undefined;
if (mapping) aFunction(mapFn);
if (source == undefined) return new this();
A = [];
if (mapping) {
n = 0;
cb = ctx(mapFn, arguments[2], 2);
forOf(source, false, function (nextItem) {
A.push(cb(nextItem, n++));
});
} else {
forOf(source, false, A.push, A);
}
return new this(A);
} });
};
/***/ }),
/* 292 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
__webpack_require__(291)('Set');
/***/ }),
/* 293 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
__webpack_require__(291)('WeakMap');
/***/ }),
/* 294 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
__webpack_require__(291)('WeakSet');
/***/ }),
/* 295 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-global
var $export = __webpack_require__(8);
$export($export.G, { global: __webpack_require__(4) });
/***/ }),
/* 296 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-global
var $export = __webpack_require__(8);
$export($export.S, 'System', { global: __webpack_require__(4) });
/***/ }),
/* 297 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/ljharb/proposal-is-error
var $export = __webpack_require__(8);
var cof = __webpack_require__(35);
$export($export.S, 'Error', {
isError: function isError(it) {
return cof(it) === 'Error';
}
});
/***/ }),
/* 298 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
clamp: function clamp(x, lower, upper) {
return Math.min(upper, Math.max(lower, x));
}
});
/***/ }),
/* 299 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });
/***/ }),
/* 300 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
var RAD_PER_DEG = 180 / Math.PI;
$export($export.S, 'Math', {
degrees: function degrees(radians) {
return radians * RAD_PER_DEG;
}
});
/***/ }),
/* 301 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
var scale = __webpack_require__(302);
var fround = __webpack_require__(114);
$export($export.S, 'Math', {
fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
return fround(scale(x, inLow, inHigh, outLow, outHigh));
}
});
/***/ }),
/* 302 */
/***/ (function(module, exports) {
// https://rwaldron.github.io/proposal-math-extensions/
module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
if (
arguments.length === 0
// eslint-disable-next-line no-self-compare
|| x != x
// eslint-disable-next-line no-self-compare
|| inLow != inLow
// eslint-disable-next-line no-self-compare
|| inHigh != inHigh
// eslint-disable-next-line no-self-compare
|| outLow != outLow
// eslint-disable-next-line no-self-compare
|| outHigh != outHigh
) return NaN;
if (x === Infinity || x === -Infinity) return x;
return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
};
/***/ }),
/* 303 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
iaddh: function iaddh(x0, x1, y0, y1) {
var $x0 = x0 >>> 0;
var $x1 = x1 >>> 0;
var $y0 = y0 >>> 0;
return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
}
});
/***/ }),
/* 304 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
isubh: function isubh(x0, x1, y0, y1) {
var $x0 = x0 >>> 0;
var $x1 = x1 >>> 0;
var $y0 = y0 >>> 0;
return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
}
});
/***/ }),
/* 305 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
imulh: function imulh(u, v) {
var UINT16 = 0xffff;
var $u = +u;
var $v = +v;
var u0 = $u & UINT16;
var v0 = $v & UINT16;
var u1 = $u >> 16;
var v1 = $v >> 16;
var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
}
});
/***/ }),
/* 306 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });
/***/ }),
/* 307 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
var DEG_PER_RAD = Math.PI / 180;
$export($export.S, 'Math', {
radians: function radians(degrees) {
return degrees * DEG_PER_RAD;
}
});
/***/ }),
/* 308 */
/***/ (function(module, exports, __webpack_require__) {
// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(8);
$export($export.S, 'Math', { scale: __webpack_require__(302) });
/***/ }),
/* 309 */
/***/ (function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(8);
$export($export.S, 'Math', {
umulh: function umulh(u, v) {
var UINT16 = 0xffff;
var $u = +u;
var $v = +v;
var u0 = $u & UINT16;
var v0 = $v & UINT16;
var u1 = $u >>> 16;
var v1 = $v >>> 16;
var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
}
});
/***/ }),
/* 310 */
/***/ (function(module, exports, __webpack_require__) {
// http://jfbastien.github.io/papers/Math.signbit.html
var $export = __webpack_require__(8);
$export($export.S, 'Math', { signbit: function signbit(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
} });
/***/ }),
/* 311 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-promise-finally
'use strict';
var $export = __webpack_require__(8);
var core = __webpack_require__(9);
var global = __webpack_require__(4);
var speciesConstructor = __webpack_require__(210);
var promiseResolve = __webpack_require__(219);
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
var C = speciesConstructor(this, core.Promise || global.Promise);
var isFunction = typeof onFinally == 'function';
return this.then(
isFunction ? function (x) {
return promiseResolve(C, onFinally()).then(function () { return x; });
} : onFinally,
isFunction ? function (e) {
return promiseResolve(C, onFinally()).then(function () { throw e; });
} : onFinally
);
} });
/***/ }),
/* 312 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-promise-try
var $export = __webpack_require__(8);
var newPromiseCapability = __webpack_require__(216);
var perform = __webpack_require__(217);
$export($export.S, 'Promise', { 'try': function (callbackfn) {
var promiseCapability = newPromiseCapability.f(this);
var result = perform(callbackfn);
(result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
return promiseCapability.promise;
} });
/***/ }),
/* 313 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var toMetaKey = metadata.key;
var ordinaryDefineOwnMetadata = metadata.set;
metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
} });
/***/ }),
/* 314 */
/***/ (function(module, exports, __webpack_require__) {
var Map = __webpack_require__(221);
var $export = __webpack_require__(8);
var shared = __webpack_require__(21)('metadata');
var store = shared.store || (shared.store = new (__webpack_require__(226))());
var getOrCreateMetadataMap = function (target, targetKey, create) {
var targetMetadata = store.get(target);
if (!targetMetadata) {
if (!create) return undefined;
store.set(target, targetMetadata = new Map());
}
var keyMetadata = targetMetadata.get(targetKey);
if (!keyMetadata) {
if (!create) return undefined;
targetMetadata.set(targetKey, keyMetadata = new Map());
} return keyMetadata;
};
var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function (target, targetKey) {
var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
var keys = [];
if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
return keys;
};
var toMetaKey = function (it) {
return it === undefined || typeof it == 'symbol' ? it : String(it);
};
var exp = function (O) {
$export($export.S, 'Reflect', O);
};
module.exports = {
store: store,
map: getOrCreateMetadataMap,
has: ordinaryHasOwnMetadata,
get: ordinaryGetOwnMetadata,
set: ordinaryDefineOwnMetadata,
keys: ordinaryOwnMetadataKeys,
key: toMetaKey,
exp: exp
};
/***/ }),
/* 315 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var toMetaKey = metadata.key;
var getOrCreateMetadataMap = metadata.map;
var store = metadata.store;
metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
if (metadataMap.size) return true;
var targetMetadata = store.get(target);
targetMetadata['delete'](targetKey);
return !!targetMetadata.size || store['delete'](target);
} });
/***/ }),
/* 316 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var getPrototypeOf = __webpack_require__(59);
var ordinaryHasOwnMetadata = metadata.has;
var ordinaryGetOwnMetadata = metadata.get;
var toMetaKey = metadata.key;
var ordinaryGetMetadata = function (MetadataKey, O, P) {
var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
var parent = getPrototypeOf(O);
return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
};
metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 317 */
/***/ (function(module, exports, __webpack_require__) {
var Set = __webpack_require__(225);
var from = __webpack_require__(283);
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var getPrototypeOf = __webpack_require__(59);
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;
var ordinaryMetadataKeys = function (O, P) {
var oKeys = ordinaryOwnMetadataKeys(O, P);
var parent = getPrototypeOf(O);
if (parent === null) return oKeys;
var pKeys = ordinaryMetadataKeys(parent, P);
return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
};
metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });
/***/ }),
/* 318 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var ordinaryGetOwnMetadata = metadata.get;
var toMetaKey = metadata.key;
metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
return ordinaryGetOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 319 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;
metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });
/***/ }),
/* 320 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var getPrototypeOf = __webpack_require__(59);
var ordinaryHasOwnMetadata = metadata.has;
var toMetaKey = metadata.key;
var ordinaryHasMetadata = function (MetadataKey, O, P) {
var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) return true;
var parent = getPrototypeOf(O);
return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
};
metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 321 */
/***/ (function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var ordinaryHasOwnMetadata = metadata.has;
var toMetaKey = metadata.key;
metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
return ordinaryHasOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
/***/ }),
/* 322 */
/***/ (function(module, exports, __webpack_require__) {
var $metadata = __webpack_require__(314);
var anObject = __webpack_require__(12);
var aFunction = __webpack_require__(24);
var toMetaKey = $metadata.key;
var ordinaryDefineOwnMetadata = $metadata.set;
$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
return function decorator(target, targetKey) {
ordinaryDefineOwnMetadata(
metadataKey, metadataValue,
(targetKey !== undefined ? anObject : aFunction)(target),
toMetaKey(targetKey)
);
};
} });
/***/ }),
/* 323 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
var $export = __webpack_require__(8);
var microtask = __webpack_require__(215)();
var process = __webpack_require__(4).process;
var isNode = __webpack_require__(35)(process) == 'process';
$export($export.G, {
asap: function asap(fn) {
var domain = isNode && process.domain;
microtask(domain ? domain.bind(fn) : fn);
}
});
/***/ }),
/* 324 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/zenparsing/es-observable
var $export = __webpack_require__(8);
var global = __webpack_require__(4);
var core = __webpack_require__(9);
var microtask = __webpack_require__(215)();
var OBSERVABLE = __webpack_require__(27)('observable');
var aFunction = __webpack_require__(24);
var anObject = __webpack_require__(12);
var anInstance = __webpack_require__(212);
var redefineAll = __webpack_require__(220);
var hide = __webpack_require__(10);
var forOf = __webpack_require__(213);
var RETURN = forOf.RETURN;
var getMethod = function (fn) {
return fn == null ? undefined : aFunction(fn);
};
var cleanupSubscription = function (subscription) {
var cleanup = subscription._c;
if (cleanup) {
subscription._c = undefined;
cleanup();
}
};
var subscriptionClosed = function (subscription) {
return subscription._o === undefined;
};
var closeSubscription = function (subscription) {
if (!subscriptionClosed(subscription)) {
subscription._o = undefined;
cleanupSubscription(subscription);
}
};
var Subscription = function (observer, subscriber) {
anObject(observer);
this._c = undefined;
this._o = observer;
observer = new SubscriptionObserver(this);
try {
var cleanup = subscriber(observer);
var subscription = cleanup;
if (cleanup != null) {
if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
else aFunction(cleanup);
this._c = cleanup;
}
} catch (e) {
observer.error(e);
return;
} if (subscriptionClosed(this)) cleanupSubscription(this);
};
Subscription.prototype = redefineAll({}, {
unsubscribe: function unsubscribe() { closeSubscription(this); }
});
var SubscriptionObserver = function (subscription) {
this._s = subscription;
};
SubscriptionObserver.prototype = redefineAll({}, {
next: function next(value) {
var subscription = this._s;
if (!subscriptionClosed(subscription)) {
var observer = subscription._o;
try {
var m = getMethod(observer.next);
if (m) return m.call(observer, value);
} catch (e) {
try {
closeSubscription(subscription);
} finally {
throw e;
}
}
}
},
error: function error(value) {
var subscription = this._s;
if (subscriptionClosed(subscription)) throw value;
var observer = subscription._o;
subscription._o = undefined;
try {
var m = getMethod(observer.error);
if (!m) throw value;
value = m.call(observer, value);
} catch (e) {
try {
cleanupSubscription(subscription);
} finally {
throw e;
}
} cleanupSubscription(subscription);
return value;
},
complete: function complete(value) {
var subscription = this._s;
if (!subscriptionClosed(subscription)) {
var observer = subscription._o;
subscription._o = undefined;
try {
var m = getMethod(observer.complete);
value = m ? m.call(observer, value) : undefined;
} catch (e) {
try {
cleanupSubscription(subscription);
} finally {
throw e;
}
} cleanupSubscription(subscription);
return value;
}
}
});
var $Observable = function Observable(subscriber) {
anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
};
redefineAll($Observable.prototype, {
subscribe: function subscribe(observer) {
return new Subscription(observer, this._f);
},
forEach: function forEach(fn) {
var that = this;
return new (core.Promise || global.Promise)(function (resolve, reject) {
aFunction(fn);
var subscription = that.subscribe({
next: function (value) {
try {
return fn(value);
} catch (e) {
reject(e);
subscription.unsubscribe();
}
},
error: reject,
complete: resolve
});
});
}
});
redefineAll($Observable, {
from: function from(x) {
var C = typeof this === 'function' ? this : $Observable;
var method = getMethod(anObject(x)[OBSERVABLE]);
if (method) {
var observable = anObject(method.call(x));
return observable.constructor === C ? observable : new C(function (observer) {
return observable.subscribe(observer);
});
}
return new C(function (observer) {
var done = false;
microtask(function () {
if (!done) {
try {
if (forOf(x, false, function (it) {
observer.next(it);
if (done) return RETURN;
}) === RETURN) return;
} catch (e) {
if (done) throw e;
observer.error(e);
return;
} observer.complete();
}
});
return function () { done = true; };
});
},
of: function of() {
for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
return new (typeof this === 'function' ? this : $Observable)(function (observer) {
var done = false;
microtask(function () {
if (!done) {
for (var j = 0; j < items.length; ++j) {
observer.next(items[j]);
if (done) return;
} observer.complete();
}
});
return function () { done = true; };
});
}
});
hide($Observable.prototype, OBSERVABLE, function () { return this; });
$export($export.G, { Observable: $Observable });
__webpack_require__(194)('Observable');
/***/ }),
/* 325 */
/***/ (function(module, exports, __webpack_require__) {
// ie9- setTimeout & setInterval additional parameters fix
var global = __webpack_require__(4);
var $export = __webpack_require__(8);
var userAgent = __webpack_require__(218);
var slice = [].slice;
var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
var wrap = function (set) {
return function (fn, time /* , ...args */) {
var boundArgs = arguments.length > 2;
var args = boundArgs ? slice.call(arguments, 2) : false;
return set(boundArgs ? function () {
// eslint-disable-next-line no-new-func
(typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
} : fn, time);
};
};
$export($export.G + $export.B + $export.F * MSIE, {
setTimeout: wrap(global.setTimeout),
setInterval: wrap(global.setInterval)
});
/***/ }),
/* 326 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
var $task = __webpack_require__(214);
$export($export.G + $export.B, {
setImmediate: $task.set,
clearImmediate: $task.clear
});
/***/ }),
/* 327 */
/***/ (function(module, exports, __webpack_require__) {
var $iterators = __webpack_require__(195);
var getKeys = __webpack_require__(31);
var redefine = __webpack_require__(18);
var global = __webpack_require__(4);
var hide = __webpack_require__(10);
var Iterators = __webpack_require__(130);
var wks = __webpack_require__(27);
var ITERATOR = wks('iterator');
var TO_STRING_TAG = wks('toStringTag');
var ArrayValues = Iterators.Array;
var DOMIterables = {
CSSRuleList: true, // TODO: Not spec compliant, should be false.
CSSStyleDeclaration: false,
CSSValueList: false,
ClientRectList: false,
DOMRectList: false,
DOMStringList: false,
DOMTokenList: true,
DataTransferItemList: false,
FileList: false,
HTMLAllCollection: false,
HTMLCollection: false,
HTMLFormElement: false,
HTMLSelectElement: false,
MediaList: true, // TODO: Not spec compliant, should be false.
MimeTypeArray: false,
NamedNodeMap: false,
NodeList: true,
PaintRequestList: false,
Plugin: false,
PluginArray: false,
SVGLengthList: false,
SVGNumberList: false,
SVGPathSegList: false,
SVGPointList: false,
SVGStringList: false,
SVGTransformList: false,
SourceBufferList: false,
StyleSheetList: true, // TODO: Not spec compliant, should be false.
TextTrackCueList: false,
TextTrackList: false,
TouchList: false
};
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
var NAME = collections[i];
var explicit = DOMIterables[NAME];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
var key;
if (proto) {
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = ArrayValues;
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
}
}
/***/ }),
/* 328 */
/***/ (function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* https://raw.github.com/facebook/regenerator/master/LICENSE file. An
* additional grant of patent rights can be found in the PATENTS file in
* the same directory.
*/
!(function(global) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var inModule = typeof module === "object";
var runtime = global.regeneratorRuntime;
if (runtime) {
if (inModule) {
// If regeneratorRuntime is defined globally and we're in a module,
// make the exports object identical to regeneratorRuntime.
module.exports = runtime;
}
// Don't bother evaluating the rest of this file if the runtime was
// already defined globally.
return;
}
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
runtime = global.regeneratorRuntime = inModule ? module.exports : {};
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
runtime.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
runtime.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
}
if (typeof global.process === "object" && global.process.domain) {
invoke = global.process.domain.bind(invoke);
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
runtime.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
if (delegate.iterator.return) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
runtime.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
runtime.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
};
})(
// Among the various tricks for obtaining a reference to the global
// object, this seems to be the most reliable technique that does not
// use indirect eval (which violates Content Security Policy).
typeof global === "object" ? global :
typeof window === "object" ? window :
typeof self === "object" ? self : this
);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 329 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(330);
module.exports = __webpack_require__(9).RegExp.escape;
/***/ }),
/* 330 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/benjamingr/RexExp.escape
var $export = __webpack_require__(8);
var $re = __webpack_require__(331)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });
/***/ }),
/* 331 */
/***/ (function(module, exports) {
module.exports = function (regExp, replace) {
var replacer = replace === Object(replace) ? function (part) {
return replace[part];
} : replace;
return function (it) {
return String(it).replace(regExp, replacer);
};
};
/***/ }),
/* 332 */
/***/ (function(module, exports, __webpack_require__) {
var BSON = __webpack_require__(333),
Binary = __webpack_require__(356),
Code = __webpack_require__(351),
DBRef = __webpack_require__(355),
Decimal128 = __webpack_require__(352),
Double = __webpack_require__(336),
Int32 = __webpack_require__(350),
Long = __webpack_require__(335),
Map = __webpack_require__(334),
MaxKey = __webpack_require__(354),
MinKey = __webpack_require__(353),
ObjectId = __webpack_require__(338),
BSONRegExp = __webpack_require__(348),
Symbol = __webpack_require__(349),
Timestamp = __webpack_require__(337);
// BSON MAX VALUES
BSON.BSON_INT32_MAX = 0x7fffffff;
BSON.BSON_INT32_MIN = -0x80000000;
BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
BSON.BSON_INT64_MIN = -Math.pow(2, 63);
// JS MAX PRECISE VALUES
BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
// Add BSON types to function creation
BSON.Binary = Binary;
BSON.Code = Code;
BSON.DBRef = DBRef;
BSON.Decimal128 = Decimal128;
BSON.Double = Double;
BSON.Int32 = Int32;
BSON.Long = Long;
BSON.Map = Map;
BSON.MaxKey = MaxKey;
BSON.MinKey = MinKey;
BSON.ObjectId = ObjectId;
BSON.ObjectID = ObjectId;
BSON.BSONRegExp = BSONRegExp;
BSON.Symbol = Symbol;
BSON.Timestamp = Timestamp;
// Return the BSON
module.exports = BSON;
/***/ }),
/* 333 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var Map = __webpack_require__(334),
Long = __webpack_require__(335),
Double = __webpack_require__(336),
Timestamp = __webpack_require__(337),
ObjectID = __webpack_require__(338),
BSONRegExp = __webpack_require__(348),
Symbol = __webpack_require__(349),
Int32 = __webpack_require__(350),
Code = __webpack_require__(351),
Decimal128 = __webpack_require__(352),
MinKey = __webpack_require__(353),
MaxKey = __webpack_require__(354),
DBRef = __webpack_require__(355),
Binary = __webpack_require__(356);
// Parts of the parser
var deserialize = __webpack_require__(357),
serializer = __webpack_require__(358),
calculateObjectSize = __webpack_require__(360),
utils = __webpack_require__(344);
/**
* @ignore
* @api private
*/
// Default Max Size
var MAXSIZE = 1024 * 1024 * 17;
// Current Internal Temporary Serialization Buffer
var buffer = utils.allocBuffer(MAXSIZE);
var BSON = function () {};
/**
* Serialize a Javascript object.
*
* @param {Object} object the Javascript object to serialize.
* @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
* @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
* @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
* @param {Number} [options.minInternalBufferSize=1024*1024*17] minimum size of the internal temporary serialization buffer **(default:1024*1024*17)**.
* @return {Buffer} returns the Buffer object containing the serialized object.
* @api public
*/
BSON.prototype.serialize = function serialize(object, options) {
options = options || {};
// Unpack the options
var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
// Resize the internal serialization buffer if needed
if (buffer.length < minInternalBufferSize) {
buffer = utils.allocBuffer(minInternalBufferSize);
}
// Attempt to serialize
var serializationIndex = serializer(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []);
// Create the final buffer
var finishedBuffer = utils.allocBuffer(serializationIndex);
// Copy into the finished buffer
buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
// Return the buffer
return finishedBuffer;
};
/**
* Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
*
* @param {Object} object the Javascript object to serialize.
* @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
* @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
* @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
* @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
* @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
* @return {Number} returns the index pointing to the last written byte in the buffer.
* @api public
*/
BSON.prototype.serializeWithBufferAndIndex = function (object, finalBuffer, options) {
options = options || {};
// Unpack the options
var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
var startIndex = typeof options.index === 'number' ? options.index : 0;
// Attempt to serialize
var serializationIndex = serializer(finalBuffer, object, checkKeys, startIndex || 0, 0, serializeFunctions, ignoreUndefined);
// Return the index
return serializationIndex - 1;
};
/**
* Deserialize data as BSON.
*
* @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
* @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
* @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
* @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
* @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
* @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
* @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
* @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
* @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
* @return {Object} returns the deserialized Javascript Object.
* @api public
*/
BSON.prototype.deserialize = function (buffer, options) {
return deserialize(buffer, options);
};
/**
* Calculate the bson size for a passed in Javascript object.
*
* @param {Object} object the Javascript object to calculate the BSON byte size for.
* @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
* @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
* @return {Number} returns the number of bytes the BSON object will take up.
* @api public
*/
BSON.prototype.calculateObjectSize = function (object, options) {
options = options || {};
var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
};
/**
* Deserialize stream data as BSON documents.
*
* @param {Buffer} data the buffer containing the serialized set of BSON documents.
* @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
* @param {Number} numberOfDocuments number of documents to deserialize.
* @param {Array} documents an array where to store the deserialized documents.
* @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
* @param {Object} [options] additional options used for the deserialization.
* @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
* @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
* @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
* @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
* @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
* @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
* @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
* @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
* @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
* @api public
*/
BSON.prototype.deserializeStream = function (data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
options = options != null ? options : {};
var index = startIndex;
// Loop over all documents
for (var i = 0; i < numberOfDocuments; i++) {
// Find size of the document
var size = data[index] | data[index + 1] << 8 | data[index + 2] << 16 | data[index + 3] << 24;
// Update options with index
options['index'] = index;
// Parse the document at this point
documents[docStartIndex + i] = this.deserialize(data, options);
// Adjust index by the document size
index = index + size;
}
// Return object containing end index of parsing and list of documents
return index;
};
/**
* @ignore
* @api private
*/
// BSON MAX VALUES
BSON.BSON_INT32_MAX = 0x7fffffff;
BSON.BSON_INT32_MIN = -0x80000000;
BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
BSON.BSON_INT64_MIN = -Math.pow(2, 63);
// JS MAX PRECISE VALUES
BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
// Internal long versions
// var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
// var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
/**
* Number BSON Type
*
* @classconstant BSON_DATA_NUMBER
**/
BSON.BSON_DATA_NUMBER = 1;
/**
* String BSON Type
*
* @classconstant BSON_DATA_STRING
**/
BSON.BSON_DATA_STRING = 2;
/**
* Object BSON Type
*
* @classconstant BSON_DATA_OBJECT
**/
BSON.BSON_DATA_OBJECT = 3;
/**
* Array BSON Type
*
* @classconstant BSON_DATA_ARRAY
**/
BSON.BSON_DATA_ARRAY = 4;
/**
* Binary BSON Type
*
* @classconstant BSON_DATA_BINARY
**/
BSON.BSON_DATA_BINARY = 5;
/**
* ObjectID BSON Type
*
* @classconstant BSON_DATA_OID
**/
BSON.BSON_DATA_OID = 7;
/**
* Boolean BSON Type
*
* @classconstant BSON_DATA_BOOLEAN
**/
BSON.BSON_DATA_BOOLEAN = 8;
/**
* Date BSON Type
*
* @classconstant BSON_DATA_DATE
**/
BSON.BSON_DATA_DATE = 9;
/**
* null BSON Type
*
* @classconstant BSON_DATA_NULL
**/
BSON.BSON_DATA_NULL = 10;
/**
* RegExp BSON Type
*
* @classconstant BSON_DATA_REGEXP
**/
BSON.BSON_DATA_REGEXP = 11;
/**
* Code BSON Type
*
* @classconstant BSON_DATA_CODE
**/
BSON.BSON_DATA_CODE = 13;
/**
* Symbol BSON Type
*
* @classconstant BSON_DATA_SYMBOL
**/
BSON.BSON_DATA_SYMBOL = 14;
/**
* Code with Scope BSON Type
*
* @classconstant BSON_DATA_CODE_W_SCOPE
**/
BSON.BSON_DATA_CODE_W_SCOPE = 15;
/**
* 32 bit Integer BSON Type
*
* @classconstant BSON_DATA_INT
**/
BSON.BSON_DATA_INT = 16;
/**
* Timestamp BSON Type
*
* @classconstant BSON_DATA_TIMESTAMP
**/
BSON.BSON_DATA_TIMESTAMP = 17;
/**
* Long BSON Type
*
* @classconstant BSON_DATA_LONG
**/
BSON.BSON_DATA_LONG = 18;
/**
* MinKey BSON Type
*
* @classconstant BSON_DATA_MIN_KEY
**/
BSON.BSON_DATA_MIN_KEY = 0xff;
/**
* MaxKey BSON Type
*
* @classconstant BSON_DATA_MAX_KEY
**/
BSON.BSON_DATA_MAX_KEY = 0x7f;
/**
* Binary Default Type
*
* @classconstant BSON_BINARY_SUBTYPE_DEFAULT
**/
BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
/**
* Binary Function Type
*
* @classconstant BSON_BINARY_SUBTYPE_FUNCTION
**/
BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
/**
* Binary Byte Array Type
*
* @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
**/
BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
/**
* Binary UUID Type
*
* @classconstant BSON_BINARY_SUBTYPE_UUID
**/
BSON.BSON_BINARY_SUBTYPE_UUID = 3;
/**
* Binary MD5 Type
*
* @classconstant BSON_BINARY_SUBTYPE_MD5
**/
BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
/**
* Binary User Defined Type
*
* @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
**/
BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
// Return BSON
module.exports = BSON;
module.exports.Code = Code;
module.exports.Map = Map;
module.exports.Symbol = Symbol;
module.exports.BSON = BSON;
module.exports.DBRef = DBRef;
module.exports.Binary = Binary;
module.exports.ObjectID = ObjectID;
module.exports.Long = Long;
module.exports.Timestamp = Timestamp;
module.exports.Double = Double;
module.exports.Int32 = Int32;
module.exports.MinKey = MinKey;
module.exports.MaxKey = MaxKey;
module.exports.BSONRegExp = BSONRegExp;
module.exports.Decimal128 = Decimal128;
/***/ }),
/* 334 */
/***/ (function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
// We have an ES6 Map available, return the native instance
if (typeof global.Map !== 'undefined') {
module.exports = global.Map;
module.exports.Map = global.Map;
} else {
// We will return a polyfill
var Map = function (array) {
this._keys = [];
this._values = {};
for (var i = 0; i < array.length; i++) {
if (array[i] == null) continue; // skip null and undefined
var entry = array[i];
var key = entry[0];
var value = entry[1];
// Add the key to the list of keys in order
this._keys.push(key);
// Add the key and value to the values dictionary with a point
// to the location in the ordered keys list
this._values[key] = { v: value, i: this._keys.length - 1 };
}
};
Map.prototype.clear = function () {
this._keys = [];
this._values = {};
};
Map.prototype.delete = function (key) {
var value = this._values[key];
if (value == null) return false;
// Delete entry
delete this._values[key];
// Remove the key from the ordered keys list
this._keys.splice(value.i, 1);
return true;
};
Map.prototype.entries = function () {
var self = this;
var index = 0;
return {
next: function () {
var key = self._keys[index++];
return {
value: key !== undefined ? [key, self._values[key].v] : undefined,
done: key !== undefined ? false : true
};
}
};
};
Map.prototype.forEach = function (callback, self) {
self = self || this;
for (var i = 0; i < this._keys.length; i++) {
var key = this._keys[i];
// Call the forEach callback
callback.call(self, this._values[key].v, key, self);
}
};
Map.prototype.get = function (key) {
return this._values[key] ? this._values[key].v : undefined;
};
Map.prototype.has = function (key) {
return this._values[key] != null;
};
Map.prototype.keys = function () {
var self = this;
var index = 0;
return {
next: function () {
var key = self._keys[index++];
return {
value: key !== undefined ? key : undefined,
done: key !== undefined ? false : true
};
}
};
};
Map.prototype.set = function (key, value) {
if (this._values[key]) {
this._values[key].v = value;
return this;
}
// Add the key to the list of keys in order
this._keys.push(key);
// Add the key and value to the values dictionary with a point
// to the location in the ordered keys list
this._values[key] = { v: value, i: this._keys.length - 1 };
return this;
};
Map.prototype.values = function () {
var self = this;
var index = 0;
return {
next: function () {
var key = self._keys[index++];
return {
value: key !== undefined ? self._values[key].v : undefined,
done: key !== undefined ? false : true
};
}
};
};
// Last ismaster
Object.defineProperty(Map.prototype, 'size', {
enumerable: true,
get: function () {
return this._keys.length;
}
});
module.exports = Map;
module.exports.Map = Map;
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 335 */
/***/ (function(module, exports) {
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright 2009 Google Inc. All Rights Reserved
/**
* Defines a Long class for representing a 64-bit two's-complement
* integer value, which faithfully simulates the behavior of a Java "Long". This
* implementation is derived from LongLib in GWT.
*
* Constructs a 64-bit two's-complement integer, given its low and high 32-bit
* values as *signed* integers. See the from* functions below for more
* convenient ways of constructing Longs.
*
* The internal representation of a Long is the two given signed, 32-bit values.
* We use 32-bit pieces because these are the size of integers on which
* Javascript performs bit-operations. For operations like addition and
* multiplication, we split each number into 16-bit pieces, which can easily be
* multiplied within Javascript's floating-point representation without overflow
* or change in sign.
*
* In the algorithms below, we frequently reduce the negative case to the
* positive case by negating the input(s) and then post-processing the result.
* Note that we must ALWAYS check specially whether those values are MIN_VALUE
* (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
* a positive number, it overflows back into a negative). Not handling this
* case would often result in infinite recursion.
*
* @class
* @param {number} low the low (signed) 32 bits of the Long.
* @param {number} high the high (signed) 32 bits of the Long.
* @return {Long}
*/
function Long(low, high) {
if (!(this instanceof Long)) return new Long(low, high);
this._bsontype = 'Long';
/**
* @type {number}
* @ignore
*/
this.low_ = low | 0; // force into 32 signed bits.
/**
* @type {number}
* @ignore
*/
this.high_ = high | 0; // force into 32 signed bits.
}
/**
* Return the int value.
*
* @method
* @return {number} the value, assuming it is a 32-bit integer.
*/
Long.prototype.toInt = function () {
return this.low_;
};
/**
* Return the Number value.
*
* @method
* @return {number} the closest floating-point representation to this value.
*/
Long.prototype.toNumber = function () {
return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
};
/**
* Return the JSON value.
*
* @method
* @return {string} the JSON representation.
*/
Long.prototype.toJSON = function () {
return this.toString();
};
/**
* Return the String value.
*
* @method
* @param {number} [opt_radix] the radix in which the text should be written.
* @return {string} the textual representation of this value.
*/
Long.prototype.toString = function (opt_radix) {
var radix = opt_radix || 10;
if (radix < 2 || 36 < radix) {
throw Error('radix out of range: ' + radix);
}
if (this.isZero()) {
return '0';
}
if (this.isNegative()) {
if (this.equals(Long.MIN_VALUE)) {
// We need to change the Long value before it can be negated, so we remove
// the bottom-most digit in this base and then recurse to do the rest.
var radixLong = Long.fromNumber(radix);
var div = this.div(radixLong);
var rem = div.multiply(radixLong).subtract(this);
return div.toString(radix) + rem.toInt().toString(radix);
} else {
return '-' + this.negate().toString(radix);
}
}
// Do several (6) digits each time through the loop, so as to
// minimize the calls to the very expensive emulated div.
var radixToPower = Long.fromNumber(Math.pow(radix, 6));
rem = this;
var result = '';
while (!rem.isZero()) {
var remDiv = rem.div(radixToPower);
var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
var digits = intval.toString(radix);
rem = remDiv;
if (rem.isZero()) {
return digits + result;
} else {
while (digits.length < 6) {
digits = '0' + digits;
}
result = '' + digits + result;
}
}
};
/**
* Return the high 32-bits value.
*
* @method
* @return {number} the high 32-bits as a signed value.
*/
Long.prototype.getHighBits = function () {
return this.high_;
};
/**
* Return the low 32-bits value.
*
* @method
* @return {number} the low 32-bits as a signed value.
*/
Long.prototype.getLowBits = function () {
return this.low_;
};
/**
* Return the low unsigned 32-bits value.
*
* @method
* @return {number} the low 32-bits as an unsigned value.
*/
Long.prototype.getLowBitsUnsigned = function () {
return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
};
/**
* Returns the number of bits needed to represent the absolute value of this Long.
*
* @method
* @return {number} Returns the number of bits needed to represent the absolute value of this Long.
*/
Long.prototype.getNumBitsAbs = function () {
if (this.isNegative()) {
if (this.equals(Long.MIN_VALUE)) {
return 64;
} else {
return this.negate().getNumBitsAbs();
}
} else {
var val = this.high_ !== 0 ? this.high_ : this.low_;
for (var bit = 31; bit > 0; bit--) {
if ((val & 1 << bit) !== 0) {
break;
}
}
return this.high_ !== 0 ? bit + 33 : bit + 1;
}
};
/**
* Return whether this value is zero.
*
* @method
* @return {boolean} whether this value is zero.
*/
Long.prototype.isZero = function () {
return this.high_ === 0 && this.low_ === 0;
};
/**
* Return whether this value is negative.
*
* @method
* @return {boolean} whether this value is negative.
*/
Long.prototype.isNegative = function () {
return this.high_ < 0;
};
/**
* Return whether this value is odd.
*
* @method
* @return {boolean} whether this value is odd.
*/
Long.prototype.isOdd = function () {
return (this.low_ & 1) === 1;
};
/**
* Return whether this Long equals the other
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} whether this Long equals the other
*/
Long.prototype.equals = function (other) {
return this.high_ === other.high_ && this.low_ === other.low_;
};
/**
* Return whether this Long does not equal the other.
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} whether this Long does not equal the other.
*/
Long.prototype.notEquals = function (other) {
return this.high_ !== other.high_ || this.low_ !== other.low_;
};
/**
* Return whether this Long is less than the other.
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} whether this Long is less than the other.
*/
Long.prototype.lessThan = function (other) {
return this.compare(other) < 0;
};
/**
* Return whether this Long is less than or equal to the other.
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} whether this Long is less than or equal to the other.
*/
Long.prototype.lessThanOrEqual = function (other) {
return this.compare(other) <= 0;
};
/**
* Return whether this Long is greater than the other.
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} whether this Long is greater than the other.
*/
Long.prototype.greaterThan = function (other) {
return this.compare(other) > 0;
};
/**
* Return whether this Long is greater than or equal to the other.
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} whether this Long is greater than or equal to the other.
*/
Long.prototype.greaterThanOrEqual = function (other) {
return this.compare(other) >= 0;
};
/**
* Compares this Long with the given one.
*
* @method
* @param {Long} other Long to compare against.
* @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
*/
Long.prototype.compare = function (other) {
if (this.equals(other)) {
return 0;
}
var thisNeg = this.isNegative();
var otherNeg = other.isNegative();
if (thisNeg && !otherNeg) {
return -1;
}
if (!thisNeg && otherNeg) {
return 1;
}
// at this point, the signs are the same, so subtraction will not overflow
if (this.subtract(other).isNegative()) {
return -1;
} else {
return 1;
}
};
/**
* The negation of this value.
*
* @method
* @return {Long} the negation of this value.
*/
Long.prototype.negate = function () {
if (this.equals(Long.MIN_VALUE)) {
return Long.MIN_VALUE;
} else {
return this.not().add(Long.ONE);
}
};
/**
* Returns the sum of this and the given Long.
*
* @method
* @param {Long} other Long to add to this one.
* @return {Long} the sum of this and the given Long.
*/
Long.prototype.add = function (other) {
// Divide each number into 4 chunks of 16 bits, and then sum the chunks.
var a48 = this.high_ >>> 16;
var a32 = this.high_ & 0xffff;
var a16 = this.low_ >>> 16;
var a00 = this.low_ & 0xffff;
var b48 = other.high_ >>> 16;
var b32 = other.high_ & 0xffff;
var b16 = other.low_ >>> 16;
var b00 = other.low_ & 0xffff;
var c48 = 0,
c32 = 0,
c16 = 0,
c00 = 0;
c00 += a00 + b00;
c16 += c00 >>> 16;
c00 &= 0xffff;
c16 += a16 + b16;
c32 += c16 >>> 16;
c16 &= 0xffff;
c32 += a32 + b32;
c48 += c32 >>> 16;
c32 &= 0xffff;
c48 += a48 + b48;
c48 &= 0xffff;
return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
};
/**
* Returns the difference of this and the given Long.
*
* @method
* @param {Long} other Long to subtract from this.
* @return {Long} the difference of this and the given Long.
*/
Long.prototype.subtract = function (other) {
return this.add(other.negate());
};
/**
* Returns the product of this and the given Long.
*
* @method
* @param {Long} other Long to multiply with this.
* @return {Long} the product of this and the other.
*/
Long.prototype.multiply = function (other) {
if (this.isZero()) {
return Long.ZERO;
} else if (other.isZero()) {
return Long.ZERO;
}
if (this.equals(Long.MIN_VALUE)) {
return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
} else if (other.equals(Long.MIN_VALUE)) {
return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
}
if (this.isNegative()) {
if (other.isNegative()) {
return this.negate().multiply(other.negate());
} else {
return this.negate().multiply(other).negate();
}
} else if (other.isNegative()) {
return this.multiply(other.negate()).negate();
}
// If both Longs are small, use float multiplication
if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
return Long.fromNumber(this.toNumber() * other.toNumber());
}
// Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
// We can skip products that would overflow.
var a48 = this.high_ >>> 16;
var a32 = this.high_ & 0xffff;
var a16 = this.low_ >>> 16;
var a00 = this.low_ & 0xffff;
var b48 = other.high_ >>> 16;
var b32 = other.high_ & 0xffff;
var b16 = other.low_ >>> 16;
var b00 = other.low_ & 0xffff;
var c48 = 0,
c32 = 0,
c16 = 0,
c00 = 0;
c00 += a00 * b00;
c16 += c00 >>> 16;
c00 &= 0xffff;
c16 += a16 * b00;
c32 += c16 >>> 16;
c16 &= 0xffff;
c16 += a00 * b16;
c32 += c16 >>> 16;
c16 &= 0xffff;
c32 += a32 * b00;
c48 += c32 >>> 16;
c32 &= 0xffff;
c32 += a16 * b16;
c48 += c32 >>> 16;
c32 &= 0xffff;
c32 += a00 * b32;
c48 += c32 >>> 16;
c32 &= 0xffff;
c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
c48 &= 0xffff;
return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
};
/**
* Returns this Long divided by the given one.
*
* @method
* @param {Long} other Long by which to divide.
* @return {Long} this Long divided by the given one.
*/
Long.prototype.div = function (other) {
if (other.isZero()) {
throw Error('division by zero');
} else if (this.isZero()) {
return Long.ZERO;
}
if (this.equals(Long.MIN_VALUE)) {
if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
} else if (other.equals(Long.MIN_VALUE)) {
return Long.ONE;
} else {
// At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
var halfThis = this.shiftRight(1);
var approx = halfThis.div(other).shiftLeft(1);
if (approx.equals(Long.ZERO)) {
return other.isNegative() ? Long.ONE : Long.NEG_ONE;
} else {
var rem = this.subtract(other.multiply(approx));
var result = approx.add(rem.div(other));
return result;
}
}
} else if (other.equals(Long.MIN_VALUE)) {
return Long.ZERO;
}
if (this.isNegative()) {
if (other.isNegative()) {
return this.negate().div(other.negate());
} else {
return this.negate().div(other).negate();
}
} else if (other.isNegative()) {
return this.div(other.negate()).negate();
}
// Repeat the following until the remainder is less than other: find a
// floating-point that approximates remainder / other *from below*, add this
// into the result, and subtract it from the remainder. It is critical that
// the approximate value is less than or equal to the real value so that the
// remainder never becomes negative.
var res = Long.ZERO;
rem = this;
while (rem.greaterThanOrEqual(other)) {
// Approximate the result of division. This may be a little greater or
// smaller than the actual value.
approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
// We will tweak the approximate result by changing it in the 48-th digit or
// the smallest non-fractional digit, whichever is larger.
var log2 = Math.ceil(Math.log(approx) / Math.LN2);
var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
// Decrease the approximation until it is smaller than the remainder. Note
// that if it is too large, the product overflows and is negative.
var approxRes = Long.fromNumber(approx);
var approxRem = approxRes.multiply(other);
while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
approx -= delta;
approxRes = Long.fromNumber(approx);
approxRem = approxRes.multiply(other);
}
// We know the answer can't be zero... and actually, zero would cause
// infinite recursion since we would make no progress.
if (approxRes.isZero()) {
approxRes = Long.ONE;
}
res = res.add(approxRes);
rem = rem.subtract(approxRem);
}
return res;
};
/**
* Returns this Long modulo the given one.
*
* @method
* @param {Long} other Long by which to mod.
* @return {Long} this Long modulo the given one.
*/
Long.prototype.modulo = function (other) {
return this.subtract(this.div(other).multiply(other));
};
/**
* The bitwise-NOT of this value.
*
* @method
* @return {Long} the bitwise-NOT of this value.
*/
Long.prototype.not = function () {
return Long.fromBits(~this.low_, ~this.high_);
};
/**
* Returns the bitwise-AND of this Long and the given one.
*
* @method
* @param {Long} other the Long with which to AND.
* @return {Long} the bitwise-AND of this and the other.
*/
Long.prototype.and = function (other) {
return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
};
/**
* Returns the bitwise-OR of this Long and the given one.
*
* @method
* @param {Long} other the Long with which to OR.
* @return {Long} the bitwise-OR of this and the other.
*/
Long.prototype.or = function (other) {
return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
};
/**
* Returns the bitwise-XOR of this Long and the given one.
*
* @method
* @param {Long} other the Long with which to XOR.
* @return {Long} the bitwise-XOR of this and the other.
*/
Long.prototype.xor = function (other) {
return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
};
/**
* Returns this Long with bits shifted to the left by the given amount.
*
* @method
* @param {number} numBits the number of bits by which to shift.
* @return {Long} this shifted to the left by the given amount.
*/
Long.prototype.shiftLeft = function (numBits) {
numBits &= 63;
if (numBits === 0) {
return this;
} else {
var low = this.low_;
if (numBits < 32) {
var high = this.high_;
return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
} else {
return Long.fromBits(0, low << numBits - 32);
}
}
};
/**
* Returns this Long with bits shifted to the right by the given amount.
*
* @method
* @param {number} numBits the number of bits by which to shift.
* @return {Long} this shifted to the right by the given amount.
*/
Long.prototype.shiftRight = function (numBits) {
numBits &= 63;
if (numBits === 0) {
return this;
} else {
var high = this.high_;
if (numBits < 32) {
var low = this.low_;
return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
} else {
return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
}
}
};
/**
* Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
*
* @method
* @param {number} numBits the number of bits by which to shift.
* @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
*/
Long.prototype.shiftRightUnsigned = function (numBits) {
numBits &= 63;
if (numBits === 0) {
return this;
} else {
var high = this.high_;
if (numBits < 32) {
var low = this.low_;
return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
} else if (numBits === 32) {
return Long.fromBits(high, 0);
} else {
return Long.fromBits(high >>> numBits - 32, 0);
}
}
};
/**
* Returns a Long representing the given (32-bit) integer value.
*
* @method
* @param {number} value the 32-bit integer in question.
* @return {Long} the corresponding Long value.
*/
Long.fromInt = function (value) {
if (-128 <= value && value < 128) {
var cachedObj = Long.INT_CACHE_[value];
if (cachedObj) {
return cachedObj;
}
}
var obj = new Long(value | 0, value < 0 ? -1 : 0);
if (-128 <= value && value < 128) {
Long.INT_CACHE_[value] = obj;
}
return obj;
};
/**
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
*
* @method
* @param {number} value the number in question.
* @return {Long} the corresponding Long value.
*/
Long.fromNumber = function (value) {
if (isNaN(value) || !isFinite(value)) {
return Long.ZERO;
} else if (value <= -Long.TWO_PWR_63_DBL_) {
return Long.MIN_VALUE;
} else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
return Long.MAX_VALUE;
} else if (value < 0) {
return Long.fromNumber(-value).negate();
} else {
return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0);
}
};
/**
* Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
*
* @method
* @param {number} lowBits the low 32-bits.
* @param {number} highBits the high 32-bits.
* @return {Long} the corresponding Long value.
*/
Long.fromBits = function (lowBits, highBits) {
return new Long(lowBits, highBits);
};
/**
* Returns a Long representation of the given string, written using the given radix.
*
* @method
* @param {string} str the textual representation of the Long.
* @param {number} opt_radix the radix in which the text is written.
* @return {Long} the corresponding Long value.
*/
Long.fromString = function (str, opt_radix) {
if (str.length === 0) {
throw Error('number format error: empty string');
}
var radix = opt_radix || 10;
if (radix < 2 || 36 < radix) {
throw Error('radix out of range: ' + radix);
}
if (str.charAt(0) === '-') {
return Long.fromString(str.substring(1), radix).negate();
} else if (str.indexOf('-') >= 0) {
throw Error('number format error: interior "-" character: ' + str);
}
// Do several (8) digits each time through the loop, so as to
// minimize the calls to the very expensive emulated div.
var radixToPower = Long.fromNumber(Math.pow(radix, 8));
var result = Long.ZERO;
for (var i = 0; i < str.length; i += 8) {
var size = Math.min(8, str.length - i);
var value = parseInt(str.substring(i, i + size), radix);
if (size < 8) {
var power = Long.fromNumber(Math.pow(radix, size));
result = result.multiply(power).add(Long.fromNumber(value));
} else {
result = result.multiply(radixToPower);
result = result.add(Long.fromNumber(value));
}
}
return result;
};
// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
// from* methods on which they depend.
/**
* A cache of the Long representations of small integer values.
* @type {Object}
* @ignore
*/
Long.INT_CACHE_ = {};
// NOTE: the compiler should inline these constant values below and then remove
// these variables, so there should be no runtime penalty for these.
/**
* Number used repeated below in calculations. This must appear before the
* first call to any from* function below.
* @type {number}
* @ignore
*/
Long.TWO_PWR_16_DBL_ = 1 << 16;
/**
* @type {number}
* @ignore
*/
Long.TWO_PWR_24_DBL_ = 1 << 24;
/**
* @type {number}
* @ignore
*/
Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
/**
* @type {number}
* @ignore
*/
Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
/**
* @type {number}
* @ignore
*/
Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
/**
* @type {number}
* @ignore
*/
Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
/**
* @type {number}
* @ignore
*/
Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
/** @type {Long} */
Long.ZERO = Long.fromInt(0);
/** @type {Long} */
Long.ONE = Long.fromInt(1);
/** @type {Long} */
Long.NEG_ONE = Long.fromInt(-1);
/** @type {Long} */
Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0);
/** @type {Long} */
Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
/**
* @type {Long}
* @ignore
*/
Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
/**
* Expose.
*/
module.exports = Long;
module.exports.Long = Long;
/***/ }),
/* 336 */
/***/ (function(module, exports) {
/**
* A class representation of the BSON Double type.
*
* @class
* @param {number} value the number we want to represent as a double.
* @return {Double}
*/
function Double(value) {
if (!(this instanceof Double)) return new Double(value);
this._bsontype = 'Double';
this.value = value;
}
/**
* Access the number value.
*
* @method
* @return {number} returns the wrapped double number.
*/
Double.prototype.valueOf = function () {
return this.value;
};
/**
* @ignore
*/
Double.prototype.toJSON = function () {
return this.value;
};
module.exports = Double;
module.exports.Double = Double;
/***/ }),
/* 337 */
/***/ (function(module, exports) {
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright 2009 Google Inc. All Rights Reserved
/**
* This type is for INTERNAL use in MongoDB only and should not be used in applications.
* The appropriate corresponding type is the JavaScript Date type.
*
* Defines a Timestamp class for representing a 64-bit two's-complement
* integer value, which faithfully simulates the behavior of a Java "Timestamp". This
* implementation is derived from TimestampLib in GWT.
*
* Constructs a 64-bit two's-complement integer, given its low and high 32-bit
* values as *signed* integers. See the from* functions below for more
* convenient ways of constructing Timestamps.
*
* The internal representation of a Timestamp is the two given signed, 32-bit values.
* We use 32-bit pieces because these are the size of integers on which
* Javascript performs bit-operations. For operations like addition and
* multiplication, we split each number into 16-bit pieces, which can easily be
* multiplied within Javascript's floating-point representation without overflow
* or change in sign.
*
* In the algorithms below, we frequently reduce the negative case to the
* positive case by negating the input(s) and then post-processing the result.
* Note that we must ALWAYS check specially whether those values are MIN_VALUE
* (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
* a positive number, it overflows back into a negative). Not handling this
* case would often result in infinite recursion.
*
* @class
* @param {number} low the low (signed) 32 bits of the Timestamp.
* @param {number} high the high (signed) 32 bits of the Timestamp.
*/
function Timestamp(low, high) {
if (!(this instanceof Timestamp)) return new Timestamp(low, high);
this._bsontype = 'Timestamp';
/**
* @type {number}
* @ignore
*/
this.low_ = low | 0; // force into 32 signed bits.
/**
* @type {number}
* @ignore
*/
this.high_ = high | 0; // force into 32 signed bits.
}
/**
* Return the int value.
*
* @return {number} the value, assuming it is a 32-bit integer.
*/
Timestamp.prototype.toInt = function () {
return this.low_;
};
/**
* Return the Number value.
*
* @method
* @return {number} the closest floating-point representation to this value.
*/
Timestamp.prototype.toNumber = function () {
return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
};
/**
* Return the JSON value.
*
* @method
* @return {string} the JSON representation.
*/
Timestamp.prototype.toJSON = function () {
return this.toString();
};
/**
* Return the String value.
*
* @method
* @param {number} [opt_radix] the radix in which the text should be written.
* @return {string} the textual representation of this value.
*/
Timestamp.prototype.toString = function (opt_radix) {
var radix = opt_radix || 10;
if (radix < 2 || 36 < radix) {
throw Error('radix out of range: ' + radix);
}
if (this.isZero()) {
return '0';
}
if (this.isNegative()) {
if (this.equals(Timestamp.MIN_VALUE)) {
// We need to change the Timestamp value before it can be negated, so we remove
// the bottom-most digit in this base and then recurse to do the rest.
var radixTimestamp = Timestamp.fromNumber(radix);
var div = this.div(radixTimestamp);
var rem = div.multiply(radixTimestamp).subtract(this);
return div.toString(radix) + rem.toInt().toString(radix);
} else {
return '-' + this.negate().toString(radix);
}
}
// Do several (6) digits each time through the loop, so as to
// minimize the calls to the very expensive emulated div.
var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
rem = this;
var result = '';
while (!rem.isZero()) {
var remDiv = rem.div(radixToPower);
var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
var digits = intval.toString(radix);
rem = remDiv;
if (rem.isZero()) {
return digits + result;
} else {
while (digits.length < 6) {
digits = '0' + digits;
}
result = '' + digits + result;
}
}
};
/**
* Return the high 32-bits value.
*
* @method
* @return {number} the high 32-bits as a signed value.
*/
Timestamp.prototype.getHighBits = function () {
return this.high_;
};
/**
* Return the low 32-bits value.
*
* @method
* @return {number} the low 32-bits as a signed value.
*/
Timestamp.prototype.getLowBits = function () {
return this.low_;
};
/**
* Return the low unsigned 32-bits value.
*
* @method
* @return {number} the low 32-bits as an unsigned value.
*/
Timestamp.prototype.getLowBitsUnsigned = function () {
return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
};
/**
* Returns the number of bits needed to represent the absolute value of this Timestamp.
*
* @method
* @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
*/
Timestamp.prototype.getNumBitsAbs = function () {
if (this.isNegative()) {
if (this.equals(Timestamp.MIN_VALUE)) {
return 64;
} else {
return this.negate().getNumBitsAbs();
}
} else {
var val = this.high_ !== 0 ? this.high_ : this.low_;
for (var bit = 31; bit > 0; bit--) {
if ((val & 1 << bit) !== 0) {
break;
}
}
return this.high_ !== 0 ? bit + 33 : bit + 1;
}
};
/**
* Return whether this value is zero.
*
* @method
* @return {boolean} whether this value is zero.
*/
Timestamp.prototype.isZero = function () {
return this.high_ === 0 && this.low_ === 0;
};
/**
* Return whether this value is negative.
*
* @method
* @return {boolean} whether this value is negative.
*/
Timestamp.prototype.isNegative = function () {
return this.high_ < 0;
};
/**
* Return whether this value is odd.
*
* @method
* @return {boolean} whether this value is odd.
*/
Timestamp.prototype.isOdd = function () {
return (this.low_ & 1) === 1;
};
/**
* Return whether this Timestamp equals the other
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} whether this Timestamp equals the other
*/
Timestamp.prototype.equals = function (other) {
return this.high_ === other.high_ && this.low_ === other.low_;
};
/**
* Return whether this Timestamp does not equal the other.
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} whether this Timestamp does not equal the other.
*/
Timestamp.prototype.notEquals = function (other) {
return this.high_ !== other.high_ || this.low_ !== other.low_;
};
/**
* Return whether this Timestamp is less than the other.
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} whether this Timestamp is less than the other.
*/
Timestamp.prototype.lessThan = function (other) {
return this.compare(other) < 0;
};
/**
* Return whether this Timestamp is less than or equal to the other.
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} whether this Timestamp is less than or equal to the other.
*/
Timestamp.prototype.lessThanOrEqual = function (other) {
return this.compare(other) <= 0;
};
/**
* Return whether this Timestamp is greater than the other.
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} whether this Timestamp is greater than the other.
*/
Timestamp.prototype.greaterThan = function (other) {
return this.compare(other) > 0;
};
/**
* Return whether this Timestamp is greater than or equal to the other.
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} whether this Timestamp is greater than or equal to the other.
*/
Timestamp.prototype.greaterThanOrEqual = function (other) {
return this.compare(other) >= 0;
};
/**
* Compares this Timestamp with the given one.
*
* @method
* @param {Timestamp} other Timestamp to compare against.
* @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
*/
Timestamp.prototype.compare = function (other) {
if (this.equals(other)) {
return 0;
}
var thisNeg = this.isNegative();
var otherNeg = other.isNegative();
if (thisNeg && !otherNeg) {
return -1;
}
if (!thisNeg && otherNeg) {
return 1;
}
// at this point, the signs are the same, so subtraction will not overflow
if (this.subtract(other).isNegative()) {
return -1;
} else {
return 1;
}
};
/**
* The negation of this value.
*
* @method
* @return {Timestamp} the negation of this value.
*/
Timestamp.prototype.negate = function () {
if (this.equals(Timestamp.MIN_VALUE)) {
return Timestamp.MIN_VALUE;
} else {
return this.not().add(Timestamp.ONE);
}
};
/**
* Returns the sum of this and the given Timestamp.
*
* @method
* @param {Timestamp} other Timestamp to add to this one.
* @return {Timestamp} the sum of this and the given Timestamp.
*/
Timestamp.prototype.add = function (other) {
// Divide each number into 4 chunks of 16 bits, and then sum the chunks.
var a48 = this.high_ >>> 16;
var a32 = this.high_ & 0xffff;
var a16 = this.low_ >>> 16;
var a00 = this.low_ & 0xffff;
var b48 = other.high_ >>> 16;
var b32 = other.high_ & 0xffff;
var b16 = other.low_ >>> 16;
var b00 = other.low_ & 0xffff;
var c48 = 0,
c32 = 0,
c16 = 0,
c00 = 0;
c00 += a00 + b00;
c16 += c00 >>> 16;
c00 &= 0xffff;
c16 += a16 + b16;
c32 += c16 >>> 16;
c16 &= 0xffff;
c32 += a32 + b32;
c48 += c32 >>> 16;
c32 &= 0xffff;
c48 += a48 + b48;
c48 &= 0xffff;
return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
};
/**
* Returns the difference of this and the given Timestamp.
*
* @method
* @param {Timestamp} other Timestamp to subtract from this.
* @return {Timestamp} the difference of this and the given Timestamp.
*/
Timestamp.prototype.subtract = function (other) {
return this.add(other.negate());
};
/**
* Returns the product of this and the given Timestamp.
*
* @method
* @param {Timestamp} other Timestamp to multiply with this.
* @return {Timestamp} the product of this and the other.
*/
Timestamp.prototype.multiply = function (other) {
if (this.isZero()) {
return Timestamp.ZERO;
} else if (other.isZero()) {
return Timestamp.ZERO;
}
if (this.equals(Timestamp.MIN_VALUE)) {
return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
} else if (other.equals(Timestamp.MIN_VALUE)) {
return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
}
if (this.isNegative()) {
if (other.isNegative()) {
return this.negate().multiply(other.negate());
} else {
return this.negate().multiply(other).negate();
}
} else if (other.isNegative()) {
return this.multiply(other.negate()).negate();
}
// If both Timestamps are small, use float multiplication
if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
return Timestamp.fromNumber(this.toNumber() * other.toNumber());
}
// Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
// We can skip products that would overflow.
var a48 = this.high_ >>> 16;
var a32 = this.high_ & 0xffff;
var a16 = this.low_ >>> 16;
var a00 = this.low_ & 0xffff;
var b48 = other.high_ >>> 16;
var b32 = other.high_ & 0xffff;
var b16 = other.low_ >>> 16;
var b00 = other.low_ & 0xffff;
var c48 = 0,
c32 = 0,
c16 = 0,
c00 = 0;
c00 += a00 * b00;
c16 += c00 >>> 16;
c00 &= 0xffff;
c16 += a16 * b00;
c32 += c16 >>> 16;
c16 &= 0xffff;
c16 += a00 * b16;
c32 += c16 >>> 16;
c16 &= 0xffff;
c32 += a32 * b00;
c48 += c32 >>> 16;
c32 &= 0xffff;
c32 += a16 * b16;
c48 += c32 >>> 16;
c32 &= 0xffff;
c32 += a00 * b32;
c48 += c32 >>> 16;
c32 &= 0xffff;
c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
c48 &= 0xffff;
return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
};
/**
* Returns this Timestamp divided by the given one.
*
* @method
* @param {Timestamp} other Timestamp by which to divide.
* @return {Timestamp} this Timestamp divided by the given one.
*/
Timestamp.prototype.div = function (other) {
if (other.isZero()) {
throw Error('division by zero');
} else if (this.isZero()) {
return Timestamp.ZERO;
}
if (this.equals(Timestamp.MIN_VALUE)) {
if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
} else if (other.equals(Timestamp.MIN_VALUE)) {
return Timestamp.ONE;
} else {
// At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
var halfThis = this.shiftRight(1);
var approx = halfThis.div(other).shiftLeft(1);
if (approx.equals(Timestamp.ZERO)) {
return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
} else {
var rem = this.subtract(other.multiply(approx));
var result = approx.add(rem.div(other));
return result;
}
}
} else if (other.equals(Timestamp.MIN_VALUE)) {
return Timestamp.ZERO;
}
if (this.isNegative()) {
if (other.isNegative()) {
return this.negate().div(other.negate());
} else {
return this.negate().div(other).negate();
}
} else if (other.isNegative()) {
return this.div(other.negate()).negate();
}
// Repeat the following until the remainder is less than other: find a
// floating-point that approximates remainder / other *from below*, add this
// into the result, and subtract it from the remainder. It is critical that
// the approximate value is less than or equal to the real value so that the
// remainder never becomes negative.
var res = Timestamp.ZERO;
rem = this;
while (rem.greaterThanOrEqual(other)) {
// Approximate the result of division. This may be a little greater or
// smaller than the actual value.
approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
// We will tweak the approximate result by changing it in the 48-th digit or
// the smallest non-fractional digit, whichever is larger.
var log2 = Math.ceil(Math.log(approx) / Math.LN2);
var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
// Decrease the approximation until it is smaller than the remainder. Note
// that if it is too large, the product overflows and is negative.
var approxRes = Timestamp.fromNumber(approx);
var approxRem = approxRes.multiply(other);
while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
approx -= delta;
approxRes = Timestamp.fromNumber(approx);
approxRem = approxRes.multiply(other);
}
// We know the answer can't be zero... and actually, zero would cause
// infinite recursion since we would make no progress.
if (approxRes.isZero()) {
approxRes = Timestamp.ONE;
}
res = res.add(approxRes);
rem = rem.subtract(approxRem);
}
return res;
};
/**
* Returns this Timestamp modulo the given one.
*
* @method
* @param {Timestamp} other Timestamp by which to mod.
* @return {Timestamp} this Timestamp modulo the given one.
*/
Timestamp.prototype.modulo = function (other) {
return this.subtract(this.div(other).multiply(other));
};
/**
* The bitwise-NOT of this value.
*
* @method
* @return {Timestamp} the bitwise-NOT of this value.
*/
Timestamp.prototype.not = function () {
return Timestamp.fromBits(~this.low_, ~this.high_);
};
/**
* Returns the bitwise-AND of this Timestamp and the given one.
*
* @method
* @param {Timestamp} other the Timestamp with which to AND.
* @return {Timestamp} the bitwise-AND of this and the other.
*/
Timestamp.prototype.and = function (other) {
return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
};
/**
* Returns the bitwise-OR of this Timestamp and the given one.
*
* @method
* @param {Timestamp} other the Timestamp with which to OR.
* @return {Timestamp} the bitwise-OR of this and the other.
*/
Timestamp.prototype.or = function (other) {
return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
};
/**
* Returns the bitwise-XOR of this Timestamp and the given one.
*
* @method
* @param {Timestamp} other the Timestamp with which to XOR.
* @return {Timestamp} the bitwise-XOR of this and the other.
*/
Timestamp.prototype.xor = function (other) {
return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
};
/**
* Returns this Timestamp with bits shifted to the left by the given amount.
*
* @method
* @param {number} numBits the number of bits by which to shift.
* @return {Timestamp} this shifted to the left by the given amount.
*/
Timestamp.prototype.shiftLeft = function (numBits) {
numBits &= 63;
if (numBits === 0) {
return this;
} else {
var low = this.low_;
if (numBits < 32) {
var high = this.high_;
return Timestamp.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
} else {
return Timestamp.fromBits(0, low << numBits - 32);
}
}
};
/**
* Returns this Timestamp with bits shifted to the right by the given amount.
*
* @method
* @param {number} numBits the number of bits by which to shift.
* @return {Timestamp} this shifted to the right by the given amount.
*/
Timestamp.prototype.shiftRight = function (numBits) {
numBits &= 63;
if (numBits === 0) {
return this;
} else {
var high = this.high_;
if (numBits < 32) {
var low = this.low_;
return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
} else {
return Timestamp.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
}
}
};
/**
* Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
*
* @method
* @param {number} numBits the number of bits by which to shift.
* @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
*/
Timestamp.prototype.shiftRightUnsigned = function (numBits) {
numBits &= 63;
if (numBits === 0) {
return this;
} else {
var high = this.high_;
if (numBits < 32) {
var low = this.low_;
return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
} else if (numBits === 32) {
return Timestamp.fromBits(high, 0);
} else {
return Timestamp.fromBits(high >>> numBits - 32, 0);
}
}
};
/**
* Returns a Timestamp representing the given (32-bit) integer value.
*
* @method
* @param {number} value the 32-bit integer in question.
* @return {Timestamp} the corresponding Timestamp value.
*/
Timestamp.fromInt = function (value) {
if (-128 <= value && value < 128) {
var cachedObj = Timestamp.INT_CACHE_[value];
if (cachedObj) {
return cachedObj;
}
}
var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
if (-128 <= value && value < 128) {
Timestamp.INT_CACHE_[value] = obj;
}
return obj;
};
/**
* Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
*
* @method
* @param {number} value the number in question.
* @return {Timestamp} the corresponding Timestamp value.
*/
Timestamp.fromNumber = function (value) {
if (isNaN(value) || !isFinite(value)) {
return Timestamp.ZERO;
} else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
return Timestamp.MIN_VALUE;
} else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
return Timestamp.MAX_VALUE;
} else if (value < 0) {
return Timestamp.fromNumber(-value).negate();
} else {
return new Timestamp(value % Timestamp.TWO_PWR_32_DBL_ | 0, value / Timestamp.TWO_PWR_32_DBL_ | 0);
}
};
/**
* Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
*
* @method
* @param {number} lowBits the low 32-bits.
* @param {number} highBits the high 32-bits.
* @return {Timestamp} the corresponding Timestamp value.
*/
Timestamp.fromBits = function (lowBits, highBits) {
return new Timestamp(lowBits, highBits);
};
/**
* Returns a Timestamp representation of the given string, written using the given radix.
*
* @method
* @param {string} str the textual representation of the Timestamp.
* @param {number} opt_radix the radix in which the text is written.
* @return {Timestamp} the corresponding Timestamp value.
*/
Timestamp.fromString = function (str, opt_radix) {
if (str.length === 0) {
throw Error('number format error: empty string');
}
var radix = opt_radix || 10;
if (radix < 2 || 36 < radix) {
throw Error('radix out of range: ' + radix);
}
if (str.charAt(0) === '-') {
return Timestamp.fromString(str.substring(1), radix).negate();
} else if (str.indexOf('-') >= 0) {
throw Error('number format error: interior "-" character: ' + str);
}
// Do several (8) digits each time through the loop, so as to
// minimize the calls to the very expensive emulated div.
var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
var result = Timestamp.ZERO;
for (var i = 0; i < str.length; i += 8) {
var size = Math.min(8, str.length - i);
var value = parseInt(str.substring(i, i + size), radix);
if (size < 8) {
var power = Timestamp.fromNumber(Math.pow(radix, size));
result = result.multiply(power).add(Timestamp.fromNumber(value));
} else {
result = result.multiply(radixToPower);
result = result.add(Timestamp.fromNumber(value));
}
}
return result;
};
// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
// from* methods on which they depend.
/**
* A cache of the Timestamp representations of small integer values.
* @type {Object}
* @ignore
*/
Timestamp.INT_CACHE_ = {};
// NOTE: the compiler should inline these constant values below and then remove
// these variables, so there should be no runtime penalty for these.
/**
* Number used repeated below in calculations. This must appear before the
* first call to any from* function below.
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
/**
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
/**
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
/**
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
/**
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
/**
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
/**
* @type {number}
* @ignore
*/
Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
/** @type {Timestamp} */
Timestamp.ZERO = Timestamp.fromInt(0);
/** @type {Timestamp} */
Timestamp.ONE = Timestamp.fromInt(1);
/** @type {Timestamp} */
Timestamp.NEG_ONE = Timestamp.fromInt(-1);
/** @type {Timestamp} */
Timestamp.MAX_VALUE = Timestamp.fromBits(0xffffffff | 0, 0x7fffffff | 0);
/** @type {Timestamp} */
Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
/**
* @type {Timestamp}
* @ignore
*/
Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
/**
* Expose.
*/
module.exports = Timestamp;
module.exports.Timestamp = Timestamp;
/***/ }),
/* 338 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer, process) {// Custom inspect property name / symbol.
var inspect = 'inspect';
var utils = __webpack_require__(344);
/**
* Machine id.
*
* Create a random 3-byte value (i.e. unique for this
* process). Other drivers use a md5 of the machine id here, but
* that would mean an asyc call to gethostname, so we don't bother.
* @ignore
*/
var MACHINE_ID = parseInt(Math.random() * 0xffffff, 10);
// Regular expression that checks for hex value
var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
// Check if buffer exists
try {
if (Buffer && Buffer.from) {
var hasBufferType = true;
inspect = __webpack_require__(345).inspect.custom || 'inspect';
}
} catch (err) {
hasBufferType = false;
}
/**
* Create a new ObjectID instance
*
* @class
* @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
* @property {number} generationTime The generation time of this ObjectId instance
* @return {ObjectID} instance of ObjectID.
*/
var ObjectID = function ObjectID(id) {
// Duck-typing to support ObjectId from different npm packages
if (id instanceof ObjectID) return id;
if (!(this instanceof ObjectID)) return new ObjectID(id);
this._bsontype = 'ObjectID';
// The most common usecase (blank id, new objectId instance)
if (id == null || typeof id === 'number') {
// Generate a new id
this.id = this.generate(id);
// If we are caching the hex string
if (ObjectID.cacheHexString) this.__id = this.toString('hex');
// Return the object
return;
}
// Check if the passed in id is valid
var valid = ObjectID.isValid(id);
// Throw an error if it's not a valid setup
if (!valid && id != null) {
throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
} else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) {
return new ObjectID(utils.toBuffer(id, 'hex'));
} else if (valid && typeof id === 'string' && id.length === 24) {
return ObjectID.createFromHexString(id);
} else if (id != null && id.length === 12) {
// assume 12 byte string
this.id = id;
} else if (id != null && id.toHexString) {
// Duck-typing to support ObjectId from different npm packages
return id;
} else {
throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
}
if (ObjectID.cacheHexString) this.__id = this.toString('hex');
};
// Allow usage of ObjectId as well as ObjectID
// var ObjectId = ObjectID;
// Precomputed hex table enables speedy hex string conversion
var hexTable = [];
for (var i = 0; i < 256; i++) {
hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
}
/**
* Return the ObjectID id as a 24 byte hex string representation
*
* @method
* @return {string} return the 24 byte hex string representation.
*/
ObjectID.prototype.toHexString = function () {
if (ObjectID.cacheHexString && this.__id) return this.__id;
var hexString = '';
if (!this.id || !this.id.length) {
throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
}
if (this.id instanceof _Buffer) {
hexString = convertToHex(this.id);
if (ObjectID.cacheHexString) this.__id = hexString;
return hexString;
}
for (var i = 0; i < this.id.length; i++) {
hexString += hexTable[this.id.charCodeAt(i)];
}
if (ObjectID.cacheHexString) this.__id = hexString;
return hexString;
};
/**
* Update the ObjectID index used in generating new ObjectID's on the driver
*
* @method
* @return {number} returns next index value.
* @ignore
*/
ObjectID.prototype.get_inc = function () {
return ObjectID.index = (ObjectID.index + 1) % 0xffffff;
};
/**
* Update the ObjectID index used in generating new ObjectID's on the driver
*
* @method
* @return {number} returns next index value.
* @ignore
*/
ObjectID.prototype.getInc = function () {
return this.get_inc();
};
/**
* Generate a 12 byte id buffer used in ObjectID's
*
* @method
* @param {number} [time] optional parameter allowing to pass in a second based timestamp.
* @return {Buffer} return the 12 byte id buffer string.
*/
ObjectID.prototype.generate = function (time) {
if ('number' !== typeof time) {
time = ~~(Date.now() / 1000);
}
// Use pid
var pid = (typeof process === 'undefined' || process.pid === 1 ? Math.floor(Math.random() * 100000) : process.pid) % 0xffff;
var inc = this.get_inc();
// Buffer used
var buffer = utils.allocBuffer(12);
// Encode time
buffer[3] = time & 0xff;
buffer[2] = time >> 8 & 0xff;
buffer[1] = time >> 16 & 0xff;
buffer[0] = time >> 24 & 0xff;
// Encode machine
buffer[6] = MACHINE_ID & 0xff;
buffer[5] = MACHINE_ID >> 8 & 0xff;
buffer[4] = MACHINE_ID >> 16 & 0xff;
// Encode pid
buffer[8] = pid & 0xff;
buffer[7] = pid >> 8 & 0xff;
// Encode index
buffer[11] = inc & 0xff;
buffer[10] = inc >> 8 & 0xff;
buffer[9] = inc >> 16 & 0xff;
// Return the buffer
return buffer;
};
/**
* Converts the id into a 24 byte hex string for printing
*
* @param {String} format The Buffer toString format parameter.
* @return {String} return the 24 byte hex string representation.
* @ignore
*/
ObjectID.prototype.toString = function (format) {
// Is the id a buffer then use the buffer toString method to return the format
if (this.id && this.id.copy) {
return this.id.toString(typeof format === 'string' ? format : 'hex');
}
// if(this.buffer )
return this.toHexString();
};
/**
* Converts to a string representation of this Id.
*
* @return {String} return the 24 byte hex string representation.
* @ignore
*/
ObjectID.prototype[inspect] = ObjectID.prototype.toString;
/**
* Converts to its JSON representation.
*
* @return {String} return the 24 byte hex string representation.
* @ignore
*/
ObjectID.prototype.toJSON = function () {
return this.toHexString();
};
/**
* Compares the equality of this ObjectID with `otherID`.
*
* @method
* @param {object} otherID ObjectID instance to compare against.
* @return {boolean} the result of comparing two ObjectID's
*/
ObjectID.prototype.equals = function equals(otherId) {
// var id;
if (otherId instanceof ObjectID) {
return this.toString() === otherId.toString();
} else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12 && this.id instanceof _Buffer) {
return otherId === this.id.toString('binary');
} else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 24) {
return otherId.toLowerCase() === this.toHexString();
} else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12) {
return otherId === this.id;
} else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
return otherId.toHexString() === this.toHexString();
} else {
return false;
}
};
/**
* Returns the generation date (accurate up to the second) that this ID was generated.
*
* @method
* @return {date} the generation date
*/
ObjectID.prototype.getTimestamp = function () {
var timestamp = new Date();
var time = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
timestamp.setTime(Math.floor(time) * 1000);
return timestamp;
};
/**
* @ignore
*/
ObjectID.index = ~~(Math.random() * 0xffffff);
/**
* @ignore
*/
ObjectID.createPk = function createPk() {
return new ObjectID();
};
/**
* Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
*
* @method
* @param {number} time an integer number representing a number of seconds.
* @return {ObjectID} return the created ObjectID
*/
ObjectID.createFromTime = function createFromTime(time) {
var buffer = utils.toBuffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// Encode time into first 4 bytes
buffer[3] = time & 0xff;
buffer[2] = time >> 8 & 0xff;
buffer[1] = time >> 16 & 0xff;
buffer[0] = time >> 24 & 0xff;
// Return the new objectId
return new ObjectID(buffer);
};
// Lookup tables
//var encodeLookup = '0123456789abcdef'.split('');
var decodeLookup = [];
i = 0;
while (i < 10) decodeLookup[0x30 + i] = i++;
while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
var _Buffer = Buffer;
var convertToHex = function (bytes) {
return bytes.toString('hex');
};
/**
* Creates an ObjectID from a hex string representation of an ObjectID.
*
* @method
* @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
* @return {ObjectID} return the created ObjectID
*/
ObjectID.createFromHexString = function createFromHexString(string) {
// Throw an error if it's not a valid setup
if (typeof string === 'undefined' || string != null && string.length !== 24) {
throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
}
// Use Buffer.from method if available
if (hasBufferType) return new ObjectID(utils.toBuffer(string, 'hex'));
// Calculate lengths
var array = new _Buffer(12);
var n = 0;
var i = 0;
while (i < 24) {
array[n++] = decodeLookup[string.charCodeAt(i++)] << 4 | decodeLookup[string.charCodeAt(i++)];
}
return new ObjectID(array);
};
/**
* Checks if a value is a valid bson ObjectId
*
* @method
* @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
*/
ObjectID.isValid = function isValid(id) {
if (id == null) return false;
if (typeof id === 'number') {
return true;
}
if (typeof id === 'string') {
return id.length === 12 || id.length === 24 && checkForHexRegExp.test(id);
}
if (id instanceof ObjectID) {
return true;
}
if (id instanceof _Buffer) {
return true;
}
// Duck-Typing detection of ObjectId like objects
if (id.toHexString) {
return id.id.length === 12 || id.id.length === 24 && checkForHexRegExp.test(id.id);
}
return false;
};
/**
* @ignore
*/
Object.defineProperty(ObjectID.prototype, 'generationTime', {
enumerable: true,
get: function () {
return this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
},
set: function (value) {
// Encode time into first 4 bytes
this.id[3] = value & 0xff;
this.id[2] = value >> 8 & 0xff;
this.id[1] = value >> 16 & 0xff;
this.id[0] = value >> 24 & 0xff;
}
});
/**
* Expose.
*/
module.exports = ObjectID;
module.exports.ObjectID = ObjectID;
module.exports.ObjectId = ObjectID;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer, __webpack_require__(343)))
/***/ }),
/* 339 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
'use strict'
var base64 = __webpack_require__(340)
var ieee754 = __webpack_require__(341)
var isArray = __webpack_require__(342)
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
/*
* Export kMaxLength after typed array support is determined.
*/
exports.kMaxLength = kMaxLength()
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
function createBuffer (that, length) {
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length)
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
that = new Buffer(length)
}
that.length = length
}
return that
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(this, arg)
}
return from(this, arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
arr.__proto__ = Buffer.prototype
return arr
}
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(that, value, encodingOrOffset)
}
return fromObject(that, value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true
})
}
}
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(that, size).fill(fill, encoding)
: createBuffer(that, size).fill(fill)
}
return createBuffer(that, size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
}
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0
}
}
return that
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(null, size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, length)
var actual = that.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}
return that
}
function fromArrayLike (that, array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('\'length\' is out of bounds')
}
if (byteOffset === undefined && length === undefined) {
array = new Uint8Array(array)
} else if (length === undefined) {
array = new Uint8Array(array, byteOffset)
} else {
array = new Uint8Array(array, byteOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array)
}
return that
}
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(that, 0)
}
return fromArrayLike(that, obj)
}
if (obj.type === 'Buffer' && isArray(obj.data)) {
return fromArrayLike(that, obj.data)
}
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function checked (length) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
string = '' + string
}
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
case undefined:
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (isNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end)
newBuf.__proto__ = Buffer.prototype
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start]
}
}
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, start + len),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if (code < 256) {
val = code
}
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: utf8ToBytes(new Buffer(val, encoding).toString())
var len = bytes.length
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 340 */
/***/ (function(module, exports) {
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(
uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
/***/ }),
/* 341 */
/***/ (function(module, exports) {
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/* 342 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/* 343 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 344 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
/**
* Normalizes our expected stringified form of a function across versions of node
* @param {Function} fn The function to stringify
*/
function normalizedFunctionString(fn) {
return fn.toString().replace(/function *\(/, 'function (');
}
function newBuffer(item, encoding) {
return new Buffer(item, encoding);
}
function allocBuffer() {
return Buffer.alloc.apply(Buffer, arguments);
}
function toBuffer() {
return Buffer.from.apply(Buffer, arguments);
}
module.exports = {
normalizedFunctionString: normalizedFunctionString,
allocBuffer: typeof Buffer.alloc === 'function' ? allocBuffer : newBuffer,
toBuffer: typeof Buffer.from === 'function' ? toBuffer : newBuffer
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
/***/ }),
/* 345 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var formatRegExp = /%[sdj%]/g;
exports.format = function(f) {
if (!isString(f)) {
var objects = [];
for (var i = 0; i < arguments.length; i++) {
objects.push(inspect(arguments[i]));
}
return objects.join(' ');
}
var i = 1;
var args = arguments;
var len = args.length;
var str = String(f).replace(formatRegExp, function(x) {
if (x === '%%') return '%';
if (i >= len) return x;
switch (x) {
case '%s': return String(args[i++]);
case '%d': return Number(args[i++]);
case '%j':
try {
return JSON.stringify(args[i++]);
} catch (_) {
return '[Circular]';
}
default:
return x;
}
});
for (var x = args[i]; i < len; x = args[++i]) {
if (isNull(x) || !isObject(x)) {
str += ' ' + x;
} else {
str += ' ' + inspect(x);
}
}
return str;
};
// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
exports.deprecate = function(fn, msg) {
// Allow for deprecating things in the process of starting up.
if (isUndefined(global.process)) {
return function() {
return exports.deprecate(fn, msg).apply(this, arguments);
};
}
if (process.noDeprecation === true) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (process.throwDeprecation) {
throw new Error(msg);
} else if (process.traceDeprecation) {
console.trace(msg);
} else {
console.error(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
};
var debugs = {};
var debugEnviron;
exports.debuglog = function(set) {
if (isUndefined(debugEnviron))
debugEnviron = process.env.NODE_DEBUG || '';
set = set.toUpperCase();
if (!debugs[set]) {
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
var pid = process.pid;
debugs[set] = function() {
var msg = exports.format.apply(exports, arguments);
console.error('%s %d: %s', set, pid, msg);
};
} else {
debugs[set] = function() {};
}
}
return debugs[set];
};
/**
* Echos the value of a value. Trys to print the value out
* in the best way possible given the different types.
*
* @param {Object} obj The object to print out.
* @param {Object} opts Optional options object that alters the output.
*/
/* legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
// default options
var ctx = {
seen: [],
stylize: stylizeNoColor
};
// legacy...
if (arguments.length >= 3) ctx.depth = arguments[2];
if (arguments.length >= 4) ctx.colors = arguments[3];
if (isBoolean(opts)) {
// legacy...
ctx.showHidden = opts;
} else if (opts) {
// got an "options" object
exports._extend(ctx, opts);
}
// set default options
if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
if (isUndefined(ctx.depth)) ctx.depth = 2;
if (isUndefined(ctx.colors)) ctx.colors = false;
if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
if (ctx.colors) ctx.stylize = stylizeWithColor;
return formatValue(ctx, obj, ctx.depth);
}
exports.inspect = inspect;
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
inspect.colors = {
'bold' : [1, 22],
'italic' : [3, 23],
'underline' : [4, 24],
'inverse' : [7, 27],
'white' : [37, 39],
'grey' : [90, 39],
'black' : [30, 39],
'blue' : [34, 39],
'cyan' : [36, 39],
'green' : [32, 39],
'magenta' : [35, 39],
'red' : [31, 39],
'yellow' : [33, 39]
};
// Don't use 'blue' not visible on cmd.exe
inspect.styles = {
'special': 'cyan',
'number': 'yellow',
'boolean': 'yellow',
'undefined': 'grey',
'null': 'bold',
'string': 'green',
'date': 'magenta',
// "name": intentionally not styling
'regexp': 'red'
};
function stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
if (style) {
return '\u001b[' + inspect.colors[style][0] + 'm' + str +
'\u001b[' + inspect.colors[style][1] + 'm';
} else {
return str;
}
}
function stylizeNoColor(str, styleType) {
return str;
}
function arrayToHash(array) {
var hash = {};
array.forEach(function(val, idx) {
hash[val] = true;
});
return hash;
}
function formatValue(ctx, value, recurseTimes) {
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (ctx.customInspect &&
value &&
isFunction(value.inspect) &&
// Filter out the util module, it's inspect function is special
value.inspect !== exports.inspect &&
// Also filter out any prototype objects using the circular check.
!(value.constructor && value.constructor.prototype === value)) {
var ret = value.inspect(recurseTimes, ctx);
if (!isString(ret)) {
ret = formatValue(ctx, ret, recurseTimes);
}
return ret;
}
// Primitive types cannot have properties
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
// Look up the keys of the object.
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
if (ctx.showHidden) {
keys = Object.getOwnPropertyNames(value);
}
// IE doesn't make error fields non-enumerable
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
if (isError(value)
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
return formatError(value);
}
// Some type of object without properties can be shortcutted.
if (keys.length === 0) {
if (isFunction(value)) {
var name = value.name ? ': ' + value.name : '';
return ctx.stylize('[Function' + name + ']', 'special');
}
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
}
if (isDate(value)) {
return ctx.stylize(Date.prototype.toString.call(value), 'date');
}
if (isError(value)) {
return formatError(value);
}
}
var base = '', array = false, braces = ['{', '}'];
// Make Array say that they are Array
if (isArray(value)) {
array = true;
braces = ['[', ']'];
}
// Make functions say that they are functions
if (isFunction(value)) {
var n = value.name ? ': ' + value.name : '';
base = ' [Function' + n + ']';
}
// Make RegExps say that they are RegExps
if (isRegExp(value)) {
base = ' ' + RegExp.prototype.toString.call(value);
}
// Make dates with properties first say the date
if (isDate(value)) {
base = ' ' + Date.prototype.toUTCString.call(value);
}
// Make error with message first say the error
if (isError(value)) {
base = ' ' + formatError(value);
}
if (keys.length === 0 && (!array || value.length == 0)) {
return braces[0] + base + braces[1];
}
if (recurseTimes < 0) {
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
} else {
return ctx.stylize('[Object]', 'special');
}
}
ctx.seen.push(value);
var output;
if (array) {
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
} else {
output = keys.map(function(key) {
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
});
}
ctx.seen.pop();
return reduceToSingleString(output, base, braces);
}
function formatPrimitive(ctx, value) {
if (isUndefined(value))
return ctx.stylize('undefined', 'undefined');
if (isString(value)) {
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
.replace(/\\"/g, '"') + '\'';
return ctx.stylize(simple, 'string');
}
if (isNumber(value))
return ctx.stylize('' + value, 'number');
if (isBoolean(value))
return ctx.stylize('' + value, 'boolean');
// For some reason typeof null is "object", so special case here.
if (isNull(value))
return ctx.stylize('null', 'null');
}
function formatError(value) {
return '[' + Error.prototype.toString.call(value) + ']';
}
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
var output = [];
for (var i = 0, l = value.length; i < l; ++i) {
if (hasOwnProperty(value, String(i))) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
String(i), true));
} else {
output.push('');
}
}
keys.forEach(function(key) {
if (!key.match(/^\d+$/)) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
key, true));
}
});
return output;
}
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
var name, str, desc;
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
if (desc.get) {
if (desc.set) {
str = ctx.stylize('[Getter/Setter]', 'special');
} else {
str = ctx.stylize('[Getter]', 'special');
}
} else {
if (desc.set) {
str = ctx.stylize('[Setter]', 'special');
}
}
if (!hasOwnProperty(visibleKeys, key)) {
name = '[' + key + ']';
}
if (!str) {
if (ctx.seen.indexOf(desc.value) < 0) {
if (isNull(recurseTimes)) {
str = formatValue(ctx, desc.value, null);
} else {
str = formatValue(ctx, desc.value, recurseTimes - 1);
}
if (str.indexOf('\n') > -1) {
if (array) {
str = str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n').substr(2);
} else {
str = '\n' + str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n');
}
}
} else {
str = ctx.stylize('[Circular]', 'special');
}
}
if (isUndefined(name)) {
if (array && key.match(/^\d+$/)) {
return str;
}
name = JSON.stringify('' + key);
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
name = name.substr(1, name.length - 2);
name = ctx.stylize(name, 'name');
} else {
name = name.replace(/'/g, "\\'")
.replace(/\\"/g, '"')
.replace(/(^"|"$)/g, "'");
name = ctx.stylize(name, 'string');
}
}
return name + ': ' + str;
}
function reduceToSingleString(output, base, braces) {
var numLinesEst = 0;
var length = output.reduce(function(prev, cur) {
numLinesEst++;
if (cur.indexOf('\n') >= 0) numLinesEst++;
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
}, 0);
if (length > 60) {
return braces[0] +
(base === '' ? '' : base + '\n ') +
' ' +
output.join(',\n ') +
' ' +
braces[1];
}
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
return Array.isArray(ar);
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = __webpack_require__(346);
function objectToString(o) {
return Object.prototype.toString.call(o);
}
function pad(n) {
return n < 10 ? '0' + n.toString(10) : n.toString(10);
}
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'];
// 26 Feb 16:19:34
function timestamp() {
var d = new Date();
var time = [pad(d.getHours()),
pad(d.getMinutes()),
pad(d.getSeconds())].join(':');
return [d.getDate(), months[d.getMonth()], time].join(' ');
}
// log is just a thin wrapper to console.log that prepends a timestamp
exports.log = function() {
console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
};
/**
* Inherit the prototype methods from one constructor into another.
*
* The Function.prototype.inherits from lang.js rewritten as a standalone
* function (not on Function.prototype). NOTE: If this file is to be loaded
* during bootstrapping this function needs to be rewritten using some native
* functions as prototype setup using normal JavaScript does not work as
* expected during bootstrapping (see mirror.js in r114903).
*
* @param {function} ctor Constructor function which needs to inherit the
* prototype.
* @param {function} superCtor Constructor function to inherit prototype from.
*/
exports.inherits = __webpack_require__(347);
exports._extend = function(origin, add) {
// Don't do anything if add isn't an object
if (!add || !isObject(add)) return origin;
var keys = Object.keys(add);
var i = keys.length;
while (i--) {
origin[keys[i]] = add[keys[i]];
}
return origin;
};
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(343)))
/***/ }),
/* 346 */
/***/ (function(module, exports) {
module.exports = function isBuffer(arg) {
return arg && typeof arg === 'object'
&& typeof arg.copy === 'function'
&& typeof arg.fill === 'function'
&& typeof arg.readUInt8 === 'function';
}
/***/ }),
/* 347 */
/***/ (function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ }),
/* 348 */
/***/ (function(module, exports) {
/**
* A class representation of the BSON RegExp type.
*
* @class
* @return {BSONRegExp} A MinKey instance
*/
function BSONRegExp(pattern, options) {
if (!(this instanceof BSONRegExp)) return new BSONRegExp();
// Execute
this._bsontype = 'BSONRegExp';
this.pattern = pattern || '';
this.options = options || '';
// Validate options
for (var i = 0; i < this.options.length; i++) {
if (!(this.options[i] === 'i' || this.options[i] === 'm' || this.options[i] === 'x' || this.options[i] === 'l' || this.options[i] === 's' || this.options[i] === 'u')) {
throw new Error('the regular expression options [' + this.options[i] + '] is not supported');
}
}
}
module.exports = BSONRegExp;
module.exports.BSONRegExp = BSONRegExp;
/***/ }),
/* 349 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {// Custom inspect property name / symbol.
var inspect = Buffer ? __webpack_require__(345).inspect.custom || 'inspect' : 'inspect';
/**
* A class representation of the BSON Symbol type.
*
* @class
* @deprecated
* @param {string} value the string representing the symbol.
* @return {Symbol}
*/
function Symbol(value) {
if (!(this instanceof Symbol)) return new Symbol(value);
this._bsontype = 'Symbol';
this.value = value;
}
/**
* Access the wrapped string value.
*
* @method
* @return {String} returns the wrapped string.
*/
Symbol.prototype.valueOf = function () {
return this.value;
};
/**
* @ignore
*/
Symbol.prototype.toString = function () {
return this.value;
};
/**
* @ignore
*/
Symbol.prototype[inspect] = function () {
return this.value;
};
/**
* @ignore
*/
Symbol.prototype.toJSON = function () {
return this.value;
};
module.exports = Symbol;
module.exports.Symbol = Symbol;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
/***/ }),
/* 350 */
/***/ (function(module, exports) {
/**
* A class representation of a BSON Int32 type.
*
* @class
* @param {number} value the number we want to represent as an int32.
* @return {Int32}
*/
var Int32 = function (value) {
if (!(this instanceof Int32)) return new Int32(value);
this._bsontype = 'Int32';
this.value = value;
};
/**
* Access the number value.
*
* @method
* @return {number} returns the wrapped int32 number.
*/
Int32.prototype.valueOf = function () {
return this.value;
};
/**
* @ignore
*/
Int32.prototype.toJSON = function () {
return this.value;
};
module.exports = Int32;
module.exports.Int32 = Int32;
/***/ }),
/* 351 */
/***/ (function(module, exports) {
/**
* A class representation of the BSON Code type.
*
* @class
* @param {(string|function)} code a string or function.
* @param {Object} [scope] an optional scope for the function.
* @return {Code}
*/
var Code = function Code(code, scope) {
if (!(this instanceof Code)) return new Code(code, scope);
this._bsontype = 'Code';
this.code = code;
this.scope = scope;
};
/**
* @ignore
*/
Code.prototype.toJSON = function () {
return { scope: this.scope, code: this.code };
};
module.exports = Code;
module.exports.Code = Code;
/***/ }),
/* 352 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var Long = __webpack_require__(335);
var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
var EXPONENT_MAX = 6111;
var EXPONENT_MIN = -6176;
var EXPONENT_BIAS = 6176;
var MAX_DIGITS = 34;
// Nan value bits as 32 bit values (due to lack of longs)
var NAN_BUFFER = [0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
// Infinity value bits 32 bit values (due to lack of longs)
var INF_NEGATIVE_BUFFER = [0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
var INF_POSITIVE_BUFFER = [0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
var EXPONENT_REGEX = /^([-+])?(\d+)?$/;
var utils = __webpack_require__(344);
// Detect if the value is a digit
var isDigit = function (value) {
return !isNaN(parseInt(value, 10));
};
// Divide two uint128 values
var divideu128 = function (value) {
var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
var _rem = Long.fromNumber(0);
var i = 0;
if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
return { quotient: value, rem: _rem };
}
for (i = 0; i <= 3; i++) {
// Adjust remainder to match value of next dividend
_rem = _rem.shiftLeft(32);
// Add the divided to _rem
_rem = _rem.add(new Long(value.parts[i], 0));
value.parts[i] = _rem.div(DIVISOR).low_;
_rem = _rem.modulo(DIVISOR);
}
return { quotient: value, rem: _rem };
};
// Multiply two Long values and return the 128 bit value
var multiply64x2 = function (left, right) {
if (!left && !right) {
return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
}
var leftHigh = left.shiftRightUnsigned(32);
var leftLow = new Long(left.getLowBits(), 0);
var rightHigh = right.shiftRightUnsigned(32);
var rightLow = new Long(right.getLowBits(), 0);
var productHigh = leftHigh.multiply(rightHigh);
var productMid = leftHigh.multiply(rightLow);
var productMid2 = leftLow.multiply(rightHigh);
var productLow = leftLow.multiply(rightLow);
productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32));
productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
// Return the 128 bit result
return { high: productHigh, low: productLow };
};
var lessThan = function (left, right) {
// Make values unsigned
var uhleft = left.high_ >>> 0;
var uhright = right.high_ >>> 0;
// Compare high bits first
if (uhleft < uhright) {
return true;
} else if (uhleft === uhright) {
var ulleft = left.low_ >>> 0;
var ulright = right.low_ >>> 0;
if (ulleft < ulright) return true;
}
return false;
};
// var longtoHex = function(value) {
// var buffer = utils.allocBuffer(8);
// var index = 0;
// // Encode the low 64 bits of the decimal
// // Encode low bits
// buffer[index++] = value.low_ & 0xff;
// buffer[index++] = (value.low_ >> 8) & 0xff;
// buffer[index++] = (value.low_ >> 16) & 0xff;
// buffer[index++] = (value.low_ >> 24) & 0xff;
// // Encode high bits
// buffer[index++] = value.high_ & 0xff;
// buffer[index++] = (value.high_ >> 8) & 0xff;
// buffer[index++] = (value.high_ >> 16) & 0xff;
// buffer[index++] = (value.high_ >> 24) & 0xff;
// return buffer.reverse().toString('hex');
// };
// var int32toHex = function(value) {
// var buffer = utils.allocBuffer(4);
// var index = 0;
// // Encode the low 64 bits of the decimal
// // Encode low bits
// buffer[index++] = value & 0xff;
// buffer[index++] = (value >> 8) & 0xff;
// buffer[index++] = (value >> 16) & 0xff;
// buffer[index++] = (value >> 24) & 0xff;
// return buffer.reverse().toString('hex');
// };
/**
* A class representation of the BSON Decimal128 type.
*
* @class
* @param {Buffer} bytes a buffer containing the raw Decimal128 bytes.
* @return {Double}
*/
var Decimal128 = function (bytes) {
this._bsontype = 'Decimal128';
this.bytes = bytes;
};
/**
* Create a Decimal128 instance from a string representation
*
* @method
* @param {string} string a numeric string representation.
* @return {Decimal128} returns a Decimal128 instance.
*/
Decimal128.fromString = function (string) {
// Parse state tracking
var isNegative = false;
var sawRadix = false;
var foundNonZero = false;
// Total number of significant digits (no leading or trailing zero)
var significantDigits = 0;
// Total number of significand digits read
var nDigitsRead = 0;
// Total number of digits (no leading zeros)
var nDigits = 0;
// The number of the digits after radix
var radixPosition = 0;
// The index of the first non-zero in *str*
var firstNonZero = 0;
// Digits Array
var digits = [0];
// The number of digits in digits
var nDigitsStored = 0;
// Insertion pointer for digits
var digitsInsert = 0;
// The index of the first non-zero digit
var firstDigit = 0;
// The index of the last digit
var lastDigit = 0;
// Exponent
var exponent = 0;
// loop index over array
var i = 0;
// The high 17 digits of the significand
var significandHigh = [0, 0];
// The low 17 digits of the significand
var significandLow = [0, 0];
// The biased exponent
var biasedExponent = 0;
// Read index
var index = 0;
// Trim the string
string = string.trim();
// Naively prevent against REDOS attacks.
// TODO: implementing a custom parsing for this, or refactoring the regex would yield
// further gains.
if (string.length >= 7000) {
throw new Error('' + string + ' not a valid Decimal128 string');
}
// Results
var stringMatch = string.match(PARSE_STRING_REGEXP);
var infMatch = string.match(PARSE_INF_REGEXP);
var nanMatch = string.match(PARSE_NAN_REGEXP);
// Validate the string
if (!stringMatch && !infMatch && !nanMatch || string.length === 0) {
throw new Error('' + string + ' not a valid Decimal128 string');
}
// Check if we have an illegal exponent format
if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
throw new Error('' + string + ' not a valid Decimal128 string');
}
// Get the negative or positive sign
if (string[index] === '+' || string[index] === '-') {
isNegative = string[index++] === '-';
}
// Check if user passed Infinity or NaN
if (!isDigit(string[index]) && string[index] !== '.') {
if (string[index] === 'i' || string[index] === 'I') {
return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
} else if (string[index] === 'N') {
return new Decimal128(utils.toBuffer(NAN_BUFFER));
}
}
// Read all the digits
while (isDigit(string[index]) || string[index] === '.') {
if (string[index] === '.') {
if (sawRadix) {
return new Decimal128(utils.toBuffer(NAN_BUFFER));
}
sawRadix = true;
index = index + 1;
continue;
}
if (nDigitsStored < 34) {
if (string[index] !== '0' || foundNonZero) {
if (!foundNonZero) {
firstNonZero = nDigitsRead;
}
foundNonZero = true;
// Only store 34 digits
digits[digitsInsert++] = parseInt(string[index], 10);
nDigitsStored = nDigitsStored + 1;
}
}
if (foundNonZero) {
nDigits = nDigits + 1;
}
if (sawRadix) {
radixPosition = radixPosition + 1;
}
nDigitsRead = nDigitsRead + 1;
index = index + 1;
}
if (sawRadix && !nDigitsRead) {
throw new Error('' + string + ' not a valid Decimal128 string');
}
// Read exponent if exists
if (string[index] === 'e' || string[index] === 'E') {
// Read exponent digits
var match = string.substr(++index).match(EXPONENT_REGEX);
// No digits read
if (!match || !match[2]) {
return new Decimal128(utils.toBuffer(NAN_BUFFER));
}
// Get exponent
exponent = parseInt(match[0], 10);
// Adjust the index
index = index + match[0].length;
}
// Return not a number
if (string[index]) {
return new Decimal128(utils.toBuffer(NAN_BUFFER));
}
// Done reading input
// Find first non-zero digit in digits
firstDigit = 0;
if (!nDigitsStored) {
firstDigit = 0;
lastDigit = 0;
digits[0] = 0;
nDigits = 1;
nDigitsStored = 1;
significantDigits = 0;
} else {
lastDigit = nDigitsStored - 1;
significantDigits = nDigits;
if (exponent !== 0 && significantDigits !== 1) {
while (string[firstNonZero + significantDigits - 1] === '0') {
significantDigits = significantDigits - 1;
}
}
}
// Normalization of exponent
// Correct exponent based on radix position, and shift significand as needed
// to represent user input
// Overflow prevention
if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
exponent = EXPONENT_MIN;
} else {
exponent = exponent - radixPosition;
}
// Attempt to normalize the exponent
while (exponent > EXPONENT_MAX) {
// Shift exponent to significand and decrease
lastDigit = lastDigit + 1;
if (lastDigit - firstDigit > MAX_DIGITS) {
// Check if we have a zero then just hard clamp, otherwise fail
var digitsString = digits.join('');
if (digitsString.match(/^0+$/)) {
exponent = EXPONENT_MAX;
break;
} else {
return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
}
}
exponent = exponent - 1;
}
while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
// Shift last digit
if (lastDigit === 0) {
exponent = EXPONENT_MIN;
significantDigits = 0;
break;
}
if (nDigitsStored < nDigits) {
// adjust to match digits not stored
nDigits = nDigits - 1;
} else {
// adjust to round
lastDigit = lastDigit - 1;
}
if (exponent < EXPONENT_MAX) {
exponent = exponent + 1;
} else {
// Check if we have a zero then just hard clamp, otherwise fail
digitsString = digits.join('');
if (digitsString.match(/^0+$/)) {
exponent = EXPONENT_MAX;
break;
} else {
return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
}
}
}
// Round
// We've normalized the exponent, but might still need to round.
if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] !== '0') {
var endOfString = nDigitsRead;
// If we have seen a radix point, 'string' is 1 longer than we have
// documented with ndigits_read, so inc the position of the first nonzero
// digit and the position that digits are read to.
if (sawRadix && exponent === EXPONENT_MIN) {
firstNonZero = firstNonZero + 1;
endOfString = endOfString + 1;
}
var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
var roundBit = 0;
if (roundDigit >= 5) {
roundBit = 1;
if (roundDigit === 5) {
roundBit = digits[lastDigit] % 2 === 1;
for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
if (parseInt(string[i], 10)) {
roundBit = 1;
break;
}
}
}
}
if (roundBit) {
var dIdx = lastDigit;
for (; dIdx >= 0; dIdx--) {
if (++digits[dIdx] > 9) {
digits[dIdx] = 0;
// overflowed most significant digit
if (dIdx === 0) {
if (exponent < EXPONENT_MAX) {
exponent = exponent + 1;
digits[dIdx] = 1;
} else {
return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
}
}
} else {
break;
}
}
}
}
// Encode significand
// The high 17 digits of the significand
significandHigh = Long.fromNumber(0);
// The low 17 digits of the significand
significandLow = Long.fromNumber(0);
// read a zero
if (significantDigits === 0) {
significandHigh = Long.fromNumber(0);
significandLow = Long.fromNumber(0);
} else if (lastDigit - firstDigit < 17) {
dIdx = firstDigit;
significandLow = Long.fromNumber(digits[dIdx++]);
significandHigh = new Long(0, 0);
for (; dIdx <= lastDigit; dIdx++) {
significandLow = significandLow.multiply(Long.fromNumber(10));
significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
}
} else {
dIdx = firstDigit;
significandHigh = Long.fromNumber(digits[dIdx++]);
for (; dIdx <= lastDigit - 17; dIdx++) {
significandHigh = significandHigh.multiply(Long.fromNumber(10));
significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
}
significandLow = Long.fromNumber(digits[dIdx++]);
for (; dIdx <= lastDigit; dIdx++) {
significandLow = significandLow.multiply(Long.fromNumber(10));
significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
}
}
var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
significand.low = significand.low.add(significandLow);
if (lessThan(significand.low, significandLow)) {
significand.high = significand.high.add(Long.fromNumber(1));
}
// Biased exponent
biasedExponent = exponent + EXPONENT_BIAS;
var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
// Encode combination, exponent, and significand.
if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber)) {
// Encode '11' into bits 1 to 3
dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
} else {
dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
}
dec.low = significand.low;
// Encode sign
if (isNegative) {
dec.high = dec.high.or(Long.fromString('9223372036854775808'));
}
// Encode into a buffer
var buffer = utils.allocBuffer(16);
index = 0;
// Encode the low 64 bits of the decimal
// Encode low bits
buffer[index++] = dec.low.low_ & 0xff;
buffer[index++] = dec.low.low_ >> 8 & 0xff;
buffer[index++] = dec.low.low_ >> 16 & 0xff;
buffer[index++] = dec.low.low_ >> 24 & 0xff;
// Encode high bits
buffer[index++] = dec.low.high_ & 0xff;
buffer[index++] = dec.low.high_ >> 8 & 0xff;
buffer[index++] = dec.low.high_ >> 16 & 0xff;
buffer[index++] = dec.low.high_ >> 24 & 0xff;
// Encode the high 64 bits of the decimal
// Encode low bits
buffer[index++] = dec.high.low_ & 0xff;
buffer[index++] = dec.high.low_ >> 8 & 0xff;
buffer[index++] = dec.high.low_ >> 16 & 0xff;
buffer[index++] = dec.high.low_ >> 24 & 0xff;
// Encode high bits
buffer[index++] = dec.high.high_ & 0xff;
buffer[index++] = dec.high.high_ >> 8 & 0xff;
buffer[index++] = dec.high.high_ >> 16 & 0xff;
buffer[index++] = dec.high.high_ >> 24 & 0xff;
// Return the new Decimal128
return new Decimal128(buffer);
};
// Extract least significant 5 bits
var COMBINATION_MASK = 0x1f;
// Extract least significant 14 bits
var EXPONENT_MASK = 0x3fff;
// Value of combination field for Inf
var COMBINATION_INFINITY = 30;
// Value of combination field for NaN
var COMBINATION_NAN = 31;
// Value of combination field for NaN
// var COMBINATION_SNAN = 32;
// decimal128 exponent bias
EXPONENT_BIAS = 6176;
/**
* Create a string representation of the raw Decimal128 value
*
* @method
* @return {string} returns a Decimal128 string representation.
*/
Decimal128.prototype.toString = function () {
// Note: bits in this routine are referred to starting at 0,
// from the sign bit, towards the coefficient.
// bits 0 - 31
var high;
// bits 32 - 63
var midh;
// bits 64 - 95
var midl;
// bits 96 - 127
var low;
// bits 1 - 5
var combination;
// decoded biased exponent (14 bits)
var biased_exponent;
// the number of significand digits
var significand_digits = 0;
// the base-10 digits in the significand
var significand = new Array(36);
for (var i = 0; i < significand.length; i++) significand[i] = 0;
// read pointer into significand
var index = 0;
// unbiased exponent
var exponent;
// the exponent if scientific notation is used
var scientific_exponent;
// true if the number is zero
var is_zero = false;
// the most signifcant significand bits (50-46)
var significand_msb;
// temporary storage for significand decoding
var significand128 = { parts: new Array(4) };
// indexing variables
i;
var j, k;
// Output string
var string = [];
// Unpack index
index = 0;
// Buffer reference
var buffer = this.bytes;
// Unpack the low 64bits into a long
low = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
midl = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Unpack the high 64bits into a long
midh = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
high = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Unpack index
index = 0;
// Create the state of the decimal
var dec = {
low: new Long(low, midl),
high: new Long(midh, high)
};
if (dec.high.lessThan(Long.ZERO)) {
string.push('-');
}
// Decode combination field and exponent
combination = high >> 26 & COMBINATION_MASK;
if (combination >> 3 === 3) {
// Check for 'special' values
if (combination === COMBINATION_INFINITY) {
return string.join('') + 'Infinity';
} else if (combination === COMBINATION_NAN) {
return 'NaN';
} else {
biased_exponent = high >> 15 & EXPONENT_MASK;
significand_msb = 0x08 + (high >> 14 & 0x01);
}
} else {
significand_msb = high >> 14 & 0x07;
biased_exponent = high >> 17 & EXPONENT_MASK;
}
exponent = biased_exponent - EXPONENT_BIAS;
// Create string of significand digits
// Convert the 114-bit binary number represented by
// (significand_high, significand_low) to at most 34 decimal
// digits through modulo and division.
significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
significand128.parts[1] = midh;
significand128.parts[2] = midl;
significand128.parts[3] = low;
if (significand128.parts[0] === 0 && significand128.parts[1] === 0 && significand128.parts[2] === 0 && significand128.parts[3] === 0) {
is_zero = true;
} else {
for (k = 3; k >= 0; k--) {
var least_digits = 0;
// Peform the divide
var result = divideu128(significand128);
significand128 = result.quotient;
least_digits = result.rem.low_;
// We now have the 9 least significant digits (in base 2).
// Convert and output to string.
if (!least_digits) continue;
for (j = 8; j >= 0; j--) {
// significand[k * 9 + j] = Math.round(least_digits % 10);
significand[k * 9 + j] = least_digits % 10;
// least_digits = Math.round(least_digits / 10);
least_digits = Math.floor(least_digits / 10);
}
}
}
// Output format options:
// Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
// Regular - ddd.ddd
if (is_zero) {
significand_digits = 1;
significand[index] = 0;
} else {
significand_digits = 36;
i = 0;
while (!significand[index]) {
i++;
significand_digits = significand_digits - 1;
index = index + 1;
}
}
scientific_exponent = significand_digits - 1 + exponent;
// The scientific exponent checks are dictated by the string conversion
// specification and are somewhat arbitrary cutoffs.
//
// We must check exponent > 0, because if this is the case, the number
// has trailing zeros. However, we *cannot* output these trailing zeros,
// because doing so would change the precision of the value, and would
// change stored data if the string converted number is round tripped.
if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
// Scientific format
string.push(significand[index++]);
significand_digits = significand_digits - 1;
if (significand_digits) {
string.push('.');
}
for (i = 0; i < significand_digits; i++) {
string.push(significand[index++]);
}
// Exponent
string.push('E');
if (scientific_exponent > 0) {
string.push('+' + scientific_exponent);
} else {
string.push(scientific_exponent);
}
} else {
// Regular format with no decimal place
if (exponent >= 0) {
for (i = 0; i < significand_digits; i++) {
string.push(significand[index++]);
}
} else {
var radix_position = significand_digits + exponent;
// non-zero digits before radix
if (radix_position > 0) {
for (i = 0; i < radix_position; i++) {
string.push(significand[index++]);
}
} else {
string.push('0');
}
string.push('.');
// add leading zeros after radix
while (radix_position++ < 0) {
string.push('0');
}
for (i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
string.push(significand[index++]);
}
}
}
return string.join('');
};
Decimal128.prototype.toJSON = function () {
return { $numberDecimal: this.toString() };
};
module.exports = Decimal128;
module.exports.Decimal128 = Decimal128;
/***/ }),
/* 353 */
/***/ (function(module, exports) {
/**
* A class representation of the BSON MinKey type.
*
* @class
* @return {MinKey} A MinKey instance
*/
function MinKey() {
if (!(this instanceof MinKey)) return new MinKey();
this._bsontype = 'MinKey';
}
module.exports = MinKey;
module.exports.MinKey = MinKey;
/***/ }),
/* 354 */
/***/ (function(module, exports) {
/**
* A class representation of the BSON MaxKey type.
*
* @class
* @return {MaxKey} A MaxKey instance
*/
function MaxKey() {
if (!(this instanceof MaxKey)) return new MaxKey();
this._bsontype = 'MaxKey';
}
module.exports = MaxKey;
module.exports.MaxKey = MaxKey;
/***/ }),
/* 355 */
/***/ (function(module, exports) {
/**
* A class representation of the BSON DBRef type.
*
* @class
* @param {string} namespace the collection name.
* @param {ObjectID} oid the reference ObjectID.
* @param {string} [db] optional db name, if omitted the reference is local to the current db.
* @return {DBRef}
*/
function DBRef(namespace, oid, db) {
if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
this._bsontype = 'DBRef';
this.namespace = namespace;
this.oid = oid;
this.db = db;
}
/**
* @ignore
* @api private
*/
DBRef.prototype.toJSON = function () {
return {
$ref: this.namespace,
$id: this.oid,
$db: this.db == null ? '' : this.db
};
};
module.exports = DBRef;
module.exports.DBRef = DBRef;
/***/ }),
/* 356 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Module dependencies.
* @ignore
*/
// Test if we're in Node via presence of "global" not absence of "window"
// to support hybrid environments like Electron
if (typeof global !== 'undefined') {
var Buffer = __webpack_require__(339).Buffer; // TODO just use global Buffer
}
var utils = __webpack_require__(344);
/**
* A class representation of the BSON Binary type.
*
* Sub types
* - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
* - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
* - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
* - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
* - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
* - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
*
* @class
* @param {Buffer} buffer a buffer object containing the binary data.
* @param {Number} [subType] the option binary type.
* @return {Binary}
*/
function Binary(buffer, subType) {
if (!(this instanceof Binary)) return new Binary(buffer, subType);
if (buffer != null && !(typeof buffer === 'string') && !Buffer.isBuffer(buffer) && !(buffer instanceof Uint8Array) && !Array.isArray(buffer)) {
throw new Error('only String, Buffer, Uint8Array or Array accepted');
}
this._bsontype = 'Binary';
if (buffer instanceof Number) {
this.sub_type = buffer;
this.position = 0;
} else {
this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
this.position = 0;
}
if (buffer != null && !(buffer instanceof Number)) {
// Only accept Buffer, Uint8Array or Arrays
if (typeof buffer === 'string') {
// Different ways of writing the length of the string for the different types
if (typeof Buffer !== 'undefined') {
this.buffer = utils.toBuffer(buffer);
} else if (typeof Uint8Array !== 'undefined' || Object.prototype.toString.call(buffer) === '[object Array]') {
this.buffer = writeStringToArray(buffer);
} else {
throw new Error('only String, Buffer, Uint8Array or Array accepted');
}
} else {
this.buffer = buffer;
}
this.position = buffer.length;
} else {
if (typeof Buffer !== 'undefined') {
this.buffer = utils.allocBuffer(Binary.BUFFER_SIZE);
} else if (typeof Uint8Array !== 'undefined') {
this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
} else {
this.buffer = new Array(Binary.BUFFER_SIZE);
}
// Set position to start of buffer
this.position = 0;
}
}
/**
* Updates this binary with byte_value.
*
* @method
* @param {string} byte_value a single byte we wish to write.
*/
Binary.prototype.put = function put(byte_value) {
// If it's a string and a has more than one character throw an error
if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1) throw new Error('only accepts single character String, Uint8Array or Array');
if (typeof byte_value !== 'number' && byte_value < 0 || byte_value > 255) throw new Error('only accepts number in a valid unsigned byte range 0-255');
// Decode the byte value once
var decoded_byte = null;
if (typeof byte_value === 'string') {
decoded_byte = byte_value.charCodeAt(0);
} else if (byte_value['length'] != null) {
decoded_byte = byte_value[0];
} else {
decoded_byte = byte_value;
}
if (this.buffer.length > this.position) {
this.buffer[this.position++] = decoded_byte;
} else {
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
// Create additional overflow buffer
var buffer = utils.allocBuffer(Binary.BUFFER_SIZE + this.buffer.length);
// Combine the two buffers together
this.buffer.copy(buffer, 0, 0, this.buffer.length);
this.buffer = buffer;
this.buffer[this.position++] = decoded_byte;
} else {
buffer = null;
// Create a new buffer (typed or normal array)
if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
} else {
buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
}
// We need to copy all the content to the new array
for (var i = 0; i < this.buffer.length; i++) {
buffer[i] = this.buffer[i];
}
// Reassign the buffer
this.buffer = buffer;
// Write the byte
this.buffer[this.position++] = decoded_byte;
}
}
};
/**
* Writes a buffer or string to the binary.
*
* @method
* @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
* @param {number} offset specify the binary of where to write the content.
* @return {null}
*/
Binary.prototype.write = function write(string, offset) {
offset = typeof offset === 'number' ? offset : this.position;
// If the buffer is to small let's extend the buffer
if (this.buffer.length < offset + string.length) {
var buffer = null;
// If we are in node.js
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
buffer = utils.allocBuffer(this.buffer.length + string.length);
this.buffer.copy(buffer, 0, 0, this.buffer.length);
} else if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
// Create a new buffer
buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
// Copy the content
for (var i = 0; i < this.position; i++) {
buffer[i] = this.buffer[i];
}
}
// Assign the new buffer
this.buffer = buffer;
}
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
string.copy(this.buffer, offset, 0, string.length);
this.position = offset + string.length > this.position ? offset + string.length : this.position;
// offset = string.length
} else if (typeof Buffer !== 'undefined' && typeof string === 'string' && Buffer.isBuffer(this.buffer)) {
this.buffer.write(string, offset, 'binary');
this.position = offset + string.length > this.position ? offset + string.length : this.position;
// offset = string.length;
} else if (Object.prototype.toString.call(string) === '[object Uint8Array]' || Object.prototype.toString.call(string) === '[object Array]' && typeof string !== 'string') {
for (i = 0; i < string.length; i++) {
this.buffer[offset++] = string[i];
}
this.position = offset > this.position ? offset : this.position;
} else if (typeof string === 'string') {
for (i = 0; i < string.length; i++) {
this.buffer[offset++] = string.charCodeAt(i);
}
this.position = offset > this.position ? offset : this.position;
}
};
/**
* Reads **length** bytes starting at **position**.
*
* @method
* @param {number} position read from the given position in the Binary.
* @param {number} length the number of bytes to read.
* @return {Buffer}
*/
Binary.prototype.read = function read(position, length) {
length = length && length > 0 ? length : this.position;
// Let's return the data based on the type we have
if (this.buffer['slice']) {
return this.buffer.slice(position, position + length);
} else {
// Create a buffer to keep the result
var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(length)) : new Array(length);
for (var i = 0; i < length; i++) {
buffer[i] = this.buffer[position++];
}
}
// Return the buffer
return buffer;
};
/**
* Returns the value of this binary as a string.
*
* @method
* @return {string}
*/
Binary.prototype.value = function value(asRaw) {
asRaw = asRaw == null ? false : asRaw;
// Optimize to serialize for the situation where the data == size of buffer
if (asRaw && typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length === this.position) return this.buffer;
// If it's a node.js buffer object
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position);
} else {
if (asRaw) {
// we support the slice command use it
if (this.buffer['slice'] != null) {
return this.buffer.slice(0, this.position);
} else {
// Create a new buffer to copy content to
var newBuffer = Object.prototype.toString.call(this.buffer) === '[object Uint8Array]' ? new Uint8Array(new ArrayBuffer(this.position)) : new Array(this.position);
// Copy content
for (var i = 0; i < this.position; i++) {
newBuffer[i] = this.buffer[i];
}
// Return the buffer
return newBuffer;
}
} else {
return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
}
}
};
/**
* Length.
*
* @method
* @return {number} the length of the binary.
*/
Binary.prototype.length = function length() {
return this.position;
};
/**
* @ignore
*/
Binary.prototype.toJSON = function () {
return this.buffer != null ? this.buffer.toString('base64') : '';
};
/**
* @ignore
*/
Binary.prototype.toString = function (format) {
return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
};
/**
* Binary default subtype
* @ignore
*/
var BSON_BINARY_SUBTYPE_DEFAULT = 0;
/**
* @ignore
*/
var writeStringToArray = function (data) {
// Create a buffer
var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
// Write the content to the buffer
for (var i = 0; i < data.length; i++) {
buffer[i] = data.charCodeAt(i);
}
// Write the string to the buffer
return buffer;
};
/**
* Convert Array ot Uint8Array to Binary String
*
* @ignore
*/
var convertArraytoUtf8BinaryString = function (byteArray, startIndex, endIndex) {
var result = '';
for (var i = startIndex; i < endIndex; i++) {
result = result + String.fromCharCode(byteArray[i]);
}
return result;
};
Binary.BUFFER_SIZE = 256;
/**
* Default BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_DEFAULT = 0;
/**
* Function BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_FUNCTION = 1;
/**
* Byte Array BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_BYTE_ARRAY = 2;
/**
* OLD UUID BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_UUID_OLD = 3;
/**
* UUID BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_UUID = 4;
/**
* MD5 BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_MD5 = 5;
/**
* User BSON type
*
* @classconstant SUBTYPE_DEFAULT
**/
Binary.SUBTYPE_USER_DEFINED = 128;
/**
* Expose.
*/
module.exports = Binary;
module.exports.Binary = Binary;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 357 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var Long = __webpack_require__(335).Long,
Double = __webpack_require__(336).Double,
Timestamp = __webpack_require__(337).Timestamp,
ObjectID = __webpack_require__(338).ObjectID,
Symbol = __webpack_require__(349).Symbol,
Code = __webpack_require__(351).Code,
MinKey = __webpack_require__(353).MinKey,
MaxKey = __webpack_require__(354).MaxKey,
Decimal128 = __webpack_require__(352),
Int32 = __webpack_require__(350),
DBRef = __webpack_require__(355).DBRef,
BSONRegExp = __webpack_require__(348).BSONRegExp,
Binary = __webpack_require__(356).Binary;
var utils = __webpack_require__(344);
var deserialize = function (buffer, options, isArray) {
options = options == null ? {} : options;
var index = options && options.index ? options.index : 0;
// Read the document size
var size = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
// Ensure buffer is valid size
if (size < 5 || buffer.length < size || size + index > buffer.length) {
throw new Error('corrupt bson message');
}
// Illegal end value
if (buffer[index + size - 1] !== 0) {
throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
}
// Start deserializtion
return deserializeObject(buffer, index, options, isArray);
};
var deserializeObject = function (buffer, index, options, isArray) {
var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
var cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
if (!cacheFunctionsCrc32) var crc32 = null;
var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
// Return raw bson buffer instead of parsing it
var raw = options['raw'] == null ? false : options['raw'];
// Return BSONRegExp objects instead of native regular expressions
var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
// Controls the promotion of values vs wrapper classes
var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
// Set the start index
var startIndex = index;
// Validate that we have at least 4 bytes of buffer
if (buffer.length < 5) throw new Error('corrupt bson message < 5 bytes long');
// Read the document size
var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Ensure buffer is valid size
if (size < 5 || size > buffer.length) throw new Error('corrupt bson message');
// Create holding object
var object = isArray ? [] : {};
// Used for arrays to skip having to perform utf8 decoding
var arrayIndex = 0;
var done = false;
// While we have more left data left keep parsing
// while (buffer[index + 1] !== 0) {
while (!done) {
// Read the type
var elementType = buffer[index++];
// If we get a zero it's the last byte, exit
if (elementType === 0) break;
// Get the start search index
var i = index;
// Locate the end of the c string
while (buffer[i] !== 0x00 && i < buffer.length) {
i++;
}
// If are at the end of the buffer there is a problem with the document
if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
index = i + 1;
if (elementType === BSON.BSON_DATA_STRING) {
var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
object[name] = buffer.toString('utf8', index, index + stringSize - 1);
index = index + stringSize;
} else if (elementType === BSON.BSON_DATA_OID) {
var oid = utils.allocBuffer(12);
buffer.copy(oid, 0, index, index + 12);
object[name] = new ObjectID(oid);
index = index + 12;
} else if (elementType === BSON.BSON_DATA_INT && promoteValues === false) {
object[name] = new Int32(buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24);
} else if (elementType === BSON.BSON_DATA_INT) {
object[name] = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
} else if (elementType === BSON.BSON_DATA_NUMBER && promoteValues === false) {
object[name] = new Double(buffer.readDoubleLE(index));
index = index + 8;
} else if (elementType === BSON.BSON_DATA_NUMBER) {
object[name] = buffer.readDoubleLE(index);
index = index + 8;
} else if (elementType === BSON.BSON_DATA_DATE) {
var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
object[name] = new Date(new Long(lowBits, highBits).toNumber());
} else if (elementType === BSON.BSON_DATA_BOOLEAN) {
if (buffer[index] !== 0 && buffer[index] !== 1) throw new Error('illegal boolean type value');
object[name] = buffer[index++] === 1;
} else if (elementType === BSON.BSON_DATA_OBJECT) {
var _index = index;
var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
if (objectSize <= 0 || objectSize > buffer.length - index) throw new Error('bad embedded document length in bson');
// We have a raw value
if (raw) {
object[name] = buffer.slice(index, index + objectSize);
} else {
object[name] = deserializeObject(buffer, _index, options, false);
}
index = index + objectSize;
} else if (elementType === BSON.BSON_DATA_ARRAY) {
_index = index;
objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
var arrayOptions = options;
// Stop index
var stopIndex = index + objectSize;
// All elements of array to be returned as raw bson
if (fieldsAsRaw && fieldsAsRaw[name]) {
arrayOptions = {};
for (var n in options) arrayOptions[n] = options[n];
arrayOptions['raw'] = true;
}
object[name] = deserializeObject(buffer, _index, arrayOptions, true);
index = index + objectSize;
if (buffer[index - 1] !== 0) throw new Error('invalid array terminator byte');
if (index !== stopIndex) throw new Error('corrupted array bson');
} else if (elementType === BSON.BSON_DATA_UNDEFINED) {
object[name] = undefined;
} else if (elementType === BSON.BSON_DATA_NULL) {
object[name] = null;
} else if (elementType === BSON.BSON_DATA_LONG) {
// Unpack the low and high bits
lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
var long = new Long(lowBits, highBits);
// Promote the long if possible
if (promoteLongs && promoteValues === true) {
object[name] = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long;
} else {
object[name] = long;
}
} else if (elementType === BSON.BSON_DATA_DECIMAL128) {
// Buffer to contain the decimal bytes
var bytes = utils.allocBuffer(16);
// Copy the next 16 bytes into the bytes buffer
buffer.copy(bytes, 0, index, index + 16);
// Update index
index = index + 16;
// Assign the new Decimal128 value
var decimal128 = new Decimal128(bytes);
// If we have an alternative mapper use that
object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
} else if (elementType === BSON.BSON_DATA_BINARY) {
var binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
var totalBinarySize = binarySize;
var subType = buffer[index++];
// Did we have a negative binary size, throw
if (binarySize < 0) throw new Error('Negative binary type element size found');
// Is the length longer than the document
if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
// Decode as raw Buffer object if options specifies it
if (buffer['slice'] != null) {
// If we have subtype 2 skip the 4 bytes for the size
if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
}
if (promoteBuffers && promoteValues) {
object[name] = buffer.slice(index, index + binarySize);
} else {
object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
}
} else {
var _buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(binarySize)) : new Array(binarySize);
// If we have subtype 2 skip the 4 bytes for the size
if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
}
// Copy the data
for (i = 0; i < binarySize; i++) {
_buffer[i] = buffer[index + i];
}
if (promoteBuffers && promoteValues) {
object[name] = _buffer;
} else {
object[name] = new Binary(_buffer, subType);
}
}
// Update the index
index = index + binarySize;
} else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === false) {
// Get the start search index
i = index;
// Locate the end of the c string
while (buffer[i] !== 0x00 && i < buffer.length) {
i++;
}
// If are at the end of the buffer there is a problem with the document
if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
// Return the C string
var source = buffer.toString('utf8', index, i);
// Create the regexp
index = i + 1;
// Get the start search index
i = index;
// Locate the end of the c string
while (buffer[i] !== 0x00 && i < buffer.length) {
i++;
}
// If are at the end of the buffer there is a problem with the document
if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
// Return the C string
var regExpOptions = buffer.toString('utf8', index, i);
index = i + 1;
// For each option add the corresponding one for javascript
var optionsArray = new Array(regExpOptions.length);
// Parse options
for (i = 0; i < regExpOptions.length; i++) {
switch (regExpOptions[i]) {
case 'm':
optionsArray[i] = 'm';
break;
case 's':
optionsArray[i] = 'g';
break;
case 'i':
optionsArray[i] = 'i';
break;
}
}
object[name] = new RegExp(source, optionsArray.join(''));
} else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === true) {
// Get the start search index
i = index;
// Locate the end of the c string
while (buffer[i] !== 0x00 && i < buffer.length) {
i++;
}
// If are at the end of the buffer there is a problem with the document
if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
// Return the C string
source = buffer.toString('utf8', index, i);
index = i + 1;
// Get the start search index
i = index;
// Locate the end of the c string
while (buffer[i] !== 0x00 && i < buffer.length) {
i++;
}
// If are at the end of the buffer there is a problem with the document
if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
// Return the C string
regExpOptions = buffer.toString('utf8', index, i);
index = i + 1;
// Set the object
object[name] = new BSONRegExp(source, regExpOptions);
} else if (elementType === BSON.BSON_DATA_SYMBOL) {
stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
index = index + stringSize;
} else if (elementType === BSON.BSON_DATA_TIMESTAMP) {
lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
object[name] = new Timestamp(lowBits, highBits);
} else if (elementType === BSON.BSON_DATA_MIN_KEY) {
object[name] = new MinKey();
} else if (elementType === BSON.BSON_DATA_MAX_KEY) {
object[name] = new MaxKey();
} else if (elementType === BSON.BSON_DATA_CODE) {
stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
var functionString = buffer.toString('utf8', index, index + stringSize - 1);
// If we are evaluating the functions
if (evalFunctions) {
// If we have cache enabled let's look for the md5 of the function in the cache
if (cacheFunctions) {
var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
// Got to do this to avoid V8 deoptimizing the call due to finding eval
object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
} else {
object[name] = isolateEval(functionString);
}
} else {
object[name] = new Code(functionString);
}
// Update parse index position
index = index + stringSize;
} else if (elementType === BSON.BSON_DATA_CODE_W_SCOPE) {
var totalSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Element cannot be shorter than totalSize + stringSize + documentSize + terminator
if (totalSize < 4 + 4 + 4 + 1) {
throw new Error('code_w_scope total size shorter minimum expected length');
}
// Get the code string size
stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Check if we have a valid string
if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
// Javascript function
functionString = buffer.toString('utf8', index, index + stringSize - 1);
// Update parse index position
index = index + stringSize;
// Parse the element
_index = index;
// Decode the size of the object document
objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
// Decode the scope object
var scopeObject = deserializeObject(buffer, _index, options, false);
// Adjust the index
index = index + objectSize;
// Check if field length is to short
if (totalSize < 4 + 4 + objectSize + stringSize) {
throw new Error('code_w_scope total size is to short, truncating scope');
}
// Check if totalSize field is to long
if (totalSize > 4 + 4 + objectSize + stringSize) {
throw new Error('code_w_scope total size is to long, clips outer document');
}
// If we are evaluating the functions
if (evalFunctions) {
// If we have cache enabled let's look for the md5 of the function in the cache
if (cacheFunctions) {
hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
// Got to do this to avoid V8 deoptimizing the call due to finding eval
object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
} else {
object[name] = isolateEval(functionString);
}
object[name].scope = scopeObject;
} else {
object[name] = new Code(functionString, scopeObject);
}
} else if (elementType === BSON.BSON_DATA_DBPOINTER) {
// Get the code string size
stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
// Check if we have a valid string
if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
// Namespace
var namespace = buffer.toString('utf8', index, index + stringSize - 1);
// Update parse index position
index = index + stringSize;
// Read the oid
var oidBuffer = utils.allocBuffer(12);
buffer.copy(oidBuffer, 0, index, index + 12);
oid = new ObjectID(oidBuffer);
// Update the index
index = index + 12;
// Split the namespace
var parts = namespace.split('.');
var db = parts.shift();
var collection = parts.join('.');
// Upgrade to DBRef type
object[name] = new DBRef(collection, oid, db);
} else {
throw new Error('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '", are you using the latest BSON parser');
}
}
// Check if the deserialization was against a valid array/object
if (size !== index - startIndex) {
if (isArray) throw new Error('corrupt array bson');
throw new Error('corrupt object bson');
}
// Check if we have a db ref object
if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
return object;
};
/**
* Ensure eval is isolated.
*
* @ignore
* @api private
*/
var isolateEvalWithHash = function (functionCache, hash, functionString, object) {
// Contains the value we are going to set
var value = null;
// Check for cache hit, eval if missing and return cached function
if (functionCache[hash] == null) {
eval('value = ' + functionString);
functionCache[hash] = value;
}
// Set the object
return functionCache[hash].bind(object);
};
/**
* Ensure eval is isolated.
*
* @ignore
* @api private
*/
var isolateEval = function (functionString) {
// Contains the value we are going to set
var value = null;
// Eval the function
eval('value = ' + functionString);
return value;
};
var BSON = {};
/**
* Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
*
* @ignore
* @api private
*/
var functionCache = BSON.functionCache = {};
/**
* Number BSON Type
*
* @classconstant BSON_DATA_NUMBER
**/
BSON.BSON_DATA_NUMBER = 1;
/**
* String BSON Type
*
* @classconstant BSON_DATA_STRING
**/
BSON.BSON_DATA_STRING = 2;
/**
* Object BSON Type
*
* @classconstant BSON_DATA_OBJECT
**/
BSON.BSON_DATA_OBJECT = 3;
/**
* Array BSON Type
*
* @classconstant BSON_DATA_ARRAY
**/
BSON.BSON_DATA_ARRAY = 4;
/**
* Binary BSON Type
*
* @classconstant BSON_DATA_BINARY
**/
BSON.BSON_DATA_BINARY = 5;
/**
* Binary BSON Type
*
* @classconstant BSON_DATA_UNDEFINED
**/
BSON.BSON_DATA_UNDEFINED = 6;
/**
* ObjectID BSON Type
*
* @classconstant BSON_DATA_OID
**/
BSON.BSON_DATA_OID = 7;
/**
* Boolean BSON Type
*
* @classconstant BSON_DATA_BOOLEAN
**/
BSON.BSON_DATA_BOOLEAN = 8;
/**
* Date BSON Type
*
* @classconstant BSON_DATA_DATE
**/
BSON.BSON_DATA_DATE = 9;
/**
* null BSON Type
*
* @classconstant BSON_DATA_NULL
**/
BSON.BSON_DATA_NULL = 10;
/**
* RegExp BSON Type
*
* @classconstant BSON_DATA_REGEXP
**/
BSON.BSON_DATA_REGEXP = 11;
/**
* Code BSON Type
*
* @classconstant BSON_DATA_DBPOINTER
**/
BSON.BSON_DATA_DBPOINTER = 12;
/**
* Code BSON Type
*
* @classconstant BSON_DATA_CODE
**/
BSON.BSON_DATA_CODE = 13;
/**
* Symbol BSON Type
*
* @classconstant BSON_DATA_SYMBOL
**/
BSON.BSON_DATA_SYMBOL = 14;
/**
* Code with Scope BSON Type
*
* @classconstant BSON_DATA_CODE_W_SCOPE
**/
BSON.BSON_DATA_CODE_W_SCOPE = 15;
/**
* 32 bit Integer BSON Type
*
* @classconstant BSON_DATA_INT
**/
BSON.BSON_DATA_INT = 16;
/**
* Timestamp BSON Type
*
* @classconstant BSON_DATA_TIMESTAMP
**/
BSON.BSON_DATA_TIMESTAMP = 17;
/**
* Long BSON Type
*
* @classconstant BSON_DATA_LONG
**/
BSON.BSON_DATA_LONG = 18;
/**
* Long BSON Type
*
* @classconstant BSON_DATA_DECIMAL128
**/
BSON.BSON_DATA_DECIMAL128 = 19;
/**
* MinKey BSON Type
*
* @classconstant BSON_DATA_MIN_KEY
**/
BSON.BSON_DATA_MIN_KEY = 0xff;
/**
* MaxKey BSON Type
*
* @classconstant BSON_DATA_MAX_KEY
**/
BSON.BSON_DATA_MAX_KEY = 0x7f;
/**
* Binary Default Type
*
* @classconstant BSON_BINARY_SUBTYPE_DEFAULT
**/
BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
/**
* Binary Function Type
*
* @classconstant BSON_BINARY_SUBTYPE_FUNCTION
**/
BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
/**
* Binary Byte Array Type
*
* @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
**/
BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
/**
* Binary UUID Type
*
* @classconstant BSON_BINARY_SUBTYPE_UUID
**/
BSON.BSON_BINARY_SUBTYPE_UUID = 3;
/**
* Binary MD5 Type
*
* @classconstant BSON_BINARY_SUBTYPE_MD5
**/
BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
/**
* Binary User Defined Type
*
* @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
**/
BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
// BSON MAX VALUES
BSON.BSON_INT32_MAX = 0x7fffffff;
BSON.BSON_INT32_MIN = -0x80000000;
BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
BSON.BSON_INT64_MIN = -Math.pow(2, 63);
// JS MAX PRECISE VALUES
BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
// Internal long versions
var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
module.exports = deserialize;
/***/ }),
/* 358 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
var writeIEEE754 = __webpack_require__(359).writeIEEE754,
Long = __webpack_require__(335).Long,
Map = __webpack_require__(334),
Binary = __webpack_require__(356).Binary;
var normalizedFunctionString = __webpack_require__(344).normalizedFunctionString;
// try {
// var _Buffer = Uint8Array;
// } catch (e) {
// _Buffer = Buffer;
// }
var regexp = /\x00/; // eslint-disable-line no-control-regex
var ignoreKeys = ['$db', '$ref', '$id', '$clusterTime'];
// To ensure that 0.4 of node works correctly
var isDate = function isDate(d) {
return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
};
var isRegExp = function isRegExp(d) {
return Object.prototype.toString.call(d) === '[object RegExp]';
};
var serializeString = function (buffer, key, value, index, isArray) {
// Encode String type
buffer[index++] = BSON.BSON_DATA_STRING;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes + 1;
buffer[index - 1] = 0;
// Write the string
var size = buffer.write(value, index + 4, 'utf8');
// Write the size of the string to buffer
buffer[index + 3] = size + 1 >> 24 & 0xff;
buffer[index + 2] = size + 1 >> 16 & 0xff;
buffer[index + 1] = size + 1 >> 8 & 0xff;
buffer[index] = size + 1 & 0xff;
// Update index
index = index + 4 + size;
// Write zero
buffer[index++] = 0;
return index;
};
var serializeNumber = function (buffer, key, value, index, isArray) {
// We have an integer value
if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
// If the value fits in 32 bits encode as int, if it fits in a double
// encode it as a double, otherwise long
if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
// Set int type 32 bits or less
buffer[index++] = BSON.BSON_DATA_INT;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the int value
buffer[index++] = value & 0xff;
buffer[index++] = value >> 8 & 0xff;
buffer[index++] = value >> 16 & 0xff;
buffer[index++] = value >> 24 & 0xff;
} else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
// Encode as double
buffer[index++] = BSON.BSON_DATA_NUMBER;
// Number of written bytes
numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write float
writeIEEE754(buffer, value, index, 'little', 52, 8);
// Ajust index
index = index + 8;
} else {
// Set long type
buffer[index++] = BSON.BSON_DATA_LONG;
// Number of written bytes
numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
var longVal = Long.fromNumber(value);
var lowBits = longVal.getLowBits();
var highBits = longVal.getHighBits();
// Encode low bits
buffer[index++] = lowBits & 0xff;
buffer[index++] = lowBits >> 8 & 0xff;
buffer[index++] = lowBits >> 16 & 0xff;
buffer[index++] = lowBits >> 24 & 0xff;
// Encode high bits
buffer[index++] = highBits & 0xff;
buffer[index++] = highBits >> 8 & 0xff;
buffer[index++] = highBits >> 16 & 0xff;
buffer[index++] = highBits >> 24 & 0xff;
}
} else {
// Encode as double
buffer[index++] = BSON.BSON_DATA_NUMBER;
// Number of written bytes
numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write float
writeIEEE754(buffer, value, index, 'little', 52, 8);
// Ajust index
index = index + 8;
}
return index;
};
var serializeNull = function (buffer, key, value, index, isArray) {
// Set long type
buffer[index++] = BSON.BSON_DATA_NULL;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
return index;
};
var serializeBoolean = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_BOOLEAN;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Encode the boolean value
buffer[index++] = value ? 1 : 0;
return index;
};
var serializeDate = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_DATE;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the date
var dateInMilis = Long.fromNumber(value.getTime());
var lowBits = dateInMilis.getLowBits();
var highBits = dateInMilis.getHighBits();
// Encode low bits
buffer[index++] = lowBits & 0xff;
buffer[index++] = lowBits >> 8 & 0xff;
buffer[index++] = lowBits >> 16 & 0xff;
buffer[index++] = lowBits >> 24 & 0xff;
// Encode high bits
buffer[index++] = highBits & 0xff;
buffer[index++] = highBits >> 8 & 0xff;
buffer[index++] = highBits >> 16 & 0xff;
buffer[index++] = highBits >> 24 & 0xff;
return index;
};
var serializeRegExp = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_REGEXP;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
if (value.source && value.source.match(regexp) != null) {
throw Error('value ' + value.source + ' must not contain null bytes');
}
// Adjust the index
index = index + buffer.write(value.source, index, 'utf8');
// Write zero
buffer[index++] = 0x00;
// Write the parameters
if (value.global) buffer[index++] = 0x73; // s
if (value.ignoreCase) buffer[index++] = 0x69; // i
if (value.multiline) buffer[index++] = 0x6d; // m
// Add ending zero
buffer[index++] = 0x00;
return index;
};
var serializeBSONRegExp = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_REGEXP;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Check the pattern for 0 bytes
if (value.pattern.match(regexp) != null) {
// The BSON spec doesn't allow keys with null bytes because keys are
// null-terminated.
throw Error('pattern ' + value.pattern + ' must not contain null bytes');
}
// Adjust the index
index = index + buffer.write(value.pattern, index, 'utf8');
// Write zero
buffer[index++] = 0x00;
// Write the options
index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8');
// Add ending zero
buffer[index++] = 0x00;
return index;
};
var serializeMinMax = function (buffer, key, value, index, isArray) {
// Write the type of either min or max key
if (value === null) {
buffer[index++] = BSON.BSON_DATA_NULL;
} else if (value._bsontype === 'MinKey') {
buffer[index++] = BSON.BSON_DATA_MIN_KEY;
} else {
buffer[index++] = BSON.BSON_DATA_MAX_KEY;
}
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
return index;
};
var serializeObjectId = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_OID;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the objectId into the shared buffer
if (typeof value.id === 'string') {
buffer.write(value.id, index, 'binary');
} else if (value.id && value.id.copy) {
value.id.copy(buffer, index, 0, 12);
} else {
throw new Error('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
}
// Ajust index
return index + 12;
};
var serializeBuffer = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_BINARY;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Get size of the buffer (current write point)
var size = value.length;
// Write the size of the string to buffer
buffer[index++] = size & 0xff;
buffer[index++] = size >> 8 & 0xff;
buffer[index++] = size >> 16 & 0xff;
buffer[index++] = size >> 24 & 0xff;
// Write the default subtype
buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
// Copy the content form the binary field to the buffer
value.copy(buffer, index, 0, size);
// Adjust the index
index = index + size;
return index;
};
var serializeObject = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) {
for (var i = 0; i < path.length; i++) {
if (path[i] === value) throw new Error('cyclic dependency detected');
}
// Push value to stack
path.push(value);
// Write the type
buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
// Pop stack
path.pop();
// Write size
return endIndex;
};
var serializeDecimal128 = function (buffer, key, value, index, isArray) {
buffer[index++] = BSON.BSON_DATA_DECIMAL128;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the data from the value
value.bytes.copy(buffer, index, 0, 16);
return index + 16;
};
var serializeLong = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = value._bsontype === 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the date
var lowBits = value.getLowBits();
var highBits = value.getHighBits();
// Encode low bits
buffer[index++] = lowBits & 0xff;
buffer[index++] = lowBits >> 8 & 0xff;
buffer[index++] = lowBits >> 16 & 0xff;
buffer[index++] = lowBits >> 24 & 0xff;
// Encode high bits
buffer[index++] = highBits & 0xff;
buffer[index++] = highBits >> 8 & 0xff;
buffer[index++] = highBits >> 16 & 0xff;
buffer[index++] = highBits >> 24 & 0xff;
return index;
};
var serializeInt32 = function (buffer, key, value, index, isArray) {
// Set int type 32 bits or less
buffer[index++] = BSON.BSON_DATA_INT;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the int value
buffer[index++] = value & 0xff;
buffer[index++] = value >> 8 & 0xff;
buffer[index++] = value >> 16 & 0xff;
buffer[index++] = value >> 24 & 0xff;
return index;
};
var serializeDouble = function (buffer, key, value, index, isArray) {
// Encode as double
buffer[index++] = BSON.BSON_DATA_NUMBER;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write float
writeIEEE754(buffer, value, index, 'little', 52, 8);
// Ajust index
index = index + 8;
return index;
};
var serializeFunction = function (buffer, key, value, index, checkKeys, depth, isArray) {
buffer[index++] = BSON.BSON_DATA_CODE;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Function string
var functionString = normalizedFunctionString(value);
// Write the string
var size = buffer.write(functionString, index + 4, 'utf8') + 1;
// Write the size of the string to buffer
buffer[index] = size & 0xff;
buffer[index + 1] = size >> 8 & 0xff;
buffer[index + 2] = size >> 16 & 0xff;
buffer[index + 3] = size >> 24 & 0xff;
// Update index
index = index + 4 + size - 1;
// Write zero
buffer[index++] = 0;
return index;
};
var serializeCode = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) {
if (value.scope && typeof value.scope === 'object') {
// Write the type
buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Starting index
var startIndex = index;
// Serialize the function
// Get the function string
var functionString = typeof value.code === 'string' ? value.code : value.code.toString();
// Index adjustment
index = index + 4;
// Write string into buffer
var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
// Write the size of the string to buffer
buffer[index] = codeSize & 0xff;
buffer[index + 1] = codeSize >> 8 & 0xff;
buffer[index + 2] = codeSize >> 16 & 0xff;
buffer[index + 3] = codeSize >> 24 & 0xff;
// Write end 0
buffer[index + 4 + codeSize - 1] = 0;
// Write the
index = index + codeSize + 4;
//
// Serialize the scope value
var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined);
index = endIndex - 1;
// Writ the total
var totalSize = endIndex - startIndex;
// Write the total size of the object
buffer[startIndex++] = totalSize & 0xff;
buffer[startIndex++] = totalSize >> 8 & 0xff;
buffer[startIndex++] = totalSize >> 16 & 0xff;
buffer[startIndex++] = totalSize >> 24 & 0xff;
// Write trailing zero
buffer[index++] = 0;
} else {
buffer[index++] = BSON.BSON_DATA_CODE;
// Number of written bytes
numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Function string
functionString = value.code.toString();
// Write the string
var size = buffer.write(functionString, index + 4, 'utf8') + 1;
// Write the size of the string to buffer
buffer[index] = size & 0xff;
buffer[index + 1] = size >> 8 & 0xff;
buffer[index + 2] = size >> 16 & 0xff;
buffer[index + 3] = size >> 24 & 0xff;
// Update index
index = index + 4 + size - 1;
// Write zero
buffer[index++] = 0;
}
return index;
};
var serializeBinary = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_BINARY;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Extract the buffer
var data = value.value(true);
// Calculate size
var size = value.position;
// Add the deprecated 02 type 4 bytes of size to total
if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
// Write the size of the string to buffer
buffer[index++] = size & 0xff;
buffer[index++] = size >> 8 & 0xff;
buffer[index++] = size >> 16 & 0xff;
buffer[index++] = size >> 24 & 0xff;
// Write the subtype to the buffer
buffer[index++] = value.sub_type;
// If we have binary type 2 the 4 first bytes are the size
if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
size = size - 4;
buffer[index++] = size & 0xff;
buffer[index++] = size >> 8 & 0xff;
buffer[index++] = size >> 16 & 0xff;
buffer[index++] = size >> 24 & 0xff;
}
// Write the data to the object
data.copy(buffer, index, 0, value.position);
// Adjust the index
index = index + value.position;
return index;
};
var serializeSymbol = function (buffer, key, value, index, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_SYMBOL;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
// Write the string
var size = buffer.write(value.value, index + 4, 'utf8') + 1;
// Write the size of the string to buffer
buffer[index] = size & 0xff;
buffer[index + 1] = size >> 8 & 0xff;
buffer[index + 2] = size >> 16 & 0xff;
buffer[index + 3] = size >> 24 & 0xff;
// Update index
index = index + 4 + size - 1;
// Write zero
buffer[index++] = 0x00;
return index;
};
var serializeDBRef = function (buffer, key, value, index, depth, serializeFunctions, isArray) {
// Write the type
buffer[index++] = BSON.BSON_DATA_OBJECT;
// Number of written bytes
var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
// Encode the name
index = index + numberOfWrittenBytes;
buffer[index++] = 0;
var startIndex = index;
var endIndex;
// Serialize object
if (null != value.db) {
endIndex = serializeInto(buffer, {
$ref: value.namespace,
$id: value.oid,
$db: value.db
}, false, index, depth + 1, serializeFunctions);
} else {
endIndex = serializeInto(buffer, {
$ref: value.namespace,
$id: value.oid
}, false, index, depth + 1, serializeFunctions);
}
// Calculate object size
var size = endIndex - startIndex;
// Write the size
buffer[startIndex++] = size & 0xff;
buffer[startIndex++] = size >> 8 & 0xff;
buffer[startIndex++] = size >> 16 & 0xff;
buffer[startIndex++] = size >> 24 & 0xff;
// Set index
return endIndex;
};
var serializeInto = function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
startingIndex = startingIndex || 0;
path = path || [];
// Push the object to the path
path.push(object);
// Start place to serialize into
var index = startingIndex + 4;
// var self = this;
// Special case isArray
if (Array.isArray(object)) {
// Get object keys
for (var i = 0; i < object.length; i++) {
var key = '' + i;
var value = object[i];
// Is there an override value
if (value && value.toBSON) {
if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
value = value.toBSON();
}
var type = typeof value;
if (type === 'string') {
index = serializeString(buffer, key, value, index, true);
} else if (type === 'number') {
index = serializeNumber(buffer, key, value, index, true);
} else if (type === 'boolean') {
index = serializeBoolean(buffer, key, value, index, true);
} else if (value instanceof Date || isDate(value)) {
index = serializeDate(buffer, key, value, index, true);
} else if (value === undefined) {
index = serializeNull(buffer, key, value, index, true);
} else if (value === null) {
index = serializeNull(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
index = serializeObjectId(buffer, key, value, index, true);
} else if (Buffer.isBuffer(value)) {
index = serializeBuffer(buffer, key, value, index, true);
} else if (value instanceof RegExp || isRegExp(value)) {
index = serializeRegExp(buffer, key, value, index, true);
} else if (type === 'object' && value['_bsontype'] == null) {
index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path);
} else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
index = serializeDecimal128(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
index = serializeLong(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'Double') {
index = serializeDouble(buffer, key, value, index, true);
} else if (typeof value === 'function' && serializeFunctions) {
index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions, true);
} else if (value['_bsontype'] === 'Code') {
index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true);
} else if (value['_bsontype'] === 'Binary') {
index = serializeBinary(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'Symbol') {
index = serializeSymbol(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'DBRef') {
index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
} else if (value['_bsontype'] === 'BSONRegExp') {
index = serializeBSONRegExp(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'Int32') {
index = serializeInt32(buffer, key, value, index, true);
} else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
index = serializeMinMax(buffer, key, value, index, true);
} else if (typeof value['_bsontype'] !== 'undefined') {
throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
}
}
} else if (object instanceof Map) {
var iterator = object.entries();
var done = false;
while (!done) {
// Unpack the next entry
var entry = iterator.next();
done = entry.done;
// Are we done, then skip and terminate
if (done) continue;
// Get the entry values
key = entry.value[0];
value = entry.value[1];
// Check the type of the value
type = typeof value;
// Check the key and throw error if it's illegal
if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
if (key.match(regexp) != null) {
// The BSON spec doesn't allow keys with null bytes because keys are
// null-terminated.
throw Error('key ' + key + ' must not contain null bytes');
}
if (checkKeys) {
if ('$' === key[0]) {
throw Error('key ' + key + " must not start with '$'");
} else if (~key.indexOf('.')) {
throw Error('key ' + key + " must not contain '.'");
}
}
}
if (type === 'string') {
index = serializeString(buffer, key, value, index);
} else if (type === 'number') {
index = serializeNumber(buffer, key, value, index);
} else if (type === 'boolean') {
index = serializeBoolean(buffer, key, value, index);
} else if (value instanceof Date || isDate(value)) {
index = serializeDate(buffer, key, value, index);
// } else if (value === undefined && ignoreUndefined === true) {
} else if (value === null || value === undefined && ignoreUndefined === false) {
index = serializeNull(buffer, key, value, index);
} else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
index = serializeObjectId(buffer, key, value, index);
} else if (Buffer.isBuffer(value)) {
index = serializeBuffer(buffer, key, value, index);
} else if (value instanceof RegExp || isRegExp(value)) {
index = serializeRegExp(buffer, key, value, index);
} else if (type === 'object' && value['_bsontype'] == null) {
index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
} else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
index = serializeDecimal128(buffer, key, value, index);
} else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
index = serializeLong(buffer, key, value, index);
} else if (value['_bsontype'] === 'Double') {
index = serializeDouble(buffer, key, value, index);
} else if (value['_bsontype'] === 'Code') {
index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
} else if (typeof value === 'function' && serializeFunctions) {
index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
} else if (value['_bsontype'] === 'Binary') {
index = serializeBinary(buffer, key, value, index);
} else if (value['_bsontype'] === 'Symbol') {
index = serializeSymbol(buffer, key, value, index);
} else if (value['_bsontype'] === 'DBRef') {
index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
} else if (value['_bsontype'] === 'BSONRegExp') {
index = serializeBSONRegExp(buffer, key, value, index);
} else if (value['_bsontype'] === 'Int32') {
index = serializeInt32(buffer, key, value, index);
} else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
index = serializeMinMax(buffer, key, value, index);
} else if (typeof value['_bsontype'] !== 'undefined') {
throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
}
}
} else {
// Did we provide a custom serialization method
if (object.toBSON) {
if (typeof object.toBSON !== 'function') throw new Error('toBSON is not a function');
object = object.toBSON();
if (object != null && typeof object !== 'object') throw new Error('toBSON function did not return an object');
}
// Iterate over all the keys
for (key in object) {
value = object[key];
// Is there an override value
if (value && value.toBSON) {
if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
value = value.toBSON();
}
// Check the type of the value
type = typeof value;
// Check the key and throw error if it's illegal
if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
if (key.match(regexp) != null) {
// The BSON spec doesn't allow keys with null bytes because keys are
// null-terminated.
throw Error('key ' + key + ' must not contain null bytes');
}
if (checkKeys) {
if ('$' === key[0]) {
throw Error('key ' + key + " must not start with '$'");
} else if (~key.indexOf('.')) {
throw Error('key ' + key + " must not contain '.'");
}
}
}
if (type === 'string') {
index = serializeString(buffer, key, value, index);
} else if (type === 'number') {
index = serializeNumber(buffer, key, value, index);
} else if (type === 'boolean') {
index = serializeBoolean(buffer, key, value, index);
} else if (value instanceof Date || isDate(value)) {
index = serializeDate(buffer, key, value, index);
} else if (value === undefined) {
if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index);
} else if (value === null) {
index = serializeNull(buffer, key, value, index);
} else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
index = serializeObjectId(buffer, key, value, index);
} else if (Buffer.isBuffer(value)) {
index = serializeBuffer(buffer, key, value, index);
} else if (value instanceof RegExp || isRegExp(value)) {
index = serializeRegExp(buffer, key, value, index);
} else if (type === 'object' && value['_bsontype'] == null) {
index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
} else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
index = serializeDecimal128(buffer, key, value, index);
} else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
index = serializeLong(buffer, key, value, index);
} else if (value['_bsontype'] === 'Double') {
index = serializeDouble(buffer, key, value, index);
} else if (value['_bsontype'] === 'Code') {
index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
} else if (typeof value === 'function' && serializeFunctions) {
index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
} else if (value['_bsontype'] === 'Binary') {
index = serializeBinary(buffer, key, value, index);
} else if (value['_bsontype'] === 'Symbol') {
index = serializeSymbol(buffer, key, value, index);
} else if (value['_bsontype'] === 'DBRef') {
index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
} else if (value['_bsontype'] === 'BSONRegExp') {
index = serializeBSONRegExp(buffer, key, value, index);
} else if (value['_bsontype'] === 'Int32') {
index = serializeInt32(buffer, key, value, index);
} else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
index = serializeMinMax(buffer, key, value, index);
} else if (typeof value['_bsontype'] !== 'undefined') {
throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
}
}
}
// Remove the path
path.pop();
// Final padding byte for object
buffer[index++] = 0x00;
// Final size
var size = index - startingIndex;
// Write the size of the object
buffer[startingIndex++] = size & 0xff;
buffer[startingIndex++] = size >> 8 & 0xff;
buffer[startingIndex++] = size >> 16 & 0xff;
buffer[startingIndex++] = size >> 24 & 0xff;
return index;
};
var BSON = {};
/**
* Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
*
* @ignore
* @api private
*/
// var functionCache = (BSON.functionCache = {});
/**
* Number BSON Type
*
* @classconstant BSON_DATA_NUMBER
**/
BSON.BSON_DATA_NUMBER = 1;
/**
* String BSON Type
*
* @classconstant BSON_DATA_STRING
**/
BSON.BSON_DATA_STRING = 2;
/**
* Object BSON Type
*
* @classconstant BSON_DATA_OBJECT
**/
BSON.BSON_DATA_OBJECT = 3;
/**
* Array BSON Type
*
* @classconstant BSON_DATA_ARRAY
**/
BSON.BSON_DATA_ARRAY = 4;
/**
* Binary BSON Type
*
* @classconstant BSON_DATA_BINARY
**/
BSON.BSON_DATA_BINARY = 5;
/**
* ObjectID BSON Type, deprecated
*
* @classconstant BSON_DATA_UNDEFINED
**/
BSON.BSON_DATA_UNDEFINED = 6;
/**
* ObjectID BSON Type
*
* @classconstant BSON_DATA_OID
**/
BSON.BSON_DATA_OID = 7;
/**
* Boolean BSON Type
*
* @classconstant BSON_DATA_BOOLEAN
**/
BSON.BSON_DATA_BOOLEAN = 8;
/**
* Date BSON Type
*
* @classconstant BSON_DATA_DATE
**/
BSON.BSON_DATA_DATE = 9;
/**
* null BSON Type
*
* @classconstant BSON_DATA_NULL
**/
BSON.BSON_DATA_NULL = 10;
/**
* RegExp BSON Type
*
* @classconstant BSON_DATA_REGEXP
**/
BSON.BSON_DATA_REGEXP = 11;
/**
* Code BSON Type
*
* @classconstant BSON_DATA_CODE
**/
BSON.BSON_DATA_CODE = 13;
/**
* Symbol BSON Type
*
* @classconstant BSON_DATA_SYMBOL
**/
BSON.BSON_DATA_SYMBOL = 14;
/**
* Code with Scope BSON Type
*
* @classconstant BSON_DATA_CODE_W_SCOPE
**/
BSON.BSON_DATA_CODE_W_SCOPE = 15;
/**
* 32 bit Integer BSON Type
*
* @classconstant BSON_DATA_INT
**/
BSON.BSON_DATA_INT = 16;
/**
* Timestamp BSON Type
*
* @classconstant BSON_DATA_TIMESTAMP
**/
BSON.BSON_DATA_TIMESTAMP = 17;
/**
* Long BSON Type
*
* @classconstant BSON_DATA_LONG
**/
BSON.BSON_DATA_LONG = 18;
/**
* Long BSON Type
*
* @classconstant BSON_DATA_DECIMAL128
**/
BSON.BSON_DATA_DECIMAL128 = 19;
/**
* MinKey BSON Type
*
* @classconstant BSON_DATA_MIN_KEY
**/
BSON.BSON_DATA_MIN_KEY = 0xff;
/**
* MaxKey BSON Type
*
* @classconstant BSON_DATA_MAX_KEY
**/
BSON.BSON_DATA_MAX_KEY = 0x7f;
/**
* Binary Default Type
*
* @classconstant BSON_BINARY_SUBTYPE_DEFAULT
**/
BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
/**
* Binary Function Type
*
* @classconstant BSON_BINARY_SUBTYPE_FUNCTION
**/
BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
/**
* Binary Byte Array Type
*
* @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
**/
BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
/**
* Binary UUID Type
*
* @classconstant BSON_BINARY_SUBTYPE_UUID
**/
BSON.BSON_BINARY_SUBTYPE_UUID = 3;
/**
* Binary MD5 Type
*
* @classconstant BSON_BINARY_SUBTYPE_MD5
**/
BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
/**
* Binary User Defined Type
*
* @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
**/
BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
// BSON MAX VALUES
BSON.BSON_INT32_MAX = 0x7fffffff;
BSON.BSON_INT32_MIN = -0x80000000;
BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
BSON.BSON_INT64_MIN = -Math.pow(2, 63);
// JS MAX PRECISE VALUES
BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
// Internal long versions
// var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
// var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
module.exports = serializeInto;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
/***/ }),
/* 359 */
/***/ (function(module, exports) {
// Copyright (c) 2008, Fair Oaks Labs, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//
// Modifications to writeIEEE754 to support negative zeroes made by Brian White
var readIEEE754 = function (buffer, offset, endian, mLen, nBytes) {
var e,
m,
bBE = endian === 'big',
eLen = nBytes * 8 - mLen - 1,
eMax = (1 << eLen) - 1,
eBias = eMax >> 1,
nBits = -7,
i = bBE ? 0 : nBytes - 1,
d = bBE ? 1 : -1,
s = buffer[offset + i];
i += d;
e = s & (1 << -nBits) - 1;
s >>= -nBits;
nBits += eLen;
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : (s ? -1 : 1) * Infinity;
} else {
m = m + Math.pow(2, mLen);
e = e - eBias;
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
};
var writeIEEE754 = function (buffer, value, offset, endian, mLen, nBytes) {
var e,
m,
c,
bBE = endian === 'big',
eLen = nBytes * 8 - mLen - 1,
eMax = (1 << eLen) - 1,
eBias = eMax >> 1,
rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
i = bBE ? nBytes - 1 : 0,
d = bBE ? -1 : 1,
s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
value = Math.abs(value);
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0;
e = eMax;
} else {
e = Math.floor(Math.log(value) / Math.LN2);
if (value * (c = Math.pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * Math.pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * Math.pow(2, mLen);
e = e + eBias;
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
e = e << mLen | m;
eLen += mLen;
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
buffer[offset + i - d] |= s * 128;
};
exports.readIEEE754 = readIEEE754;
exports.writeIEEE754 = writeIEEE754;
/***/ }),
/* 360 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
var Long = __webpack_require__(335).Long,
Double = __webpack_require__(336).Double,
Timestamp = __webpack_require__(337).Timestamp,
ObjectID = __webpack_require__(338).ObjectID,
Symbol = __webpack_require__(349).Symbol,
BSONRegExp = __webpack_require__(348).BSONRegExp,
Code = __webpack_require__(351).Code,
Decimal128 = __webpack_require__(352),
MinKey = __webpack_require__(353).MinKey,
MaxKey = __webpack_require__(354).MaxKey,
DBRef = __webpack_require__(355).DBRef,
Binary = __webpack_require__(356).Binary;
var normalizedFunctionString = __webpack_require__(344).normalizedFunctionString;
// To ensure that 0.4 of node works correctly
var isDate = function isDate(d) {
return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
};
var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
var totalLength = 4 + 1;
if (Array.isArray(object)) {
for (var i = 0; i < object.length; i++) {
totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
}
} else {
// If we have toBSON defined, override the current object
if (object.toBSON) {
object = object.toBSON();
}
// Calculate size
for (var key in object) {
totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
}
}
return totalLength;
};
/**
* @ignore
* @api private
*/
function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
// If we have toBSON defined, override the current object
if (value && value.toBSON) {
value = value.toBSON();
}
switch (typeof value) {
case 'string':
return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
case 'number':
if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
// 32 bit
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
} else {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
}
} else {
// 64 bit
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
}
case 'undefined':
if (isArray || !ignoreUndefined) return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
return 0;
case 'boolean':
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
case 'object':
if (value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
} else if (value instanceof ObjectID || value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
} else if (value instanceof Date || isDate(value)) {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
} else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length;
} else if (value instanceof Long || value instanceof Double || value instanceof Timestamp || value['_bsontype'] === 'Long' || value['_bsontype'] === 'Double' || value['_bsontype'] === 'Timestamp') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
} else if (value instanceof Decimal128 || value['_bsontype'] === 'Decimal128') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
} else if (value instanceof Code || value['_bsontype'] === 'Code') {
// Calculate size depending on the availability of a scope
if (value.scope != null && Object.keys(value.scope).length > 0) {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
} else {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
}
} else if (value instanceof Binary || value['_bsontype'] === 'Binary') {
// Check what kind of subtype we have
if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1 + 4);
} else {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1);
}
} else if (value instanceof Symbol || value['_bsontype'] === 'Symbol') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
} else if (value instanceof DBRef || value['_bsontype'] === 'DBRef') {
// Set up correct object for serialization
var ordered_values = {
$ref: value.namespace,
$id: value.oid
};
// Add db reference if it exists
if (null != value.db) {
ordered_values['$db'] = value.db;
}
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
} else if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
} else if (value instanceof BSONRegExp || value['_bsontype'] === 'BSONRegExp') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1 + Buffer.byteLength(value.options, 'utf8') + 1;
} else {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
}
case 'function':
// WTF for 0.4.X where typeof /someregexp/ === 'function'
if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) === '[object RegExp]') {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
} else {
if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
} else if (serializeFunctions) {
return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1;
}
}
}
return 0;
}
var BSON = {};
// BSON MAX VALUES
BSON.BSON_INT32_MAX = 0x7fffffff;
BSON.BSON_INT32_MIN = -0x80000000;
// JS MAX PRECISE VALUES
BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
module.exports = calculateObjectSize;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
/***/ })
/******/ ])
});
;
|
"use strict";
var _toolsProtectJs2 = require("./../../tools/protect.js");
var _toolsProtectJs3 = _interopRequireDefault(_toolsProtectJs2);
exports.__esModule = true;
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _messages = require("../../messages");
var messages = _interopRequireWildcard(_messages);
var _libRemaps = require("./lib/remaps");
var _libRemaps2 = _interopRequireDefault(_libRemaps);
var _lodashObjectExtend = require("lodash/object/extend");
var _lodashObjectExtend2 = _interopRequireDefault(_lodashObjectExtend);
var _helpersObject = require("../../helpers/object");
var _helpersObject2 = _interopRequireDefault(_helpersObject);
var _util = require("../../util");
var util = _interopRequireWildcard(_util);
var _types = require("../../types");
var t = _interopRequireWildcard(_types);
_toolsProtectJs3["default"](module);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var metadataVisitor = {
ModuleDeclaration: {
enter: function enter(node, parent, scope, formatter) {
if (node.source) {
node.source.value = formatter.file.resolveModuleSource(node.source.value);
formatter.addScope(this);
}
}
},
ImportDeclaration: {
exit: function exit(node, parent, scope, formatter) {
formatter.hasLocalImports = true;
var specifiers = [];
var imported = [];
formatter.metadata.imports.push({
source: node.source.value,
imported: imported,
specifiers: specifiers
});
var _arr = this.get("specifiers");
for (var _i = 0; _i < _arr.length; _i++) {
var specifier = _arr[_i];
var ids = specifier.getBindingIdentifiers();
_lodashObjectExtend2["default"](formatter.localImports, ids);
var local = specifier.node.local.name;
if (specifier.isImportDefaultSpecifier()) {
imported.push("default");
specifiers.push({
kind: "named",
imported: "default",
local: local
});
}
if (specifier.isImportSpecifier()) {
var importedName = specifier.node.imported.name;
imported.push(importedName);
specifiers.push({
kind: "named",
imported: importedName,
local: local
});
}
if (specifier.isImportNamespaceSpecifier()) {
imported.push("*");
specifiers.push({
kind: "namespace",
local: local
});
}
}
}
},
ExportDeclaration: function ExportDeclaration(node, parent, scope, formatter) {
formatter.hasLocalExports = true;
var source = node.source ? node.source.value : null;
var exports = formatter.metadata.exports;
// export function foo() {}
// export var foo = "bar";
var declar = this.get("declaration");
if (declar.isStatement()) {
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
var binding = bindings[name];
formatter._addExport(name, binding);
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
exported: this.isExportDefaultDeclaration() ? "default" : name
});
}
}
if (this.isExportNamedDeclaration() && node.specifiers) {
var _arr2 = node.specifiers;
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
var specifier = _arr2[_i2];
var exported = specifier.exported.name;
exports.exported.push(exported);
// export foo from "bar";
if (t.isExportDefaultSpecifier(specifier)) {
exports.specifiers.push({
kind: "external",
local: exported,
exported: exported,
source: source
});
}
// export * as foo from "bar";
if (t.isExportNamespaceSpecifier(specifier)) {
exports.specifiers.push({
kind: "external-namespace",
exported: exported,
source: source
});
}
var local = specifier.local;
if (!local) continue;
formatter._addExport(local.name, specifier.exported);
// export { foo } from "bar";
// export { foo as bar } from "bar";
if (source) {
exports.specifiers.push({
kind: "external",
local: local.name,
exported: exported,
source: source
});
}
// export { foo };
// export { foo as bar };
if (!source) {
exports.specifiers.push({
kind: "local",
local: local.name,
exported: exported
});
}
}
}
// export * from "bar";
if (this.isExportAllDeclaration()) {
exports.specifiers.push({
kind: "external-all",
source: source
});
}
if (!t.isExportDefaultDeclaration(node) && !declar.isTypeAlias()) {
var onlyDefault = node.specifiers && node.specifiers.length === 1 && t.isSpecifierDefault(node.specifiers[0]);
if (!onlyDefault) {
formatter.hasNonDefaultExports = true;
}
}
},
Scope: function Scope(node, parent, scope, formatter) {
if (!formatter.isLoose()) {
this.skip();
}
}
};
var DefaultFormatter = (function () {
function DefaultFormatter(file) {
_classCallCheck(this, DefaultFormatter);
// object containg all module sources with the scope that they're contained in
this.sourceScopes = _helpersObject2["default"]();
// ids for use in module ids
this.defaultIds = _helpersObject2["default"]();
this.ids = _helpersObject2["default"]();
// contains reference aliases for live bindings
this.remaps = new _libRemaps2["default"](file, this);
this.scope = file.scope;
this.file = file;
this.hasNonDefaultExports = false;
this.hasLocalExports = false;
this.hasLocalImports = false;
this.localExports = _helpersObject2["default"]();
this.localImports = _helpersObject2["default"]();
this.metadata = file.metadata.modules;
this.getMetadata();
}
DefaultFormatter.prototype.addScope = function addScope(path) {
var source = path.node.source && path.node.source.value;
if (!source) return;
var existingScope = this.sourceScopes[source];
if (existingScope && existingScope !== path.scope) {
throw path.errorWithNode(messages.get("modulesDuplicateDeclarations"));
}
this.sourceScopes[source] = path.scope;
};
DefaultFormatter.prototype.isModuleType = function isModuleType(node, type) {
var modules = this.file.dynamicImportTypes[type];
return modules && modules.indexOf(node) >= 0;
};
DefaultFormatter.prototype.transform = function transform() {
this.remapAssignments();
};
DefaultFormatter.prototype.doDefaultExportInterop = function doDefaultExportInterop(node) {
return (t.isExportDefaultDeclaration(node) || t.isSpecifierDefault(node)) && !this.noInteropRequireExport && !this.hasNonDefaultExports;
};
DefaultFormatter.prototype.getMetadata = function getMetadata() {
var has = false;
var _arr3 = this.file.ast.program.body;
for (var _i3 = 0; _i3 < _arr3.length; _i3++) {
var node = _arr3[_i3];
if (t.isModuleDeclaration(node)) {
has = true;
break;
}
}
if (has || this.isLoose()) {
this.file.path.traverse(metadataVisitor, this);
}
};
DefaultFormatter.prototype.remapAssignments = function remapAssignments() {
if (this.hasLocalExports || this.hasLocalImports) {
this.remaps.run();
}
};
DefaultFormatter.prototype.remapExportAssignment = function remapExportAssignment(node, exported) {
var assign = node;
for (var i = 0; i < exported.length; i++) {
assign = t.assignmentExpression("=", t.memberExpression(t.identifier("exports"), exported[i]), assign);
}
return assign;
};
DefaultFormatter.prototype._addExport = function _addExport(name, exported) {
var info = this.localExports[name] = this.localExports[name] || {
binding: this.scope.getBindingIdentifier(name),
exported: []
};
info.exported.push(exported);
};
DefaultFormatter.prototype.getExport = function getExport(node, scope) {
if (!t.isIdentifier(node)) return;
var local = this.localExports[node.name];
if (local && local.binding === scope.getBindingIdentifier(node.name)) {
return local.exported;
}
};
DefaultFormatter.prototype.getModuleName = function getModuleName() {
var opts = this.file.opts;
// moduleId is n/a if a `getModuleId()` is provided
if (opts.moduleId && !opts.getModuleId) {
return opts.moduleId;
}
var filenameRelative = opts.filenameRelative;
var moduleName = "";
if (opts.moduleRoot) {
moduleName = opts.moduleRoot + "/";
}
if (!opts.filenameRelative) {
return moduleName + opts.filename.replace(/^\//, "");
}
if (opts.sourceRoot) {
// remove sourceRoot from filename
var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "/?");
filenameRelative = filenameRelative.replace(sourceRootRegEx, "");
}
if (!opts.keepModuleIdExtensions) {
// remove extension
filenameRelative = filenameRelative.replace(/\.(\w*?)$/, "");
}
moduleName += filenameRelative;
// normalize path separators
moduleName = moduleName.replace(/\\/g, "/");
if (opts.getModuleId) {
// If return is falsy, assume they want us to use our generated default name
return opts.getModuleId(moduleName) || moduleName;
} else {
return moduleName;
}
};
DefaultFormatter.prototype._pushStatement = function _pushStatement(ref, nodes) {
if (t.isClass(ref) || t.isFunction(ref)) {
if (ref.id) {
nodes.push(t.toStatement(ref));
ref = ref.id;
}
}
return ref;
};
DefaultFormatter.prototype._hoistExport = function _hoistExport(declar, assign, priority) {
if (t.isFunctionDeclaration(declar)) {
assign._blockHoist = priority || 2;
}
return assign;
};
DefaultFormatter.prototype.getExternalReference = function getExternalReference(node, nodes) {
var ids = this.ids;
var id = node.source.value;
if (ids[id]) {
return ids[id];
} else {
return this.ids[id] = this._getExternalReference(node, nodes);
}
};
DefaultFormatter.prototype.checkExportIdentifier = function checkExportIdentifier(node) {
if (t.isIdentifier(node, { name: "__esModule" })) {
throw this.file.errorWithNode(node, messages.get("modulesIllegalExportName", node.name));
}
};
DefaultFormatter.prototype.exportAllDeclaration = function exportAllDeclaration(node, nodes) {
var ref = this.getExternalReference(node, nodes);
nodes.push(this.buildExportsWildcard(ref, node));
};
DefaultFormatter.prototype.isLoose = function isLoose() {
return this.file.isLoose("es6.modules");
};
DefaultFormatter.prototype.exportSpecifier = function exportSpecifier(specifier, node, nodes) {
if (node.source) {
var ref = this.getExternalReference(node, nodes);
if (specifier.local.name === "default" && !this.noInteropRequireExport) {
// importing a default so we need to normalize it
ref = t.callExpression(this.file.addHelper("interop-require"), [ref]);
} else {
ref = t.memberExpression(ref, specifier.local);
if (!this.isLoose()) {
nodes.push(this.buildExportsFromAssignment(specifier.exported, ref, node));
return;
}
}
// export { foo } from "test";
nodes.push(this.buildExportsAssignment(specifier.exported, ref, node));
} else {
// export { foo };
nodes.push(this.buildExportsAssignment(specifier.exported, specifier.local, node));
}
};
DefaultFormatter.prototype.buildExportsWildcard = function buildExportsWildcard(objectIdentifier) {
return t.expressionStatement(t.callExpression(this.file.addHelper("defaults"), [t.identifier("exports"), t.callExpression(this.file.addHelper("interop-require-wildcard"), [objectIdentifier])]));
};
DefaultFormatter.prototype.buildExportsFromAssignment = function buildExportsFromAssignment(id, init) {
this.checkExportIdentifier(id);
return util.template("exports-from-assign", {
INIT: init,
ID: t.literal(id.name)
}, true);
};
DefaultFormatter.prototype.buildExportsAssignment = function buildExportsAssignment(id, init) {
this.checkExportIdentifier(id);
return util.template("exports-assign", {
VALUE: init,
KEY: id
}, true);
};
DefaultFormatter.prototype.exportDeclaration = function exportDeclaration(node, nodes) {
var declar = node.declaration;
var id = declar.id;
if (t.isExportDefaultDeclaration(node)) {
id = t.identifier("default");
}
var assign;
if (t.isVariableDeclaration(declar)) {
for (var i = 0; i < declar.declarations.length; i++) {
var decl = declar.declarations[i];
decl.init = this.buildExportsAssignment(decl.id, decl.init, node).expression;
var newDeclar = t.variableDeclaration(declar.kind, [decl]);
if (i === 0) t.inherits(newDeclar, declar);
nodes.push(newDeclar);
}
} else {
var ref = declar;
if (t.isFunctionDeclaration(declar) || t.isClassDeclaration(declar)) {
ref = declar.id;
nodes.push(declar);
}
assign = this.buildExportsAssignment(id, ref, node);
nodes.push(assign);
this._hoistExport(declar, assign);
}
};
return DefaultFormatter;
})();
exports["default"] = DefaultFormatter;
module.exports = exports["default"];
|
import PropTypes from "prop-types"
import React from "react"
import _AuctionInfoDesktop from "./AuctionInfoDesktop"
import _AuctionInfoMobile from "./AuctionInfoMobile"
import { connect } from "react-redux"
// FIXME: Rewire
let AuctionInfoDesktop = _AuctionInfoDesktop
let AuctionInfoMobile = _AuctionInfoMobile
function AuctionInfoContainer({ isMobile }) {
return isMobile ? <AuctionInfoMobile /> : <AuctionInfoDesktop />
}
AuctionInfoContainer.propTypes = {
isMobile: PropTypes.bool.isRequired,
}
const mapStateToProps = state => ({
isMobile: state.app.isMobile,
})
export default connect(mapStateToProps)(AuctionInfoContainer)
export const test = { AuctionInfoContainer }
|
var parse = require('../parse/index.js')
/**
* @category Hour Helpers
* @summary Set the hours to the given date.
*
* @description
* Set the hours to the given date.
*
* @param {Date|String|Number} date - the date to be changed
* @param {Number} hours - the hours of the new date
* @returns {Date} the new date with the hours setted
*
* @example
* // Set 4 hours to 1 September 2014 11:30:00:
* var result = setHours(new Date(2014, 8, 1, 11, 30), 4)
* //=> Mon Sep 01 2014 04:30:00
*/
function setHours (dirtyDate, hours) {
var date = parse(dirtyDate)
date.setHours(hours)
return date
}
module.exports = setHours
|
var assert = require('assert');
var editor = require('./stubs/editor');
var cssGradient = require('../lib/resolver/cssGradient');
var prefs = require('../lib/assets/preferences');
var ciu = require('../lib/assets/caniuse');
var expandAbbreviation = require('../lib/action/expandAbbreviation');
var reflectValue = require('../lib/action/reflectCSSValue');
var gradient = require('../lib/resolver/gradient/linear');
describe('CSS Gradient', function() {
var _ciuEnabled = null;
function restoreCIU() {
prefs.set('caniuse.enabled', _ciuEnabled);
}
function disableCIU() {
_ciuEnabled = prefs.get('caniuse.enabled');
prefs.set('caniuse.enabled', false);
}
it('should parse linear gradient', function() {
var g = gradient.parse('linear-gradient(top left, white , #a6f2c0 30%, rgba(180, 200, 210, .9) .8, black 10em)');
assert.equal(g.type, 'linear-gradient');
assert.equal(g.direction, 135);
assert.equal(g.colorStops.length, 4);
assert.equal(g.stringify(), 'linear-gradient(to bottom right, white, #a6f2c0 30%, rgba(180, 200, 210, .9) .8, black 10em)');
assert.equal(g.stringify({prefix: 'moz'}), '-moz-linear-gradient(top left, white, #a6f2c0 30%, rgba(180, 200, 210, .9) .8, black 10em)');
// test old Webkit syntax
g = gradient.parse('lg(red, black)');
assert.equal(g.stringifyOldWebkit(), '-webkit-gradient(linear, 0 0, 0 100%, from(red), to(black))');
g = gradient.parse('-webkit-linear-gradient(red, black)');
assert.equal(g.direction, 180);
assert.equal(g.colorStops.length, 2);
});
it('should expand abbreviation as "Expand Abbreviation" handler', function() {
disableCIU();
var run = function(content) {
if (content) {
editor.replaceContent(content);
}
expandAbbreviation.expandAbbreviationAction(editor);
};
editor.setSyntax('css');
run('.r{\n\tlg(right, red, black)$0\n}');
assert.equal(editor.getContent(), '.r{\n\tbackground-image: -webkit-linear-gradient(right, red, black);\n\tbackground-image: -moz-linear-gradient(right, red, black);\n\tbackground-image: -o-linear-gradient(right, red, black);\n\tbackground-image: linear-gradient(to left, red, black);\n}');
run('.r{background:lg(red, black)$0}');
assert.equal(editor.getContent(), '.r{background:-webkit-linear-gradient(red, black);background:-moz-linear-gradient(red, black);background:-o-linear-gradient(red, black);background:linear-gradient(red, black);}');
assert.equal(editor.getCaretPos(), 174);
// expand gradient outside value
run('.r{\n\tlg(red, black)$0\n}');
assert.equal(editor.getContent(), '.r{\n\tbackground-image: -webkit-linear-gradient(red, black);\n\tbackground-image: -moz-linear-gradient(red, black);\n\tbackground-image: -o-linear-gradient(red, black);\n\tbackground-image: linear-gradient(red, black);\n}');
// test fallback value
prefs.set('css.gradient.fallback', true);
run('.r{\n\tlg(red, black)$0\n}');
assert.equal(editor.getContent(), '.r{\n\tbackground-color: red;\n\tbackground-image: -webkit-linear-gradient(red, black);\n\tbackground-image: -moz-linear-gradient(red, black);\n\tbackground-image: -o-linear-gradient(red, black);\n\tbackground-image: linear-gradient(red, black);\n}');
prefs.set('css.gradient.fallback', false);
// test gradients without prefixes
var prefixes = prefs.get('css.gradient.prefixes');
prefs.set('css.gradient.prefixes', null);
run('.r{background:lg(red, black)$0}');
assert.equal(editor.getContent(), '.r{background:linear-gradient(red, black);}');
prefs.set('css.gradient.prefixes', prefixes);
editor.setSyntax('html');
restoreCIU();
});
it('should run as "Reflect CSS Value" action delegate', function() {
editor.setSyntax('css');
editor.replaceContent('.r{a:test;a:linear-gradient(red, green$0);a:-moz-linear-gradient(red, black);p:1}');
reflectValue.reflectCSSValueAction(editor);
assert.equal(editor.getContent(), '.r{a:test;a:linear-gradient(red, green);a:-moz-linear-gradient(red, green);p:1}');
editor.setSyntax('html');
});
it('should parse multiple gradients', function() {
editor.setSyntax('css');
disableCIU();
var run = function(content) {
if (content) {
editor.replaceContent(content);
}
expandAbbreviation.expandAbbreviationAction(editor);
};
run('.r{background:lg(red, black), lg(yellow, blue)$0}');
assert.equal(editor.getContent(), '.r{background:-webkit-linear-gradient(red, black), -webkit-linear-gradient(yellow, blue);background:-moz-linear-gradient(red, black), -moz-linear-gradient(yellow, blue);background:-o-linear-gradient(red, black), -o-linear-gradient(yellow, blue);background:linear-gradient(red, black), linear-gradient(yellow, blue);}');
assert.equal(editor.getCaretPos(), 314);
run('.r{background:lg(red, black), skip, lg(yellow, blue)$0}');
assert.equal(editor.getContent(), '.r{background:-webkit-linear-gradient(red, black), skip, -webkit-linear-gradient(yellow, blue);background:-moz-linear-gradient(red, black), skip, -moz-linear-gradient(yellow, blue);background:-o-linear-gradient(red, black), skip, -o-linear-gradient(yellow, blue);background:linear-gradient(red, black), skip, linear-gradient(yellow, blue);}');
assert.equal(editor.getCaretPos(), 338);
// reflect CSS value
editor.replaceContent('.r{a:test;a:linear-gradient(red, green$0), skip, linear-gradient(yellow, blue);a:-moz-linear-gradient(red, black);p:1}');
reflectValue.reflectCSSValueAction(editor);
assert.equal(editor.getContent(), '.r{a:test;a:linear-gradient(red, green), skip, linear-gradient(yellow, blue);a:-moz-linear-gradient(red, green), skip, -moz-linear-gradient(yellow, blue);p:1}');
restoreCIU();
editor.setSyntax('html');
});
it('should not expand mixins', function() {
// https://github.com/sergeche/emmet-sublime/issues/411
editor.setSyntax('stylus');
var run = function(content) {
if (content) {
editor.replaceContent(content);
}
expandAbbreviation.expandAbbreviationAction(editor);
};
run('.r{\n\theight: 10px$0\n\tlg(red, black)\n}');
assert.equal(editor.getContent(), '.r{\n\theight: 10px\n\tlg(red, black)\n}');
editor.setSyntax('html');
});
});
|
version https://git-lfs.github.com/spec/v1
oid sha256:7370c29cd358584f713482cdb33108019364b28cefb5bf949e68cfb1a304b480
size 4738
|
version https://git-lfs.github.com/spec/v1
oid sha256:9f4d081d68eccc16308411bbfc5a5eb3e44d5c561877c5f1bedbf0184a565b7c
size 3524
|
/**
* This file defines the email tests for your project.
*
* Each email test should provide the locals used to render the
* email template for preview.
*
* Values can either be an object (for simple tests), or a
* function that calls a callback(err, locals).
*
* Sample generated emails, based on the keys and methods below,
* can be previewed at /keystone/test-email/{key}
*/
var keystone = require('keystone');
module.exports = {
/** New Enquiry Notifications */
'enquiry-notification': function(req, res, callback) {
// To test enquiry notifications we create a dummy enquiry that
// is not saved to the database, but passed to the template.
var Enquiry = keystone.list('Enquiry');
var newEnquiry = new Enquiry.model({
name: { first: 'Test', last: 'User' },
email: 'contact@keystonejs.com',
phone: '+61 2 1234 5678',
enquiryType: 'message',
message: { md: 'Nice enquiry notification.' }
});
callback(null, {
admin: 'Admin User',
enquiry: newEnquiry,
enquiry_url: '/keystone/enquiries/'
});
}
};
|
// @flow strict
import React from 'react';
import renderer from 'react-test-renderer';
import Meta from './Meta';
describe('Meta', () => {
it('renders correctly', () => {
const props = {
date: '2016-09-01'
};
const tree = renderer.create(<Meta {...props} />).toJSON();
expect(tree).toMatchSnapshot();
});
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.