code
stringlengths
2
1.05M
repo_name
stringlengths
5
114
path
stringlengths
4
991
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
'use strict'; // prePublish gets run on 'npm install' (e.g. even if you aren't actually publishing) // so we have to check to make sure that we are in our own directory and this isn't // some poor user trying to install our package. var path = require('path'); var fs = require('fs'); var rootDirectory = path.join(__dirname, "../../"); if (path.basename(rootDirectory) != "Thali_CordovaPlugin") { process.exit(0); } var readMeFileName = "readme.md"; var parentReadMe = path.join(__dirname, "../../", readMeFileName); var localReadMe = path.join(__dirname, "../", readMeFileName); fs.writeFileSync(localReadMe, fs.readFileSync(parentReadMe)); process.exit(0);
thaliproject/CITest
thali/install/prePublishThaliCordovaPlugin.js
JavaScript
mit
665
import React, { Component } from 'react'; import classnames from 'classnames'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import LinearProgress from 'material-ui/LinearProgress'; import history from '../../core/history'; import Link from '../../components/Link/Link'; import Image from '../../components/Image'; import { Grid, Row, Col, ListGroup, ListGroupItem } from 'react-bootstrap'; import { AutoAffix } from 'react-overlays'; import s from './SystemsList.css'; import configs from '../../config/systems.json'; const System = ({name, title, image, available, visible, onClick}) => { const classNames = classnames(s.availabilityCheckIcon, "fa", available ? 'fa-check' : 'fa-close', available ? s.available : s.unavailable); return ( <div key={`system-${name}`} className={classnames(s.system, !visible ? s.hidden : s.show )} onClick={() => onClick(`/system/${name}`)} > <Image src={image} alt={title} /> <div className={s.systemTitle}>{title}</div> <i className={classNames} /> </div> ) }; class Systems extends Component { constructor(...props) { super(...props); this.state = { show: 'available' }; this.onHandleClick = ::this.onHandleClick; this.filter = ::this.filter; } onHandleClick(url) { history.push(url); } filter(system) { const { checkList } = this.props; if (this.state.show == 'all') { return true; } else if (this.state.show == 'available' && checkList[system.name]) { return true; } else if (this.state.show == 'not_available' && !checkList[system.name]) { return true; } return false; } setFilter(filter) { this.setState({ show: filter }); } renderSystems() { const { isChecking, checkList } = this.props; if (isChecking || checkList == undefined) { return (<LinearProgress />); } return ( <Row className={s.list}> <Col xs={12} md={8}> { configs.map((system) => { const isAvailable = checkList[system.name]; const isVisible = this.filter(system); return ( <System key={`emu-${system.name}`} {...system} available={isAvailable} visible={isVisible} onClick={this.onHandleClick} /> ) }) } </Col> <Col xs={6} md={3}> <AutoAffix viewportOffsetTop={15} container={this}> <ListGroup> <ListGroupItem onClick={this.setFilter.bind(this, 'available')} active={this.state.show == 'available'} > Show only available systems </ListGroupItem> <ListGroupItem onClick={this.setFilter.bind(this, 'not_available')} active={this.state.show == 'not_available'} > Show only not available systems </ListGroupItem> <ListGroupItem onClick={this.setFilter.bind(this, 'all')} active={this.state.show == 'all'} > Show all systems </ListGroupItem> </ListGroup> </AutoAffix> </Col> </Row> ); } render() { return ( <div className={s.container}> <h1>Systems</h1> <Grid> {this.renderSystems()} </Grid> </div> ) } } export default withStyles(s)(Systems);
fechy/retropie-web-gui
src/components/SystemsList/SystemsList.js
JavaScript
mit
3,572
version https://git-lfs.github.com/spec/v1 oid sha256:32728342485677be1fe240941c1404f53f367f741f7980cf29ae5c77e3f66a16 size 558
yogeshsaroya/new-cdnjs
ajax/libs/globalize/1.0.0-alpha.3/globalize.min.js
JavaScript
mit
128
var Accumulator, errorTypes, isConstructor, isType, isValidator, throwFailedValidator, throwFailure, throwInvalidType; throwFailure = require("failure").throwFailure; Accumulator = require("accumulator"); isConstructor = require("./isConstructor"); isValidator = require("./isValidator"); errorTypes = require("../errorTypes"); isType = require("./isType"); module.exports = function(value, type, key) { var relevantData, result; if (isConstructor(key, Object)) { relevantData = key; key = relevantData.key; } else { relevantData = { key: key }; } if (!type) { throwFailure(Error("Must provide a 'type'!"), { value: value, type: type, key: key, relevantData: relevantData }); } if (isValidator(type)) { result = type.validate(value, key); if (result !== true) { throwFailedValidator(type, result, relevantData); } } else if (!isType(value, type)) { throwInvalidType(type, value, relevantData); } }; throwFailedValidator = function(type, result, relevantData) { var accumulated; accumulated = Accumulator(); accumulated.push(result); if (relevantData) { accumulated.push(relevantData); } return type.fail(accumulated.flatten()); }; throwInvalidType = function(type, value, relevantData) { var accumulated, error; accumulated = Accumulator(); accumulated.push({ type: type, value: value }); if (relevantData) { accumulated.push(relevantData); } error = errorTypes.invalidType(type, relevantData.key); return throwFailure(error, accumulated.flatten()); }; //# sourceMappingURL=../../../map/src/core/assertType.map
aleclarson/type-utils
js/src/core/assertType.js
JavaScript
mit
1,659
import SyncClient from 'sync-client'; const versions = [{ version: 1, stores: { bookmarks: 'id, parentID', folders: 'id, parentID', }, }, { version: 2, stores: { bookmarks: 'id, parentID, *tags', folders: 'id, parentID', tags: 'id', }, }]; export default new SyncClient('BookmarksManager', versions); export { SyncClient };
nponiros/bookmarks_manager
app/src/db/sync_client.js
JavaScript
mit
358
'use strict'; angular.module('meanDemoApp') .config(function ($stateProvider) { $stateProvider .state('main', { url: '/', templateUrl: 'app/main/main.html', controller: 'MainCtrl' }); });
edispring/mean-demo
client/app/main/main.js
JavaScript
mit
232
const _parseHash = function (hash) { let name = ''; let urlType = ''; let hashParts = hash.split('_'); if (hashParts && hashParts.length === 2) { name = hashParts[1]; let type = hashParts[0]; // take off the "#" let finalType = type.slice(1, type.length); switch (finalType) { case 'method': urlType = 'methods'; break; case 'property': urlType = 'properties'; break; case 'event': urlType = 'events'; break; default: urlType = ''; } return { urlType, name, }; } return null; }; function hashToUrl(window) { if (window && window.location && window.location.hash) { let hashInfo = _parseHash(window.location.hash); if (hashInfo) { return `${window.location.pathname}/${hashInfo.urlType}/${hashInfo.name}?anchor=${hashInfo.name}`; } } return null; } function hasRedirectableHash(window) { let canRedirect = false; if (window && window.location && window.location.hash) { let hashParts = window.location.hash.split('_'); if (hashParts && hashParts.length === 2) { canRedirect = true; } } return canRedirect; } export { hashToUrl, hasRedirectableHash };
ember-learn/ember-api-docs
app/utils/hash-to-url.js
JavaScript
mit
1,240
/** * An ES6 screeps game engine. * * An attempt to conquer screeps, the first MMO strategy sandbox * game for programmers! * * @author Geert Hauwaerts <geert@hauwaerts.be> * @copyright Copyright (c) Geert Hauwaerts * @license MIT License */ /** * Cache for static function results. */ export default class Cache { /** * Cache for static function results. * * @returns {void} */ constructor() { this.cache = {}; } /** * Store or retrieve an entry from cache. * * @param {string} table The cache table. * @param {string} key The entry to store or retrieve. * @param {*} value The callback function. * @param {*} ...args The callback function arguments. * @returns {*} */ remember(table, key, callback, ...args) { if (this.cache[table] === undefined) { this.cache[table] = {}; } let value = this.cache[table][key]; if (value === undefined) { value = callback(args); this.cache[table][key] = value; } return value; } /** * Remove an entry from cache. * * @param {string} table The cache table. * @param {string} key The entry to remove. * @returns {void} */ forget(table, key) { delete this.cache[table][key]; } }
GeertHauwaerts/screeps
src/Cache.js
JavaScript
mit
1,287
'use strict'; var conf = require('../config'); var ctrlBuilder = require('../controllers/face-controller'); var version = conf.get('version'); var base_route = conf.get('baseurlpath'); var face_route = base_route + '/face'; module.exports = function (server, models, redis) { var controller = ctrlBuilder(server, models, redis); server.get({path: face_route, version: version}, controller.randomFace); server.head({path: face_route, version: version}, controller.randomFace); };
epappas/random-api
openapi/routes/face.js
JavaScript
mit
497
var chai = require('chai'); chai.use(require('chai-fs')); var expect = chai.expect var execute = require('../'); describe('execute', function() { it('should exist', function() { expect(execute).to.exist; }); it('should return a promise', function() { expect(execute().then).to.exist; }); it('should return an result object handed through it', function(done) { var result = { key: 'val' } execute(result).then(function(res) { if (res) { expect(res).to.equal(result); done(); } else { done(new Error('Expected result to be resolved')); } }, function() { done(new Error('Expected function to resolve, not reject.')); }); }); describe('shell commands', function() { it('should execute a string as a shell script', function(done) { //Test by creating file and asserting that it exists execute(null, { shell: 'echo "new file content" >> ./test/file.txt' }).then(function(){ expect("./test/file.txt").to.be.a.file("file.txt not found") done() }, function() { done(new Error('expected function to resolve, not reject')); }) //Remove file and asserting that it does not exist execute(null, { shell: 'rm ./test/file.txt' }).then(function(){ expect("./test/file.txt").not.to.be.a.file("file.txt not found") done() }, function() { done(new Error('expected function to resolve, not reject')); }) }); }); describe('bash scripts', function() { it('should execute a file as a bash script', function(done) { //Test by creating file and asserting that it exists execute(null, { bashScript: './test/test-script' }).then(function(){ expect("./test/file.txt").to.be.a.file("file.txt not found") done() }, function() { done(new Error('expected function to resolve, not reject')); }) //Remove file and asserting that it does not exist execute(null, { shell: 'rm ./test/file.txt' }).then(function(){ expect("./test/file.txt").not.to.be.a.file("file.txt not found") done() }, function() { done(new Error('expected function to resolve, not reject')); }); }); it('should hand parameters to bash scripts', function(done) { //Test by creating file and asserting that it exists execute(null, { bashScript: './test/test-script-params', bashParams: ['./test/file.txt'] }).then(function(){ expect("./test/file.txt").to.be.a.file("file.txt not found") done() }, function() { done(new Error('expected function to resolve, not reject')); }) //Remove file and asserting that it does not exist execute(null, { shell: 'rm ./test/file.txt' }).then(function(){ expect("./test/file.txt").not.to.be.a.file("file.txt not found") done() }, function() { done(new Error('expected function to resolve, not reject')); }) }); }); xdescribe('logging', function() { //TODO: enforce this: these two log tests could be enforced with an abstracted log func and a spy.... it('should default logging to false', function() { execute(null, { shell: 'echo "i should not log"' }).then(function(){ done() }, function() { done(new Error('expected function to resolve, not reject')); }) }); //TODO: enforce this it('should allow toggling logging', function() { execute(null, { logOutput: true, shell: 'echo "i should log"' }).then(function(){ done() }, function() { done(new Error('expected function to resolve, not reject')); }) }); }); });
lambduh/lambduh-execute
test/execute.spec.js
JavaScript
mit
3,830
/* * catberry-homepage * * Copyright (c) 2015 Denis Rechkunov and project contributors. * * catberry-homepage's license follows: * * 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. * * This license applies to all parts of catberry-homepage that are not * externally maintained libraries. */ 'use strict'; module.exports = Overview; var util = require('util'), StaticStoreBase = require('../../lib/StaticStoreBase'); util.inherits(Overview, StaticStoreBase); /* * This is a Catberry Store file. * More details can be found here * https://github.com/catberry/catberry/blob/master/docs/index.md#stores */ /** * Creates new instance of the "static/Quotes" store. * @constructor */ function Overview() { StaticStoreBase.call(this); } Overview.prototype.filename = 'github/overview';
zarkone/catberry-homepage
catberry_stores/static/Overview.js
JavaScript
mit
1,829
import util from './util' import LatLngBounds from './latlngbounds' const {abs, max, min, PI, sin, cos, acos} = Math const rad = PI / 180 // distance between two geographical points using spherical law of cosines approximation function distance (latlng1, latlng2) { const lat1 = latlng1.lat * rad const lat2 = latlng2.lat * rad const a = sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos((latlng2.lng - latlng1.lng) * rad) return 6371000 * acos(min(a, 1)); } class LatLng { constructor(a, b, c) { if (a instanceof LatLng) { return a; } if (Array.isArray(a) && typeof a[0] !== 'object') { if (a.length === 3) { return this._constructor(a[0], a[1], a[2]) } if (a.length === 2) { return this._constructor(a[0], a[1]) } return null; } if (a === undefined || a === null) { return a } if (typeof a === 'object' && 'lat' in a) { return this._constructor(a.lat, 'lng' in a ? a.lng : a.lon, a.alt); } if (b === undefined) { return null; } return this._constructor(a, b, c) } _constructor(lat, lng, alt) { if (isNaN(lat) || isNaN(lng)) { throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')'); } // @property lat: Number // Latitude in degrees this.lat = +lat // @property lng: Number // Longitude in degrees this.lng = +lng // @property alt: Number // Altitude in meters (optional) if (alt !== undefined) { this.alt = +alt } } // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overriden by setting `maxMargin` to a small number. equals(obj, maxMargin) { if (!obj) { return false } obj = new LatLng(obj); const margin = max(abs(this.lat - obj.lat), abs(this.lng - obj.lng)) return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin); } // @method toString(): String // Returns a string representation of the point (for debugging purposes). toString(precision) { return `LatLng(${this.lat.toFixed(precision)}, ${this.lng.toFixed(precision)})` } // @method distanceTo(otherLatLng: LatLng): Number // Returns the distance (in meters) to the given `LatLng` calculated using the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula). distanceTo(other) { return distance(this, new LatLng(other)) } // @method wrap(): LatLng // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees. wrap(latlng) { const lng = util.wrapNum(latlng.lng, [-180, 180], true) return new LatLng(latlng.lat, lng, latlng.alt) } // @method toBounds(sizeInMeters: Number): LatLngBounds // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters` meters apart from the `LatLng`. toBounds(sizeInMeters) { const latAccuracy = 180 * sizeInMeters / 40075017 const lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat) return LatLngBounds( [this.lat - latAccuracy, this.lng - lngAccuracy], [this.lat + latAccuracy, this.lng + lngAccuracy] ) } clone() { return new LatLng(this.lat, this.lng, this.alt) } } module.exports = LatLng
ujazdowskip/nano_map
src/latlng.js
JavaScript
mit
3,318
import React from 'react' const EditableText = React.createClass({ propTypes: { onSubmit: React.PropTypes.func.isRequired, validator: React.PropTypes.func, enableEditing: React.PropTypes.bool, value: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.number, ]) }, getInitialState: function() { return { editing: false, invalid: false, newValue: this.props.value, }; }, getDefaultProps: function() { return { enableEditing: true }; }, edit() { this.setState({editing: true}); }, handleChange(e) { this.setState({newValue: e.target.value}); }, cancelEdit() { this.setState({ editing: false, invalid: false, }); }, submit(e) { e.preventDefault(); if (!this.props.validator || this.props.validator(this.state.newValue)) { this.props.onSubmit(this.state.newValue); this.cancelEdit(); } else { this.setState({invalid: true}); } }, renderInputForm() { const inputForm = ( <form onSubmit={this.submit} className={this.state.invalid ? 'has-error' : ''} > <input type="text" autoFocus onChange={this.handleChange} onBlur={this.cancelEdit} value={this.state.newValue} className="form-control inline-editable" /> </form> ); return inputForm; }, render: function() { if (this.props.enableEditing) { return ( <div className="inline-edit"> {this.state.editing ? this.renderInputForm() : <a onClick={this.edit} title="Edit" className={'inline-editable'}>{this.props.value || 'Add'}</a> } </div> ); } else { return (<span>{this.props.value}</span>); } } }); export default EditableText
bpugh/react-editable
src/index.js
JavaScript
mit
1,822
(function () { "use strict"; //angular.module('app', ['angularUtils.directives.dirPagination']); var env = {}; if (window) { Object.assign(env, window.__env); } var app = angular.module("deviceManagement", ['angularUtils.directives.dirPagination', 'common.services', 'ui.router'//, //'deviceResourceRest' //'deviceResourceMock' ]); app.constant("rootUrl", "http://www.example.com"); app.constant("$env", env); // configure state for device list // add route state // reference the app variable app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { // pass in $stateProvider - and use array to be min safe $urlRouterProvider.otherwise("/"); //("/devices"); // default otherwise if an activated state has no entry $stateProvider .state("home", { url: "/", templateUrl: "app/welcomeView.html" }) //manifest .state("manifestList", { url: "/devices/manifest/:DeviceId", templateUrl: "app/devices/manifestList.html", controller: "ManifestCtrl as vm" }) //devices .state("deviceList", { // set url fragment url: "/devices", // http://localhost:8000/#/devices templateUrl: "app/devices/deviceListView.html", // url location fetched template from web server controller: "DeviceListCtrl as vm" // associated controller is contructed }) .state("deviceEdit", { abstract: true, // abstract set so that it cannot be explicitly activated , it must have child state url: "/devices/edit/:DeviceId", // param is required which specific device id templateUrl: "app/devices/deviceEditView.html", // ui elements controller: "DeviceEditCtrl as vm", // as with alias of vm // resolve: { // deviceResource: "deviceResource", // device: function (deviceResource, $stateParams) { // var DeviceId = $stateParams.DeviceId; // return deviceResource.get({ DeviceId: DeviceId }).$promise; // } // } }) .state("deviceEdit.info", { url: "/info", templateUrl: "app/devices/deviceEditInfoView.html" }) .state("deviceEdit.price", { url: "/price", templateUrl: "app/devices/deviceEditPriceView.html" }) .state("deviceEdit.tags", { url: "/tags", templateUrl: "app/devices/deviceEditTagsView.html" }) .state("deviceDetail", { url: "/devices/:DeviceId", // param is required which specific device id templateUrl: "app/devices/deviceDetailView.html", // ui elements controller: "DeviceDetailCtrl as vm"//{ //$scope.DeviceId = $stateParams.DeviceId; //var DeviceId = $stateParams.DeviceId; //} //controller: "DeviceDetailCtrl as vm" //, // as with alias of vm // resolve: { // resolve is a property of the stateconfiguration object // deviceResource: "deviceResource", // key value pair Key is deviceResource value is string name of "deviceResource" // device: function (deviceResource, $stateParams) { // $stateParams service is needed because url: has this :DeviceId // var DeviceId = $stateParams.DeviceId; // return deviceResource.get({ DeviceId: DeviceId }).$promise; // function returns the promise // } // } }) //console.log('end .state ui router'); }] ); } ());
tazmanrising/IntiotgAngular
SimBit/solution/app/app.js
JavaScript
mit
4,538
/** * Created by zad on 17/4/20. */ /** to left shift an Array * @param {Array} arr * @param {Number} num * @return {Array} */ function leftShift(arr, num) { const result = arr.concat(); if (num < 0) { return rightShift(arr, -num); } while (num > 0) { result.push(result.shift()); num--; } return result; } /** to right shift an Array * @param {Array} arr * @param {Number} num * @return {Array} */ function rightShift(arr, num) { return leftShift(arr, arr.length - num); } export {leftShift, rightShift};
zadzbw/React-Component-zad
src/utils/arrayShift.js
JavaScript
mit
544
/* eslint-env node */ 'use strict'; module.exports = { 'cowsay': require('./cowsay') };
alexdiliberto/ember-cowsay
lib/commands/index.js
JavaScript
mit
91
import Component from '@ember/component'; import { computed } from '@ember/object'; import { inject as service } from '@ember/service'; import { isEmpty } from '@ember/utils'; import { all } from 'rsvp'; import { task, timeout } from 'ember-concurrency'; import { validator, buildValidations } from 'ember-cp-validations'; import ValidationErrorDisplay from 'ilios-common/mixins/validation-error-display'; const Validations = buildValidations({ firstName: [ validator('presence', true), validator('length', { max: 50 }) ], middleName: [ validator('length', { max: 20 }) ], lastName: [ validator('presence', true), validator('length', { max: 50 }) ], campusId: [ validator('length', { max: 16 }) ], otherId: [ validator('length', { max: 16 }) ], email: [ validator('presence', true), validator('length', { max: 100 }), validator('format', { type: 'email' }) ], displayName: [ validator('length', { max: 200 }) ], preferredEmail: [ validator('length', { max: 100 }), validator('format', { allowBlank: true, type: 'email', }) ], phone: [ validator('length', { max: 20 }) ], username: { descriptionKey: 'general.username', validators: [ validator('length', { max: 100, }), validator('format', { regex: /^[a-z0-9_\-()@.]*$/i, }) ] }, password: { dependentKeys: ['model.canEditUsernameAndPassword', 'model.changeUserPassword'], disabled: computed('model.canEditUsernameAndPassword', 'model.changeUserPassword', function() { return this.get('model.canEditUsernameAndPassword') && !this.get('model.changeUserPassword'); }), validators: [ validator('presence', true), validator('length', { min: 5 }) ] } }); export default Component.extend(ValidationErrorDisplay, Validations, { commonAjax: service(), currentUser: service(), iliosConfig: service(), store: service(), classNameBindings: [':user-profile-bio', ':small-component', 'hasSavedRecently:has-saved:has-not-saved'], 'data-test-user-profile-bio': true, campusId: null, changeUserPassword: false, email: null, displayName: null, firstName: null, hasSavedRecently: false, isManageable: false, isManaging: false, lastName: null, middleName: null, otherId: null, password: null, phone: null, preferredEmail: null, showSyncErrorMessage: false, updatedFieldsFromSync: null, user: null, username: null, canEditUsernameAndPassword: computed('iliosConfig.userSearchType', async function() { const userSearchType = await this.iliosConfig.userSearchType; return userSearchType !== 'ldap'; }), passwordStrengthScore: computed('password', async function() { const { default: zxcvbn } = await import('zxcvbn'); const password = isEmpty(this.password) ? '' : this.password; const obj = zxcvbn(password); return obj.score; }), usernameMissing: computed('user.authentication', async function() { const authentication = await this.user.authentication; return isEmpty(authentication) || isEmpty(authentication.username); }), init() { this._super(...arguments); this.set('updatedFieldsFromSync', []); }, didReceiveAttrs() { this._super(...arguments); const user = this.user; const isManaging = this.isManaging; const manageTask = this.manage; if (user && isManaging && !manageTask.get('lastSuccessfull')){ manageTask.perform(); } }, actions: { cancelChangeUserPassword() { this.set('changeUserPassword', false); this.set('password', null); this.send('removeErrorDisplayFor', 'password'); } }, keyUp(event) { const keyCode = event.keyCode; const target = event.target; if (! ['text', 'password'].includes(target.type)) { return; } if (13 === keyCode) { this.save.perform(); return; } if (27 === keyCode) { if ('text' === target.type) { this.cancel.perform(); } else { this.send('cancelChangeUserPassword'); } } }, manage: task(function* () { const user = this.user; this.setProperties(user.getProperties( 'firstName', 'middleName', 'lastName', 'campusId', 'otherId', 'email', 'displayName', 'preferredEmail', 'phone' )); let auth = yield user.get('authentication'); if (auth) { this.set('username', auth.get('username')); this.set('password', ''); } this.setIsManaging(true); return true; }), save: task(function* () { yield timeout(10); const store = this.store; const canEditUsernameAndPassword = yield this.canEditUsernameAndPassword; const changeUserPassword = yield this.changeUserPassword; this.send('addErrorDisplaysFor', [ 'firstName', 'middleName', 'lastName', 'campusId', 'otherId', 'email', 'displayName', 'preferredEmail', 'phone', 'username', 'password' ]); let {validations} = yield this.validate(); if (validations.get('isValid')) { const user = this.user; user.setProperties(this.getProperties( 'firstName', 'middleName', 'lastName', 'campusId', 'otherId', 'email', 'displayName', 'preferredEmail', 'phone' )); let auth = yield user.get('authentication'); if (!auth) { auth = store.createRecord('authentication', { user }); } //always set and send the username in case it was updated in the sync let username = this.username; if (isEmpty(username)) { username = null; } auth.set('username', username); if (canEditUsernameAndPassword && changeUserPassword) { auth.set('password', this.password); } yield auth.save(); yield user.save(); const pendingUpdates = yield user.get('pendingUserUpdates'); yield all(pendingUpdates.invoke('destroyRecord')); this.send('clearErrorDisplay'); this.cancel.perform(); this.set('hasSavedRecently', true); yield timeout(500); this.set('hasSavedRecently', false); } }).drop(), directorySync: task(function* () { yield timeout(10); this.set('updatedFieldsFromSync', []); this.set('showSyncErrorMessage', false); this.set('syncComplete', false); const userId = this.get('user.id'); let url = `/application/directory/find/${userId}`; const commonAjax = this.commonAjax; try { let data = yield commonAjax.request(url); let userData = data.result; const firstName = this.firstName; const lastName = this.lastName; const displayName = this.displayName; const email = this.email; const username = this.username; const phone = this.phone; const campusId = this.campusId; if (userData.firstName !== firstName) { this.set('firstName', userData.firstName); this.updatedFieldsFromSync.pushObject('firstName'); } if (userData.lastName !== lastName) { this.set('lastName', userData.lastName); this.updatedFieldsFromSync.pushObject('lastName'); } if (userData.displayName !== displayName) { this.set('displayName', userData.displayName); this.updatedFieldsFromSync.pushObject('displayName'); } if (userData.email !== email) { this.set('email', userData.email); this.updatedFieldsFromSync.pushObject('email'); } if (userData.campusId !== campusId) { this.set('campusId', userData.campusId); this.updatedFieldsFromSync.pushObject('campusId'); } if (userData.phone !== phone) { this.set('phone', userData.phone); this.updatedFieldsFromSync.pushObject('phone'); } if (userData.username !== username) { this.set('username', userData.username); this.updatedFieldsFromSync.pushObject('username'); } } catch (e) { this.set('showSyncErrorMessage', true); } finally { this.set('syncComplete', true); yield timeout(2000); this.set('syncComplete', false); } }).drop(), cancel: task(function* () { yield timeout(1); this.set('hasSavedRecently', false); this.set('updatedFieldsFromSync', []); this.setIsManaging(false); this.set('changeUserPassword', false); this.set('firstName', null); this.set('lastName', null); this.set('middleName', null); this.set('campusId', null); this.set('otherId', null); this.set('email', null); this.set('displayName', null); this.set('preferredEmail', null); this.set('phone', null); this.set('username', null); this.set('password', null); }).drop() });
thecoolestguy/frontend
app/components/user-profile-bio.js
JavaScript
mit
8,974
module.exports = { Server: app => ({ app, listen: jest.fn(), }), };
Bottr-js/Bottr
__mocks__/http.js
JavaScript
mit
80
/* * Responsive Slideshow - jQuery plugin * * Copyright (c) 2010-2012 Roland Baldovino * * Project home: * https://github.com/junebaldovino/jquery.resss.plugin * * Version: 0.1 * */ (function($){ var _this,settings; var methods = { init : function( options ) { return this.each(function(){ settings = $.extend( { interval: 3000, animspeed: 1000, easing: 'easeOutBack', valign: 'middle', controls: false, cc: null, autoplay: false, controlsCont: null, total: null, allimgs: null, idletime: null, idlemode: false, details: false, curPg: 0, imgLoadCount: 0, waitLoad: true }, options); _this = $(this); var $this = $(this), data = $this.data('resss'); // initial settings settings.allimgs = _this.find('li'); settings.total = settings.allimgs.length; if(settings.controls) methods.initControls(); methods.preloadImages(); if(!settings.waitLoad){ methods.resetImages(); methods.addListeners(); methods.initTimers(); } if (!data) { $(this).data('resss', { target : $this }); } }); }, initControls : function(){ cc = $('<div class="controls" />'); _this.append(cc); for (var i = 0; i < settings.total; i++ ){ var d = i==0 ? $('<div class="active" />') : $('<div />'); cc.append(d); } }, resetCtrls : function(){ cc.find('div').each(function(i){ var li = $(this); i == settings.curPg ? li.addClass('active') : li.removeClass('active'); }); }, addListeners : function(){ // add swipe listeners _this.swipe({swipe:function(event, direction, distance, duration, fingerCount) {methods.swipe(event, direction, distance, duration, fingerCount)} }); // add window resize listeners $(window).bind({ 'resize.resss': function(e){methods.onresize();} }); // add controls listener if(settings.controls){ cc.find('div').each(function(i){ $(this).bind({ 'click' : function(e){ if(!$(this).hasClass('active')){ methods.gotoSlide(i); methods.resetCtrls(); } } }); }); } }, preloadImages : function(){ imgLoadDone = 0; imgCounter = 0; imgsLoaded = false; var c = settings.total; while(c--){ $.ajax({ url: settings.allimgs.find('img').eq(c).attr('src'), type: 'HEAD', success: function(data) { ++settings.imgLoadCount; if(settings.waitLoad){ if(settings.imgLoadCount==settings.total){ methods.finLoad(); } } /* else{ methods.showLoadedImg(this['url']); } */ } }); } methods.gotoSlide(settings.curPg); }, showLoadedImg : function(url){ settings.allimgs.find('img').each(function(){if($(this).attr('src')==url)$(this).css({display:'block'});}); }, finLoad : function(){ if(settings.waitLoad){ methods.resetImages(); methods.addListeners(); methods.initTimers(); } }, initTimers : function(){ if(settings.autoplay) { methods.ssplay(); }else{ $.idleTimer(settings.interval); $(document).bind("idle.idleTimer", function(){ settings.idlemode = true; settings.idletime = setInterval(function(){methods.onIdle()},settings.interval); }); $(document).bind("active.idleTimer", function(){ settings.idlemode = false; clearInterval(settings.idletime); }); } }, ssplay : function(){ if(settings.idletime != null) clearInterval(settings.idletime); settings.idletime = setInterval(function(){methods.ssplay()},settings.interval); methods.slideNext(); }, onIdle : function() { methods.slideNext(); }, onresize : function() { if($('.backstretch').length > 1){ $('.backstretch').eq(0).remove(); } if(settings.autoplay) methods.ssplay(); }, swipe : function(event, direction, distance, duration, fingerCount){ if(direction=='left') methods.slideNext(); if(direction=='right') methods.slidePrev(); }, slideNext : function(){ ++settings.curPg; if(settings.curPg > settings.total-1) settings.curPg = 0; var src = $(settings.allimgs[settings.curPg]).find('img').attr('src'); if($('.backstretch').length > 1){ $('.backstretch').eq(0).animate({opacity:0}, settings.animspeed, settings.easing, function(){$(this).remove();}); } _this.backstretch(src, {fade: settings.animspeed }); if(settings.details) { $(settings.allimgs[settings.curPg]).find('.details').css({display:'block', opacity:0}).animate({opacity:1}, settings.animspeed, settings.easing); } methods.resetCtrls(); if(settings.details) methods.resetDetails(); }, slidePrev : function(){ --settings.curPg; if(settings.curPg < 0) settings.curPg = settings.total-1; var src = $(settings.allimgs[settings.curPg]).find('img').attr('src'); if($('.backstretch').length > 1){ $('.backstretch').eq(0).animate({opacity:0}, settings.animspeed, settings.easing, function(){$(this).remove();}); } _this.backstretch(src, {fade: settings.animspeed}); if(settings.details) { $(settings.allimgs[settings.curPg]).find('.details').css({display:'block', opacity:0}).animate({opacity:1}, settings.animspeed, settings.easing); } methods.resetCtrls(); if(settings.details) methods.resetDetails(); }, gotoSlide : function(i){ settings.curPg = i; var src = $(settings.allimgs[settings.curPg]).find('img').attr('src'); if($('.backstretch').length > 1){ $('.backstretch').eq(0).animate({opacity:0}, settings.animspeed, settings.easing, function(){$(this).remove();}); } if(settings.details) { $(settings.allimgs[settings.curPg]).find('.details').css({display:'block', opacity:0}).animate({opacity:1}, settings.animspeed, settings.easing); } _this.backstretch(src, {fade: settings.animspeed}); if(settings.details) methods.resetDetails(); }, resetDetails : function(){ $(settings.allimgs).each(function(i){ if(i != settings.curPg) $(settings.allimgs[i]).find('.details').css({opacity:0,display:'none'}); }); }, resetImages : function(){ $(settings.allimgs).each(function(i){ $(settings.allimgs[i]).find('img').css({opacity:0,display:'none'}); }); if(settings.details) methods.resetDetails(); }, destroy : function( ) { return this.each(function(){ var $this = $(this), data = $this.data('resss'); $(window).unbind({ 'resize.resss': function(e){methods.onresize()}}); $(window).unbind('.resss'); data.resss.remove(); $this.removeData('resss'); }); } }; $.fn.resss = function(method) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if (typeof method === 'object' || ! method) { return methods.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exist on jQuery.resss'); } }; })( jQuery );
wtfroland/jquery.resss.plugin
js/jquery.resss.js
JavaScript
mit
7,122
/* global bp, noEvents, emptySet */ /* * This little app adds bthreads dynamically. */ bp.log.info("Program Loaded"); // Define the events. var kidADone = bp.Event("kidADone"); var kidBDone = bp.Event("kidBDone"); var parentDone = bp.Event("parentDone"); bp.registerBThread("parentBThread", function () { bp.log.info("parent started"); // first one, text for behavior on the start() method. bp.registerBThread( "kid a1", function() { bp.log.info("kid a1 started"); bp.sync({request:kidADone, block:parentDone}); }); bp.registerBThread( "kid b1", function() { bp.log.info("kid b1 started"); bp.sync({request:kidBDone, block:parentDone}); }); bp.sync( {request: parentDone} ); // second round, test for behavior on the resume() method. bp.registerBThread( "kid a2", function() { bp.sync({request:kidADone, block:parentDone}); }); bp.registerBThread( "kid b2", function() { bp.sync({request:kidBDone, block:parentDone}); }); bp.sync( {request: parentDone} ); });
bThink-BGU/BPjs
src/test/resources/AddingBthreads.js
JavaScript
mit
1,097
//configure requirejs var requirejs = require('requirejs'); requirejs.config({ baseUrl: __dirname + '/../javascripts', nodeRequire: require }); //turn off rendering for commandline unit tests var global = requirejs('global'); global.RENDER = false; //export requirejs module.exports = { require: requirejs };
bridgs/grapple-game
test/setup.js
JavaScript
mit
311
"use strict" /** * Construct URL for Magento Admin. * * @param {string} path path to Magento page (absolute path started with '/', alias - w/o) */ var result = function getUrl(path) { /* shortcuts for globals */ var casper = global.casper; var mobi = global.mobi; var root = mobi.opts.navig.mage; /* functionality */ casper.echo(" construct Magento Admin URL for path '" + path + "'.", "PARAMETER"); var isAlias = path.indexOf('/') === -1; // absolute path contains at least one '/' char var result, url; if (isAlias) { /* compose URI based on "route.to.page" */ var route = mobi.objPath.get(root.admin, path); url = route.self; } else { /* absolute path is used */ url = path } /* "http://mage2.local.host.com" + "/admin" + "url" */ result = root.self + root.admin.self + url; casper.echo(" result URL: " + result, "PARAMETER"); return result; } module.exports = result;
praxigento/mobi_app_generic_mage2
test/integration/src/sub/mage/admin/getUrl.js
JavaScript
mit
984
"use strict"; var EventEmitter = require('events').EventEmitter; var util = require( './util' ); /** * Single user on the server. */ var User = function(data, client) { this.client = client; this._applyProperties(data); }; User.prototype = Object.create(EventEmitter.prototype); /** * @summary Moves the user to a channel * * @param {Channel|String} channel - Channel name or a channel object */ User.prototype.moveToChannel = function(channel) { var id; if(typeof channel === "string") { id = this.client.channelByName(channel).id; } else if(typeof channel === "object") { id = channel.id; } else { return; } this.client.connection.sendMessage( 'UserState', { session: this.session, actor: this.client.user.session, channel_id: id }); }; /** * @summary Change a user's self deafened state. (Obviously) only works on yourself. * * @param {Boolean} isSelfDeaf - The new self deafened state */ User.prototype.setSelfDeaf = function(isSelfDeaf){ this.client.connection.sendMessage( 'UserState', { session: this.session, actor: this.client.user.session, self_deaf: isSelfDeaf }); }; /** * @summary Change a user's self muted state. (Obviously) only works on yourself. * * @param {Boolean} isSelfMute - The new self muted state */ User.prototype.setSelfMute = function(isSelfMute){ this.client.connection.sendMessage( 'UserState', { session: this.session, actor: this.client.user.session, self_mute: isSelfMute }); }; /** * @summary Attempts to kick the user. * * @param {String} [reason] - The reason to kick the user for. */ User.prototype.kick = function(reason) { this._sendRemoveUser( reason || "You have been kicked", false ); }; /** * @summary Attempts to ban the user. * * @param {String} [reason] - The reason to ban the user for. */ User.prototype.ban = function(reason) { this._sendRemoveUser( reason || "You have been banned", true ); }; /** * @summary Sends a message to the user. * * @param {String} message - The message to send. */ User.prototype.sendMessage = function(message) { this.client.sendMessage( message, { session: [ this.session ] } ); }; /** * @summary Returns an output stream for listening to the user audio. * * @param {Boolean} [noEmptyFrames] * True to cut the output stream during silence. If the output stream * isn't cut it will keep emitting zero-values when the user isn't * talking. * * @returns {MumbleOutputStream} Output stream. */ User.prototype.outputStream = function(noEmptyFrames) { return this.client.connection.outputStream(this.session, noEmptyFrames); }; /** * @summary Returns an input stream for sending audio to the user. * * @returns {MumbleInputStream} Input stream. */ User.prototype.inputStream = function() { return this.client.inputStreamForUser( this.session ); }; /** * @summary Checks whether the user can talk or not. * * @returns {Boolean} True if the user can talk. */ User.prototype.canTalk = function() { return !this.mute && !this.selfMute && !this.suppress; }; /** * @summary Checks whether the user can hear other people. * * @returns {Boolean} True if the user can hear. */ User.prototype.canHear = function() { return !this.selfDeaf; }; User.prototype._applyProperties = function(data) { /** * @summary Session ID * * @description * Session ID is present for all users. The ID specifies the current user * session and will change when the user reconnects. * * @see User#id * * @name User#session * @type Number */ this.session = data.session; /** * @summary User name * * @name User#name * @type String */ this.name = data.name; /** * @summary User ID * * @description * User ID is specified only for users who are registered on the server. * The user ID won't change when the user reconnects. * * @see User#session * * @name User#id * @type Number */ this.id = data.user_id; /** * @summary _true_ when the user is muted by an admin. * * @name User#mute * @type Boolean */ this.mute = data.mute; /** * @summary _true_ when the user is deafened by an admin. * * @name User#deaf * @type Boolean */ this.deaf = data.deaf; /** * @summary _true_ when the user is suppressed due to lack of * permissions. * * @description * The user will be suppressed by the server if they don't have permissions * to speak on the current channel. * * @name User#suppress * @type Boolean */ this.suppress = data.suppress; /** * @summary _true_ when the user has muted themselves. * * @name User#selfMute * @type Boolean */ this.selfMute = data.self_mute; /** * @summary _true_ when the user has deafened themselves. * * @name User#selfDeaf * @type Boolean */ this.selfDeaf = data.self_deaf; /** * @summary The hash of the user certificate * * @name User#hash * @type String */ this.hash = data.hash; /** * @summary _true_ when the user is recording the conversation. * * @name User#recording * @type Boolean */ this.recording = data.recording; /** * @summary _true_ when the user is a priority speaker. * * @name User#prioritySpeaker * @type Boolean */ this.prioritySpeaker = data.priority_speaker; /** * @summary User's current channel. * * @name User#channel * @type Channel */ if(data.channel_id !== null) { this.channel = this.client.channelById(data.channel_id); } else { // New users always enter root this.channel = this.client.rootChannel; } this.channel._addUser(this); //TODO: Comments, textures }; /** * @summary Emitted when the user disconnects * * @description * Also available through the client `user-disconnect` event. * * @event User#disconnect */ User.prototype._detach = function() { this.emit('disconnect'); this.channel._removeUser(this); }; /** * @summary Emitted when the user moves between channels. * * @event User#move * @param {Channel} oldChannel - The channel where the user was moved from. * @param {Channel} newChannel - The channel where the user was moved to. * @param {User} actor - The user who moved the channel or undefined for server. */ User.prototype._checkChangeChannel = function( data ) { // Get the two channel instances. var newChannel = this.client.channelById( data.channel_id ); var oldChannel = this.channel; // Make sure there is a change in the channel. if( newChannel === oldChannel ) return; // Make the channel change and notify listeners. this.channel = newChannel; oldChannel._removeUser( this ); newChannel._addUser( this ); var actor = this.client.userBySession( data.actor ); this.emit( 'move', oldChannel, newChannel, actor ); }; /** * @summary Emitted when the user is muted or unmuted by the server. * * @description * Also available through the client `user-mute` event. * * @event User#mute * @param {Boolean} status * True when the user is muted, false when unmuted. */ /** * @summary Emitted when the user mutes or unmutes themselves. * * @description * Also available through the client `user-self-mute` event. * * @event User#self-mute * @param {Boolean} status * True when the user mutes themselves. False when unmuting. */ /** * @summary Emitted when the user deafens or undeafens themselves. * * @description * Also available through the client `user-self-deaf` event. * * @event User#self-deaf * @param {Boolean} status * True when the user deafens themselves. False when undeafening. */ /** * @summary Emitted when the user is suppressed or unsuppressed. * * @description * Also available through the client `user-suppress` event. * * @event User#suppress * @param {Boolean} status * True when the user is suppressed. False when unsuppressed. */ /** * @summary Emitted when the user starts or stops recording. * * @description * Also available through the client `user-recording` event. * * @event User#recording * @param {Boolean} status * True when the user starts recording. False when they stop. */ /** * @summary Emitted when the user gains or loses priority speaker status. * * @description * Also available through the client `user-priority-speaker` event. * * @event User#priority-speaker * @param {Boolean} status * True when the user gains priority speaker status. False when they lose * it. */ User.prototype.update = function(data) { var self = this; // Check the simple fields. [ 'mute', 'selfMute', 'suppress', 'selfDeaf', 'recording', 'prioritySpeaker', ].forEach( function(f) { self._checkField( data, f ); }); // Channel check if( data.channel_id !== null ) { this._checkChangeChannel( data ); } }; User.prototype._sendRemoveUser = function( reason, ban ) { this.client.connection.sendMessage( 'UserRemove', { session: this.session, actor: this.client.user.session, reason: reason, ban: ban } ); }; User.prototype._checkField = function( data, field ) { // Make sure the field has a value. var newValue = data[ util.toFieldName( field ) ]; if( newValue === undefined ) return; // Make sure the new value differs. var oldValue = this[ field ]; if( newValue === oldValue ) return; // All checks succeeded. Store the new value and emit change event. this[ field ] = newValue; var actor = this.client.userBySession( data.actor ); this.emit( util.toEventName( field ), newValue, actor ); }; module.exports = User;
mikemimik/node-mumble
lib/User.js
JavaScript
mit
10,014
"use strict"; module.exports = function (context) { return context.data.root.query.name + context.data.root.query.suffix; };
afronski/playground-nodejs
nodeschool.io/makemehapi/helpers/helper.js
JavaScript
mit
130
/** * @author mrdoob / http://mrdoob.com/ */ var Config = function () { var namespace = 'threejs-inspector'; var storage = { 'selectionBoxEnabled': false, 'rafEnabled' : false, 'rafFps' : 30, } if ( window.localStorage[ namespace ] === undefined ) { window.localStorage[ namespace ] = JSON.stringify( storage ); } else { var data = JSON.parse( window.localStorage[ namespace ] ); for ( var key in data ) { storage[ key ] = data[ key ]; } } return { getKey: function ( key ) { return storage[ key ]; }, setKey: function () { // key, value, key, value ... for ( var i = 0, l = arguments.length; i < l; i += 2 ) { storage[ arguments[ i ] ] = arguments[ i + 1 ]; } window.localStorage[ namespace ] = JSON.stringify( storage ); console.log( '[' + /\d\d\:\d\d\:\d\d/.exec( new Date() )[ 0 ] + ']', 'Saved config to LocalStorage.' ); }, clear: function () { delete window.localStorage[ namespace ]; } } };
jeromeetienne/threejs-inspector
src/panel/editor-ui/Config.js
JavaScript
mit
987
var _ = require("underscore"); var util = require("util"); exports.show = function (req, res) { var async = require('async'); if (!req.session.screen) { req.session.messages = { errors: ['screen not found'] }; res.redirect('/'); return; } var Handlebars = require('../hbs_helpers/hbs_helpers.js'); var fs = require('fs'); var JSONParse = require('json-literal-parse'); var screen = req.session.screen; var arr_widgetHTML = []; var widgetUtil = require('../lib/widget_util.js'); async.each(screen.widgets, function (widget, cb) { widgetUtil.render_widget(widget, function (err, w_html) { if(!err) arr_widgetHTML.push(w_html); else{ console.log("Failed to render widget " + widget.id + " : "+ err); req.session.messages = { errors: ["Failed to render widget " + widget.id + " : "+ err ] }; } cb(null); }); }, function (err) { req.session.screen.widgets = arr_widgetHTML; var data = { username: req.session.user.username, title: 'Screen : '+req.session.screen.name, screens: req.session.screens, widgets: req.session.widgets, screen: req.session.screen }; res.render('screens/show', data); }); }; exports.new = function (req, res) { var data = { username: req.session.user.username, title: 'Screen : Create New', screens: req.session.screens, widgets:req.session.widgets }; res.render('screens/new', data); }; exports.create = function (req, res) { //Deny direct post request if (!req.body.hasOwnProperty('screen_name') || !req.body.hasOwnProperty('screen_desc')) { res.status(401); res.send('Unauthorized Access <a href=\'/screens/new\'>Create New Screen</a> '); return; } var t_screen = { name: req.body.screen_name, description: req.body.screen_desc, widgets : [] }; var Screen = require('../models/screen'); //Create new screen Screen.save( t_screen, function(err, screen){ if(!err){ console.log('Screen created successfully'); req.session.messages = { success: ['Screen(' + t_screen.name + ') created successfully'], errors: [] }; res.redirect('/screens/'+screen.id); return; }else{ console.log('Failed to create screen: ',err); req.session.messages = { validationErrors: err }; res.redirect('screens/new'); return; } }); }; exports.addWidget = function(req, res){ var data = { username: req.session.user.username, title: 'Screen : Create New', screens: req.session.screens, screen:req.session.screen, widgets:req.session.widgets }; res.render("screens/widgets/add", data) }; exports.updateWidgets = function(req, res){ // res.send("widgets size: " + req.body.widgets.length +" Instance of " +( req.body.widgets instanceof Array)) // return; var Screen = require("../models/screen.js") Screen.addWidgets(req.params.id, req.body.widgets, function(err, suc){ if(err){ console.log("Error adding widgets to the screen: ", err); req.session.messages = { errors: ["Error adding widgets to the screen: " + err] }; res.redirect("/screens/"+req.params.id + "/widgets/add"); }else{ console.log(" Widgets added successfully!!") req.session.messages = { success: [ "Widgets added successfully!!"] }; res.redirect("/screens/"+req.params.id ); } }) } exports.removeWidget = function(req, res){ }; exports.delete = function (req, res) { if (!req.session.screen) { req.session.messages = { errors: ['screen not found'] }; } else { var Screen = require('../models/screen'); Screen.destroy(req.session.screen, function(err){ if(err){ util.log("Failed to delete screen "+err); req.session.messages = { errors: ['Failed to delete screen. ' + err] }; }else{ util.log("Screen deleted successfully"); req.session.messages = { success: ['Screen ' + req.session.screen.name + ' deleted successfully'] }; req.session.screen = null; } res.redirect('/'); return; }); } };
sahilsk/Dashboard-Extended
controllers/screens.js
JavaScript
mit
4,134
var db=require('./dbDatabase'); var mysql=require('mysql'); var connect_pool=mysql.createPool(db.options); connect_pool.connectionLimit=100; //准备好20个链接 connect_pool.queueLimit=100; //最大链接数 function getConnection(callback){ connect_pool.getConnection(function(err,client){ if(err){ console.log(err.message); setTimeout(getConnection,2000); } callback(client); }) } exports.getConnection=getConnection;
zhuliyu/Learning-Platform
util/DBHelper.js
JavaScript
mit
466
angular.module('factoria', ['firebase']) .factory('fireService', ['$firebaseArray', function($firebaseArray){ var firebaseRef= ""; var setFirebaseSource = function(url){ firebaseRef= new Firebase(url); }; var getFirebaseRoot = function(){ return firebaseRef; }; var addData = function(data){ // persist our data to firebase var ref = getFirebaseRoot(); return $firebase(ref).$push(data); }; var getData = function(callback){ var ref = getFirebaseRoot(); //TODO: //Call koaRender to update new elements style return $firebaseArray(ref); } var service = { setFirebaseSource : setFirebaseSource, addData : addData, getData : getData, getFirebaseRoot : getFirebaseRoot }; return service; }]);
KingofApp/koa-module-firebase
factory.js
JavaScript
mit
868
//A container for data pertaining to the local card game state. Defines the decks stored locally as well as the local player data. class CardSystem { constructor() { this.deck = [random_deck()]; //Plan on having multiple decks available this.player = new Player(); this.player.deck = this.deck[0].copy(); this.duel = null; this.player.duel = this.duel; } reset() { this.player.deck = this.deck[0].copy(); this.duel = null; this.player.duel = this.duel; this.player.prizeTokens = 0; } } //An object representing a card. Clickable. class CardObject { constructor(slot, card, op, parent) { var d = card.index; var game = Client.game; this.parent = parent; this.isOpponents = op; this.obj = game.add.button( slot.obj.x, slot.obj.y, 'cards', this.click, this ); this.obj.anchor.setTo(0.5, 0.5); this.obj.height = 140; this.obj.width = 104; this.obj.angle = 90; if(op) { this.obj.angle *= -1; } this.obj.p = this; this.text = game.add.text( slot.obj.x, slot.obj.y, "HP 0/ 0\nATK 0\nDEF 0", { font: "16px Courier New", fill: "#ffffff", stroke: '#000000', align: "left" }); this.text.strokeThickness = 4; this.text.anchor.setTo(0.5, 0.5); this.card = card; if(this.card.type != CardType.MEMBER) { this.text.text = ""; } this.hpCTR = 0; this.revealed = !this.isOpponents; card.obj = this; this.game = game; this.ls = Client; this.slot = slot; this.channel = null; this.state = game.state.getCurrentState(); this.parent.add(this.obj); } isMember() { return this.card.type == CardType.MEMBER; } isChannel() { return this.card.type == CardType.CHANNEL; } isMeme() { return this.card.type == CardType.MEME; } isRole() { return this.card.type == CardType.ROLE; } getName() { return this.card.name; } getOriginalName() { return this.card.original_name; } hasOriginalName() { return this.card.name == this.card.original_name; } getAttack() { return this.card.atk; } getDefense() { return this.card.def; } getLevel() { return this.card.lvl; } getMemeCategory() { return this.card.category; } getChannelSubject() { return this.card.subject; } click() { var local = this.ls.cardsys.duel.local; var duel = this.ls.cardsys.duel; if(Game.waitAnim || Game.inputLayer > 0) return; if(this.isOpponents) { if(!this.revealed) return; if(duel.phase == DuelPhase.BATTLE) { var local = duel.local; var cobj = local.selected.obj; var c = local.selected; if(local.selected == null) return; var b = validAttackTarget(c, this.slot, duel) Client.chat.write(`Valid: ${b}`); if(b) { if(c.attacks > 0) { Client.sendMove("ATTACK " + cobj.slot.name + " " + this.slot.name); c.attacks--; Game.attack(cobj, this.slot); } } return; } this.state.obj.pv.x = this.game.world.centerX; this.state.obj.pv.y = this.game.world.centerY; this.state.obj.pv.key = 'cards'; if(this.card.index !== 0 || this.card.index > CardIndex.length) { this.state.obj.pv.frame = this.card.index - 1; } else { this.state.obj.pv.frame = UNDEFINED_CARD_INDEX; } return; } if(duel.phase === DuelPhase.DRAW) { if(this.slot.type === SlotType.DECK) { if(duel.draws < 5) { this.draw(); } } return; } if(local.selected === this.card) { this.state.obj.pv.x = this.game.world.centerX; this.state.obj.pv.y = this.game.world.centerY; this.state.obj.pv.key = 'cards'; if(this.card.index !== 0 || this.card.index > CardIndex.length) { this.state.obj.pv.frame = this.card.index - 1; } else { this.state.obj.pv.frame = UNDEFINED_CARD_INDEX; } } else { local.selected = this.card; } if(this.slot !== null) { //Client.sendMove("SELECT " + this.slot.name); } } draw() { var duel = this.ls.cardsys.duel; if(this.isOpponents) { duel.opponent.deck.draw(); } else { duel.player.deck.draw(); var next = new CardObject(this.slot, duel.player.deck.get_top(), this.isOpponents, this.parent); this.parent.bringToTop(this.obj); this.state.obj.local.deck = next; this.move({ x: 104, y: (duel.local.hand.length * 104) + 132 }); duel.local.hand.push(this); this.slot = null; duel.draws++; if(duel.draws >= 5) { duel.phase++; duel.effectPhase(); } } Client.sendMove("DRAW"); } move(dest, cb=function(duel){}) { //var distance = Phaser.Math.distance(this.obj.x, this.obj.y, dest.x, dest.y); var duration = 250; var local = this.ls.cardsys.duel.local; local.selected = null; this.obj.input.enabled = false; this.parent.bringToTop(this.obj); var tween = this.game.add.tween(this.obj).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween.onComplete.addOnce(function(obj, tween) { obj.input.enabled = true; }); tween.start(); var tween2 = this.game.add.tween(this.text).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween2.onComplete.addOnce(function(obj, tween2) { cb(Client.cardsys.duel); }); tween2.start(); } update() { if(!this.revealed) { this.obj.frame = UNDEFINED_CARD_INDEX; this.text.text = ""; return; } if(this.card.index > 0 && this.card.index < CardIndex.length) { this.obj.frame = this.card.index - 1; } else { this.obj.frame = UNDEFINED_CARD_INDEX; } if(this.ls.cardsys.duel.local.selected === this.card) { this.obj.tint = 0x7F7FFF; } else { this.obj.tint = 0xFFFFFF; } if(this.card.type == CardType.MEMBER) { if(this.hpCTR > this.card.currentHP) { this.hpCTR--; } else if(this.hpCTR < this.card.currentHP) { this.hpCTR++; } if(this.slot == null) { this.text.text = ""; } else { this.text.text = "HP " + this.hpCTR + "/ " + this.card.hp + "\nATK " + this.card.atk + "\nDEF " + this.card.def; } } } } //An object representing the deck. class DeckObject { constructor(slot, card, op, parent) { var d = card.index; var game = Client.game; this.parent = parent; this.isOpponents = op; this.obj = game.add.button( slot.obj.x, slot.obj.y, 'cards', this.click, this ); this.obj.anchor.setTo(0.5, 0.5); this.obj.height = 140; this.obj.width = 104; this.obj.angle = 90; if(op) { this.obj.angle *= -1; } this.text = game.add.text( slot.obj.x, slot.obj.y, "0", { font: "16px Courier New", fill: "#ffffff", stroke: '#000000', align: "left" }); this.text.strokeThickness = 4; this.text.anchor.setTo(0.5, 0.5); this.card = card; if(this.card.type != CardType.MEMBER) { this.text.text = ""; } this.revealed = !this.isOpponents; card.obj = this; this.game = game; this.ls = Client; this.slot = slot; this.channel = null; this.state = game.state.getCurrentState(); this.parent.add(this.obj); } click() { var local = this.ls.cardsys.duel.local; var duel = this.ls.cardsys.duel; if(Game.waitAnim || Game.inputLayer > 0) return; if(this.isOpponents) { //this.draw(); return; } if(duel.phase === DuelPhase.DRAW) { if(this.slot.type === SlotType.DECK) { if(duel.draws < 1) { this.draw(); } } return; } if(this.slot !== null) { //Client.sendMove("SURRENDER"); } } draw(cb=function(duel){}) { var duel = this.ls.cardsys.duel; var game = this.ls.game; var sounds = this.ls.sounds; if(duel.phase == DuelPhase.DRAW) { Client.sendMove("DRAW 1"); } if(this.isOpponents) { var next = new CardObject(this.slot, duel.opponent.deck.get_top(), this.isOpponents, this.parent); next.revealed = true; this.parent.bringToTop(next.obj); //obj.remote.hand.push(next); //obj.remote.hand.updateHandPositions(); duel.remote.hand.push(next); Game.addToHand(next, this.isOpponents); Game.updateHand(cb); var n = getRandomInt(1, 3); if(n == 1) { sounds['card1'].play(); } else if(n == 2) { sounds['card0'].play(); } else { sounds['card3'].play(); } //duel.remote.hand.updateHandPositions(); next.slot = null; duel.opponent.deck.draw(); } else { var next = new CardObject(this.slot, duel.player.deck.get_top(), this.isOpponents, this.parent); this.parent.bringToTop(next.obj); //this.state.obj.local.deck = next; //next.move({ // x: 104, // y: (duel.local.hand.length * 104) + 132 //}); //obj.local.hand.push(next); //obj.local.hand.updateHandPositions(); duel.local.hand.push(next); Game.addToHand(next, this.isOpponents); Game.updateHand(cb); var n = getRandomInt(1, 3); if(n == 1) { sounds['card1'].play(); } else if(n == 2) { sounds['card0'].play(); } else { sounds['card3'].play(); } //duel.local.hand.updateHandPositions(); next.slot = null; duel.player.deck.draw(); duel.draws++; if(duel.draws >= 1) { duel.phase = DuelPhase.EFFECT; duel.effectPhase(); } } } move(dest) { //var distance = Phaser.Math.distance(this.obj.x, this.obj.y, dest.x, dest.y); var duration = 250; var local = this.ls.cardsys.duel.local; local.selected = null; this.obj.input.enabled = false; var tween = this.game.add.tween(this.obj).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween.onComplete.addOnce(function(obj, tween) { obj.input.enabled = true; }); tween.start(); var tween2 = this.game.add.tween(this.text).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween2.onComplete.addOnce(function(obj, tween2) { }); tween2.start(); } update() { this.obj.frame = UNDEFINED_CARD_INDEX; if(this.isOpponents) { this.text.setText(`${Client.cardsys.duel.opponent.deck.card.length}`); } else { this.text.setText(`${Client.cardsys.duel.player.deck.card.length}`); } } } //An object that controls the hand. Automatically spaces out cards and handles animation. class HandObject { constructor(p, op, parent) { var game = Client.game; this.parent = parent; this.isOpponents = op; this.objs = []; this.pos = { x: p.x, y: p.y, }; this.revealed = !this.isOpponents; this.game = game; this.ls = Client; this.state = game.state.getCurrentState(); } get(index) { return this.objs[index]; } updateHandPositions(fn, fcb=function(duel){}) { var duration = 250; var local = this.ls.cardsys.duel.local; local.selected = null; var tweens = []; for(i in this.objs) { var dest = {x: this.pos.x, y: (this.pos.y + (104 * (i - this.objs.length / 2)))}; //Client.chat.write("X=" + dest.x + ",Y=" + dest.y); this.objs[i].obj.input.enabled = false; var tween = this.game.add.tween(this.objs[i].obj).to(dest, duration, Phaser.Easing.Quadratic.InOut); if(i >= this.objs.length - 1) { tween.onComplete.addOnce(function(obj, tween) { fn(obj.p); fcb(Client.cardsys.duel); obj.input.enabled = true; }); } else { tween.onComplete.addOnce(function(obj, tween) { obj.input.enabled = true; }); } tween.start(); tweens.push(tween); var tween2 = this.game.add.tween(this.objs[i].text).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween2.onComplete.addOnce(function(obj, tween2) { }); tween2.start(); tweens.push(tween2); } } push(o) { this.objs.push(o); this.parent.add(o.obj); } remove(o) { var j = -1; for(i in this.objs) { if(this.objs[i] === o) j = i; } if(j !== -1) { this.objs.splice(j, 1); } return j; //this.parent.add(o.obj); } check(o) { for(i in this.objs) { if(this.objs[i] === o) return true; } return false; } /*click() {} draw() { } move(dest) { //var distance = Phaser.Math.distance(this.obj.x, this.obj.y, dest.x, dest.y); var duration = 250; var local = this.ls.cardsys.duel.local; local.selected = null; this.obj.input.enabled = false; var tween = this.game.add.tween(this.obj).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween.onComplete.addOnce(function(obj, tween) { obj.input.enabled = true; }); tween.start(); var tween2 = this.game.add.tween(this.text).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween2.onComplete.addOnce(function(obj, tween2) { }); tween2.start(); }*/ update() { for(i in this.objs) { this.objs[i].update(); } } } //An object that represents the Offline Space. Automatically controls animations. class OfflineObject { constructor(p, op, parent) { var game = Client.game; this.parent = parent; this.isOpponents = op; this.objs = []; this.pos = { x: p.x + 70, y: p.y + 50, }; this.revealed = true; this.game = game; this.ls = Client; this.state = game.state.getCurrentState(); } updatePositions() { var duration = 250; var local = this.ls.cardsys.duel.local; local.selected = null; var tweens = []; for(i in this.objs) { var dest = {x: this.pos.x, y: this.pos.y }; //Client.chat.write("X=" + dest.x + ",Y=" + dest.y); this.objs[i].obj.input.enabled = false; var tween = this.game.add.tween(this.objs[i].obj).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween.onComplete.addOnce(function(obj, tween) { obj.input.enabled = true; }); tween.start(); tweens.push(tween); var tween2 = this.game.add.tween(this.objs[i].text).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween2.onComplete.addOnce(function(obj, tween2) { }); tween2.start(); tweens.push(tween2); } } push(o) { this.objs.push(o); this.parent.add(o.obj); } remove(o) { var j = -1; for(i in this.objs) { if(this.objs[i] === o) j = i; } if(j !== -1) { this.objs.splice(j, 1); } //this.parent.add(o.obj); } check(o) { for(i in this.objs) { if(this.objs[i] === o) return true; } return false; } /*click() {} draw() { } move(dest) { //var distance = Phaser.Math.distance(this.obj.x, this.obj.y, dest.x, dest.y); var duration = 250; var local = this.ls.cardsys.duel.local; local.selected = null; this.obj.input.enabled = false; var tween = this.game.add.tween(this.obj).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween.onComplete.addOnce(function(obj, tween) { obj.input.enabled = true; }); tween.start(); var tween2 = this.game.add.tween(this.text).to(dest, duration, Phaser.Easing.Quadratic.InOut); tween2.onComplete.addOnce(function(obj, tween2) { }); tween2.start(); }*/ update() { for(i in this.objs) { this.objs[i].update(); } } } //An object that represents a card selector button. Used in prompts. class CardSelectObject { constructor() { var game = Client.game; this.obj = game.add.button( -1000, 500, 'cards', this.click, this ); this.obj.height = 281; this.obj.width = 201; this.obj.angle = 0; } init(c, op, parent) { var game = Client.game; this.parent = parent; this.isOpponents = op; //this.obj = game.add.button( // -1000, // 500, // 'cards', // this.click, // this //); //this.obj.anchor.setTo(0.5, 0.5); this.card = c; } setSelected(b) { this.selected = b; } click() { this.parent.selected = this; } update() { this.obj.frame = this.card.index - 1; if(this.parent.selected === this) { this.obj.tint = 0x7F7FFF; } else { this.obj.tint = 0xFFFFFF; } } } //An object that represents the select card prompt that allows the user to select a card. Handles the layout of the prompt and animations. class SelectCardPrompt { constructor(pos) { var game = Client.game; this.pos = pos; this.onConfirm = function(c){}; this.selected = null; this.objs = []; this.dobjs = []; this.back = game.add.tileSprite(pos.x, pos.y, pos.width, pos.height, 'promptsc', 2, ui); this.back.y += pos.height; this.text = game.add.text(pos.text.x, pos.text.y, "", { font: pos.text.pxsize + "px Impact", fill: "#FFFFFF", align: "center" }); this.text.y += pos.height; this.confirmButton = game.add.button( this.pos.button.x, this.pos.button.y, 'buttons3', function() { if(this.selected !== null) { this.hide(function(pr){ pr.p.hidden = true; Game.inputLayer = 0; pr.p.onConfirm(pr.p.selected.card); }); } }, this ); this.confirmButton.p = this; this.confirmButton.frame = 4; this.confirmButton.y += pos.height; this.scroll = 0; this.hidden = true; for(var i = 0; i < 40; i++) { this.dobjs.push(new CardSelectObject()); } this.dobjsid = 0; } setMsg(msg) { this.text.setText(msg); } clear() { this.objs = []; this.dobjsid = 0; this.selected = null; } add(c) { var nb = this.dobjs[this.dobjsid]; nb.init(c, false, this); this.objs.push(nb); this.dobjsid++; } getSelected() { return this.selected; } setConfirmCallback(onConfirm) { this.onConfirm = onConfirm; } show() { var game = Client.game; var tween = game.add.tween(this.back).to( { y: this.pos.y }, 100, Phaser.Easing.Linear.None, true, 0); var tween2 = game.add.tween(this.text).to( { y: this.pos.text.y }, 100, Phaser.Easing.Linear.None, true, 0); var tween3 = game.add.tween(this.confirmButton).to( { y: this.pos.button.y }, 100, Phaser.Easing.Linear.None, true, 0); tween.start(); tween2.start(); tween3.start(); this.hidden = false; } hide(onFinish) { var game = Client.game; var tween = game.add.tween(this.back).to( { y: this.pos.y + this.pos.height }, 100, Phaser.Easing.Linear.None, true, 0); var tween2 = game.add.tween(this.text).to( { y: this.pos.text.y + this.pos.height }, 100, Phaser.Easing.Linear.None, true, 0); var tween3 = game.add.tween(this.confirmButton).to( { y: this.pos.button.y + this.pos.height }, 100, Phaser.Easing.Linear.None, true, 0); tween.start(); tween2.start(); tween3.onComplete.addOnce(function(obj, tween){ onFinish(obj); }); tween3.start(); } calcButtonPosition(index) { //var xx = this.pos.card.x + (this.pos.card.width * index) - (this.scroll * this.pos.card.width); var xx = this.pos.card.x + (this.pos.card.width * index) - (this.scroll * this.pos.card.width * this.objs.length); var pos = { //x: xx + 230, x: 10 + (202 * index), y: (this.pos.card.y - 141) + (this.back.y - this.pos.y) } return pos; } update() { if(this.hidden) return; for(i in this.objs) { var pos = this.calcButtonPosition(i); this.objs[i].obj.x = pos.x; this.objs[i].obj.y = pos.y; this.objs[i].update(); } } } const ChannelType = { NON : 0, SRS : 1, GMG : 2, MDA : 3, MTR : 4, MEM : 5 } //Returns a random number between min and max - 1 inclusive function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive } //Damage calculation function function calcDamage(atk, def) { var dmg = Math.round((atk * 1.5) - (def * 1.5)); if(dmg < 1) dmg = 1; return dmg; } //Converts a raw array of numbers into a deck. function make_deck(rawDeck) { var deck = new Deck(); for(i in rawDeck) { var card = new Card(); card.set_index(rawDeck[i]); deck.add(card); } return deck; } //Returns a random deck function random_deck() { var cards = 40; var deck = new Deck(); for(i = 0; i < cards; i++) { var n = getRandomInt(1, 152); var c = new Card(); c.set_index(n); deck.add(c); } return deck; } //Returns true if a deck is playable function check_deck(deck) { var cards = 40; var numChannels = 0; var numMembers = 0; for(i = 0; i < cards; i++) { var c = deck.card[i]; if(c.type == CardType.MEMBER) numMembers++; if(c.type == CardType.CHANNEL) numChannels++; } return (numChannels >= 1 && numMembers >= 1); } //Returns a random deck that is guarenteed to be playable function random_playable_deck() { var cards = 40; var deck = null; do { deck = new Deck(); for(i = 0; i < cards; i++) { var n = getRandomInt(1, 152); var c = new Card(); c.set_index(n); deck.add(c); } } while(!check_deck(deck)); return deck; } //Returns a dummy deck used for testing function dummy_deck() { var cards = 40; var deck = new Deck(); for(i = 0; i < cards; i++) { var n = DummyDeck[i]; var c = new Card(); c.set_index(n); deck.add(c); } return deck; } //Initializes CardIndex with the JSON string str. function loadCardData(str) { CardIndex = JSON.parse(str); } //Returns whether a card can be moved to a slot. function validSlot(card, slot, duel) { if(!slot.empty()) return false; if(slot.isOpponents) return false; if(card.type === CardType.CHANNEL && slot.type === SlotType.CHANNEL) { return true; } if((card.type === CardType.ROLE || card.type === CardType.MEMBER) && slot.type === SlotType.MEMROLE ) { if(slot.channel.empty()) return false; if(card.type === CardType.MEMBER && card.lvl > 1) return ( duel.local.getLevelOneMembers().length > card.lvl - 2 ); return true; } if(card.type === CardType.MEME && slot.type === SlotType.MEME) { return true; } return false; } //Returns whether a slot is a valid attack target function validAttackTarget(card, slot, duel) { if(slot.empty()) return false; if(!slot.isOpponents) return false; if(card.type !== CardType.MEMBER && (card.type !== CardType.MEME || card.category !== MemeCategory.VRT)) { return false; } if(slot.type === SlotType.CHANNEL) { return true; } if(slot.type === SlotType.MEMROLE && slot.card.card.type === CardType.MEMBER) { return true; } return false; } const SlotType = { UNDEFINED : 0, MEMROLE : 1, CHANNEL : 2, MEME : 3, DECK : 4, OFFLINE : 5 } const SlotFrame = { UNDEFINED : 0, DISABLED : 1, OPEN : 2 } //An object representing a slot on the game board. class Slot { constructor(pos, type, op, channel) { this.type = type; //Whether the slot is controlled by the opponent. this.isOpponents = op; //The card that is in this slot. this.card = null; this.hpCTR = 0; //Channel slot connected to this one. this.channel = channel; var game = Client.game; //The button object. this.obj = game.add.button( pos.x + 70, pos.y + 51, 'cardmask', this.click, this ); this.obj.anchor.setTo(0.5, 0.5); this.obj.height = 140; this.obj.width = 104; this.obj.angle = 90; this.obj.frame = SlotFrame.UNDEFINED; //The name of the slot. this.name = ""; this.ls = Client; } //Returns true if a card is not in this slot. False otherwise. empty() { return (this.card === null); } refresh() { if(!this.empty()) this.card.resetAttacks(); } //Called when the user clicks the card slot. click() { var duel = this.ls.cardsys.duel; var player = duel.player; if(duel.turn !== player) return; if(duel.local.selected !== null) { if(duel.phase === DuelPhase.ACTION) { if(Game.isInHand(duel.local.selected.obj, false)) { var local = duel.local; var cobj = local.selected.obj; var c = local.selected; if(validSlot(c, this, duel)) { cobj.move({x: this.obj.x, y: this.obj.y}); this.card = cobj; if(cobj.slot !== null) { cobj.slot.card = null; } cobj.slot = this; local.selected = null; var j = Game.removeFromHand(cobj, false); var n = this.name; Game.updateHand(); Client.sendMove("PLAY " + j + " " + n); Game.playCard(cobj, false); } } } else if(duel.phase === DuelPhase.BATTLE) { //if(Game.isOnField(duel.local.selected.obj, false)) { var local = duel.local; var cobj = local.selected.obj; var c = local.selected; if(validAttackTarget(c, this, duel)) { if(cobj.attacks > 0) { Game.attack(c, this); this.card = cobj; //if(cobj.slot !== null) { // cobj.slot.card = null; //} //cobj.slot = this; local.selected = null; } } //} } } } update() { var duel = this.ls.cardsys.duel; var game = this.ls.game; var player = duel.player; if(duel.turn !== player) { this.obj.frame = 1; } if(duel.local.selected !== null) { if(duel.local.selected === this.card) { this.obj.frame = 0; return; } if(Game.isInHand(duel.local.selected.obj, false)) { if(validSlot(duel.local.selected, this, duel)) { this.obj.frame = 2; } else { this.obj.frame = 1; } } } else { this.obj.frame = 0; } if(this.card !== null) { this.card.update(); } } } //Player data object. class Player { constructor() { //The player's active deck. this.deck = random_deck(); //The player's current active duel. this.duel = null; //The player's current prize token count. this.prizeTokens = 0; //The player's registered name. this.name = null; //The player's rank. this.rank = 0; } }
DanZC/phaser-tcg
scripts/felfdip.js
JavaScript
mit
29,710
const path = require('path'); const wmd = require('wmd'); const {getFile} = require('./importHelpers'); const createContextForList = (folderContents) => { let promises = []; return new Promise((resolve, reject) => { for (let file in folderContents) { let promise = getFile(folderContents[file].path); promises.push(promise); } Promise.all(promises).then(results => { for (let file in folderContents) { const content = wmd(results[file], { preprocessors: [wmd.preprocessors.metadata, wmd.preprocessors.fencedCodeBlocks] }); folderContents[file].meta = content.metadata; } resolve(folderContents); }); }); } // gets context data from file url - works both for list entries and pages const createContextFromFile = (fileUrl) => { return new Promise((resolve, reject) => { getFile(fileUrl).then(data => { const parsedData = { context: wmd(data, { preprocessors: [wmd.preprocessors.metadata, wmd.preprocessors.fencedCodeBlocks] }), fileName: path.parse(fileUrl).name, } resolve(parsedData); }); }); } module.exports.createContextForList = createContextForList; module.exports.createContextFromFile = createContextFromFile;
mrmnmly/mrwrittr
api/api/contextHelpers.js
JavaScript
mit
1,235
class AchievementEvt { constructor(subType, payload) { this.type = 'achievements'; this.subType = subType; this.payload = payload; } }; /** * generate PageVisitEvt * @param {string} * @returns {AchievementEvt} */ export class PageVisitEvt extends AchievementEvt { constructor(pageName) { super('page-visited', pageName); } }; /** * generate ForgotPasswordEvt * @param {String} targetEmail * @returns {AchievementEvt} */ export class ForgotPasswordEvt extends AchievementEvt { constructor(targetEmail) { super('forgot-password', targetEmail); } }; /** * generate ForgotPasswordEvt * @returns {AchievementEvt} */ export class MoodRegisteredEvt extends AchievementEvt { constructor() { super('mood-registered'); } }; /** * generate TimeTravelEvt * @param {Object} targetRange * @returns {AchievementEvt} */ export class TimeTravelEvt extends AchievementEvt { constructor(targetRange) { super('time-travel', targetRange); } }; // TODO // clickedOnNotification from SW - just after action [fast hand, tchin tchin, chain reaction] // ensure all ui event are processed - OK [mood entry, page visits, past, future, forgot password] await TEST [duck face] KO [duck face] // snackbar for achievements + animation const badgesConfig = { badgesArray: [ { title: 'adventurer', description: 'visited all pages in one session', badge: 'adventurer' }, { title: 'lost in translation', description: 'went to 404 page', badge: 'lost-in-translation' }, { title: 'duck face', description: 'got a custom avatar', badge: 'no-more-faceless' }, { title: 'goldfish', description: 'forgot password mechanism activated X1', badge: 'goldfish' }, { title: 'alzeihmer', description: 'forgot password mechanism activated X3', badge: '019-grandfather' }, { title: 'mood alert', description: 'subscribed for notifications', badge: '003-smartphone' }, { title: 'mood monitor', description: 'multiple subscriptions for notifications', badge: '010-technology' }, { title: 'fast hand', description: 'clicked on notification', badge: 'fast-hand' }, { title: 'tchin tchin', description: 'your mood update notification nudged someone else mood update', badge: '001-toast' }, { title: 'chain reaction', description: 'your mood update notification nudged two persons to update their mood', badge: '007-share' }, { title: 'back to the future', description: 'time traveled more than one month in the past', badge: 'back-to-the-future' }, { title: 'fortuneteller', description: 'tried to time travel more than a month in the future. Tip: it is useless!', badge: '010-crystal-ball' }, { title: 'noob moodist', description: 'first mood update', badge: '014-helmet' }, { title: 'baron moodist', description: 'updated mood three days straight', badge: '011-crown-2' }, { title: 'duke moodist', description: 'updated mood a full week straight', badge: '012-crown-1' }, { title: 'archduke moodist', description: 'updated mood a full month straight', badge: '010-crown-3' }, { title: 'king moodist', description: 'updated mood three months straight', badge: '013-crown' }, { title: 'emperor moodist', description: 'updated mood a full year straight', badge: '003-greek' }, { title: 'happy days', description: 'positive mood for the last five updates', badge: '005-heavy-metal' }, { title: 'depression', description: 'negative mood for the last five updates', badge: '006-crying' }, { title: 'zen & balanced', description: 'neurtral mood for the last three updates', badge: '003-libra' }, { title: 'mood roller coaster', description: 'changed mood from positive to negative, or reverse, in one day', badge: '005-roller-coaster' }, { title: 'mood swings meds', description: 'changed mood more than three times a day', badge: '008-pills' }, { title: 'blissed', description: 'mood updated to highest possible score', badge: '004-island' }, { title: 'suicidal tendencies', description: 'mood updated to lowest possible score', badge: '006-gallows' }, { title: 'come back', description: 'from negative to positive mood', badge: '005-profits' }, { title: 'mood swing', description: 'from positive to negative mood', badge: '004-loss' }, { title: 'stairway to heaven', description: 'mood increased 5 scores at once', badge: '015-paper-plane' }, { title: 'nuclear disaster', description: 'mood decreased 5 scores at once', badge: '007-bomb-detonation' } ], AchievementsEvts: { PageVisitEvt: PageVisitEvt, ForgotPasswordEvt: ForgotPasswordEvt, TimeTravelEvt: TimeTravelEvt, MoodRegisteredEvt: MoodRegisteredEvt }, technical: { gravatarImagesCacheName: '$$$toolbox-cache$$$https://moodies-1ad4f.firebaseapp.com/$$$', adventurerPageList: ['home', 'profile', 'users', 'mood-input', 'time-travel', 'about', 'badges'], adventurerID: 'adventurer', lostInTranslationPageList: ['404'], lostInTranslationID: 'lost in translation', backToTheFutureID: 'back to the future', fortunetellerID: 'fortuneteller', alzeihmerGoldfishID: 'forgotPasswordCounter', duckFaceID: 'duck face', moodsRelatedAchievementsSpecialEvt: 'all-moods-related-achievements' } }; export default badgesConfig;
kairos666/moodys
src/config/badges.js
JavaScript
mit
5,494
function InputHandler(viewport) { var self = this; self.pressedKeys = {}; self.mouseX = 0; self.mouseY = 0; self.mouseDownX = 0; self.mouseDownY = 0; self.mouseMoved = false; self.mouseDown = false; self.mouseButton = 0; // 1 = left | 2 = middle | 3 = right self.viewport = viewport; var viewportElem = viewport.get(0); viewportElem.ondrop = function(event) { self.onDrop(event); }; viewportElem.ondragover = function(event) { event.preventDefault(); }; viewportElem.onclick = function(event) { self.onClick(event); }; viewportElem.onmousedown = function(event) { self.onMouseDown(event); }; window.onmouseup = function(event) { self.onMouseUp(event); }; window.onkeydown = function(event) { self.onKeyDown(event); }; window.onkeyup = function(event) { self.onKeyUp(event); }; window.onmousemove = function(event) { self.onMouseMove(event); }; viewportElem.oncontextmenu = function(event) { event.preventDefault();}; viewport.mousewheel(function(event) { self.onScroll(event); }); } InputHandler.prototype.update = function(event) { for(var key in this.pressedKeys) { this.target.onKeyDown(key); } }; InputHandler.prototype.onKeyUp = function(event) { delete this.pressedKeys[event.keyCode]; }; InputHandler.prototype.onKeyDown = function(event) { // Avoid capturing key events from input boxes and text areas var tag = event.target.tagName.toLowerCase(); if (tag == 'input' || tag == 'textarea') return; var keyCode = event.keyCode; this.pressedKeys[keyCode] = true; var ctrl = event.ctrlKey; this.target.onKeyPress(keyCode, ctrl); }; InputHandler.prototype.isKeyDown = function(key) { var isDown = this.pressedKeys[key] !== undefined; return isDown; }; // Return mouse position in [0,1] range relative to bottom-left of viewport (screen space) InputHandler.prototype.convertToScreenSpace = function(pageX, pageY) { var left = this.viewport.offset().left; var top = this.viewport.offset().top; var width = this.viewport.innerWidth(); var height = this.viewport.innerHeight(); var x = (pageX - left)/width; var y = -(pageY - top)/height + 1.0; return [x,y]; }; InputHandler.prototype.onDrop = function(event) { event.preventDefault(); var mouse = this.convertToScreenSpace(event.pageX, event.pageY); var assetName = event.dataTransfer.getData("text"); this.target.dropAsset(assetName, mouse[0], mouse[1]); }; InputHandler.prototype.onClick = function(event) { if(this.mouseMoved) return; var screenSpace = this.convertToScreenSpace(event.pageX, event.pageY); this.target.onClick(screenSpace[0], screenSpace[1]); }; InputHandler.prototype.onMouseDown = function(event) { this.viewport.focus(); if(this.mouseButton > 0) return; // Don't process a mouse down from a different button until the current one is done this.mouseButton = event.which; this.mouseDown = true; var mouseX = event.pageX; var mouseY = event.pageY; this.mouseDownX = mouseX; this.mouseDownY = mouseY; this.mouseMoved = false; var screenSpace = this.convertToScreenSpace(mouseX, mouseY); this.target.onMouseDown(screenSpace[0], screenSpace[1], this.mouseButton) }; InputHandler.prototype.onMouseUp = function(event) { this.mouseDown = false; this.mouseButton = 0; }; InputHandler.prototype.onMouseMove = function(event) { var mouseX = event.pageX; var mouseY = event.pageY; // Ignore click if mouse moved too much between mouse down and mouse click if(Math.abs(this.mouseDownX - mouseX) > 3 || Math.abs(this.mouseDownY - mouseY) > 3) { this.mouseMoved = true; } if(this.mouseDown) { event.preventDefault(); } var mouseMoveX = mouseX - this.mouseX; var mouseMoveY = mouseY - this.mouseY; this.mouseX = mouseX; this.mouseY = mouseY; var screenSpace = this.convertToScreenSpace(mouseX, mouseY); this.target.onMouseMove(screenSpace[0], screenSpace[1], mouseMoveX, mouseMoveY, this.mouseButton); }; InputHandler.prototype.onScroll = function(event) { this.target.onScroll(event.deltaY); };
PhiladelphiaGameLab/Flip
js/util/InputHandler.js
JavaScript
mit
4,207
// Generated by CoffeeScript 1.9.1 (function() { var bcv_parser, bcv_passage, bcv_utils, root, hasProp = {}.hasOwnProperty; root = this; bcv_parser = (function() { bcv_parser.prototype.s = ""; bcv_parser.prototype.entities = []; bcv_parser.prototype.passage = null; bcv_parser.prototype.regexps = {}; bcv_parser.prototype.options = { consecutive_combination_strategy: "combine", osis_compaction_strategy: "b", book_sequence_strategy: "ignore", invalid_sequence_strategy: "ignore", sequence_combination_strategy: "combine", invalid_passage_strategy: "ignore", non_latin_digits_strategy: "ignore", passage_existence_strategy: "bcv", zero_chapter_strategy: "error", zero_verse_strategy: "error", book_alone_strategy: "ignore", book_range_strategy: "ignore", captive_end_digits_strategy: "delete", end_range_digits_strategy: "verse", include_apocrypha: false, ps151_strategy: "c", versification_system: "default", case_sensitive: "none" }; function bcv_parser() { var key, ref, val; this.options = {}; ref = bcv_parser.prototype.options; for (key in ref) { if (!hasProp.call(ref, key)) continue; val = ref[key]; this.options[key] = val; } this.versification_system(this.options.versification_system); } bcv_parser.prototype.parse = function(s) { var ref; this.reset(); this.s = s; s = this.replace_control_characters(s); ref = this.match_books(s), s = ref[0], this.passage.books = ref[1]; this.entities = this.match_passages(s)[0]; return this; }; bcv_parser.prototype.parse_with_context = function(s, context) { var entities, ref, ref1, ref2; this.reset(); ref = this.match_books(this.replace_control_characters(context)), context = ref[0], this.passage.books = ref[1]; ref1 = this.match_passages(context), entities = ref1[0], context = ref1[1]; this.reset(); this.s = s; s = this.replace_control_characters(s); ref2 = this.match_books(s), s = ref2[0], this.passage.books = ref2[1]; this.passage.books.push({ value: "", parsed: [], start_index: 0, type: "context", context: context }); s = "\x1f" + (this.passage.books.length - 1) + "/9\x1f" + s; this.entities = this.match_passages(s)[0]; return this; }; bcv_parser.prototype.reset = function() { this.s = ""; this.entities = []; if (this.passage) { this.passage.books = []; return this.passage.indices = {}; } else { this.passage = new bcv_passage; this.passage.options = this.options; return this.passage.translations = this.translations; } }; bcv_parser.prototype.set_options = function(options) { var key, val; for (key in options) { if (!hasProp.call(options, key)) continue; val = options[key]; if (key === "include_apocrypha" || key === "versification_system" || key === "case_sensitive") { this[key](val); } else { this.options[key] = val; } } return this; }; bcv_parser.prototype.include_apocrypha = function(arg) { var base, base1, ref, translation, verse_count; if (!((arg != null) && (arg === true || arg === false))) { return this; } this.options.include_apocrypha = arg; this.regexps.books = this.regexps.get_books(arg, this.options.case_sensitive); ref = this.translations; for (translation in ref) { if (!hasProp.call(ref, translation)) continue; if (translation === "aliases" || translation === "alternates") { continue; } if ((base = this.translations[translation]).chapters == null) { base.chapters = {}; } if ((base1 = this.translations[translation].chapters)["Ps"] == null) { base1["Ps"] = bcv_utils.shallow_clone_array(this.translations["default"].chapters["Ps"]); } if (arg === true) { if (this.translations[translation].chapters["Ps151"] != null) { verse_count = this.translations[translation].chapters["Ps151"][0]; } else { verse_count = this.translations["default"].chapters["Ps151"][0]; } this.translations[translation].chapters["Ps"][150] = verse_count; } else { if (this.translations[translation].chapters["Ps"].length === 151) { this.translations[translation].chapters["Ps"].pop(); } } } return this; }; bcv_parser.prototype.versification_system = function(system) { var base, base1, base2, book, chapter_list, ref, ref1; if (!((system != null) && (this.translations[system] != null))) { return this; } if (this.translations.alternates["default"] != null) { if (system === "default") { if (this.translations.alternates["default"].order != null) { this.translations["default"].order = bcv_utils.shallow_clone(this.translations.alternates["default"].order); } ref = this.translations.alternates["default"].chapters; for (book in ref) { if (!hasProp.call(ref, book)) continue; chapter_list = ref[book]; this.translations["default"].chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } } else { this.versification_system("default"); } } if ((base = this.translations.alternates)["default"] == null) { base["default"] = { order: null, chapters: {} }; } if (system !== "default" && (this.translations[system].order != null)) { if ((base1 = this.translations.alternates["default"]).order == null) { base1.order = bcv_utils.shallow_clone(this.translations["default"].order); } this.translations["default"].order = bcv_utils.shallow_clone(this.translations[system].order); } if (system !== "default" && (this.translations[system].chapters != null)) { ref1 = this.translations[system].chapters; for (book in ref1) { if (!hasProp.call(ref1, book)) continue; chapter_list = ref1[book]; if ((base2 = this.translations.alternates["default"].chapters)[book] == null) { base2[book] = bcv_utils.shallow_clone_array(this.translations["default"].chapters[book]); } this.translations["default"].chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } } this.options.versification_system = system; this.include_apocrypha(this.options.include_apocrypha); return this; }; bcv_parser.prototype.case_sensitive = function(arg) { if (!((arg != null) && (arg === "none" || arg === "books"))) { return this; } if (arg === this.options.case_sensitive) { return this; } this.options.case_sensitive = arg; this.regexps.books = this.regexps.get_books(this.options.include_apocrypha, arg); return this; }; bcv_parser.prototype.translation_info = function(new_translation) { var book, chapter_list, id, old_translation, out, ref, ref1, ref2; if (new_translation == null) { new_translation = "default"; } if ((new_translation != null) && (((ref = this.translations.aliases[new_translation]) != null ? ref.alias : void 0) != null)) { new_translation = this.translations.aliases[new_translation].alias; } if (!((new_translation != null) && (this.translations[new_translation] != null))) { new_translation = "default"; } old_translation = this.options.versification_system; if (new_translation !== old_translation) { this.versification_system(new_translation); } out = { order: bcv_utils.shallow_clone(this.translations["default"].order), books: [], chapters: {} }; ref1 = this.translations["default"].chapters; for (book in ref1) { if (!hasProp.call(ref1, book)) continue; chapter_list = ref1[book]; out.chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } ref2 = out.order; for (book in ref2) { if (!hasProp.call(ref2, book)) continue; id = ref2[book]; out.books[id - 1] = book; } if (new_translation !== old_translation) { this.versification_system(old_translation); } return out; }; bcv_parser.prototype.replace_control_characters = function(s) { s = s.replace(this.regexps.control, " "); if (this.options.non_latin_digits_strategy === "replace") { s = s.replace(/[٠۰߀०০੦૦୦0౦೦൦๐໐༠၀႐០᠐᥆᧐᪀᪐᭐᮰᱀᱐꘠꣐꤀꧐꩐꯰0]/g, "0"); s = s.replace(/[١۱߁१১੧૧୧௧౧೧൧๑໑༡၁႑១᠑᥇᧑᪁᪑᭑᮱᱁᱑꘡꣑꤁꧑꩑꯱1]/g, "1"); s = s.replace(/[٢۲߂२২੨૨୨௨౨೨൨๒໒༢၂႒២᠒᥈᧒᪂᪒᭒᮲᱂᱒꘢꣒꤂꧒꩒꯲2]/g, "2"); s = s.replace(/[٣۳߃३৩੩૩୩௩౩೩൩๓໓༣၃႓៣᠓᥉᧓᪃᪓᭓᮳᱃᱓꘣꣓꤃꧓꩓꯳3]/g, "3"); s = s.replace(/[٤۴߄४৪੪૪୪௪౪೪൪๔໔༤၄႔៤᠔᥊᧔᪄᪔᭔᮴᱄᱔꘤꣔꤄꧔꩔꯴4]/g, "4"); s = s.replace(/[٥۵߅५৫੫૫୫௫౫೫൫๕໕༥၅႕៥᠕᥋᧕᪅᪕᭕᮵᱅᱕꘥꣕꤅꧕꩕꯵5]/g, "5"); s = s.replace(/[٦۶߆६৬੬૬୬௬౬೬൬๖໖༦၆႖៦᠖᥌᧖᪆᪖᭖᮶᱆᱖꘦꣖꤆꧖꩖꯶6]/g, "6"); s = s.replace(/[٧۷߇७৭੭૭୭௭౭೭൭๗໗༧၇႗៧᠗᥍᧗᪇᪗᭗᮷᱇᱗꘧꣗꤇꧗꩗꯷7]/g, "7"); s = s.replace(/[٨۸߈८৮੮૮୮௮౮೮൮๘໘༨၈႘៨᠘᥎᧘᪈᪘᭘᮸᱈᱘꘨꣘꤈꧘꩘꯸8]/g, "8"); s = s.replace(/[٩۹߉९৯੯૯୯௯౯೯൯๙໙༩၉႙៩᠙᥏᧙᪉᪙᭙᮹᱉᱙꘩꣙꤉꧙꩙꯹9]/g, "9"); } return s; }; bcv_parser.prototype.match_books = function(s) { var book, books, has_replacement, k, len, ref; books = []; ref = this.regexps.books; for (k = 0, len = ref.length; k < len; k++) { book = ref[k]; has_replacement = false; s = s.replace(book.regexp, function(full, prev, bk) { var extra; has_replacement = true; books.push({ value: bk, parsed: book.osis, type: "book" }); extra = book.extra != null ? "/" + book.extra : ""; return prev + "\x1f" + (books.length - 1) + extra + "\x1f"; }); if (has_replacement === true && /^[\s\x1f\d:.,;\-\u2013\u2014]+$/.test(s)) { break; } } s = s.replace(this.regexps.translations, function(match) { books.push({ value: match, parsed: match.toLowerCase(), type: "translation" }); return "\x1e" + (books.length - 1) + "\x1e"; }); return [s, this.get_book_indices(books, s)]; }; bcv_parser.prototype.get_book_indices = function(books, s) { var add_index, match, re; add_index = 0; re = /([\x1f\x1e])(\d+)(?:\/\d+)?\1/g; while (match = re.exec(s)) { books[match[2]].start_index = match.index + add_index; add_index += books[match[2]].value.length - match[0].length; } return books; }; bcv_parser.prototype.match_passages = function(s) { var accum, book_id, entities, full, match, next_char, original_part_length, part, passage, post_context, re, ref, regexp_index_adjust, start_index_adjust; entities = []; post_context = {}; while (match = this.regexps.escaped_passage.exec(s)) { full = match[0], part = match[1], book_id = match[2]; original_part_length = part.length; match.index += full.length - original_part_length; if (/\s[2-9]\d\d\s*$|\s\d{4,}\s*$/.test(part)) { re = /\s+\d+\s*$/; part = part.replace(re, ""); } if (!/[\d\x1f\x1e)]$/.test(part)) { part = this.replace_match_end(part); } if (this.options.captive_end_digits_strategy === "delete") { next_char = match.index + part.length; if (s.length > next_char && /^\w/.test(s.substr(next_char, 1))) { part = part.replace(/[\s*]+\d+$/, ""); } part = part.replace(/(\x1e[)\]]?)[\s*]*\d+$/, "$1"); } part = part.replace(/[A-Z]+/g, function(capitals) { return capitals.toLowerCase(); }); start_index_adjust = part.substr(0, 1) === "\x1f" ? 0 : part.split("\x1f")[0].length; passage = { value: grammar.parse(part), type: "base", start_index: this.passage.books[book_id].start_index - start_index_adjust, match: part }; if (this.options.book_alone_strategy === "full" && this.options.book_range_strategy === "include" && passage.value[0].type === "b" && (passage.value.length === 1 || (passage.value.length > 1 && passage.value[1].type === "translation_sequence")) && start_index_adjust === 0 && (this.passage.books[book_id].parsed.length === 1 || (this.passage.books[book_id].parsed.length > 1 && this.passage.books[book_id].parsed[1].type === "translation")) && /^[234]/.test(this.passage.books[book_id].parsed[0])) { this.create_book_range(s, passage, book_id); } ref = this.passage.handle_obj(passage), accum = ref[0], post_context = ref[1]; entities = entities.concat(accum); regexp_index_adjust = this.adjust_regexp_end(accum, original_part_length, part.length); if (regexp_index_adjust > 0) { this.regexps.escaped_passage.lastIndex -= regexp_index_adjust; } } return [entities, post_context]; }; bcv_parser.prototype.adjust_regexp_end = function(accum, old_length, new_length) { var regexp_index_adjust; regexp_index_adjust = 0; if (accum.length > 0) { regexp_index_adjust = old_length - accum[accum.length - 1].indices[1] - 1; } else if (old_length !== new_length) { regexp_index_adjust = old_length - new_length; } return regexp_index_adjust; }; bcv_parser.prototype.replace_match_end = function(part) { var match, remove; remove = part.length; while (match = this.regexps.match_end_split.exec(part)) { remove = match.index + match[0].length; } if (remove < part.length) { part = part.substr(0, remove); } return part; }; bcv_parser.prototype.create_book_range = function(s, passage, book_id) { var cases, i, k, limit, prev, range_regexp, ref; cases = [bcv_parser.prototype.regexps.first, bcv_parser.prototype.regexps.second, bcv_parser.prototype.regexps.third]; limit = parseInt(this.passage.books[book_id].parsed[0].substr(0, 1), 10); for (i = k = 1, ref = limit; 1 <= ref ? k < ref : k > ref; i = 1 <= ref ? ++k : --k) { range_regexp = i === limit - 1 ? bcv_parser.prototype.regexps.range_and : bcv_parser.prototype.regexps.range_only; prev = s.match(RegExp("(?:^|\\W)(" + cases[i - 1] + "\\s*" + range_regexp + "\\s*)\\x1f" + book_id + "\\x1f", "i")); if (prev != null) { return this.add_book_range_object(passage, prev, i); } } return false; }; bcv_parser.prototype.add_book_range_object = function(passage, prev, start_book_number) { var i, k, length, ref, ref1, results; length = prev[1].length; passage.value[0] = { type: "b_range_pre", value: [ { type: "b_pre", value: start_book_number.toString(), indices: [prev.index, prev.index + length] }, passage.value[0] ], indices: [0, passage.value[0].indices[1] + length] }; passage.value[0].value[1].indices[0] += length; passage.value[0].value[1].indices[1] += length; passage.start_index -= length; passage.match = prev[1] + passage.match; if (passage.value.length === 1) { return; } results = []; for (i = k = 1, ref = passage.value.length; 1 <= ref ? k < ref : k > ref; i = 1 <= ref ? ++k : --k) { if (passage.value[i].value == null) { continue; } if (((ref1 = passage.value[i].value[0]) != null ? ref1.indices : void 0) != null) { passage.value[i].value[0].indices[0] += length; passage.value[i].value[0].indices[1] += length; } passage.value[i].indices[0] += length; results.push(passage.value[i].indices[1] += length); } return results; }; bcv_parser.prototype.osis = function() { var k, len, osis, out, ref; out = []; ref = this.parsed_entities(); for (k = 0, len = ref.length; k < len; k++) { osis = ref[k]; if (osis.osis.length > 0) { out.push(osis.osis); } } return out.join(","); }; bcv_parser.prototype.osis_and_translations = function() { var k, len, osis, out, ref; out = []; ref = this.parsed_entities(); for (k = 0, len = ref.length; k < len; k++) { osis = ref[k]; if (osis.osis.length > 0) { out.push([osis.osis, osis.translations.join(",")]); } } return out; }; bcv_parser.prototype.osis_and_indices = function() { var k, len, osis, out, ref; out = []; ref = this.parsed_entities(); for (k = 0, len = ref.length; k < len; k++) { osis = ref[k]; if (osis.osis.length > 0) { out.push({ osis: osis.osis, translations: osis.translations, indices: osis.indices }); } } return out; }; bcv_parser.prototype.parsed_entities = function() { var entity, entity_id, i, k, l, last_i, len, len1, length, m, n, osis, osises, out, passage, ref, ref1, ref2, ref3, strings, translation, translation_alias, translation_osis, translations; out = []; for (entity_id = k = 0, ref = this.entities.length; 0 <= ref ? k < ref : k > ref; entity_id = 0 <= ref ? ++k : --k) { entity = this.entities[entity_id]; if (entity.type && entity.type === "translation_sequence" && out.length > 0 && entity_id === out[out.length - 1].entity_id + 1) { out[out.length - 1].indices[1] = entity.absolute_indices[1]; } if (entity.passages == null) { continue; } if ((entity.type === "b" && this.options.book_alone_strategy === "ignore") || (entity.type === "b_range" && this.options.book_range_strategy === "ignore") || entity.type === "context") { continue; } translations = []; translation_alias = null; if (entity.passages[0].translations != null) { ref1 = entity.passages[0].translations; for (l = 0, len = ref1.length; l < len; l++) { translation = ref1[l]; translation_osis = ((ref2 = translation.osis) != null ? ref2.length : void 0) > 0 ? translation.osis : ""; if (translation_alias == null) { translation_alias = translation.alias; } translations.push(translation_osis); } } else { translations = [""]; translation_alias = "default"; } osises = []; length = entity.passages.length; for (i = m = 0, ref3 = length; 0 <= ref3 ? m < ref3 : m > ref3; i = 0 <= ref3 ? ++m : --m) { passage = entity.passages[i]; if (passage.type == null) { passage.type = entity.type; } if (passage.valid.valid === false) { if (this.options.invalid_sequence_strategy === "ignore" && entity.type === "sequence") { this.snap_sequence("ignore", entity, osises, i, length); } if (this.options.invalid_passage_strategy === "ignore") { continue; } } if ((passage.type === "b" || passage.type === "b_range") && this.options.book_sequence_strategy === "ignore" && entity.type === "sequence") { this.snap_sequence("book", entity, osises, i, length); continue; } if ((passage.type === "b_range_start" || passage.type === "range_end_b") && this.options.book_range_strategy === "ignore") { this.snap_range(entity, i); } if (passage.absolute_indices == null) { passage.absolute_indices = entity.absolute_indices; } osises.push({ osis: passage.valid.valid ? this.to_osis(passage.start, passage.end, translation_alias) : "", type: passage.type, indices: passage.absolute_indices, translations: translations, start: passage.start, end: passage.end, enclosed_indices: passage.enclosed_absolute_indices, entity_id: entity_id, entities: [passage] }); } if (osises.length === 0) { continue; } if (osises.length > 1 && this.options.consecutive_combination_strategy === "combine") { osises = this.combine_consecutive_passages(osises, translation_alias); } if (this.options.sequence_combination_strategy === "separate") { out = out.concat(osises); } else { strings = []; last_i = osises.length - 1; if ((osises[last_i].enclosed_indices != null) && osises[last_i].enclosed_indices[1] >= 0) { entity.absolute_indices[1] = osises[last_i].enclosed_indices[1]; } for (n = 0, len1 = osises.length; n < len1; n++) { osis = osises[n]; if (osis.osis.length > 0) { strings.push(osis.osis); } } out.push({ osis: strings.join(","), indices: entity.absolute_indices, translations: translations, entity_id: entity_id, entities: osises }); } } return out; }; bcv_parser.prototype.to_osis = function(start, end, translation) { var osis, out; if ((end.c == null) && (end.v == null) && start.b === end.b && (start.c == null) && (start.v == null) && this.options.book_alone_strategy === "first_chapter") { end.c = 1; } osis = { start: "", end: "" }; if (start.c == null) { start.c = 1; } if (start.v == null) { start.v = 1; } if (end.c == null) { if (this.options.passage_existence_strategy.indexOf("c") >= 0 || ((this.passage.translations[translation].chapters[end.b] != null) && this.passage.translations[translation].chapters[end.b].length === 1)) { end.c = this.passage.translations[translation].chapters[end.b].length; } else { end.c = 999; } } if (end.v == null) { if ((this.passage.translations[translation].chapters[end.b][end.c - 1] != null) && this.options.passage_existence_strategy.indexOf("v") >= 0) { end.v = this.passage.translations[translation].chapters[end.b][end.c - 1]; } else { end.v = 999; } } if (this.options.include_apocrypha && this.options.ps151_strategy === "b" && ((start.c === 151 && start.b === "Ps") || (end.c === 151 && end.b === "Ps"))) { this.fix_ps151(start, end, translation); } if (this.options.osis_compaction_strategy === "b" && start.c === 1 && start.v === 1 && end.c === this.passage.translations[translation].chapters[end.b].length && end.v === this.passage.translations[translation].chapters[end.b][end.c - 1]) { osis.start = start.b; osis.end = end.b; } else if (this.options.osis_compaction_strategy.length <= 2 && start.v === 1 && (end.v === 999 || end.v === this.passage.translations[translation].chapters[end.b][end.c - 1])) { osis.start = start.b + "." + start.c.toString(); osis.end = end.b + "." + end.c.toString(); } else { osis.start = start.b + "." + start.c.toString() + "." + start.v.toString(); osis.end = end.b + "." + end.c.toString() + "." + end.v.toString(); } if (osis.start === osis.end) { out = osis.start; } else { out = osis.start + "-" + osis.end; } if (start.extra != null) { out = start.extra + "," + out; } if (end.extra != null) { out += "," + end.extra; } return out; }; bcv_parser.prototype.fix_ps151 = function(start, end, translation) { var ref; if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters["Ps151"] : void 0) == null)) { this.passage.promote_book_to_translation("Ps151", translation); } if (start.c === 151 && start.b === "Ps") { if (end.c === 151 && end.b === "Ps") { start.b = "Ps151"; start.c = 1; end.b = "Ps151"; return end.c = 1; } else { start.extra = this.to_osis({ b: "Ps151", c: 1, v: start.v }, { b: "Ps151", c: 1, v: this.passage.translations[translation].chapters["Ps151"][0] }, translation); start.b = "Prov"; start.c = 1; return start.v = 1; } } else { end.extra = this.to_osis({ b: "Ps151", c: 1, v: 1 }, { b: "Ps151", c: 1, v: end.v }, translation); end.c = 150; return end.v = this.passage.translations[translation].chapters["Ps"][149]; } }; bcv_parser.prototype.combine_consecutive_passages = function(osises, translation) { var enclosed_sequence_start, has_enclosed, i, is_enclosed_last, k, last_i, osis, out, prev, prev_i, ref; out = []; prev = {}; last_i = osises.length - 1; enclosed_sequence_start = -1; has_enclosed = false; for (i = k = 0, ref = last_i; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) { osis = osises[i]; if (osis.osis.length > 0) { prev_i = out.length - 1; is_enclosed_last = false; if (osis.enclosed_indices[0] !== enclosed_sequence_start) { enclosed_sequence_start = osis.enclosed_indices[0]; } if (enclosed_sequence_start >= 0 && (i === last_i || osises[i + 1].enclosed_indices[0] !== osis.enclosed_indices[0])) { is_enclosed_last = true; has_enclosed = true; } if (this.is_verse_consecutive(prev, osis.start, translation)) { out[prev_i].end = osis.end; out[prev_i].is_enclosed_last = is_enclosed_last; out[prev_i].indices[1] = osis.indices[1]; out[prev_i].enclosed_indices[1] = osis.enclosed_indices[1]; out[prev_i].osis = this.to_osis(out[prev_i].start, osis.end, translation); } else { out.push(osis); } prev = { b: osis.end.b, c: osis.end.c, v: osis.end.v }; } else { out.push(osis); prev = {}; } } if (has_enclosed) { this.snap_enclosed_indices(out); } return out; }; bcv_parser.prototype.snap_enclosed_indices = function(osises) { var k, len, osis; for (k = 0, len = osises.length; k < len; k++) { osis = osises[k]; if (osis.is_enclosed_last != null) { if (osis.enclosed_indices[0] < 0 && osis.is_enclosed_last) { osis.indices[1] = osis.enclosed_indices[1]; } delete osis.is_enclosed_last; } } return osises; }; bcv_parser.prototype.is_verse_consecutive = function(prev, check, translation) { var translation_order; if (prev.b == null) { return false; } translation_order = this.passage.translations[translation].order != null ? this.passage.translations[translation].order : this.passage.translations["default"].order; if (prev.b === check.b) { if (prev.c === check.c) { if (prev.v === check.v - 1) { return true; } } else if (check.v === 1 && prev.c === check.c - 1) { if (prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { return true; } } } else if (check.c === 1 && check.v === 1 && translation_order[prev.b] === translation_order[check.b] - 1) { if (prev.c === this.passage.translations[translation].chapters[prev.b].length && prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { return true; } } return false; }; bcv_parser.prototype.snap_range = function(entity, passage_i) { var entity_i, key, pluck, ref, source_entity, target_entity, temp, type; if (entity.type === "b_range_start" || (entity.type === "sequence" && entity.passages[passage_i].type === "b_range_start")) { entity_i = 1; source_entity = "end"; type = "b_range_start"; } else { entity_i = 0; source_entity = "start"; type = "range_end_b"; } target_entity = source_entity === "end" ? "start" : "end"; ref = entity.passages[passage_i][target_entity]; for (key in ref) { if (!hasProp.call(ref, key)) continue; entity.passages[passage_i][target_entity][key] = entity.passages[passage_i][source_entity][key]; } if (entity.type === "sequence") { if (passage_i >= entity.value.length) { passage_i = entity.value.length - 1; } pluck = this.passage.pluck(type, entity.value[passage_i]); if (pluck != null) { temp = this.snap_range(pluck, 0); if (passage_i === 0) { entity.absolute_indices[0] = temp.absolute_indices[0]; } else { entity.absolute_indices[1] = temp.absolute_indices[1]; } } } else { entity.original_type = entity.type; entity.type = entity.value[entity_i].type; entity.absolute_indices = [entity.value[entity_i].absolute_indices[0], entity.value[entity_i].absolute_indices[1]]; } return entity; }; bcv_parser.prototype.snap_sequence = function(type, entity, osises, i, length) { var passage; passage = entity.passages[i]; if (passage.absolute_indices[0] === entity.absolute_indices[0] && i < length - 1 && this.get_snap_sequence_i(entity.passages, i, length) !== i) { entity.absolute_indices[0] = entity.passages[i + 1].absolute_indices[0]; this.remove_absolute_indices(entity.passages, i + 1); } else if (passage.absolute_indices[1] === entity.absolute_indices[1] && i > 0) { entity.absolute_indices[1] = osises.length > 0 ? osises[osises.length - 1].indices[1] : entity.passages[i - 1].absolute_indices[1]; } else if (type === "book" && i < length - 1 && !this.starts_with_book(entity.passages[i + 1])) { entity.passages[i + 1].absolute_indices[0] = passage.absolute_indices[0]; } return entity; }; bcv_parser.prototype.get_snap_sequence_i = function(passages, i, length) { var j, k, ref, ref1; for (j = k = ref = i + 1, ref1 = length; ref <= ref1 ? k < ref1 : k > ref1; j = ref <= ref1 ? ++k : --k) { if (this.starts_with_book(passages[j])) { return j; } if (passages[j].valid.valid) { return i; } } return i; }; bcv_parser.prototype.starts_with_book = function(passage) { if (passage.type.substr(0, 1) === "b") { return true; } if ((passage.type === "range" || passage.type === "ff") && passage.start.type.substr(0, 1) === "b") { return true; } return false; }; bcv_parser.prototype.remove_absolute_indices = function(passages, i) { var end, k, len, passage, ref, ref1, start; if (passages[i].enclosed_absolute_indices[0] < 0) { return false; } ref = passages[i].enclosed_absolute_indices, start = ref[0], end = ref[1]; ref1 = passages.slice(i); for (k = 0, len = ref1.length; k < len; k++) { passage = ref1[k]; if (passage.enclosed_absolute_indices[0] === start && passage.enclosed_absolute_indices[1] === end) { passage.enclosed_absolute_indices = [-1, -1]; } else { break; } } return true; }; return bcv_parser; })(); root.bcv_parser = bcv_parser; bcv_passage = (function() { function bcv_passage() {} bcv_passage.prototype.books = []; bcv_passage.prototype.indices = {}; bcv_passage.prototype.options = {}; bcv_passage.prototype.translations = {}; bcv_passage.prototype.handle_array = function(passages, accum, context) { var k, len, passage, ref; if (accum == null) { accum = []; } if (context == null) { context = {}; } for (k = 0, len = passages.length; k < len; k++) { passage = passages[k]; if (passage == null) { continue; } if (passage.type === "stop") { break; } ref = this.handle_obj(passage, accum, context), accum = ref[0], context = ref[1]; } return [accum, context]; }; bcv_passage.prototype.handle_obj = function(passage, accum, context) { if ((passage.type != null) && (this[passage.type] != null)) { return this[passage.type](passage, accum, context); } else { return [accum, context]; } }; bcv_passage.prototype.b = function(passage, accum, context) { var alternates, b, k, len, obj, ref, valid; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; alternates = []; ref = this.books[passage.value].parsed; for (k = 0, len = ref.length; k < len; k++) { b = ref[k]; valid = this.validate_ref(passage.start_context.translations, { b: b }); obj = { start: { b: b }, end: { b: b }, valid: valid }; if (passage.passages.length === 0 && valid.valid) { passage.passages.push(obj); } else { alternates.push(obj); } } if (passage.passages.length === 0) { passage.passages.push(alternates.shift()); } if (alternates.length > 0) { passage.passages[0].alternates = alternates; } if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); context = { b: passage.passages[0].start.b }; if (passage.start_context.translations != null) { context.translations = passage.start_context.translations; } return [accum, context]; }; bcv_passage.prototype.b_range = function(passage, accum, context) { return this.range(passage, accum, context); }; bcv_passage.prototype.b_range_pre = function(passage, accum, context) { var alternates, book, end, ref, ref1, start_obj; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; alternates = []; book = this.pluck("b", passage.value); ref = this.b(book, [], context), (ref1 = ref[0], end = ref1[0]), context = ref[1]; if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } start_obj = { b: passage.value[0].value + end.passages[0].start.b.substr(1), type: "b" }; passage.passages = [ { start: start_obj, end: end.passages[0].end, valid: end.passages[0].valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.b_range_start = function(passage, accum, context) { return this.range(passage, accum, context); }; bcv_passage.prototype.base = function(passage, accum, context) { this.indices = this.calculate_indices(passage.match, passage.start_index); return this.handle_array(passage.value, accum, context); }; bcv_passage.prototype.bc = function(passage, accum, context) { var alternates, b, c, context_key, k, len, obj, ref, ref1, valid; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; this.reset_context(context, ["b", "c", "v"]); c = this.pluck("c", passage.value).value; alternates = []; ref = this.books[this.pluck("b", passage.value).value].parsed; for (k = 0, len = ref.length; k < len; k++) { b = ref[k]; context_key = "c"; valid = this.validate_ref(passage.start_context.translations, { b: b, c: c }); obj = { start: { b: b }, end: { b: b }, valid: valid }; if (valid.messages.start_chapter_not_exist_in_single_chapter_book) { obj.valid = this.validate_ref(passage.start_context.translations, { b: b, v: c }); obj.valid.messages.start_chapter_not_exist_in_single_chapter_book = 1; obj.start.c = 1; obj.end.c = 1; context_key = "v"; } obj.start[context_key] = c; ref1 = this.fix_start_zeroes(obj.valid, obj.start.c, obj.start.v), obj.start.c = ref1[0], obj.start.v = ref1[1]; if (obj.start.v == null) { delete obj.start.v; } obj.end[context_key] = obj.start[context_key]; if (passage.passages.length === 0 && obj.valid.valid) { passage.passages.push(obj); } else { alternates.push(obj); } } if (passage.passages.length === 0) { passage.passages.push(alternates.shift()); } if (alternates.length > 0) { passage.passages[0].alternates = alternates; } if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); accum.push(passage); return [accum, context]; }; bcv_passage.prototype.bc_title = function(passage, accum, context) { var bc, i, k, ref, ref1, ref2, title; passage.start_context = bcv_utils.shallow_clone(context); ref = this.bc(this.pluck("bc", passage.value), [], context), (ref1 = ref[0], bc = ref1[0]), context = ref[1]; if (bc.passages[0].start.b.substr(0, 2) !== "Ps" && (bc.passages[0].alternates != null)) { for (i = k = 0, ref2 = bc.passages[0].alternates.length; 0 <= ref2 ? k < ref2 : k > ref2; i = 0 <= ref2 ? ++k : --k) { if (bc.passages[0].alternates[i].start.b.substr(0, 2) !== "Ps") { continue; } bc.passages[0] = bc.passages[0].alternates[i]; break; } } if (bc.passages[0].start.b.substr(0, 2) !== "Ps") { accum.push(bc); return [accum, context]; } this.books[this.pluck("b", bc.value).value].parsed = ["Ps"]; title = this.pluck("title", passage.value); if (title == null) { title = this.pluck("v", passage.value); } passage.value[1] = { type: "v", value: [ { type: "integer", value: 1, indices: title.indices } ], indices: title.indices }; passage.type = "bcv"; return this.bcv(passage, accum, passage.start_context); }; bcv_passage.prototype.bcv = function(passage, accum, context) { var alternates, b, bc, c, k, len, obj, ref, ref1, v, valid; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; this.reset_context(context, ["b", "c", "v"]); bc = this.pluck("bc", passage.value); c = this.pluck("c", bc.value).value; v = this.pluck("v", passage.value).value; alternates = []; ref = this.books[this.pluck("b", bc.value).value].parsed; for (k = 0, len = ref.length; k < len; k++) { b = ref[k]; valid = this.validate_ref(passage.start_context.translations, { b: b, c: c, v: v }); ref1 = this.fix_start_zeroes(valid, c, v), c = ref1[0], v = ref1[1]; obj = { start: { b: b, c: c, v: v }, end: { b: b, c: c, v: v }, valid: valid }; if (passage.passages.length === 0 && valid.valid) { passage.passages.push(obj); } else { alternates.push(obj); } } if (passage.passages.length === 0) { passage.passages.push(alternates.shift()); } if (alternates.length > 0) { passage.passages[0].alternates = alternates; } if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); accum.push(passage); return [accum, context]; }; bcv_passage.prototype.bv = function(passage, accum, context) { var b, bcv, ref, ref1, ref2, v; passage.start_context = bcv_utils.shallow_clone(context); ref = passage.value, b = ref[0], v = ref[1]; bcv = { indices: passage.indices, value: [ { type: "bc", value: [ b, { type: "c", value: [ { type: "integer", value: 1 } ] } ] }, v ] }; ref1 = this.bcv(bcv, [], context), (ref2 = ref1[0], bcv = ref2[0]), context = ref1[1]; passage.passages = bcv.passages; if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.c = function(passage, accum, context) { var c, valid; passage.start_context = bcv_utils.shallow_clone(context); c = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; valid = this.validate_ref(passage.start_context.translations, { b: context.b, c: c }); if (!valid.valid && valid.messages.start_chapter_not_exist_in_single_chapter_book) { return this.v(passage, accum, context); } c = this.fix_start_zeroes(valid, c)[0]; passage.passages = [ { start: { b: context.b, c: c }, end: { b: context.b, c: c }, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } accum.push(passage); context.c = c; this.reset_context(context, ["v"]); if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } return [accum, context]; }; bcv_passage.prototype.c_psalm = function(passage, accum, context) { var c; passage.type = "bc"; c = parseInt(this.books[passage.value].value.match(/^\d+/)[0], 10); passage.value = [ { type: "b", value: passage.value, indices: passage.indices }, { type: "c", value: [ { type: "integer", value: c, indices: passage.indices } ], indices: passage.indices } ]; return this.bc(passage, accum, context); }; bcv_passage.prototype.c_title = function(passage, accum, context) { var title; passage.start_context = bcv_utils.shallow_clone(context); if (context.b !== "Ps") { return this.c(passage.value[0], accum, context); } title = this.pluck("title", passage.value); passage.value[1] = { type: "v", value: [ { type: "integer", value: 1, indices: title.indices } ], indices: title.indices }; passage.type = "cv"; return this.cv(passage, accum, passage.start_context); }; bcv_passage.prototype.cv = function(passage, accum, context) { var c, ref, v, valid; passage.start_context = bcv_utils.shallow_clone(context); c = this.pluck("c", passage.value).value; v = this.pluck("v", passage.value).value; valid = this.validate_ref(passage.start_context.translations, { b: context.b, c: c, v: v }); ref = this.fix_start_zeroes(valid, c, v), c = ref[0], v = ref[1]; passage.passages = [ { start: { b: context.b, c: c, v: v }, end: { b: context.b, c: c, v: v }, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } accum.push(passage); context.c = c; context.v = v; if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } return [accum, context]; }; bcv_passage.prototype.cb_range = function(passage, accum, context) { var b, end_c, ref, start_c; passage.type = "range"; ref = passage.value, b = ref[0], start_c = ref[1], end_c = ref[2]; passage.value = [ { type: "bc", value: [b, start_c], indices: passage.indices }, end_c ]; end_c.indices[1] = passage.indices[1]; return this.range(passage, accum, context); }; bcv_passage.prototype.context = function(passage, accum, context) { var key, ref; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; ref = this.books[passage.value].context; for (key in ref) { if (!hasProp.call(ref, key)) continue; context[key] = this.books[passage.value].context[key]; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.cv_psalm = function(passage, accum, context) { var bc, c_psalm, ref, v; passage.start_context = bcv_utils.shallow_clone(context); passage.type = "bcv"; ref = passage.value, c_psalm = ref[0], v = ref[1]; bc = this.c_psalm(c_psalm, [], passage.start_context)[0][0]; passage.value = [bc, v]; return this.bcv(passage, accum, context); }; bcv_passage.prototype.ff = function(passage, accum, context) { var ref, ref1; passage.start_context = bcv_utils.shallow_clone(context); passage.value.push({ type: "integer", indices: passage.indices, value: 999 }); ref = this.range(passage, [], passage.start_context), (ref1 = ref[0], passage = ref1[0]), context = ref[1]; passage.value[0].indices = passage.value[1].indices; passage.value[0].absolute_indices = passage.value[1].absolute_indices; passage.value.pop(); if (passage.passages[0].valid.messages.end_verse_not_exist != null) { delete passage.passages[0].valid.messages.end_verse_not_exist; } if (passage.passages[0].valid.messages.end_chapter_not_exist != null) { delete passage.passages[0].valid.messages.end_chapter_not_exist; } if (passage.passages[0].end.original_c != null) { delete passage.passages[0].end.original_c; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.integer_title = function(passage, accum, context) { var v_indices; passage.start_context = bcv_utils.shallow_clone(context); if (context.b !== "Ps") { return this.integer(passage.value[0], accum, context); } passage.value[0] = { type: "c", value: [passage.value[0]], indices: [passage.value[0].indices[0], passage.value[0].indices[1]] }; v_indices = [passage.indices[1] - 5, passage.indices[1]]; passage.value[1] = { type: "v", value: [ { type: "integer", value: 1, indices: v_indices } ], indices: v_indices }; passage.type = "cv"; return this.cv(passage, accum, passage.start_context); }; bcv_passage.prototype.integer = function(passage, accum, context) { if (context.v != null) { return this.v(passage, accum, context); } return this.c(passage, accum, context); }; bcv_passage.prototype.sequence = function(passage, accum, context) { var k, l, len, len1, obj, psg, ref, ref1, ref2, ref3, sub_psg; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; ref = passage.value; for (k = 0, len = ref.length; k < len; k++) { obj = ref[k]; ref1 = this.handle_array(obj, [], context), (ref2 = ref1[0], psg = ref2[0]), context = ref1[1]; ref3 = psg.passages; for (l = 0, len1 = ref3.length; l < len1; l++) { sub_psg = ref3[l]; if (sub_psg.type == null) { sub_psg.type = psg.type; } if (sub_psg.absolute_indices == null) { sub_psg.absolute_indices = psg.absolute_indices; } if (psg.start_context.translations != null) { sub_psg.translations = psg.start_context.translations; } sub_psg.enclosed_absolute_indices = psg.type === "sequence_post_enclosed" ? psg.absolute_indices : [-1, -1]; passage.passages.push(sub_psg); } } if (passage.absolute_indices == null) { if (passage.passages.length > 0 && passage.type === "sequence") { passage.absolute_indices = [passage.passages[0].absolute_indices[0], passage.passages[passage.passages.length - 1].absolute_indices[1]]; } else { passage.absolute_indices = this.get_absolute_indices(passage.indices); } } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.sequence_post_enclosed = function(passage, accum, context) { return this.sequence(passage, accum, context); }; bcv_passage.prototype.v = function(passage, accum, context) { var c, no_c, ref, v, valid; v = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; passage.start_context = bcv_utils.shallow_clone(context); c = context.c != null ? context.c : 1; valid = this.validate_ref(passage.start_context.translations, { b: context.b, c: c, v: v }); ref = this.fix_start_zeroes(valid, 0, v), no_c = ref[0], v = ref[1]; passage.passages = [ { start: { b: context.b, c: c, v: v }, end: { b: context.b, c: c, v: v }, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); context.v = v; return [accum, context]; }; bcv_passage.prototype.range = function(passage, accum, context) { var end, end_obj, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, return_now, return_value, start, start_obj, valid; passage.start_context = bcv_utils.shallow_clone(context); ref = passage.value, start = ref[0], end = ref[1]; ref1 = this.handle_obj(start, [], context), (ref2 = ref1[0], start = ref2[0]), context = ref1[1]; if (end.type === "v" && ((start.type === "bc" && !((ref3 = start.passages) != null ? (ref4 = ref3[0]) != null ? (ref5 = ref4.valid) != null ? (ref6 = ref5.messages) != null ? ref6.start_chapter_not_exist_in_single_chapter_book : void 0 : void 0 : void 0 : void 0)) || start.type === "c") && this.options.end_range_digits_strategy === "verse") { passage.value[0] = start; return this.range_change_integer_end(passage, accum); } ref7 = this.handle_obj(end, [], context), (ref8 = ref7[0], end = ref8[0]), context = ref7[1]; passage.value = [start, end]; passage.indices = [start.indices[0], end.indices[1]]; delete passage.absolute_indices; start_obj = { b: start.passages[0].start.b, c: start.passages[0].start.c, v: start.passages[0].start.v, type: start.type }; end_obj = { b: end.passages[0].end.b, c: end.passages[0].end.c, v: end.passages[0].end.v, type: end.type }; if (end.passages[0].valid.messages.start_chapter_is_zero) { end_obj.c = 0; } if (end.passages[0].valid.messages.start_verse_is_zero) { end_obj.v = 0; } valid = this.validate_ref(passage.start_context.translations, start_obj, end_obj); if (valid.valid) { ref9 = this.range_handle_valid(valid, passage, start, start_obj, end, end_obj, accum), return_now = ref9[0], return_value = ref9[1]; if (return_now) { return return_value; } } else { return this.range_handle_invalid(valid, passage, start, start_obj, end, end_obj, accum); } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } passage.passages = [ { start: start_obj, end: end_obj, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (start_obj.type === "b") { if (end_obj.type === "b") { passage.type = "b_range"; } else { passage.type = "b_range_start"; } } else if (end_obj.type === "b") { passage.type = "range_end_b"; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.range_change_end = function(passage, accum, new_end) { var end, new_obj, ref, start; ref = passage.value, start = ref[0], end = ref[1]; if (end.type === "integer") { end.original_value = end.value; end.value = new_end; } else if (end.type === "v") { new_obj = this.pluck("integer", end.value); new_obj.original_value = new_obj.value; new_obj.value = new_end; } else if (end.type === "cv") { new_obj = this.pluck("c", end.value); new_obj.original_value = new_obj.value; new_obj.value = new_end; } return this.handle_obj(passage, accum, passage.start_context); }; bcv_passage.prototype.range_change_integer_end = function(passage, accum) { var end, ref, start; ref = passage.value, start = ref[0], end = ref[1]; if (passage.original_type == null) { passage.original_type = passage.type; } if (passage.original_value == null) { passage.original_value = [start, end]; } passage.type = start.type === "integer" ? "cv" : start.type + "v"; if (start.type === "integer") { passage.value[0] = { type: "c", value: [start], indices: start.indices }; } if (end.type === "integer") { passage.value[1] = { type: "v", value: [end], indices: end.indices }; } return this.handle_obj(passage, accum, passage.start_context); }; bcv_passage.prototype.range_check_new_end = function(translations, start_obj, end_obj, valid) { var new_end, new_valid, obj_to_validate, type; new_end = 0; type = null; if (valid.messages.end_chapter_before_start) { type = "c"; } else if (valid.messages.end_verse_before_start) { type = "v"; } if (type != null) { new_end = this.range_get_new_end_value(start_obj, end_obj, valid, type); } if (new_end > 0) { obj_to_validate = { b: end_obj.b, c: end_obj.c, v: end_obj.v }; obj_to_validate[type] = new_end; new_valid = this.validate_ref(translations, obj_to_validate); if (!new_valid.valid) { new_end = 0; } } return new_end; }; bcv_passage.prototype.range_end_b = function(passage, accum, context) { return this.range(passage, accum, context); }; bcv_passage.prototype.range_get_new_end_value = function(start_obj, end_obj, valid, key) { var new_end; new_end = 0; if ((key === "c" && valid.messages.end_chapter_is_zero) || (key === "v" && valid.messages.end_verse_is_zero)) { return new_end; } if (start_obj[key] >= 10 && end_obj[key] < 10 && start_obj[key] - 10 * Math.floor(start_obj[key] / 10) < end_obj[key]) { new_end = end_obj[key] + 10 * Math.floor(start_obj[key] / 10); } else if (start_obj[key] >= 100 && end_obj[key] < 100 && start_obj[key] - 100 < end_obj[key]) { new_end = end_obj[key] + 100; } return new_end; }; bcv_passage.prototype.range_handle_invalid = function(valid, passage, start, start_obj, end, end_obj, accum) { var new_end, ref, temp_valid, temp_value; if (valid.valid === false && (valid.messages.end_chapter_before_start || valid.messages.end_verse_before_start) && (end.type === "integer" || end.type === "v") || (valid.valid === false && valid.messages.end_chapter_before_start && end.type === "cv")) { new_end = this.range_check_new_end(passage.start_context.translations, start_obj, end_obj, valid); if (new_end > 0) { return this.range_change_end(passage, accum, new_end); } } if (this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v")) { temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; temp_valid = this.validate_ref(passage.start_context.translations, { b: start_obj.b, c: start_obj.c, v: temp_value }); if (temp_valid.valid) { return this.range_change_integer_end(passage, accum); } } if (passage.original_type == null) { passage.original_type = passage.type; } passage.type = "sequence"; ref = [[start, end], [[start], [end]]], passage.original_value = ref[0], passage.value = ref[1]; return this.sequence(passage, accum, passage.start_context); }; bcv_passage.prototype.range_handle_valid = function(valid, passage, start, start_obj, end, end_obj, accum) { var temp_valid, temp_value; if (valid.messages.end_chapter_not_exist && this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v") && this.options.passage_existence_strategy.indexOf("v") >= 0) { temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; temp_valid = this.validate_ref(passage.start_context.translations, { b: start_obj.b, c: start_obj.c, v: temp_value }); if (temp_valid.valid) { return [true, this.range_change_integer_end(passage, accum)]; } } this.range_validate(valid, start_obj, end_obj, passage); return [false, null]; }; bcv_passage.prototype.range_validate = function(valid, start_obj, end_obj, passage) { var ref; if (valid.messages.end_chapter_not_exist || valid.messages.end_chapter_not_exist_in_single_chapter_book) { end_obj.original_c = end_obj.c; end_obj.c = valid.messages.end_chapter_not_exist ? valid.messages.end_chapter_not_exist : valid.messages.end_chapter_not_exist_in_single_chapter_book; if (end_obj.v != null) { end_obj.v = this.validate_ref(passage.start_context.translations, { b: end_obj.b, c: end_obj.c, v: 999 }).messages.end_verse_not_exist; delete valid.messages.end_verse_is_zero; } } else if (valid.messages.end_verse_not_exist) { end_obj.original_v = end_obj.v; end_obj.v = valid.messages.end_verse_not_exist; } if (valid.messages.end_verse_is_zero && this.options.zero_verse_strategy !== "allow") { end_obj.v = valid.messages.end_verse_is_zero; } if (valid.messages.end_chapter_is_zero) { end_obj.c = valid.messages.end_chapter_is_zero; } ref = this.fix_start_zeroes(valid, start_obj.c, start_obj.v), start_obj.c = ref[0], start_obj.v = ref[1]; return true; }; bcv_passage.prototype.translation_sequence = function(passage, accum, context) { var k, l, len, len1, ref, translation, translations, val; passage.start_context = bcv_utils.shallow_clone(context); translations = []; translations.push({ translation: this.books[passage.value[0].value].parsed }); ref = passage.value[1]; for (k = 0, len = ref.length; k < len; k++) { val = ref[k]; val = this.books[this.pluck("translation", val).value].parsed; if (val != null) { translations.push({ translation: val }); } } for (l = 0, len1 = translations.length; l < len1; l++) { translation = translations[l]; if (this.translations.aliases[translation.translation] != null) { translation.alias = this.translations.aliases[translation.translation].alias; translation.osis = this.translations.aliases[translation.translation].osis || ""; } else { translation.alias = "default"; translation.osis = translation.translation.toUpperCase(); } } if (accum.length > 0) { context = this.translation_sequence_apply(accum, translations); } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); this.reset_context(context, ["translations"]); return [accum, context]; }; bcv_passage.prototype.translation_sequence_apply = function(accum, translations) { var context, i, k, new_accum, ref, ref1, use_i; use_i = 0; for (i = k = ref = accum.length - 1; ref <= 0 ? k <= 0 : k >= 0; i = ref <= 0 ? ++k : --k) { if (accum[i].original_type != null) { accum[i].type = accum[i].original_type; } if (accum[i].original_value != null) { accum[i].value = accum[i].original_value; } if (accum[i].type !== "translation_sequence") { continue; } use_i = i + 1; break; } if (use_i < accum.length) { accum[use_i].start_context.translations = translations; ref1 = this.handle_array(accum.slice(use_i), [], accum[use_i].start_context), new_accum = ref1[0], context = ref1[1]; } else { context = bcv_utils.shallow_clone(accum[accum.length - 1].start_context); } return context; }; bcv_passage.prototype.pluck = function(type, passages) { var k, len, passage; for (k = 0, len = passages.length; k < len; k++) { passage = passages[k]; if (!((passage != null) && (passage.type != null) && passage.type === type)) { continue; } if (type === "c" || type === "v") { return this.pluck("integer", passage.value); } return passage; } return null; }; bcv_passage.prototype.set_context_from_object = function(context, keys, obj) { var k, len, results, type; results = []; for (k = 0, len = keys.length; k < len; k++) { type = keys[k]; if (obj[type] == null) { continue; } results.push(context[type] = obj[type]); } return results; }; bcv_passage.prototype.reset_context = function(context, keys) { var k, len, results, type; results = []; for (k = 0, len = keys.length; k < len; k++) { type = keys[k]; results.push(delete context[type]); } return results; }; bcv_passage.prototype.fix_start_zeroes = function(valid, c, v) { if (valid.messages.start_chapter_is_zero && this.options.zero_chapter_strategy === "upgrade") { c = valid.messages.start_chapter_is_zero; } if (valid.messages.start_verse_is_zero && this.options.zero_verse_strategy === "upgrade") { v = valid.messages.start_verse_is_zero; } return [c, v]; }; bcv_passage.prototype.calculate_indices = function(match, adjust) { var character, end_index, indices, k, l, len, len1, len2, m, match_index, part, part_length, parts, ref, switch_type, temp; switch_type = "book"; indices = []; match_index = 0; adjust = parseInt(adjust, 10); parts = [match]; ref = ["\x1e", "\x1f"]; for (k = 0, len = ref.length; k < len; k++) { character = ref[k]; temp = []; for (l = 0, len1 = parts.length; l < len1; l++) { part = parts[l]; temp = temp.concat(part.split(character)); } parts = temp; } for (m = 0, len2 = parts.length; m < len2; m++) { part = parts[m]; switch_type = switch_type === "book" ? "rest" : "book"; part_length = part.length; if (part_length === 0) { continue; } if (switch_type === "book") { part = part.replace(/\/\d+$/, ""); end_index = match_index + part_length; if (indices.length > 0 && indices[indices.length - 1].index === adjust) { indices[indices.length - 1].end = end_index; } else { indices.push({ start: match_index, end: end_index, index: adjust }); } match_index += part_length + 2; adjust = this.books[part].start_index + this.books[part].value.length - match_index; indices.push({ start: end_index + 1, end: end_index + 1, index: adjust }); } else { end_index = match_index + part_length - 1; if (indices.length > 0 && indices[indices.length - 1].index === adjust) { indices[indices.length - 1].end = end_index; } else { indices.push({ start: match_index, end: end_index, index: adjust }); } match_index += part_length; } } return indices; }; bcv_passage.prototype.get_absolute_indices = function(arg1) { var end, end_out, index, k, len, ref, start, start_out; start = arg1[0], end = arg1[1]; start_out = null; end_out = null; ref = this.indices; for (k = 0, len = ref.length; k < len; k++) { index = ref[k]; if (start_out === null && (index.start <= start && start <= index.end)) { start_out = start + index.index; } if ((index.start <= end && end <= index.end)) { end_out = end + index.index + 1; break; } } return [start_out, end_out]; }; bcv_passage.prototype.validate_ref = function(translations, start, end) { var k, len, messages, temp_valid, translation, valid; if (!((translations != null) && translations.length > 0)) { translations = [ { translation: "default", osis: "", alias: "default" } ]; } valid = false; messages = {}; for (k = 0, len = translations.length; k < len; k++) { translation = translations[k]; if (translation.alias == null) { translation.alias = "default"; } if (translation.alias == null) { if (messages.translation_invalid == null) { messages.translation_invalid = []; } messages.translation_invalid.push(translation); continue; } if (this.translations.aliases[translation.alias] == null) { translation.alias = "default"; if (messages.translation_unknown == null) { messages.translation_unknown = []; } messages.translation_unknown.push(translation); } temp_valid = this.validate_start_ref(translation.alias, start, messages)[0]; if (end) { temp_valid = this.validate_end_ref(translation.alias, start, end, temp_valid, messages)[0]; } if (temp_valid === true) { valid = true; } } return { valid: valid, messages: messages }; }; bcv_passage.prototype.validate_start_ref = function(translation, start, messages) { var ref, ref1, translation_order, valid; valid = true; if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters[start.b] : void 0) == null)) { this.promote_book_to_translation(start.b, translation); } translation_order = ((ref1 = this.translations[translation]) != null ? ref1.order : void 0) != null ? translation : "default"; if (start.v != null) { start.v = parseInt(start.v, 10); } if (this.translations[translation_order].order[start.b] != null) { if (start.c == null) { start.c = 1; } start.c = parseInt(start.c, 10); if (isNaN(start.c)) { valid = false; messages.start_chapter_not_numeric = true; return [valid, messages]; } if (start.c === 0) { messages.start_chapter_is_zero = 1; if (this.options.zero_chapter_strategy === "error") { valid = false; } else { start.c = 1; } } if ((start.v != null) && start.v === 0) { messages.start_verse_is_zero = 1; if (this.options.zero_verse_strategy === "error") { valid = false; } else if (this.options.zero_verse_strategy === "upgrade") { start.v = 1; } } if (start.c > 0 && (this.translations[translation].chapters[start.b][start.c - 1] != null)) { if (start.v != null) { if (isNaN(start.v)) { valid = false; messages.start_verse_not_numeric = true; } else if (start.v > this.translations[translation].chapters[start.b][start.c - 1]) { if (this.options.passage_existence_strategy.indexOf("v") >= 0) { valid = false; messages.start_verse_not_exist = this.translations[translation].chapters[start.b][start.c - 1]; } } } } else { if (start.c !== 1 && this.translations[translation].chapters[start.b].length === 1) { valid = false; messages.start_chapter_not_exist_in_single_chapter_book = 1; } else if (start.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { valid = false; messages.start_chapter_not_exist = this.translations[translation].chapters[start.b].length; } } } else { if (this.options.passage_existence_strategy.indexOf("b") >= 0) { valid = false; } messages.start_book_not_exist = true; } return [valid, messages]; }; bcv_passage.prototype.validate_end_ref = function(translation, start, end, valid, messages) { var ref, translation_order; translation_order = ((ref = this.translations[translation]) != null ? ref.order : void 0) != null ? translation : "default"; if (end.c != null) { end.c = parseInt(end.c, 10); if (isNaN(end.c)) { valid = false; messages.end_chapter_not_numeric = true; } else if (end.c === 0) { messages.end_chapter_is_zero = 1; if (this.options.zero_chapter_strategy === "error") { valid = false; } else { end.c = 1; } } } if (end.v != null) { end.v = parseInt(end.v, 10); if (isNaN(end.v)) { valid = false; messages.end_verse_not_numeric = true; } else if (end.v === 0) { messages.end_verse_is_zero = 1; if (this.options.zero_verse_strategy === "error") { valid = false; } else if (this.options.zero_verse_strategy === "upgrade") { end.v = 1; } } } if (this.translations[translation_order].order[end.b] != null) { if ((end.c == null) && this.translations[translation].chapters[end.b].length === 1) { end.c = 1; } if ((this.translations[translation_order].order[start.b] != null) && this.translations[translation_order].order[start.b] > this.translations[translation_order].order[end.b]) { if (this.options.passage_existence_strategy.indexOf("b") >= 0) { valid = false; } messages.end_book_before_start = true; } if (start.b === end.b && (end.c != null) && !isNaN(end.c)) { if (start.c == null) { start.c = 1; } if (!isNaN(parseInt(start.c, 10)) && start.c > end.c) { valid = false; messages.end_chapter_before_start = true; } else if (start.c === end.c && (end.v != null) && !isNaN(end.v)) { if (start.v == null) { start.v = 1; } if (!isNaN(parseInt(start.v, 10)) && start.v > end.v) { valid = false; messages.end_verse_before_start = true; } } } if ((end.c != null) && !isNaN(end.c)) { if (this.translations[translation].chapters[end.b][end.c - 1] == null) { if (this.translations[translation].chapters[end.b].length === 1) { messages.end_chapter_not_exist_in_single_chapter_book = 1; } else if (end.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { messages.end_chapter_not_exist = this.translations[translation].chapters[end.b].length; } } } if ((end.v != null) && !isNaN(end.v)) { if (end.c == null) { end.c = this.translations[translation].chapters[end.b].length; } if (end.v > this.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0) { messages.end_verse_not_exist = this.translations[translation].chapters[end.b][end.c - 1]; } } } else { valid = false; messages.end_book_not_exist = true; } return [valid, messages]; }; bcv_passage.prototype.promote_book_to_translation = function(book, translation) { var base, base1; if ((base = this.translations)[translation] == null) { base[translation] = {}; } if ((base1 = this.translations[translation]).chapters == null) { base1.chapters = {}; } if (this.translations[translation].chapters[book] == null) { return this.translations[translation].chapters[book] = bcv_utils.shallow_clone_array(this.translations["default"].chapters[book]); } }; return bcv_passage; })(); bcv_utils = { shallow_clone: function(obj) { var key, out, val; if (obj == null) { return obj; } out = {}; for (key in obj) { if (!hasProp.call(obj, key)) continue; val = obj[key]; out[key] = val; } return out; }, shallow_clone_array: function(arr) { var i, k, out, ref; if (arr == null) { return arr; } out = []; for (i = k = 0, ref = arr.length; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) { if (typeof arr[i] !== "undefined") { out[i] = arr[i]; } } return out; } }; bcv_parser.prototype.regexps.translations = /(?:(?:RUSV|SZ))\b/gi; bcv_parser.prototype.translations = { aliases: { "default": { osis: "", alias: "default" } }, alternates: {}, "default": { order: { "Gen": 1, "Exod": 2, "Lev": 3, "Num": 4, "Deut": 5, "Josh": 6, "Judg": 7, "Ruth": 8, "1Sam": 9, "2Sam": 10, "1Kgs": 11, "2Kgs": 12, "1Chr": 13, "2Chr": 14, "Ezra": 15, "Neh": 16, "Esth": 17, "Job": 18, "Ps": 19, "Prov": 20, "Eccl": 21, "Song": 22, "Isa": 23, "Jer": 24, "Lam": 25, "Ezek": 26, "Dan": 27, "Hos": 28, "Joel": 29, "Amos": 30, "Obad": 31, "Jonah": 32, "Mic": 33, "Nah": 34, "Hab": 35, "Zeph": 36, "Hag": 37, "Zech": 38, "Mal": 39, "Matt": 40, "Mark": 41, "Luke": 42, "John": 43, "Acts": 44, "Rom": 45, "1Cor": 46, "2Cor": 47, "Gal": 48, "Eph": 49, "Phil": 50, "Col": 51, "1Thess": 52, "2Thess": 53, "1Tim": 54, "2Tim": 55, "Titus": 56, "Phlm": 57, "Heb": 58, "Jas": 59, "1Pet": 60, "2Pet": 61, "1John": 62, "2John": 63, "3John": 64, "Jude": 65, "Rev": 66, "Tob": 67, "Jdt": 68, "GkEsth": 69, "Wis": 70, "Sir": 71, "Bar": 72, "PrAzar": 73, "Sus": 74, "Bel": 75, "SgThree": 76, "EpJer": 77, "1Macc": 78, "2Macc": 79, "3Macc": 80, "4Macc": 81, "1Esd": 82, "2Esd": 83, "PrMan": 84 }, chapters: { "Gen": [31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26], "Exod": [22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38], "Lev": [17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34], "Num": [54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, 23, 31, 40, 16, 54, 42, 56, 29, 34, 13], "Deut": [46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 32, 18, 29, 23, 22, 20, 22, 21, 20, 23, 30, 25, 22, 19, 19, 26, 68, 29, 20, 30, 52, 29, 12], "Josh": [18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33], "Judg": [36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25], "Ruth": [22, 23, 18, 22], "1Sam": [28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13], "2Sam": [27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 33, 43, 26, 22, 51, 39, 25], "1Kgs": [53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 53], "2Kgs": [18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 21, 21, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30], "1Chr": [54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 47, 40, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30], "2Chr": [17, 18, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 22, 15, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23], "Ezra": [11, 70, 13, 24, 17, 22, 28, 36, 15, 44], "Neh": [11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31], "Esth": [22, 23, 15, 17, 14, 14, 10, 17, 32, 3], "Job": [22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 24, 34, 17], "Ps": [6, 12, 8, 8, 12, 10, 17, 9, 20, 18, 7, 8, 6, 7, 5, 11, 15, 50, 14, 9, 13, 31, 6, 10, 22, 12, 14, 9, 11, 12, 24, 11, 22, 22, 28, 12, 40, 22, 13, 17, 13, 11, 5, 26, 17, 11, 9, 14, 20, 23, 19, 9, 6, 7, 23, 13, 11, 11, 17, 12, 8, 12, 11, 10, 13, 20, 7, 35, 36, 5, 24, 20, 28, 23, 10, 12, 20, 72, 13, 19, 16, 8, 18, 12, 13, 17, 7, 18, 52, 17, 16, 15, 5, 23, 11, 13, 12, 9, 9, 5, 8, 28, 22, 35, 45, 48, 43, 13, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 13, 10, 7, 12, 15, 21, 10, 20, 14, 9, 6], "Prov": [33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31], "Eccl": [18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14], "Song": [17, 17, 11, 16, 16, 13, 13, 14], "Isa": [31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 12, 25, 24], "Jer": [19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34], "Lam": [22, 22, 66, 22, 22], "Ezek": [28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35], "Dan": [21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13], "Hos": [11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9], "Joel": [20, 32, 21], "Amos": [15, 16, 15, 13, 27, 14, 17, 14, 15], "Obad": [21], "Jonah": [17, 10, 10, 11], "Mic": [16, 13, 12, 13, 15, 16, 20], "Nah": [15, 13, 19], "Hab": [17, 20, 19], "Zeph": [18, 15, 20], "Hag": [15, 23], "Zech": [21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21], "Mal": [14, 17, 18, 6], "Matt": [25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20], "Mark": [45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20], "Luke": [80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53], "John": [51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25], "Acts": [26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 41, 38, 40, 30, 35, 27, 27, 32, 44, 31], "Rom": [32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27], "1Cor": [31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24], "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14], "Gal": [24, 21, 29, 31, 26, 18], "Eph": [23, 22, 21, 32, 33, 24], "Phil": [30, 30, 21, 23], "Col": [29, 23, 25, 18], "1Thess": [10, 20, 13, 18, 28], "2Thess": [12, 17, 18], "1Tim": [20, 15, 16, 16, 25, 21], "2Tim": [18, 26, 17, 22], "Titus": [16, 15, 15], "Phlm": [25], "Heb": [14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25], "Jas": [27, 26, 18, 17, 20], "1Pet": [25, 25, 22, 19, 14], "2Pet": [21, 22, 18], "1John": [10, 29, 24, 21, 21], "2John": [13], "3John": [15], "Jude": [25], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [22, 14, 17, 21, 22, 18, 16, 21, 6, 13, 18, 22, 17, 15], "Jdt": [16, 28, 10, 15, 24, 21, 32, 36, 14, 23, 23, 20, 20, 19, 14, 25], "GkEsth": [22, 23, 15, 17, 14, 14, 10, 17, 32, 13, 12, 6, 18, 19, 16, 24], "Wis": [16, 24, 19, 20, 23, 25, 30, 21, 18, 21, 26, 27, 19, 31, 19, 29, 21, 25, 22], "Sir": [30, 18, 31, 31, 15, 37, 36, 19, 18, 31, 34, 18, 26, 27, 20, 30, 32, 33, 30, 31, 28, 27, 27, 34, 26, 29, 30, 26, 28, 25, 31, 24, 33, 31, 26, 31, 31, 34, 35, 30, 22, 25, 33, 23, 26, 20, 25, 25, 16, 29, 30], "Bar": [22, 35, 37, 37, 9], "PrAzar": [68], "Sus": [64], "Bel": [42], "SgThree": [39], "EpJer": [73], "1Macc": [64, 70, 60, 61, 68, 63, 50, 32, 73, 89, 74, 53, 53, 49, 41, 24], "2Macc": [36, 32, 40, 50, 27, 31, 42, 36, 29, 38, 38, 45, 26, 46, 39], "3Macc": [29, 33, 30, 21, 51, 41, 23], "4Macc": [35, 24, 21, 26, 38, 35, 23, 29, 32, 21, 27, 19, 27, 20, 32, 25, 24, 24], "1Esd": [58, 30, 24, 63, 73, 34, 15, 96, 55], "2Esd": [40, 48, 36, 52, 56, 59, 70, 63, 47, 59, 46, 51, 58, 48, 63, 78], "PrMan": [15], "Ps151": [7] } }, vulgate: { chapters: { "Ps": [6, 13, 9, 10, 13, 11, 18, 10, 39, 8, 9, 6, 7, 5, 10, 15, 51, 15, 10, 14, 32, 6, 10, 22, 12, 14, 9, 11, 13, 25, 11, 22, 23, 28, 13, 40, 23, 14, 18, 14, 12, 5, 26, 18, 12, 10, 15, 21, 23, 21, 11, 7, 9, 24, 13, 12, 12, 18, 14, 9, 13, 12, 11, 14, 20, 8, 36, 37, 6, 24, 20, 28, 23, 11, 13, 21, 72, 13, 20, 17, 8, 19, 13, 14, 17, 7, 19, 53, 17, 16, 16, 5, 23, 11, 13, 12, 9, 9, 5, 8, 29, 22, 35, 45, 48, 43, 14, 31, 7, 10, 10, 9, 26, 9, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 14, 10, 8, 12, 15, 21, 10, 11, 20, 14, 9, 7] } }, ceb: { chapters: { "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [22, 14, 17, 21, 22, 18, 16, 21, 6, 13, 18, 22, 18, 15], "PrAzar": [67], "EpJer": [72], "1Esd": [55, 26, 24, 63, 71, 33, 15, 92, 55] } }, kjv: { chapters: { "3John": [14] } }, nab: { order: { "Gen": 1, "Exod": 2, "Lev": 3, "Num": 4, "Deut": 5, "Josh": 6, "Judg": 7, "Ruth": 8, "1Sam": 9, "2Sam": 10, "1Kgs": 11, "2Kgs": 12, "1Chr": 13, "2Chr": 14, "PrMan": 15, "Ezra": 16, "Neh": 17, "1Esd": 18, "2Esd": 19, "Tob": 20, "Jdt": 21, "Esth": 22, "GkEsth": 23, "1Macc": 24, "2Macc": 25, "3Macc": 26, "4Macc": 27, "Job": 28, "Ps": 29, "Prov": 30, "Eccl": 31, "Song": 32, "Wis": 33, "Sir": 34, "Isa": 35, "Jer": 36, "Lam": 37, "Bar": 38, "EpJer": 39, "Ezek": 40, "Dan": 41, "PrAzar": 42, "Sus": 43, "Bel": 44, "SgThree": 45, "Hos": 46, "Joel": 47, "Amos": 48, "Obad": 49, "Jonah": 50, "Mic": 51, "Nah": 52, "Hab": 53, "Zeph": 54, "Hag": 55, "Zech": 56, "Mal": 57, "Matt": 58, "Mark": 59, "Luke": 60, "John": 61, "Acts": 62, "Rom": 63, "1Cor": 64, "2Cor": 65, "Gal": 66, "Eph": 67, "Phil": 68, "Col": 69, "1Thess": 70, "2Thess": 71, "1Tim": 72, "2Tim": 73, "Titus": 74, "Phlm": 75, "Heb": 76, "Jas": 77, "1Pet": 78, "2Pet": 79, "1John": 80, "2John": 81, "3John": 82, "Jude": 83, "Rev": 84 }, chapters: { "Gen": [31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 54, 33, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26], "Exod": [22, 25, 22, 31, 23, 30, 29, 28, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 37, 30, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38], "Lev": [17, 16, 17, 35, 26, 23, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34], "Num": [54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 35, 28, 32, 22, 29, 35, 41, 30, 25, 19, 65, 23, 31, 39, 17, 54, 42, 56, 29, 34, 13], "Deut": [46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 31, 19, 29, 23, 22, 20, 22, 21, 20, 23, 29, 26, 22, 19, 19, 26, 69, 28, 20, 30, 52, 29, 12], "1Sam": [28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 16, 23, 28, 23, 44, 25, 12, 25, 11, 31, 13], "2Sam": [27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 32, 44, 26, 22, 51, 39, 25], "1Kgs": [53, 46, 28, 20, 32, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 54], "2Kgs": [18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 20, 22, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30], "1Chr": [54, 55, 24, 43, 41, 66, 40, 40, 44, 14, 47, 41, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30], "2Chr": [18, 17, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 23, 14, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23], "Neh": [11, 20, 38, 17, 19, 19, 72, 18, 37, 40, 36, 47, 31], "Job": [22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 32, 26, 17], "Ps": [6, 11, 9, 9, 13, 11, 18, 10, 21, 18, 7, 9, 6, 7, 5, 11, 15, 51, 15, 10, 14, 32, 6, 10, 22, 12, 14, 9, 11, 13, 25, 11, 22, 23, 28, 13, 40, 23, 14, 18, 14, 12, 5, 27, 18, 12, 10, 15, 21, 23, 21, 11, 7, 9, 24, 14, 12, 12, 18, 14, 9, 13, 12, 11, 14, 20, 8, 36, 37, 6, 24, 20, 28, 23, 11, 13, 21, 72, 13, 20, 17, 8, 19, 13, 14, 17, 7, 19, 53, 17, 16, 16, 5, 23, 11, 13, 12, 9, 9, 5, 8, 29, 22, 35, 45, 48, 43, 14, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 14, 10, 8, 12, 15, 21, 10, 20, 14, 9, 6], "Eccl": [18, 26, 22, 17, 19, 12, 29, 17, 18, 20, 10, 14], "Song": [17, 17, 11, 16, 16, 12, 14, 14], "Isa": [31, 22, 26, 6, 30, 13, 25, 23, 20, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 11, 25, 24], "Jer": [19, 37, 25, 31, 31, 30, 34, 23, 25, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34], "Ezek": [28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 44, 37, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35], "Dan": [21, 49, 100, 34, 30, 29, 28, 27, 27, 21, 45, 13, 64, 42], "Hos": [9, 25, 5, 19, 15, 11, 16, 14, 17, 15, 11, 15, 15, 10], "Joel": [20, 27, 5, 21], "Jonah": [16, 11, 10, 11], "Mic": [16, 13, 12, 14, 14, 16, 20], "Nah": [14, 14, 19], "Zech": [17, 17, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21], "Mal": [14, 17, 24], "Acts": [26, 47, 26, 37, 42, 15, 60, 40, 43, 49, 30, 25, 52, 28, 41, 40, 34, 28, 40, 38, 40, 30, 35, 27, 27, 32, 44, 31], "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [22, 14, 17, 21, 22, 18, 17, 21, 6, 13, 18, 22, 18, 15], "Sir": [30, 18, 31, 31, 15, 37, 36, 19, 18, 31, 34, 18, 26, 27, 20, 30, 32, 33, 30, 31, 28, 27, 27, 33, 26, 29, 30, 26, 28, 25, 31, 24, 33, 31, 26, 31, 31, 34, 35, 30, 22, 25, 33, 23, 26, 20, 25, 25, 16, 29, 30], "Bar": [22, 35, 38, 37, 9, 72], "2Macc": [36, 32, 40, 50, 27, 31, 42, 36, 29, 38, 38, 46, 26, 46, 39] } }, nlt: { chapters: { "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21] } }, nrsv: { chapters: { "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21] } } }; bcv_parser.prototype.regexps.space = "[\\s\\xa0]"; bcv_parser.prototype.regexps.escaped_passage = RegExp("(?:^|[^\\x1f\\x1e\\dA-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:(?:ch(?:apters?|a?pts?\\.?|a?p?s?\\.?)?\\s*\\d+\\s*(?:[\\u2013\\u2014\\-]|through|thru|to)\\s*\\d+\\s*(?:from|of|in)(?:\\s+the\\s+book\\s+of)?\\s*)|(?:ch(?:apters?|a?pts?\\.?|a?p?s?\\.?)?\\s*\\d+\\s*(?:from|of|in)(?:\\s+the\\s+book\\s+of)?\\s*)|(?:\\d+(?:th|nd|st)\\s*ch(?:apter|a?pt\\.?|a?p?\\.?)?\\s*(?:from|of|in)(?:\\s+the\\s+book\\s+of)?\\s*))?\\x1f(\\d+)(?:/\\d+)?\\x1f(?:/\\d+\\x1f|[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014]|надписаниях(?![a-z])|и" + bcv_parser.prototype.regexps.space + "+далее|главы|стихи|глав|стих|гл|—|и|[аб](?!\\w)|$)+)", "gi"); bcv_parser.prototype.regexps.match_end_split = RegExp("\\d\\W*надписаниях|\\d\\W*и" + bcv_parser.prototype.regexps.space + "+далее(?:[\\s\\xa0*]*\\.)?|\\d[\\s\\xa0*]*[аб](?!\\w)|\\x1e(?:[\\s\\xa0*]*[)\\]\\uff09])?|[\\d\\x1f]", "gi"); bcv_parser.prototype.regexps.control = /[\x1e\x1f]/g; bcv_parser.prototype.regexps.pre_book = "[^A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ]"; bcv_parser.prototype.regexps.first = "(?:1-?я|1-?е|1)\\.?" + bcv_parser.prototype.regexps.space + "*"; bcv_parser.prototype.regexps.second = "(?:2-?я|2-?е|2)\\.?" + bcv_parser.prototype.regexps.space + "*"; bcv_parser.prototype.regexps.third = "(?:3-?я|3-?е|3)\\.?" + bcv_parser.prototype.regexps.space + "*"; bcv_parser.prototype.regexps.range_and = "(?:[&\u2013\u2014-]|и|—)"; bcv_parser.prototype.regexps.range_only = "(?:[\u2013\u2014-]|—)"; bcv_parser.prototype.regexps.get_books = function(include_apocrypha, case_sensitive) { var book, books, k, len, out; books = [ { osis: ["Ps"], apocrypha: true, extra: "2", regexp: /(\b)(Ps151)(?=\.1)/g }, { osis: ["Gen"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Бытия|Gen|Быт(?:ие)?|Нач(?:ало)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Exod"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Исход|Exod|Исх(?:од)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Bel"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Виле[\\s\\xa0]*и[\\s\\xa0]*драконе|Bel|Бел(?:[\\s\\xa0]*и[\\s\\xa0]*Дракон|е)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Lev"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Левит|Lev|Лев(?:ит)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Num"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Чисел|Num|Чис(?:ла)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Sir"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Премудрост(?:и[\\s\\xa0]*Иисуса,[\\s\\xa0]*сына[\\s\\xa0]*Сирахова|ь[\\s\\xa0]*Сираха)|Ekkleziastik|Sir|Сир(?:ахова)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Wis"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Прем(?:удрости[\\s\\xa0]*Соломона)?|Wis))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Lam"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Плач(?:[\\s\\xa0]*Иеремии)?|Lam))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["EpJer"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*Иеремии|EpJer))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Rev"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Rev|Отк(?:р(?:овение)?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["PrMan"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Молитва[\\s\\xa0]*Манассии|PrMan))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Deut"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Deut|Втор(?:озаконие)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Josh"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Иисуса[\\s\\xa0]*Навина|Josh|И(?:исус(?:а[\\s\\xa0]*Навина|[\\s\\xa0]*Навин)|еш(?:уа)?)|Нав))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Judg"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Суде(?:[ий](?:[\\s\\xa0]*Израилевых)?)|Judg|Суд(?:е[ий]|ьи)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Ruth"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Руфи|Ruth|Ру(?:т|фь?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["1Esd"], apocrypha: true, regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:2(?:-?(?:[ея](?:\.[\s\xa0]*Ездры|[\s\xa0]*Ездры))|\.[\s\xa0]*Ездры|(?:[ея](?:\.[\s\xa0]*Ездры|[\s\xa0]*Ездры))|[\s\xa0]*Езд(?:ры)?)|1Esd))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Esd"], apocrypha: true, regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:3(?:-?(?:[ея](?:\.[\s\xa0]*Ездры|[\s\xa0]*Ездры))|\.[\s\xa0]*Ездры|(?:[ея](?:\.[\s\xa0]*Ездры|[\s\xa0]*Ездры))|[\s\xa0]*Езд(?:ры)?)|2Esd))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Isa"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Исаии|Isa|Ис(?:аи[ия]?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Sam"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)))|\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)|(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)))|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Цар(?:ств)?)|Sam))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Sam"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)))|\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)|(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Царств)))|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Самуила|Цар(?:ств)?)|Sam))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Kgs"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:4(?:-?(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)))|\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)|(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)))|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Цар(?:ств)?))|2(?:-?(?:[ея](?:\.[\s\xa0]*Царе[ий]|[\s\xa0]*Царе[ий]))|\.[\s\xa0]*Царе[ий]|(?:[ея](?:\.[\s\xa0]*Царе[ий]|[\s\xa0]*Царе[ий]))|[\s\xa0]*Царе[ий]|Kgs)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Kgs"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:3(?:-?(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)))|\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)|(?:[ея](?:\.[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Царств)))|[\s\xa0]*(?:Книга[\s\xa0]*Царств|Цар(?:ств)?))|1(?:-?(?:[ея](?:\.[\s\xa0]*Царе[ий]|[\s\xa0]*Царе[ий]))|\.[\s\xa0]*Царе[ий]|(?:[ея](?:\.[\s\xa0]*Царе[ий]|[\s\xa0]*Царе[ий]))|[\s\xa0]*Царе[ий]|Kgs)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Chr"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?(?:[ея](?:\.[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)|[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)))|\.[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)|(?:[ея](?:\.[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)|[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)))|[\s\xa0]*(?:Хроник|Лет(?:опись)?|Пар(?:алипоменон)?)|Chr))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Chr"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?(?:[ея](?:\.[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)|[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)))|\.[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)|(?:[ея](?:\.[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)|[\s\xa0]*(?:Паралипоменон|Летопись|Хроник)))|[\s\xa0]*(?:Хроник|Лет(?:опись)?|Пар(?:алипоменон)?)|Chr))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Ezra"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:Первая[\s\xa0]*Ездры|Книга[\s\xa0]*Ездры|1[\s\xa0]*Езд|Уза[ий]р|Ezra|Езд(?:р[аы])?))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Neh"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Неемии|Неем(?:и[ия])?|Neh))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["GkEsth"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Дополнения[\\s\\xa0]*к[\\s\\xa0]*Есфири|GkEsth))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Esth"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Есфири|Esth|Есф(?:ирь)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Job"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Иова|Job|Аюб|Иова?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Ps"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Заб(?:ур)?|Ps|Пс(?:ал(?:тирь|мы|ом)?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["PrAzar"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Молитва[\\s\\xa0]*Азария|PrAzar))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Prov"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*притче[ий][\\s\\xa0]*Соломоновых|Prov|Мудр(?:ые[\\s\\xa0]*изречения)?|Пр(?:ит(?:чи)?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Eccl"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*Екклесиаста|Eccl|Разм(?:ышления)?|Екк(?:лесиаст)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["SgThree"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Благодарственная[\\s\\xa0]*песнь[\\s\\xa0]*отроков|Молитва[\\s\\xa0]*святых[\\s\\xa0]*трех[\\s\\xa0]*отроков|Песнь[\\s\\xa0]*тр[её]х[\\s\\xa0]*отроков|SgThree))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Song"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Song|Песн(?:и[\\s\\xa0]*Песне[ий]|ь(?:[\\s\\xa0]*(?:песне[ий][\\s\\xa0]*Соломона|Суле[ий]мана))?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jer"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Иеремии|Jer|Иер(?:еми[ия])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Ezek"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Иезекииля|Ezek|Езек(?:иил)?|Иез(?:екиил[ья])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Dan"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Даниила|Dan|Д(?:ан(?:и(?:ила?|ял))?|он)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Hos"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Осии|Hos|Ос(?:и[ия])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Joel"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Иоиля|Joel|Иоил[ья]?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Amos"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Амоса|Amos|Ам(?:оса?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Obad"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Авдия|Obad|Авд(?:и[ийя])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jonah"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Ионы|Jonah|Ион[аы]|Юнус))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Mic"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Михея|Mic|Мих(?:е[ийя])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Nah"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Наума|Наума?|Nah))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Hab"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Аввакума|Hab|Авв(?:акума?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Zeph"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Софонии|Zeph|Соф(?:они[ия])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Hag"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Аггея|Hag|Агг(?:е[ийя])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Zech"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Захарии|Zech|За(?:к(?:ария)?|х(?:ари[ия])?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Mal"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*пророка[\\s\\xa0]*Малахии|Mal|Мал(?:ахи[ия])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Matt"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Евангелие[\\s\\xa0]*от[\\s\\xa0]*Матфея|От[\\s\\xa0]*Матфея|Matt|М(?:ат(?:а[ий])?|[тф])))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Mark"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Евангелие[\\s\\xa0]*от[\\s\\xa0]*Марка|От[\\s\\xa0]*Марка|Mark|М(?:арк|[кр])))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Luke"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Евангелие[\\s\\xa0]*от[\\s\\xa0]*Луки|От[\\s\\xa0]*Луки|Luke|Л(?:ука|к)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["1John"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))))|\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))))|John|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|И(?:о(?:анна|хана)|н))))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2John"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))))|\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))))|John|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|И(?:о(?:анна|хана)|н))))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["3John"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(3(?:-?(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))))|\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|Ио(?:анна|хана))))|John|[\s\xa0]*(?:послание[\s\xa0]*Иоанна|И(?:о(?:анна|хана)|н))))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["John"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Евангелие[\\s\\xa0]*от[\\s\\xa0]*Иоанна|От[\\s\\xa0]*Иоанна|John|И(?:охан|н)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Acts"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Acts|Деян(?:ия)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Rom"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Римлянам|К[\\s\\xa0]*Римлянам|Rom|Рим(?:лянам)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Cor"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)|[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)))|\.[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)|(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)|[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)))|[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Кор(?:инфянам)?)|Cor))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Cor"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)|[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)))|\.[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)|(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)|[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Коринфянам)))|[\s\xa0]*(?:к[\s\xa0]*Коринфянам|Кор(?:инфянам)?)|Cor))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Gal"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Галатам|К[\\s\\xa0]*Галатам|Gal|Гал(?:атам)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Eph"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Ефесянам|К[\\s\\xa0]*Ефесянам|Eph|(?:[ЕЭ]ф(?:есянам)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Phil"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Филиппи[ий]цам|К[\\s\\xa0]*Филиппи[ий]цам|Phil|Ф(?:ил(?:иппи[ий]цам)?|лп)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Col"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Колоссянам|Col|К(?:[\\s\\xa0]*Колоссянам|ол(?:оссянам)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Thess"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам)|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)))|\.[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)|[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам)|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)))|Thess|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фес(?:салоники[ий]цам)?))|2(?:-?[ея](?:\.[\s\xa0]*Фессалоники(?:[ий]цам|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)))|[ея](?:\.[\s\xa0]*Фессалоники(?:[ий]цам|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам))))|2(?:-?[ея][\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам))|[ея][\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам)))|2(?:-?[ея][\s\xa0]*Фессалоники(?:[ий]цам)|[ея][\s\xa0]*Фессалоники(?:[ий]цам)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Thess"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам)|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)))|\.[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)|[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам)|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)))|Thess|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фес(?:салоники[ий]цам)?))|1(?:-?[ея](?:\.[\s\xa0]*Фессалоники(?:[ий]цам|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам)))|[ея](?:\.[\s\xa0]*Фессалоники(?:[ий]цам|[\s\xa0]*(?:к[\s\xa0]*Фессалоники[ий]цам|Фессалоники[ий]цам))))|1(?:-?[ея][\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам))|[ея][\s\xa0]*(?:к[\s\xa0]*Фессалоники(?:[ий]цам|Фессалоники[ий]цам)))|1(?:-?[ея][\s\xa0]*Фессалоники(?:[ий]цам)|[ея][\s\xa0]*Фессалоники(?:[ий]цам)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Tim"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))|[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))))|\.[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))|(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))|[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))))|[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею)?)|Tim))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Tim"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))|[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))))|\.[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))|(?:[ея](?:\.[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))|[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею))))|[\s\xa0]*(?:к[\s\xa0]*Тимофею|Тим(?:етею|офею)?)|Tim))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Titus"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Титу|К[\\s\\xa0]*Титу|Titus|Титу?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Phlm"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Филимону|К[\\s\\xa0]*Филимону|Phlm|Ф(?:илимону|лм)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Heb"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*к[\\s\\xa0]*Евреям|К[\\s\\xa0]*Евреям|Heb|Евр(?:еям)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jas"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*Иакова|Якуб|Jas|Иак(?:ова)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Pet"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(2(?:-?(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))|[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))))|\.[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))|(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))|[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))))|[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра)?)|Pet))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Pet"], regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(1(?:-?(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))|[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))))|\.[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))|(?:[ея](?:\.[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))|[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра))))|[\s\xa0]*(?:послание[\s\xa0]*Петра|Пет(?:ира|ра)?)|Pet))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Jude"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Послание[\\s\\xa0]*Иуды|Jude|Иуд[аы]?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Tob"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Tob|Тов(?:ита)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jdt"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Jdt|Юди(?:фь)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Bar"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Книга[\\s\\xa0]*(?:пророка[\\s\\xa0]*Вару́ха|Варуха)|Бару́ха|Bar|Вар(?:уха)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Sus"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:С(?:казанию[\\s\\xa0]*о[\\s\\xa0]*Сусанне[\\s\\xa0]*и[\\s\\xa0]*Данииле|усанна(?:[\\s\\xa0]*и[\\s\\xa0]*старцы)?)|Sus))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)()\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:Вторая[\s\xa0]*книга[\s\xa0]*Маккаве[ий]ская|2(?:-?(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|\.[\s\xa0]*Маккавеев|(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|[\s\xa0]*Макк(?:авеев)?|Macc)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["3Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:Третья[\s\xa0]*книга[\s\xa0]*Маккаве[ий]ская|3(?:-?(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|\.[\s\xa0]*Маккавеев|(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|[\s\xa0]*Макк(?:авеев)?|Macc)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["4Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])(4(?:-?(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|\.[\s\xa0]*Маккавеев|(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|[\s\xa0]*Макк(?:авеев)?|Macc))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zЀ-ҁ҃-҇Ҋ-ԧⷠ-ⷿꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ])((?:Первая[\s\xa0]*книга[\s\xa0]*Маккаве[ий]ская|1(?:-?(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|\.[\s\xa0]*Маккавеев|(?:[ея](?:\.[\s\xa0]*Маккавеев|[\s\xa0]*Маккавеев))|[\s\xa0]*Макк(?:авеев)?|Macc)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]\/"'\*=~\-\u2013\u2014])|$)/gi } ]; if (include_apocrypha === true && case_sensitive === "none") { return books; } out = []; for (k = 0, len = books.length; k < len; k++) { book = books[k]; if (include_apocrypha === false && (book.apocrypha != null) && book.apocrypha === true) { continue; } if (case_sensitive === "books") { book.regexp = new RegExp(book.regexp.source, "g"); } out.push(book); } return out; }; bcv_parser.prototype.regexps.books = bcv_parser.prototype.regexps.get_books(false, "none"); var grammar = (function() { /* * Generated by PEG.js 0.8.0. * * http://pegjs.majda.cz/ */ function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function SyntaxError(message, expected, found, offset, line, column) { this.message = message; this.expected = expected; this.found = found; this.offset = offset; this.line = line; this.column = column; this.name = "SyntaxError"; } peg$subclass(SyntaxError, Error); function parse(input) { var options = arguments.length > 1 ? arguments[1] : {}, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = [], peg$c1 = peg$FAILED, peg$c2 = null, peg$c3 = function(val_1, val_2) { val_2.unshift([val_1]); return {"type": "sequence", "value": val_2, "indices": [offset(), peg$currPos - 1]} }, peg$c4 = "(", peg$c5 = { type: "literal", value: "(", description: "\"(\"" }, peg$c6 = ")", peg$c7 = { type: "literal", value: ")", description: "\")\"" }, peg$c8 = function(val_1, val_2) { if (typeof(val_2) === "undefined") val_2 = []; val_2.unshift([val_1]); return {"type": "sequence_post_enclosed", "value": val_2, "indices": [offset(), peg$currPos - 1]} }, peg$c9 = void 0, peg$c10 = function(val_1, val_2) { if (val_1.length && val_1.length === 2) val_1 = val_1[0]; // for `b`, which returns [object, undefined] return {"type": "range", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c11 = "\x1F", peg$c12 = { type: "literal", value: "\x1F", description: "\"\\x1F\"" }, peg$c13 = "/", peg$c14 = { type: "literal", value: "/", description: "\"/\"" }, peg$c15 = /^[1-8]/, peg$c16 = { type: "class", value: "[1-8]", description: "[1-8]" }, peg$c17 = function(val) { return {"type": "b", "value": val.value, "indices": [offset(), peg$currPos - 1]} }, peg$c18 = function(val_1, val_2) { return {"type": "bc", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c19 = ",", peg$c20 = { type: "literal", value: ",", description: "\",\"" }, peg$c21 = function(val_1, val_2) { return {"type": "bc_title", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c22 = ".", peg$c23 = { type: "literal", value: ".", description: "\".\"" }, peg$c24 = function(val_1, val_2) { return {"type": "bcv", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c25 = "-", peg$c26 = { type: "literal", value: "-", description: "\"-\"" }, peg$c27 = function(val_1, val_2, val_3, val_4) { return {"type": "range", "value": [{"type": "bcv", "value": [{"type": "bc", "value": [val_1, val_2], "indices": [val_1.indices[0], val_2.indices[1]]}, val_3], "indices": [val_1.indices[0], val_3.indices[1]]}, val_4], "indices": [offset(), peg$currPos - 1]} }, peg$c28 = function(val_1, val_2) { return {"type": "bv", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c29 = function(val_1, val_2) { return {"type": "bc", "value": [val_2, val_1], "indices": [offset(), peg$currPos - 1]} }, peg$c30 = function(val_1, val_2, val_3) { return {"type": "cb_range", "value": [val_3, val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c31 = "th", peg$c32 = { type: "literal", value: "th", description: "\"th\"" }, peg$c33 = "nd", peg$c34 = { type: "literal", value: "nd", description: "\"nd\"" }, peg$c35 = "st", peg$c36 = { type: "literal", value: "st", description: "\"st\"" }, peg$c37 = "/1\x1F", peg$c38 = { type: "literal", value: "/1\x1F", description: "\"/1\\x1F\"" }, peg$c39 = function(val) { return {"type": "c_psalm", "value": val.value, "indices": [offset(), peg$currPos - 1]} }, peg$c40 = function(val_1, val_2) { return {"type": "cv_psalm", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c41 = function(val_1, val_2) { return {"type": "c_title", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c42 = function(val_1, val_2) { return {"type": "cv", "value": [val_1, val_2], "indices": [offset(), peg$currPos - 1]} }, peg$c43 = function(val) { return {"type": "c", "value": [val], "indices": [offset(), peg$currPos - 1]} }, peg$c44 = "\u0438", peg$c45 = { type: "literal", value: "\u0438", description: "\"\\u0438\"" }, peg$c46 = "\u0434\u0430\u043B\u0435\u0435", peg$c47 = { type: "literal", value: "\u0434\u0430\u043B\u0435\u0435", description: "\"\\u0434\\u0430\\u043B\\u0435\\u0435\"" }, peg$c48 = /^[a-z]/, peg$c49 = { type: "class", value: "[a-z]", description: "[a-z]" }, peg$c50 = function(val_1) { return {"type": "ff", "value": [val_1], "indices": [offset(), peg$currPos - 1]} }, peg$c51 = "\u043D\u0430\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u044F\u0445", peg$c52 = { type: "literal", value: "\u043D\u0430\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u044F\u0445", description: "\"\\u043D\\u0430\\u0434\\u043F\\u0438\\u0441\\u0430\\u043D\\u0438\\u044F\\u0445\"" }, peg$c53 = function(val_1) { return {"type": "integer_title", "value": [val_1], "indices": [offset(), peg$currPos - 1]} }, peg$c54 = "/9\x1F", peg$c55 = { type: "literal", value: "/9\x1F", description: "\"/9\\x1F\"" }, peg$c56 = function(val) { return {"type": "context", "value": val.value, "indices": [offset(), peg$currPos - 1]} }, peg$c57 = "/2\x1F", peg$c58 = { type: "literal", value: "/2\x1F", description: "\"/2\\x1F\"" }, peg$c59 = ".1", peg$c60 = { type: "literal", value: ".1", description: "\".1\"" }, peg$c61 = /^[0-9]/, peg$c62 = { type: "class", value: "[0-9]", description: "[0-9]" }, peg$c63 = function(val) { return {"type": "bc", "value": [val, {"type": "c", "value": [{"type": "integer", "value": 151, "indices": [peg$currPos - 2, peg$currPos - 1]}], "indices": [peg$currPos - 2, peg$currPos - 1]}], "indices": [offset(), peg$currPos - 1]} }, peg$c64 = function(val_1, val_2) { return {"type": "bcv", "value": [val_1, {"type": "v", "value": [val_2], "indices": [val_2.indices[0], val_2.indices[1]]}], "indices": [offset(), peg$currPos - 1]} }, peg$c65 = /^[\u0430\u0431]/i, peg$c66 = { type: "class", value: "[\\u0430\\u0431]i", description: "[\\u0430\\u0431]i" }, peg$c67 = function(val) { return {"type": "v", "value": [val], "indices": [offset(), peg$currPos - 1]} }, peg$c68 = "\u0433\u043B", peg$c69 = { type: "literal", value: "\u0433\u043B", description: "\"\\u0433\\u043B\"" }, peg$c70 = "\u0430\u0432\u044B", peg$c71 = { type: "literal", value: "\u0430\u0432\u044B", description: "\"\\u0430\\u0432\\u044B\"" }, peg$c72 = "\u0430\u0432", peg$c73 = { type: "literal", value: "\u0430\u0432", description: "\"\\u0430\\u0432\"" }, peg$c74 = "", peg$c75 = function() { return {"type": "c_explicit"} }, peg$c76 = "\u0441\u0442\u0438\u0445", peg$c77 = { type: "literal", value: "\u0441\u0442\u0438\u0445", description: "\"\\u0441\\u0442\\u0438\\u0445\"" }, peg$c78 = function() { return {"type": "v_explicit"} }, peg$c79 = /^["']/, peg$c80 = { type: "class", value: "[\"']", description: "[\"']" }, peg$c81 = /^[;\/:&\-\u2013\u2014~]/, peg$c82 = { type: "class", value: "[;\\/:&\\-\\u2013\\u2014~]", description: "[;\\/:&\\-\\u2013\\u2014~]" }, peg$c83 = function() { return "" }, peg$c84 = /^[\-\u2013\u2014]/, peg$c85 = { type: "class", value: "[\\-\\u2013\\u2014]", description: "[\\-\\u2013\\u2014]" }, peg$c86 = "\u2014", peg$c87 = { type: "literal", value: "\u2014", description: "\"\\u2014\"" }, peg$c88 = function(val) { return {type:"title", value: [val], "indices": [offset(), peg$currPos - 1]} }, peg$c89 = "from", peg$c90 = { type: "literal", value: "from", description: "\"from\"" }, peg$c91 = "of", peg$c92 = { type: "literal", value: "of", description: "\"of\"" }, peg$c93 = "in", peg$c94 = { type: "literal", value: "in", description: "\"in\"" }, peg$c95 = "the", peg$c96 = { type: "literal", value: "the", description: "\"the\"" }, peg$c97 = "book", peg$c98 = { type: "literal", value: "book", description: "\"book\"" }, peg$c99 = /^[([]/, peg$c100 = { type: "class", value: "[([]", description: "[([]" }, peg$c101 = /^[)\]]/, peg$c102 = { type: "class", value: "[)\\]]", description: "[)\\]]" }, peg$c103 = function(val) { return {"type": "translation_sequence", "value": val, "indices": [offset(), peg$currPos - 1]} }, peg$c104 = "\x1E", peg$c105 = { type: "literal", value: "\x1E", description: "\"\\x1E\"" }, peg$c106 = function(val) { return {"type": "translation", "value": val.value, "indices": [offset(), peg$currPos - 1]} }, peg$c107 = ",000", peg$c108 = { type: "literal", value: ",000", description: "\",000\"" }, peg$c109 = function(val) { return {"type": "integer", "value": parseInt(val.join(""), 10), "indices": [offset(), peg$currPos - 1]} }, peg$c110 = /^[^\x1F\x1E([]/, peg$c111 = { type: "class", value: "[^\\x1F\\x1E([]", description: "[^\\x1F\\x1E([]" }, peg$c112 = function(val) { return {"type": "word", "value": val.join(""), "indices": [offset(), peg$currPos - 1]} }, peg$c113 = function(val) { return {"type": "stop", "value": val, "indices": [offset(), peg$currPos - 1]} }, peg$c114 = /^[\s\xa0*]/, peg$c115 = { type: "class", value: "[\\s\\xa0*]", description: "[\\s\\xa0*]" }, peg$currPos = 0, peg$reportedPos = 0, peg$cachedPos = 0, peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); } peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } function text() { return input.substring(peg$reportedPos, peg$currPos); } function offset() { return peg$reportedPos; } function line() { return peg$computePosDetails(peg$reportedPos).line; } function column() { return peg$computePosDetails(peg$reportedPos).column; } function expected(description) { throw peg$buildException( null, [{ type: "other", description: description }], peg$reportedPos ); } function error(message) { throw peg$buildException(message, null, peg$reportedPos); } function peg$computePosDetails(pos) { function advance(details, startPos, endPos) { var p, ch; for (p = startPos; p < endPos; p++) { ch = input.charAt(p); if (ch === "\n") { if (!details.seenCR) { details.line++; } details.column = 1; details.seenCR = false; } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { details.line++; details.column = 1; details.seenCR = true; } else { details.column++; details.seenCR = false; } } } if (peg$cachedPos !== pos) { if (peg$cachedPos > pos) { peg$cachedPos = 0; peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; } advance(peg$cachedPosDetails, peg$cachedPos, pos); peg$cachedPos = pos; } return peg$cachedPosDetails; } function peg$fail(expected) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected); } function peg$buildException(message, expected, pos) { function cleanupExpected(expected) { var i = 1; expected.sort(function(a, b) { if (a.description < b.description) { return -1; } else if (a.description > b.description) { return 1; } else { return 0; } }); while (i < expected.length) { if (expected[i - 1] === expected[i]) { expected.splice(i, 1); } else { i++; } } } function buildMessage(expected, found) { function stringEscape(s) { function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } return s .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\x08/g, '\\b') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\f/g, '\\f') .replace(/\r/g, '\\r') .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); } var expectedDescs = new Array(expected.length), expectedDesc, foundDesc, i; for (i = 0; i < expected.length; i++) { expectedDescs[i] = expected[i].description; } expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected.length - 1] : expectedDescs[0]; foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; return "Expected " + expectedDesc + " but " + foundDesc + " found."; } var posDetails = peg$computePosDetails(pos), found = pos < input.length ? input.charAt(pos) : null; if (expected !== null) { cleanupExpected(expected); } return new SyntaxError( message !== null ? message : buildMessage(expected, found), expected, found, pos, posDetails.line, posDetails.column ); } function peg$parsestart() { var s0, s1; s0 = []; s1 = peg$parsebcv_hyphen_range(); if (s1 === peg$FAILED) { s1 = peg$parsesequence(); if (s1 === peg$FAILED) { s1 = peg$parsecb_range(); if (s1 === peg$FAILED) { s1 = peg$parserange(); if (s1 === peg$FAILED) { s1 = peg$parseff(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parseb(); if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence_enclosed(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence(); if (s1 === peg$FAILED) { s1 = peg$parsesequence_sep(); if (s1 === peg$FAILED) { s1 = peg$parsec_title(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_title(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsev_letter(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); if (s1 === peg$FAILED) { s1 = peg$parseword(); if (s1 === peg$FAILED) { s1 = peg$parseword_parenthesis(); if (s1 === peg$FAILED) { s1 = peg$parsecontext(); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); s1 = peg$parsebcv_hyphen_range(); if (s1 === peg$FAILED) { s1 = peg$parsesequence(); if (s1 === peg$FAILED) { s1 = peg$parsecb_range(); if (s1 === peg$FAILED) { s1 = peg$parserange(); if (s1 === peg$FAILED) { s1 = peg$parseff(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parseb(); if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence_enclosed(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence(); if (s1 === peg$FAILED) { s1 = peg$parsesequence_sep(); if (s1 === peg$FAILED) { s1 = peg$parsec_title(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_title(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsev_letter(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); if (s1 === peg$FAILED) { s1 = peg$parseword(); if (s1 === peg$FAILED) { s1 = peg$parseword_parenthesis(); if (s1 === peg$FAILED) { s1 = peg$parsecontext(); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } else { s0 = peg$c1; } return s0; } function peg$parsesequence() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsecb_range(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_hyphen_range(); if (s1 === peg$FAILED) { s1 = peg$parserange(); if (s1 === peg$FAILED) { s1 = peg$parseff(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parseb(); if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecontext(); } } } } } } } } } } } } } } } } } } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsesequence_sep(); if (s4 === peg$FAILED) { s4 = peg$c2; } if (s4 !== peg$FAILED) { s5 = peg$parsesequence_post(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsesequence_sep(); if (s4 === peg$FAILED) { s4 = peg$c2; } if (s4 !== peg$FAILED) { s5 = peg$parsesequence_post(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } } } else { s2 = peg$c1; } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c3(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsesequence_post_enclosed() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c4; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c5); } } if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { s3 = peg$parsesequence_sep(); if (s3 === peg$FAILED) { s3 = peg$c2; } if (s3 !== peg$FAILED) { s4 = peg$parsesequence_post(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 === peg$FAILED) { s7 = peg$c2; } if (s7 !== peg$FAILED) { s8 = peg$parsesequence_post(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$c1; } } else { peg$currPos = s6; s6 = peg$c1; } while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 === peg$FAILED) { s7 = peg$c2; } if (s7 !== peg$FAILED) { s8 = peg$parsesequence_post(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$c1; } } else { peg$currPos = s6; s6 = peg$c1; } } if (s5 !== peg$FAILED) { s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c6; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c7); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c8(s4, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsesequence_post() { var s0; s0 = peg$parsesequence_post_enclosed(); if (s0 === peg$FAILED) { s0 = peg$parsecb_range(); if (s0 === peg$FAILED) { s0 = peg$parsebcv_hyphen_range(); if (s0 === peg$FAILED) { s0 = peg$parserange(); if (s0 === peg$FAILED) { s0 = peg$parseff(); if (s0 === peg$FAILED) { s0 = peg$parsebcv_comma(); if (s0 === peg$FAILED) { s0 = peg$parsebc_title(); if (s0 === peg$FAILED) { s0 = peg$parseps151_bcv(); if (s0 === peg$FAILED) { s0 = peg$parsebcv(); if (s0 === peg$FAILED) { s0 = peg$parsebcv_weak(); if (s0 === peg$FAILED) { s0 = peg$parseps151_bc(); if (s0 === peg$FAILED) { s0 = peg$parsebc(); if (s0 === peg$FAILED) { s0 = peg$parsecv_psalm(); if (s0 === peg$FAILED) { s0 = peg$parsebv(); if (s0 === peg$FAILED) { s0 = peg$parsec_psalm(); if (s0 === peg$FAILED) { s0 = peg$parseb(); if (s0 === peg$FAILED) { s0 = peg$parsecbv(); if (s0 === peg$FAILED) { s0 = peg$parsecbv_ordinal(); if (s0 === peg$FAILED) { s0 = peg$parsecb(); if (s0 === peg$FAILED) { s0 = peg$parsecb_ordinal(); if (s0 === peg$FAILED) { s0 = peg$parsec_title(); if (s0 === peg$FAILED) { s0 = peg$parseinteger_title(); if (s0 === peg$FAILED) { s0 = peg$parsecv(); if (s0 === peg$FAILED) { s0 = peg$parsecv_weak(); if (s0 === peg$FAILED) { s0 = peg$parsev_letter(); if (s0 === peg$FAILED) { s0 = peg$parseinteger(); if (s0 === peg$FAILED) { s0 = peg$parsec(); if (s0 === peg$FAILED) { s0 = peg$parsev(); } } } } } } } } } } } } } } } } } } } } } } } } } } } return s0; } function peg$parserange() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$currPos; s2 = peg$parseb(); if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$currPos; s5 = peg$parserange_sep(); if (s5 !== peg$FAILED) { s6 = peg$parsebcv_comma(); if (s6 === peg$FAILED) { s6 = peg$parsebc_title(); if (s6 === peg$FAILED) { s6 = peg$parseps151_bcv(); if (s6 === peg$FAILED) { s6 = peg$parsebcv(); if (s6 === peg$FAILED) { s6 = peg$parsebcv_weak(); if (s6 === peg$FAILED) { s6 = peg$parseps151_bc(); if (s6 === peg$FAILED) { s6 = peg$parsebc(); if (s6 === peg$FAILED) { s6 = peg$parsebv(); if (s6 === peg$FAILED) { s6 = peg$parseb(); } } } } } } } } if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } peg$silentFails--; if (s4 !== peg$FAILED) { peg$currPos = s3; s3 = peg$c9; } else { s3 = peg$c1; } if (s3 !== peg$FAILED) { s2 = [s2, s3]; s1 = s2; } else { peg$currPos = s1; s1 = peg$c1; } } else { peg$currPos = s1; s1 = peg$c1; } if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsec_title(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_title(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsev_letter(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); } } } } } } } } } } } } } } } } } } } } } } if (s1 !== peg$FAILED) { s2 = peg$parserange_sep(); if (s2 !== peg$FAILED) { s3 = peg$parseff(); if (s3 === peg$FAILED) { s3 = peg$parsebcv_comma(); if (s3 === peg$FAILED) { s3 = peg$parsebc_title(); if (s3 === peg$FAILED) { s3 = peg$parseps151_bcv(); if (s3 === peg$FAILED) { s3 = peg$parsebcv(); if (s3 === peg$FAILED) { s3 = peg$parsebcv_weak(); if (s3 === peg$FAILED) { s3 = peg$parseps151_bc(); if (s3 === peg$FAILED) { s3 = peg$parsebc(); if (s3 === peg$FAILED) { s3 = peg$parsecv_psalm(); if (s3 === peg$FAILED) { s3 = peg$parsebv(); if (s3 === peg$FAILED) { s3 = peg$parseb(); if (s3 === peg$FAILED) { s3 = peg$parsecbv(); if (s3 === peg$FAILED) { s3 = peg$parsecbv_ordinal(); if (s3 === peg$FAILED) { s3 = peg$parsec_psalm(); if (s3 === peg$FAILED) { s3 = peg$parsecb(); if (s3 === peg$FAILED) { s3 = peg$parsecb_ordinal(); if (s3 === peg$FAILED) { s3 = peg$parsec_title(); if (s3 === peg$FAILED) { s3 = peg$parseinteger_title(); if (s3 === peg$FAILED) { s3 = peg$parsecv(); if (s3 === peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parseinteger(); if (s3 === peg$FAILED) { s3 = peg$parsecv_weak(); if (s3 === peg$FAILED) { s3 = peg$parsec(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } } } } } } } } } } } } } } } } } } } } } } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c10(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseb() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c11; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { s4 = peg$c13; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c14); } } if (s4 !== peg$FAILED) { if (peg$c15.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 === peg$FAILED) { s3 = peg$c2; } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 31) { s4 = peg$c11; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c17(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebc() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsec(); if (s6 !== peg$FAILED) { s7 = peg$parsecv_sep(); if (s7 !== peg$FAILED) { s8 = peg$parsev(); if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } peg$silentFails--; if (s5 !== peg$FAILED) { peg$currPos = s4; s4 = peg$c9; } else { s4 = peg$c1; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parsecv_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep(); } } else { s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parsecv_sep_weak(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep_weak(); } } else { s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parserange_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parserange_sep(); } } else { s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = peg$parsesp(); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsec(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c18(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebc_comma() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c19; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c20); } } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { s5 = peg$parsec(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c18(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebc_title() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); } if (s1 !== peg$FAILED) { s2 = peg$parsetitle(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c21(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebcv() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c22; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s4 !== peg$FAILED) { s5 = peg$parsev_explicit(); if (s5 !== peg$FAILED) { s6 = peg$parsev(); if (s6 !== peg$FAILED) { s4 = [s4, s5, s6]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 === peg$FAILED) { s3 = peg$currPos; s4 = peg$parsesequence_sep(); if (s4 === peg$FAILED) { s4 = peg$c2; } if (s4 !== peg$FAILED) { s5 = peg$parsev_explicit(); if (s5 !== peg$FAILED) { s6 = peg$parsecv(); if (s6 !== peg$FAILED) { s4 = [s4, s5, s6]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } } peg$silentFails--; if (s3 === peg$FAILED) { s2 = peg$c9; } else { peg$currPos = s2; s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = peg$parsecv_sep(); if (s4 === peg$FAILED) { s4 = peg$parsesequence_sep(); } if (s4 === peg$FAILED) { s4 = peg$c2; } if (s4 !== peg$FAILED) { s5 = peg$parsev_explicit(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 === peg$FAILED) { s3 = peg$parsecv_sep(); } if (s3 !== peg$FAILED) { s4 = peg$parsev_letter(); if (s4 === peg$FAILED) { s4 = peg$parsev(); } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c24(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebcv_weak() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); } if (s1 !== peg$FAILED) { s2 = peg$parsecv_sep_weak(); if (s2 !== peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsecv_sep(); if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c9; } else { peg$currPos = s4; s4 = peg$c1; } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c24(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebcv_comma() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parsebc_comma(); if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c19; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c20); } } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { s5 = peg$parsev_letter(); if (s5 === peg$FAILED) { s5 = peg$parsev(); } if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; s7 = peg$currPos; s8 = peg$parsecv_sep(); if (s8 !== peg$FAILED) { s9 = peg$parsev(); if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$c1; } } else { peg$currPos = s7; s7 = peg$c1; } peg$silentFails--; if (s7 === peg$FAILED) { s6 = peg$c9; } else { peg$currPos = s6; s6 = peg$c1; } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c24(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebcv_hyphen_range() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s2 = peg$c25; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c26); } } if (s2 === peg$FAILED) { s2 = peg$parsespace(); } if (s2 === peg$FAILED) { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$parsec(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s4 = peg$c25; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c26); } } if (s4 !== peg$FAILED) { s5 = peg$parsev(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s6 = peg$c25; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c26); } } if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c27(s1, s3, s5, s7); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsebv() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsecv_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep(); } } else { s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parsecv_sep_weak(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep_weak(); } } else { s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parserange_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parserange_sep(); } } else { s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = peg$currPos; s3 = []; s4 = peg$parsesequence_sep(); if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsesequence_sep(); } } else { s3 = peg$c1; } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$parsev_explicit(); peg$silentFails--; if (s5 !== peg$FAILED) { peg$currPos = s4; s4 = peg$c9; } else { s4 = peg$c1; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = peg$parsesp(); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c28(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecb() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$parsein_book_of(); if (s3 === peg$FAILED) { s3 = peg$c2; } if (s3 !== peg$FAILED) { s4 = peg$parseb(); if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c29(s2, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecb_range() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$parserange_sep(); if (s3 !== peg$FAILED) { s4 = peg$parsec(); if (s4 !== peg$FAILED) { s5 = peg$parsein_book_of(); if (s5 === peg$FAILED) { s5 = peg$c2; } if (s5 !== peg$FAILED) { s6 = peg$parseb(); if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c30(s2, s4, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecbv() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsecb(); if (s1 !== peg$FAILED) { s2 = peg$parsesequence_sep(); if (s2 === peg$FAILED) { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsev(); if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c24(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecb_ordinal() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsec(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c31) { s2 = peg$c31; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c32); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c33) { s2 = peg$c33; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c35) { s2 = peg$c35; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c36); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsec_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsein_book_of(); if (s4 === peg$FAILED) { s4 = peg$c2; } if (s4 !== peg$FAILED) { s5 = peg$parseb(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c29(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecbv_ordinal() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsecb_ordinal(); if (s1 !== peg$FAILED) { s2 = peg$parsesequence_sep(); if (s2 === peg$FAILED) { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsev(); if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c24(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsec_psalm() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c11; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c37) { s3 = peg$c37; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c38); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c39(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecv_psalm() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsec_psalm(); if (s1 !== peg$FAILED) { s2 = peg$parsesequence_sep(); if (s2 === peg$FAILED) { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsev(); if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c40(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsec_title() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$parsetitle(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c41(s2, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecv() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsev_explicit(); if (s1 === peg$FAILED) { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s5 = peg$c22; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s5 !== peg$FAILED) { s6 = peg$parsev_explicit(); if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { s5 = [s5, s6, s7]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } peg$silentFails--; if (s4 === peg$FAILED) { s3 = peg$c9; } else { peg$currPos = s3; s3 = peg$c1; } if (s3 !== peg$FAILED) { s4 = peg$currPos; s5 = peg$parsecv_sep(); if (s5 === peg$FAILED) { s5 = peg$c2; } if (s5 !== peg$FAILED) { s6 = peg$parsev_explicit(); if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } if (s4 === peg$FAILED) { s4 = peg$parsecv_sep(); } if (s4 !== peg$FAILED) { s5 = peg$parsev_letter(); if (s5 === peg$FAILED) { s5 = peg$parsev(); } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c42(s2, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecv_weak() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsec(); if (s1 !== peg$FAILED) { s2 = peg$parsecv_sep_weak(); if (s2 !== peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsecv_sep(); if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c9; } else { peg$currPos = s4; s4 = peg$c1; } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c42(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsec() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 === peg$FAILED) { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = peg$parseinteger(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c43(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseff() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); } } } } } } } } if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 1).toLowerCase() === peg$c44) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s3 !== peg$FAILED) { s4 = peg$parsespace(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 5).toLowerCase() === peg$c46) { s5 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s5 !== peg$FAILED) { s6 = peg$parseabbrev(); if (s6 === peg$FAILED) { s6 = peg$c2; } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; if (peg$c48.test(input.charAt(peg$currPos))) { s8 = input.charAt(peg$currPos); peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c49); } } peg$silentFails--; if (s8 === peg$FAILED) { s7 = peg$c9; } else { peg$currPos = s7; s7 = peg$c1; } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c50(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseinteger_title() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parseinteger(); if (s1 !== peg$FAILED) { s2 = peg$parsecv_sep(); if (s2 === peg$FAILED) { s2 = peg$parsesequence_sep(); } if (s2 === peg$FAILED) { s2 = peg$c2; } if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 11).toLowerCase() === peg$c51) { s3 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c53(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecontext() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c11; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c54) { s3 = peg$c54; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c55); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c56(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseps151_b() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c11; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c57) { s3 = peg$c57; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c58); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c17(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseps151_bc() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parseps151_b(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c59) { s2 = peg$c59; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c60); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (peg$c61.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c62); } } peg$silentFails--; if (s4 === peg$FAILED) { s3 = peg$c9; } else { peg$currPos = s3; s3 = peg$c1; } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c63(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseps151_bcv() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s2 = peg$c22; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s2 !== peg$FAILED) { s3 = peg$parseinteger(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c64(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsev_letter() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsev_explicit(); if (s1 === peg$FAILED) { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = peg$parseinteger(); if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; if (input.substr(peg$currPos, 1).toLowerCase() === peg$c44) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s6 !== peg$FAILED) { s7 = peg$parsespace(); if (s7 !== peg$FAILED) { if (input.substr(peg$currPos, 5).toLowerCase() === peg$c46) { s8 = input.substr(peg$currPos, 5); peg$currPos += 5; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c9; } else { peg$currPos = s4; s4 = peg$c1; } if (s4 !== peg$FAILED) { if (peg$c65.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c66); } } if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; if (peg$c48.test(input.charAt(peg$currPos))) { s7 = input.charAt(peg$currPos); peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c49); } } peg$silentFails--; if (s7 === peg$FAILED) { s6 = peg$c9; } else { peg$currPos = s6; s6 = peg$c1; } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c67(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsev() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parsev_explicit(); if (s1 === peg$FAILED) { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = peg$parseinteger(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c67(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsec_explicit() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.substr(peg$currPos, 2).toLowerCase() === peg$c68) { s3 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 3).toLowerCase() === peg$c70) { s4 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c71); } } if (s4 === peg$FAILED) { if (input.substr(peg$currPos, 2).toLowerCase() === peg$c72) { s4 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s4 === peg$FAILED) { s4 = peg$currPos; s5 = peg$c74; if (s5 !== peg$FAILED) { s6 = peg$parseabbrev(); if (s6 === peg$FAILED) { s6 = peg$c2; } if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c75(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsev_explicit() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.substr(peg$currPos, 4).toLowerCase() === peg$c76) { s3 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c77); } } if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 1).toLowerCase() === peg$c44) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s4 === peg$FAILED) { s4 = peg$c74; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (peg$c48.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c49); } } peg$silentFails--; if (s4 === peg$FAILED) { s3 = peg$c9; } else { peg$currPos = s3; s3 = peg$c1; } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c78(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecv_sep() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s2 = peg$c19; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c20); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsecv_sep_weak() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (peg$c79.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c80); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } if (s0 === peg$FAILED) { s0 = peg$parsespace(); } return s0; } function peg$parsesequence_sep() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = []; if (peg$c81.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s2 === peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s3 = peg$c22; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s7 = peg$c22; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s9 = peg$c22; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s9 !== peg$FAILED) { s6 = [s6, s7, s8, s9]; s5 = s6; } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c9; } else { peg$currPos = s4; s4 = peg$c1; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 1).toLowerCase() === peg$c44) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s2 === peg$FAILED) { s2 = peg$parsespace(); } } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c81.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c82); } } if (s2 === peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s3 = peg$c22; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s7 = peg$c22; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s9 = peg$c22; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s9 !== peg$FAILED) { s6 = [s6, s7, s8, s9]; s5 = s6; } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } } else { peg$currPos = s5; s5 = peg$c1; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c9; } else { peg$currPos = s4; s4 = peg$c1; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 1).toLowerCase() === peg$c44) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s2 === peg$FAILED) { s2 = peg$parsespace(); } } } } } else { s1 = peg$c1; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c83(); } s0 = s1; return s0; } function peg$parserange_sep() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; if (peg$c84.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c85); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.substr(peg$currPos, 1).toLowerCase() === peg$c86) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c87); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; if (peg$c84.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c85); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.substr(peg$currPos, 1).toLowerCase() === peg$c86) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c87); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } } } } else { s2 = peg$c1; } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsetitle() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parsecv_sep(); if (s1 === peg$FAILED) { s1 = peg$parsesequence_sep(); } if (s1 === peg$FAILED) { s1 = peg$c2; } if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 11).toLowerCase() === peg$c51) { s2 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c88(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsein_book_of() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c89) { s2 = peg$c89; peg$currPos += 4; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c90); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c91) { s2 = peg$c91; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c93) { s2 = peg$c93; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c94); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s4 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c95) { s5 = peg$c95; peg$currPos += 3; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c96); } } if (s5 !== peg$FAILED) { s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c97) { s7 = peg$c97; peg$currPos += 4; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c91) { s9 = peg$c91; peg$currPos += 2; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s9 !== peg$FAILED) { s10 = peg$parsesp(); if (s10 !== peg$FAILED) { s5 = [s5, s6, s7, s8, s9, s10]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } if (s4 === peg$FAILED) { s4 = peg$c2; } if (s4 !== peg$FAILED) { s1 = [s1, s2, s3, s4]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseabbrev() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s2 = peg$c22; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$currPos; s5 = peg$parsesp(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s6 = peg$c22; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s6 !== peg$FAILED) { s7 = peg$parsesp(); if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s8 = peg$c22; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s8 !== peg$FAILED) { s5 = [s5, s6, s7, s8]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } peg$silentFails--; if (s4 === peg$FAILED) { s3 = peg$c9; } else { peg$currPos = s3; s3 = peg$c1; } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsetranslation_sequence_enclosed() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (peg$c99.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c100); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s4 = peg$currPos; s5 = peg$parsetranslation(); if (s5 !== peg$FAILED) { s6 = []; s7 = peg$currPos; s8 = peg$parsesequence_sep(); if (s8 !== peg$FAILED) { s9 = peg$parsetranslation(); if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$c1; } } else { peg$currPos = s7; s7 = peg$c1; } while (s7 !== peg$FAILED) { s6.push(s7); s7 = peg$currPos; s8 = peg$parsesequence_sep(); if (s8 !== peg$FAILED) { s9 = peg$parsetranslation(); if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$c1; } } else { peg$currPos = s7; s7 = peg$c1; } } if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$c1; } } else { peg$currPos = s4; s4 = peg$c1; } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { if (peg$c101.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c103(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsetranslation_sequence() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c19; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c20); } } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c1; } } else { peg$currPos = s2; s2 = peg$c1; } if (s2 === peg$FAILED) { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = peg$parsetranslation(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 !== peg$FAILED) { s8 = peg$parsetranslation(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$c1; } } else { peg$currPos = s6; s6 = peg$c1; } while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 !== peg$FAILED) { s8 = peg$parsetranslation(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$c1; } } else { peg$currPos = s6; s6 = peg$c1; } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c1; } } else { peg$currPos = s3; s3 = peg$c1; } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c103(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parsetranslation() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 30) { s1 = peg$c104; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 30) { s3 = peg$c104; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c106(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } } else { peg$currPos = s0; s0 = peg$c1; } return s0; } function peg$parseinteger() { var res; if (res = /^[0-9]{1,3}(?!\d|,000)/.exec(input.substr(peg$currPos))) { peg$reportedPos = peg$currPos; peg$currPos += res[0].length; return {"type": "integer", "value": parseInt(res[0], 10), "indices": [peg$reportedPos, peg$currPos - 1]} } else { return peg$c1; } } function peg$parseany_integer() { var res; if (res = /^[0-9]+/.exec(input.substr(peg$currPos))) { peg$reportedPos = peg$currPos; peg$currPos += res[0].length; return {"type": "integer", "value": parseInt(res[0], 10), "indices": [peg$reportedPos, peg$currPos - 1]} } else { return peg$c1; } } function peg$parseword() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c110.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c111); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c110.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c111); } } } } else { s1 = peg$c1; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c112(s1); } s0 = s1; return s0; } function peg$parseword_parenthesis() { var s0, s1; s0 = peg$currPos; if (peg$c99.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c100); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c113(s1); } s0 = s1; return s0; } function peg$parsesp() { var s0; s0 = peg$parsespace(); if (s0 === peg$FAILED) { s0 = peg$c2; } return s0; } function peg$parsespace() { var res; if (res = /^[\s\xa0*]+/.exec(input.substr(peg$currPos))) { peg$reportedPos = peg$currPos; peg$currPos += res[0].length; return []; } return peg$c1; } peg$result = peg$startRuleFunction(); if (peg$result !== peg$FAILED && peg$currPos === input.length) { return peg$result; } else { if (peg$result !== peg$FAILED && peg$currPos < input.length) { peg$fail({ type: "end", description: "end of input" }); } throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); } } return { SyntaxError: SyntaxError, parse: parse }; })(); }).call(this);
Agrando/Bible-Passage-Reference-Parser
js/eu/ru_bcv_parser.js
JavaScript
mit
254,449
const config = require('../../../knexfile').intweb const knex = require('knex')(config) const dateFormatter = require('../date-formatter') const insertClaimEvent = require('./insert-claim-event') const claimEventEnum = require('../../constants/claim-event-enum') module.exports = function (claimId, isTrusted, untrustedReason) { return getEligibilityData(claimId) .then(function (eligibilityData) { if (isTrusted !== eligibilityData.IsTrusted) { var updateObject = { isTrusted: isTrusted, UntrustedDate: !isTrusted ? dateFormatter.now().toDate() : null, UntrustedReason: !isTrusted ? untrustedReason : null } return knex('Eligibility') .where('EligibilityId', eligibilityData.EligibilityId) .update(updateObject) .then(function () { var event = isTrusted ? claimEventEnum.ALLOW_AUTO_APPROVAL.value : claimEventEnum.DISABLE_AUTO_APPROVAL.value return insertClaimEvent(eligibilityData.Reference, eligibilityData.EligibilityId, claimId, event, null, untrustedReason, null, true) }) } }) } function getEligibilityData (claimId) { return knex('Claim') .join('Eligibility', 'Claim.EligibilityId', '=', 'Eligibility.EligibilityId') .where('ClaimId', claimId) .first() .select('Eligibility.EligibilityId', 'Eligibility.Reference', 'Eligibility.IsTrusted') }
ministryofjustice/apvs-internal-web
app/services/data/update-eligibility-trusted-status.js
JavaScript
mit
1,411
import Ember from 'ember'; import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'; import config from 'ilios/config/environment'; const { inject } = Ember; const { service } = inject; export default Ember.Route.extend(ApplicationRouteMixin, { flashMessages: service(), commonAjax: service(), i18n: service(), moment: service(), /** * Leave titles as an array * All of our routes send translations for the 'titleToken' key and we do the translating in head.hbs * and in the application controller. * @param Array tokens * @return Array */ title(tokens){ return tokens; }, //Override the default session invalidator so we can do auth stuff sessionInvalidated() { if (!Ember.testing) { let logoutUrl = '/auth/logout'; return this.get('commonAjax').request(logoutUrl).then(response => { if(response.status === 'redirect'){ window.location.replace(response.logoutUrl); } else { this.get('flashMessages').success('general.confirmLogout'); window.location.replace(config.rootURL); } }); } }, beforeModel() { const i18n = this.get('i18n'); const moment = this.get('moment'); moment.setLocale(i18n.get('locale')); }, actions: { willTransition: function() { let controller = this.controllerFor('application'); controller.set('errors', []); controller.set('showErrorDisplay', false); } } });
gabycampagna/frontend
app/routes/application.js
JavaScript
mit
1,478
var map = [ [0x1, 0x8], [0x2, 0x10], [0x4, 0x20], [0x40, 0x80] ] function Canvas(width, height) { if(width%2 != 0) { throw new Error('Width must be multiple of 2!'); } if(height%4 != 0) { throw new Error('Height must be multiple of 4!'); } this.width = width; this.height = height; this.content = new Buffer(width*height/8); this.content.fill(0); } var methods = { set: function(coord, mask) { this.content[coord] |= mask; }, unset: function(coord, mask) { this.content[coord] &= ~mask; }, toggle: function(coord, mask) { this.content[coord] ^= mask; } }; Object.keys(methods).forEach(function(method) { Canvas.prototype[method] = function(x, y) { if(!(x >= 0 && x < this.width && y >= 0 && y < this.height)) { return; } x = Math.floor(x); y = Math.floor(y); var nx = Math.floor(x/2); var ny = Math.floor(y/4); var coord = nx + this.width/2*ny; var mask = map[y%4][x%2]; methods[method].call(this, coord, mask); } }); Canvas.prototype.clear = function() { this.content.fill(0); }; Canvas.prototype.frame = function frame(delimiter) { delimiter = delimiter || '\n'; var result = []; for(var i = 0, j = 0; i < this.content.length; i++, j++) { if(j == this.width/2) { result.push(delimiter); j = 0; } if(this.content[i] == 0) { result.push(' '); } else { result.push(String.fromCharCode(0x2800 + this.content[i])) } } result.push(delimiter); return result.join(''); }; module.exports = Canvas;
Student007/node-drawille
index.js
JavaScript
mit
1,557
/** * Test for fur bin. * Runs with mocha. */ 'use strict' const assert = require('assert') const fs = require('fs') const furBin = require.resolve('../bin/fur') const execcli = require('execcli') const mkdirp = require('mkdirp') let tmpDir = __dirname + '/../tmp' describe('bin', function () { this.timeout(24000) before(async () => { await mkdirp(tmpDir) }) after(async () => { }) it('Generate favicon', async () => { let filename = tmpDir + '/testing-bin-favicon.png' await execcli(furBin, [ 'favicon', filename ]) assert.ok(fs.existsSync(filename)) }) it('Generate banner', async () => { let filename = tmpDir + '/testing-bin-banner.png' await execcli(furBin, [ 'banner', filename ]) assert.ok(fs.existsSync(filename)) }) }) /* global describe, before, after, it */
fur-labo/fur
test/bin_test.js
JavaScript
mit
827
Router.map(function(){ this.route('home',{ path:'/', template: 'home', onBeforeAction: function(pause){ this.subscribe('getAlgosByReg',Session.get('mainQuery')).wait(); this.subscribe('getAlgosByName',Session.get('mainQuery')).wait(); this.subscribe('getAlgosByKeyWord',Session.get('mainQuery')).wait(); } }); this.route('guide',{ path:'/guidelines', template:'guidelines' }); this.route('pediaHome',{ path: '/algos', template:'pedia', onBeforeAction: function(pause){ this.subscribe('getAllAlgos'); Session.set('pediaAiD',""); } }); this.route('pediaSpecific',{ path: '/algos/:_id', template:'pedia', onBeforeAction: function(pause){ this.subscribe('getAllAlgos'); this.subscribe('codeByAlgo',this.params._id); Session.set('pediaAiD',this.params._id); } }); this.route('langs',{ template: 'langList', onBeforeAction: function(pause){ Session.set('langPageLang',""); } }); this.route('langSearch',{ path: '/langs/:_id', template: 'langList', onBeforeAction: function(pause){ this.subscribe('codeByLang',this.params._id).wait(); Session.set('langPageLang',this.params._id); } }); this.route('users',{ path: '/users/:_id', template:'userPage', onBeforeAction: function(pause){ this.subscribe('getUserCode',this.params._id).wait(); this.subscribe('getUserAlgos',this.params._id).wait(); var uDoc = Meteor.users.findOne({_id:this.params._id}); Session.set('lastUserSearch',uDoc); if(Session.equals('lastUserSearch',undefined)){ pause(); } } }); this.route('pedia',{ path:'/pedia/:_id', template: 'entryPage', onBeforeAction: function(pause){ this.subscribe('algoParticular',this.params._id).wait(); var aDoc = AlgoPedia.findOne({AiD:this.params._id}); Session.set('lastAlgoSearch',aDoc); Session.set('lsiSelected',null); Session.set('tabSelect','first'); Session.set('lsiLangSearch',null); if(Session.equals('lastAlgoSearch',undefined)){ pause(); } } }); this.route('pediaSearch',{ path:'/pedia/:algo/:search', template: 'entryPage', onBeforeAction: function(pause){ this.subscribe('algoParticular',this.params.algo).wait(); var aDoc=AlgoPedia.findOne({AiD:this.params.algo}); Session.set('lastAlgoSearch',aDoc); if(this.params.search==="showAll"){ this.subscribe('codeByAlgo',this.params.algo).wait(); Session.set('lsiLangSearch',null); Session.set('lsiSelected',null); Session.set('tabSelect','second'); if(Session.equals('lastAlgoSearch',undefined)){ pause(); } } else{ this.subscribe('codeByAlgoAndLang',this.params.algo,this.params.search).wait(); var lDoc = Languages.findOne({Slug:this.params.search}); Session.set('lsiLangSearch',lDoc); Session.set('lsiSelected',null); Session.set('tabSelect','second'); if(Session.equals('lastAlgoSearch',undefined)){ pause(); } if(Session.equals('lsiLangSearch',undefined)){ pause(); } } } }); this.route('lsiSearchRoute',{ path:'/pedia/:algo/:lang/:search', template: 'entryPage', onBeforeAction: function(pause){ this.subscribe('getComments',this.params.search); this.subscribe('algoParticular',this.params.algo).wait(); var aDoc=AlgoPedia.findOne({AiD:this.params.algo}); Session.set('lastAlgoSearch',aDoc); if(this.params.lang==="showAll"){ this.subscribe('codeByAlgo',this.params.algo).wait(); Session.set('lsiSelected',this.params.search); Session.set('tabSelect','second'); Session.set('lsiLangSearch',null); if(Session.equals('lastAlgoSearch',undefined)){ pause(); } } else{ this.subscribe('codeByAlgoAndLang',this.params.algo,this.params.lang).wait(); var lDoc = Languages.findOne({Slug:this.params.lang}); Session.set('lsiSelected',this.params.search); Session.set('tabSelect','second'); Session.set('lsiLangSearch',lDoc); if(Session.equals('lastAlgoSearch',undefined)){ pause(); } if(Session.equals('lsiLangSearch',undefined)){ pause(); } } } }); }); Router.configure({ layoutTemplate: 'layout_main', });
theelee13/Algos
client/router.js
JavaScript
mit
4,130
/** * Imports */ var path = require('path'); var fs = require('fs'); var _ = require('lodash'); /** * BaseDbContext class * @param {Object} options */ var BaseDbContext = module.exports = function(options) { options || (options = {}); this.entities = {}; this._loadModels(); this.initialize.apply(this, arguments); } _.extend(BaseDbContext.prototype, { initialize: function () {}, modelsFolder: [], _loadModels: function () { if(!this.db) { return; } var self = this; this.modelsFolder.forEach(function (folderpath) { fs.readdirSync(folderpath).forEach(function(file) { var modelName = file.split('.')[0]; var model = self.db.import(path.join(folderpath, file)); self.entities[modelName] = model; }); Object.keys(self.entities).forEach(function(modelName) { if ('associate' in self.entities[modelName]) { self.entities[modelName].associate(self.entities); } }); }); }, sync: function () { return this.db.sync(); }, drop: function () { return this.db.drop(); } }); /** * JavaScript extend function */ function extend(protoProps, staticProps) { var parent = this; var child; if (protoProps && _.has(protoProps, 'constructor')) { child = protoProps.constructor; } else { child = function() { return parent.apply(this, arguments); }; } _.extend(child, parent, staticProps); child.prototype = Object.create(parent.prototype, { constructor: { value: child, enumerable: false, writable: true, configurable: true } }); if (protoProps) _.extend(child.prototype, protoProps); child.__super__ = parent.prototype; return child; }; BaseDbContext.extend = extend; module.exports = BaseDbContext;
anthonycluse/passagenda
db/libs/BaseDbContext.js
JavaScript
mit
1,841
import React, {Component} from "react"; import { addAnimationId } from './modules/animationFunctions.js' import '../scss/dev-projects.css'; import close from "../assets/close.png"; export default class DevProjects extends Component { componentDidMount() { addAnimationId('dev-projects', 'dev-section-fadein') } render() { return ( <div id="dev-projects"> <i onClick={this.props.closeButtonClick} className="fal fa-times"></i> <div className="project-container"> <div> <p>PERSONAL SITE PROJECT</p> <p>BUILT A NEW PERSONAL SITE USING REACT.JS WHILE UTILIZING VARIOUS ANIMATIONS AND TRANSITIONS</p> </div> <div> <a href="https://github.com/Ayaz2589/personal_site" target="_blank"> VIEW PERSONAL SITE CODEBASE </a> </div> </div> </div> ); } };
Ayaz2589/Ayaz2589.github.io
src/components/DevProjects.js
JavaScript
mit
895
import React, { PropTypes } from 'react'; import Spinner from './Spinner'; const ModalOverlay = (props) => { const isActive = props.active ? 'active' : ''; const spinner = props.spinner ? <Spinner /> : ''; return ( <div id="modal-overlay" className={isActive}> {spinner} </div> ); }; ModalOverlay.propTypes = { active: PropTypes.bool, spinner: PropTypes.bool, }; export default ModalOverlay;
phillydorn/CAProject2
app/components/utility/ModalOverlay.js
JavaScript
mit
424
version https://git-lfs.github.com/spec/v1 oid sha256:1371b661d4ebad753ee72a0b75d51aca5ca885cbb51d046e634951057b5314f6 size 144
yogeshsaroya/new-cdnjs
ajax/libs/yui/3.18.0/tree-selectable/debug.js
JavaScript
mit
128
function tabCtrl(id) { var element = document.querySelectorAll('[data-selector="tabbar/tab"]'); for (var i = 0; i < element.length; i++) { if (element[i].dataset.id === id) { element[i].classList.add('tabbar__tab__active'); } else { element[i].classList.remove('tabbar__tab__active'); } } } function tabItemCtrl(id) { var element = document.querySelectorAll('[data-selector="tabbar/item"]'); for (var i = 0; i < element.length; i++) { if (element[i].dataset.id === id) { element[i].classList.remove('tabbar__item--hidden'); } else { element[i].classList.add('tabbar__item--hidden'); } } } function init() { var links = document.querySelectorAll('[data-selector="tabbar/tab"]'); for (var i = 0; i < links.length; i++) { links[i].addEventListener('click', function (event) { event.preventDefault(); tabCtrl(this.dataset.id); tabItemCtrl(this.dataset.id); }, false); } } export default init;
guddii/floidtv
app/components/tabbar/itemCtrl.js
JavaScript
mit
944
import core from 'comindware/core'; import CanvasView from 'demoPage/views/CanvasView'; export default function() { const model = new Backbone.Model({ referenceValue: { id: 'test.1', text: 'Test Reference 1' } }); return new CanvasView({ view: new core.form.editors.ReferenceBubbleEditor({ model, key: 'referenceValue', autocommit: true, showEditButton: true, controller: new core.form.editors.reference.controllers.DemoReferenceEditorController() }), presentation: "{{#if referenceValue}}{ id: '{{referenceValue.id}}', text: '{{referenceValue.text}}' }{{else}}null{{/if}}" }); }
wilerus/core-ui
demo/public/app/cases/editors/ReferenceEditor.js
JavaScript
mit
746
'use strict'; // Use local.env.js for environment variables that grunt will set when the server starts locally. // Use for your api keys, secrets, etc. This file should not be tracked by git. // // You will need to set these on the server you deploy to. module.exports = { DOMAIN: 'http://localhost:9000', SESSION_SECRET: 'zebratest-secret', // Control debug level for modules using visionmedia/debug DEBUG: '' };
robertraleigh/zebras
server/config/local.env.sample.js
JavaScript
mit
437
/* Copyright 2013, KISSY UI Library v1.30 MIT Licensed build time: Jul 1 20:13 */ var KISSY=function(a){var b=this,i,k=0;i={__BUILD_TIME:"20130701201313",Env:{host:b,nodejs:"function"==typeof require&&"object"==typeof exports},Config:{debug:"",fns:{}},version:"1.30",config:function(b,j){var l,e,f=this,d,h=i.Config,c=h.fns;i.isObject(b)?i.each(b,function(m,a){(d=c[a])?d.call(f,m):h[a]=m}):(l=c[b],j===a?e=l?l.call(f):h[b]:l?e=l.call(f,j):h[b]=j);return e},log:function(g,j,l){if(i.Config.debug&&(l&&(g=l+": "+g),b.console!==a&&console.log))console[j&&console[j]?j:"log"](g)}, error:function(a){if(i.Config.debug)throw a instanceof Error?a:Error(a);},guid:function(a){return(a||"")+k++}};i.Env.nodejs&&(i.KISSY=i,module.exports=i);return i}(); (function(a,b){function i(){}function k(c,a){var b;d?b=d(c):(i.prototype=c,b=new i);b.constructor=a;return b}function g(c,d,h,e,g,i){if(!d||!c)return c;h===b&&(h=f);var k=0,s,u,v;d[l]=c;i.push(d);if(e){v=e.length;for(k=0;k<v;k++)s=e[k],s in d&&j(s,c,d,h,e,g,i)}else{u=a.keys(d);v=u.length;for(k=0;k<v;k++)s=u[k],s!=l&&j(s,c,d,h,e,g,i)}return c}function j(c,d,h,e,j,i,k){if(e||!(c in d)||i){var s=d[c],h=h[c];if(s===h)s===b&&(d[c]=s);else if(i&&h&&(a.isArray(h)||a.isPlainObject(h)))h[l]?d[c]=h[l]:(i=s&& (a.isArray(s)||a.isPlainObject(s))?s:a.isArray(h)?[]:{},d[c]=i,g(i,h,e,j,f,k));else if(h!==b&&(e||!(c in d)))d[c]=h}}var l="__MIX_CIRCULAR",e=this,f=!0,d=Object.create,h=!{toString:1}.propertyIsEnumerable("toString"),c="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toString,toLocaleString,valueOf".split(",");(function(c,a){for(var d in a)c[d]=a[d]})(a,{stamp:function(c,d,h){if(!c)return c;var h=h||"__~ks_stamped",f=c[h];if(!f&&!d)try{f=c[h]=a.guid(h)}catch(e){f=b}return f},keys:function(a){var d= [],b,f;for(b in a)d.push(b);if(h)for(f=c.length-1;0<=f;f--)b=c[f],a.hasOwnProperty(b)&&d.push(b);return d},mix:function(c,a,d,b,h){"object"===typeof d&&(b=d.whitelist,h=d.deep,d=d.overwrite);var f=[],e=0;for(g(c,a,d,b,h,f);a=f[e++];)delete a[l];return c},merge:function(c){var c=a.makeArray(arguments),d={},b,h=c.length;for(b=0;b<h;b++)a.mix(d,c[b]);return d},augment:function(c,d){var h=a.makeArray(arguments),f=h.length-2,e=1,j=h[f],g=h[f+1];a.isArray(g)||(j=g,g=b,f++);a.isBoolean(j)||(j=b,f++);for(;e< f;e++)a.mix(c.prototype,h[e].prototype||h[e],j,g);return c},extend:function(c,d,b,h){if(!d||!c)return c;var f=d.prototype,e;e=k(f,c);c.prototype=a.mix(e,c.prototype);c.superclass=k(f,d);b&&a.mix(e,b);h&&a.mix(c,h);return c},namespace:function(){var c=a.makeArray(arguments),d=c.length,b=null,h,j,g,i=c[d-1]===f&&d--;for(h=0;h<d;h++){g=(""+c[h]).split(".");b=i?e:this;for(j=e[g[0]]===b?1:0;j<g.length;++j)b=b[g[j]]=b[g[j]]||{}}return b}})})(KISSY); (function(a,b){var i=Array.prototype,k=i.indexOf,g=i.lastIndexOf,j=i.filter,l=i.every,e=i.some,f=i.map;a.mix(a,{each:function(d,h,c){if(d){var m,f,e=0;m=d&&d.length;f=m===b||"function"===a.type(d);c=c||null;if(f)for(f=a.keys(d);e<f.length&&!(m=f[e],!1===h.call(c,d[m],m,d));e++);else for(f=d[0];e<m&&!1!==h.call(c,f,e,d);f=d[++e]);}return d},indexOf:k?function(d,a){return k.call(a,d)}:function(d,a){for(var c=0,b=a.length;c<b;++c)if(a[c]===d)return c;return-1},lastIndexOf:g?function(d,a){return g.call(a, d)}:function(d,a){for(var c=a.length-1;0<=c&&a[c]!==d;c--);return c},unique:function(d,b){var c=d.slice();b&&c.reverse();for(var m=0,f,e;m<c.length;){for(e=c[m];(f=a.lastIndexOf(e,c))!==m;)c.splice(f,1);m+=1}b&&c.reverse();return c},inArray:function(d,b){return-1<a.indexOf(d,b)},filter:j?function(d,a,c){return j.call(d,a,c||this)}:function(d,b,c){var m=[];a.each(d,function(d,a,f){b.call(c||this,d,a,f)&&m.push(d)});return m},map:f?function(d,a,c){return f.call(d,a,c||this)}:function(d,a,c){for(var b= d.length,f=Array(b),e=0;e<b;e++){var j="string"==typeof d?d.charAt(e):d[e];if(j||e in d)f[e]=a.call(c||this,j,e,d)}return f},reduce:function(a,f,c){var m=a.length;if("function"!==typeof f)throw new TypeError("callback is not function!");if(0===m&&2==arguments.length)throw new TypeError("arguments invalid");var e=0,j;if(3<=arguments.length)j=arguments[2];else{do{if(e in a){j=a[e++];break}e+=1;if(e>=m)throw new TypeError;}while(1)}for(;e<m;)e in a&&(j=f.call(b,j,a[e],e,a)),e++;return j},every:l?function(a, b,c){return l.call(a,b,c||this)}:function(a,b,c){for(var f=a&&a.length||0,e=0;e<f;e++)if(e in a&&!b.call(c,a[e],e,a))return!1;return!0},some:e?function(a,b,c){return e.call(a,b,c||this)}:function(a,b,c){for(var f=a&&a.length||0,e=0;e<f;e++)if(e in a&&b.call(c,a[e],e,a))return!0;return!1},makeArray:function(d){if(null==d)return[];if(a.isArray(d))return d;if("number"!==typeof d.length||d.alert||"string"==typeof d||a.isFunction(d))return[d];for(var b=[],c=0,f=d.length;c<f;c++)b[c]=d[c];return b}})})(KISSY); (function(a,b){function i(c){var a=typeof c;return null==c||"object"!==a&&"function"!==a}function k(){if(f)return f;var c=j;a.each(l,function(a){c+=a+"|"});c=c.slice(0,-1);return f=RegExp(c,"g")}function g(){if(d)return d;var c=j;a.each(e,function(a){c+=a+"|"});c+="&#(\\d{1,5});";return d=RegExp(c,"g")}var j="",l={"&amp;":"&","&gt;":">","&lt;":"<","&#x60;":"`","&#x2F;":"/","&quot;":'"',"&#x27;":"'"},e={},f,d,h=/[\-#$\^*()+\[\]{}|\\,.?\s]/g;(function(){for(var c in l)e[l[c]]=c})();a.mix(a,{urlEncode:function(c){return encodeURIComponent(""+ c)},urlDecode:function(c){return decodeURIComponent(c.replace(/\+/g," "))},fromUnicode:function(c){return c.replace(/\\u([a-f\d]{4})/ig,function(c,a){return String.fromCharCode(parseInt(a,16))})},escapeHTML:function(c){return(c+"").replace(k(),function(c){return e[c]})},escapeRegExp:function(c){return c.replace(h,"\\$&")},unEscapeHTML:function(c){return c.replace(g(),function(c,a){return l[c]||String.fromCharCode(+a)})},param:function(c,d,f,e){if(!a.isPlainObject(c))return j;d=d||"&";f=f||"=";a.isUndefined(e)&& (e=!0);var h=[],g,l,k,s,u,v=a.urlEncode;for(g in c)if(u=c[g],g=v(g),i(u))h.push(g),u!==b&&h.push(f,v(u+j)),h.push(d);else if(a.isArray(u)&&u.length){l=0;for(s=u.length;l<s;++l)k=u[l],i(k)&&(h.push(g,e?v("[]"):j),k!==b&&h.push(f,v(k+j)),h.push(d))}h.pop();return h.join(j)},unparam:function(c,d,f){if("string"!=typeof c||!(c=a.trim(c)))return{};for(var f=f||"=",e={},h,j=a.urlDecode,c=c.split(d||"&"),g=0,i=c.length;g<i;++g){h=c[g].indexOf(f);if(-1==h)d=j(c[g]),h=b;else{d=j(c[g].substring(0,h));h=c[g].substring(h+ 1);try{h=j(h)}catch(l){}a.endsWith(d,"[]")&&(d=d.substring(0,d.length-2))}d in e?a.isArray(e[d])?e[d].push(h):e[d]=[e[d],h]:e[d]=h}return e}})})(KISSY); (function(a){function b(a,b,g){var j=[].slice,l=j.call(arguments,3),e=function(){},f=function(){var d=j.call(arguments);return b.apply(this instanceof e?this:g,a?d.concat(l):l.concat(d))};e.prototype=b.prototype;f.prototype=new e;return f}a.mix(a,{noop:function(){},bind:b(0,b,null,0),rbind:b(0,b,null,1),later:function(b,k,g,j,l){var k=k||0,e=b,f=a.makeArray(l),d;"string"==typeof b&&(e=j[b]);b=function(){e.apply(j,f)};d=g?setInterval(b,k):setTimeout(b,k);return{id:d,interval:g,cancel:function(){this.interval? clearInterval(d):clearTimeout(d)}}},throttle:function(b,k,g){k=k||150;if(-1===k)return function(){b.apply(g||this,arguments)};var j=a.now();return function(){var l=a.now();l-j>k&&(j=l,b.apply(g||this,arguments))}},buffer:function(b,k,g){function j(){j.stop();l=a.later(b,k,0,g||this,arguments)}k=k||150;if(-1===k)return function(){b.apply(g||this,arguments)};var l=null;j.stop=function(){l&&(l.cancel(),l=0)};return j}})})(KISSY); (function(a,b){function i(b,d,e){var c=b,m,n,g,o;if(!b)return c;if(b[l])return e[b[l]].destination;if("object"===typeof b){o=b.constructor;if(a.inArray(o,[Boolean,String,Number,Date,RegExp]))c=new o(b.valueOf());else if(m=a.isArray(b))c=d?a.filter(b,d):b.concat();else if(n=a.isPlainObject(b))c={};b[l]=o=a.guid();e[o]={destination:c,input:b}}if(m)for(b=0;b<c.length;b++)c[b]=i(c[b],d,e);else if(n)for(g in b)if(g!==l&&(!d||d.call(b,b[g],g,b)!==j))c[g]=i(b[g],d,e);return c}function k(f,d,h,c){if(f[e]=== d&&d[e]===f)return g;f[e]=d;d[e]=f;var m=function(c,a){return null!==c&&c!==b&&c[a]!==b},n;for(n in d)!m(f,n)&&m(d,n)&&h.push("expected has key '"+n+"', but missing from actual.");for(n in f)!m(d,n)&&m(f,n)&&h.push("expected missing key '"+n+"', but present in actual.");for(n in d)n!=e&&(a.equals(f[n],d[n],h,c)||c.push("'"+n+"' was '"+(d[n]?d[n].toString():d[n])+"' in expected, but was '"+(f[n]?f[n].toString():f[n])+"' in actual."));a.isArray(f)&&a.isArray(d)&&f.length!=d.length&&c.push("arrays were not the same length"); delete f[e];delete d[e];return 0===h.length&&0===c.length}var g=!0,j=!1,l="__~ks_cloned",e="__~ks_compared";a.mix(a,{equals:function(e,d,h,c){h=h||[];c=c||[];return e===d?g:e===b||null===e||d===b||null===d?null==e&&null==d:e instanceof Date&&d instanceof Date?e.getTime()==d.getTime():"string"==typeof e&&"string"==typeof d||a.isNumber(e)&&a.isNumber(d)?e==d:"object"===typeof e&&"object"===typeof d?k(e,d,h,c):e===d},clone:function(e,d){var h={},c=i(e,d,h);a.each(h,function(c){c=c.input;if(c[l])try{delete c[l]}catch(a){c[l]= b}});h=null;return c},now:Date.now||function(){return+new Date}})})(KISSY); (function(a,b){var i=/^[\s\xa0]+|[\s\xa0]+$/g,k=String.prototype.trim,g=/\\?\{([^{}]+)\}/g;a.mix(a,{trim:k?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(i,"")},substitute:function(a,i,e){return"string"!=typeof a||!i?a:a.replace(e||g,function(a,d){return"\\"===a.charAt(0)?a.slice(1):i[d]===b?"":i[d]})},ucfirst:function(a){a+="";return a.charAt(0).toUpperCase()+a.substring(1)},startsWith:function(a,b){return 0===a.lastIndexOf(b,0)},endsWith:function(a,b){var e= a.length-b.length;return 0<=e&&a.indexOf(b,e)==e}})})(KISSY); (function(a,b){var i={},k=Object.prototype.toString;a.mix(a,{isBoolean:0,isNumber:0,isString:0,isFunction:0,isArray:0,isDate:0,isRegExp:0,isObject:0,type:function(a){return null==a?""+a:i[k.call(a)]||"object"},isNull:function(a){return null===a},isUndefined:function(a){return a===b},isEmptyObject:function(a){for(var j in a)if(j!==b)return!1;return!0},isPlainObject:function(g){if(!g||"object"!==a.type(g)||g.nodeType||g.window==g)return!1;try{if(g.constructor&&!Object.prototype.hasOwnProperty.call(g, "constructor")&&!Object.prototype.hasOwnProperty.call(g.constructor.prototype,"isPrototypeOf"))return!1}catch(j){return!1}for(var i in g);return i===b||Object.prototype.hasOwnProperty.call(g,i)}});a.each("Boolean,Number,String,Function,Array,Date,RegExp,Object".split(","),function(b,j){i["[object "+b+"]"]=j=b.toLowerCase();a["is"+b]=function(b){return a.type(b)==j}})})(KISSY); (function(a,b){function i(a,d,e){if(a instanceof l)return e(a[h]);var f=a[h];if(a=a[c])a.push([d,e]);else if(g(f))i(f,d,e);else return d&&d(f);return b}function k(a){if(!(this instanceof k))return new k(a);this.promise=a||new j}function g(a){return a&&a instanceof j}function j(a){this[h]=a;a===b&&(this[c]=[])}function l(a){if(a instanceof l)return a;j.apply(this,arguments);return b}function e(a,c,b){function d(a){try{return c?c(a):a}catch(b){return new l(b)}}function e(a){try{return b?b(a):new l(a)}catch(c){return new l(c)}} function h(a){g||(g=1,f.resolve(d(a)))}var f=new k,g=0;a instanceof j?i(a,h,function(a){g||(g=1,f.resolve(e(a)))}):h(a);return f.promise}function f(a){return!d(a)&&g(a)&&a[c]===b&&(!g(a[h])||f(a[h]))}function d(a){return g(a)&&a[c]===b&&a[h]instanceof l}var h="__promise_value",c="__promise_pendings";k.prototype={constructor:k,resolve:function(d){var e=this.promise,f;if(!(f=e[c]))return b;e[h]=d;f=[].concat(f);e[c]=b;a.each(f,function(a){i(e,a[0],a[1])});return d},reject:function(a){return this.resolve(new l(a))}}; j.prototype={constructor:j,then:function(a,c){return e(this,a,c)},fail:function(a){return e(this,0,a)},fin:function(a){return e(this,function(c){return a(c,!0)},function(c){return a(c,!1)})},isResolved:function(){return f(this)},isRejected:function(){return d(this)}};a.extend(l,j);KISSY.Defer=k;KISSY.Promise=j;j.Defer=k;a.mix(j,{when:e,isPromise:g,isResolved:f,isRejected:d,all:function(a){var c=a.length;if(!c)return a;for(var b=k(),d=0;d<a.length;d++)(function(d,h){e(d,function(d){a[h]=d;0===--c&& b.resolve(a)},function(a){b.reject(a)})})(a[d],d);return b.promise}})})(KISSY); (function(a){function b(a,b){for(var i=0,e=a.length-1,f=[],d;0<=e;e--)d=a[e],"."!=d&&(".."===d?i++:i?i--:f[f.length]=d);if(b)for(;i--;i)f[f.length]="..";return f=f.reverse()}var i=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,k={resolve:function(){var g="",j,i=arguments,e,f=0;for(j=i.length-1;0<=j&&!f;j--)e=i[j],"string"==typeof e&&e&&(g=e+"/"+g,f="/"==e.charAt(0));g=b(a.filter(g.split("/"),function(a){return!!a}),!f).join("/");return(f?"/":"")+g||"."},normalize:function(g){var j= "/"==g.charAt(0),i="/"==g.slice(-1),g=b(a.filter(g.split("/"),function(a){return!!a}),!j).join("/");!g&&!j&&(g=".");g&&i&&(g+="/");return(j?"/":"")+g},join:function(){var b=a.makeArray(arguments);return k.normalize(a.filter(b,function(a){return a&&"string"==typeof a}).join("/"))},relative:function(b,j){var b=k.normalize(b),j=k.normalize(j),i=a.filter(b.split("/"),function(a){return!!a}),e=[],f,d,h=a.filter(j.split("/"),function(a){return!!a});d=Math.min(i.length,h.length);for(f=0;f<d&&i[f]==h[f];f++); for(d=f;f<i.length;)e.push(".."),f++;e=e.concat(h.slice(d));return e=e.join("/")},basename:function(a,b){var k;k=(a.match(i)||[])[3]||"";b&&k&&k.slice(-1*b.length)==b&&(k=k.slice(0,-1*b.length));return k},dirname:function(a){var b=a.match(i)||[],a=b[1]||"",b=b[2]||"";if(!a&&!b)return".";b&&(b=b.substring(0,b.length-1));return a+b},extname:function(a){return(a.match(i)||[])[4]||""}};a.Path=k})(KISSY); (function(a,b){function i(c){c._queryMap||(c._queryMap=a.unparam(c._query))}function k(a){this._query=a||""}function g(a,c){return encodeURI(a).replace(c,function(a){a=a.charCodeAt(0).toString(16);return"%"+(1==a.length?"0"+a:a)})}function j(c){if(c instanceof j)return c.clone();var b=this;a.mix(b,{scheme:"",userInfo:"",hostname:"",port:"",path:"",query:"",fragment:""});c=j.getComponents(c);a.each(c,function(c,d){c=c||"";if("query"==d)b.query=new k(c);else{try{c=a.urlDecode(c)}catch(e){}b[d]=c}}); return b}var l=/[#\/\?@]/g,e=/[#\?]/g,f=/[#@]/g,d=/#/g,h=RegExp("^(?:([\\w\\d+.-]+):)?(?://(?:([^/?#@]*)@)?([\\w\\d\\-\\u0100-\\uffff.+%]*|\\[[^\\]]+\\])(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),c=a.Path,m={scheme:1,userInfo:2,hostname:3,port:4,path:5,query:6,fragment:7};k.prototype={constructor:k,clone:function(){return new k(this.toString())},reset:function(a){this._query=a||"";this._queryMap=null;return this},count:function(){var c,b=0,d;i(this);c=this._queryMap;for(d in c)a.isArray(c[d])? b+=c[d].length:b++;return b},has:function(c){var b;i(this);b=this._queryMap;return c?c in b:!a.isEmptyObject(b)},get:function(a){var c;i(this);c=this._queryMap;return a?c[a]:c},keys:function(){i(this);return a.keys(this._queryMap)},set:function(c,b){var d;i(this);d=this._queryMap;"string"==typeof c?this._queryMap[c]=b:(c instanceof k&&(c=c.get()),a.each(c,function(a,c){d[c]=a}));return this},remove:function(a){i(this);a?delete this._queryMap[a]:this._queryMap={};return this},add:function(c,d){var e= this,h,f;a.isObject(c)?(c instanceof k&&(c=c.get()),a.each(c,function(a,c){e.add(c,a)})):(i(e),h=e._queryMap,f=h[c],f=f===b?d:[].concat(f).concat(d),h[c]=f);return e},toString:function(c){i(this);return a.param(this._queryMap,b,b,c)}};j.prototype={constructor:j,clone:function(){var c=new j,b=this;a.each(m,function(a,d){c[d]=b[d]});c.query=c.query.clone();return c},resolve:function(b){"string"==typeof b&&(b=new j(b));var d=0,e,h=this.clone();a.each("scheme,userInfo,hostname,port,path,query,fragment".split(","), function(f){if(f=="path")if(d)h[f]=b[f];else{if(f=b.path){d=1;if(!a.startsWith(f,"/"))if(h.hostname&&!h.path)f="/"+f;else if(h.path){e=h.path.lastIndexOf("/");e!=-1&&(f=h.path.slice(0,e+1)+f)}h.path=c.normalize(f)}}else if(f=="query"){if(d||b.query.toString()){h.query=b.query.clone();d=1}}else if(d||b[f]){h[f]=b[f];d=1}});return h},getScheme:function(){return this.scheme},setScheme:function(a){this.scheme=a;return this},getHostname:function(){return this.hostname},setHostname:function(a){this.hostname= a;return this},setUserInfo:function(a){this.userInfo=a;return this},getUserInfo:function(){return this.userInfo},setPort:function(a){this.port=a;return this},getPort:function(){return this.port},setPath:function(a){this.path=a;return this},getPath:function(){return this.path},setQuery:function(c){"string"==typeof c&&(a.startsWith(c,"?")&&(c=c.slice(1)),c=new k(g(c,f)));this.query=c;return this},getQuery:function(){return this.query},getFragment:function(){return this.fragment},setFragment:function(c){a.startsWith(c, "#")&&(c=c.slice(1));this.fragment=c;return this},isSameOriginAs:function(a){return this.hostname.toLowerCase()==a.hostname.toLowerCase()&&this.scheme.toLowerCase()==a.scheme.toLowerCase()&&this.port.toLowerCase()==a.port.toLowerCase()},toString:function(b){var h=[],f,m;if(f=this.scheme)h.push(g(f,l)),h.push(":");if(f=this.hostname){h.push("//");if(m=this.userInfo)h.push(g(m,l)),h.push("@");h.push(encodeURIComponent(f));if(m=this.port)h.push(":"),h.push(m)}if(m=this.path)f&&!a.startsWith(m,"/")&& (m="/"+m),m=c.normalize(m),h.push(g(m,e));if(b=this.query.toString.call(this.query,b))h.push("?"),h.push(b);if(b=this.fragment)h.push("#"),h.push(g(b,d));return h.join("")}};j.Query=k;j.getComponents=function(c){var b=(c||"").match(h)||[],d={};a.each(m,function(a,c){d[c]=b[a]});return d};a.Uri=j})(KISSY); (function(a,b){function i(a){var c;return(c=a.match(/MSIE\s([^;]*)/))&&c[1]?n(c[1]):0}var k=a.Env.host,g=k.document,k=(k=k.navigator)&&k.userAgent||"",j,l="",e="",f,d=[6,9],h=g&&g.createElement("div"),c=[],m=KISSY.UA={webkit:b,trident:b,gecko:b,presto:b,chrome:b,safari:b,firefox:b,ie:b,opera:b,mobile:b,core:b,shell:b,phantomjs:b,os:b,ipad:b,iphone:b,ipod:b,ios:b,android:b,nodejs:b},n=function(a){var c=0;return parseFloat(a.replace(/\./g,function(){return 0===c++?".":""}))};h&&(h.innerHTML="<\!--[if IE {{version}}]><s></s><![endif]--\>".replace("{{version}}", ""),c=h.getElementsByTagName("s"));if(0<c.length){e="ie";m[l="trident"]=0.1;if((f=k.match(/Trident\/([\d.]*)/))&&f[1])m[l]=n(f[1]);f=d[0];for(d=d[1];f<=d;f++)if(h.innerHTML="<\!--[if IE {{version}}]><s></s><![endif]--\>".replace("{{version}}",f),0<c.length){m[e]=f;break}var p;if(!m.ie&&(p=i(k)))m[e="ie"]=p}else if((f=k.match(/AppleWebKit\/([\d.]*)/))&&f[1]){m[l="webkit"]=n(f[1]);if((f=k.match(/Chrome\/([\d.]*)/))&&f[1])m[e="chrome"]=n(f[1]);else if((f=k.match(/\/([\d.]*) Safari/))&&f[1])m[e="safari"]= n(f[1]);if(/ Mobile\//.test(k)&&k.match(/iPad|iPod|iPhone/)){m.mobile="apple";if((f=k.match(/OS ([^\s]*)/))&&f[1])m.ios=n(f[1].replace("_","."));j="ios";if((f=k.match(/iPad|iPod|iPhone/))&&f[0])m[f[0].toLowerCase()]=m.ios}else if(/ Android/.test(k)){if(/Mobile/.test(k)&&(j=m.mobile="android"),(f=k.match(/Android ([^\s]*);/))&&f[1])m.android=n(f[1])}else if(f=k.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))m.mobile=f[0].toLowerCase();if((f=k.match(/PhantomJS\/([^\s]*)/))&&f[1])m.phantomjs=n(f[1])}else if((f= k.match(/Presto\/([\d.]*)/))&&f[1]){if(m[l="presto"]=n(f[1]),(f=k.match(/Opera\/([\d.]*)/))&&f[1]){m[e="opera"]=n(f[1]);if((f=k.match(/Opera\/.* Version\/([\d.]*)/))&&f[1])m[e]=n(f[1]);if((f=k.match(/Opera Mini[^;]*/))&&f)m.mobile=f[0].toLowerCase();else if((f=k.match(/Opera Mobi[^;]*/))&&f)m.mobile=f[0]}}else if((f=k.match(/MSIE\s([^;]*)/))&&f[1]){if(m[l="trident"]=0.1,m[e="ie"]=n(f[1]),(f=k.match(/Trident\/([\d.]*)/))&&f[1])m[l]=n(f[1])}else if(f=k.match(/Gecko/)){m[l="gecko"]=0.1;if((f=k.match(/rv:([\d.]*)/))&& f[1])m[l]=n(f[1]);if((f=k.match(/Firefox\/([\d.]*)/))&&f[1])m[e="firefox"]=n(f[1])}j||(/windows|win32/i.test(k)?j="windows":/macintosh|mac_powerpc/i.test(k)?j="macintosh":/linux/i.test(k)?j="linux":/rhino/i.test(k)&&(j="rhino"));if("object"===typeof process){var o,q;if((o=process.versions)&&(q=o.node))j=process.platform,m.nodejs=n(q)}m.os=j;m.core=l;m.shell=e;m._numberify=n;j="webkit,trident,gecko,presto,chrome,safari,firefox,ie,opera".split(",");var g=g&&g.documentElement,r="";g&&(a.each(j,function(a){var c= m[a];if(c){r=r+(" ks-"+a+(parseInt(c)+""));r=r+(" ks-"+a)}}),a.trim(r)&&(g.className=a.trim(g.className+r)))})(KISSY);(function(a){var b=a.Env,i=b.host,k=a.UA,g=i.document||{},j="ontouchstart"in g&&!k.phantomjs,l=(g=g.documentMode)||k.ie,e=(b.nodejs&&"object"===typeof global?global:i).JSON;g&&9>g&&(e=0);a.Features={isTouchSupported:function(){return j},isDeviceMotionSupported:function(){return!!i.DeviceMotionEvent},isHashChangeSupported:function(){return"onhashchange"in i&&(!l||7<l)},isNativeJSONSupported:function(){return e}}})(KISSY); (function(a){function b(a){this.runtime=a}b.Status={INIT:0,LOADING:1,LOADED:2,ERROR:3,ATTACHED:4};a.Loader=b;a.Loader.Status=b.Status})(KISSY); (function(a){function b(a,b,j){a=a[i]||(a[i]={});j&&(a[b]=a[b]||[]);return a[b]}a.namespace("Loader");var i="__events__"+a.now();KISSY.Loader.Target={on:function(a,g){b(this,a,1).push(g)},detach:function(k,g){var j,l;if(k){if(j=b(this,k))g&&(l=a.indexOf(g,j),-1!=l&&j.splice(l,1)),(!g||!j.length)&&delete (this[i]||(this[i]={}))[k]}else delete this[i]},fire:function(a,g){var j=b(this,a)||[],i,e=j.length;for(i=0;i<e;i++)j[i].call(null,g)}}})(KISSY); (function(a){function b(a){if("string"==typeof a)return i(a);for(var c=[],b=0,d=a.length;b<d;b++)c[b]=i(a[b]);return c}function i(a){"/"==a.charAt(a.length-1)&&(a+="index");return a}function k(c,b,d){var c=c.Env.mods,e,h,b=a.makeArray(b);for(h=0;h<b.length;h++)if(e=c[b[h]],!e||e.status!==d)return 0;return 1}var g=a.Loader,j=a.Path,l=a.Env.host,e=a.startsWith,f=g.Status,d=f.ATTACHED,h=f.LOADED,c=a.Loader.Utils={},m=l.document;a.mix(c,{docHead:function(){return m.getElementsByTagName("head")[0]||m.documentElement}, normalDepModuleName:function(a,b){var d=0,h;if(!b)return b;if("string"==typeof b)return e(b,"../")||e(b,"./")?j.resolve(j.dirname(a),b):j.normalize(b);for(h=b.length;d<h;d++)b[d]=c.normalDepModuleName(a,b[d]);return b},createModulesInfo:function(b,d){a.each(d,function(a){c.createModuleInfo(b,a)})},createModuleInfo:function(c,b,d){var b=i(b),e=c.Env.mods,h=e[b];return h?h:e[b]=h=new g.Module(a.mix({name:b,runtime:c},d))},isAttached:function(a,c){return k(a,c,d)},isLoaded:function(a,c){return k(a,c, h)},getModules:function(b,e){var h=[b],f,m,g,j,i=b.Env.mods;a.each(e,function(e){f=i[e];if(!f||"css"!=f.getType())m=c.unalias(b,e),(g=a.reduce(m,function(a,c){j=i[c];return a&&j&&j.status==d},!0))?h.push(i[m[0]].value):h.push(null)});return h},attachModsRecursively:function(a,b,d){var d=d||[],e,h=1,f=a.length,m=d.length;for(e=0;e<f;e++)h=c.attachModRecursively(a[e],b,d)&&h,d.length=m;return h},attachModRecursively:function(b,e,f){var m,g=e.Env.mods[b];if(!g)return 0;m=g.status;if(m==d)return 1;if(m!= h)return 0;if(a.Config.debug){if(a.inArray(b,f))return f.push(b),0;f.push(b)}return c.attachModsRecursively(g.getNormalizedRequires(),e,f)?(c.attachMod(e,g),1):0},attachMod:function(a,b){if(b.status==h){var e=b.fn;e&&(b.value=e.apply(b,c.getModules(a,b.getRequiresWithAlias())));b.status=d;a.getLoader().fire("afterModAttached",{mod:b})}},getModNamesAsArray:function(a){"string"==typeof a&&(a=a.replace(/\s+/g,"").split(","));return a},normalizeModNames:function(a,b,d){return c.unalias(a,c.normalizeModNamesWithAlias(a, b,d))},unalias:function(a,c){for(var d=[].concat(c),e,h,f,m=0,g,j=a.Env.mods;!m;){m=1;for(e=d.length-1;0<=e;e--)if((h=j[d[e]])&&(f=h.alias)){m=0;for(g=f.length-1;0<=g;g--)f[g]||f.splice(g,1);d.splice.apply(d,[e,1].concat(b(f)))}}return d},normalizeModNamesWithAlias:function(a,d,e){var a=[],h,f;if(d){h=0;for(f=d.length;h<f;h++)d[h]&&a.push(b(d[h]))}e&&(a=c.normalDepModuleName(e,a));return a},registerModule:function(b,d,e,f){var m=b.Env.mods,g=m[d];if(!g||!g.fn)c.createModuleInfo(b,d),g=m[d],a.mix(g, {name:d,status:h,fn:e}),a.mix(g,f)},getMappedPath:function(a,c,b){for(var a=b||a.Config.mappedRules||[],d,b=0;b<a.length;b++)if(d=a[b],c.match(d[0]))return c.replace(d[0],d[1]);return c}})})(KISSY); (function(a){function b(a,b){return b in a?a[b]:a.runtime.Config[b]}function i(b){a.mix(this,b)}function k(b){this.status=j.Status.INIT;a.mix(this,b)}var g=a.Path,j=a.Loader,l=j.Utils;a.augment(i,{getTag:function(){return b(this,"tag")},getName:function(){return this.name},getBase:function(){return b(this,"base")},getPrefixUriForCombo:function(){var a=this.getName();return this.getBase()+(a&&!this.isIgnorePackageNameInUri()?a+"/":"")},getBaseUri:function(){return b(this,"baseUri")},isDebug:function(){return b(this, "debug")},isIgnorePackageNameInUri:function(){return b(this,"ignorePackageNameInUri")},getCharset:function(){return b(this,"charset")},isCombine:function(){return b(this,"combine")}});j.Package=i;a.augment(k,{setValue:function(a){this.value=a},getType:function(){var a=this.type;a||(this.type=a=".css"==g.extname(this.name).toLowerCase()?"css":"js");return a},getFullPath:function(){var a,b,d,h,c;if(!this.fullpath){d=this.getPackage();b=d.getBaseUri();c=this.getPath();if(d.isIgnorePackageNameInUri()&& (h=d.getName()))c=g.relative(h,c);b=b.resolve(c);(a=this.getTag())&&b.query.set("t",a);this.fullpath=l.getMappedPath(this.runtime,b.toString())}return this.fullpath},getPath:function(){var a;if(!(a=this.path)){a=this.name;var b="."+this.getType(),d="-min";a=g.join(g.dirname(a),g.basename(a,b));this.getPackage().isDebug()&&(d="");a=this.path=a+d+b}return a},getValue:function(){return this.value},getName:function(){return this.name},getPackage:function(){var b;if(!(b=this.packageInfo)){b=this.runtime; var f=this.name,d=b.config("packages"),h="",c;for(c in d)a.startsWith(f,c)&&c.length>h.length&&(h=c);b=this.packageInfo=d[h]||b.config("systemPackage")}return b},getTag:function(){return this.tag||this.getPackage().getTag()},getCharset:function(){return this.charset||this.getPackage().getCharset()},getRequiredMods:function(){var b=this.runtime;return a.map(this.getNormalizedRequires(),function(a){return l.createModuleInfo(b,a)})},getRequiresWithAlias:function(){var a=this.requiresWithAlias,b=this.requires; if(!b||0==b.length)return b||[];a||(this.requiresWithAlias=a=l.normalizeModNamesWithAlias(this.runtime,b,this.name));return a},getNormalizedRequires:function(){var a,b=this.normalizedRequiresStatus,d=this.status,h=this.requires;if(!h||0==h.length)return h||[];if((a=this.normalizedRequires)&&b==d)return a;this.normalizedRequiresStatus=d;return this.normalizedRequires=l.normalizeModNames(this.runtime,h,this.name)}});j.Module=k})(KISSY); (function(a){function b(){for(var l in j){var e=j[l],f=e.node,d,h=0;if(k.webkit)f.sheet&&(h=1);else if(f.sheet)try{f.sheet.cssRules&&(h=1)}catch(c){d=c.name,"NS_ERROR_DOM_SECURITY_ERR"==d&&(h=1)}h&&(e.callback&&e.callback.call(f),delete j[l])}g=a.isEmptyObject(j)?0:setTimeout(b,i)}var i=30,k=a.UA,g=0,j={};a.mix(a.Loader.Utils,{pollCss:function(a,e){var f;f=j[a.href]={};f.node=a;f.callback=e;g||b()}})})(KISSY); (function(a){var b=a.Env.host.document,i=a.Loader.Utils,k=a.Path,g={},j=536>a.UA.webkit;a.mix(a,{getScript:function(l,e,f){var d=e,h=0,c,m,n,p;a.startsWith(k.extname(l).toLowerCase(),".css")&&(h=1);a.isPlainObject(d)&&(e=d.success,c=d.error,m=d.timeout,f=d.charset,n=d.attrs);d=g[l]=g[l]||[];d.push([e,c]);if(1<d.length)return d.node;var e=i.docHead(),o=b.createElement(h?"link":"script");n&&a.each(n,function(a,b){o.setAttribute(b,a)});h?(o.href=l,o.rel="stylesheet"):(o.src=l,o.async=!0);d.node=o;f&& (o.charset=f);var q=function(b){var c;if(p){p.cancel();p=void 0}a.each(g[l],function(a){(c=a[b])&&c.call(o)});delete g[l]},f=!h;h&&(f=j?!1:"onload"in o);f?(o.onload=o.onreadystatechange=function(){var a=o.readyState;if(!a||a=="loaded"||a=="complete"){o.onreadystatechange=o.onload=null;q(0)}},o.onerror=function(){o.onerror=null;q(1)}):i.pollCss(o,function(){q(0)});m&&(p=a.later(function(){q(1)},1E3*m));h?e.appendChild(o):e.insertBefore(o,e.firstChild);return o}})})(KISSY); (function(a,b){function i(b){"/"!=b.charAt(b.length-1)&&(b+="/");l?b=l.resolve(b):(a.startsWith(b,"file:")||(b="file:"+b),b=new a.Uri(b));return b}var k=a.Loader,g=k.Utils,j=a.Env.host.location,l,e,f=a.Config.fns;if(!a.Env.nodejs&&j&&(e=j.href))l=new a.Uri(e);f.map=function(a){var b=this.Config;return!1===a?b.mappedRules=[]:b.mappedRules=(b.mappedRules||[]).concat(a||[])};f.mapCombo=function(a){var b=this.Config;return!1===a?b.mappedComboRules=[]:b.mappedComboRules=(b.mappedComboRules||[]).concat(a|| [])};f.packages=function(d){var h,c=this.Config,e=c.packages=c.packages||{};return d?(a.each(d,function(b,c){h=b.name||c;var d=i(b.base||b.path);b.name=h;b.base=d.toString();b.baseUri=d;b.runtime=a;delete b.path;e[h]=new k.Package(b)}),b):!1===d?(c.packages={},b):e};f.modules=function(b){var h=this,c=h.Env;b&&a.each(b,function(b,d){g.createModuleInfo(h,d,b);a.mix(c.mods[d],b)})};f.base=function(a){var h=this.Config;if(!a)return h.base;a=i(a);h.base=a.toString();h.baseUri=a;return b}})(KISSY); (function(a){var b=a.Loader,i=a.UA,k=b.Utils;a.augment(b,b.Target,{__currentMod:null,__startLoadTime:0,__startLoadModName:null,add:function(b,j,l){var e=this.runtime;if("string"==typeof b)k.registerModule(e,b,j,l);else if(a.isFunction(b))if(l=j,j=b,i.ie){var b=a.Env.host.document.getElementsByTagName("script"),f,d,h;for(d=b.length-1;0<=d;d--)if(h=b[d],"interactive"==h.readyState){f=h;break}b=f?f.getAttribute("data-mod-name"):this.__startLoadModName;k.registerModule(e,b,j,l);this.__startLoadModName= null;this.__startLoadTime=0}else this.__currentMod={fn:j,config:l}}})})(KISSY); (function(a,b){function i(b){a.mix(this,{fn:b,waitMods:{},requireLoadedMods:{}})}function k(a,b,d){var f,m=b.length;for(f=0;f<m;f++){var j=a,i=b[f],k=d,l=j.runtime,w=void 0,A=void 0,w=l.Env.mods,y=w[i];y||(e.createModuleInfo(l,i),y=w[i]);w=y.status;w!=n&&(w===c?k.loadModRequires(j,y):(A=k.isModWait(i),A||(k.addWaitMod(i),w<=h&&g(j,y,k))))}}function g(c,g,j){function i(){g.fn?(d[l]||(d[l]=1),j.loadModRequires(c,g),j.removeWaitMod(l),j.check()):g.status=m}var k=c.runtime,l=g.getName(),n=g.getCharset(), v=g.getFullPath(),x=0,w=f.ie,A="css"==g.getType();g.status=h;w&&!A&&(c.__startLoadModName=l,c.__startLoadTime=Number(+new Date));a.getScript(v,{attrs:w?{"data-mod-name":l}:b,success:function(){if(g.status==h)if(A)e.registerModule(k,l,a.noop);else if(x=c.__currentMod){e.registerModule(k,l,x.fn,x.config);c.__currentMod=null}a.later(i)},error:i,charset:n})}var j,l,e,f,d={},h,c,m,n;j=a.Loader;l=j.Status;e=j.Utils;f=a.UA;h=l.LOADING;c=l.LOADED;m=l.ERROR;n=l.ATTACHED;i.prototype={check:function(){var b= this.fn;b&&a.isEmptyObject(this.waitMods)&&(b(),this.fn=null)},addWaitMod:function(a){this.waitMods[a]=1},removeWaitMod:function(a){delete this.waitMods[a]},isModWait:function(a){return this.waitMods[a]},loadModRequires:function(a,b){var c=this.requireLoadedMods,d=b.name;c[d]||(c[d]=1,c=b.getNormalizedRequires(),k(a,c,this))}};a.augment(j,{use:function(a,b,c){var d,h=new i(function(){e.attachModsRecursively(d,f);b&&b.apply(f,e.getModules(f,a))}),f=this.runtime,a=e.getModNamesAsArray(a),a=e.normalizeModNamesWithAlias(f, a);d=e.unalias(f,a);k(this,d,h);c?h.check():setTimeout(function(){h.check()},0);return this}})})(KISSY); (function(a,b){function i(b,c,d){var h=b&&b.length;h?a.each(b,function(b){a.getScript(b,function(){--h||c()},d)}):c()}function k(b){a.mix(this,{runtime:b,queue:[],loading:0})}function g(a){if(a.queue.length){var b=a.queue.shift();l(a,b)}}function j(a,b){a.queue.push(b)}function l(b,c){function d(){w&&x&&(m.attachModsRecursively(g,B)?j.apply(null,m.getModules(B,h)):l(b,c))}var h=c.modNames,g=c.unaliasModNames,j=c.fn,k,u,v,x,w,A,y,B=b.runtime;b.loading=1;k=b.calculate(g);m.createModulesInfo(B,k);k= b.getComboUrls(k);u=k.css;A=0;for(y in u)A++;x=0;w=!A;for(y in u)i(u[y],function(){if(!--A){for(y in u)a.each(u[y].mods,function(b){m.registerModule(B,b.name,a.noop)});e(u);w=1;d()}},u[y].charset);v=k.js;f(v,function(a){(x=a)&&e(v);d()})}function e(b){if(a.Config.debug){var c=[],d,h=[];for(d in b)h.push.apply(h,b[d]),a.each(b[d].mods,function(a){c.push(a.name)})}}function f(d,h){var e,f,m=0;for(e in d)m++;if(m)for(e in f=1,d)(function(e){i(d[e],function(){a.each(d[e].mods,function(a){return!a.fn? (a.status=c.ERROR,f=0,!1):b});f&&!--m&&h(1)},d[e].charset)})(e);else h(1)}function d(b,c,h){var e=b.runtime,f,g;f=b.runtime.Env.mods[c];var j=h[c];if(j)return j;h[c]=j={};if(f&&!m.isAttached(e,c)){c=f.getNormalizedRequires();for(f=0;f<c.length;f++)g=c[f],!m.isLoaded(e,g)&&!m.isAttached(e,g)&&(j[g]=1),g=d(b,g,h),a.mix(j,g)}return j}var h=a.Loader,c=h.Status,m=h.Utils;a.augment(k,h.Target);a.augment(k,{clear:function(){this.loading=0},use:function(a,b,c){var d=this,h=d.runtime,a=m.getModNamesAsArray(a), a=m.normalizeModNamesWithAlias(h,a),e=m.unalias(h,a);m.isAttached(h,e)?b&&(c?b.apply(null,m.getModules(h,a)):setTimeout(function(){b.apply(null,m.getModules(h,a))},0)):(j(d,{modNames:a,unaliasModNames:e,fn:function(){setTimeout(function(){d.loading=0;g(d)},0);b&&b.apply(this,arguments)}}),d.loading||g(d))},add:function(a,b,c){m.registerModule(this.runtime,a,b,c)},calculate:function(b){var c={},h,e,f,g=this.runtime,j={};for(h=0;h<b.length;h++)e=b[h],m.isAttached(g,e)||(m.isLoaded(g,e)||(c[e]=1),a.mix(c, d(this,e,j)));b=[];for(f in c)b.push(f);return b},getComboUrls:function(b){var c=this,d,h=c.runtime,e=h.Config,f={};a.each(b,function(a){var a=c.runtime.Env.mods[a],b=a.getPackage(),d=a.getType(),h,e=b.getName();f[e]=f[e]||{};if(!(h=f[e][d]))h=f[e][d]=f[e][d]||[],h.packageInfo=b;h.push(a)});var g={js:{},css:{}},j,i,k,b=e.comboPrefix,l=e.comboSep,A=e.comboMaxFileNum,y=e.comboMaxUrlLength;for(i in f)for(k in f[i]){j=[];var B=f[i][k],D=B.packageInfo,C=(d=D.getTag())?"?t="+encodeURIComponent(d):"",I= C.length,z,F,K,J=D.getPrefixUriForCombo();g[k][i]=[];g[k][i].charset=D.getCharset();g[k][i].mods=[];z=J+b;K=z.length;var L=function(){g[k][i].push(m.getMappedPath(h,z+j.join(l)+C,e.mappedComboRules))};for(d=0;d<B.length;d++)if(F=B[d].getFullPath(),g[k][i].mods.push(B[d]),!D.isCombine()||!a.startsWith(F,J))g[k][i].push(F);else if(F=F.slice(J.length).replace(/\?.*$/,""),j.push(F),j.length>A||K+j.join(l).length+I>y)j.pop(),L(),j=[],d--;j.length&&L()}return g}});h.Combo=k})(KISSY); (function(a,b){function i(){var e=/^(.*)(seed|kissy)(?:-min)?\.js[^/]*/i,f=/(seed|kissy)(?:-min)?\.js/i,d,h,c=g.host.document.getElementsByTagName("script"),m=c[c.length-1],c=m.src,m=(m=m.getAttribute("data-config"))?(new Function("return "+m))():{};d=m.comboPrefix=m.comboPrefix||"??";h=m.comboSep=m.comboSep||",";var j,i=c.indexOf(d);-1==i?j=c.replace(e,"$1"):(j=c.substring(0,i),"/"!=j.charAt(j.length-1)&&(j+="/"),c=c.substring(i+d.length).split(h),a.each(c,function(a){return a.match(f)?(j+=a.replace(e, "$1"),!1):b}));return a.mix({base:j},m)}a.mix(a,{add:function(a,b,d){this.getLoader().add(a,b,d)},use:function(a,b){var d=this.getLoader();d.use.apply(d,arguments)},getLoader:function(){var a=this.Env;return this.Config.combine&&!a.nodejs?a._comboLoader:a._loader},require:function(a){return j.getModules(this,[a])[1]}});var k=a.Loader,g=a.Env,j=k.Utils,l=a.Loader.Combo;a.Env.nodejs?a.config({charset:"utf-8",base:__dirname.replace(/\\/g,"/").replace(/\/$/,"")+"/"}):a.config(a.mix({comboMaxUrlLength:2E3, comboMaxFileNum:40,charset:"utf-8",tag:"20130701201313"},i()));a.config("systemPackage",new k.Package({name:"",runtime:a}));g.mods={};g._loader=new k(a);l&&(g._comboLoader=new l(a))})(KISSY); (function(a,b){function i(){j&&o(k,n,i);f.resolve(a)}var k=a.Env.host,g=a.UA,j=k.document,l=j&&j.documentElement,e=k.location,f=new a.Defer,d=f.promise,h=/^#?([\w-]+)$/,c=/\S/,m=!(!j||!j.addEventListener),n="load",p=m?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)},o=m?function(a,b,c){a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent("on"+b,c)};a.mix(a,{isWindow:function(a){return null!=a&&a==a.window},parseXML:function(a){if(a.documentElement)return a; var c;try{k.DOMParser?c=(new DOMParser).parseFromString(a,"text/xml"):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a))}catch(d){c=b}!c||!c.documentElement||c.getElementsByTagName("parsererror");return c},globalEval:function(a){a&&c.test(a)&&(k.execScript||function(a){k.eval.call(k,a)})(a)},ready:function(a){d.then(a);return this},available:function(b,c){var b=(b+"").match(h)[1],d=1,e,f=a.later(function(){((e=j.getElementById(b))&&(c(e)||1)||500<++d)&&f.cancel()},40,!0)}});if(e&&-1!== (e.search||"").indexOf("ks-debug"))a.Config.debug=!0;(function(){if(!j||"complete"===j.readyState)i();else if(p(k,n,i),m){var a=function(){o(j,"DOMContentLoaded",a);i()};p(j,"DOMContentLoaded",a)}else{var b=function(){"complete"===j.readyState&&(o(j,"readystatechange",b),i())};p(j,"readystatechange",b);var c,d=l&&l.doScroll;try{c=null===k.frameElement}catch(h){c=!1}if(d&&c){var e=function(){try{d("left"),i()}catch(a){setTimeout(e,40)}};e()}}})();if(g.ie)try{j.execCommand("BackgroundImageCache",!1, !0)}catch(q){}})(KISSY,void 0);(function(a){var b=a.startsWith(location.href,"https")?"https://s.tbcdn.cn/s/kissy/":"http://a.tbcdn.cn/s/kissy/";a.config({packages:{gallery:{base:b},mobile:{base:b}},modules:{core:{alias:"dom,event,ajax,anim,base,node,json,ua,cookie".split(",")}}})})(KISSY); (function(a,b,i){a({ajax:{requires:["dom","json","event"]}});a({anim:{requires:["dom","event"]}});a({base:{requires:["event/custom"]}});a({button:{requires:["component/base","event"]}});a({calendar:{requires:["node","event"]}});a({color:{requires:["base"]}});a({combobox:{requires:["dom","component/base","node","menu","ajax"]}});a({"component/base":{requires:["rich-base","node","event"]}});a({"component/extension":{requires:["dom","node"]}});a({"component/plugin/drag":{requires:["rich-base","dd/base"]}}); a({"component/plugin/resize":{requires:["resizable"]}});a({datalazyload:{requires:["dom","event","base"]}});a({dd:{alias:["dd/base","dd/droppable"]}});a({"dd/base":{requires:["dom","node","event","rich-base","base"]}});a({"dd/droppable":{requires:["dd/base","dom","node","rich-base"]}});a({"dd/plugin/constrain":{requires:["base","node"]}});a({"dd/plugin/proxy":{requires:["node","base","dd/base"]}});a({"dd/plugin/scroll":{requires:["dd/base","base","node","dom"]}});a({dom:{alias:["dom/base",i.ie&&(9> i.ie||9>document.documentMode)?"dom/ie":""]}});a({"dom/ie":{requires:["dom/base"]}});a({editor:{requires:["htmlparser","component/base","core"]}});a({event:{alias:["event/base","event/dom","event/custom"]}});a({"event/custom":{requires:["event/base"]}});a({"event/dom":{alias:["event/dom/base",b.isTouchSupported()?"event/dom/touch":"",b.isDeviceMotionSupported()?"event/dom/shake":"",b.isHashChangeSupported()?"":"event/dom/hashchange",9>i.ie?"event/dom/ie":"",i.ie?"":"event/dom/focusin"]}});a({"event/dom/base":{requires:["dom", "event/base"]}});a({"event/dom/focusin":{requires:["event/dom/base"]}});a({"event/dom/hashchange":{requires:["event/dom/base","dom"]}});a({"event/dom/ie":{requires:["event/dom/base","dom"]}});a({"event/dom/shake":{requires:["event/dom/base"]}});a({"event/dom/touch":{requires:["event/dom/base","dom"]}});a({imagezoom:{requires:["node","overlay"]}});a({json:{requires:[KISSY.Features.isNativeJSONSupported()?"":"json/json2"]}});a({kison:{requires:["base"]}});a({menu:{requires:["component/extension","node", "component/base","event"]}});a({menubutton:{requires:["node","menu","button","component/base"]}});a({mvc:{requires:["event","base","ajax","json","node"]}});a({node:{requires:["dom","event/dom","anim"]}});a({overlay:{requires:["node","component/base","component/extension","event"]}});a({resizable:{requires:["node","rich-base","dd/base"]}});a({"rich-base":{requires:["base"]}});a({separator:{requires:["component/base"]}});a({"split-button":{requires:["component/base","button","menubutton"]}});a({stylesheet:{requires:["dom"]}}); a({swf:{requires:["dom","json","base"]}});a({switchable:{requires:["dom","event","anim",KISSY.Features.isTouchSupported()?"dd/base":""]}});a({tabs:{requires:["button","toolbar","component/base"]}});a({toolbar:{requires:["component/base","node"]}});a({tree:{requires:["node","component/base","event"]}});a({waterfall:{requires:["node","base"]}});a({xtemplate:{alias:["xtemplate/facade"]}});a({"xtemplate/compiler":{requires:["xtemplate/runtime"]}});a({"xtemplate/facade":{requires:["xtemplate/runtime", "xtemplate/compiler"]}})})(function(a){KISSY.config("modules",a)},KISSY.Features,KISSY.UA);(function(a){a.add("empty",a.noop);a.add("promise",function(){return a.Promise});a.add("ua",function(){return a.UA});a.add("uri",function(){return a.Uri});a.add("path",function(){return a.Path})})(KISSY); KISSY.add("dom/base/api",function(a){var b=a.Env.host,i=a.UA,k={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},g={isCustomDomain:function(a){var a=a||b,g=a.document.domain,a=a.location.hostname;return g!=a&&g!="["+a+"]"},getEmptyIframeSrc:function(a){a=a||b;return i.ie&&g.isCustomDomain(a)?"javascript:void(function(){"+ encodeURIComponent("document.open();document.domain='"+a.document.domain+"';document.close();")+"}())":""},NodeType:k,getWindow:function(a){return!a?b:"scrollTo"in a&&a.document?a:a.nodeType==k.DOCUMENT_NODE?a.defaultView||a.parentWindow:!1},_isNodeList:function(a){return a&&!a.nodeType&&a.item&&!a.setTimeout},nodeName:function(a){var b=g.get(a),a=b.nodeName.toLowerCase();i.ie&&(b=b.scopeName)&&"HTML"!=b&&(a=b.toLowerCase()+":"+a);return a},_RE_NUM_NO_PX:RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+ ")(?!px)[a-z%]+$","i")};a.mix(g,k);return g}); KISSY.add("dom/base/attr",function(a,b,i){function k(a,b){var b=q[b]||b,c=t[b];return c&&c.get?c.get(a,b):a[b]}var g=a.Env.host.document,j=b.NodeType,l=(g=g&&g.documentElement)&&g.textContent===i?"innerText":"textContent",e=b.nodeName,f=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,d=/^(?:button|input|object|select|textarea)$/i,h=/^a(?:rea)?$/i,c=/:|^on/,m=/\r/g,n={},p={val:1,css:1,html:1,text:1,data:1,width:1,height:1, offset:1,scrollTop:1,scrollLeft:1},o={tabindex:{get:function(a){var b=a.getAttributeNode("tabindex");return b&&b.specified?parseInt(b.value,10):d.test(a.nodeName)||h.test(a.nodeName)&&a.href?0:i}}},q={hidefocus:"hideFocus",tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},r={get:function(a, c){return b.prop(a,c)?c.toLowerCase():i},set:function(a,c,d){!1===c?b.removeAttr(a,d):(c=q[d]||d,c in a&&(a[c]=!0),a.setAttribute(d,d.toLowerCase()));return d}},t={},s={},u={select:{get:function(a){var c=a.selectedIndex,d=a.options,h;if(0>c)return null;if("select-one"===a.type)return b.val(d[c]);a=[];c=0;for(h=d.length;c<h;++c)d[c].selected&&a.push(b.val(d[c]));return a},set:function(c,d){var h=a.makeArray(d);a.each(c.options,function(c){c.selected=a.inArray(b.val(c),h)});h.length||(c.selectedIndex= -1);return h}}};a.each(["radio","checkbox"],function(c){u[c]={get:function(a){return null===a.getAttribute("value")?"on":a.value},set:function(c,d){if(a.isArray(d))return c.checked=a.inArray(b.val(c),d)}}});o.style={get:function(a){return a.style.cssText}};a.mix(b,{_valHooks:u,_propFix:q,_attrHooks:o,_propHooks:t,_attrNodeHook:s,_attrFix:n,prop:function(c,d,h){var e=b.query(c),f,m;if(a.isPlainObject(d))return a.each(d,function(a,c){b.prop(e,c,a)}),i;d=q[d]||d;m=t[d];if(h!==i)for(c=e.length-1;0<=c;c--)f= e[c],m&&m.set?m.set(f,h,d):f[d]=h;else if(e.length)return k(e[0],d);return i},hasProp:function(a,c){var d=b.query(a),h,e=d.length,f;for(h=0;h<e;h++)if(f=d[h],k(f,c)!==i)return!0;return!1},removeProp:function(a,c){var c=q[c]||c,d=b.query(a),h,e;for(h=d.length-1;0<=h;h--){e=d[h];try{e[c]=i,delete e[c]}catch(f){}}},attr:function(d,h,m,g){var k=b.query(d),l=k[0];if(a.isPlainObject(h)){var g=m,q;for(q in h)b.attr(k,q,h[q],g);return i}if(!(h=a.trim(h)))return i;if(g&&p[h])return b[h](d,m);h=h.toLowerCase(); if(g&&p[h])return b[h](d,m);h=n[h]||h;d=f.test(h)?r:c.test(h)?s:o[h];if(m===i){if(l&&l.nodeType===j.ELEMENT_NODE){"form"==e(l)&&(d=s);if(d&&d.get)return d.get(l,h);h=l.getAttribute(h);return null===h?i:h}}else for(g=k.length-1;0<=g;g--)if((l=k[g])&&l.nodeType===j.ELEMENT_NODE)"form"==e(l)&&(d=s),d&&d.set?d.set(l,m,h):l.setAttribute(h,""+m);return i},removeAttr:function(a,c){var c=c.toLowerCase(),c=n[c]||c,d=b.query(a),h,e,m;for(m=d.length-1;0<=m;m--)if(e=d[m],e.nodeType==j.ELEMENT_NODE&&(e.removeAttribute(c), f.test(c)&&(h=q[c]||c)in e))e[h]=!1},hasAttr:g&&!g.hasAttribute?function(a,c){var c=c.toLowerCase(),d=b.query(a),h,e;for(h=0;h<d.length;h++)if(e=d[h],(e=e.getAttributeNode(c))&&e.specified)return!0;return!1}:function(a,c){var d=b.query(a),h,e=d.length;for(h=0;h<e;h++)if(d[h].hasAttribute(c))return!0;return!1},val:function(c,d){var h,f,g,j,k;if(d===i){if(g=b.get(c)){if((h=u[e(g)]||u[g.type])&&"get"in h&&(f=h.get(g,"value"))!==i)return f;f=g.value;return"string"===typeof f?f.replace(m,""):null==f?"": f}return i}f=b.query(c);for(j=f.length-1;0<=j;j--){g=f[j];if(1!==g.nodeType)break;k=d;null==k?k="":"number"===typeof k?k+="":a.isArray(k)&&(k=a.map(k,function(a){return a==null?"":a+""}));h=u[e(g)]||u[g.type];if(!h||!("set"in h)||h.set(g,k,"value")===i)g.value=k}return i},text:function(a,c){var d,h,e;if(c===i){d=b.get(a);if(d.nodeType==j.ELEMENT_NODE)return d[l]||"";if(d.nodeType==j.TEXT_NODE)return d.nodeValue}else{h=b.query(a);for(e=h.length-1;0<=e;e--)d=h[e],d.nodeType==j.ELEMENT_NODE?d[l]=c:d.nodeType== j.TEXT_NODE&&(d.nodeValue=c)}return i}});return b},{requires:["./api"]});KISSY.add("dom/base",function(a,b){a.mix(a,{DOM:b,get:b.get,query:b.query});return b},{requires:"./base/api,./base/attr,./base/class,./base/create,./base/data,./base/insertion,./base/offset,./base/style,./base/selector,./base/traversal".split(",")}); KISSY.add("dom/base/class",function(a,b,i){function k(e,f,d,h){if(!(f=a.trim(f)))return h?!1:i;var e=b.query(e),c=e.length,m=f.split(j),f=[],k,l;for(l=0;l<m.length;l++)(k=a.trim(m[l]))&&f.push(k);for(l=0;l<c;l++)if(m=e[l],m.nodeType==g.ELEMENT_NODE&&(m=d(m,f,f.length),m!==i))return m;return h?!1:i}var g=b.NodeType,j=/[\.\s]\s*\.?/,l=/[\n\t]/g;a.mix(b,{hasClass:function(a,b){return k(a,b,function(a,b,c){var a=a.className,e,f;if(a){a=(" "+a+" ").replace(l," ");e=0;for(f=!0;e<c;e++)if(0>a.indexOf(" "+ b[e]+" ")){f=!1;break}if(f)return!0}},!0)},addClass:function(b,f){k(b,f,function(b,h,c){var e=b.className,g,i;if(e){g=(" "+e+" ").replace(l," ");for(i=0;i<c;i++)0>g.indexOf(" "+h[i]+" ")&&(e+=" "+h[i]);b.className=a.trim(e)}else b.className=f},i)},removeClass:function(b,f){k(b,f,function(b,h,c){var e=b.className,f,g;if(e)if(c){e=(" "+e+" ").replace(l," ");for(f=0;f<c;f++)for(g=" "+h[f]+" ";0<=e.indexOf(g);)e=e.replace(g," ");b.className=a.trim(e)}else b.className=""},i)},replaceClass:function(a,f, d){b.removeClass(a,f);b.addClass(a,d)},toggleClass:function(e,f,d){var h=a.isBoolean(d),c,g;k(e,f,function(a,e,i){for(g=0;g<i;g++)f=e[g],c=h?!d:b.hasClass(a,f),b[c?"removeClass":"addClass"](a,f)},i)}});return b},{requires:["./api"]}); KISSY.add("dom/base/create",function(a,b,i){function k(c){var d=a.require("event/dom");d&&d.detach(c);b.removeData(c)}function g(a,b){var d=b&&b!=f?b.createElement(c):m;d.innerHTML="m<div>"+a+"</div>";return d.lastChild}function j(a,b,c){var h=b.nodeType;if(h==d.DOCUMENT_FRAGMENT_NODE){b=b.childNodes;c=c.childNodes;for(h=0;b[h];)c[h]&&j(a,b[h],c[h]),h++}else if(h==d.ELEMENT_NODE){b=b.getElementsByTagName("*");c=c.getElementsByTagName("*");for(h=0;b[h];)c[h]&&a(b[h],c[h]),h++}}function l(c,h){var e= a.require("event/dom"),f,g;if(h.nodeType!=d.ELEMENT_NODE||b.hasData(c)){f=b.data(c);for(g in f)b.data(h,g,f[g]);e&&(e._DOMUtils.removeData(h),e._clone(c,h))}}function e(b){var c=null,d,h;if(b&&(b.push||b.item)&&b[0]){c=b[0].ownerDocument;c=c.createDocumentFragment();b=a.makeArray(b);d=0;for(h=b.length;d<h;d++)c.appendChild(b[d])}return c}var f=a.Env.host.document,d=b.NodeType,h=a.UA.ie,c="div",m=f&&f.createElement(c),n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,p=/<([\w:]+)/, o=/^\s+/,q=h&&9>h,r=/<|&#?\w+;/,t=f&&"outerHTML"in f.documentElement,s=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;a.mix(b,{create:function(h,m,j,k){var l=null;if(!h)return l;if(h.nodeType)return b.clone(h);if("string"!=typeof h)return l;k===i&&(k=!0);k&&(h=a.trim(h));var k=b._creators,t,u,j=j||f,w,v=c;if(r.test(h))if(w=s.exec(h))l=j.createElement(w[1]);else{h=h.replace(n,"<$1></$2>");if((w=p.exec(h))&&(t=w[1]))v=t.toLowerCase();t=(k[v]||g)(h,j);q&&(u=h.match(o))&&t.insertBefore(j.createTextNode(u[0]),t.firstChild); h=t.childNodes;1===h.length?l=h[0].parentNode.removeChild(h[0]):h.length&&(l=e(h))}else l=j.createTextNode(h);a.isPlainObject(m)&&(l.nodeType==d.ELEMENT_NODE?b.attr(l,m,!0):l.nodeType==d.DOCUMENT_FRAGMENT_NODE&&b.attr(l.childNodes,m,!0));return l},_fixCloneAttributes:null,_creators:{div:g},_defaultCreator:g,html:function(a,c,h,e){var a=b.query(a),f=a[0],g=!1,m,j;if(f){if(c===i)return f.nodeType==d.ELEMENT_NODE?f.innerHTML:null;c+="";if(!c.match(/<(?:script|style|link)/i)&&(!q||!c.match(o))&&!x[(c.match(p)|| ["",""])[1].toLowerCase()])try{for(m=a.length-1;0<=m;m--)j=a[m],j.nodeType==d.ELEMENT_NODE&&(k(j.getElementsByTagName("*")),j.innerHTML=c);g=!0}catch(l){}g||(c=b.create(c,0,f.ownerDocument,0),b.empty(a),b.append(c,a,h));e&&e()}},outerHTML:function(a,h,e){var g=b.query(a),j=g.length;if(a=g[0]){if(h===i){if(t)return a.outerHTML;h=(h=a.ownerDocument)&&h!=f?h.createElement(c):m;h.innerHTML="";h.appendChild(b.clone(a,!0));return h.innerHTML}h+="";if(!h.match(/<(?:script|style|link)/i)&&t)for(e=j-1;0<= e;e--)a=g[e],a.nodeType==d.ELEMENT_NODE&&(k(a),k(a.getElementsByTagName("*")),a.outerHTML=h);else a=b.create(h,0,a.ownerDocument,0),b.insertBefore(a,g,e),b.remove(g)}},remove:function(a,c){var h,e=b.query(a),f,g;for(g=e.length-1;0<=g;g--)h=e[g],!c&&h.nodeType==d.ELEMENT_NODE&&(f=h.getElementsByTagName("*"),k(f),k(h)),h.parentNode&&h.parentNode.removeChild(h)},clone:function(a,c,h,e){"object"===typeof c&&(e=c.deepWithDataAndEvent,h=c.withDataAndEvent,c=c.deep);var a=b.get(a),f,g=b._fixCloneAttributes, m;if(!a)return null;m=a.nodeType;f=a.cloneNode(c);if(m==d.ELEMENT_NODE||m==d.DOCUMENT_FRAGMENT_NODE)g&&m==d.ELEMENT_NODE&&g(a,f),c&&g&&j(g,a,f);h&&(l(a,f),c&&e&&j(l,a,f));return f},empty:function(a){var a=b.query(a),c,d;for(d=a.length-1;0<=d;d--)c=a[d],b.remove(c.childNodes)},_nodeListToFragment:e});var u=b._creators,v=b.create,x={option:"select",optgroup:"select",area:"map",thead:"table",td:"tr",th:"tr",tr:"tbody",tbody:"table",tfoot:"table",caption:"table",colgroup:"table",col:"colgroup",legend:"fieldset"}, w;for(w in x)(function(a){u[w]=function(b,c){return v("<"+a+">"+b+"</"+a+">",null,c)}})(x[w]);return b},{requires:["./api"]}); KISSY.add("dom/base/data",function(a,b,i){var k=a.Env.host,g="__ks_data_"+a.now(),j={},l={},e={applet:1,object:1,embed:1},f={hasData:function(b,d){if(b)if(d!==i){if(d in b)return!0}else if(!a.isEmptyObject(b))return!0;return!1}},d={hasData:function(a,b){return a==k?d.hasData(l,b):f.hasData(a[g],b)},data:function(a,b,h){if(a==k)return d.data(l,b,h);var e=a[g];if(h!==i)e=a[g]=a[g]||{},e[b]=h;else return b!==i?e&&e[b]:e=a[g]=a[g]||{}},removeData:function(b,h){if(b==k)return d.removeData(l,h);var e=b[g]; if(h!==i)delete e[h],a.isEmptyObject(e)&&d.removeData(b);else try{delete b[g]}catch(f){b[g]=i}}},h={hasData:function(a,b){var d=a[g];return!d?!1:f.hasData(j[d],b)},data:function(b,d,h){if(e[b.nodeName.toLowerCase()])return i;var f=b[g];if(!f){if(d!==i&&h===i)return i;f=b[g]=a.guid()}b=j[f];if(h!==i)b=j[f]=j[f]||{},b[d]=h;else return d!==i?b&&b[d]:b=j[f]=j[f]||{}},removeData:function(b,d){var e=b[g],f;if(e)if(f=j[e],d!==i)delete f[d],a.isEmptyObject(f)&&h.removeData(b);else{delete j[e];try{delete b[g]}catch(k){b[g]= i}b.removeAttribute&&b.removeAttribute(g)}}};a.mix(b,{__EXPANDO:g,hasData:function(a,e){for(var f=!1,g=b.query(a),j=0;j<g.length&&!(f=g[j],f=f.nodeType?h.hasData(f,e):d.hasData(f,e));j++);return f},data:function(c,e,f){var c=b.query(c),g=c[0];if(a.isPlainObject(e)){for(var j in e)b.data(c,j,e[j]);return i}if(f===i){if(g)return g.nodeType?h.data(g,e):d.data(g,e)}else for(j=c.length-1;0<=j;j--)g=c[j],g.nodeType?h.data(g,e,f):d.data(g,e,f);return i},removeData:function(a,e){var f=b.query(a),g,j;for(j= f.length-1;0<=j;j--)g=f[j],g.nodeType?h.removeData(g,e):d.removeData(g,e)}});return b},{requires:["./api"]}); KISSY.add("dom/base/insertion",function(a,b){function i(a,b){var g=[],k,o,q;for(k=0;a[k];k++)if(o=a[k],q=e(o),o.nodeType==j.DOCUMENT_FRAGMENT_NODE)g.push.apply(g,i(f(o.childNodes),b));else if("script"===q&&(!o.type||h.test(o.type)))o.parentNode&&o.parentNode.removeChild(o),b&&b.push(o);else{if(o.nodeType==j.ELEMENT_NODE&&!l.test(q)){q=[];var r,t,s=o.getElementsByTagName("script");for(t=0;t<s.length;t++)r=s[t],(!r.type||h.test(r.type))&&q.push(r);d.apply(a,[k+1,0].concat(q))}g.push(o)}return g}function k(b){b.src? a.getScript(b.src):(b=a.trim(b.text||b.textContent||b.innerHTML||""))&&a.globalEval(b)}function g(c,d,h,e){c=b.query(c);e&&(e=[]);c=i(c,e);b._fixInsertionChecked&&b._fixInsertionChecked(c);var d=b.query(d),f,g,j,l,s=d.length;if((c.length||e&&e.length)&&s){c=b._nodeListToFragment(c);1<s&&(l=b.clone(c,!0),d=a.makeArray(d));for(f=0;f<s;f++)g=d[f],c&&(j=0<f?b.clone(l,!0):c,h(j,g)),e&&e.length&&a.each(e,k)}}var j=b.NodeType,l=/^(?:button|input|object|select|textarea)$/i,e=b.nodeName,f=a.makeArray,d=[].splice, h=/\/(java|ecma)script/i;a.mix(b,{_fixInsertionChecked:null,insertBefore:function(a,b,d){g(a,b,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)},d)},insertAfter:function(a,b,d){g(a,b,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)},d)},appendTo:function(a,b,d){g(a,b,function(a,b){b.appendChild(a)},d)},prependTo:function(a,b,d){g(a,b,function(a,b){b.insertBefore(a,b.firstChild)},d)},wrapAll:function(a,d){d=b.clone(b.get(d),!0);a=b.query(a);a[0].parentNode&&b.insertBefore(d, a[0]);for(var h;(h=d.firstChild)&&1==h.nodeType;)d=h;b.appendTo(a,d)},wrap:function(c,d){c=b.query(c);d=b.get(d);a.each(c,function(a){b.wrapAll(a,d)})},wrapInner:function(c,d){c=b.query(c);d=b.get(d);a.each(c,function(a){var c=a.childNodes;c.length?b.wrapAll(c,d):a.appendChild(d)})},unwrap:function(c){c=b.query(c);a.each(c,function(a){a=a.parentNode;b.replaceWith(a,a.childNodes)})},replaceWith:function(a,d){var h=b.query(a),d=b.query(d);b.remove(d,!0);b.insertBefore(d,h);b.remove(h)}});a.each({prepend:"prependTo", append:"appendTo",before:"insertBefore",after:"insertAfter"},function(a,d){b[d]=b[a]});return b},{requires:["./api"]}); KISSY.add("dom/base/offset",function(a,b,i){function k(a){var b,c=a.ownerDocument.body;if(!a.getBoundingClientRect)return{left:0,top:0};b=a.getBoundingClientRect();a=b[n];b=b[p];a-=f.clientLeft||c.clientLeft||0;b-=f.clientTop||c.clientTop||0;return{left:a,top:b}}function g(a,c){var h={left:0,top:0},e=d(a[m]),f,g=a,c=c||e;do{if(e==c){var j=g;f=k(j);j=d(j[m]);f.left+=b[q](j);f.top+=b[r](j)}else f=k(g);h.left+=f.left;h.top+=f.top}while(e&&e!=c&&(g=e.frameElement)&&(e=e.parent));return h}var j=a.Env.host, l=j.document,e=b.NodeType,f=l&&l.documentElement,d=b.getWindow,h=Math.max,c=parseFloat,m="ownerDocument",n="left",p="top",o=a.isNumber,q="scrollLeft",r="scrollTop";a.mix(b,{offset:function(a,d,h){if(d===i){var a=b.get(a),e;a&&(e=g(a,h));return e}h=b.query(a);for(e=h.length-1;0<=e;e--){var a=h[e],f=d;"static"===b.css(a,"position")&&(a.style.position="relative");var j=g(a),k={},m=void 0,l=void 0;for(l in f)m=c(b.css(a,l))||0,k[l]=c(m+f[l]-j[l]);b.css(a,k)}return i},scrollIntoView:function(h,f,g,j){var k, m,l,o;if(l=b.get(h)){f&&(f=b.get(f));f||(f=l.ownerDocument);f.nodeType==e.DOCUMENT_NODE&&(f=d(f));a.isPlainObject(g)&&(j=g.allowHorizontalScroll,o=g.onlyScrollIfNeeded,g=g.alignWithTop);j=j===i?!0:j;m=!!d(f);var h=b.offset(l),q=b.outerHeight(l);k=b.outerWidth(l);var r,C,I,z;m?(m=f,r=b.height(m),C=b.width(m),z={left:b.scrollLeft(m),top:b.scrollTop(m)},m=h[n]-z[n],l=h[p]-z[p],k=h[n]+k-(z[n]+C),h=h[p]+q-(z[p]+r)):(r=b.offset(f),C=f.clientHeight,I=f.clientWidth,z={left:b.scrollLeft(f),top:b.scrollTop(f)}, m=h[n]-(r[n]+(c(b.css(f,"borderLeftWidth"))||0)),l=h[p]-(r[p]+(c(b.css(f,"borderTopWidth"))||0)),k=h[n]+k-(r[n]+I+(c(b.css(f,"borderRightWidth"))||0)),h=h[p]+q-(r[p]+C+(c(b.css(f,"borderBottomWidth"))||0)));if(o){if(0>l||0<h)!0===g?b.scrollTop(f,z.top+l):!1===g?b.scrollTop(f,z.top+h):0>l?b.scrollTop(f,z.top+l):b.scrollTop(f,z.top+h)}else(g=g===i?!0:!!g)?b.scrollTop(f,z.top+l):b.scrollTop(f,z.top+h);if(j)if(o){if(0>m||0<k)!0===g?b.scrollLeft(f,z.left+m):!1===g?b.scrollLeft(f,z.left+k):0>m?b.scrollLeft(f, z.left+m):b.scrollLeft(f,z.left+k)}else(g=g===i?!0:!!g)?b.scrollLeft(f,z.left+m):b.scrollLeft(f,z.left+k)}},docWidth:0,docHeight:0,viewportHeight:0,viewportWidth:0,scrollTop:0,scrollLeft:0});a.each(["Left","Top"],function(a,c){var h="scroll"+a;b[h]=function(f,g){if(o(f))return arguments.callee(j,f);var f=b.get(f),m,k,l,n=d(f);n?g!==i?(g=parseFloat(g),k="Left"==a?g:b.scrollLeft(n),l="Top"==a?g:b.scrollTop(n),n.scrollTo(k,l)):(m=n["page"+(c?"Y":"X")+"Offset"],o(m)||(k=n.document,m=k.documentElement[h], o(m)||(m=k.body[h]))):f.nodeType==e.ELEMENT_NODE&&(g!==i?f[h]=parseFloat(g):m=f[h]);return m}});a.each(["Width","Height"],function(a){b["doc"+a]=function(c){c=b.get(c);c=d(c).document;return h(c.documentElement["scroll"+a],c.body["scroll"+a],b["viewport"+a](c))};b["viewport"+a]=function(c){var c=b.get(c),h="client"+a,c=d(c).document,e=c.body,f=c.documentElement[h];return"CSS1Compat"===c.compatMode&&f||e&&e[h]||f}});return b},{requires:["./api"]}); KISSY.add("dom/base/selector",function(a,b,i){function k(a){var b,c;for(c=0;c<this.length&&!(b=this[c],!1===a(b,c));c++);}function g(d,h){var e,f,m="string"==typeof d,o=h===i&&(f=1)?[c]:g(h);d?m?(d=v(d),f&&"body"==d?e=[c.body]:1==o.length&&d&&(e=l(d,o[0]))):f&&(e=d.nodeType||d.setTimeout?[d]:d.getDOMNodes?d.getDOMNodes():p(d)?d:q(d)?a.makeArray(d):[d]):e=[];if(!e&&(e=[],d)){for(f=0;f<o.length;f++)t.apply(e,j(d,o[f]));1<e.length&&(1<o.length||m&&-1<d.indexOf(u))&&b.unique(e)}e.each=k;return e}function j(b, c){var d="string"==typeof b;if(d&&b.match(w)||!d)d=e(b,c);else if(d&&-1<b.replace(/"(?:(?:\\.)|[^"])*"/g,"").replace(/'(?:(?:\\.)|[^'])*'/g,"").indexOf(u)){var d=[],h,f=b.split(/\s*,\s*/);for(h=0;h<f.length;h++)t.apply(d,j(f[h],c))}else d=[],(h=a.require("sizzle"))&&h(b,c,d);return d}function l(a,c){var h,e,g,j;if(x.test(a))h=(e=f(a.slice(1),c))?[e]:[];else if(g=w.exec(a)){e=g[1];j=g[2];g=g[3];if(c=e?f(e,c):c)g?!e||-1!=a.indexOf(s)?h=[].concat(b._getElementsByClassName(g,j,c)):(e=f(e,c),d(e,g)&&(h= [e])):j&&(h=o(b._getElementsByTagName(j,c)));h=h||[]}return h}function e(a,d){var h;"string"==typeof a?h=l(a,d)||[]:p(a)||q(a)?h=n(a,function(a){return!a?!1:d==c?!0:b._contains(d,a)}):(!a?0:d==c||b._contains(d,a))&&(h=[a]);return h}function f(a,c){var d=c.nodeType==m.DOCUMENT_NODE;return b._getElementById(a,c,d?c:c.ownerDocument,d)}function d(a,b){var c=a&&a.className;return c&&-1<(s+c+s).indexOf(s+b+s)}function h(a,b){var c=a&&a.getAttributeNode(b);return c&&c.nodeValue}var c=a.Env.host.document, m=b.NodeType,n=a.filter,p=a.isArray,o=a.makeArray,q=b._isNodeList,r=b.nodeName,t=Array.prototype.push,s=" ",u=",",v=a.trim,x=/^#[\w-]+$/,w=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;a.mix(b,{_getAttr:h,_hasSingleClass:d,_getElementById:function(a,c,d,h){var e=d.getElementById(a),f=b._getAttr(e,"id");return!e&&!h&&!b._contains(d,c)||e&&f!=a?b.filter("*","#"+a,c)[0]||null:h||e&&b._contains(c,e)?e:null},_getElementsByTagName:function(a,b){return b.getElementsByTagName(a)},_getElementsByClassName:function(a, b,c){return o(c.querySelectorAll((b||"")+"."+a))},_compareNodeOrder:function(a,b){return!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1},query:g,get:function(a,b){return g(a,b)[0]||null},unique:function(){function a(d,h){return d==h?(c=!0,0):b._compareNodeOrder(d,h)}var c,d=!0;[0,0].sort(function(){d=!1;return 0});return function(b){c=d;b.sort(a);if(c)for(var h=1,e=b.length;h<e;)b[h]===b[h-1]?b.splice(h,1):h++;return b}}(), filter:function(b,c,e){var b=g(b,e),e=a.require("sizzle"),f,j,i,m,k=[];if("string"==typeof c&&(c=v(c))&&(f=w.exec(c)))i=f[1],j=f[2],m=f[3],i?i&&!j&&!m&&(c=function(a){return h(a,"id")==i}):c=function(a){var b=!0,c=!0;j&&(b=r(a)==j.toLowerCase());m&&(c=d(a,m));return c&&b};a.isFunction(c)?k=a.filter(b,c):c&&e&&(k=e.matches(c,b));return k},test:function(a,c,d){a=g(a,d);return a.length&&b.filter(a,c,d).length===a.length}});return b},{requires:["./api"]}); KISSY.add("dom/base/style",function(a,b,i){function k(a){return a.replace(t,"ms-").replace(s,u)}function g(a,b,c){var d={},h;for(h in b)d[h]=a[m][h],a[m][h]=b[h];c.call(a);for(h in b)a[m][h]=d[h]}function j(a,b,c){var d,h,e;if(3===a.nodeType||8===a.nodeType||!(d=a[m]))return i;b=k(b);e=A[b];b=y[b]||b;if(c!==i){null===c||c===x?c=x:!isNaN(Number(c))&&!r[b]&&(c+=w);e&&e.set&&(c=e.set(a,c));if(c!==i){try{d[b]=c}catch(f){}c===x&&d.removeAttribute&&d.removeAttribute(b)}d.cssText||a.removeAttribute("style"); return i}if(!e||!("get"in e&&(h=e.get(a,!1))!==i))h=d[b];return h===i?"":h}function l(a){var b,c=arguments;0!==a.offsetWidth?b=e.apply(i,c):g(a,D,function(){b=e.apply(i,c)});return b}function e(c,d,h){if(a.isWindow(c))return d==p?b.viewportWidth(c):b.viewportHeight(c);if(9==c.nodeType)return d==p?b.docWidth(c):b.docHeight(c);var e=d===p?["Left","Right"]:["Top","Bottom"],f=d===p?c.offsetWidth:c.offsetHeight;if(0<f)return"border"!==h&&a.each(e,function(a){h||(f-=parseFloat(b.css(c,"padding"+a))||0); f="margin"===h?f+(parseFloat(b.css(c,h+a))||0):f-(parseFloat(b.css(c,"border"+a+"Width"))||0)}),f;f=b._getComputedStyle(c,d);if(null==f||0>Number(f))f=c.style[d]||0;f=parseFloat(f)||0;h&&a.each(e,function(a){f+=parseFloat(b.css(c,"padding"+a))||0;"padding"!==h&&(f+=parseFloat(b.css(c,"border"+a+"Width"))||0);"margin"===h&&(f+=parseFloat(b.css(c,h+a))||0)});return f}var f=a.Env.host,d=a.UA,h=b.nodeName,c=f.document,m="style",n=/^margin/,p="width",o="display"+a.now(),q=parseInt,r={fillOpacity:1,fontWeight:1, lineHeight:1,opacity:1,orphans:1,widows:1,zIndex:1,zoom:1},t=/^-ms-/,s=/-([a-z])/ig,u=function(a,b){return b.toUpperCase()},v=/([A-Z]|^ms)/g,x="",w="px",A={},y={},B={};y["float"]="cssFloat";a.mix(b,{_camelCase:k,_CUSTOM_STYLES:A,_cssProps:y,_getComputedStyle:function(a,c){var d="",h,e,f,g,j;e=a.ownerDocument;c=c.replace(v,"-$1").toLowerCase();if(h=e.defaultView.getComputedStyle(a,null))d=h.getPropertyValue(c)||h[c];""===d&&!b.contains(e,a)&&(c=y[c]||c,d=a[m][c]);b._RE_NUM_NO_PX.test(d)&&n.test(c)&& (j=a.style,e=j.width,f=j.minWidth,g=j.maxWidth,j.minWidth=j.maxWidth=j.width=d,d=h.width,j.width=e,j.minWidth=f,j.maxWidth=g);return d},style:function(c,d,h){var c=b.query(c),e,f=c[0];if(a.isPlainObject(d)){for(e in d)for(f=c.length-1;0<=f;f--)j(c[f],e,d[e]);return i}if(h===i)return e="",f&&(e=j(f,d,h)),e;for(f=c.length-1;0<=f;f--)j(c[f],d,h);return i},css:function(c,d,h){var c=b.query(c),e=c[0],f;if(a.isPlainObject(d)){for(f in d)for(e=c.length-1;0<=e;e--)j(c[e],f,d[f]);return i}d=k(d);f=A[d];if(h=== i){h="";if(e&&(!f||!("get"in f&&(h=f.get(e,!0))!==i)))h=b._getComputedStyle(e,d);return h===i?"":h}for(e=c.length-1;0<=e;e--)j(c[e],d,h);return i},show:function(a){var a=b.query(a),d,h,e;for(e=a.length-1;0<=e;e--)if(h=a[e],h[m].display=b.data(h,o)||x,"none"===b.css(h,"display")){d=h.tagName.toLowerCase();var f=void 0,g=B[d],j=void 0;B[d]||(f=c.body||c.documentElement,j=c.createElement(d),b.prepend(j,f),g=b.css(j,"display"),f.removeChild(j),B[d]=g);d=g;b.data(h,o,d);h[m].display=d}},hide:function(a){var a= b.query(a),c,d;for(d=a.length-1;0<=d;d--){c=a[d];var h=c[m],e=h.display;"none"!==e&&(e&&b.data(c,o,e),h.display="none")}},toggle:function(a){var a=b.query(a),c,d;for(d=a.length-1;0<=d;d--)c=a[d],"none"===b.css(c,"display")?b.show(c):b.hide(c)},addStyleSheet:function(a,c,d){a=a||f;"string"==typeof a&&(d=c,c=a,a=f);var a=b.get(a),a=b.getWindow(a).document,h;if(d&&(d=d.replace("#",x)))h=b.get("#"+d,a);h||(h=b.create("<style>",{id:d},a),b.get("head",a).appendChild(h),h.styleSheet?h.styleSheet.cssText= c:h.appendChild(a.createTextNode(c)))},unselectable:function(c){var c=b.query(c),e,f,g=0,j,i;for(f=c.length-1;0<=f;f--)if(e=c[f],d.gecko)e[m].MozUserSelect="none";else if(d.webkit)e[m].KhtmlUserSelect="none";else if(d.ie||d.opera){i=e.getElementsByTagName("*");e.setAttribute("unselectable","on");for(j=["iframe","textarea","input","select"];e=i[g++];)a.inArray(h(e),j)||e.setAttribute("unselectable","on")}},innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,width:0,height:0});a.each([p,"height"], function(c){b["inner"+a.ucfirst(c)]=function(a){return(a=b.get(a))&&l(a,c,"padding")};b["outer"+a.ucfirst(c)]=function(a,d){var h=b.get(a);return h&&l(h,c,d?"margin":"border")};b[c]=function(a,d){var h=b.css(a,c,d);h&&(h=parseFloat(h));return h}});var D={position:"absolute",visibility:"hidden",display:"block"};a.each(["height","width"],function(a){A[a]={get:function(b,c){return c?l(b,a)+"px":i}}});a.each(["left","top"],function(h){A[h]={get:function(e,f){var g;if(f&&(g=b._getComputedStyle(e,h),"auto"=== g)){g=0;if(a.inArray(b.css(e,"position"),["absolute","fixed"])){g=e["left"===h?"offsetLeft":"offsetTop"];if(d.ie&&9>(c.documentMode||0)||d.opera)g-=e.offsetParent&&e.offsetParent["client"+("left"==h?"Left":"Top")]||0;g-=q(b.css(e,"margin-"+h))||0}g+="px"}return g}}});return b},{requires:["./api"]}); KISSY.add("dom/base/traversal",function(a,b,i){function k(e,f,d,h,c,j,k){if(!(e=b.get(e)))return null;if(0===f)return e;j||(e=e[d]);if(!e)return null;c=c&&b.get(c)||null;f===i&&(f=1);var j=[],p=a.isArray(f),o,q;a.isNumber(f)&&(o=0,q=f,f=function(){return++o===q});for(;e&&e!=c;){if((e.nodeType==l.ELEMENT_NODE||e.nodeType==l.TEXT_NODE&&k)&&g(e,f)&&(!h||h(e)))if(j.push(e),!p)break;e=e[d]}return p?j:j[0]||null}function g(e,f){if(!f)return!0;if(a.isArray(f)){var d,h=f.length;if(!h)return!0;for(d=0;d<h;d++)if(b.test(e, f[d]))return!0}else if(b.test(e,f))return!0;return!1}function j(e,f,d,h){var c=[],g,j;if((g=e=b.get(e))&&d)g=e.parentNode;if(g){d=a.makeArray(g.childNodes);for(g=0;g<d.length;g++)j=d[g],(h||j.nodeType==l.ELEMENT_NODE)&&j!=e&&c.push(j);f&&(c=b.filter(c,f))}return c}var l=b.NodeType;a.mix(b,{_contains:function(a,b){return!!(a.compareDocumentPosition(b)&16)},closest:function(a,b,d,h){return k(a,b,"parentNode",function(a){return a.nodeType!=l.DOCUMENT_FRAGMENT_NODE},d,!0,h)},parent:function(a,b,d){return k(a, b,"parentNode",function(a){return a.nodeType!=l.DOCUMENT_FRAGMENT_NODE},d,i)},first:function(a,f,d){a=b.get(a);return k(a&&a.firstChild,f,"nextSibling",i,i,!0,d)},last:function(a,f,d){a=b.get(a);return k(a&&a.lastChild,f,"previousSibling",i,i,!0,d)},next:function(a,b,d){return k(a,b,"nextSibling",i,i,i,d)},prev:function(a,b,d){return k(a,b,"previousSibling",i,i,i,d)},siblings:function(a,b,d){return j(a,b,!0,d)},children:function(a,b){return j(a,b,i)},contents:function(a,b){return j(a,b,i,1)},contains:function(a, f){a=b.get(a);f=b.get(f);return a&&f?b._contains(a,f):!1},index:function(e,f){var d=b.query(e),h,c=0;h=d[0];if(!f){d=h&&h.parentNode;if(!d)return-1;for(;h=h.previousSibling;)h.nodeType==l.ELEMENT_NODE&&c++;return c}c=b.query(f);return"string"===typeof f?a.indexOf(h,c):a.indexOf(c[0],d)},equals:function(a,f){a=b.query(a);f=b.query(f);if(a.length!=f.length)return!1;for(var d=a.length;0<=d;d--)if(a[d]!=f[d])return!1;return!0}});return b},{requires:["./api"]}); KISSY.add("dom/ie/attr",function(a,b){var i=b._attrHooks,k=b._attrNodeHook,g=b.NodeType,j=b._valHooks,l=b._propFix;if(8>(document.documentMode||a.UA.ie))i.style.set=function(a,b){a.style.cssText=b},a.mix(k,{get:function(a,b){var d=a.getAttributeNode(b);return d&&(d.specified||d.nodeValue)?d.nodeValue:void 0},set:function(a,b,d){var h=a.getAttributeNode(d),c;if(h)h.nodeValue=b;else try{c=a.ownerDocument.createAttribute(d),c.value=b,a.setAttributeNode(c)}catch(g){return a.setAttribute(d,b,0)}}}),a.mix(b._attrFix, l),i.tabIndex=i.tabindex,a.each("href,src,width,height,colSpan,rowSpan".split(","),function(a){i[a]={get:function(b){b=b.getAttribute(a,2);return b===null?void 0:b}}}),j.button=i.value=k,j.option={get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}};(i.href=i.href||{}).set=function(a,b,d){for(var h=a.childNodes,c,j=h.length,i=0<j,j=j-1;0<=j;j--)h[j].nodeType!=g.TEXT_NODE&&(i=0);i&&(c=a.ownerDocument.createElement("b"),c.style.display="none",a.appendChild(c));a.setAttribute(d, ""+b);c&&a.removeChild(c)};return b},{requires:["dom/base"]}); KISSY.add("dom/ie/create",function(a,b){var i=document.documentMode||a.UA.ie;b._fixCloneAttributes=function(a,e){e.clearAttributes&&e.clearAttributes();e.mergeAttributes&&e.mergeAttributes(a);var f=e.nodeName.toLowerCase(),d=a.childNodes;if("object"===f&&!e.childNodes.length)for(f=0;f<d.length;f++)e.appendChild(d[f].cloneNode(!0));else if("input"===f&&("checkbox"===a.type||"radio"===a.type)){if(a.checked&&(e.defaultChecked=e.checked=a.checked),e.value!==a.value)e.value=a.value}else if("option"=== f)e.selected=a.defaultSelected;else if("input"===f||"textarea"===f)e.defaultValue=a.defaultValue;e.removeAttribute(b.__EXPANDO)};var k=b._creators,g=b._defaultCreator,j=/<tbody/i;8>i&&(k.table=function(i,e){var f=g(i,e);if(j.test(i))return f;var d=f.firstChild,h=a.makeArray(d.childNodes);a.each(h,function(a){"tbody"==b.nodeName(a)&&!a.childNodes.length&&d.removeChild(a)});return f})},{requires:["dom/base"]});KISSY.add("dom/ie",function(a,b){return b},{requires:"./ie/attr,./ie/create,./ie/insertion,./ie/selector,./ie/style,./ie/traversal,./ie/input-selection".split(",")}); KISSY.add("dom/ie/input-selection",function(a,b){function i(a,b){var d=0,h=0,c=a.ownerDocument.selection.createRange(),g=k(a);g.inRange(c)&&(g.setEndPoint("EndToStart",c),d=j(a,g).length,b&&(h=d+j(a,c).length));return[d,h]}function k(a){if("textarea"==a.type){var b=a.document.body.createTextRange();b.moveToElementText(a);return b}return a.createTextRange()}function g(a,b,d){var h=Math.min(b,d),c=Math.max(b,d);return h==c?0:"textarea"==a.type?(a=a.value.substring(h,c).replace(/\r\n/g,"\n").length, b>d&&(a=-a),a):d-b}function j(a,b){if("textarea"==a.type){var d=b.text,h=b.duplicate();if(0==h.compareEndPoints("StartToEnd",h))return d;h.moveEnd("character",-1);h.text==d&&(d+="\r\n");return d}return b.text}var l=b._propHooks;l.selectionStart={set:function(a,b){var d=a.ownerDocument.selection.createRange();if(k(a).inRange(d)){var h=i(a,1)[1],c=g(a,b,h);d.collapse(!1);d.moveStart("character",-c);b>h&&d.collapse(!0);d.select()}},get:function(a){return i(a)[0]}};l.selectionEnd={set:function(a,b){var d= a.ownerDocument.selection.createRange();if(k(a).inRange(d)){var h=i(a)[0],c=g(a,h,b);d.collapse(!0);d.moveEnd("character",c);h>b&&d.collapse(!1);d.select()}},get:function(a){return i(a,1)[1]}}},{requires:["dom/base"]}); KISSY.add("dom/ie/insertion",function(a,b){if(8>(document.documentMode||a.UA.ie))b._fixInsertionChecked=function k(a){for(var j=0;j<a.length;j++){var l=a[j];if(l.nodeType==b.NodeType.DOCUMENT_FRAGMENT_NODE)k(l.childNodes);else if("input"==b.nodeName(l)){if("checkbox"===l.type||"radio"===l.type)l.defaultChecked=l.checked}else if(l.nodeType==b.NodeType.ELEMENT_NODE)for(var l=l.getElementsByTagName("input"),e=0;e<l.length;e++)k(l[e])}}},{requires:["dom/base"]}); KISSY.add("dom/ie/selector",function(a,b){var i=a.Env.host.document;b._compareNodeOrder=function(a,b){return a.sourceIndex-b.sourceIndex};i.querySelectorAll||(b._getElementsByClassName=function(a,g,j){if(!j)return[];for(var g=j.getElementsByTagName(g||"*"),j=[],i=0,e=0,f=g.length,d;i<f;++i)d=g[i],b._hasSingleClass(d,a)&&(j[e++]=d);return j});b._getElementsByTagName=function(b,g){var j=a.makeArray(g.getElementsByTagName(b)),i,e,f,d;if(b==="*"){i=[];for(f=e=0;d=j[e++];)d.nodeType===1&&(i[f++]=d);j= i}return j}},{requires:["dom/base"]}); KISSY.add("dom/ie/style",function(a,b){var i=b._cssProps,k=document.documentMode||a.UA.ie,g=a.Env.host.document,g=g&&g.documentElement,j=/^(top|right|bottom|left)$/,l=b._CUSTOM_STYLES,e=/opacity\s*=\s*([^)]*)/,f=/alpha\([^)]*\)/i;i["float"]="styleFloat";l.backgroundPosition={get:function(a,b){return b?a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY:a.style.backgroundPosition}};try{null==g.style.opacity&&(l.opacity={get:function(a,b){return e.test((b&&a.currentStyle?a.currentStyle.filter: a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(b,d){var d=parseFloat(d),h=b.style,e=b.currentStyle,g=isNaN(d)?"":"alpha(opacity="+100*d+")",j=a.trim(e&&e.filter||h.filter||"");h.zoom=1;if((1<=d||!g)&&!a.trim(j.replace(f,"")))if(h.removeAttribute("filter"),!g||e&&!e.filter)return;h.filter=f.test(j)?j.replace(f,g):j+(j?", ":"")+g}})}catch(d){}var k=8==k,h={};h.thin=k?"1px":"2px";h.medium=k?"3px":"4px";h.thick=k?"5px":"6px";a.each(["","Top","Left","Right","Bottom"],function(a){var b= "border"+a+"Width",d="border"+a+"Style";l[b]={get:function(a,c){var f=c?a.currentStyle:0,e=f&&""+f[b]||void 0;e&&0>e.indexOf("px")&&(e=h[e]&&"none"!==f[d]?h[e]:0);return e}}});b._getComputedStyle=function(a,d){var d=i[d]||d,h=a.currentStyle&&a.currentStyle[d];if(b._RE_NUM_NO_PX.test(h)&&!j.test(d)){var e=a.style,f=e.left,g=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left="fontSize"===d?"1em":h||0;h=e.pixelLeft+"px";e.left=f;a.runtimeStyle.left=g}return""===h?"auto":h}},{requires:["dom/base"]}); KISSY.add("dom/ie/traversal",function(a,b){b._contains=function(a,k){a.nodeType==b.NodeType.DOCUMENT_NODE&&(a=a.documentElement);k=k.parentNode;return a==k?!0:k&&k.nodeType==b.NodeType.ELEMENT_NODE?a.contains&&a.contains(k):!1}},{requires:["dom/base"]});KISSY.add("event/base",function(a,b,i,k,g){return a.Event={_Utils:b,_Object:i,_Observer:k,_ObservableEvent:g}},{requires:["./base/utils","./base/object","./base/observer","./base/observable"]}); KISSY.add("event/base/object",function(a){function b(){this.timeStamp=a.now()}var i=function(){return!1},k=function(){return!0};b.prototype={constructor:b,isDefaultPrevented:i,isPropagationStopped:i,isImmediatePropagationStopped:i,preventDefault:function(){this.isDefaultPrevented=k},stopPropagation:function(){this.isPropagationStopped=k},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()},halt:function(a){a?this.stopImmediatePropagation():this.stopPropagation(); this.preventDefault()}};return b}); KISSY.add("event/base/observable",function(a){function b(b){a.mix(this,b);this.reset()}b.prototype={constructor:b,hasObserver:function(){return!!this.observers.length},reset:function(){this.observers=[]},removeObserver:function(a){var b,g=this.observers,j=g.length;for(b=0;b<j;b++)if(g[b]==a){g.splice(b,1);break}this.checkMemory()},checkMemory:function(){},findObserver:function(a){var b=this.observers,g;for(g=b.length-1;0<=g;--g)if(a.equals(b[g]))return g;return-1}};return b}); KISSY.add("event/base/observer",function(a){function b(b){a.mix(this,b)}b.prototype={constructor:b,equals:function(b){var k=this;return!!a.reduce(k.keys,function(a,j){return a&&k[j]===b[j]},1)},simpleNotify:function(a,b){var g;g=this.fn.call(this.context||b.currentTarget,a,this.data);this.once&&b.removeObserver(this);return g},notifyInternal:function(a,b){return this.simpleNotify(a,b)},notify:function(a,b){var g;g=a._ks_groups;if(!g||this.groups&&this.groups.match(g))return g=this.notifyInternal(a, b),!1===g&&a.halt(),g}};return b}); KISSY.add("event/base/utils",function(a){var b,i;return{splitAndRun:i=function(b,g){b=a.trim(b);-1==b.indexOf(" ")?g(b):a.each(b.split(/\s+/),g)},normalizeParam:function(i,g,j){var l=g||{},l=a.isFunction(g)?{fn:g,context:j}:a.merge(l),g=b(i),i=g[0];l.groups=g[1];l.type=i;return l},batchForType:function(b,g){var j=a.makeArray(arguments);i(j[2+g],function(a){var e=[].concat(j);e.splice(0,2);e[g]=a;b.apply(null,e)})},getTypedGroups:b=function(a){if(0>a.indexOf("."))return[a,""];var b=a.match(/([^.]+)?(\..+)?$/), a=[b[1]];(b=b[2])?(b=b.split(".").sort(),a.push(b.join("."))):a.push("");return a},getGroupsRe:function(a){return RegExp(a.split(".").join(".*\\.")+"(?:\\.|$)")}}}); KISSY.add("event/custom/api-impl",function(a,b,i,k){var g=a.trim,j=i._Utils,l=j.splitAndRun;return a.mix(b,{fire:function(a,b,d){var h=void 0,d=d||{};l(b,function(b){var f,b=j.getTypedGroups(b);f=b[1];b=b[0];f&&(f=j.getGroupsRe(f),d._ks_groups=f);f=(k.getCustomEvent(a,b)||new k({currentTarget:a,type:b})).fire(d);!1!==h&&(h=f)});return h},publish:function(b,f,d){var h;l(f,function(c){h=k.getCustomEvent(b,c,1);a.mix(h,d)});return b},addTarget:function(e,f){var d=b.getTargets(e);a.inArray(f,d)||d.push(f); return e},removeTarget:function(e,f){var d=b.getTargets(e),h=a.indexOf(f,d);-1!=h&&d.splice(h,1);return e},getTargets:function(a){a["__~ks_bubble_targets"]=a["__~ks_bubble_targets"]||[];return a["__~ks_bubble_targets"]},on:function(a,b,d,h){b=g(b);j.batchForType(function(b,d,h){d=j.normalizeParam(b,d,h);b=d.type;if(b=k.getCustomEvent(a,b,1))b.on(d)},0,b,d,h);return a},detach:function(b,f,d,h){f=g(f);j.batchForType(function(c,d,h){var f=j.normalizeParam(c,d,h);(c=f.type)?(c=k.getCustomEvent(b,c,1))&& c.detach(f):(c=k.getCustomEvents(b),a.each(c,function(a){a.detach(f)}))},0,f,d,h);return b}})},{requires:["./api","event/base","./observable"]});KISSY.add("event/custom/api",function(){return{}});KISSY.add("event/custom",function(a,b,i,k){var g={};a.each(i,function(b,i){g[i]=function(){var e=a.makeArray(arguments);e.unshift(this);return b.apply(null,e)}});i=a.mix({_ObservableCustomEvent:k,Target:g},i);a.mix(b,{Target:g,custom:i});a.EventTarget=g;return i},{requires:["./base","./custom/api-impl","./custom/observable"]}); KISSY.add("event/custom/object",function(a,b){function i(b){i.superclass.constructor.call(this);a.mix(this,b)}a.extend(i,b._Object);return i},{requires:["event/base"]}); KISSY.add("event/custom/observable",function(a,b,i,k,g){function j(){j.superclass.constructor.apply(this,arguments);this.defaultFn=null;this.defaultTargetOnly=!1;this.bubbles=!0}var l=g._Utils;a.extend(j,g._ObservableEvent,{constructor:j,on:function(a){a=new i(a);-1==this.findObserver(a)&&this.observers.push(a)},checkMemory:function(){var b=this.currentTarget,d=j.getCustomEvents(b);d&&(this.hasObserver()||delete d[this.type],a.isEmptyObject(d)&&delete b[e])},fire:function(a){if(this.hasObserver()|| this.bubbles){var a=a||{},d=this.type,h=this.defaultFn,c,e,g;c=this.currentTarget;var i=a,l;a.type=d;i instanceof k||(i.target=c,i=new k(i));i.currentTarget=c;a=this.notify(i);!1!==l&&(l=a);if(this.bubbles){g=(e=b.getTargets(c))&&e.length||0;for(c=0;c<g&&!i.isPropagationStopped();c++)a=b.fire(e[c],d,i),!1!==l&&(l=a)}h&&!i.isDefaultPrevented()&&(d=j.getCustomEvent(i.target,i.type),(!this.defaultTargetOnly&&!d.defaultTargetOnly||this==i.target)&&h.call(this));return l}},notify:function(a){var b=this.observers, h,c,e=b.length,g;for(g=0;g<e&&!a.isImmediatePropagationStopped();g++)h=b[g].notify(a,this),!1!==c&&(c=h),!1===h&&a.halt();return c},detach:function(a){var b,h=a.fn,c=a.context,e=this.currentTarget,g=this.observers,a=a.groups;if(g.length){a&&(b=l.getGroupsRe(a));var j,i,k,r,t=g.length;if(h||b){c=c||e;j=a=0;for(i=[];a<t;++a)if(k=g[a],r=k.context||e,c!=r||h&&h!=k.fn||b&&!k.groups.match(b))i[j++]=k;this.observers=i}else this.reset();this.checkMemory()}}});var e="__~ks_custom_events";j.getCustomEvent= function(a,b,h){var c,e=j.getCustomEvents(a,h);c=e&&e[b];!c&&h&&(c=e[b]=new j({currentTarget:a,type:b}));return c};j.getCustomEvents=function(a,b){!a[e]&&b&&(a[e]={});return a[e]};return j},{requires:["./api","./observer","./object","event/base"]});KISSY.add("event/custom/observer",function(a,b){function i(){i.superclass.constructor.apply(this,arguments)}a.extend(i,b._Observer,{keys:["fn","context","groups"]});return i},{requires:["event/base"]}); KISSY.add("event/dom/base/api",function(a,b,i,k,g,j,l){function e(a,b){var d=k[b]||{};a.originalType||(a.selector?d.delegateFix&&(a.originalType=b,b=d.delegateFix):d.onFix&&(a.originalType=b,b=d.onFix));return b}function f(b,c,d){var f,g,i,d=a.merge(d),c=e(d,c);f=j.getCustomEvents(b,1);if(!(i=f.handle))i=f.handle=function(a){var b=a.type,c=i.currentTarget;if(!(j.triggeredEvent==b||"undefined"==typeof KISSY))if(b=j.getCustomEvent(c,b))return a.currentTarget=c,a=new l(a),b.notify(a)},i.currentTarget= b;if(!(g=f.events))g=f.events={};f=g[c];f||(f=g[c]=new j({type:c,fn:i,currentTarget:b}),f.setup());f.on(d);b=null}var d=b._Utils;a.mix(b,{add:function(b,c,e,g){c=a.trim(c);b=i.query(b);d.batchForType(function(a,b,c,h){c=d.normalizeParam(b,c,h);b=c.type;for(h=a.length-1;0<=h;h--)f(a[h],b,c)},1,b,c,e,g);return b},remove:function(b,c,f,g){c=a.trim(c);b=i.query(b);d.batchForType(function(b,c,h,f){h=d.normalizeParam(c,h,f);c=h.type;for(f=b.length-1;0<=f;f--){var g=b[f],i=c,k=h,k=a.merge(k),l=void 0,i= e(k,i),g=j.getCustomEvents(g),l=(g||{}).events;if(g&&l)if(i)(l=l[i])&&l.detach(k);else for(i in l)l[i].detach(k)}},1,b,c,f,g);return b},delegate:function(a,c,d,e,f){return b.add(a,c,{fn:e,context:f,selector:d})},undelegate:function(a,c,d,e,f){return b.remove(a,c,{fn:e,context:f,selector:d})},fire:function(b,c,e,f){var g=void 0,e=e||{};e.synthetic=1;d.splitAndRun(c,function(c){e.type=c;var k,l,t,c=d.getTypedGroups(c);(l=c[1])&&(l=d.getGroupsRe(l));c=c[0];a.mix(e,{type:c,_ks_groups:l});b=i.query(b); for(l=b.length-1;0<=l;l--)k=b[l],t=j.getCustomEvent(k,c),!f&&!t&&(t=new j({type:c,currentTarget:k})),t&&(k=t.fire(e,f),!1!==g&&(g=k))});return g},fireHandler:function(a,c,d){return b.fire(a,c,d,1)},_clone:function(b,c){var d;(d=j.getCustomEvents(b))&&a.each(d.events,function(b,d){a.each(b.observers,function(a){f(c,d,a)})})},_ObservableDOMEvent:j});b.on=b.add;b.detach=b.remove;return b},{requires:"event/base,dom,./special,./utils,./observable,./object".split(",")}); KISSY.add("event/dom/base",function(a,b,i,k,g,j){a.mix(b,{KeyCodes:i,_DOMUtils:k,Gesture:g,_Special:j});return b},{requires:"event/base,./base/key-codes,./base/utils,./base/gesture,./base/special,./base/api,./base/mouseenter,./base/mousewheel,./base/valuechange".split(",")});KISSY.add("event/dom/base/gesture",function(){return{start:"mousedown",move:"mousemove",end:"mouseup",tap:"click",doubleTap:"dblclick"}}); KISSY.add("event/dom/base/key-codes",function(a){var b=a.UA,i={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88, Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221, WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(a){if(a.altKey&&!a.ctrlKey||a.metaKey||a.keyCode>=i.F1&&a.keyCode<=i.F12)return!1;switch(a.keyCode){case i.ALT:case i.CAPS_LOCK:case i.CONTEXT_MENU:case i.CTRL:case i.DOWN:case i.END:case i.ESC:case i.HOME:case i.INSERT:case i.LEFT:case i.MAC_FF_META:case i.META:case i.NUMLOCK:case i.NUM_CENTER:case i.PAGE_DOWN:case i.PAGE_UP:case i.PAUSE:case i.PRINT_SCREEN:case i.RIGHT:case i.SHIFT:case i.UP:case i.WIN_KEY:case i.WIN_KEY_RIGHT:return!1; default:return!0}},isCharacterKey:function(a){if(a>=i.ZERO&&a<=i.NINE||a>=i.NUM_ZERO&&a<=i.NUM_MULTIPLY||a>=i.A&&a<=i.Z||b.webkit&&0==a)return!0;switch(a){case i.SPACE:case i.QUESTION_MARK:case i.NUM_PLUS:case i.NUM_MINUS:case i.NUM_PERIOD:case i.NUM_DIVISION:case i.SEMICOLON:case i.DASH:case i.EQUALS:case i.COMMA:case i.PERIOD:case i.SLASH:case i.APOSTROPHE:case i.SINGLE_QUOTE:case i.OPEN_SQUARE_BRACKET:case i.BACKSLASH:case i.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};return i}); KISSY.add("event/dom/base/mouseenter",function(a,b,i,k){a.each([{name:"mouseenter",fix:"mouseover"},{name:"mouseleave",fix:"mouseout"}],function(a){k[a.name]={onFix:a.fix,delegateFix:a.fix,handle:function(a,b,e){var f=a.currentTarget,d=a.relatedTarget;if(!d||d!==f&&!i.contains(f,d))return[b.simpleNotify(a,e)]}}});return b},{requires:["./api","dom","./special"]}); KISSY.add("event/dom/base/mousewheel",function(a,b){var i=a.UA.gecko?"DOMMouseScroll":"mousewheel";b.mousewheel={onFix:i,delegateFix:i}},{requires:["./special"]}); KISSY.add("event/dom/base/object",function(a,b,i){function k(a){this.scale=this.rotation=this.targetTouches=this.touches=this.changedTouches=this.which=this.wheelDelta=this.view=this.toElement=this.srcElement=this.shiftKey=this.screenY=this.screenX=this.relatedTarget=this.relatedNode=this.prevValue=this.pageY=this.pageX=this.offsetY=this.offsetX=this.newValue=this.metaKey=this.keyCode=this.handler=this.fromElement=this.eventPhase=this.detail=this.data=this.ctrlKey=this.clientY=this.clientX=this.charCode= this.cancelable=this.button=this.bubbles=this.attrName=this.attrChange=this.altKey=i;k.superclass.constructor.call(this);this.originalEvent=a;this.isDefaultPrevented=a.defaultPrevented||a.returnValue===f||a.getPreventDefault&&a.getPreventDefault()?function(){return e}:function(){return f};g(this);j(this)}function g(a){for(var b=a.originalEvent,e=d.length,f,g=b.currentTarget,g=9===g.nodeType?g:g.ownerDocument||l;e;)f=d[--e],a[f]=b[f];a.target||(a.target=a.srcElement||g);3===a.target.nodeType&&(a.target= a.target.parentNode);!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);a.pageX===i&&a.clientX!==i&&(b=g.documentElement,e=g.body,a.pageX=a.clientX+(b&&b.scrollLeft||e&&e.scrollLeft||0)-(b&&b.clientLeft||e&&e.clientLeft||0),a.pageY=a.clientY+(b&&b.scrollTop||e&&e.scrollTop||0)-(b&&b.clientTop||e&&e.clientTop||0));a.which===i&&(a.which=a.charCode===i?a.keyCode:a.charCode);a.metaKey===i&&(a.metaKey=a.ctrlKey);!a.which&&a.button!==i&&(a.which=a.button& 1?1:a.button&2?3:a.button&4?2:0)}function j(b){var c,d,e,f=b.detail;b.wheelDelta&&(e=b.wheelDelta/120);b.detail&&(e=-(0==f%3?f/3:f));b.axis!==i&&(b.axis===b.HORIZONTAL_AXIS?(d=0,c=-1*e):b.axis===b.VERTICAL_AXIS&&(c=0,d=e));b.wheelDeltaY!==i&&(d=b.wheelDeltaY/120);b.wheelDeltaX!==i&&(c=-1*b.wheelDeltaX/120);!c&&!d&&(d=e);(c!==i||d!==i||e!==i)&&a.mix(b,{deltaY:d,delta:e,deltaX:c})}var l=a.Env.host.document,e=!0,f=!1,d="type,altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,pageX,pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which,axis,changedTouches,touches,targetTouches,rotation,scale".split(","); a.extend(k,b._Object,{constructor:k,preventDefault:function(){var a=this.originalEvent;a.preventDefault?a.preventDefault():a.returnValue=f;k.superclass.preventDefault.call(this)},stopPropagation:function(){var a=this.originalEvent;a.stopPropagation?a.stopPropagation():a.cancelBubble=e;k.superclass.stopPropagation.call(this)}});return b.DOMEventObject=k},{requires:["event/base"]}); KISSY.add("event/dom/base/observable",function(a,b,i,k,g,j,l){function e(b){a.mix(this,b);this.reset()}var f=l._Utils;a.extend(e,l._ObservableEvent,{setup:function(){var a=this.type,b=i[a]||{},c=this.currentTarget,e=k.data(c).handle;(!b.setup||!1===b.setup.call(c,a))&&k.simpleAdd(c,a,e)},constructor:e,reset:function(){e.superclass.reset.call(this);this.lastCount=this.delegateCount=0},notify:function(a){var h=a.target,c=this.currentTarget,e=this.observers,f=[],g,j,i=this.delegateCount||0,l,k;if(i&& !h.disabled)for(;h!=c;){l=[];for(j=0;j<i;j++)k=e[j],b.test(h,k.selector)&&l.push(k);l.length&&f.push({currentTarget:h,currentTargetObservers:l});h=h.parentNode||c}f.push({currentTarget:c,currentTargetObservers:e.slice(i)});j=0;for(h=f.length;!a.isPropagationStopped()&&j<h;++j){c=f[j];l=c.currentTargetObservers;c=c.currentTarget;a.currentTarget=c;for(c=0;!a.isImmediatePropagationStopped()&&c<l.length;c++)e=l[c],e=e.notify(a,this),!1!==g&&(g=e)}return g},fire:function(d,h){var d=d||{},c=this.type,f= i[c];f&&f.onFix&&(c=f.onFix);var g,l,f=this.currentTarget,k=!0;d.type=c;d instanceof j||(l=d,d=new j({currentTarget:f,target:f}),a.mix(d,l));l=f;g=b.getWindow(l.ownerDocument||l);var q=g.document,r=[],t=0,s="on"+c;do r.push(l),l=l.parentNode||l.ownerDocument||l===q&&g;while(l);l=r[t];do{d.currentTarget=l;if(g=e.getCustomEvent(l,c))g=g.notify(d),!1!==k&&(k=g);l[s]&&!1===l[s].call(l)&&d.preventDefault();l=r[++t]}while(!h&&l&&!d.isPropagationStopped());if(!h&&!d.isDefaultPrevented()){var u;try{if(s&& f[c]&&("focus"!==c&&"blur"!==c||0!==f.offsetWidth)&&!a.isWindow(f))(u=f[s])&&(f[s]=null),e.triggeredEvent=c,f[c]()}catch(v){}u&&(f[s]=u);e.triggeredEvent=""}return k},on:function(a){var b=this.observers,c=i[this.type]||{},a=a instanceof g?a:new g(a);-1==this.findObserver(a)&&(a.selector?(b.splice(this.delegateCount,0,a),this.delegateCount++):a.last?(b.push(a),this.lastCount++):b.splice(b.length-this.lastCount,0,a),c.add&&c.add.call(this.currentTarget,a))},detach:function(a){var b,c=i[this.type]|| {},e="selector"in a,g=a.selector,j=a.context,l=a.fn,k=this.currentTarget,r=this.observers,a=a.groups;if(r.length){a&&(b=f.getGroupsRe(a));var t,s,u,v,x=r.length;if(l||e||b){j=j||k;t=a=0;for(s=[];a<x;++a)u=r[a],v=u.context||k,j!=v||l&&l!=u.fn||e&&(g&&g!=u.selector||!g&&!u.selector)||b&&!u.groups.match(b)?s[t++]=u:(u.selector&&this.delegateCount&&this.delegateCount--,u.last&&this.lastCount&&this.lastCount--,c.remove&&c.remove.call(k,u));this.observers=s}else this.reset();this.checkMemory()}},checkMemory:function(){var b= this.type,h,c,e=i[b]||{},f=this.currentTarget,g=k.data(f);if(g&&(h=g.events,this.hasObserver()||(c=g.handle,(!e.tearDown||!1===e.tearDown.call(f,b))&&k.simpleRemove(f,b,c),delete h[b]),a.isEmptyObject(h)))g.handle=null,k.removeData(f)}});e.triggeredEvent="";e.getCustomEvent=function(a,b){var c=k.data(a),e;c&&(e=c.events);if(e)return e[b]};e.getCustomEvents=function(a,b){var c=k.data(a);!c&&b&&k.data(a,c={});return c};return e},{requires:"dom,./special,./utils,./observer,./object,event/base".split(",")}); KISSY.add("event/dom/base/observer",function(a,b,i){function k(a){k.superclass.constructor.apply(this,arguments)}a.extend(k,i._Observer,{keys:"fn,selector,data,context,originalType,groups,last".split(","),notifyInternal:function(a,j){var i,e,f=a.type;this.originalType&&(a.type=this.originalType);(i=b[a.type])&&i.handle?(i=i.handle(a,this,j))&&0<i.length&&(e=i[0]):e=this.simpleNotify(a,j);a.type=f;return e}});return k},{requires:["./special","event/base"]});KISSY.add("event/dom/base/special",function(){return{}}); KISSY.add("event/dom/base/utils",function(a,b){var i=a.Env.host.document;return{simpleAdd:i&&i.addEventListener?function(a,b,j,i){a.addEventListener&&a.addEventListener(b,j,!!i)}:function(a,b,j){a.attachEvent&&a.attachEvent("on"+b,j)},simpleRemove:i&&i.removeEventListener?function(a,b,j,i){a.removeEventListener&&a.removeEventListener(b,j,!!i)}:function(a,b,j){a.detachEvent&&a.detachEvent("on"+b,j)},data:function(a,g){return b.data(a,"ksEventTargetId_1.30",g)},removeData:function(a){return b.removeData(a, "ksEventTargetId_1.30")}}},{requires:["dom"]}); KISSY.add("event/dom/base/valuechange",function(a,b,i,k){function g(a){if(i.hasData(a,p)){var b=i.data(a,p);clearTimeout(b);i.removeData(a,p)}}function j(a){g(a.target)}function l(a){var d=a.value,h=i.data(a,n);d!==h&&(b.fireHandler(a,c,{prevVal:h,newVal:d}),i.data(a,n,d))}function e(a){i.hasData(a,p)||i.data(a,p,setTimeout(function(){l(a);i.data(a,p,setTimeout(arguments.callee,o))},o))}function f(a){var b=a.target;"focus"==a.type&&i.data(b,n,b.value);e(b)}function d(a){l(a.target)}function h(a){i.removeData(a, n);g(a);b.remove(a,"blur",j);b.remove(a,"webkitspeechchange",d);b.remove(a,"mousedown keyup keydown focus",f)}var c="valuechange",m=i.nodeName,n="event/valuechange/history",p="event/valuechange/poll",o=50;k[c]={setup:function(){var a=m(this);if("input"==a||"textarea"==a)h(this),b.on(this,"blur",j),b.on(this,"webkitspeechchange",d),b.on(this,"mousedown keyup keydown focus",f)},tearDown:function(){h(this)}};return b},{requires:["./api","dom","./special"]}); KISSY.add("event/dom/focusin",function(a,b){var i=b._Special;a.each([{name:"focusin",fix:"focus"},{name:"focusout",fix:"blur"}],function(k){function g(a){return b.fire(a.target,k.name)}var j=a.guid("attaches_"+a.now()+"_");i[k.name]={setup:function(){var a=this.ownerDocument||this;j in a||(a[j]=0);a[j]+=1;1===a[j]&&a.addEventListener(k.fix,g,!0)},tearDown:function(){var a=this.ownerDocument||this;a[j]-=1;0===a[j]&&a.removeEventListener(k.fix,g,!0)}}});return b},{requires:["event/dom/base"]}); KISSY.add("event/dom/hashchange",function(a,b,i){var k=a.UA,g=b._Special,j=a.Env.host,l=j.document,e=l&&l.documentMode,f="__replace_history_"+a.now(),k=e||k.ie;b.REPLACE_HISTORY=f;var d="<html><head><title>"+(l&&l.title||"")+" - {hash}</title>{head}</head><body>{hash}</body></html>",h=function(){return"#"+(new a.Uri(location.href)).getFragment()},c,m,n=function(){var b=h(),d;if(d=a.endsWith(b,f))b=b.slice(0,-f.length),location.hash=b;b!==m&&(m=b,p(b,d));c=setTimeout(n,50)},p=k&&8>k?function(b,c){var h= a.substitute(d,{hash:a.escapeHTML(b),head:i.isCustomDomain()?"<script>document.domain = '"+l.domain+"';<\/script>":""}),e=r.contentWindow.document;try{c?e.open("text/html","replace"):e.open(),e.write(h),e.close()}catch(f){}}:function(){b.fireHandler(j,"hashchange")},o=function(){c||n()},q=function(){c&&clearTimeout(c);c=0},r;k&&8>k&&(o=function(){if(!r){var c=i.getEmptyIframeSrc();r=i.create("<iframe "+(c?'src="'+c+'"':"")+' style="display: none" height="0" width="0" tabindex="-1" title="empty"/>'); i.prepend(r,l.documentElement);b.add(r,"load",function(){b.remove(r,"load");p(h());b.add(r,"load",d);n()});l.onpropertychange=function(){try{"title"===event.propertyName&&(r.contentWindow.document.title=l.title+" - "+h())}catch(a){}};var d=function(){var c=a.trim(r.contentWindow.document.body.innerText),d=h();c!=d&&(m=location.hash=c);b.fireHandler(j,"hashchange")}}},q=function(){c&&clearTimeout(c);c=0;b.detach(r);i.remove(r);r=0});g.hashchange={setup:function(){if(this===j){m=h();o()}},tearDown:function(){this=== j&&q()}}},{requires:["event/dom/base","dom"]}); KISSY.add("event/dom/ie/change",function(a,b,i){function k(a){a=a.type;return"checkbox"==a||"radio"==a}function g(a){"checked"==a.originalEvent.propertyName&&(this.__changed=1)}function j(a){this.__changed&&(this.__changed=0,b.fire(this,"change",a))}function l(a){a=a.target;f.test(a.nodeName)&&!a.__changeHandler&&(a.__changeHandler=1,b.on(a,"change",{fn:e,last:1}))}function e(a){if(!a.isPropagationStopped()&&!k(this)){var h;(h=this.parentNode)&&b.fire(h,"change",a)}}var f=/^(?:textarea|input|select)$/i; b._Special.change={setup:function(){if(f.test(this.nodeName))if(k(this))b.on(this,"propertychange",g),b.on(this,"click",j);else return!1;else b.on(this,"beforeactivate",l)},tearDown:function(){if(f.test(this.nodeName))if(k(this))b.remove(this,"propertychange",g),b.remove(this,"click",j);else return!1;else b.remove(this,"beforeactivate",l),a.each(i.query("textarea,input,select",this),function(a){a.__changeHandler&&(a.__changeHandler=0,b.remove(a,"change",{fn:e,last:1}))})}}},{requires:["event/dom/base", "dom"]});KISSY.add("event/dom/ie",function(){},{requires:["./ie/change","./ie/submit"]}); KISSY.add("event/dom/ie/submit",function(a,b,i){function k(a){var a=a.target,e=j(a);if((a="input"==e||"button"==e?a.form:null)&&!a.__submit__fix)a.__submit__fix=1,b.on(a,"submit",{fn:g,last:1})}function g(a){this.parentNode&&!a.isPropagationStopped()&&!a.synthetic&&b.fire(this.parentNode,"submit",a)}var j=i.nodeName;b._Special.submit={setup:function(){if("form"==j(this))return!1;b.on(this,"click keypress",k)},tearDown:function(){if("form"==j(this))return!1;b.remove(this,"click keypress",k);a.each(i.query("form", this),function(a){a.__submit__fix&&(a.__submit__fix=0,b.remove(a,"submit",{fn:g,last:1}))})}}},{requires:["event/dom/base","dom"]}); KISSY.add("event/dom/shake",function(a,b,i){function k(a){var b=a.accelerationIncludingGravity,a=b.x,g=b.y,b=b.z,k;f!==i&&(k=c(m(a-f),m(g-d),m(b-h)),k>j&&p(),k>l&&(e=1));f=a;d=g;h=b}var g=b._Special,j=5,l=20,e=0,f,d,h,c=Math.max,m=Math.abs,n=a.Env.host,p=a.buffer(function(){e&&(b.fireHandler(n,"shake",{accelerationIncludingGravity:{x:f,y:d,z:h}}),f=i,e=0)},250);g.shake={setup:function(){this==n&&n.addEventListener("devicemotion",k,!1)},tearDown:function(){this==n&&(p.stop(),f=i,e=0,n.removeEventListener("devicemotion", k,!1))}}},{requires:["event/dom/base"]}); KISSY.add("event/dom/touch/double-tap",function(a,b,i,k){function g(){}a.extend(g,k,{onTouchStart:function(a){if(!1===g.superclass.onTouchStart.apply(this,arguments))return!1;this.startTime=a.timeStamp;this.singleTapTimer&&(clearTimeout(this.singleTapTimer),this.singleTapTimer=0)},onTouchMove:function(){return!1},onTouchEnd:function(a){var b=this.lastEndTime,e=a.timeStamp,f=a.target,d=a.changedTouches[0],h=e-this.startTime;this.lastEndTime=e;if(b&&(h=e-b,300>h)){this.lastEndTime=0;i.fire(f,"doubleTap", {touch:d,duration:h/1E3});return}h=e-this.startTime;300<h?i.fire(f,"singleTap",{touch:d,duration:h/1E3}):this.singleTapTimer=setTimeout(function(){i.fire(f,"singleTap",{touch:d,duration:h/1E3})},300)}});b.singleTap=b.doubleTap={handle:new g};return g},{requires:["./handle-map","event/dom/base","./single-touch"]}); KISSY.add("event/dom/touch/gesture",function(a,b){var i=b.Gesture,k,g,j;a.Features.isTouchSupported()&&(k="touchstart",g="touchmove",j="touchend");k&&(i.start=k,i.move=g,i.end=j,i.tap="tap",i.doubleTap="doubleTap");return i},{requires:["event/dom/base"]});KISSY.add("event/dom/touch/handle-map",function(){return{}}); KISSY.add("event/dom/touch/handle",function(a,b,i,k,g){function j(a){this.doc=a;this.eventHandle={};this.init()}var l=a.guid("touch-handle"),e=a.Features,f={};f[g.start]="onTouchStart";f[g.move]="onTouchMove";f[g.end]="onTouchEnd";"mousedown"!==g.start&&(f.touchcancel="onTouchEnd");var d=a.throttle(function(a){this.callEventHandle("onTouchMove",a)},30);j.prototype={init:function(){var a=this.doc,b,d;for(b in f){d=f[b];k.on(a,b,this[d],this)}},normalize:function(a){var b=a.type,d;if(!e.isTouchSupported()){if(b.indexOf("mouse")!= -1&&a.which!=1)return;d=[a];b=!b.match(/up$/i);a.touches=b?d:[];a.targetTouches=b?d:[];a.changedTouches=d}return a},onTouchMove:function(a){d.call(this,a)},onTouchStart:function(a){var b,d,e=this.eventHandle;for(b in e){d=e[b].handle;d.isActive=1}this.callEventHandle("onTouchStart",a)},onTouchEnd:function(a){this.callEventHandle("onTouchEnd",a)},callEventHandle:function(a,b){var d=this.eventHandle,e,f;if(b=this.normalize(b)){for(e in d){f=d[e].handle;if(!f.processed){f.processed=1;if(f.isActive&& f[a](b)===false)f.isActive=0}}for(e in d){f=d[e].handle;f.processed=0}}},addEventHandle:function(a){var b=this.eventHandle,d=i[a].handle;b[a]?b[a].count++:b[a]={count:1,handle:d}},removeEventHandle:function(a){var b=this.eventHandle;if(b[a]){b[a].count--;b[a].count||delete b[a]}},destroy:function(){var a=this.doc,b,d;for(b in f){d=f[b];k.detach(a,b,this[d],this)}}};return{addDocumentHandle:function(a,c){var d=b.getWindow(a.ownerDocument||a).document,e=i[c].setup,f=b.data(d,l);f||b.data(d,l,f=new j(d)); e&&e.call(a,c);f.addEventHandle(c)},removeDocumentHandle:function(d,c){var e=b.getWindow(d.ownerDocument||d).document,f=i[c].tearDown,g=b.data(e,l);f&&f.call(d,c);if(g){g.removeEventHandle(c);if(a.isEmptyObject(g.eventHandle)){g.destroy();b.removeData(e,l)}}}}},{requires:"dom,./handle-map,event/dom/base,./gesture,./tap,./swipe,./double-tap,./pinch,./tap-hold,./rotate".split(",")}); KISSY.add("event/dom/touch/multi-touch",function(a,b){function i(){}i.prototype={requiredTouchCount:2,onTouchStart:function(a){var b=this.requiredTouchCount,j=a.touches.length;j===b?this.start():j>b&&this.end(a)},onTouchEnd:function(a){this.end(a)},start:function(){this.isTracking||(this.isTracking=!0,this.isStarted=!1)},fireEnd:a.noop,getCommonTarget:function(a){var g=a.touches,a=g[0].target,g=g[1].target;if(a==g||b.contains(a,g))return a;for(;;){if(b.contains(g,a))return g;g=g.parentNode}},end:function(a){this.isTracking&& (this.isTracking=!1,this.isStarted&&(this.isStarted=!1,this.fireEnd(a)))}};return i},{requires:["dom"]}); KISSY.add("event/dom/touch/pinch",function(a,b,i,k,g){function j(){}function l(a){(!a.touches||2==a.touches.length)&&a.preventDefault()}a.extend(j,k,{onTouchMove:function(b){if(this.isTracking){var f=b.touches,d,h=f[0],c=f[1];d=h.pageX-c.pageX;h=h.pageY-c.pageY;d=Math.sqrt(d*d+h*h);this.lastTouches=f;this.isStarted?i.fire(this.target,"pinch",a.mix(b,{distance:d,scale:d/this.startDistance})):(this.isStarted=!0,this.startDistance=d,f=this.target=this.getCommonTarget(b),i.fire(f,"pinchStart",a.mix(b, {distance:d,scale:1})))}},fireEnd:function(b){i.fire(this.target,"pinchEnd",a.mix(b,{touches:this.lastTouches}))}});k=new j;b.pinchStart=b.pinchEnd={handle:k};b.pinch={handle:k,setup:function(){i.on(this,g.move,l)},tearDown:function(){i.detach(this,g.move,l)}};return j},{requires:["./handle-map","event/dom/base","./multi-touch","./gesture"]}); KISSY.add("event/dom/touch/rotate",function(a,b,i,k,g,j){function l(){}function e(a){(!a.touches||2==a.touches.length)&&a.preventDefault()}var f=180/Math.PI;a.extend(l,i,{onTouchMove:function(b){if(this.isTracking){var e=b.touches,c=e[0],g=e[1],i=this.lastAngle,c=Math.atan2(g.pageY-c.pageY,g.pageX-c.pageX)*f;if(i!==j){var g=Math.abs(c-i),l=(c+360)%360,o=(c-360)%360;Math.abs(l-i)<g?c=l:Math.abs(o-i)<g&&(c=o)}this.lastTouches=e;this.lastAngle=c;this.isStarted?k.fire(this.target,"rotate",a.mix(b,{angle:c, rotation:c-this.startAngle})):(this.isStarted=!0,this.startAngle=c,this.target=this.getCommonTarget(b),k.fire(this.target,"rotateStart",a.mix(b,{angle:c,rotation:0})))}},end:function(){this.lastAngle=j;l.superclass.end.apply(this,arguments)},fireEnd:function(b){k.fire(this.target,"rotateEnd",a.mix(b,{touches:this.lastTouches}))}});i=new l;b.rotateEnd=b.rotateStart={handle:i};b.rotate={handle:i,setup:function(){k.on(this,g.move,e)},tearDown:function(){k.detach(this,g.move,e)}};return l},{requires:["./handle-map", "./multi-touch","event/dom/base","./gesture"]});KISSY.add("event/dom/touch/single-touch",function(a){function b(){}b.prototype={requiredTouchCount:1,onTouchStart:function(a){if(a.touches.length!=this.requiredTouchCount)return!1;this.lastTouches=a.touches},onTouchMove:a.noop,onTouchEnd:a.noop};return b}); KISSY.add("event/dom/touch/swipe",function(a,b,i,k){function g(a,b,c){var g=b.changedTouches[0],j=g.pageX-a.startX,k=g.pageY-a.startY,o=Math.abs(j),q=Math.abs(k);if(c)a.isVertical&&a.isHorizontal&&(q>o?a.isHorizontal=0:a.isVertical=0);else if(a.isVertical&&q<f&&(a.isVertical=0),a.isHorizontal&&o<f)a.isHorizontal=0;if(a.isHorizontal)j=0>j?"left":"right";else if(a.isVertical)j=0>k?"up":"down",o=q;else return!1;i.fire(b.target,c?e:l,{originalEvent:b.originalEvent,touch:g,direction:j,distance:o,duration:(b.timeStamp- a.startTime)/1E3})}function j(){}var l="swipe",e="swiping",f=50;a.extend(j,k,{onTouchStart:function(a){if(!1===j.superclass.onTouchStart.apply(this,arguments))return!1;var b=a.touches[0];this.startTime=a.timeStamp;this.isVertical=this.isHorizontal=1;this.startX=b.pageX;this.startY=b.pageY;-1!=a.type.indexOf("mouse")&&a.preventDefault()},onTouchMove:function(a){var b=a.changedTouches[0],c=b.pageY-this.startY,b=Math.abs(b.pageX-this.startX),c=Math.abs(c);if(1E3<a.timeStamp-this.startTime)return!1;this.isVertical&& 35<b&&(this.isVertical=0);this.isHorizontal&&35<c&&(this.isHorizontal=0);return g(this,a,1)},onTouchEnd:function(a){return!1===this.onTouchMove(a)?!1:g(this,a,0)}});b[l]=b[e]={handle:new j};return j},{requires:["./handle-map","event/dom/base","./single-touch"]}); KISSY.add("event/dom/touch/tap-hold",function(a,b,i,k,g){function j(){}function l(a){(!a.touches||1==a.touches.length)&&a.preventDefault()}a.extend(j,i,{onTouchStart:function(b){if(!1===j.superclass.onTouchStart.call(this,b))return!1;this.timer=setTimeout(function(){k.fire(b.target,"tapHold",{touch:b.touches[0],duration:(a.now()-b.timeStamp)/1E3})},1E3)},onTouchMove:function(){clearTimeout(this.timer);return!1},onTouchEnd:function(){clearTimeout(this.timer)}});b.tapHold={setup:function(){k.on(this, g.start,l)},tearDown:function(){k.detach(this,g.start,l)},handle:new j};return j},{requires:["./handle-map","./single-touch","event/dom/base","./gesture"]});KISSY.add("event/dom/touch/tap",function(a,b,i,k){function g(){}a.extend(g,k,{onTouchMove:function(){return!1},onTouchEnd:function(a){i.fire(a.target,"tap",{touch:a.changedTouches[0]})}});b.tap={handle:new g};return g},{requires:["./handle-map","event/dom/base","./single-touch"]}); KISSY.add("event/dom/touch",function(a,b,i,k){var a=b._Special,b={setup:function(a){k.addDocumentHandle(this,a)},tearDown:function(a){k.removeDocumentHandle(this,a)}},g;for(g in i)a[g]=b},{requires:["event/dom/base","./touch/handle-map","./touch/handle"]}); KISSY.add("json/json2",function(){function a(a){return 10>a?"0"+a:a}function b(a){j.lastIndex=0;return j.test(a)?'"'+a.replace(j,function(a){var b=f[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function i(a,c){var f,g,j,k,q=l,r,t=c[a];t&&"object"===typeof t&&"function"===typeof t.toJSON&&(t=t.toJSON(a));"function"===typeof d&&(t=d.call(c,a,t));switch(typeof t){case "string":return b(t);case "number":return isFinite(t)?""+t:"null";case "boolean":case "null":return""+ t;case "object":if(!t)return"null";l+=e;r=[];if("[object Array]"===Object.prototype.toString.apply(t)){k=t.length;for(f=0;f<k;f+=1)r[f]=i(f,t)||"null";j=0===r.length?"[]":l?"[\n"+l+r.join(",\n"+l)+"\n"+q+"]":"["+r.join(",")+"]";l=q;return j}if(d&&"object"===typeof d){k=d.length;for(f=0;f<k;f+=1)g=d[f],"string"===typeof g&&(j=i(g,t))&&r.push(b(g)+(l?": ":":")+j)}else for(g in t)Object.hasOwnProperty.call(t,g)&&(j=i(g,t))&&r.push(b(g)+(l?": ":":")+j);j=0===r.length?"{}":l?"{\n"+l+r.join(",\n"+l)+"\n"+ q+"}":"{"+r.join(",")+"}";l=q;return j}}var k={};"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var g=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, j=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l,e,f={"":"\\b","\t":"\\t","\n":"\\n"," ":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;k.stringify=function(a,b,f){var g;e=l="";if(typeof f==="number")for(g=0;g<f;g=g+1)e=e+" ";else typeof f==="string"&&(e=f);if((d=b)&&typeof b!=="function"&&(typeof b!=="object"||typeof b.length!=="number"))throw Error("JSON.stringify");return i("",{"":a})};k.parse=function(a,b){function d(a, f){var e,h,g=a[f];if(g&&typeof g==="object")for(e in g)if(Object.hasOwnProperty.call(g,e)){h=d(g,e);h!==void 0?g[e]=h:delete g[e]}return b.call(a,f,g)}var f,a=""+a;g.lastIndex=0;g.test(a)&&(a=a.replace(g,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){f=eval("("+a+")");return typeof b=== "function"?d({"":f},""):f}throw new SyntaxError("JSON.parse");};return k});KISSY.add("json",function(a,b){b||(b=JSON);return a.JSON={parse:function(a){return null==a||""===a?null:b.parse(a)},stringify:b.stringify}},{requires:[KISSY.Features.isNativeJSONSupported()?"":"json/json2"]}); KISSY.add("ajax",function(a,b,i){function k(b,l,e,f,d){a.isFunction(l)&&(f=e,e=l,l=g);return i({type:d||"get",url:b,data:l,success:e,dataType:f})}var g=void 0;a.mix(i,{serialize:b.serialize,get:k,post:function(b,i,e,f){a.isFunction(i)&&(f=e,e=i,i=g);return k(b,i,e,f,"post")},jsonp:function(b,i,e){a.isFunction(i)&&(e=i,i=g);return k(b,i,e,"jsonp")},getScript:a.getScript,getJSON:function(b,i,e){a.isFunction(i)&&(e=i,i=g);return k(b,i,e,"json")},upload:function(b,k,e,f,d){a.isFunction(e)&&(d=f,f=e,e= g);return i({url:b,type:"post",dataType:d,form:k,data:e,success:f})}});a.mix(a,{Ajax:i,IO:i,ajax:i,io:i,jsonp:i.jsonp});return i},{requires:"ajax/form-serializer,ajax/base,ajax/xhr-transport,ajax/script-transport,ajax/jsonp,ajax/form,ajax/iframe-transport,ajax/methods".split(",")}); KISSY.add("ajax/base",function(a,b,i,k){function g(b){var d=b.context;delete b.context;b=a.mix(a.clone(p),b,{deep:!0});b.context=d||b;var e,h=b.type,g=b.dataType,d=b.uri=m.resolve(b.url);b.uri.setQuery("");"crossDomain"in b||(b.crossDomain=!b.uri.isSameOriginAs(m));h=b.type=h.toUpperCase();b.hasContent=!c.test(h);if(b.processData&&(e=b.data)&&"string"!=typeof e)b.data=a.param(e,k,k,b.serializeArray);g=b.dataType=a.trim(g||"*").split(f);!("cache"in b)&&a.inArray(g[0],["script","jsonp"])&&(b.cache= !1);b.hasContent||(b.data&&d.query.add(a.unparam(b.data)),!1===b.cache&&d.query.set("_ksTS",a.now()+"_"+a.guid()));return b}function j(a,b){l.fire(a,{ajaxConfig:b.config,io:b})}function l(b){function c(a){return function(c){if(i=d.timeoutTimer)clearTimeout(i),d.timeoutTimer=0;var f=b[a];f&&f.apply(w,c);j(a,d)}}var d=this;if(!(d instanceof l))return new l(b);h.call(d);b=g(b);a.mix(d,{responseData:null,config:b||{},timeoutTimer:null,responseText:null,responseXML:null,responseHeadersString:"",responseHeaders:null, requestHeaders:{},readyState:0,state:0,statusText:null,status:0,transport:null,_defer:new a.Defer(this)});var f;j("start",d);f=new (n[b.dataType[0]]||n["*"])(d);d.transport=f;b.contentType&&d.setRequestHeader("Content-Type",b.contentType);var e=b.dataType[0],i,k,m=b.timeout,w=b.context,p=b.headers,y=b.accepts;d.setRequestHeader("Accept",e&&y[e]?y[e]+("*"===e?"":", */*; q=0.01"):y["*"]);for(k in p)d.setRequestHeader(k,p[k]);if(b.beforeSend&&!1===b.beforeSend.call(w,d,b))return d;d.then(c("success"), c("error"));d.fin(c("complete"));d.readyState=1;j("send",d);b.async&&0<m&&(d.timeoutTimer=setTimeout(function(){d.abort("timeout")},1E3*m));try{d.state=1,f.send()}catch(B){2>d.state&&d._ioReady(-1,B.message)}return d}var e=/^(?:about|app|app\-storage|.+\-extension|file|widget)$/,f=/\s+/,d=function(a){return a},h=a.Promise,c=/^(?:GET|HEAD)$/,m=new a.Uri((a.Env.host.location||{}).href),e=m&&e.test(m.getScheme()),n={},p={type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",async:!0, serializeArray:!0,processData:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},converters:{text:{json:b.parse,html:d,text:d,xml:a.parseXML}},contents:{xml:/xml/,html:/html/,json:/json/}};p.converters.html=p.converters.text;a.mix(l,i.Target);a.mix(l,{isLocal:e,setupConfig:function(b){a.mix(p,b,{deep:!0})},setupTransport:function(a,b){n[a]=b},getTransport:function(a){return n[a]},getConfig:function(){return p}});return l}, {requires:["json","event"]}); KISSY.add("ajax/form-serializer",function(a,b){function i(a){return a.replace(g,"\r\n")}var k=/^(?:select|textarea)/i,g=/\r?\n/g,j,l=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i;return j={serialize:function(b,f){return a.param(j.getFormData(b),void 0,void 0,f||!1)},getFormData:function(e){var f=[],d={};a.each(b.query(e),function(b){b=b.elements?a.makeArray(b.elements):[b];f.push.apply(f,b)});f=a.filter(f,function(a){return a.name&&!a.disabled&& (a.checked||k.test(a.nodeName)||l.test(a.type))});a.each(f,function(f){var c=b.val(f),e;null!==c&&(c=a.isArray(c)?a.map(c,i):i(c),(e=d[f.name])?(e&&!a.isArray(e)&&(e=d[f.name]=[e]),e.push.apply(e,a.makeArray(c))):d[f.name]=c)});return d}}},{requires:["dom"]}); KISSY.add("ajax/form",function(a,b,i,k){b.on("start",function(b){var j,l,e,b=b.io.config;if(e=b.form)j=i.get(e),l=j.encoding||j.enctype,e=b.data,"multipart/form-data"!=l.toLowerCase()?(j=k.getFormData(j),b.hasContent?(j=a.param(j,void 0,void 0,b.serializeArray),b.data=e?b.data+("&"+j):j):b.uri.query.add(j)):(e=b.dataType,b=e[0],"*"==b&&(b="text"),e.length=2,e[0]="iframe",e[1]=b)});return b},{requires:["./base","dom","./form-serializer"]}); KISSY.add("ajax/iframe-transport",function(a,b,i,k){function g(f){var d=a.guid("io-iframe"),h=b.getEmptyIframeSrc(),f=f.iframe=b.create("<iframe "+(h?' src="'+h+'" ':"")+' id="'+d+'" name="'+d+'" style="position:absolute;left:-9999px;top:-9999px;"/>');b.prepend(f,e.body||e.documentElement);return f}function j(f,d,h){var c=[],g,j,i,k;a.each(f,function(f,l){g=a.isArray(f);j=a.makeArray(f);for(i=0;i<j.length;i++)k=e.createElement("input"),k.type="hidden",k.name=l+(g&&h?"[]":""),k.value=j[i],b.append(k, d),c.push(k)});return c}function l(a){this.io=a}var e=a.Env.host.document;k.setupConfig({converters:{iframe:k.getConfig().converters.text,text:{iframe:function(a){return a}},xml:{iframe:function(a){return a}}}});a.augment(l,{send:function(){function f(){i.on(l,"load error",d._callback,d);q.submit()}var d=this,e=d.io,c=e.config,k,l,p,o=c.data,q=b.get(c.form);d.attrs={target:b.attr(q,"target")||"",action:b.attr(q,"action")||"",method:b.attr(q,"method")};d.form=q;l=g(e);b.attr(q,{target:l.id,action:e._getUrlForSend(), method:"post"});o&&(p=a.unparam(o));p&&(k=j(p,q,c.serializeArray));d.fields=k;6==a.UA.ie?setTimeout(f,0):f()},_callback:function(e){var d=this,h=d.form,c=d.io,e=e.type,g,j=c.iframe;if(j)if("abort"==e&&6==a.UA.ie?setTimeout(function(){b.attr(h,d.attrs)},0):b.attr(h,d.attrs),b.remove(this.fields),i.detach(j),setTimeout(function(){b.remove(j)},30),c.iframe=null,"load"==e)try{if((g=j.contentWindow.document)&&g.body)c.responseText=a.trim(b.text(g.body)),a.startsWith(c.responseText,"<?xml")&&(c.responseText= void 0);c.responseXML=g&&g.XMLDocument?g.XMLDocument:g;g?c._ioReady(200,"success"):c._ioReady(500,"parser error")}catch(k){c._ioReady(500,"parser error")}else"error"==e&&c._ioReady(500,"error")},abort:function(){this._callback({type:"abort"})}});k.setupTransport("iframe",l);return k},{requires:["dom","event","./base"]}); KISSY.add("ajax/jsonp",function(a,b){var i=a.Env.host;b.setupConfig({jsonp:"callback",jsonpCallback:function(){return a.guid("jsonp")}});b.on("start",function(b){var g=b.io,j=g.config,b=j.dataType;if("jsonp"==b[0]){var l,e=j.jsonpCallback,f=a.isFunction(e)?e():e,d=i[f];j.uri.query.set(j.jsonp,f);i[f]=function(b){1<arguments.length&&(b=a.makeArray(arguments));l=[b]};g.fin(function(){i[f]=d;if(void 0===d)try{delete i[f]}catch(a){}else l&&d(l[0])});g=g.converters=g.converters||{};g.script=g.script|| {};g.script.json=function(){return l[0]};b.length=2;b[0]="script";b[1]="json"}});return b},{requires:["./base"]}); KISSY.add("ajax/methods",function(a,b,i){function k(b){var g=b.responseText,e=b.responseXML,f=b.config,d=f.converters,h=b.converters||{},c,k,n=f.contents,p=f.dataType;if(g||e){for(f=b.mimeType||b.getResponseHeader("Content-Type");"*"==p[0];)p.shift();if(!p.length)for(c in n)if(n[c].test(f)){p[0]!=c&&p.unshift(c);break}p[0]=p[0]||"text";if("text"==p[0]&&g!==i)k=g;else if("xml"==p[0]&&e!==i)k=e;else{var o={text:g,xml:e};a.each(["text","xml"],function(a){var b=p[0];return(h[a]&&h[a][b]||d[a]&&d[a][b])&& o[a]?(p.unshift(a),k="text"==a?g:e,!1):i})}}n=p[0];for(f=1;f<p.length;f++){c=p[f];var q=h[n]&&h[n][c]||d[n]&&d[n][c];if(!q)throw"no covert for "+n+" => "+c;k=q(k);n=c}b.responseData=k}var g=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg;a.extend(b,a.Promise,{setRequestHeader:function(a,b){this.requestHeaders[a]=b;return this},getAllResponseHeaders:function(){return 2===this.state?this.responseHeadersString:null},getResponseHeader:function(a){var b,e;if(2===this.state){if(!(e=this.responseHeaders))for(e=this.responseHeaders= {};b=g.exec(this.responseHeadersString);)e[b[1]]=b[2];b=e[a]}return b===i?null:b},overrideMimeType:function(a){this.state||(this.mimeType=a);return this},abort:function(a){a=a||"abort";this.transport&&this.transport.abort(a);this._ioReady(0,a);return this},getNativeXhr:function(){var a;return(a=this.transport)?a.nativeXhr:null},_ioReady:function(a,b){if(2!=this.state){this.state=2;this.readyState=4;var e;if(200<=a&&300>a||304==a)if(304==a)b="not modified",e=!0;else try{k(this),b="success",e=!0}catch(f){b= "parser error"}else 0>a&&(a=0);this.status=a;this.statusText=b;this._defer[e?"resolve":"reject"]([this.responseData,b,this])}},_getUrlForSend:function(){var b=this.config,g=b.uri,e=a.Uri.getComponents(b.url).query||"";return g.toString(b.serializeArray)+(e?(g.query.has()?"&":"?")+e:e)}})},{requires:["./base"]}); KISSY.add("ajax/script-transport",function(a,b,i,k){function g(a){if(!a.config.crossDomain)return new (b.getTransport("*"))(a);this.io=a;return this}var j=a.Env.host,l=j.document;b.setupConfig({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{text:{script:function(b){a.globalEval(b);return b}}}});a.augment(g,{send:function(){var a=this,b,d=a.io,h=d.config,c=l.head||l.getElementsByTagName("head")[0]|| l.documentElement;a.head=c;b=l.createElement("script");a.script=b;b.async=!0;h.scriptCharset&&(b.charset=h.scriptCharset);b.src=d._getUrlForSend();b.onerror=b.onload=b.onreadystatechange=function(b){b=b||j.event;a._callback((b.type||"error").toLowerCase())};c.insertBefore(b,c.firstChild)},_callback:function(a,b){var d=this.script,h=this.io,c=this.head;if(d&&(b||!d.readyState||/loaded|complete/.test(d.readyState)||"error"==a))d.onerror=d.onload=d.onreadystatechange=null,c&&d.parentNode&&c.removeChild(d), this.head=this.script=k,!b&&"error"!=a?h._ioReady(200,"success"):"error"==a&&h._ioReady(500,"script error")},abort:function(){this._callback(0,1)}});b.setupTransport("script",g);return b},{requires:["./base","./xhr-transport"]}); KISSY.add("ajax/sub-domain-transport",function(a,b,i,k){function g(a){var b=a.config;this.io=a;b.crossDomain=!1}function j(){var a=this.io.config.uri.getHostname(),a=e[a];a.ready=1;i.detach(a.iframe,"load",j,this);this.send()}var l=a.Env.host.document,e={};a.augment(g,b.proto,{send:function(){var f=this.io.config,d=f.uri,h=d.getHostname(),c;c=e[h];var g="/sub_domain_proxy.html";f.xdr&&f.xdr.subDomain&&f.xdr.subDomain.proxy&&(g=f.xdr.subDomain.proxy);c&&c.ready?(this.nativeXhr=b.nativeXhr(0,c.iframe.contentWindow))&& this.sendInternal():(c?f=c.iframe:(c=e[h]={},f=c.iframe=l.createElement("iframe"),k.css(f,{position:"absolute",left:"-9999px",top:"-9999px"}),k.prepend(f,l.body||l.documentElement),c=new a.Uri,c.setScheme(d.getScheme()),c.setPort(d.getPort()),c.setHostname(h),c.setPath(g),f.src=c.toString()),i.on(f,"load",j,this))}});return g},{requires:["./xhr-transport-base","event","dom"]}); KISSY.add("ajax/xdr-flash-transport",function(a,b,i){function k(a,b,e){d||(d=!0,a='<object id="'+l+'" type="application/x-shockwave-flash" data="'+a+'" width="0" height="0"><param name="movie" value="'+a+'" /><param name="FlashVars" value="yid='+b+"&uid="+e+'&host=KISSY.IO" /><param name="allowScriptAccess" value="always" /></object>',b=f.createElement("div"),i.prepend(b,f.body||f.documentElement),b.innerHTML=a)}function g(a){this.io=a}var j={},l="io_swf",e,f=a.Env.host.document,d=!1;a.augment(g, {send:function(){var b=this,c=b.io,d=c.config;k((d.xdr||{}).src||a.Config.base+"ajax/io.swf",1,1);e?(b._uid=a.guid(),j[b._uid]=b,e.send(c._getUrlForSend(),{id:b._uid,uid:b._uid,method:d.type,data:d.hasContent&&d.data||{}})):setTimeout(function(){b.send()},200)},abort:function(){e.abort(this._uid)},_xdrResponse:function(a,b){var d,e=b.id,f,g=b.c,i=this.io;if(g&&(f=g.responseText))i.responseText=decodeURI(f);switch(a){case "success":d={status:200,statusText:"success"};delete j[e];break;case "abort":delete j[e]; break;case "timeout":case "transport error":case "failure":delete j[e],d={status:"status"in g?g.status:500,statusText:g.statusText||a}}d&&i._ioReady(d.status,d.statusText)}});b.applyTo=function(d,c,e){var d=c.split(".").slice(1),f=b;a.each(d,function(a){f=f[a]});f.apply(null,e)};b.xdrReady=function(){e=f.getElementById(l)};b.xdrResponse=function(a,b){var d=j[b.uid];d&&d._xdrResponse(a,b)};return g},{requires:["./base","dom"]}); KISSY.add("ajax/xhr-transport-base",function(a,b){function i(a,b){try{return new (b||g).XMLHttpRequest}catch(c){}}function k(a){var b;a.ifModified&&(b=a.uri,!1===a.cache&&(b=b.clone(),b.query.remove("_ksTS")),b=b.toString());return b}var g=a.Env.host,j=7<a.UA.ie&&g.XDomainRequest,l={proto:{}},e={},f={};b.__lastModifiedCached=e;b.__eTagCached=f;l.nativeXhr=g.ActiveXObject?function(a,e){var c;if(!l.supportCORS&&a&&j)c=new j;else if(!(c=!b.isLocal&&i(a,e)))a:{try{c=new (e||g).ActiveXObject("Microsoft.XMLHTTP"); break a}catch(f){}c=void 0}return c}:i;l._XDomainRequest=j;l.supportCORS="withCredentials"in l.nativeXhr();a.mix(l.proto,{sendInternal:function(){var a=this,b=a.io,c=b.config,g=a.nativeXhr,i=c.type,l=c.async,o,q=b.mimeType,r=b.requestHeaders||{},b=b._getUrlForSend(),t=k(c),s,u;if(t){if(s=e[t])r["If-Modified-Since"]=s;if(s=f[t])r["If-None-Match"]=s}(o=c.username)?g.open(i,b,l,o,c.password):g.open(i,b,l);if(i=c.xhrFields)for(u in i)g[u]=i[u];q&&g.overrideMimeType&&g.overrideMimeType(q);r["X-Requested-With"]|| (r["X-Requested-With"]="XMLHttpRequest");if("undefined"!==typeof g.setRequestHeader)for(u in r)g.setRequestHeader(u,r[u]);g.send(c.hasContent&&c.data||null);!l||4==g.readyState?a._callback():j&&g instanceof j?(g.onload=function(){g.readyState=4;g.status=200;a._callback()},g.onerror=function(){g.readyState=4;g.status=500;a._callback()}):g.onreadystatechange=function(){a._callback()}},abort:function(){this._callback(0,1)},_callback:function(d,g){var c=this.nativeXhr,i=this.io,l,p,o,q,r,t=i.config;try{if(g|| 4==c.readyState)if(j&&c instanceof j?(c.onerror=a.noop,c.onload=a.noop):c.onreadystatechange=a.noop,g)4!==c.readyState&&c.abort();else{l=k(t);var s=c.status;j&&c instanceof j||(i.responseHeadersString=c.getAllResponseHeaders());l&&(p=c.getResponseHeader("Last-Modified"),o=c.getResponseHeader("ETag"),p&&(e[l]=p),o&&(f[o]=o));if((r=c.responseXML)&&r.documentElement)i.responseXML=r;i.responseText=c.responseText;try{q=c.statusText}catch(u){q=""}!s&&b.isLocal&&!t.crossDomain?s=i.responseText?200:404:1223=== s&&(s=204);i._ioReady(s,q)}}catch(v){c.onreadystatechange=a.noop,g||i._ioReady(-1,v)}}});return l},{requires:["./base"]}); KISSY.add("ajax/xhr-transport",function(a,b,i,k,g){function j(b){var d=b.config,h=d.crossDomain,c=d.xdr||{},j=c.subDomain=c.subDomain||{};this.io=b;if(h){d=d.uri.getHostname();if(l.domain&&a.endsWith(d,l.domain)&&!1!==j.proxy)return new k(b);if(!i.supportCORS&&("flash"===""+c.use||!e))return new g(b)}this.nativeXhr=i.nativeXhr(h);return this}var l=a.Env.host.document,e=i._XDomainRequest;a.augment(j,i.proto,{send:function(){this.sendInternal()}});b.setupTransport("*",j);return b},{requires:["./base", "./xhr-transport-base","./sub-domain-transport","./xdr-flash-transport"]}); KISSY.add("cookie",function(a){function b(a){return"string"==typeof a&&""!==a}var i=a.Env.host.document,k=encodeURIComponent,g=a.urlDecode;return a.Cookie={get:function(a){var k,e;if(b(a)&&(e=(""+i.cookie).match(RegExp("(?:^| )"+a+"(?:(?:=([^;]*))|;|$)"))))k=e[1]?g(e[1]):"";return k},set:function(a,g,e,f,d,h){var g=""+k(g),c=e;"number"===typeof c&&(c=new Date,c.setTime(c.getTime()+864E5*e));c instanceof Date&&(g+="; expires="+c.toUTCString());b(f)&&(g+="; domain="+f);b(d)&&(g+="; path="+d);h&&(g+= "; secure");i.cookie=a+"="+g},remove:function(a,b,e,f){this.set(a,"",-1,b,e,f)}}}); KISSY.add("base/attribute",function(a,b){function i(a,b){return"string"==typeof b?a[b]:b}function k(b,c,d,e,f,g,h){h=h||d;return b.fire(c+a.ucfirst(d)+"Change",{attrName:h,subAttrName:g,prevVal:e,newVal:f})}function g(a,b,c){var d=a[b]||{};c&&(a[b]=d);return d}function j(a){return g(a,"__attrs",!0)}function l(a){return g(a,"__attrVals",!0)}function e(a,c){for(var d=0,e=c.length;a!=b&&d<e;d++)a=a[c[d]];return a}function f(a,b){var c;!a.hasAttr(b)&&-1!==b.indexOf(".")&&(c=b.split("."),b=c.shift()); return{path:c,name:b}}function d(c,d,e){var f=e;if(d){var c=f=c===b?{}:a.clone(c),g=d.length-1;if(0<=g){for(var h=0;h<g;h++)c=c[d[h]];c!=b&&(c[d[h]]=e)}}return f}function h(a,c,g,h,i){var h=h||{},j,m,n;n=f(a,c);var w=c,c=n.name;j=n.path;n=a.get(c);j&&(m=e(n,j));if(!j&&n===g||j&&m===g)return b;g=d(n,j,g);if(!h.silent&&!1===k(a,"before",c,n,g,w))return!1;g=a.setInternal(c,g,h);if(!1===g)return g;h.silent||(g=l(a)[c],k(a,"after",c,n,g,w),i?i.push({prevVal:n,newVal:g,attrName:c,subAttrName:w}):k(a,"", "*",[n],[g],[w],[c]));return a}function c(){}function m(a,c){var d=j(a),e=g(d,c),f=e.valueFn;if(f&&(f=i(a,f)))f=f.call(a),f!==b&&(e.value=f),delete e.valueFn,d[c]=e;return e.value}function n(a,c,e,h){var k,l;k=f(a,c);c=k.name;if(k=k.path)l=a.get(c),e=d(l,k,e);if((k=g(j(a),c,!0).validator)&&(k=i(a,k)))if(a=k.call(a,e,c,h),a!==b&&!0!==a)return a;return b}c.INVALID={};var p=c.INVALID;c.prototype={getAttrs:function(){return j(this)},getAttrVals:function(){var a={},b,c=j(this);for(b in c)a[b]=this.get(b); return a},addAttr:function(b,c,d){var e=j(this),c=a.clone(c);e[b]?a.mix(e[b],c,d):e[b]=c;return this},addAttrs:function(b,c){var d=this;a.each(b,function(a,b){d.addAttr(b,a)});c&&d.set(c);return d},hasAttr:function(a){return j(this).hasOwnProperty(a)},removeAttr:function(a){this.hasAttr(a)&&(delete j(this)[a],delete l(this)[a]);return this},set:function(c,d,e){if(a.isPlainObject(c)){var e=d,d=Object(c),f=[],g,i=[];for(c in d)(g=n(this,c,d[c],d))!==b&&i.push(g);if(i.length)return e&&e.error&&e.error(i), !1;for(c in d)h(this,c,d[c],e,f);var j=[],l=[],m=[],p=[];a.each(f,function(a){l.push(a.prevVal);m.push(a.newVal);j.push(a.attrName);p.push(a.subAttrName)});j.length&&k(this,"","*",l,m,p,j);return this}return h(this,c,d,e)},setInternal:function(a,c,d){var e,f,h=g(j(this),a,!0).setter;f=n(this,a,c);if(f!==b)return d.error&&d.error(f),!1;if(h&&(h=i(this,h)))e=h.call(this,c,a);if(e===p)return!1;e!==b&&(c=e);l(this)[a]=c},get:function(a){var c,d=this.hasAttr(a),f=l(this),h;!d&&-1!==a.indexOf(".")&&(c= a.split("."),a=c.shift());d=g(j(this),a).getter;h=a in f?f[a]:m(this,a);if(d&&(d=i(this,d)))h=d.call(this,h,a);!(a in f)&&h!==b&&(f[a]=h);c&&(h=e(h,c));return h},reset:function(a,b){if("string"==typeof a)return this.hasAttr(a)?this.set(a,m(this,a),b):this;var b=a,c=j(this),d={};for(a in c)d[a]=m(this,a);this.set(d,b);return this}};return c}); KISSY.add("base",function(a,b,i){function k(a){var b=this.constructor;for(this.userConfig=a;b;){var i=b.ATTRS;if(i){var e=void 0;for(e in i)this.addAttr(e,i[e],!1)}b=b.superclass?b.superclass.constructor:null}if(a)for(var f in a)this.setInternal(f,a[f])}a.augment(k,i.Target,b);k.Attribute=b;return a.Base=k},{requires:["base/attribute","event/custom"]});KISSY.add("anim",function(a,b,i){b.Easing=i;a.mix(a,{Anim:b,Easing:b.Easing});return b},{requires:["anim/base","anim/easing","anim/color","anim/background-position"]}); KISSY.add("anim/background-position",function(a,b,i,k){function g(a){a=a.replace(/left|top/g,"0px").replace(/right|bottom/g,"100%").replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");a=a.match(/(-?[0-9\.]+)(px|%|em|pt)\s(-?[0-9\.]+)(px|%|em|pt)/);return[parseFloat(a[1]),a[2],parseFloat(a[3]),a[4]]}function j(){j.superclass.constructor.apply(this,arguments)}a.extend(j,k,{load:function(){j.superclass.load.apply(this,arguments);this.unit=["px","px"];if(this.from){var a=g(this.from);this.from=[a[0],a[2]]}else this.from= [0,0];this.to?(a=g(this.to),this.to=[a[0],a[2]],this.unit=[a[1],a[3]]):this.to=[0,0]},interpolate:function(a,b,f){var d=this.unit,g=j.superclass.interpolate;return g(a[0],b[0],f)+d[0]+" "+g(a[1],b[1],f)+d[1]},cur:function(){return b.css(this.anim.config.el,"backgroundPosition")},update:function(){var a=this.prop,e=this.anim.config.el,f=this.interpolate(this.from,this.to,this.pos);b.css(e,a,f)}});return k.Factories.backgroundPosition=j},{requires:["dom","./base","./fx"]}); KISSY.add("anim/base",function(a,b,i,k,g,j,l){function e(c,d,g,h,i){if(c.el)return g=c.el,d=c.props,delete c.el,delete c.props,new e(g,d,c);if(c=b.get(c)){if(!(this instanceof e))return new e(c,d,g,h,i);d="string"==typeof d?a.unparam(""+d,";",":"):a.clone(d);a.each(d,function(b,c){var e=a.trim(o(c));e?c!=e&&(d[e]=d[c],delete d[c]):delete d[c]});g=a.isPlainObject(g)?a.clone(g):{duration:parseFloat(g)||void 0,easing:h,complete:i};g=a.merge(s,g);g.el=c;g.props=d;this.config=g;this._duration=1E3*g.duration; this.domEl=c;this._backupProps={};this._fxs={};this.on("complete",f)}}function f(c){var d,e,f=this.config;a.isEmptyObject(d=this._backupProps)||b.css(f.el,d);(e=f.complete)&&e.call(this,c)}function d(){var c=this.config,d=this._backupProps,e=c.el,f,i,l,m=c.specialEasing||{},n=this._fxs,o=c.props;h(this);if(!1===this.fire("beforeStart"))this.stop(0);else{if(e.nodeType==q.ELEMENT_NODE)for(l in i="none"===b.css(e,"display"),o)if(f=o[l],"hide"==f&&i||"show"==f&&!i){this.stop(1);return}if(e.nodeType== q.ELEMENT_NODE&&(o.width||o.height))f=e.style,a.mix(d,{overflow:f.overflow,"overflow-x":f.overflowX,"overflow-y":f.overflowY}),f.overflow="hidden","inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(p.ie?f.zoom=1:f.display="inline-block");a.each(o,function(b,d){var e;a.isArray(b)?(e=m[d]=b[1],o[d]=b[0]):e=m[d]=m[d]||c.easing;"string"==typeof e&&(e=m[d]=k[e]);m[d]=e||k.easeNone});a.each(t,function(c,d){var f,g;if(g=o[d])f={},a.each(c,function(a){f[a]=b.css(e,a);m[a]=m[d]}),b.css(e,d,g),a.each(f, function(a,c){o[c]=b.css(e,c);b.css(e,c,a)}),delete o[d]});for(l in o){f=a.trim(o[l]);var s,v,x={prop:l,anim:this,easing:m[l]},E=j.getFx(x);a.inArray(f,r)?(d[l]=b.style(e,l),"toggle"==f&&(f=i?"show":"hide"),"hide"==f?(s=0,v=E.cur(),d.display="none"):(v=0,s=E.cur(),b.css(e,l,v),b.show(e)),f=s):(s=f,v=E.cur());f+="";var H="",G=f.match(u);if(G){s=parseFloat(G[2]);if((H=G[3])&&"px"!==H)b.css(e,l,f),v*=s/E.cur(),b.css(e,l,v+H);G[1]&&(s=("-="===G[1]?-1:1)*s+v)}x.from=v;x.to=s;x.unit=H;E.load(x);n[l]=E}this._startTime= a.now();g.start(this)}}function h(c){var d=c.config.el,e=b.data(d,v);e||b.data(d,v,e={});e[a.stamp(c)]=c}function c(c){var d=c.config.el,e=b.data(d,v);e&&(delete e[a.stamp(c)],a.isEmptyObject(e)&&b.removeData(d,v))}function m(c,d,e){c=b.data(c,"resume"==e?x:v);c=a.merge(c);a.each(c,function(a){if(void 0===d||a.config.queue==d)a[e]()})}function n(c,d,e,f){e&&!1!==f&&l.removeQueue(c,f);c=b.data(c,v);c=a.merge(c);a.each(c,function(a){a.config.queue==f&&a.stop(d)})}var p=a.UA,o=b._camelCase,q=b.NodeType, r=["hide","show","toggle"],t={background:["backgroundPosition"],border:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],borderBottom:["borderBottomWidth"],borderLeft:["borderLeftWidth"],borderTop:["borderTopWidth"],borderRight:["borderRightWidth"],font:["fontSize","fontWeight"],margin:["marginBottom","marginLeft","marginRight","marginTop"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"]},s={duration:1,easing:"easeNone"},u=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i; e.SHORT_HANDS=t;e.prototype={constructor:e,isRunning:function(){var c=b.data(this.config.el,v);return c?!!c[a.stamp(this)]:0},isPaused:function(){var c=b.data(this.config.el,x);return c?!!c[a.stamp(this)]:0},pause:function(){if(this.isRunning()){this._pauseDiff=a.now()-this._startTime;g.stop(this);c(this);var d=this.config.el,e=b.data(d,x);e||b.data(d,x,e={});e[a.stamp(this)]=this}return this},resume:function(){if(this.isPaused()){this._startTime=a.now()-this._pauseDiff;var c=this.config.el,d=b.data(c, x);d&&(delete d[a.stamp(this)],a.isEmptyObject(d)&&b.removeData(c,x));h(this);g.start(this)}return this},_runInternal:d,run:function(){!1===this.config.queue?d.call(this):l.queue(this);return this},_frame:function(){var a,b=this.config,c=1,d,e,f=this._fxs;for(a in f)if(!(e=f[a]).finished)b.frame&&(d=b.frame(e)),1==d||0==d?(e.finished=d,c&=d):(c&=e.frame())&&b.frame&&b.frame(e);(!1===this.fire("step")||c)&&this.stop(c)},stop:function(a){var b=this.config,d=b.queue,e,f=this._fxs;if(!this.isRunning())return!1!== d&&l.remove(this),this;if(a){for(e in f)if(!(a=f[e]).finished)b.frame?b.frame(a,1):a.frame(1);this.fire("complete")}g.stop(this);c(this);!1!==d&&l.dequeue(this);return this}};a.augment(e,i.Target);var v=a.guid("ks-anim-unqueued-"+a.now()+"-"),x=a.guid("ks-anim-paused-"+a.now()+"-");e.stop=function(c,d,e,f){if(null===f||"string"==typeof f||!1===f)return n.apply(void 0,arguments);e&&l.removeQueues(c);var g=b.data(c,v),g=a.merge(g);a.each(g,function(a){a.stop(d)})};a.each(["pause","resume"],function(a){e[a]= function(b,c){if(null===c||"string"==typeof c||!1===c)return m(b,c,a);m(b,void 0,a)}});e.isRunning=function(c){return(c=b.data(c,v))&&!a.isEmptyObject(c)};e.isPaused=function(c){return(c=b.data(c,x))&&!a.isEmptyObject(c)};e.Q=l;return e},{requires:"dom,event,./easing,./manager,./fx,./queue".split(",")}); KISSY.add("anim/color",function(a,b,i,k){function g(a){var a=a+"",b;if(b=a.match(d))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])];if(b=a.match(h))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),parseInt(b[4])];if(b=a.match(c)){for(a=1;a<b.length;a++)2>b[a].length&&(b[a]+=b[a]);return[parseInt(b[1],l),parseInt(b[2],l),parseInt(b[3],l)]}return f[a=a.toLowerCase()]?f[a]:[255,255,255]}function j(){j.superclass.constructor.apply(this,arguments)}var l=16,e=Math.floor,f={black:[0,0,0],silver:[192, 192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]},d=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,h=/^rgba\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+),\s*([0-9]+)\)$/i,c=/^#?([0-9A-F]{1,2})([0-9A-F]{1,2})([0-9A-F]{1,2})$/i,b=i.SHORT_HANDS;b.background=b.background||[];b.background.push("backgroundColor"); b.borderColor=["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"];b.border.push("borderBottomColor","borderLeftColor","borderRightColor","borderTopColor");b.borderBottom.push("borderBottomColor");b.borderLeft.push("borderLeftColor");b.borderRight.push("borderRightColor");b.borderTop.push("borderTopColor");a.extend(j,k,{load:function(){j.superclass.load.apply(this,arguments);this.from&&(this.from=g(this.from));this.to&&(this.to=g(this.to))},interpolate:function(a,b,c){var d= j.superclass.interpolate;if(3==a.length&&3==b.length)return"rgb("+[e(d(a[0],b[0],c)),e(d(a[1],b[1],c)),e(d(a[2],b[2],c))].join(", ")+")";if(4==a.length||4==b.length)return"rgba("+[e(d(a[0],b[0],c)),e(d(a[1],b[1],c)),e(d(a[2],b[2],c)),e(d(a[3]||1,b[3]||1,c))].join(", ")+")"}});a.each("backgroundColor,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,outlineColor".split(","),function(a){k.Factories[a]=j});return j},{requires:["dom","./base","./fx"]}); KISSY.add("anim/easing",function(){var a=Math.PI,b=Math.pow,i=Math.sin,k={swing:function(b){return-Math.cos(b*a)/2+0.5},easeNone:function(a){return a},easeIn:function(a){return a*a},easeOut:function(a){return(2-a)*a},easeBoth:function(a){return 1>(a*=2)?0.5*a*a:0.5*(1- --a*(a-2))},easeInStrong:function(a){return a*a*a*a},easeOutStrong:function(a){return 1- --a*a*a*a},easeBothStrong:function(a){return 1>(a*=2)?0.5*a*a*a*a:0.5*(2-(a-=2)*a*a*a)},elasticIn:function(g){return 0===g||1===g?g:-(b(2,10*(g-= 1))*i((g-0.075)*2*a/0.3))},elasticOut:function(g){return 0===g||1===g?g:b(2,-10*g)*i((g-0.075)*2*a/0.3)+1},elasticBoth:function(g){return 0===g||2===(g*=2)?g:1>g?-0.5*b(2,10*(g-=1))*i((g-0.1125)*2*a/0.45):0.5*b(2,-10*(g-=1))*i((g-0.1125)*2*a/0.45)+1},backIn:function(a){1===a&&(a-=0.001);return a*a*(2.70158*a-1.70158)},backOut:function(a){return(a-=1)*a*(2.70158*a+1.70158)+1},backBoth:function(a){var b,i=(b=2.5949095)+1;return 1>(a*=2)?0.5*a*a*(i*a-b):0.5*((a-=2)*a*(i*a+b)+2)},bounceIn:function(a){return 1- k.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},bounceBoth:function(a){return 0.5>a?0.5*k.bounceIn(2*a):0.5*k.bounceOut(2*a-1)+0.5}};return k}); KISSY.add("anim/fx",function(a,b,i){function k(a){this.load(a)}function g(a,g){return(!a.style||null==a.style[g])&&null!=b.attr(a,g,i,1)?1:0}k.prototype={constructor:k,load:function(b){a.mix(this,b);this.pos=0;this.unit=this.unit||""},frame:function(b){var g=this.anim,e=0;if(this.finished)return 1;var f=a.now(),d=g._startTime,g=g._duration;b||f>=g+d?e=this.pos=1:this.pos=this.easing((f-d)/g);this.update();this.finished=this.finished||e;return e},interpolate:function(b,g,e){return a.isNumber(b)&&a.isNumber(g)? (b+(g-b)*e).toFixed(3):i},update:function(){var a=this.prop,k=this.anim.config.el,e=this.to,f=this.interpolate(this.from,e,this.pos);f===i?this.finished||(this.finished=1,b.css(k,a,e)):(f+=this.unit,g(k,a)?b.attr(k,a,f,1):b.css(k,a,f))},cur:function(){var a=this.prop,k=this.anim.config.el;if(g(k,a))return b.attr(k,a,i,1);var e,a=b.css(k,a);return isNaN(e=parseFloat(a))?!a||"auto"===a?0:a:e}};k.Factories={};k.getFx=function(a){return new (k.Factories[a.prop]||k)(a)};return k},{requires:["dom"]}); KISSY.add("anim/manager",function(a){var b=a.stamp;return{interval:15,runnings:{},timer:null,start:function(a){var k=b(a);this.runnings[k]||(this.runnings[k]=a,this.startTimer())},stop:function(a){this.notRun(a)},notRun:function(i){delete this.runnings[b(i)];a.isEmptyObject(this.runnings)&&this.stopTimer()},pause:function(a){this.notRun(a)},resume:function(a){this.start(a)},startTimer:function(){var a=this;a.timer||(a.timer=setTimeout(function(){a.runFrames()?a.stopTimer():(a.timer=0,a.startTimer())}, a.interval))},stopTimer:function(){var a=this.timer;a&&(clearTimeout(a),this.timer=0)},runFrames:function(){var a=1,b,g=this.runnings;for(b in g)a=0,g[b]._frame();return a}}}); KISSY.add("anim/queue",function(a,b){function i(a,f,d){var f=f||j,h,c=b.data(a,g);!c&&!d&&b.data(a,g,c={});c&&(h=c[f],!h&&!d&&(h=c[f]=[]));return h}function k(e,f){var f=f||j,d=b.data(e,g);d&&delete d[f];a.isEmptyObject(d)&&b.removeData(e,g)}var g=a.guid("ks-queue-"+a.now()+"-"),j=a.guid("ks-queue-"+a.now()+"-"),l={queueCollectionKey:g,queue:function(a){var b=i(a.config.el,a.config.queue);b.push(a);"..."!==b[0]&&l.dequeue(a);return b},remove:function(b){var f=i(b.config.el,b.config.queue,1);f&&(b= a.indexOf(b,f),-1<b&&f.splice(b,1))},removeQueues:function(a){b.removeData(a,g)},removeQueue:k,dequeue:function(a){var b=a.config.el,a=a.config.queue,d=i(b,a,1),h=d&&d.shift();"..."==h&&(h=d.shift());h?(d.unshift("..."),h._runInternal()):k(b,a)}};return l},{requires:["dom"]}); KISSY.add("node/anim",function(a,b,i,k,g){function j(a,b,d){for(var h=[],c={},d=d||0;d<b;d++)h.push.apply(h,l[d]);for(d=0;d<h.length;d++)c[h[d]]=a;return c}var l=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.augment(k,{animate:function(b){var f=a.makeArray(arguments);a.each(this,function(b){var e=a.clone(f),c=e[0];c.props?(c.el=b,i(c).run()):i.apply(g,[b].concat(e)).run()});return this},stop:function(b, f,d){a.each(this,function(a){i.stop(a,b,f,d)});return this},pause:function(b,f){a.each(this,function(a){i.pause(a,f)});return this},resume:function(b,f){a.each(this,function(a){i.resume(a,f)});return this},isRunning:function(){for(var a=0;a<this.length;a++)if(i.isRunning(this[a]))return!0;return!1},isPaused:function(){for(var a=0;a<this.length;a++)if(i.isPaused(this[a]))return 1;return 0}});a.each({show:j("show",3),hide:j("hide",3),toggle:j("toggle",3),fadeIn:j("show",3,2),fadeOut:j("hide",3,2),fadeToggle:j("toggle", 3,2),slideDown:j("show",1),slideUp:j("hide",1),slideToggle:j("toggle",1)},function(e,f){k.prototype[f]=function(d,h,c){if(b[f]&&!d)b[f](this);else a.each(this,function(a){i(a,e,d,c||"easeOut",h).run()});return this}})},{requires:["dom","anim","./base"]}); KISSY.add("node/attach",function(a,b,i,k,g){function j(a,d,e){e.unshift(d);a=b[a].apply(b,e);return a===g?d:a}var l=k.prototype,e=a.makeArray;k.KeyCodes=i.KeyCodes;a.each("nodeName,equals,contains,index,scrollTop,scrollLeft,height,width,innerHeight,innerWidth,outerHeight,outerWidth,addStyleSheet,appendTo,prependTo,insertBefore,before,after,insertAfter,test,hasClass,addClass,removeClass,replaceClass,toggleClass,removeAttr,hasAttr,hasProp,scrollIntoView,remove,empty,removeData,hasData,unselectable,wrap,wrapAll,replaceWith,wrapInner,unwrap".split(","),function(a){l[a]= function(){var b=e(arguments);return j(a,this,b)}});a.each("filter,first,last,parent,closest,next,prev,clone,siblings,contents,children".split(","),function(a){l[a]=function(){var d=e(arguments);d.unshift(this);d=b[a].apply(b,d);return d===g?this:d===null?null:new k(d)}});a.each({attr:1,text:0,css:1,style:1,val:0,prop:1,offset:0,html:0,outerHTML:0,data:1},function(f,d){l[d]=function(){var h;h=e(arguments);h[f]===g&&!a.isObject(h[0])?(h.unshift(this),h=b[d].apply(b,h)):h=j(d,this,h);return h}});a.each("on,detach,fire,fireHandler,delegate,undelegate".split(","), function(a){l[a]=function(){var b=e(arguments);b.unshift(this);i[a].apply(i,b);return this}})},{requires:["dom","event/dom","./base"]}); KISSY.add("node/base",function(a,b,i){function k(h,c,g){if(!(this instanceof k))return new k(h,c,g);if(h)if("string"==typeof h){if(h=b.create(h,c,g),h.nodeType===l.DOCUMENT_FRAGMENT_NODE)return e.apply(this,f(h.childNodes)),this}else{if(a.isArray(h)||d(h))return e.apply(this,f(h)),this}else return this;this[0]=h;this.length=1;return this}var g=Array.prototype,j=g.slice,l=b.NodeType,e=g.push,f=a.makeArray,d=b._isNodeList;k.prototype={constructor:k,length:0,item:function(b){return a.isNumber(b)?b>= this.length?null:new k(this[b]):new k(b)},add:function(b,c,d){a.isNumber(c)&&(d=c,c=i);b=k.all(b,c).getDOMNodes();c=new k(this);d===i?e.apply(c,b):(d=[d,0],d.push.apply(d,b),g.splice.apply(c,d));return c},slice:function(a,b){return new k(j.apply(this,arguments))},getDOMNodes:function(){return j.call(this)},each:function(b,c){var d=this;a.each(d,function(a,e){a=new k(a);return b.call(c||a,a,e,d)});return d},getDOMNode:function(){return this[0]},end:function(){return this.__parent||this},all:function(a){a= 0<this.length?k.all(a,this):new k;a.__parent=this;return a},one:function(a){a=this.all(a);if(a=a.length?a.slice(0,1):null)a.__parent=this;return a}};a.mix(k,{all:function(d,c){return"string"==typeof d&&(d=a.trim(d))&&3<=d.length&&a.startsWith(d,"<")&&a.endsWith(d,">")?(c&&(c.getDOMNode&&(c=c[0]),c=c.ownerDocument||c),new k(d,i,c)):new k(b.query(d,c))},one:function(a,b){var d=k.all(a,b);return d.length?d.slice(0,1):null}});k.NodeType=l;return k},{requires:["dom"]}); KISSY.add("node",function(a,b){a.mix(a,{Node:b,NodeList:b,one:b.one,all:b.all});return b},{requires:["node/base","node/attach","node/override","node/anim"]}); KISSY.add("node/override",function(a,b,i){var k=i.prototype;a.each(["append","prepend","before","after"],function(a){k[a]=function(i){"string"==typeof i&&(i=b.create(i));if(i)b[a](i,this);return this}});a.each(["wrap","wrapAll","replaceWith","wrapInner"],function(a){var b=k[a];k[a]=function(a){"string"==typeof a&&(a=i.all(a,this[0].ownerDocument));return b.call(this,a)}})},{requires:["dom","./base"]});KISSY.use("ua,dom,event,node,json,ajax,anim,base,cookie",0,1);
tossmilestone/TmallAutoOrder
seed-min.js
JavaScript
mit
144,147
import { template, traverse, types as t } from "@babel/core"; import { environmentVisitor } from "@babel/helper-replace-supers"; const findBareSupers = traverse.visitors.merge([ { Super(path) { const { node, parentPath } = path; if (parentPath.isCallExpression({ callee: node })) { this.push(parentPath); } }, }, environmentVisitor, ]); const referenceVisitor = { "TSTypeAnnotation|TypeAnnotation"(path) { path.skip(); }, ReferencedIdentifier(path) { if (this.scope.hasOwnBinding(path.node.name)) { this.scope.rename(path.node.name); path.skip(); } }, }; function handleClassTDZ(path, state) { if ( state.classBinding && state.classBinding === path.scope.getBinding(path.node.name) ) { const classNameTDZError = state.file.addHelper("classNameTDZError"); const throwNode = t.callExpression(classNameTDZError, [ t.stringLiteral(path.node.name), ]); path.replaceWith(t.sequenceExpression([throwNode, path.node])); path.skip(); } } const classFieldDefinitionEvaluationTDZVisitor = { ReferencedIdentifier: handleClassTDZ, }; export function injectInitialization(path, constructor, nodes, renamer) { if (!nodes.length) return; const isDerived = !!path.node.superClass; if (!constructor) { const newConstructor = t.classMethod( "constructor", t.identifier("constructor"), [], t.blockStatement([]), ); if (isDerived) { newConstructor.params = [t.restElement(t.identifier("args"))]; newConstructor.body.body.push(template.statement.ast`super(...args)`); } [constructor] = path.get("body").unshiftContainer("body", newConstructor); } if (renamer) { renamer(referenceVisitor, { scope: constructor.scope }); } if (isDerived) { const bareSupers = []; constructor.traverse(findBareSupers, bareSupers); let isFirst = true; for (const bareSuper of bareSupers) { if (isFirst) { bareSuper.insertAfter(nodes); isFirst = false; } else { bareSuper.insertAfter(nodes.map(n => t.cloneNode(n))); } } } else { constructor.get("body").unshiftContainer("body", nodes); } } export function extractComputedKeys(ref, path, computedPaths, file) { const declarations = []; const state = { classBinding: path.node.id && path.scope.getBinding(path.node.id.name), file, }; for (const computedPath of computedPaths) { const computedKey = computedPath.get("key"); if (computedKey.isReferencedIdentifier()) { handleClassTDZ(computedKey, state); } else { computedKey.traverse(classFieldDefinitionEvaluationTDZVisitor, state); } const computedNode = computedPath.node; // Make sure computed property names are only evaluated once (upon class definition) // and in the right order in combination with static properties if (!computedKey.isConstantExpression()) { const ident = path.scope.generateUidIdentifierBasedOnNode( computedNode.key, ); // Declaring in the same block scope // Ref: https://github.com/babel/babel/pull/10029/files#diff-fbbdd83e7a9c998721c1484529c2ce92 path.scope.push({ id: ident, kind: "let", }); declarations.push( t.expressionStatement( t.assignmentExpression("=", t.cloneNode(ident), computedNode.key), ), ); computedNode.key = t.cloneNode(ident); } } return declarations; }
jridgewell/babel
packages/babel-helper-create-class-features-plugin/src/misc.js
JavaScript
mit
3,505
import React from "react" import Presentation from "./Presentation" import Icon from 'material-ui/Icon' import IconButton from 'material-ui/IconButton' import Grid from 'material-ui/Grid' import Typography from 'material-ui/Typography' import { colors } from "../themes/coinium" require("../themes/coinium/index.css") const FOOTER_WIDTH = 60 const MODES = { PRESENTATION: 0, HELP: 1 } export default class App extends React.Component { constructor(props) { super(props); this.state = { mode: MODES.PRESENTATION }; } goToSlide(slideName) { this.setState({mode: MODES.PRESENTATION}, () => { location.hash = `/${slideName}` }) } renderHelp() { const style = { height: '100%', backgroundColor: colors.primary } const creditsStyle = { opacity: 0.8 } return ( <Grid container direction="column" justify="center" align="center" style={style}> <Typography type="caption" style={creditsStyle}> Copyright 2017 Coinium, Inc <hr /> Contact us: <a href="mailto:support@coinium.com">support@coinium.com</a> <hr /> {"Some icons based on the work of "} <a href="http://www.freepik.com" title="Freepik">Freepik</a> {" from "} <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> {" are licensed by "} <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a> </Typography> </Grid> ) } renderCurrentPage() { switch (this.state.mode) { case MODES.PRESENTATION: return <Presentation /> case MODES.HELP: return this.renderHelp() default: return ( <Typography>Please reload</Typography> ) } } render() { const mainStyle = { position: 'fixed', top: 0, right: FOOTER_WIDTH, bottom: 0, left: 0, boxShadow: '2px 0px 4px rgba(0,0,0,0.4)', zIndex: 2, overflow: 'hidden' } const navStyle = { background: colors.secondary, position: 'fixed', top: 0, right: 0, bottom: 0, left: 'auto', width: FOOTER_WIDTH, zIndex: 1 } const onHelpClick = () => { const mode = this.state.mode == MODES.HELP ? MODES.PRESENTATION : MODES.HELP this.setState({mode}) } return ( <Grid container className="App"> <Grid item style={mainStyle}> {this.renderCurrentPage()} </Grid> <Grid item container direction="column" justify="space-between" align="center" spacing={0} style={navStyle}> <Grid> <IconButton onClick={this.goToSlide.bind(this, "home")}> <Icon color="contrast">home</Icon> </IconButton> <IconButton onClick={this.goToSlide.bind(this, "problem")}> <Icon color="contrast">info_outline</Icon> </IconButton> <IconButton onClick={this.goToSlide.bind(this, "team")}> <Icon color="contrast">people</Icon> </IconButton> <IconButton onClick={this.goToSlide.bind(this, "mobile")}> <Icon color="contrast">phone_iphone</Icon> </IconButton> <IconButton onClick={this.goToSlide.bind(this, "signup")}> <Icon color="contrast">insert_drive_file</Icon> </IconButton> </Grid> <Grid> <IconButton onClick={onHelpClick}> <Icon color="contrast">help_outline</Icon> </IconButton> </Grid> </Grid> </Grid> ); } }
alexanderatallah/coinium
components/App.js
JavaScript
mit
3,736
/** * 在球场 * zaiqiuchang.com */ const initialState = { users: {}, posts: {}, courts: {}, files: {}, userStats: {}, postStats: {}, courtStats: {}, fileStats: {} } export default (state = initialState, action) => { if (action.type === 'CACHE_OBJECTS') { let newState = Object.assign({}, state) for (let [k, v] of Object.entries(action)) { if (newState[k] === undefined) { continue } newState[k] = Object.assign({}, newState[k], v) } return newState } else if (action.type === 'RESET' || action.type === 'RESET_OBJECT_CACHE') { return initialState } else { return state } }
jaggerwang/zqc-admin-demo
src/reducers/object.js
JavaScript
mit
655
// ajax mode: abort // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() var pendingRequests = {}, ajax; // Use a prefilter if available (1.5+) if ($.ajaxPrefilter) { $.ajaxPrefilter(function (settings, _, xhr) { var port = settings.port; if (settings.mode === "abort") { if (pendingRequests[port]) { pendingRequests[port].abort(); } pendingRequests[port] = xhr; } }); } else { // Proxy ajax ajax = $.ajax; $.ajax = function (settings) { var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, port = ( "port" in settings ? settings : $.ajaxSettings ).port; if (mode === "abort") { if (pendingRequests[port]) { pendingRequests[port].abort(); } pendingRequests[port] = ajax.apply(this, arguments); return pendingRequests[port]; } return ajax.apply(this, arguments); }; }
GowthamITMARTX/adsports
assets/plugins/jquery-validation/src/ajax.js
JavaScript
mit
1,124
module.exports = { prefix: 'fal', iconName: 'trademark', icon: [640, 512, [], "f25c", "M121.564 134.98H23.876c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h240.249c6.627 0 12 5.373 12 12v14.98c0 6.627-5.373 12-12 12h-97.688V404c0 6.627-5.373 12-12 12h-20.873c-6.627 0-12-5.373-12-12V134.98zM352.474 96h28.124a12 12 0 0 1 11.048 7.315l70.325 165.83c7.252 17.677 15.864 43.059 15.864 43.059h.907s8.611-25.382 15.863-43.059l70.326-165.83A11.998 11.998 0 0 1 575.978 96h28.123a12 12 0 0 1 11.961 11.034l23.898 296c.564 6.985-4.953 12.966-11.961 12.966h-20.318a12 12 0 0 1-11.963-11.059l-14.994-190.64c-1.36-19.49-.453-47.139-.453-47.139h-.907s-9.518 29.462-17.224 47.139l-60.746 137a12 12 0 0 1-10.97 7.136h-24.252a12 12 0 0 1-10.983-7.165l-60.301-136.971c-7.252-17.225-17.224-48.046-17.224-48.046h-.907s.453 28.555-.907 48.046l-14.564 190.613A11.997 11.997 0 0 1 349.322 416h-20.746c-7.008 0-12.525-5.98-11.961-12.966l23.897-296A12.002 12.002 0 0 1 352.474 96z"] };
dolare/myCMS
static/fontawesome5/fontawesome-pro-5.0.2/fontawesome-pro-5.0.2/advanced-options/use-with-node-js/fontawesome-pro-light/faTrademark.js
JavaScript
mit
967
export const FETCH_MESSAGES_REQUEST = 'FETCH_MESSAGES_REQUEST'; export const FETCH_MESSAGES_SUCCESS = 'FETCH_MESSAGES_SUCCESS'; export const FETCH_MESSAGES_ERROR = 'FETCH_MESSAGES_ERROR'; export const CREATE_MESSAGE_REQUEST = 'CREATE_MESSAGE_REQUEST'; export const CREATE_MESSAGE_SUCCESS = 'CREATE_MESSAGE_SUCCESS'; export const CREATE_MESSAGE_ERROR = 'CREATE_MESSAGE_ERROR'; export const UPDATE_MESSAGE_REQUEST = 'UPDATE_MESSAGE_REQUEST'; export const UPDATE_MESSAGE_SUCCESS = 'UPDATE_MESSAGE_SUCCESS'; export const UPDATE_MESSAGE_ERROR = 'UPDATE_MESSAGE_ERROR'; export const DELETE_MESSAGE_REQUEST = 'DELETE_MESSAGE_REQUEST'; export const DELETE_MESSAGE_SUCCESS = 'DELETE_MESSAGE_SUCCESS'; export const DELETE_MESSAGE_ERROR = 'DELETE_MESSAGE_ERROR';
chrisVillanueva/react-redux-firebase-message-example
src/redux/constants/index.js
JavaScript
mit
772
(function(){ if ( !window.File || !window.FileReader || !window.FileList || !window.Blob) return alert('La API de Archivos no es compatible con tu navegador. Considera actualizarlo.'); var Fractal = { loaded: false, imagen: null, tipo: "mandelbrot", busy: false, mode: 0, lastTime: 0, properties: { width:500, height:500 }, dimensions: { x:{s:0,e:0}, y:{s:0,e:0} }, iniciate: function(){ Fractal.loaded = true; Fractal.resetDimentions(); UI.setFractalprop(); }, clear: function(){ Fractal.loaded = false; Fractal.imagen = null; }, resetDimentions: function(){ var d = fractal[Fractal.tipo].prototype.dim; Fractal.dimensions = { x:{s:d.x.s,e:d.x.e}, y:{s:d.y.s,e:d.y.e} }; UI.setDimensions(); }, render: function(){ var self = this; Fractal.dimensions = UI.getDimensions(); if ( !Fractal.loaded || Fractal.busy ) return alert("El Fractal está ocupado"); if ( ! Fractal.paleta.loaded ) return alert("Cargar una paleta"); Fractal.busy = true; UI.rendering(); setTimeout(function(){ Fractal.lastTime = Date.now(); Fractal.imagen = new engine.Imagen(); var process = new engine.ProcessMulti( "fractal.worker.js", Fractal.imagen, UI.getWorkers(), FractalProcessing); // Asignar paleta //process.on("paint",function(f){return self.paleta.getColor(f);}); // Al terminar de procesar: process.on("end",function(){ Fractal.busy = false; Fractal.lastTime = Date.now() - Fractal.lastTime; process.render(); console.log("Tiempo: " + Fractal.lastTime); UI.setFractalprop(); // Guardar imagen del fractal Fractal.imagen = process.source; UI.rendered(); }); console.log(Fractal.properties); Fractal.imagen.create( Fractal.properties.width , Fractal.properties.height ); //if ( Fractal.paleta.loaded ) { // Usar paleta process.loop({ fractal_nom: Fractal.tipo }, {x:0,y:0}, {x:Fractal.properties.width,y:Fractal.properties.height}, Fractal.dimensions, Fractal.paleta ); //} else return alert("La paleta no está cargada"); },100); }, calcularZoom: function(pos,medidas){ var offset_x = - Fractal.dimensions.x.s, offset_y = - Fractal.dimensions.y.s, w = Fractal.dimensions.x.e - Fractal.dimensions.x.s, h = Fractal.dimensions.y.e - Fractal.dimensions.y.s; Fractal.dimensions.x.s = ( pos.x / Fractal.properties.width ) * w - offset_x; Fractal.dimensions.y.s = ( pos.y / Fractal.properties.height ) * h - offset_y; Fractal.dimensions.x.e = ( ( pos.x + medidas ) / Fractal.properties.width ) * w - offset_x; Fractal.dimensions.y.e = ( ( pos.y + medidas ) / Fractal.properties.height ) * h - offset_y; UI.setDimensions(); }, calcularDesplazo: function(x,y){ var offset_x = - Fractal.dimensions.x.s, offset_y = - Fractal.dimensions.y.s, w = Fractal.dimensions.x.e - Fractal.dimensions.x.s, h = Fractal.dimensions.y.e - Fractal.dimensions.y.s, desplazo = { h: ( x / Fractal.properties.width ) * w - offset_x - Fractal.dimensions.x.s, v: ( y / Fractal.properties.height ) * h - offset_y - Fractal.dimensions.y.s }; Fractal.dimensions.x.s += desplazo.h; Fractal.dimensions.y.s += desplazo.v; Fractal.dimensions.x.e += desplazo.h; Fractal.dimensions.y.e += desplazo.v; console.log({h:desplazo.h,v:desplazo.v},{x:x,y:y}); UI.setDimensions(); }, paleta: null }; engine.MyCanvas.init(Fractal.properties.width,Fractal.properties.height); var UI = { $els: {}, init: function(){ this.$els.Fractal = {}; this.$els.Fractal.fetchType = $("#fractalType"); this.$els.Fractal.fileName = this.$els.Fractal.fetchType.children('a:first'); this.$els.Fractal.selectType = this.$els.Fractal.fetchType.children('select#tipoFractal'); this.$els.Fractal.settings = $("#FractalSettings"); this.$els.Fractal.complejos = this.$els.Fractal.settings.find('ul#complejos'); this.$els.Fractal.dims = { s_x: this.$els.Fractal.complejos.find('output[name="s_x"]'), s_y: this.$els.Fractal.complejos.find('output[name="s_y"]'), e_x: this.$els.Fractal.complejos.find('output[name="e_x"]'), e_y: this.$els.Fractal.complejos.find('output[name="e_y"]') }; this.$els.Fractal.modo = this.$els.Fractal.settings.find("#modes .btn-group"); this.$els.Fractal.workers = this.$els.Fractal.settings.find('input[name="workers"]'); this.$els.paleta = { divs: { select: $("#paletaSelect"), selected: $("#paletaSelected"), current: $("a#paleta") }, forms: { select: $('select#palletSelect'), input: $('input#paletteInput') }, slide: { list: $('ul#paletaShow'), button: $('a#paletaSlide') } }; this.$els.paleta.forms.selectLoad = this.$els.paleta.divs.select.find('button'); this.$els.Fractal.suave = this.$els.Fractal.settings.find('input#softTransition'); this.$els.Fractal.renderButton = this.$els.Fractal.settings.find('button[name="render"]'); this.$els.Fractal.renderButton.removeAttr("disabled"); this.setEventos(); }, setEventos: function(){ this.$els.Fractal.fileName.click(function(e){ Fractal.clear(); UI.fileSelect(false); }); this.$els.paleta.divs.current.click(function(e){ Fractal.paleta.clear(); UI.paletaSelect(false); }); this.$els.paleta.forms.selectLoad.click(function(e){ Fractal.paleta.ajaxFetch( UI.$els.paleta.forms.select.val() ); }); this.$els.Fractal.renderButton.click(function(e){ Fractal.render(); }); this.$els.Fractal.suave.on('change',function(e){ Fractal.paleta.suavizado = e.currentTarget.checked; }); Fractal.paleta.suavizado = this.$els.Fractal.suave[0].checked; this.$els.paleta.slide.button.click(UI.paletaSlide); this.$els.Fractal.modo.on('click','label',function(e){ var $this = $(this), selected = $this.children('input').val(); UI.$els.Fractal.modo.find('label.active').removeClass('active'); $this.addClass("active"); if ( selected == "zoom" ) Fractal.mode = 0; else Fractal.mode = 1; }); this.$els.Fractal.settings.find('span#resetDim').click(function(){ Fractal.resetDimentions(); }); this.$els.Fractal.selectType.on('change',UI.typeChange); this.$els.paleta.forms.input.on('change',Fractal.paleta.loadFile); // Dispararse en la primera dibujada $(engine.MyCanvas.el).on('mousedown',UI.mouse.down); $(engine.MyCanvas.el).on('mouseup',UI.mouse.up); $(engine.MyCanvas.el).on('mousemove',UI.mouse.move); }, typeChange: function(e){ var v = $(e.target).val(); if ( v != "" ) { UI.fileSelect(true); UI.$els.Fractal.fileName.children('small').html(e.target.selectedOptions[0].innerHTML); Fractal.tipo = v; Fractal.iniciate(); } }, fileSelect: function(activate){ if ( ( activate == undefined ) || activate ){ this.$els.Fractal.fileName.show(); this.$els.Fractal.selectType.hide(); } else { this.$els.Fractal.selectType.show().val("Elige Fractal"); this.$els.Fractal.fileName.hide(); } }, mouse: { pressed: false, startPos:{x:0,y:0}, endPos:{x:0,y:0}, getCoords: function(e){ var rect = engine.MyCanvas.el.getBoundingClientRect(); return { x: e.clientX - rect.left, y: e.clientY - rect.top }; }, down: function(e){ if ( UI.mouse.pressed ) return UI.mouse.up(e); if ( e.which != 1 ) return; UI.mouse.pressed = true; UI.mouse.startPos = UI.mouse.getCoords(e); }, up: function(e){ if ( !UI.mouse.pressed || e.which != 1 ) return; UI.mouse.pressed = false; UI.mouse.endPos = UI.mouse.getCoords(e); if ( Fractal.mode == 0 ) { var pos = { x: Math.min(UI.mouse.startPos.x,UI.mouse.endPos.x), y: Math.min(UI.mouse.startPos.y,UI.mouse.endPos.y) }, width = Math.max(UI.mouse.startPos.x,UI.mouse.endPos.x) - pos.x, height = Math.max(UI.mouse.startPos.y,UI.mouse.endPos.y) - pos.y; Fractal.calcularZoom(pos,Math.max(width,height)); } else Fractal.calcularDesplazo(UI.mouse.endPos.x - UI.mouse.startPos.x , UI.mouse.endPos.y - UI.mouse.startPos.y); Fractal.render(); }, move: function(e){ if ( !UI.mouse.pressed ) return; var endPos = UI.mouse.getCoords(e), startPos = UI.mouse.startPos; engine.MyCanvas.renderImg( Fractal.imagen ); var context = engine.MyCanvas.context; context.beginPath(); if ( Fractal.mode == 0 ) { var pos = { x: Math.min(startPos.x,endPos.x), y: Math.min(startPos.y,endPos.y) }, width = Math.max(startPos.x,endPos.x) - pos.x, height = Math.max(startPos.y,endPos.y) - pos.y; context.rect(pos.x,pos.y, width,height); } else { context.moveTo(startPos.x,startPos.y); context.lineTo(endPos.x,endPos.y); } context.lineWidth = 2; context.strokeStyle = 'red'; context.stroke(); } }, paletaSelect: function(activate){ if ( ( activate == undefined ) || activate ){ this.$els.paleta.divs.select.hide(); this.$els.paleta.divs.selected.show(); this.paletaDraw(); } else { this.$els.paleta.divs.selected.hide(); this.$els.paleta.divs.select.show(); } }, setFractalprop: function(){ var $lis = this.$els.Fractal.settings.find('ul#datos li'); $lis.eq(0).find('span').html(Fractal.properties.width+"x"+Fractal.properties.height); var $time = $lis.eq(1).children('b'); $time.children('span').remove(); var $span = $('<span></span>'); $span.html(Fractal.lastTime + "ms").addClass("animate new"); $time.append( $span ); $span.focus().removeClass("new"); }, setDimensions: function(){ this.$els.Fractal.dims.s_x.html(Fractal.dimensions.x.s); this.$els.Fractal.dims.s_y.html(Fractal.dimensions.y.s); this.$els.Fractal.dims.e_x.html(Fractal.dimensions.x.e); this.$els.Fractal.dims.e_y.html(Fractal.dimensions.y.e); }, getDimensions: function(){ var $dim = this.$els.Fractal.dims; return ret = {x: { s: parseFloat( $dim.s_x.html() ), e: parseFloat( $dim.e_x.html() ) },y:{ s: parseFloat( $dim.s_y.html() ), e: parseFloat( $dim.e_y.html() ) }}; }, getWorkers: function(){ var v = parseInt(this.$els.Fractal.workers.val()); if ( v < 1 || v > 20 ) { v = 1; this.$els.Fractal.workers.val(v); } return v; }, rendering: function(){ UI.$els.Fractal.renderButton.html("... rendering ...").attr("disabled",""); $('body').addClass("cargando"); }, rendered: function(){ UI.$els.Fractal.renderButton.html("Render").removeAttr("disabled"); $('body').removeClass('cargando'); $('#modes').show(); }, paletaSlide: function(){ var lista = UI.$els.paleta.slide.list, boton = UI.$els.paleta.slide.button; if ( boton.hasClass("active") ){ boton.removeClass("active"); boton.html("Mostrar Paleta"); lista.slideUp("slow"); } else { boton.addClass("active"); lista.slideDown("slow"); boton.html("Ocultar Paleta"); } }, paletaDraw: function(){ var $lista = this.$els.paleta.slide.list; $lista.empty(); for (var i = 0; i < Fractal.paleta.json.length; i++) { var row = Fractal.paleta.json[i]; $lista.append( $('<li></li>').html('<span class="color" style="background-color:rgb('+ row[1].r+','+row[1].g+','+row[1].b+');"></span> ' + row[0]) ); }; } }; Fractal.paleta = new engine.Paleta(UI); UI.init(); Fractal.iniciate(); })();
juampi92/VisualizacionCompI
entrega2/script.js
JavaScript
mit
11,984
var Model = require('./beer'); var Controller = { create: function(req, res) { var dados = req.body; var model = new Model(dados); model.save(function (err, data) { if (err){ console.log('Erro: ', err); res.json('Erro: ' + err); } else{ console.log('Cerveja Inserida: ', data); res.json(data); } }); }, retrieve: function(req, res) { var query = {}; Model.find(query, function (err, data) { if (err){ console.log('Erro: ', err); res.json('Erro: ' + err); } else{ console.log('Cervejas Listadas: ', data); res.json(data); } }); }, get: function(req, res) { var query = {_id: req.params.id}; Model.findOne(query, function (err, data) { if (err){ console.log('Erro: ', err); res.json('Erro: ' + err); } else{ console.log('Cervejas Listadas: ', data); res.json(data); } }); }, update: function(req, res) { var query = {_id: req.params.id}; var mod = req.body; Model.update(query, mod, function (err, data) { if (err){ console.log('Erro: ', err); res.json('Erro: ' + err); } else{ console.log('Cervejas alteradas: ', data); res.json(data); } }); }, delete: function(req, res) { var query = {_id: req.params.id}; // É multi: true CUIDADO! Model.remove(query, function(err, data) { if (err){ console.log('Erro: ', err); res.json('Erro: ' + err); } else{ console.log('Cervejas deletadas: ', data); res.json(data); } }); }, renderList: function(req, res) { var query = {}; Model.find(query, function (err, data) { if (err){ console.log('Erro: ', err); res.render('beers/error', { error: err }); } else{ console.log('Cervejas Listadas: ', data); res.render('beers/index', { title: 'Listagem das cervejas', beers: data }); } }); }, renderGet: function(req, res) { var query = {_id: req.params.id}; Model.findOne(query, function (err, data) { if (err){ console.log('Erro: ', err); res.render('beers/error', { error: err }); } else{ console.log('Cervejas consultada: ', data); res.render('beers/get', { title: 'Cerveja ' + data.name, beer: data }); } }); }, renderCreate: function(req, res) { res.render('beers/create', { title: 'Cadastro de Cerveja' }); }, renderUpdate: function(req, res) { var query = {_id: req.params.id}; Model.findOne(query, function (err, data) { if (err){ console.log('Erro: ', err); res.render('beers/error', { error: err }); } else{ console.log('Cervejas alteradas: ', data); res.render('beers/update', { title: 'Cerveja ' + data.name, beer: data }); } }); }, renderRemove: function(req, res) { var query = {_id: req.params.id}; Model.findOne(query, function (err, data) { if (err){ console.log('Erro: ', err); res.render('beers/error', { error: err }); } else{ console.log('Cervejas removidas: ', data); res.render('beers/remove', { title: 'Remover Cerveja ' + data.name, beer: data }); } }); } }; module.exports = Controller;
marcostomazini/workshop-mean-senai-2015
node/aula-express/modules/beer/controller.js
JavaScript
mit
3,574
(function() { // numeral.js locale configuration // locale : Latvian (lv) // author : Lauris Bukšis-Haberkorns : https://github.com/Lafriks return { delimiters: { thousands: String.fromCharCode(160), decimal: ',' }, abbreviations: { thousand: ' tūkst.', million: ' milj.', billion: ' mljrd.', trillion: ' trilj.' }, ordinal: function(number) { return '.'; }, currency: { symbol: '€' } }; })();
datawrapper/datawrapper
libs/locales/locales/numeral/lv.js
JavaScript
mit
579
module.exports = { out: "./docs/", readme: "README.md", name: "Persian Tools", includes: "./src", entryPoints: ["./src/index.ts"], exclude: ["**/test/**/*", "**/*.js", "**/dist/**/*", "**/src/dummy/**"], excludeExternals: true, includeVersion: true, excludePrivate: false, };
ali-master/persian-tools
typedoc.js
JavaScript
mit
285
'use strict'; /** * Confirm new player name */ module.exports = (srcPath) => { const EventUtil = require(srcPath + 'EventUtil'); return { event: state => (socket, args) => { const say = EventUtil.genSay(socket); const write = EventUtil.genWrite(socket); write(`<bold>${args.name} doesn't exist, would you like to create it?</bold> <cyan>[y/n]</cyan> `); socket.once('data', confirmation => { say(''); confirmation = confirmation.toString().trim().toLowerCase(); if (!/[yn]/.test(confirmation)) { return socket.emit('player-name-check', socket, args); } if (confirmation === 'n') { say(`Let's try again...`); return socket.emit('create-player', socket, args); } return socket.emit('finish-player', socket, args); }); } }; };
seanohue/ranviermud
bundles/ranvier-input-events/input-events/player-name-check.js
JavaScript
mit
862
import React, {Component} from 'react'; import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {initialPlay, nextTrack, togglePlaying} from 'redux/modules/player'; import {starTrack, unstarTrack} from 'redux/modules/starred'; import {isTrackStarred} from 'utils/track'; const classNames = require('classnames'); const styles = require('./Player.scss'); @connect( state => ({player: state.player, starred: state.starred}), dispatch => bindActionCreators({initialPlay, nextTrack, starTrack, unstarTrack, togglePlaying}, dispatch)) export default class Player extends Component { constructor(props) { super(props); this.handleToggleClick = this.handleToggleClick.bind(this); this.handleNextTrack = this.handleNextTrack.bind(this); this.handleStarTrack = this.handleStarTrack.bind(this); this.handleStarTrackClick = this.handleStarTrackClick.bind(this); this.isStarred = this.isStarred.bind(this); this.isTrackSelected = this.isTrackSelected.bind(this); this.renderInfo = this.renderInfo.bind(this); } handleToggleClick() { const {initialPlay, player, togglePlaying} = this.props; // eslint-disable-line no-shadow const {currentTrack} = player; if (currentTrack) { togglePlaying(); } else { initialPlay(); } } handleNextTrack() { if (!this.isTrackSelected()) return; const {nextTrack} = this.props; // eslint-disable-line no-shadow nextTrack(); } handleStarTrack() { const {player, starTrack} = this.props; // eslint-disable-line no-shadow const {currentTrack} = player; starTrack(currentTrack); console.log('starrr'); } handleStarTrackClick() { if (this.isStarred()) { this.handleUnstarTrack(); } else { this.handleStarTrack(); } } handleUnstarTrack() { const {player, unstarTrack} = this.props; // eslint-disable-line no-shadow const {currentTrack} = player; unstarTrack(currentTrack); console.log('unstarrr'); } isStarred() { const {player, starred} = this.props; const {currentTrack} = player; if (!this.isTrackSelected()) return false; const {starredTracks} = starred; return isTrackStarred(currentTrack, starredTracks); } isTrackSelected() { const {player} = this.props; const {currentTrack} = player; return currentTrack ? true : false; } renderInfo() { const {player} = this.props; const {currentTrack} = player; if (!currentTrack) return ''; const { data: { title, artist: { name: artistName, url: artistUrl }, track: { url: trackUrl } } } = currentTrack; return ( <h3 className={styles['info__text']}> <a className={styles['info__text__title']} href={trackUrl} target="_blank">{title}</a> <span className={styles['info__text__divider']}></span> <a className={styles['info__text__artist']} href={artistUrl} target="_blank">{artistName}</a> </h3> ); } render() { const {player} = this.props; const { playing: isPlaying } = player; const isStarred = this.isStarred(); console.log('is starred?', isStarred); const trackIsSelected = this.isTrackSelected(); const rootClasses = classNames( styles['Player'], { [styles['state--empty']]: !trackIsSelected, [styles['state--playing']]: isPlaying, [styles['state--starred']]: isStarred, [styles['state--disabled']]: !trackIsSelected } ); return ( <div className={rootClasses}> <div className={styles['info']}> {this.renderInfo()} </div> <div className={styles['controls']}> <div className={[styles['btn'], styles['btn--star']].join(' ')} onClick={this.handleStarTrackClick}> <div className={styles['btnIcon']}></div> </div> <div className={[styles['btn'], styles['btn--share']].join(' ')}> <div className={styles['btnIcon']}></div> </div> <div className={[styles['btn'], styles['btn--toggle']].join(' ')} onClick={this.handleToggleClick}> <div className={styles['btnIcon']}></div> </div> <div className={[styles['btn'], styles['btn--skip']].join(' ')} onClick={this.handleNextTrack}> <div className={styles['btnIcon']}></div> </div> </div> </div> ); } } Player.propTypes = { initialPlay: React.PropTypes.func, nextTrack: React.PropTypes.func, player: React.PropTypes.object, starred: React.PropTypes.object, starTrack: React.PropTypes.func, unstarTrack: React.PropTypes.func, togglePlaying: React.PropTypes.func, };
simonghales/mapping
src/components/Player/Player.js
JavaScript
mit
4,755
/** * @fileoverview Rule to enforce grouped require statements for Node.JS * @author Raphael Pigulla * @deprecated in ESLint v7.0.0 */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { deprecated: true, replacedBy: [], type: "suggestion", docs: { description: "disallow `require` calls to be mixed with regular variable declarations", recommended: false, url: "https://eslint.org/docs/rules/no-mixed-requires" }, schema: [ { oneOf: [ { type: "boolean" }, { type: "object", properties: { grouping: { type: "boolean" }, allowCall: { type: "boolean" } }, additionalProperties: false } ] } ], messages: { noMixRequire: "Do not mix 'require' and other declarations.", noMixCoreModuleFileComputed: "Do not mix core, module, file and computed requires." } }, create(context) { const options = context.options[0]; let grouping = false, allowCall = false; if (typeof options === "object") { grouping = options.grouping; allowCall = options.allowCall; } else { grouping = !!options; } /** * Returns the list of built-in modules. * @returns {string[]} An array of built-in Node.js modules. */ function getBuiltinModules() { /* * This list is generated using: * `require("repl")._builtinLibs.concat('repl').sort()` * This particular list is as per nodejs v0.12.2 and iojs v0.7.1 */ return [ "assert", "buffer", "child_process", "cluster", "crypto", "dgram", "dns", "domain", "events", "fs", "http", "https", "net", "os", "path", "punycode", "querystring", "readline", "repl", "smalloc", "stream", "string_decoder", "tls", "tty", "url", "util", "v8", "vm", "zlib" ]; } const BUILTIN_MODULES = getBuiltinModules(); const DECL_REQUIRE = "require", DECL_UNINITIALIZED = "uninitialized", DECL_OTHER = "other"; const REQ_CORE = "core", REQ_FILE = "file", REQ_MODULE = "module", REQ_COMPUTED = "computed"; /** * Determines the type of a declaration statement. * @param {ASTNode} initExpression The init node of the VariableDeclarator. * @returns {string} The type of declaration represented by the expression. */ function getDeclarationType(initExpression) { if (!initExpression) { // "var x;" return DECL_UNINITIALIZED; } if (initExpression.type === "CallExpression" && initExpression.callee.type === "Identifier" && initExpression.callee.name === "require" ) { // "var x = require('util');" return DECL_REQUIRE; } if (allowCall && initExpression.type === "CallExpression" && initExpression.callee.type === "CallExpression" ) { // "var x = require('diagnose')('sub-module');" return getDeclarationType(initExpression.callee); } if (initExpression.type === "MemberExpression") { // "var x = require('glob').Glob;" return getDeclarationType(initExpression.object); } // "var x = 42;" return DECL_OTHER; } /** * Determines the type of module that is loaded via require. * @param {ASTNode} initExpression The init node of the VariableDeclarator. * @returns {string} The module type. */ function inferModuleType(initExpression) { if (initExpression.type === "MemberExpression") { // "var x = require('glob').Glob;" return inferModuleType(initExpression.object); } if (initExpression.arguments.length === 0) { // "var x = require();" return REQ_COMPUTED; } const arg = initExpression.arguments[0]; if (arg.type !== "Literal" || typeof arg.value !== "string") { // "var x = require(42);" return REQ_COMPUTED; } if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { // "var fs = require('fs');" return REQ_CORE; } if (/^\.{0,2}\//u.test(arg.value)) { // "var utils = require('./utils');" return REQ_FILE; } // "var async = require('async');" return REQ_MODULE; } /** * Check if the list of variable declarations is mixed, i.e. whether it * contains both require and other declarations. * @param {ASTNode} declarations The list of VariableDeclarators. * @returns {boolean} True if the declarations are mixed, false if not. */ function isMixed(declarations) { const contains = {}; declarations.forEach(declaration => { const type = getDeclarationType(declaration.init); contains[type] = true; }); return !!( contains[DECL_REQUIRE] && (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER]) ); } /** * Check if all require declarations in the given list are of the same * type. * @param {ASTNode} declarations The list of VariableDeclarators. * @returns {boolean} True if the declarations are grouped, false if not. */ function isGrouped(declarations) { const found = {}; declarations.forEach(declaration => { if (getDeclarationType(declaration.init) === DECL_REQUIRE) { found[inferModuleType(declaration.init)] = true; } }); return Object.keys(found).length <= 1; } return { VariableDeclaration(node) { if (isMixed(node.declarations)) { context.report({ node, messageId: "noMixRequire" }); } else if (grouping && !isGrouped(node.declarations)) { context.report({ node, messageId: "noMixCoreModuleFileComputed" }); } } }; } };
platinumazure/eslint
lib/rules/no-mixed-requires.js
JavaScript
mit
7,383
import IntersectionObserverPolyfill from './resources/IntersectionObserverPolyfill'; import IntersectionObserverEntryPolyfill from './resources/IntersectionObserverEntryPolyfill'; export { IntersectionObserverEntryPolyfill, IntersectionObserverPolyfill, };
wildhaber/gluebert
src/polyfills/polyfill.intersection-observer.js
JavaScript
mit
265
(function() { var bcv_parser, bcv_passage, bcv_utils, root, hasProp = {}.hasOwnProperty; root = this; bcv_parser = (function() { bcv_parser.prototype.s = ""; bcv_parser.prototype.entities = []; bcv_parser.prototype.passage = null; bcv_parser.prototype.regexps = {}; bcv_parser.prototype.options = { consecutive_combination_strategy: "combine", osis_compaction_strategy: "b", book_sequence_strategy: "ignore", invalid_sequence_strategy: "ignore", sequence_combination_strategy: "combine", punctuation_strategy: "us", invalid_passage_strategy: "ignore", non_latin_digits_strategy: "ignore", passage_existence_strategy: "bcv", zero_chapter_strategy: "error", zero_verse_strategy: "error", single_chapter_1_strategy: "chapter", book_alone_strategy: "ignore", book_range_strategy: "ignore", captive_end_digits_strategy: "delete", end_range_digits_strategy: "verse", include_apocrypha: false, ps151_strategy: "c", versification_system: "default", case_sensitive: "none" }; function bcv_parser() { var key, ref, val; this.options = {}; ref = bcv_parser.prototype.options; for (key in ref) { if (!hasProp.call(ref, key)) continue; val = ref[key]; this.options[key] = val; } this.versification_system(this.options.versification_system); } bcv_parser.prototype.parse = function(s) { var ref; this.reset(); this.s = s; s = this.replace_control_characters(s); ref = this.match_books(s), s = ref[0], this.passage.books = ref[1]; this.entities = this.match_passages(s)[0]; return this; }; bcv_parser.prototype.parse_with_context = function(s, context) { var entities, ref, ref1, ref2; this.reset(); ref = this.match_books(this.replace_control_characters(context)), context = ref[0], this.passage.books = ref[1]; ref1 = this.match_passages(context), entities = ref1[0], context = ref1[1]; this.reset(); this.s = s; s = this.replace_control_characters(s); ref2 = this.match_books(s), s = ref2[0], this.passage.books = ref2[1]; this.passage.books.push({ value: "", parsed: [], start_index: 0, type: "context", context: context }); s = "\x1f" + (this.passage.books.length - 1) + "/9\x1f" + s; this.entities = this.match_passages(s)[0]; return this; }; bcv_parser.prototype.reset = function() { this.s = ""; this.entities = []; if (this.passage) { this.passage.books = []; return this.passage.indices = {}; } else { this.passage = new bcv_passage; this.passage.options = this.options; return this.passage.translations = this.translations; } }; bcv_parser.prototype.set_options = function(options) { var key, val; for (key in options) { if (!hasProp.call(options, key)) continue; val = options[key]; if (key === "include_apocrypha" || key === "versification_system" || key === "case_sensitive") { this[key](val); } else { this.options[key] = val; } } return this; }; bcv_parser.prototype.include_apocrypha = function(arg) { var base, base1, ref, translation, verse_count; if (!((arg != null) && (arg === true || arg === false))) { return this; } this.options.include_apocrypha = arg; this.regexps.books = this.regexps.get_books(arg, this.options.case_sensitive); ref = this.translations; for (translation in ref) { if (!hasProp.call(ref, translation)) continue; if (translation === "aliases" || translation === "alternates") { continue; } if ((base = this.translations[translation]).chapters == null) { base.chapters = {}; } if ((base1 = this.translations[translation].chapters)["Ps"] == null) { base1["Ps"] = bcv_utils.shallow_clone_array(this.translations["default"].chapters["Ps"]); } if (arg === true) { if (this.translations[translation].chapters["Ps151"] != null) { verse_count = this.translations[translation].chapters["Ps151"][0]; } else { verse_count = this.translations["default"].chapters["Ps151"][0]; } this.translations[translation].chapters["Ps"][150] = verse_count; } else { if (this.translations[translation].chapters["Ps"].length === 151) { this.translations[translation].chapters["Ps"].pop(); } } } return this; }; bcv_parser.prototype.versification_system = function(system) { var base, base1, base2, book, chapter_list, ref, ref1; if (!((system != null) && (this.translations[system] != null))) { return this; } if (this.translations.alternates["default"] != null) { if (system === "default") { if (this.translations.alternates["default"].order != null) { this.translations["default"].order = bcv_utils.shallow_clone(this.translations.alternates["default"].order); } ref = this.translations.alternates["default"].chapters; for (book in ref) { if (!hasProp.call(ref, book)) continue; chapter_list = ref[book]; this.translations["default"].chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } } else { this.versification_system("default"); } } if ((base = this.translations.alternates)["default"] == null) { base["default"] = { order: null, chapters: {} }; } if (system !== "default" && (this.translations[system].order != null)) { if ((base1 = this.translations.alternates["default"]).order == null) { base1.order = bcv_utils.shallow_clone(this.translations["default"].order); } this.translations["default"].order = bcv_utils.shallow_clone(this.translations[system].order); } if (system !== "default" && (this.translations[system].chapters != null)) { ref1 = this.translations[system].chapters; for (book in ref1) { if (!hasProp.call(ref1, book)) continue; chapter_list = ref1[book]; if ((base2 = this.translations.alternates["default"].chapters)[book] == null) { base2[book] = bcv_utils.shallow_clone_array(this.translations["default"].chapters[book]); } this.translations["default"].chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } } this.options.versification_system = system; this.include_apocrypha(this.options.include_apocrypha); return this; }; bcv_parser.prototype.case_sensitive = function(arg) { if (!((arg != null) && (arg === "none" || arg === "books"))) { return this; } if (arg === this.options.case_sensitive) { return this; } this.options.case_sensitive = arg; this.regexps.books = this.regexps.get_books(this.options.include_apocrypha, arg); return this; }; bcv_parser.prototype.translation_info = function(new_translation) { var book, chapter_list, id, old_translation, out, ref, ref1, ref2; if (new_translation == null) { new_translation = "default"; } if ((new_translation != null) && (((ref = this.translations.aliases[new_translation]) != null ? ref.alias : void 0) != null)) { new_translation = this.translations.aliases[new_translation].alias; } if (!((new_translation != null) && (this.translations[new_translation] != null))) { new_translation = "default"; } old_translation = this.options.versification_system; if (new_translation !== old_translation) { this.versification_system(new_translation); } out = { alias: new_translation, books: [], chapters: {}, order: bcv_utils.shallow_clone(this.translations["default"].order) }; ref1 = this.translations["default"].chapters; for (book in ref1) { if (!hasProp.call(ref1, book)) continue; chapter_list = ref1[book]; out.chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } ref2 = out.order; for (book in ref2) { if (!hasProp.call(ref2, book)) continue; id = ref2[book]; out.books[id - 1] = book; } if (new_translation !== old_translation) { this.versification_system(old_translation); } return out; }; bcv_parser.prototype.replace_control_characters = function(s) { s = s.replace(this.regexps.control, " "); if (this.options.non_latin_digits_strategy === "replace") { s = s.replace(/[٠۰߀०০੦૦୦0౦೦൦๐໐༠၀႐០᠐᥆᧐᪀᪐᭐᮰᱀᱐꘠꣐꤀꧐꩐꯰0]/g, "0"); s = s.replace(/[١۱߁१১੧૧୧௧౧೧൧๑໑༡၁႑១᠑᥇᧑᪁᪑᭑᮱᱁᱑꘡꣑꤁꧑꩑꯱1]/g, "1"); s = s.replace(/[٢۲߂२২੨૨୨௨౨೨൨๒໒༢၂႒២᠒᥈᧒᪂᪒᭒᮲᱂᱒꘢꣒꤂꧒꩒꯲2]/g, "2"); s = s.replace(/[٣۳߃३৩੩૩୩௩౩೩൩๓໓༣၃႓៣᠓᥉᧓᪃᪓᭓᮳᱃᱓꘣꣓꤃꧓꩓꯳3]/g, "3"); s = s.replace(/[٤۴߄४৪੪૪୪௪౪೪൪๔໔༤၄႔៤᠔᥊᧔᪄᪔᭔᮴᱄᱔꘤꣔꤄꧔꩔꯴4]/g, "4"); s = s.replace(/[٥۵߅५৫੫૫୫௫౫೫൫๕໕༥၅႕៥᠕᥋᧕᪅᪕᭕᮵᱅᱕꘥꣕꤅꧕꩕꯵5]/g, "5"); s = s.replace(/[٦۶߆६৬੬૬୬௬౬೬൬๖໖༦၆႖៦᠖᥌᧖᪆᪖᭖᮶᱆᱖꘦꣖꤆꧖꩖꯶6]/g, "6"); s = s.replace(/[٧۷߇७৭੭૭୭௭౭೭൭๗໗༧၇႗៧᠗᥍᧗᪇᪗᭗᮷᱇᱗꘧꣗꤇꧗꩗꯷7]/g, "7"); s = s.replace(/[٨۸߈८৮੮૮୮௮౮೮൮๘໘༨၈႘៨᠘᥎᧘᪈᪘᭘᮸᱈᱘꘨꣘꤈꧘꩘꯸8]/g, "8"); s = s.replace(/[٩۹߉९৯੯૯୯௯౯೯൯๙໙༩၉႙៩᠙᥏᧙᪉᪙᭙᮹᱉᱙꘩꣙꤉꧙꩙꯹9]/g, "9"); } return s; }; bcv_parser.prototype.match_books = function(s) { var book, books, has_replacement, k, len, ref; books = []; ref = this.regexps.books; for (k = 0, len = ref.length; k < len; k++) { book = ref[k]; has_replacement = false; s = s.replace(book.regexp, function(full, prev, bk) { var extra; has_replacement = true; books.push({ value: bk, parsed: book.osis, type: "book" }); extra = book.extra != null ? "/" + book.extra : ""; return prev + "\x1f" + (books.length - 1) + extra + "\x1f"; }); if (has_replacement === true && /^[\s\x1f\d:.,;\-\u2013\u2014]+$/.test(s)) { break; } } s = s.replace(this.regexps.translations, function(match) { books.push({ value: match, parsed: match.toLowerCase(), type: "translation" }); return "\x1e" + (books.length - 1) + "\x1e"; }); return [s, this.get_book_indices(books, s)]; }; bcv_parser.prototype.get_book_indices = function(books, s) { var add_index, match, re; add_index = 0; re = /([\x1f\x1e])(\d+)(?:\/\d+)?\1/g; while (match = re.exec(s)) { books[match[2]].start_index = match.index + add_index; add_index += books[match[2]].value.length - match[0].length; } return books; }; bcv_parser.prototype.match_passages = function(s) { var accum, book_id, entities, full, match, next_char, original_part_length, part, passage, post_context, ref, regexp_index_adjust, start_index_adjust; entities = []; post_context = {}; while (match = this.regexps.escaped_passage.exec(s)) { full = match[0], part = match[1], book_id = match[2]; original_part_length = part.length; match.index += full.length - original_part_length; if (/\s[2-9]\d\d\s*$|\s\d{4,}\s*$/.test(part)) { part = part.replace(/\s+\d+\s*$/, ""); } if (!/[\d\x1f\x1e)]$/.test(part)) { part = this.replace_match_end(part); } if (this.options.captive_end_digits_strategy === "delete") { next_char = match.index + part.length; if (s.length > next_char && /^\w/.test(s.substr(next_char, 1))) { part = part.replace(/[\s*]+\d+$/, ""); } part = part.replace(/(\x1e[)\]]?)[\s*]*\d+$/, "$1"); } part = part.replace(/[A-Z]+/g, function(capitals) { return capitals.toLowerCase(); }); start_index_adjust = part.substr(0, 1) === "\x1f" ? 0 : part.split("\x1f")[0].length; passage = { value: grammar.parse(part, { punctuation_strategy: this.options.punctuation_strategy }), type: "base", start_index: this.passage.books[book_id].start_index - start_index_adjust, match: part }; if (this.options.book_alone_strategy === "full" && this.options.book_range_strategy === "include" && passage.value[0].type === "b" && (passage.value.length === 1 || (passage.value.length > 1 && passage.value[1].type === "translation_sequence")) && start_index_adjust === 0 && (this.passage.books[book_id].parsed.length === 1 || (this.passage.books[book_id].parsed.length > 1 && this.passage.books[book_id].parsed[1].type === "translation")) && /^[234]/.test(this.passage.books[book_id].parsed[0])) { this.create_book_range(s, passage, book_id); } ref = this.passage.handle_obj(passage), accum = ref[0], post_context = ref[1]; entities = entities.concat(accum); regexp_index_adjust = this.adjust_regexp_end(accum, original_part_length, part.length); if (regexp_index_adjust > 0) { this.regexps.escaped_passage.lastIndex -= regexp_index_adjust; } } return [entities, post_context]; }; bcv_parser.prototype.adjust_regexp_end = function(accum, old_length, new_length) { var regexp_index_adjust; regexp_index_adjust = 0; if (accum.length > 0) { regexp_index_adjust = old_length - accum[accum.length - 1].indices[1] - 1; } else if (old_length !== new_length) { regexp_index_adjust = old_length - new_length; } return regexp_index_adjust; }; bcv_parser.prototype.replace_match_end = function(part) { var match, remove; remove = part.length; while (match = this.regexps.match_end_split.exec(part)) { remove = match.index + match[0].length; } if (remove < part.length) { part = part.substr(0, remove); } return part; }; bcv_parser.prototype.create_book_range = function(s, passage, book_id) { var cases, i, k, limit, prev, range_regexp, ref; cases = [bcv_parser.prototype.regexps.first, bcv_parser.prototype.regexps.second, bcv_parser.prototype.regexps.third]; limit = parseInt(this.passage.books[book_id].parsed[0].substr(0, 1), 10); for (i = k = 1, ref = limit; 1 <= ref ? k < ref : k > ref; i = 1 <= ref ? ++k : --k) { range_regexp = i === limit - 1 ? bcv_parser.prototype.regexps.range_and : bcv_parser.prototype.regexps.range_only; prev = s.match(RegExp("(?:^|\\W)(" + cases[i - 1] + "\\s*" + range_regexp + "\\s*)\\x1f" + book_id + "\\x1f", "i")); if (prev != null) { return this.add_book_range_object(passage, prev, i); } } return false; }; bcv_parser.prototype.add_book_range_object = function(passage, prev, start_book_number) { var i, k, length, ref, ref1, results; length = prev[1].length; passage.value[0] = { type: "b_range_pre", value: [ { type: "b_pre", value: start_book_number.toString(), indices: [prev.index, prev.index + length] }, passage.value[0] ], indices: [0, passage.value[0].indices[1] + length] }; passage.value[0].value[1].indices[0] += length; passage.value[0].value[1].indices[1] += length; passage.start_index -= length; passage.match = prev[1] + passage.match; if (passage.value.length === 1) { return; } results = []; for (i = k = 1, ref = passage.value.length; 1 <= ref ? k < ref : k > ref; i = 1 <= ref ? ++k : --k) { if (passage.value[i].value == null) { continue; } if (((ref1 = passage.value[i].value[0]) != null ? ref1.indices : void 0) != null) { passage.value[i].value[0].indices[0] += length; passage.value[i].value[0].indices[1] += length; } passage.value[i].indices[0] += length; results.push(passage.value[i].indices[1] += length); } return results; }; bcv_parser.prototype.osis = function() { var k, len, osis, out, ref; out = []; ref = this.parsed_entities(); for (k = 0, len = ref.length; k < len; k++) { osis = ref[k]; if (osis.osis.length > 0) { out.push(osis.osis); } } return out.join(","); }; bcv_parser.prototype.osis_and_translations = function() { var k, len, osis, out, ref; out = []; ref = this.parsed_entities(); for (k = 0, len = ref.length; k < len; k++) { osis = ref[k]; if (osis.osis.length > 0) { out.push([osis.osis, osis.translations.join(",")]); } } return out; }; bcv_parser.prototype.osis_and_indices = function() { var k, len, osis, out, ref; out = []; ref = this.parsed_entities(); for (k = 0, len = ref.length; k < len; k++) { osis = ref[k]; if (osis.osis.length > 0) { out.push({ osis: osis.osis, translations: osis.translations, indices: osis.indices }); } } return out; }; bcv_parser.prototype.parsed_entities = function() { var entity, entity_id, i, k, l, last_i, len, len1, length, m, n, osis, osises, out, passage, ref, ref1, ref2, ref3, strings, translation, translation_alias, translation_osis, translations; out = []; for (entity_id = k = 0, ref = this.entities.length; 0 <= ref ? k < ref : k > ref; entity_id = 0 <= ref ? ++k : --k) { entity = this.entities[entity_id]; if (entity.type && entity.type === "translation_sequence" && out.length > 0 && entity_id === out[out.length - 1].entity_id + 1) { out[out.length - 1].indices[1] = entity.absolute_indices[1]; } if (entity.passages == null) { continue; } if ((entity.type === "b" && this.options.book_alone_strategy === "ignore") || (entity.type === "b_range" && this.options.book_range_strategy === "ignore") || entity.type === "context") { continue; } translations = []; translation_alias = null; if (entity.passages[0].translations != null) { ref1 = entity.passages[0].translations; for (l = 0, len = ref1.length; l < len; l++) { translation = ref1[l]; translation_osis = ((ref2 = translation.osis) != null ? ref2.length : void 0) > 0 ? translation.osis : ""; if (translation_alias == null) { translation_alias = translation.alias; } translations.push(translation_osis); } } else { translations = [""]; translation_alias = "default"; } osises = []; length = entity.passages.length; for (i = m = 0, ref3 = length; 0 <= ref3 ? m < ref3 : m > ref3; i = 0 <= ref3 ? ++m : --m) { passage = entity.passages[i]; if (passage.type == null) { passage.type = entity.type; } if (passage.valid.valid === false) { if (this.options.invalid_sequence_strategy === "ignore" && entity.type === "sequence") { this.snap_sequence("ignore", entity, osises, i, length); } if (this.options.invalid_passage_strategy === "ignore") { continue; } } if ((passage.type === "b" || passage.type === "b_range") && this.options.book_sequence_strategy === "ignore" && entity.type === "sequence") { this.snap_sequence("book", entity, osises, i, length); continue; } if ((passage.type === "b_range_start" || passage.type === "range_end_b") && this.options.book_range_strategy === "ignore") { this.snap_range(entity, i); } if (passage.absolute_indices == null) { passage.absolute_indices = entity.absolute_indices; } osises.push({ osis: passage.valid.valid ? this.to_osis(passage.start, passage.end, translation_alias) : "", type: passage.type, indices: passage.absolute_indices, translations: translations, start: passage.start, end: passage.end, enclosed_indices: passage.enclosed_absolute_indices, entity_id: entity_id, entities: [passage] }); } if (osises.length === 0) { continue; } if (osises.length > 1 && this.options.consecutive_combination_strategy === "combine") { osises = this.combine_consecutive_passages(osises, translation_alias); } if (this.options.sequence_combination_strategy === "separate") { out = out.concat(osises); } else { strings = []; last_i = osises.length - 1; if ((osises[last_i].enclosed_indices != null) && osises[last_i].enclosed_indices[1] >= 0) { entity.absolute_indices[1] = osises[last_i].enclosed_indices[1]; } for (n = 0, len1 = osises.length; n < len1; n++) { osis = osises[n]; if (osis.osis.length > 0) { strings.push(osis.osis); } } out.push({ osis: strings.join(","), indices: entity.absolute_indices, translations: translations, entity_id: entity_id, entities: osises }); } } return out; }; bcv_parser.prototype.to_osis = function(start, end, translation) { var osis, out; if ((end.c == null) && (end.v == null) && start.b === end.b && (start.c == null) && (start.v == null) && this.options.book_alone_strategy === "first_chapter") { end.c = 1; } osis = { start: "", end: "" }; if (start.c == null) { start.c = 1; } if (start.v == null) { start.v = 1; } if (end.c == null) { if (this.options.passage_existence_strategy.indexOf("c") >= 0 || ((this.passage.translations[translation].chapters[end.b] != null) && this.passage.translations[translation].chapters[end.b].length === 1)) { end.c = this.passage.translations[translation].chapters[end.b].length; } else { end.c = 999; } } if (end.v == null) { if ((this.passage.translations[translation].chapters[end.b][end.c - 1] != null) && this.options.passage_existence_strategy.indexOf("v") >= 0) { end.v = this.passage.translations[translation].chapters[end.b][end.c - 1]; } else { end.v = 999; } } if (this.options.include_apocrypha && this.options.ps151_strategy === "b" && ((start.c === 151 && start.b === "Ps") || (end.c === 151 && end.b === "Ps"))) { this.fix_ps151(start, end, translation); } if (this.options.osis_compaction_strategy === "b" && start.c === 1 && start.v === 1 && ((end.c === 999 && end.v === 999) || (end.c === this.passage.translations[translation].chapters[end.b].length && this.options.passage_existence_strategy.indexOf("c") >= 0 && (end.v === 999 || (end.v === this.passage.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0))))) { osis.start = start.b; osis.end = end.b; } else if (this.options.osis_compaction_strategy.length <= 2 && start.v === 1 && (end.v === 999 || (end.v === this.passage.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0))) { osis.start = start.b + "." + start.c.toString(); osis.end = end.b + "." + end.c.toString(); } else { osis.start = start.b + "." + start.c.toString() + "." + start.v.toString(); osis.end = end.b + "." + end.c.toString() + "." + end.v.toString(); } if (osis.start === osis.end) { out = osis.start; } else { out = osis.start + "-" + osis.end; } if (start.extra != null) { out = start.extra + "," + out; } if (end.extra != null) { out += "," + end.extra; } return out; }; bcv_parser.prototype.fix_ps151 = function(start, end, translation) { var ref; if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters["Ps151"] : void 0) == null)) { this.passage.promote_book_to_translation("Ps151", translation); } if (start.c === 151 && start.b === "Ps") { if (end.c === 151 && end.b === "Ps") { start.b = "Ps151"; start.c = 1; end.b = "Ps151"; return end.c = 1; } else { start.extra = this.to_osis({ b: "Ps151", c: 1, v: start.v }, { b: "Ps151", c: 1, v: this.passage.translations[translation].chapters["Ps151"][0] }, translation); start.b = "Prov"; start.c = 1; return start.v = 1; } } else { end.extra = this.to_osis({ b: "Ps151", c: 1, v: 1 }, { b: "Ps151", c: 1, v: end.v }, translation); end.c = 150; return end.v = this.passage.translations[translation].chapters["Ps"][149]; } }; bcv_parser.prototype.combine_consecutive_passages = function(osises, translation) { var enclosed_sequence_start, has_enclosed, i, is_enclosed_last, k, last_i, osis, out, prev, prev_i, ref; out = []; prev = {}; last_i = osises.length - 1; enclosed_sequence_start = -1; has_enclosed = false; for (i = k = 0, ref = last_i; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) { osis = osises[i]; if (osis.osis.length > 0) { prev_i = out.length - 1; is_enclosed_last = false; if (osis.enclosed_indices[0] !== enclosed_sequence_start) { enclosed_sequence_start = osis.enclosed_indices[0]; } if (enclosed_sequence_start >= 0 && (i === last_i || osises[i + 1].enclosed_indices[0] !== osis.enclosed_indices[0])) { is_enclosed_last = true; has_enclosed = true; } if (this.is_verse_consecutive(prev, osis.start, translation)) { out[prev_i].end = osis.end; out[prev_i].is_enclosed_last = is_enclosed_last; out[prev_i].indices[1] = osis.indices[1]; out[prev_i].enclosed_indices[1] = osis.enclosed_indices[1]; out[prev_i].osis = this.to_osis(out[prev_i].start, osis.end, translation); } else { out.push(osis); } prev = { b: osis.end.b, c: osis.end.c, v: osis.end.v }; } else { out.push(osis); prev = {}; } } if (has_enclosed) { this.snap_enclosed_indices(out); } return out; }; bcv_parser.prototype.snap_enclosed_indices = function(osises) { var k, len, osis; for (k = 0, len = osises.length; k < len; k++) { osis = osises[k]; if (osis.is_enclosed_last != null) { if (osis.enclosed_indices[0] < 0 && osis.is_enclosed_last) { osis.indices[1] = osis.enclosed_indices[1]; } delete osis.is_enclosed_last; } } return osises; }; bcv_parser.prototype.is_verse_consecutive = function(prev, check, translation) { var translation_order; if (prev.b == null) { return false; } translation_order = this.passage.translations[translation].order != null ? this.passage.translations[translation].order : this.passage.translations["default"].order; if (prev.b === check.b) { if (prev.c === check.c) { if (prev.v === check.v - 1) { return true; } } else if (check.v === 1 && prev.c === check.c - 1) { if (prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { return true; } } } else if (check.c === 1 && check.v === 1 && translation_order[prev.b] === translation_order[check.b] - 1) { if (prev.c === this.passage.translations[translation].chapters[prev.b].length && prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { return true; } } return false; }; bcv_parser.prototype.snap_range = function(entity, passage_i) { var entity_i, key, pluck, ref, source_entity, target_entity, temp, type; if (entity.type === "b_range_start" || (entity.type === "sequence" && entity.passages[passage_i].type === "b_range_start")) { entity_i = 1; source_entity = "end"; type = "b_range_start"; } else { entity_i = 0; source_entity = "start"; type = "range_end_b"; } target_entity = source_entity === "end" ? "start" : "end"; ref = entity.passages[passage_i][target_entity]; for (key in ref) { if (!hasProp.call(ref, key)) continue; entity.passages[passage_i][target_entity][key] = entity.passages[passage_i][source_entity][key]; } if (entity.type === "sequence") { if (passage_i >= entity.value.length) { passage_i = entity.value.length - 1; } pluck = this.passage.pluck(type, entity.value[passage_i]); if (pluck != null) { temp = this.snap_range(pluck, 0); if (passage_i === 0) { entity.absolute_indices[0] = temp.absolute_indices[0]; } else { entity.absolute_indices[1] = temp.absolute_indices[1]; } } } else { entity.original_type = entity.type; entity.type = entity.value[entity_i].type; entity.absolute_indices = [entity.value[entity_i].absolute_indices[0], entity.value[entity_i].absolute_indices[1]]; } return entity; }; bcv_parser.prototype.snap_sequence = function(type, entity, osises, i, length) { var passage; passage = entity.passages[i]; if (passage.absolute_indices[0] === entity.absolute_indices[0] && i < length - 1 && this.get_snap_sequence_i(entity.passages, i, length) !== i) { entity.absolute_indices[0] = entity.passages[i + 1].absolute_indices[0]; this.remove_absolute_indices(entity.passages, i + 1); } else if (passage.absolute_indices[1] === entity.absolute_indices[1] && i > 0) { entity.absolute_indices[1] = osises.length > 0 ? osises[osises.length - 1].indices[1] : entity.passages[i - 1].absolute_indices[1]; } else if (type === "book" && i < length - 1 && !this.starts_with_book(entity.passages[i + 1])) { entity.passages[i + 1].absolute_indices[0] = passage.absolute_indices[0]; } return entity; }; bcv_parser.prototype.get_snap_sequence_i = function(passages, i, length) { var j, k, ref, ref1; for (j = k = ref = i + 1, ref1 = length; ref <= ref1 ? k < ref1 : k > ref1; j = ref <= ref1 ? ++k : --k) { if (this.starts_with_book(passages[j])) { return j; } if (passages[j].valid.valid) { return i; } } return i; }; bcv_parser.prototype.starts_with_book = function(passage) { if (passage.type.substr(0, 1) === "b") { return true; } if ((passage.type === "range" || passage.type === "ff") && passage.start.type.substr(0, 1) === "b") { return true; } return false; }; bcv_parser.prototype.remove_absolute_indices = function(passages, i) { var end, k, len, passage, ref, ref1, start; if (passages[i].enclosed_absolute_indices[0] < 0) { return false; } ref = passages[i].enclosed_absolute_indices, start = ref[0], end = ref[1]; ref1 = passages.slice(i); for (k = 0, len = ref1.length; k < len; k++) { passage = ref1[k]; if (passage.enclosed_absolute_indices[0] === start && passage.enclosed_absolute_indices[1] === end) { passage.enclosed_absolute_indices = [-1, -1]; } else { break; } } return true; }; return bcv_parser; })(); root.bcv_parser = bcv_parser; bcv_passage = (function() { function bcv_passage() {} bcv_passage.prototype.books = []; bcv_passage.prototype.indices = {}; bcv_passage.prototype.options = {}; bcv_passage.prototype.translations = {}; bcv_passage.prototype.handle_array = function(passages, accum, context) { var k, len, passage, ref; if (accum == null) { accum = []; } if (context == null) { context = {}; } for (k = 0, len = passages.length; k < len; k++) { passage = passages[k]; if (passage == null) { continue; } if (passage.type === "stop") { break; } ref = this.handle_obj(passage, accum, context), accum = ref[0], context = ref[1]; } return [accum, context]; }; bcv_passage.prototype.handle_obj = function(passage, accum, context) { if ((passage.type != null) && (this[passage.type] != null)) { return this[passage.type](passage, accum, context); } else { return [accum, context]; } }; bcv_passage.prototype.b = function(passage, accum, context) { var alternates, b, k, len, obj, ref, valid; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; alternates = []; ref = this.books[passage.value].parsed; for (k = 0, len = ref.length; k < len; k++) { b = ref[k]; valid = this.validate_ref(passage.start_context.translations, { b: b }); obj = { start: { b: b }, end: { b: b }, valid: valid }; if (passage.passages.length === 0 && valid.valid) { passage.passages.push(obj); } else { alternates.push(obj); } } if (passage.passages.length === 0) { passage.passages.push(alternates.shift()); } if (alternates.length > 0) { passage.passages[0].alternates = alternates; } if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); context = { b: passage.passages[0].start.b }; if (passage.start_context.translations != null) { context.translations = passage.start_context.translations; } return [accum, context]; }; bcv_passage.prototype.b_range = function(passage, accum, context) { return this.range(passage, accum, context); }; bcv_passage.prototype.b_range_pre = function(passage, accum, context) { var book, end, ref, ref1, start_obj; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; book = this.pluck("b", passage.value); ref = this.b(book, [], context), (ref1 = ref[0], end = ref1[0]), context = ref[1]; if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } start_obj = { b: passage.value[0].value + end.passages[0].start.b.substr(1), type: "b" }; passage.passages = [ { start: start_obj, end: end.passages[0].end, valid: end.passages[0].valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.b_range_start = function(passage, accum, context) { return this.range(passage, accum, context); }; bcv_passage.prototype.base = function(passage, accum, context) { this.indices = this.calculate_indices(passage.match, passage.start_index); return this.handle_array(passage.value, accum, context); }; bcv_passage.prototype.bc = function(passage, accum, context) { var alternates, b, c, context_key, k, len, obj, ref, ref1, valid; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; this.reset_context(context, ["b", "c", "v"]); c = this.pluck("c", passage.value).value; alternates = []; ref = this.books[this.pluck("b", passage.value).value].parsed; for (k = 0, len = ref.length; k < len; k++) { b = ref[k]; context_key = "c"; valid = this.validate_ref(passage.start_context.translations, { b: b, c: c }); obj = { start: { b: b }, end: { b: b }, valid: valid }; if (valid.messages.start_chapter_not_exist_in_single_chapter_book || valid.messages.start_chapter_1) { obj.valid = this.validate_ref(passage.start_context.translations, { b: b, v: c }); if (valid.messages.start_chapter_not_exist_in_single_chapter_book) { obj.valid.messages.start_chapter_not_exist_in_single_chapter_book = 1; } obj.start.c = 1; obj.end.c = 1; context_key = "v"; } obj.start[context_key] = c; ref1 = this.fix_start_zeroes(obj.valid, obj.start.c, obj.start.v), obj.start.c = ref1[0], obj.start.v = ref1[1]; if (obj.start.v == null) { delete obj.start.v; } obj.end[context_key] = obj.start[context_key]; if (passage.passages.length === 0 && obj.valid.valid) { passage.passages.push(obj); } else { alternates.push(obj); } } if (passage.passages.length === 0) { passage.passages.push(alternates.shift()); } if (alternates.length > 0) { passage.passages[0].alternates = alternates; } if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); accum.push(passage); return [accum, context]; }; bcv_passage.prototype.bc_title = function(passage, accum, context) { var bc, i, k, ref, ref1, ref2, title; passage.start_context = bcv_utils.shallow_clone(context); ref = this.bc(this.pluck("bc", passage.value), [], context), (ref1 = ref[0], bc = ref1[0]), context = ref[1]; if (bc.passages[0].start.b.substr(0, 2) !== "Ps" && (bc.passages[0].alternates != null)) { for (i = k = 0, ref2 = bc.passages[0].alternates.length; 0 <= ref2 ? k < ref2 : k > ref2; i = 0 <= ref2 ? ++k : --k) { if (bc.passages[0].alternates[i].start.b.substr(0, 2) !== "Ps") { continue; } bc.passages[0] = bc.passages[0].alternates[i]; break; } } if (bc.passages[0].start.b.substr(0, 2) !== "Ps") { accum.push(bc); return [accum, context]; } this.books[this.pluck("b", bc.value).value].parsed = ["Ps"]; title = this.pluck("title", passage.value); if (title == null) { title = this.pluck("v", passage.value); } passage.value[1] = { type: "v", value: [ { type: "integer", value: 1, indices: title.indices } ], indices: title.indices }; passage.type = "bcv"; return this.bcv(passage, accum, passage.start_context); }; bcv_passage.prototype.bcv = function(passage, accum, context) { var alternates, b, bc, c, k, len, obj, ref, ref1, v, valid; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; this.reset_context(context, ["b", "c", "v"]); bc = this.pluck("bc", passage.value); c = this.pluck("c", bc.value).value; v = this.pluck("v", passage.value).value; alternates = []; ref = this.books[this.pluck("b", bc.value).value].parsed; for (k = 0, len = ref.length; k < len; k++) { b = ref[k]; valid = this.validate_ref(passage.start_context.translations, { b: b, c: c, v: v }); ref1 = this.fix_start_zeroes(valid, c, v), c = ref1[0], v = ref1[1]; obj = { start: { b: b, c: c, v: v }, end: { b: b, c: c, v: v }, valid: valid }; if (passage.passages.length === 0 && valid.valid) { passage.passages.push(obj); } else { alternates.push(obj); } } if (passage.passages.length === 0) { passage.passages.push(alternates.shift()); } if (alternates.length > 0) { passage.passages[0].alternates = alternates; } if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); accum.push(passage); return [accum, context]; }; bcv_passage.prototype.bv = function(passage, accum, context) { var b, bcv, ref, ref1, ref2, v; passage.start_context = bcv_utils.shallow_clone(context); ref = passage.value, b = ref[0], v = ref[1]; bcv = { indices: passage.indices, value: [ { type: "bc", value: [ b, { type: "c", value: [ { type: "integer", value: 1 } ] } ] }, v ] }; ref1 = this.bcv(bcv, [], context), (ref2 = ref1[0], bcv = ref2[0]), context = ref1[1]; passage.passages = bcv.passages; if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.c = function(passage, accum, context) { var c, valid; passage.start_context = bcv_utils.shallow_clone(context); c = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; valid = this.validate_ref(passage.start_context.translations, { b: context.b, c: c }); if (!valid.valid && valid.messages.start_chapter_not_exist_in_single_chapter_book) { return this.v(passage, accum, context); } c = this.fix_start_zeroes(valid, c)[0]; passage.passages = [ { start: { b: context.b, c: c }, end: { b: context.b, c: c }, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } accum.push(passage); context.c = c; this.reset_context(context, ["v"]); if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } return [accum, context]; }; bcv_passage.prototype.c_psalm = function(passage, accum, context) { var c; passage.type = "bc"; c = parseInt(this.books[passage.value].value.match(/^\d+/)[0], 10); passage.value = [ { type: "b", value: passage.value, indices: passage.indices }, { type: "c", value: [ { type: "integer", value: c, indices: passage.indices } ], indices: passage.indices } ]; return this.bc(passage, accum, context); }; bcv_passage.prototype.c_title = function(passage, accum, context) { var title; passage.start_context = bcv_utils.shallow_clone(context); if (context.b !== "Ps") { return this.c(passage.value[0], accum, context); } title = this.pluck("title", passage.value); passage.value[1] = { type: "v", value: [ { type: "integer", value: 1, indices: title.indices } ], indices: title.indices }; passage.type = "cv"; return this.cv(passage, accum, passage.start_context); }; bcv_passage.prototype.cv = function(passage, accum, context) { var c, ref, v, valid; passage.start_context = bcv_utils.shallow_clone(context); c = this.pluck("c", passage.value).value; v = this.pluck("v", passage.value).value; valid = this.validate_ref(passage.start_context.translations, { b: context.b, c: c, v: v }); ref = this.fix_start_zeroes(valid, c, v), c = ref[0], v = ref[1]; passage.passages = [ { start: { b: context.b, c: c, v: v }, end: { b: context.b, c: c, v: v }, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } accum.push(passage); context.c = c; context.v = v; if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } return [accum, context]; }; bcv_passage.prototype.cb_range = function(passage, accum, context) { var b, end_c, ref, start_c; passage.type = "range"; ref = passage.value, b = ref[0], start_c = ref[1], end_c = ref[2]; passage.value = [ { type: "bc", value: [b, start_c], indices: passage.indices }, end_c ]; end_c.indices[1] = passage.indices[1]; return this.range(passage, accum, context); }; bcv_passage.prototype.context = function(passage, accum, context) { var key, ref; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; ref = this.books[passage.value].context; for (key in ref) { if (!hasProp.call(ref, key)) continue; context[key] = this.books[passage.value].context[key]; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.cv_psalm = function(passage, accum, context) { var bc, c_psalm, ref, v; passage.start_context = bcv_utils.shallow_clone(context); passage.type = "bcv"; ref = passage.value, c_psalm = ref[0], v = ref[1]; bc = this.c_psalm(c_psalm, [], passage.start_context)[0][0]; passage.value = [bc, v]; return this.bcv(passage, accum, context); }; bcv_passage.prototype.ff = function(passage, accum, context) { var ref, ref1; passage.start_context = bcv_utils.shallow_clone(context); passage.value.push({ type: "integer", indices: passage.indices, value: 999 }); ref = this.range(passage, [], passage.start_context), (ref1 = ref[0], passage = ref1[0]), context = ref[1]; passage.value[0].indices = passage.value[1].indices; passage.value[0].absolute_indices = passage.value[1].absolute_indices; passage.value.pop(); if (passage.passages[0].valid.messages.end_verse_not_exist != null) { delete passage.passages[0].valid.messages.end_verse_not_exist; } if (passage.passages[0].valid.messages.end_chapter_not_exist != null) { delete passage.passages[0].valid.messages.end_chapter_not_exist; } if (passage.passages[0].end.original_c != null) { delete passage.passages[0].end.original_c; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.integer_title = function(passage, accum, context) { passage.start_context = bcv_utils.shallow_clone(context); if (context.b !== "Ps") { return this.integer(passage.value[0], accum, context); } passage.value[0] = { type: "c", value: [passage.value[0]], indices: [passage.value[0].indices[0], passage.value[0].indices[1]] }; passage.value[1].type = "v"; passage.value[1].original_type = "title"; passage.value[1].value = [ { type: "integer", value: 1, indices: passage.value[1].value.indices } ]; passage.type = "cv"; return this.cv(passage, accum, passage.start_context); }; bcv_passage.prototype.integer = function(passage, accum, context) { if (context.v != null) { return this.v(passage, accum, context); } return this.c(passage, accum, context); }; bcv_passage.prototype.next_v = function(passage, accum, context) { var prev_integer, psg, ref, ref1, ref2, ref3; passage.start_context = bcv_utils.shallow_clone(context); prev_integer = this.pluck_last_recursively("integer", passage.value); if (prev_integer == null) { prev_integer = { value: 1 }; } passage.value.push({ type: "integer", indices: passage.indices, value: prev_integer.value + 1 }); ref = this.range(passage, [], passage.start_context), (ref1 = ref[0], psg = ref1[0]), context = ref[1]; if ((psg.passages[0].valid.messages.end_verse_not_exist != null) && (psg.passages[0].valid.messages.start_verse_not_exist == null) && (psg.passages[0].valid.messages.start_chapter_not_exist == null) && (context.c != null)) { passage.value.pop(); passage.value.push({ type: "cv", indices: passage.indices, value: [ { type: "c", value: [ { type: "integer", value: context.c + 1, indices: passage.indices } ], indices: passage.indices }, { type: "v", value: [ { type: "integer", value: 1, indices: passage.indices } ], indices: passage.indices } ] }); ref2 = this.range(passage, [], passage.start_context), (ref3 = ref2[0], psg = ref3[0]), context = ref2[1]; } psg.value[0].indices = psg.value[1].indices; psg.value[0].absolute_indices = psg.value[1].absolute_indices; psg.value.pop(); if (psg.passages[0].valid.messages.end_verse_not_exist != null) { delete psg.passages[0].valid.messages.end_verse_not_exist; } if (psg.passages[0].valid.messages.end_chapter_not_exist != null) { delete psg.passages[0].valid.messages.end_chapter_not_exist; } if (psg.passages[0].end.original_c != null) { delete psg.passages[0].end.original_c; } accum.push(psg); return [accum, context]; }; bcv_passage.prototype.sequence = function(passage, accum, context) { var k, l, len, len1, obj, psg, ref, ref1, ref2, ref3, sub_psg; passage.start_context = bcv_utils.shallow_clone(context); passage.passages = []; ref = passage.value; for (k = 0, len = ref.length; k < len; k++) { obj = ref[k]; ref1 = this.handle_array(obj, [], context), (ref2 = ref1[0], psg = ref2[0]), context = ref1[1]; ref3 = psg.passages; for (l = 0, len1 = ref3.length; l < len1; l++) { sub_psg = ref3[l]; if (sub_psg.type == null) { sub_psg.type = psg.type; } if (sub_psg.absolute_indices == null) { sub_psg.absolute_indices = psg.absolute_indices; } if (psg.start_context.translations != null) { sub_psg.translations = psg.start_context.translations; } sub_psg.enclosed_absolute_indices = psg.type === "sequence_post_enclosed" ? psg.absolute_indices : [-1, -1]; passage.passages.push(sub_psg); } } if (passage.absolute_indices == null) { if (passage.passages.length > 0 && passage.type === "sequence") { passage.absolute_indices = [passage.passages[0].absolute_indices[0], passage.passages[passage.passages.length - 1].absolute_indices[1]]; } else { passage.absolute_indices = this.get_absolute_indices(passage.indices); } } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.sequence_post_enclosed = function(passage, accum, context) { return this.sequence(passage, accum, context); }; bcv_passage.prototype.v = function(passage, accum, context) { var c, no_c, ref, v, valid; v = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; passage.start_context = bcv_utils.shallow_clone(context); c = context.c != null ? context.c : 1; valid = this.validate_ref(passage.start_context.translations, { b: context.b, c: c, v: v }); ref = this.fix_start_zeroes(valid, 0, v), no_c = ref[0], v = ref[1]; passage.passages = [ { start: { b: context.b, c: c, v: v }, end: { b: context.b, c: c, v: v }, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); context.v = v; return [accum, context]; }; bcv_passage.prototype.range = function(passage, accum, context) { var end, end_obj, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, return_now, return_value, start, start_obj, valid; passage.start_context = bcv_utils.shallow_clone(context); ref = passage.value, start = ref[0], end = ref[1]; ref1 = this.handle_obj(start, [], context), (ref2 = ref1[0], start = ref2[0]), context = ref1[1]; if (end.type === "v" && ((start.type === "bc" && !((ref3 = start.passages) != null ? (ref4 = ref3[0]) != null ? (ref5 = ref4.valid) != null ? (ref6 = ref5.messages) != null ? ref6.start_chapter_not_exist_in_single_chapter_book : void 0 : void 0 : void 0 : void 0)) || start.type === "c") && this.options.end_range_digits_strategy === "verse") { passage.value[0] = start; return this.range_change_integer_end(passage, accum); } ref7 = this.handle_obj(end, [], context), (ref8 = ref7[0], end = ref8[0]), context = ref7[1]; passage.value = [start, end]; passage.indices = [start.indices[0], end.indices[1]]; delete passage.absolute_indices; start_obj = { b: start.passages[0].start.b, c: start.passages[0].start.c, v: start.passages[0].start.v, type: start.type }; end_obj = { b: end.passages[0].end.b, c: end.passages[0].end.c, v: end.passages[0].end.v, type: end.type }; if (end.passages[0].valid.messages.start_chapter_is_zero) { end_obj.c = 0; } if (end.passages[0].valid.messages.start_verse_is_zero) { end_obj.v = 0; } valid = this.validate_ref(passage.start_context.translations, start_obj, end_obj); if (valid.valid) { ref9 = this.range_handle_valid(valid, passage, start, start_obj, end, end_obj, accum), return_now = ref9[0], return_value = ref9[1]; if (return_now) { return return_value; } } else { return this.range_handle_invalid(valid, passage, start, start_obj, end, end_obj, accum); } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } passage.passages = [ { start: start_obj, end: end_obj, valid: valid } ]; if (passage.start_context.translations != null) { passage.passages[0].translations = passage.start_context.translations; } if (start_obj.type === "b") { if (end_obj.type === "b") { passage.type = "b_range"; } else { passage.type = "b_range_start"; } } else if (end_obj.type === "b") { passage.type = "range_end_b"; } accum.push(passage); return [accum, context]; }; bcv_passage.prototype.range_change_end = function(passage, accum, new_end) { var end, new_obj, ref, start; ref = passage.value, start = ref[0], end = ref[1]; if (end.type === "integer") { end.original_value = end.value; end.value = new_end; } else if (end.type === "v") { new_obj = this.pluck("integer", end.value); new_obj.original_value = new_obj.value; new_obj.value = new_end; } else if (end.type === "cv") { new_obj = this.pluck("c", end.value); new_obj.original_value = new_obj.value; new_obj.value = new_end; } return this.handle_obj(passage, accum, passage.start_context); }; bcv_passage.prototype.range_change_integer_end = function(passage, accum) { var end, ref, start; ref = passage.value, start = ref[0], end = ref[1]; if (passage.original_type == null) { passage.original_type = passage.type; } if (passage.original_value == null) { passage.original_value = [start, end]; } passage.type = start.type === "integer" ? "cv" : start.type + "v"; if (start.type === "integer") { passage.value[0] = { type: "c", value: [start], indices: start.indices }; } if (end.type === "integer") { passage.value[1] = { type: "v", value: [end], indices: end.indices }; } return this.handle_obj(passage, accum, passage.start_context); }; bcv_passage.prototype.range_check_new_end = function(translations, start_obj, end_obj, valid) { var new_end, new_valid, obj_to_validate, type; new_end = 0; type = null; if (valid.messages.end_chapter_before_start) { type = "c"; } else if (valid.messages.end_verse_before_start) { type = "v"; } if (type != null) { new_end = this.range_get_new_end_value(start_obj, end_obj, valid, type); } if (new_end > 0) { obj_to_validate = { b: end_obj.b, c: end_obj.c, v: end_obj.v }; obj_to_validate[type] = new_end; new_valid = this.validate_ref(translations, obj_to_validate); if (!new_valid.valid) { new_end = 0; } } return new_end; }; bcv_passage.prototype.range_end_b = function(passage, accum, context) { return this.range(passage, accum, context); }; bcv_passage.prototype.range_get_new_end_value = function(start_obj, end_obj, valid, key) { var new_end; new_end = 0; if ((key === "c" && valid.messages.end_chapter_is_zero) || (key === "v" && valid.messages.end_verse_is_zero)) { return new_end; } if (start_obj[key] >= 10 && end_obj[key] < 10 && start_obj[key] - 10 * Math.floor(start_obj[key] / 10) < end_obj[key]) { new_end = end_obj[key] + 10 * Math.floor(start_obj[key] / 10); } else if (start_obj[key] >= 100 && end_obj[key] < 100 && start_obj[key] - 100 < end_obj[key]) { new_end = end_obj[key] + 100; } return new_end; }; bcv_passage.prototype.range_handle_invalid = function(valid, passage, start, start_obj, end, end_obj, accum) { var new_end, ref, temp_valid, temp_value; if (valid.valid === false && (valid.messages.end_chapter_before_start || valid.messages.end_verse_before_start) && (end.type === "integer" || end.type === "v") || (valid.valid === false && valid.messages.end_chapter_before_start && end.type === "cv")) { new_end = this.range_check_new_end(passage.start_context.translations, start_obj, end_obj, valid); if (new_end > 0) { return this.range_change_end(passage, accum, new_end); } } if (this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v")) { temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; temp_valid = this.validate_ref(passage.start_context.translations, { b: start_obj.b, c: start_obj.c, v: temp_value }); if (temp_valid.valid) { return this.range_change_integer_end(passage, accum); } } if (passage.original_type == null) { passage.original_type = passage.type; } passage.type = "sequence"; ref = [[start, end], [[start], [end]]], passage.original_value = ref[0], passage.value = ref[1]; return this.sequence(passage, accum, passage.start_context); }; bcv_passage.prototype.range_handle_valid = function(valid, passage, start, start_obj, end, end_obj, accum) { var temp_valid, temp_value; if (valid.messages.end_chapter_not_exist && this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v") && this.options.passage_existence_strategy.indexOf("v") >= 0) { temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; temp_valid = this.validate_ref(passage.start_context.translations, { b: start_obj.b, c: start_obj.c, v: temp_value }); if (temp_valid.valid) { return [true, this.range_change_integer_end(passage, accum)]; } } this.range_validate(valid, start_obj, end_obj, passage); return [false, null]; }; bcv_passage.prototype.range_validate = function(valid, start_obj, end_obj, passage) { var ref; if (valid.messages.end_chapter_not_exist || valid.messages.end_chapter_not_exist_in_single_chapter_book) { end_obj.original_c = end_obj.c; end_obj.c = valid.messages.end_chapter_not_exist ? valid.messages.end_chapter_not_exist : valid.messages.end_chapter_not_exist_in_single_chapter_book; if (end_obj.v != null) { end_obj.v = this.validate_ref(passage.start_context.translations, { b: end_obj.b, c: end_obj.c, v: 999 }).messages.end_verse_not_exist; delete valid.messages.end_verse_is_zero; } } else if (valid.messages.end_verse_not_exist) { end_obj.original_v = end_obj.v; end_obj.v = valid.messages.end_verse_not_exist; } if (valid.messages.end_verse_is_zero && this.options.zero_verse_strategy !== "allow") { end_obj.v = valid.messages.end_verse_is_zero; } if (valid.messages.end_chapter_is_zero) { end_obj.c = valid.messages.end_chapter_is_zero; } ref = this.fix_start_zeroes(valid, start_obj.c, start_obj.v), start_obj.c = ref[0], start_obj.v = ref[1]; return true; }; bcv_passage.prototype.translation_sequence = function(passage, accum, context) { var k, l, len, len1, ref, translation, translations, val; passage.start_context = bcv_utils.shallow_clone(context); translations = []; translations.push({ translation: this.books[passage.value[0].value].parsed }); ref = passage.value[1]; for (k = 0, len = ref.length; k < len; k++) { val = ref[k]; val = this.books[this.pluck("translation", val).value].parsed; if (val != null) { translations.push({ translation: val }); } } for (l = 0, len1 = translations.length; l < len1; l++) { translation = translations[l]; if (this.translations.aliases[translation.translation] != null) { translation.alias = this.translations.aliases[translation.translation].alias; translation.osis = this.translations.aliases[translation.translation].osis || translation.translation.toUpperCase(); } else { translation.alias = "default"; translation.osis = translation.translation.toUpperCase(); } } if (accum.length > 0) { context = this.translation_sequence_apply(accum, translations); } if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } accum.push(passage); this.reset_context(context, ["translations"]); return [accum, context]; }; bcv_passage.prototype.translation_sequence_apply = function(accum, translations) { var context, i, k, new_accum, ref, ref1, use_i; use_i = 0; for (i = k = ref = accum.length - 1; ref <= 0 ? k <= 0 : k >= 0; i = ref <= 0 ? ++k : --k) { if (accum[i].original_type != null) { accum[i].type = accum[i].original_type; } if (accum[i].original_value != null) { accum[i].value = accum[i].original_value; } if (accum[i].type !== "translation_sequence") { continue; } use_i = i + 1; break; } if (use_i < accum.length) { accum[use_i].start_context.translations = translations; ref1 = this.handle_array(accum.slice(use_i), [], accum[use_i].start_context), new_accum = ref1[0], context = ref1[1]; } else { context = bcv_utils.shallow_clone(accum[accum.length - 1].start_context); } return context; }; bcv_passage.prototype.pluck = function(type, passages) { var k, len, passage; for (k = 0, len = passages.length; k < len; k++) { passage = passages[k]; if (!((passage != null) && (passage.type != null) && passage.type === type)) { continue; } if (type === "c" || type === "v") { return this.pluck("integer", passage.value); } return passage; } return null; }; bcv_passage.prototype.pluck_last_recursively = function(type, passages) { var k, passage, value; for (k = passages.length - 1; k >= 0; k += -1) { passage = passages[k]; if (!((passage != null) && (passage.type != null))) { continue; } if (passage.type === type) { return this.pluck(type, [passage]); } value = this.pluck_last_recursively(type, passage.value); if (value != null) { return value; } } return null; }; bcv_passage.prototype.set_context_from_object = function(context, keys, obj) { var k, len, results, type; results = []; for (k = 0, len = keys.length; k < len; k++) { type = keys[k]; if (obj[type] == null) { continue; } results.push(context[type] = obj[type]); } return results; }; bcv_passage.prototype.reset_context = function(context, keys) { var k, len, results, type; results = []; for (k = 0, len = keys.length; k < len; k++) { type = keys[k]; results.push(delete context[type]); } return results; }; bcv_passage.prototype.fix_start_zeroes = function(valid, c, v) { if (valid.messages.start_chapter_is_zero && this.options.zero_chapter_strategy === "upgrade") { c = valid.messages.start_chapter_is_zero; } if (valid.messages.start_verse_is_zero && this.options.zero_verse_strategy === "upgrade") { v = valid.messages.start_verse_is_zero; } return [c, v]; }; bcv_passage.prototype.calculate_indices = function(match, adjust) { var character, end_index, indices, k, l, len, len1, len2, m, match_index, part, part_length, parts, ref, switch_type, temp; switch_type = "book"; indices = []; match_index = 0; adjust = parseInt(adjust, 10); parts = [match]; ref = ["\x1e", "\x1f"]; for (k = 0, len = ref.length; k < len; k++) { character = ref[k]; temp = []; for (l = 0, len1 = parts.length; l < len1; l++) { part = parts[l]; temp = temp.concat(part.split(character)); } parts = temp; } for (m = 0, len2 = parts.length; m < len2; m++) { part = parts[m]; switch_type = switch_type === "book" ? "rest" : "book"; part_length = part.length; if (part_length === 0) { continue; } if (switch_type === "book") { part = part.replace(/\/\d+$/, ""); end_index = match_index + part_length; if (indices.length > 0 && indices[indices.length - 1].index === adjust) { indices[indices.length - 1].end = end_index; } else { indices.push({ start: match_index, end: end_index, index: adjust }); } match_index += part_length + 2; adjust = this.books[part].start_index + this.books[part].value.length - match_index; indices.push({ start: end_index + 1, end: end_index + 1, index: adjust }); } else { end_index = match_index + part_length - 1; if (indices.length > 0 && indices[indices.length - 1].index === adjust) { indices[indices.length - 1].end = end_index; } else { indices.push({ start: match_index, end: end_index, index: adjust }); } match_index += part_length; } } return indices; }; bcv_passage.prototype.get_absolute_indices = function(arg1) { var end, end_out, index, k, len, ref, start, start_out; start = arg1[0], end = arg1[1]; start_out = null; end_out = null; ref = this.indices; for (k = 0, len = ref.length; k < len; k++) { index = ref[k]; if (start_out === null && (index.start <= start && start <= index.end)) { start_out = start + index.index; } if ((index.start <= end && end <= index.end)) { end_out = end + index.index + 1; break; } } return [start_out, end_out]; }; bcv_passage.prototype.validate_ref = function(translations, start, end) { var k, len, messages, temp_valid, translation, valid; if (!((translations != null) && translations.length > 0)) { translations = [ { translation: "default", osis: "", alias: "default" } ]; } valid = false; messages = {}; for (k = 0, len = translations.length; k < len; k++) { translation = translations[k]; if (translation.alias == null) { translation.alias = "default"; } if (translation.alias == null) { if (messages.translation_invalid == null) { messages.translation_invalid = []; } messages.translation_invalid.push(translation); continue; } if (this.translations.aliases[translation.alias] == null) { translation.alias = "default"; if (messages.translation_unknown == null) { messages.translation_unknown = []; } messages.translation_unknown.push(translation); } temp_valid = this.validate_start_ref(translation.alias, start, messages)[0]; if (end) { temp_valid = this.validate_end_ref(translation.alias, start, end, temp_valid, messages)[0]; } if (temp_valid === true) { valid = true; } } return { valid: valid, messages: messages }; }; bcv_passage.prototype.validate_start_ref = function(translation, start, messages) { var ref, ref1, translation_order, valid; valid = true; if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters[start.b] : void 0) == null)) { this.promote_book_to_translation(start.b, translation); } translation_order = ((ref1 = this.translations[translation]) != null ? ref1.order : void 0) != null ? translation : "default"; if (start.v != null) { start.v = parseInt(start.v, 10); } if (this.translations[translation_order].order[start.b] != null) { if (start.c == null) { start.c = 1; } start.c = parseInt(start.c, 10); if (isNaN(start.c)) { valid = false; messages.start_chapter_not_numeric = true; return [valid, messages]; } if (start.c === 0) { messages.start_chapter_is_zero = 1; if (this.options.zero_chapter_strategy === "error") { valid = false; } else { start.c = 1; } } if ((start.v != null) && start.v === 0) { messages.start_verse_is_zero = 1; if (this.options.zero_verse_strategy === "error") { valid = false; } else if (this.options.zero_verse_strategy === "upgrade") { start.v = 1; } } if (start.c > 0 && (this.translations[translation].chapters[start.b][start.c - 1] != null)) { if (start.v != null) { if (isNaN(start.v)) { valid = false; messages.start_verse_not_numeric = true; } else if (start.v > this.translations[translation].chapters[start.b][start.c - 1]) { if (this.options.passage_existence_strategy.indexOf("v") >= 0) { valid = false; messages.start_verse_not_exist = this.translations[translation].chapters[start.b][start.c - 1]; } } } else if (start.c === 1 && this.options.single_chapter_1_strategy === "verse" && this.translations[translation].chapters[start.b].length === 1) { messages.start_chapter_1 = 1; } } else { if (start.c !== 1 && this.translations[translation].chapters[start.b].length === 1) { valid = false; messages.start_chapter_not_exist_in_single_chapter_book = 1; } else if (start.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { valid = false; messages.start_chapter_not_exist = this.translations[translation].chapters[start.b].length; } } } else if (start.b == null) { valid = false; messages.start_book_not_defined = true; } else { if (this.options.passage_existence_strategy.indexOf("b") >= 0) { valid = false; } messages.start_book_not_exist = true; } return [valid, messages]; }; bcv_passage.prototype.validate_end_ref = function(translation, start, end, valid, messages) { var ref, translation_order; translation_order = ((ref = this.translations[translation]) != null ? ref.order : void 0) != null ? translation : "default"; if (end.c != null) { end.c = parseInt(end.c, 10); if (isNaN(end.c)) { valid = false; messages.end_chapter_not_numeric = true; } else if (end.c === 0) { messages.end_chapter_is_zero = 1; if (this.options.zero_chapter_strategy === "error") { valid = false; } else { end.c = 1; } } } if (end.v != null) { end.v = parseInt(end.v, 10); if (isNaN(end.v)) { valid = false; messages.end_verse_not_numeric = true; } else if (end.v === 0) { messages.end_verse_is_zero = 1; if (this.options.zero_verse_strategy === "error") { valid = false; } else if (this.options.zero_verse_strategy === "upgrade") { end.v = 1; } } } if (this.translations[translation_order].order[end.b] != null) { if ((end.c == null) && this.translations[translation].chapters[end.b].length === 1) { end.c = 1; } if ((this.translations[translation_order].order[start.b] != null) && this.translations[translation_order].order[start.b] > this.translations[translation_order].order[end.b]) { if (this.options.passage_existence_strategy.indexOf("b") >= 0) { valid = false; } messages.end_book_before_start = true; } if (start.b === end.b && (end.c != null) && !isNaN(end.c)) { if (start.c == null) { start.c = 1; } if (!isNaN(parseInt(start.c, 10)) && start.c > end.c) { valid = false; messages.end_chapter_before_start = true; } else if (start.c === end.c && (end.v != null) && !isNaN(end.v)) { if (start.v == null) { start.v = 1; } if (!isNaN(parseInt(start.v, 10)) && start.v > end.v) { valid = false; messages.end_verse_before_start = true; } } } if ((end.c != null) && !isNaN(end.c)) { if (this.translations[translation].chapters[end.b][end.c - 1] == null) { if (this.translations[translation].chapters[end.b].length === 1) { messages.end_chapter_not_exist_in_single_chapter_book = 1; } else if (end.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { messages.end_chapter_not_exist = this.translations[translation].chapters[end.b].length; } } } if ((end.v != null) && !isNaN(end.v)) { if (end.c == null) { end.c = this.translations[translation].chapters[end.b].length; } if (end.v > this.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0) { messages.end_verse_not_exist = this.translations[translation].chapters[end.b][end.c - 1]; } } } else { valid = false; messages.end_book_not_exist = true; } return [valid, messages]; }; bcv_passage.prototype.promote_book_to_translation = function(book, translation) { var base, base1; if ((base = this.translations)[translation] == null) { base[translation] = {}; } if ((base1 = this.translations[translation]).chapters == null) { base1.chapters = {}; } if (this.translations[translation].chapters[book] == null) { return this.translations[translation].chapters[book] = bcv_utils.shallow_clone_array(this.translations["default"].chapters[book]); } }; return bcv_passage; })(); bcv_utils = { shallow_clone: function(obj) { var key, out, val; if (obj == null) { return obj; } out = {}; for (key in obj) { if (!hasProp.call(obj, key)) continue; val = obj[key]; out[key] = val; } return out; }, shallow_clone_array: function(arr) { var i, k, out, ref; if (arr == null) { return arr; } out = []; for (i = k = 0, ref = arr.length; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) { if (typeof arr[i] !== "undefined") { out[i] = arr[i]; } } return out; } }; bcv_parser.prototype.regexps.translations = /(?:(?:ERV))\b/gi; bcv_parser.prototype.translations = { aliases: { "default": { osis: "", alias: "default" } }, alternates: {}, "default": { order: { "Gen": 1, "Exod": 2, "Lev": 3, "Num": 4, "Deut": 5, "Josh": 6, "Judg": 7, "Ruth": 8, "1Sam": 9, "2Sam": 10, "1Kgs": 11, "2Kgs": 12, "1Chr": 13, "2Chr": 14, "Ezra": 15, "Neh": 16, "Esth": 17, "Job": 18, "Ps": 19, "Prov": 20, "Eccl": 21, "Song": 22, "Isa": 23, "Jer": 24, "Lam": 25, "Ezek": 26, "Dan": 27, "Hos": 28, "Joel": 29, "Amos": 30, "Obad": 31, "Jonah": 32, "Mic": 33, "Nah": 34, "Hab": 35, "Zeph": 36, "Hag": 37, "Zech": 38, "Mal": 39, "Matt": 40, "Mark": 41, "Luke": 42, "John": 43, "Acts": 44, "Rom": 45, "1Cor": 46, "2Cor": 47, "Gal": 48, "Eph": 49, "Phil": 50, "Col": 51, "1Thess": 52, "2Thess": 53, "1Tim": 54, "2Tim": 55, "Titus": 56, "Phlm": 57, "Heb": 58, "Jas": 59, "1Pet": 60, "2Pet": 61, "1John": 62, "2John": 63, "3John": 64, "Jude": 65, "Rev": 66, "Tob": 67, "Jdt": 68, "GkEsth": 69, "Wis": 70, "Sir": 71, "Bar": 72, "PrAzar": 73, "Sus": 74, "Bel": 75, "SgThree": 76, "EpJer": 77, "1Macc": 78, "2Macc": 79, "3Macc": 80, "4Macc": 81, "1Esd": 82, "2Esd": 83, "PrMan": 84 }, chapters: { "Gen": [31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26], "Exod": [22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38], "Lev": [17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34], "Num": [54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, 23, 31, 40, 16, 54, 42, 56, 29, 34, 13], "Deut": [46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 32, 18, 29, 23, 22, 20, 22, 21, 20, 23, 30, 25, 22, 19, 19, 26, 68, 29, 20, 30, 52, 29, 12], "Josh": [18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33], "Judg": [36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25], "Ruth": [22, 23, 18, 22], "1Sam": [28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13], "2Sam": [27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 33, 43, 26, 22, 51, 39, 25], "1Kgs": [53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 53], "2Kgs": [18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 21, 21, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30], "1Chr": [54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 47, 40, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30], "2Chr": [17, 18, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 22, 15, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23], "Ezra": [11, 70, 13, 24, 17, 22, 28, 36, 15, 44], "Neh": [11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31], "Esth": [22, 23, 15, 17, 14, 14, 10, 17, 32, 3], "Job": [22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 24, 34, 17], "Ps": [6, 12, 8, 8, 12, 10, 17, 9, 20, 18, 7, 8, 6, 7, 5, 11, 15, 50, 14, 9, 13, 31, 6, 10, 22, 12, 14, 9, 11, 12, 24, 11, 22, 22, 28, 12, 40, 22, 13, 17, 13, 11, 5, 26, 17, 11, 9, 14, 20, 23, 19, 9, 6, 7, 23, 13, 11, 11, 17, 12, 8, 12, 11, 10, 13, 20, 7, 35, 36, 5, 24, 20, 28, 23, 10, 12, 20, 72, 13, 19, 16, 8, 18, 12, 13, 17, 7, 18, 52, 17, 16, 15, 5, 23, 11, 13, 12, 9, 9, 5, 8, 28, 22, 35, 45, 48, 43, 13, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 13, 10, 7, 12, 15, 21, 10, 20, 14, 9, 6], "Prov": [33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31], "Eccl": [18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14], "Song": [17, 17, 11, 16, 16, 13, 13, 14], "Isa": [31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 12, 25, 24], "Jer": [19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34], "Lam": [22, 22, 66, 22, 22], "Ezek": [28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35], "Dan": [21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13], "Hos": [11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9], "Joel": [20, 32, 21], "Amos": [15, 16, 15, 13, 27, 14, 17, 14, 15], "Obad": [21], "Jonah": [17, 10, 10, 11], "Mic": [16, 13, 12, 13, 15, 16, 20], "Nah": [15, 13, 19], "Hab": [17, 20, 19], "Zeph": [18, 15, 20], "Hag": [15, 23], "Zech": [21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21], "Mal": [14, 17, 18, 6], "Matt": [25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20], "Mark": [45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20], "Luke": [80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53], "John": [51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25], "Acts": [26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 41, 38, 40, 30, 35, 27, 27, 32, 44, 31], "Rom": [32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27], "1Cor": [31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24], "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14], "Gal": [24, 21, 29, 31, 26, 18], "Eph": [23, 22, 21, 32, 33, 24], "Phil": [30, 30, 21, 23], "Col": [29, 23, 25, 18], "1Thess": [10, 20, 13, 18, 28], "2Thess": [12, 17, 18], "1Tim": [20, 15, 16, 16, 25, 21], "2Tim": [18, 26, 17, 22], "Titus": [16, 15, 15], "Phlm": [25], "Heb": [14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25], "Jas": [27, 26, 18, 17, 20], "1Pet": [25, 25, 22, 19, 14], "2Pet": [21, 22, 18], "1John": [10, 29, 24, 21, 21], "2John": [13], "3John": [15], "Jude": [25], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [22, 14, 17, 21, 22, 18, 16, 21, 6, 13, 18, 22, 17, 15], "Jdt": [16, 28, 10, 15, 24, 21, 32, 36, 14, 23, 23, 20, 20, 19, 14, 25], "GkEsth": [22, 23, 15, 17, 14, 14, 10, 17, 32, 13, 12, 6, 18, 19, 16, 24], "Wis": [16, 24, 19, 20, 23, 25, 30, 21, 18, 21, 26, 27, 19, 31, 19, 29, 21, 25, 22], "Sir": [30, 18, 31, 31, 15, 37, 36, 19, 18, 31, 34, 18, 26, 27, 20, 30, 32, 33, 30, 31, 28, 27, 27, 34, 26, 29, 30, 26, 28, 25, 31, 24, 33, 31, 26, 31, 31, 34, 35, 30, 22, 25, 33, 23, 26, 20, 25, 25, 16, 29, 30], "Bar": [22, 35, 37, 37, 9], "PrAzar": [68], "Sus": [64], "Bel": [42], "SgThree": [39], "EpJer": [73], "1Macc": [64, 70, 60, 61, 68, 63, 50, 32, 73, 89, 74, 53, 53, 49, 41, 24], "2Macc": [36, 32, 40, 50, 27, 31, 42, 36, 29, 38, 38, 45, 26, 46, 39], "3Macc": [29, 33, 30, 21, 51, 41, 23], "4Macc": [35, 24, 21, 26, 38, 35, 23, 29, 32, 21, 27, 19, 27, 20, 32, 25, 24, 24], "1Esd": [58, 30, 24, 63, 73, 34, 15, 96, 55], "2Esd": [40, 48, 36, 52, 56, 59, 70, 63, 47, 59, 46, 51, 58, 48, 63, 78], "PrMan": [15], "Ps151": [7] } }, vulgate: { chapters: { "Gen": [31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 32, 25], "Exod": [22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 36], "Lev": [17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 45, 34], "Num": [54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 34, 15, 34, 45, 41, 50, 13, 32, 22, 30, 35, 41, 30, 25, 18, 65, 23, 31, 39, 17, 54, 42, 56, 29, 34, 13], "Josh": [18, 24, 17, 25, 16, 27, 26, 35, 27, 44, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 43, 34, 16, 33], "Judg": [36, 23, 31, 24, 32, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 24], "1Sam": [28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 43, 15, 23, 28, 23, 44, 25, 12, 25, 11, 31, 13], "1Kgs": [53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 54], "1Chr": [54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 46, 40, 14, 17, 29, 43, 27, 17, 19, 7, 30, 19, 32, 31, 31, 32, 34, 21, 30], "Neh": [11, 20, 31, 23, 19, 19, 73, 18, 38, 39, 36, 46, 31], "Job": [22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 23, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 35, 28, 25, 16], "Ps": [6, 13, 9, 10, 13, 11, 18, 10, 39, 8, 9, 6, 7, 5, 10, 15, 51, 15, 10, 14, 32, 6, 10, 22, 12, 14, 9, 11, 13, 25, 11, 22, 23, 28, 13, 40, 23, 14, 18, 14, 12, 5, 26, 18, 12, 10, 15, 21, 23, 21, 11, 7, 9, 24, 13, 12, 12, 18, 14, 9, 13, 12, 11, 14, 20, 8, 36, 37, 6, 24, 20, 28, 23, 11, 13, 21, 72, 13, 20, 17, 8, 19, 13, 14, 17, 7, 19, 53, 17, 16, 16, 5, 23, 11, 13, 12, 9, 9, 5, 8, 29, 22, 35, 45, 48, 43, 14, 31, 7, 10, 10, 9, 26, 9, 10, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 14, 10, 8, 12, 15, 21, 10, 11, 9, 14, 9, 6], "Eccl": [18, 26, 22, 17, 19, 11, 30, 17, 18, 20, 10, 14], "Song": [16, 17, 11, 16, 17, 12, 13, 14], "Jer": [19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 20, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34], "Ezek": [28, 9, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35], "Dan": [21, 49, 100, 34, 31, 28, 28, 27, 27, 21, 45, 13, 65, 42], "Hos": [11, 24, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 15, 10], "Amos": [15, 16, 15, 13, 27, 15, 17, 14, 14], "Jonah": [16, 11, 10, 11], "Mic": [16, 13, 12, 13, 14, 16, 20], "Hag": [14, 24], "Matt": [25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 26, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20], "Mark": [45, 28, 35, 40, 43, 56, 37, 39, 49, 52, 33, 44, 37, 72, 47, 20], "John": [51, 25, 36, 54, 47, 72, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25], "Acts": [26, 47, 26, 37, 42, 15, 59, 40, 43, 48, 30, 25, 52, 27, 41, 40, 34, 28, 40, 38, 40, 30, 35, 27, 27, 32, 44, 31], "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [25, 23, 25, 23, 28, 22, 20, 24, 12, 13, 21, 22, 23, 17], "Jdt": [12, 18, 15, 17, 29, 21, 25, 34, 19, 20, 21, 20, 31, 18, 15, 31], "Wis": [16, 25, 19, 20, 24, 27, 30, 21, 19, 21, 27, 27, 19, 31, 19, 29, 20, 25, 20], "Sir": [40, 23, 34, 36, 18, 37, 40, 22, 25, 34, 36, 19, 32, 27, 22, 31, 31, 33, 28, 33, 31, 33, 38, 47, 36, 28, 33, 30, 35, 27, 42, 28, 33, 31, 26, 28, 34, 39, 41, 32, 28, 26, 37, 27, 31, 23, 31, 28, 19, 31, 38, 13], "Bar": [22, 35, 38, 37, 9, 72], "1Macc": [67, 70, 60, 61, 68, 63, 50, 32, 73, 89, 74, 54, 54, 49, 41, 24], "2Macc": [36, 33, 40, 50, 27, 31, 42, 36, 29, 38, 38, 46, 26, 46, 40] } }, ceb: { chapters: { "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [22, 14, 17, 21, 22, 18, 16, 21, 6, 13, 18, 22, 18, 15], "PrAzar": [67], "EpJer": [72], "1Esd": [55, 26, 24, 63, 71, 33, 15, 92, 55] } }, kjv: { chapters: { "3John": [14] } }, nab: { order: { "Gen": 1, "Exod": 2, "Lev": 3, "Num": 4, "Deut": 5, "Josh": 6, "Judg": 7, "Ruth": 8, "1Sam": 9, "2Sam": 10, "1Kgs": 11, "2Kgs": 12, "1Chr": 13, "2Chr": 14, "PrMan": 15, "Ezra": 16, "Neh": 17, "1Esd": 18, "2Esd": 19, "Tob": 20, "Jdt": 21, "Esth": 22, "GkEsth": 23, "1Macc": 24, "2Macc": 25, "3Macc": 26, "4Macc": 27, "Job": 28, "Ps": 29, "Prov": 30, "Eccl": 31, "Song": 32, "Wis": 33, "Sir": 34, "Isa": 35, "Jer": 36, "Lam": 37, "Bar": 38, "EpJer": 39, "Ezek": 40, "Dan": 41, "PrAzar": 42, "Sus": 43, "Bel": 44, "SgThree": 45, "Hos": 46, "Joel": 47, "Amos": 48, "Obad": 49, "Jonah": 50, "Mic": 51, "Nah": 52, "Hab": 53, "Zeph": 54, "Hag": 55, "Zech": 56, "Mal": 57, "Matt": 58, "Mark": 59, "Luke": 60, "John": 61, "Acts": 62, "Rom": 63, "1Cor": 64, "2Cor": 65, "Gal": 66, "Eph": 67, "Phil": 68, "Col": 69, "1Thess": 70, "2Thess": 71, "1Tim": 72, "2Tim": 73, "Titus": 74, "Phlm": 75, "Heb": 76, "Jas": 77, "1Pet": 78, "2Pet": 79, "1John": 80, "2John": 81, "3John": 82, "Jude": 83, "Rev": 84 }, chapters: { "Gen": [31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 54, 33, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26], "Exod": [22, 25, 22, 31, 23, 30, 29, 28, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 37, 30, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38], "Lev": [17, 16, 17, 35, 26, 23, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34], "Num": [54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 35, 28, 32, 22, 29, 35, 41, 30, 25, 19, 65, 23, 31, 39, 17, 54, 42, 56, 29, 34, 13], "Deut": [46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 31, 19, 29, 23, 22, 20, 22, 21, 20, 23, 29, 26, 22, 19, 19, 26, 69, 28, 20, 30, 52, 29, 12], "1Sam": [28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 16, 23, 28, 23, 44, 25, 12, 25, 11, 31, 13], "2Sam": [27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 32, 44, 26, 22, 51, 39, 25], "1Kgs": [53, 46, 28, 20, 32, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 54], "2Kgs": [18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 20, 22, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30], "1Chr": [54, 55, 24, 43, 41, 66, 40, 40, 44, 14, 47, 41, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30], "2Chr": [18, 17, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 23, 14, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23], "Neh": [11, 20, 38, 17, 19, 19, 72, 18, 37, 40, 36, 47, 31], "Job": [22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 32, 26, 17], "Ps": [6, 11, 9, 9, 13, 11, 18, 10, 21, 18, 7, 9, 6, 7, 5, 11, 15, 51, 15, 10, 14, 32, 6, 10, 22, 12, 14, 9, 11, 13, 25, 11, 22, 23, 28, 13, 40, 23, 14, 18, 14, 12, 5, 27, 18, 12, 10, 15, 21, 23, 21, 11, 7, 9, 24, 14, 12, 12, 18, 14, 9, 13, 12, 11, 14, 20, 8, 36, 37, 6, 24, 20, 28, 23, 11, 13, 21, 72, 13, 20, 17, 8, 19, 13, 14, 17, 7, 19, 53, 17, 16, 16, 5, 23, 11, 13, 12, 9, 9, 5, 8, 29, 22, 35, 45, 48, 43, 14, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 14, 10, 8, 12, 15, 21, 10, 20, 14, 9, 6], "Eccl": [18, 26, 22, 17, 19, 12, 29, 17, 18, 20, 10, 14], "Song": [17, 17, 11, 16, 16, 12, 14, 14], "Isa": [31, 22, 26, 6, 30, 13, 25, 23, 20, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 11, 25, 24], "Jer": [19, 37, 25, 31, 31, 30, 34, 23, 25, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34], "Ezek": [28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 44, 37, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35], "Dan": [21, 49, 100, 34, 30, 29, 28, 27, 27, 21, 45, 13, 64, 42], "Hos": [9, 25, 5, 19, 15, 11, 16, 14, 17, 15, 11, 15, 15, 10], "Joel": [20, 27, 5, 21], "Jonah": [16, 11, 10, 11], "Mic": [16, 13, 12, 14, 14, 16, 20], "Nah": [14, 14, 19], "Zech": [17, 17, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21], "Mal": [14, 17, 24], "Acts": [26, 47, 26, 37, 42, 15, 60, 40, 43, 49, 30, 25, 52, 28, 41, 40, 34, 28, 40, 38, 40, 30, 35, 27, 27, 32, 44, 31], "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21], "Tob": [22, 14, 17, 21, 22, 18, 17, 21, 6, 13, 18, 22, 18, 15], "Sir": [30, 18, 31, 31, 15, 37, 36, 19, 18, 31, 34, 18, 26, 27, 20, 30, 32, 33, 30, 31, 28, 27, 27, 33, 26, 29, 30, 26, 28, 25, 31, 24, 33, 31, 26, 31, 31, 34, 35, 30, 22, 25, 33, 23, 26, 20, 25, 25, 16, 29, 30], "Bar": [22, 35, 38, 37, 9, 72], "2Macc": [36, 32, 40, 50, 27, 31, 42, 36, 29, 38, 38, 46, 26, 46, 39] } }, nlt: { chapters: { "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21] } }, nrsv: { chapters: { "2Cor": [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13], "Rev": [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21] } } }; bcv_parser.prototype.languages = ["or"]; bcv_parser.prototype.regexps.space = "[\\s\\xa0]"; bcv_parser.prototype.regexps.escaped_passage = /(?:^|[^\x1f\x1e\dA-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:(?:ch(?:apters?|a?pts?\.?|a?p?s?\.?)?\s*\d+\s*(?:[\u2013\u2014\-]|through|thru|to)\s*\d+\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*)|(?:ch(?:apters?|a?pts?\.?|a?p?s?\.?)?\s*\d+\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*)|(?:\d+(?:th|nd|st)\s*ch(?:apter|a?pt\.?|a?p?\.?)?\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*))?\x1f(\d+)(?:\/\d+)?\x1f(?:\/\d+\x1f|[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014]|title(?![a-z])|chapter|verse|ଠାରୁ|and|ff|[ଖ](?!\w)|$)+)/gi; bcv_parser.prototype.regexps.match_end_split = /\d\W*title|\d\W*ff(?:[\s\xa0*]*\.)?|\d[\s\xa0*]*[ଖ](?!\w)|\x1e(?:[\s\xa0*]*[)\]\uff09])?|[\d\x1f]/gi; bcv_parser.prototype.regexps.control = /[\x1e\x1f]/g; bcv_parser.prototype.regexps.pre_book = "[^A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ]"; bcv_parser.prototype.regexps.first = "(?:ପ୍ରଥମ|1)\\.?" + bcv_parser.prototype.regexps.space + "*"; bcv_parser.prototype.regexps.second = "(?:ଦ୍ୱିତୀୟ|2)\\.?" + bcv_parser.prototype.regexps.space + "*"; bcv_parser.prototype.regexps.third = "(?:ତୃତୀୟ|3)\\.?" + bcv_parser.prototype.regexps.space + "*"; bcv_parser.prototype.regexps.range_and = "(?:[&\u2013\u2014-]|and|ଠାରୁ)"; bcv_parser.prototype.regexps.range_only = "(?:[\u2013\u2014-]|ଠାରୁ)"; bcv_parser.prototype.regexps.get_books = function(include_apocrypha, case_sensitive) { var book, books, k, len, out; books = [ { osis: ["Ps"], apocrypha: true, extra: "2", regexp: /(\b)(Ps151)(?=\.1)/g }, { osis: ["Gen"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଆଦି(?:ପୁସ୍ତକ)?|Gen))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Exod"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯାତ୍ରା(?:[\\s\\xa0]*ପୁସ୍ତକ|ପୁସ୍ତକ)?|Exod))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Bel"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Bel))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Lev"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଲେବୀୟ(?:[\\s\\xa0]*ପୁସ୍ତକ)?|Lev))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Num"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଗଣନା(?:[\\s\\xa0]*ପୁସ୍ତକ)?|Num))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Sir"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Sir))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Wis"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Wis))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Lam"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯିରିମିୟଙ୍କ[\\s\\xa0]*ବିଳାପ|Lam))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["EpJer"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:EpJer))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Rev"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯୋହନଙ୍କ[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପ୍ରକାଶିତ[\\s\\xa0]*ବାକ୍ୟ|Rev))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["PrMan"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:PrMan))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Deut"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଦ୍ୱିତୀୟ[\\s\\xa0]*ବିବରଣୀ?|ବିବରଣି|Deut))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Josh"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯିହୋଶୂୟଙ୍କର(?:[\\s\\xa0]*ପୁସ୍ତକ)?|Josh))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Judg"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ[\\s\\xa0]*ବିବରଣ|Judg))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Ruth"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଋତର[\\s\\xa0]*ବିବରଣ[\\s\\xa0]*ପୁସ୍ତକ|Ruth))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["1Esd"], apocrypha: true, regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1Esd))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Esd"], apocrypha: true, regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2Esd))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Isa"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯ(?:ିଶାଇୟ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କର[\\s\\xa0]*ପୁସ୍ତକ)?|[ାୀ]ଶାଇୟ)|ୟିଶାୟ|Isa|ୟଶାଇୟ))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Sam"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ଶାମୁୟେଲଙ|Sam|\.[\s\xa0]*ଶାମୁୟେଲଙ)|ଦ୍ୱିତୀୟ[\s\xa0]*ଶାମୁୟେଲଙ|(?:ଦ୍ୱିତୀୟ|2\.?)[\s\xa0]*ଶାମୁୟେଲ|ଶାମୁୟେଲଙ୍କ[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପୁସ୍ତକ))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Sam"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*ଶାମୁୟେଲଙ|Sam|\.[\s\xa0]*ଶାମୁୟେଲଙ)|ପ୍ରଥମ[\s\xa0]*ଶାମୁୟେଲଙ|(?:ପ୍ରଥମ|1\.?)[\s\xa0]*ଶାମୁୟେଲ|ଶାମୁୟେଲଙ୍କ[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପୁସ୍ତକ))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Kgs"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ରାଜାବଳୀର|Kgs|\.[\s\xa0]*ରାଜାବଳୀର)|ଦ୍ୱିତୀୟ[\s\xa0]*ରାଜାବଳୀର|(?:ଦ୍ୱିତୀୟ|2\.?)[\s\xa0]*ରାଜାବଳୀ|ରାଜାବଳୀର[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପୁସ୍ତକ))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Kgs"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*ରାଜାବଳୀର|Kgs|\.[\s\xa0]*ରାଜାବଳୀର)|ପ୍ରଥମ[\s\xa0]*ରାଜାବଳୀର|(?:ପ୍ରଥମ|1\.?)[\s\xa0]*ରାଜାବଳୀ|ରାଜାବଳୀର[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପୁସ୍ତକ))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Chr"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ବଂଶାବଳୀର|Chr|\.[\s\xa0]*ବଂଶାବଳୀର)|ଦ୍ୱିତୀୟ[\s\xa0]*ବଂଶାବଳୀର|(?:ଦ୍ୱିତୀୟ|2\.?)[\s\xa0]*ବଂଶାବଳୀ|ବଂଶାବଳୀର[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପୁସ୍ତକ))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Chr"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*ବଂଶାବଳୀର|Chr|\.[\s\xa0]*ବଂଶାବଳୀର)|ପ୍ରଥମ[\s\xa0]*ବଂଶାବଳୀର|(?:ପ୍ରଥମ|1\.?)[\s\xa0]*ବଂଶାବଳୀ|ବଂଶାବଳୀର[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପୁସ୍ତକ))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Ezra"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଏଜ୍ରା|Ezra))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Neh"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ନିହିମିୟାଙ୍କର(?:[\\s\\xa0]*ପୁସ୍ତକ)?|Neh))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["GkEsth"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:GkEsth))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Esth"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଏଷ୍ଟର[\\s\\xa0]*ବିବରଣ|Esth))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Job"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଆୟୁବ(?:[\\s\\xa0]*ପୁସ୍ତକ)?|Job))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Ps"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଗ(?:ୀତି?|ାତ)ସଂହିତା|Ps))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["PrAzar"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:PrAzar))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Prov"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ହିତୋପଦେଶ|Prov))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Eccl"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଉପଦେଶକ|Eccl))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["SgThree"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:SgThree))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Song"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ପରମଗୀତ|Song))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jer"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯିରିମିୟ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Jer))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Ezek"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯିହିଜିକଲ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Ezek))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Dan"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଦାନିୟେଲଙ(?:୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Dan))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Hos"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ହୋଶ(?:େୟ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|ହେ)|Hos))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Joel"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯୋୟେଲ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Joel))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Amos"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଆମୋଷ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Amos))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Obad"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଓବଦିଅ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Obad))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jonah"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯୂନସ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Jonah))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Mic"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ମ(?:ୀଖା(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|ିଖା)|Mic))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Nah"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ନାହୂମ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Nah))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Hab"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ହବ(?:‌କ୍‌କୂକ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|କ[ୁୂ]କ୍)|Hab))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Zeph"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ସିଫନିୟ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Zeph))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Hag"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ହାଗୟ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Hag))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Zech"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯିଖରିୟ(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Zech))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Mal"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ମଲାଖି(?:[\\s\\xa0]*ଭବିଷ୍ୟ‌ଦ୍‌ବକ୍ତାଙ୍କ[\\s\\xa0]*ପୁସ୍ତକ)?|Mal))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Matt"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ମାଥିଉ(?:[\\s\\xa0]*ଲିଖିତ[\\s\\xa0]*ସୁସମାଗ୍ଭର)?|Matt))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Mark"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ମାର୍କ(?:[\\s\\xa0]*ଲିଖିତ[\\s\\xa0]*ସୁସମାଗ୍ଭର)?|Mark))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Luke"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଲୂକ(?:[\\s\\xa0]*ଲିଖିତ[\\s\\xa0]*ସୁସମାଗ୍ଭର)?|Luke))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["1John"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*ଯୋହନଙ|John|\.[\s\xa0]*ଯୋହନଙ)|ପ୍ରଥମ[\s\xa0]*ଯୋହନଙ|ଯୋହନଙ୍କ[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2John"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ଯୋହନଙ|John|\.[\s\xa0]*ଯୋହନଙ)|ଦ୍ୱିତୀୟ[\s\xa0]*ଯୋହନଙ|ଯୋହନଙ୍କ[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["3John"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:3(?:[\s\xa0]*ଯୋହନଙ|John|\.[\s\xa0]*ଯୋହନଙ)|ତୃତୀୟ[\s\xa0]*ଯୋହନଙ|ଯୋହନଙ୍କ[\s\xa0]*ତୃତୀୟ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["John"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯୋହନ(?:[\\s\\xa0]*ଲିଖିତ[\\s\\xa0]*ସୁସମାଗ୍ଭର)?|John))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Acts"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ପ୍ରେରିତ(?:ମାନଙ୍କ[\\s\\xa0]*କାର୍ଯ୍ୟର[\\s\\xa0]*ବିବରଣ)?|Acts))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Rom"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ରୋମୀୟଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Rom))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Cor"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*କରିନ୍ଥୀୟଙ୍କ|Cor|\.[\s\xa0]*କରିନ୍ଥୀୟଙ୍କ)|ଦ୍ୱିତୀୟ[\s\xa0]*କରିନ୍ଥୀୟଙ୍କ|(?:ଦ୍ୱିତୀୟ|2\.?)[\s\xa0]*କରିନ୍ଥୀୟ|କରିନ୍ଥୀୟଙ୍କ[\s\xa0]*ପ୍ରତି[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Cor"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*କରିନ୍ଥୀୟଙ୍କ|Cor|\.[\s\xa0]*କରିନ୍ଥୀୟଙ୍କ)|ପ୍ରଥମ[\s\xa0]*କରିନ୍ଥୀୟଙ୍କ|(?:ପ୍ରଥମ|1\.?)[\s\xa0]*କରିନ୍ଥୀୟ|କରିନ୍ଥୀୟଙ୍କ[\s\xa0]*ପ୍ରତି[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Gal"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଗାଲାତୀୟଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Gal))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Eph"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଏଫିସୀୟଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Eph))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Phil"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଫିଲି‌ପ୍‌ପୀୟଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Phil))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Col"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:କଲସୀୟଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Col))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Thess"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ଥେସଲନୀକୀୟଙ|Thess|\.[\s\xa0]*ଥେସଲନୀକୀୟଙ)|ଦ୍ୱିତୀୟ[\s\xa0]*ଥେସଲନୀକୀୟଙ|ଥେସଲନୀକୀୟଙ୍କ[\s\xa0]*ପ୍ରତି[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Thess"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*ଥେସଲନୀକୀୟଙ|Thess|\.[\s\xa0]*ଥେସଲନୀକୀୟଙ)|ପ୍ରଥମ[\s\xa0]*ଥେସଲନୀକୀୟଙ|ଥେସଲନୀକୀୟଙ୍କ[\s\xa0]*ପ୍ରତି[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["2Tim"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ତୀମଥିଙ୍କ|Tim|\.[\s\xa0]*ତୀମଥିଙ୍କ)|ଦ୍ୱିତୀୟ[\s\xa0]*ତୀମଥିଙ୍କ|ତୀମଥିଙ୍କ[\s\xa0]*ପ୍ରତି[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Tim"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1(?:[\s\xa0]*ତୀମଥିଙ୍କ|Tim|\.[\s\xa0]*ତୀମଥିଙ୍କ)|ପ୍ରଥମ[\s\xa0]*ତୀମଥିଙ୍କ|ତୀମଥିଙ୍କ[\s\xa0]*ପ୍ରତି[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Titus"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ତୀତସଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Titus))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Phlm"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଫିଲୀମୋନଙ୍କ(?:[\\s\\xa0]*ପ୍ରତି[\\s\\xa0]*ପତ୍ର)?|Phlm))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Heb"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଏବ୍ରୀ|Heb))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jas"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯାକୁବଙ୍କ(?:[\\s\\xa0]*ପତ୍ର)?|Jas))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Pet"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2(?:[\s\xa0]*ପିତରଙ|Pet|\.[\s\xa0]*ପିତରଙ)|ଦ୍ୱିତୀୟ[\s\xa0]*ପିତରଙ|ପିତରଙ୍କ[\s\xa0]*ଦ୍ୱିତୀୟ[\s\xa0]*ପତ୍ର))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Pet"], regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:ପ(?:ିତରଙ୍କ[\s\xa0]*ପ୍ରଥମ[\s\xa0]*ପତ୍ର|୍ରଥମ[\s\xa0]*ପିତରଙ)|1(?:[\s\xa0]*ପିତରଙ|Pet|\.[\s\xa0]*ପିତରଙ)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["Jude"], regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:ଯିହୂଦାଙ୍କ(?:[\\s\\xa0]*ପତ୍ର)?|Jude))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Tob"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Tob))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Jdt"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Jdt))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Bar"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Bar))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["Sus"], apocrypha: true, regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Sus))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") }, { osis: ["2Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:2Macc))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["3Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:3Macc))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["4Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:4Macc))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi }, { osis: ["1Macc"], apocrypha: true, regexp: /(^|[^0-9A-Za-zଁଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ଼-ଽିୁ-ୄ୍ୖଡ଼-ଢ଼ୟ-ୣୱ])((?:1Macc))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi } ]; if (include_apocrypha === true && case_sensitive === "none") { return books; } out = []; for (k = 0, len = books.length; k < len; k++) { book = books[k]; if (include_apocrypha === false && (book.apocrypha != null) && book.apocrypha === true) { continue; } if (case_sensitive === "books") { book.regexp = new RegExp(book.regexp.source, "g"); } out.push(book); } return out; }; bcv_parser.prototype.regexps.books = bcv_parser.prototype.regexps.get_books(false, "none"); var grammar; /* * Generated by PEG.js 0.10.0. * * http://pegjs.org/ */ (function(root) { "use strict"; function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function peg$SyntaxError(message, expected, found, location) { this.message = message; this.expected = expected; this.found = found; this.location = location; this.name = "SyntaxError"; if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, peg$SyntaxError); } } peg$subclass(peg$SyntaxError, Error); peg$SyntaxError.buildMessage = function(expected, found) { var DESCRIBE_EXPECTATION_FNS = { literal: function(expectation) { return "\"" + literalEscape(expectation.text) + "\""; }, "class": function(expectation) { var escapedParts = "", i; for (i = 0; i < expectation.parts.length; i++) { escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); } return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; }, any: function(expectation) { return "any character"; }, end: function(expectation) { return "end of input"; }, other: function(expectation) { return expectation.description; } }; function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } function literalEscape(s) { return s .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\0/g, '\\0') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); } function classEscape(s) { return s .replace(/\\/g, '\\\\') .replace(/\]/g, '\\]') .replace(/\^/g, '\\^') .replace(/-/g, '\\-') .replace(/\0/g, '\\0') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); } function describeExpectation(expectation) { return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); } function describeExpected(expected) { var descriptions = new Array(expected.length), i, j; for (i = 0; i < expected.length; i++) { descriptions[i] = describeExpectation(expected[i]); } descriptions.sort(); if (descriptions.length > 0) { for (i = 1, j = 1; i < descriptions.length; i++) { if (descriptions[i - 1] !== descriptions[i]) { descriptions[j] = descriptions[i]; j++; } } descriptions.length = j; } switch (descriptions.length) { case 1: return descriptions[0]; case 2: return descriptions[0] + " or " + descriptions[1]; default: return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; } } function describeFound(found) { return found ? "\"" + literalEscape(found) + "\"" : "end of input"; } return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; }; function peg$parse(input, options) { options = options !== void 0 ? options : {}; var peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = function(val_1, val_2) { val_2.unshift([val_1]); return {"type": "sequence", "value": val_2, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c1 = "(", peg$c2 = peg$literalExpectation("(", false), peg$c3 = ")", peg$c4 = peg$literalExpectation(")", false), peg$c5 = function(val_1, val_2) { if (typeof(val_2) === "undefined") val_2 = []; val_2.unshift([val_1]); return {"type": "sequence_post_enclosed", "value": val_2, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c6 = function(val_1, val_2) { if (val_1.length && val_1.length === 2) val_1 = val_1[0]; // for `b`, which returns [object, undefined] return {"type": "range", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c7 = "\x1F", peg$c8 = peg$literalExpectation("\x1F", false), peg$c9 = "/", peg$c10 = peg$literalExpectation("/", false), peg$c11 = /^[1-8]/, peg$c12 = peg$classExpectation([["1", "8"]], false, false), peg$c13 = function(val) { return {"type": "b", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c14 = function(val_1, val_2) { return {"type": "bc", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c15 = ",", peg$c16 = peg$literalExpectation(",", false), peg$c17 = function(val_1, val_2) { return {"type": "bc_title", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c18 = ".", peg$c19 = peg$literalExpectation(".", false), peg$c20 = function(val_1, val_2) { return {"type": "bcv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c21 = "-", peg$c22 = peg$literalExpectation("-", false), peg$c23 = function(val_1, val_2, val_3, val_4) { return {"type": "range", "value": [{"type": "bcv", "value": [{"type": "bc", "value": [val_1, val_2], "indices": [val_1.indices[0], val_2.indices[1]]}, val_3], "indices": [val_1.indices[0], val_3.indices[1]]}, val_4], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c24 = function(val_1, val_2) { return {"type": "bv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c25 = function(val_1, val_2) { return {"type": "bc", "value": [val_2, val_1], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c26 = function(val_1, val_2, val_3) { return {"type": "cb_range", "value": [val_3, val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c27 = "th", peg$c28 = peg$literalExpectation("th", false), peg$c29 = "nd", peg$c30 = peg$literalExpectation("nd", false), peg$c31 = "st", peg$c32 = peg$literalExpectation("st", false), peg$c33 = "/1\x1F", peg$c34 = peg$literalExpectation("/1\x1F", false), peg$c35 = function(val) { return {"type": "c_psalm", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c36 = function(val_1, val_2) { return {"type": "cv_psalm", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c37 = function(val_1, val_2) { return {"type": "c_title", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c38 = function(val_1, val_2) { return {"type": "cv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c39 = function(val) { return {"type": "c", "value": [val], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c40 = "ff", peg$c41 = peg$literalExpectation("ff", false), peg$c42 = /^[a-z]/, peg$c43 = peg$classExpectation([["a", "z"]], false, false), peg$c44 = function(val_1) { return {"type": "ff", "value": [val_1], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c45 = function(val_1, val_2) { return {"type": "integer_title", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c46 = "/9\x1F", peg$c47 = peg$literalExpectation("/9\x1F", false), peg$c48 = function(val) { return {"type": "context", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c49 = "/2\x1F", peg$c50 = peg$literalExpectation("/2\x1F", false), peg$c51 = ".1", peg$c52 = peg$literalExpectation(".1", false), peg$c53 = /^[0-9]/, peg$c54 = peg$classExpectation([["0", "9"]], false, false), peg$c55 = function(val) { return {"type": "bc", "value": [val, {"type": "c", "value": [{"type": "integer", "value": 151, "indices": [peg$currPos - 2, peg$currPos - 1]}], "indices": [peg$currPos - 2, peg$currPos - 1]}], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c56 = function(val_1, val_2) { return {"type": "bcv", "value": [val_1, {"type": "v", "value": [val_2], "indices": [val_2.indices[0], val_2.indices[1]]}], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c57 = /^[\u0B16]/i, peg$c58 = peg$classExpectation(["\u0B16"], false, true), peg$c59 = function(val) { return {"type": "v", "value": [val], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c60 = "chapter", peg$c61 = peg$literalExpectation("chapter", false), peg$c62 = function() { return {"type": "c_explicit"} }, peg$c63 = "verse", peg$c64 = peg$literalExpectation("verse", false), peg$c65 = function() { return {"type": "v_explicit"} }, peg$c66 = ":", peg$c67 = peg$literalExpectation(":", false), peg$c68 = /^["']/, peg$c69 = peg$classExpectation(["\"", "'"], false, false), peg$c70 = /^[,;\/:&\-\u2013\u2014~]/, peg$c71 = peg$classExpectation([",", ";", "/", ":", "&", "-", "\u2013", "\u2014", "~"], false, false), peg$c72 = "and", peg$c73 = peg$literalExpectation("and", false), peg$c74 = function() { return "" }, peg$c75 = /^[\-\u2013\u2014]/, peg$c76 = peg$classExpectation(["-", "\u2013", "\u2014"], false, false), peg$c77 = "\u0B20\u0B3E\u0B30\u0B41", peg$c78 = peg$literalExpectation("\u0B20\u0B3E\u0B30\u0B41", true), peg$c79 = "title", peg$c80 = peg$literalExpectation("title", false), peg$c81 = function(val) { return {type:"title", value: [val], "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c82 = "from", peg$c83 = peg$literalExpectation("from", false), peg$c84 = "of", peg$c85 = peg$literalExpectation("of", false), peg$c86 = "in", peg$c87 = peg$literalExpectation("in", false), peg$c88 = "the", peg$c89 = peg$literalExpectation("the", false), peg$c90 = "book", peg$c91 = peg$literalExpectation("book", false), peg$c92 = /^[([]/, peg$c93 = peg$classExpectation(["(", "["], false, false), peg$c94 = /^[)\]]/, peg$c95 = peg$classExpectation([")", "]"], false, false), peg$c96 = function(val) { return {"type": "translation_sequence", "value": val, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c97 = "\x1E", peg$c98 = peg$literalExpectation("\x1E", false), peg$c99 = function(val) { return {"type": "translation", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c100 = ",000", peg$c101 = peg$literalExpectation(",000", false), peg$c102 = function(val) { return {"type": "integer", "value": parseInt(val.join(""), 10), "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c103 = /^[^\x1F\x1E([]/, peg$c104 = peg$classExpectation(["\x1F", "\x1E", "(", "["], true, false), peg$c105 = function(val) { return {"type": "word", "value": val.join(""), "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c106 = function(val) { return {"type": "stop", "value": val, "indices": [peg$savedPos, peg$currPos - 1]} }, peg$c107 = /^[\s\xa0*]/, peg$c108 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0", "*"], false, false), peg$currPos = 0, peg$savedPos = 0, peg$posDetailsCache = [{ line: 1, column: 1 }], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); } peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } if ("punctuation_strategy" in options && options.punctuation_strategy === "eu") { peg$parsecv_sep = peg$parseeu_cv_sep; peg$c70 = /^[;\/:&\-\u2013\u2014~]/; } function text() { return input.substring(peg$savedPos, peg$currPos); } function location() { return peg$computeLocation(peg$savedPos, peg$currPos); } function expected(description, location) { location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) throw peg$buildStructuredError( [peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location ); } function error(message, location) { location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos) throw peg$buildSimpleError(message, location); } function peg$literalExpectation(text, ignoreCase) { return { type: "literal", text: text, ignoreCase: ignoreCase }; } function peg$classExpectation(parts, inverted, ignoreCase) { return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; } function peg$anyExpectation() { return { type: "any" }; } function peg$endExpectation() { return { type: "end" }; } function peg$otherExpectation(description) { return { type: "other", description: description }; } function peg$computePosDetails(pos) { var details = peg$posDetailsCache[pos], p; if (details) { return details; } else { p = pos - 1; while (!peg$posDetailsCache[p]) { p--; } details = peg$posDetailsCache[p]; details = { line: details.line, column: details.column }; while (p < pos) { if (input.charCodeAt(p) === 10) { details.line++; details.column = 1; } else { details.column++; } p++; } peg$posDetailsCache[pos] = details; return details; } } function peg$computeLocation(startPos, endPos) { var startPosDetails = peg$computePosDetails(startPos), endPosDetails = peg$computePosDetails(endPos); return { start: { offset: startPos, line: startPosDetails.line, column: startPosDetails.column }, end: { offset: endPos, line: endPosDetails.line, column: endPosDetails.column } }; } function peg$fail(expected) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected); } function peg$buildSimpleError(message, location) { return new peg$SyntaxError(message, null, null, location); } function peg$buildStructuredError(expected, found, location) { return new peg$SyntaxError( peg$SyntaxError.buildMessage(expected, found), expected, found, location ); } function peg$parsestart() { var s0, s1; s0 = []; s1 = peg$parsebcv_hyphen_range(); if (s1 === peg$FAILED) { s1 = peg$parsesequence(); if (s1 === peg$FAILED) { s1 = peg$parsecb_range(); if (s1 === peg$FAILED) { s1 = peg$parserange(); if (s1 === peg$FAILED) { s1 = peg$parseff(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parseb(); if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence_enclosed(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence(); if (s1 === peg$FAILED) { s1 = peg$parsesequence_sep(); if (s1 === peg$FAILED) { s1 = peg$parsec_title(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_title(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsev_letter(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); if (s1 === peg$FAILED) { s1 = peg$parseword(); if (s1 === peg$FAILED) { s1 = peg$parseword_parenthesis(); if (s1 === peg$FAILED) { s1 = peg$parsecontext(); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); s1 = peg$parsebcv_hyphen_range(); if (s1 === peg$FAILED) { s1 = peg$parsesequence(); if (s1 === peg$FAILED) { s1 = peg$parsecb_range(); if (s1 === peg$FAILED) { s1 = peg$parserange(); if (s1 === peg$FAILED) { s1 = peg$parseff(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parseb(); if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence_enclosed(); if (s1 === peg$FAILED) { s1 = peg$parsetranslation_sequence(); if (s1 === peg$FAILED) { s1 = peg$parsesequence_sep(); if (s1 === peg$FAILED) { s1 = peg$parsec_title(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_title(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsev_letter(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); if (s1 === peg$FAILED) { s1 = peg$parseword(); if (s1 === peg$FAILED) { s1 = peg$parseword_parenthesis(); if (s1 === peg$FAILED) { s1 = peg$parsecontext(); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } else { s0 = peg$FAILED; } return s0; } function peg$parsesequence() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsecb_range(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_hyphen_range(); if (s1 === peg$FAILED) { s1 = peg$parserange(); if (s1 === peg$FAILED) { s1 = peg$parseff(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parseb(); if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsecontext(); } } } } } } } } } } } } } } } } } } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsesequence_sep(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parsesequence_post(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsesequence_sep(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parsesequence_post(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c0(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsesequence_post_enclosed() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c1; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c2); } } if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { s3 = peg$parsesequence_sep(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsesequence_post(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 === peg$FAILED) { s7 = null; } if (s7 !== peg$FAILED) { s8 = peg$parsesequence_post(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 === peg$FAILED) { s7 = null; } if (s7 !== peg$FAILED) { s8 = peg$parsesequence_post(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c3; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c5(s4, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsesequence_post() { var s0; s0 = peg$parsesequence_post_enclosed(); if (s0 === peg$FAILED) { s0 = peg$parsecb_range(); if (s0 === peg$FAILED) { s0 = peg$parsebcv_hyphen_range(); if (s0 === peg$FAILED) { s0 = peg$parserange(); if (s0 === peg$FAILED) { s0 = peg$parseff(); if (s0 === peg$FAILED) { s0 = peg$parsebcv_comma(); if (s0 === peg$FAILED) { s0 = peg$parsebc_title(); if (s0 === peg$FAILED) { s0 = peg$parseps151_bcv(); if (s0 === peg$FAILED) { s0 = peg$parsebcv(); if (s0 === peg$FAILED) { s0 = peg$parsebcv_weak(); if (s0 === peg$FAILED) { s0 = peg$parseps151_bc(); if (s0 === peg$FAILED) { s0 = peg$parsebc(); if (s0 === peg$FAILED) { s0 = peg$parsecv_psalm(); if (s0 === peg$FAILED) { s0 = peg$parsebv(); if (s0 === peg$FAILED) { s0 = peg$parsec_psalm(); if (s0 === peg$FAILED) { s0 = peg$parseb(); if (s0 === peg$FAILED) { s0 = peg$parsecbv(); if (s0 === peg$FAILED) { s0 = peg$parsecbv_ordinal(); if (s0 === peg$FAILED) { s0 = peg$parsecb(); if (s0 === peg$FAILED) { s0 = peg$parsecb_ordinal(); if (s0 === peg$FAILED) { s0 = peg$parsec_title(); if (s0 === peg$FAILED) { s0 = peg$parseinteger_title(); if (s0 === peg$FAILED) { s0 = peg$parsecv(); if (s0 === peg$FAILED) { s0 = peg$parsecv_weak(); if (s0 === peg$FAILED) { s0 = peg$parsev_letter(); if (s0 === peg$FAILED) { s0 = peg$parseinteger(); if (s0 === peg$FAILED) { s0 = peg$parsec(); if (s0 === peg$FAILED) { s0 = peg$parsev(); } } } } } } } } } } } } } } } } } } } } } } } } } } } return s0; } function peg$parserange() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parsebcv_comma(); if (s1 === peg$FAILED) { s1 = peg$parsebc_title(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsecv_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$currPos; s2 = peg$parseb(); if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$currPos; s5 = peg$parserange_sep(); if (s5 !== peg$FAILED) { s6 = peg$parsebcv_comma(); if (s6 === peg$FAILED) { s6 = peg$parsebc_title(); if (s6 === peg$FAILED) { s6 = peg$parseps151_bcv(); if (s6 === peg$FAILED) { s6 = peg$parsebcv(); if (s6 === peg$FAILED) { s6 = peg$parsebcv_weak(); if (s6 === peg$FAILED) { s6 = peg$parseps151_bc(); if (s6 === peg$FAILED) { s6 = peg$parsebc(); if (s6 === peg$FAILED) { s6 = peg$parsebv(); if (s6 === peg$FAILED) { s6 = peg$parseb(); } } } } } } } } if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } peg$silentFails--; if (s4 !== peg$FAILED) { peg$currPos = s3; s3 = void 0; } else { s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s2 = [s2, s3]; s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 === peg$FAILED) { s1 = peg$parsecbv(); if (s1 === peg$FAILED) { s1 = peg$parsecbv_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsec_psalm(); if (s1 === peg$FAILED) { s1 = peg$parsecb(); if (s1 === peg$FAILED) { s1 = peg$parsecb_ordinal(); if (s1 === peg$FAILED) { s1 = peg$parsec_title(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_title(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsev_letter(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); } } } } } } } } } } } } } } } } } } } } } } if (s1 !== peg$FAILED) { s2 = peg$parserange_sep(); if (s2 !== peg$FAILED) { s3 = peg$parseff(); if (s3 === peg$FAILED) { s3 = peg$parsebcv_comma(); if (s3 === peg$FAILED) { s3 = peg$parsebc_title(); if (s3 === peg$FAILED) { s3 = peg$parseps151_bcv(); if (s3 === peg$FAILED) { s3 = peg$parsebcv(); if (s3 === peg$FAILED) { s3 = peg$parsebcv_weak(); if (s3 === peg$FAILED) { s3 = peg$parseps151_bc(); if (s3 === peg$FAILED) { s3 = peg$parsebc(); if (s3 === peg$FAILED) { s3 = peg$parsecv_psalm(); if (s3 === peg$FAILED) { s3 = peg$parsebv(); if (s3 === peg$FAILED) { s3 = peg$parseb(); if (s3 === peg$FAILED) { s3 = peg$parsecbv(); if (s3 === peg$FAILED) { s3 = peg$parsecbv_ordinal(); if (s3 === peg$FAILED) { s3 = peg$parsec_psalm(); if (s3 === peg$FAILED) { s3 = peg$parsecb(); if (s3 === peg$FAILED) { s3 = peg$parsecb_ordinal(); if (s3 === peg$FAILED) { s3 = peg$parsec_title(); if (s3 === peg$FAILED) { s3 = peg$parseinteger_title(); if (s3 === peg$FAILED) { s3 = peg$parsecv(); if (s3 === peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parseinteger(); if (s3 === peg$FAILED) { s3 = peg$parsecv_weak(); if (s3 === peg$FAILED) { s3 = peg$parsec(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } } } } } } } } } } } } } } } } } } } } } } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c6(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseb() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { s4 = peg$c9; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s4 !== peg$FAILED) { if (peg$c11.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 31) { s4 = peg$c7; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c13(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebc() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsec(); if (s6 !== peg$FAILED) { s7 = peg$parsecv_sep(); if (s7 !== peg$FAILED) { s8 = peg$parsev(); if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } peg$silentFails--; if (s5 !== peg$FAILED) { peg$currPos = s4; s4 = void 0; } else { s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parsecv_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep(); } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parsecv_sep_weak(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep_weak(); } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parserange_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parserange_sep(); } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = peg$parsesp(); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsec(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c14(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebc_comma() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c15; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { s5 = peg$parsec(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c14(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebc_title() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); } if (s1 !== peg$FAILED) { s2 = peg$parsetitle(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c17(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebcv() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c18; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s4 !== peg$FAILED) { s5 = peg$parsev_explicit(); if (s5 !== peg$FAILED) { s6 = peg$parsev(); if (s6 !== peg$FAILED) { s4 = [s4, s5, s6]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 === peg$FAILED) { s3 = peg$currPos; s4 = peg$parsesequence_sep(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parsev_explicit(); if (s5 !== peg$FAILED) { s6 = peg$parsecv(); if (s6 !== peg$FAILED) { s4 = [s4, s5, s6]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } peg$silentFails--; if (s3 === peg$FAILED) { s2 = void 0; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = peg$parsecv_sep(); if (s4 === peg$FAILED) { s4 = peg$parsesequence_sep(); } if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parsev_explicit(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 === peg$FAILED) { s3 = peg$parsecv_sep(); } if (s3 !== peg$FAILED) { s4 = peg$parsev_letter(); if (s4 === peg$FAILED) { s4 = peg$parsev(); } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c20(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebcv_weak() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); } if (s1 !== peg$FAILED) { s2 = peg$parsecv_sep_weak(); if (s2 !== peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsecv_sep(); if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c20(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebcv_comma() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parsebc_comma(); if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c15; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { s5 = peg$parsev_letter(); if (s5 === peg$FAILED) { s5 = peg$parsev(); } if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; s7 = peg$currPos; s8 = peg$parsecv_sep(); if (s8 !== peg$FAILED) { s9 = peg$parsev(); if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c20(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebcv_hyphen_range() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s2 = peg$c21; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c22); } } if (s2 === peg$FAILED) { s2 = peg$parsespace(); } if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { s3 = peg$parsec(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s4 = peg$c21; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c22); } } if (s4 !== peg$FAILED) { s5 = peg$parsev(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s6 = peg$c21; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c22); } } if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c23(s1, s3, s5, s7); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebv() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseb(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsecv_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep(); } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parsecv_sep_weak(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsecv_sep_weak(); } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = []; s3 = peg$parserange_sep(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parserange_sep(); } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = peg$currPos; s3 = []; s4 = peg$parsesequence_sep(); if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsesequence_sep(); } } else { s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$parsev_explicit(); peg$silentFails--; if (s5 !== peg$FAILED) { peg$currPos = s4; s4 = void 0; } else { s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = peg$parsesp(); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c24(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecb() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$parsein_book_of(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parseb(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c25(s2, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecb_range() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$parserange_sep(); if (s3 !== peg$FAILED) { s4 = peg$parsec(); if (s4 !== peg$FAILED) { s5 = peg$parsein_book_of(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { s6 = peg$parseb(); if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c26(s2, s4, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecbv() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsecb(); if (s1 !== peg$FAILED) { s2 = peg$parsesequence_sep(); if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsev(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c20(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecb_ordinal() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsec(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c27) { s2 = peg$c27; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c28); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c29) { s2 = peg$c29; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c30); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c31) { s2 = peg$c31; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c32); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsec_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsein_book_of(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parseb(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c25(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecbv_ordinal() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsecb_ordinal(); if (s1 !== peg$FAILED) { s2 = peg$parsesequence_sep(); if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsev(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c20(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsec_psalm() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c33) { s3 = peg$c33; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c35(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecv_psalm() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsec_psalm(); if (s1 !== peg$FAILED) { s2 = peg$parsesequence_sep(); if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { s3 = peg$parsev_explicit(); if (s3 !== peg$FAILED) { s4 = peg$parsev(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c36(s1, s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsec_title() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$parsetitle(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c37(s2, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecv() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsev_explicit(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = peg$parsec(); if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s5 = peg$c18; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s5 !== peg$FAILED) { s6 = peg$parsev_explicit(); if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { s5 = [s5, s6, s7]; s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } peg$silentFails--; if (s4 === peg$FAILED) { s3 = void 0; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$currPos; s5 = peg$parsecv_sep(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { s6 = peg$parsev_explicit(); if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 === peg$FAILED) { s4 = peg$parsecv_sep(); } if (s4 !== peg$FAILED) { s5 = peg$parsev_letter(); if (s5 === peg$FAILED) { s5 = peg$parsev(); } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c38(s2, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecv_weak() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsec(); if (s1 !== peg$FAILED) { s2 = peg$parsecv_sep_weak(); if (s2 !== peg$FAILED) { s3 = peg$parsev_letter(); if (s3 === peg$FAILED) { s3 = peg$parsev(); } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsecv_sep(); if (s6 !== peg$FAILED) { s7 = peg$parsev(); if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c38(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsec() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parsec_explicit(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = peg$parseinteger(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c39(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseff() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parsebcv(); if (s1 === peg$FAILED) { s1 = peg$parsebcv_weak(); if (s1 === peg$FAILED) { s1 = peg$parsebc(); if (s1 === peg$FAILED) { s1 = peg$parsebv(); if (s1 === peg$FAILED) { s1 = peg$parsecv(); if (s1 === peg$FAILED) { s1 = peg$parsecv_weak(); if (s1 === peg$FAILED) { s1 = peg$parseinteger(); if (s1 === peg$FAILED) { s1 = peg$parsec(); if (s1 === peg$FAILED) { s1 = peg$parsev(); } } } } } } } } if (s1 !== peg$FAILED) { s2 = peg$parsesp(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c40) { s3 = peg$c40; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s3 !== peg$FAILED) { s4 = peg$parseabbrev(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$currPos; peg$silentFails++; if (peg$c42.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c43); } } peg$silentFails--; if (s6 === peg$FAILED) { s5 = void 0; } else { peg$currPos = s5; s5 = peg$FAILED; } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c44(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseinteger_title() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parseinteger(); if (s1 !== peg$FAILED) { s2 = peg$parsetitle(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c45(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecontext() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c46) { s3 = peg$c46; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseps151_b() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 31) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c49) { s3 = peg$c49; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c13(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseps151_bc() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parseps151_b(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c51) { s2 = peg$c51; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (peg$c53.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c54); } } peg$silentFails--; if (s4 === peg$FAILED) { s3 = void 0; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c55(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseps151_bcv() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parseps151_bc(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s2 = peg$c18; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s2 !== peg$FAILED) { s3 = peg$parseinteger(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c56(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsev_letter() { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsev_explicit(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = peg$parseinteger(); if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; if (input.substr(peg$currPos, 2) === peg$c40) { s5 = peg$c40; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (peg$c57.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c58); } } if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; if (peg$c42.test(input.charAt(peg$currPos))) { s7 = input.charAt(peg$currPos); peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c43); } } peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c59(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsev() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parsev_explicit(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = peg$parseinteger(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c59(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsec_explicit() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c60) { s2 = peg$c60; peg$currPos += 7; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c61); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c62(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsev_explicit() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c63) { s2 = peg$c63; peg$currPos += 5; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c64); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (peg$c42.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c43); } } peg$silentFails--; if (s4 === peg$FAILED) { s3 = void 0; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c65(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecv_sep() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = []; if (input.charCodeAt(peg$currPos) === 58) { s3 = peg$c66; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c67); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (input.charCodeAt(peg$currPos) === 58) { s3 = peg$c66; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c67); } } } } else { s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s7 = peg$c18; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s9 = peg$c18; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s9 !== peg$FAILED) { s6 = [s6, s7, s8, s9]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsecv_sep_weak() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (peg$c68.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parsespace(); } return s0; } function peg$parsesequence_sep() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = []; if (peg$c70.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c71); } } if (s2 === peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s7 = peg$c18; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s9 = peg$c18; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s9 !== peg$FAILED) { s6 = [s6, s7, s8, s9]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c72) { s2 = peg$c72; peg$currPos += 3; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s2 === peg$FAILED) { s2 = peg$parsespace(); } } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c70.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c71); } } if (s2 === peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = peg$currPos; peg$silentFails++; s5 = peg$currPos; s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s7 = peg$c18; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s9 = peg$c18; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s9 !== peg$FAILED) { s6 = [s6, s7, s8, s9]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c72) { s2 = peg$c72; peg$currPos += 3; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s2 === peg$FAILED) { s2 = peg$parsespace(); } } } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c74(); } s0 = s1; return s0; } function peg$parserange_sep() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; if (peg$c75.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.substr(peg$currPos, 4).toLowerCase() === peg$c77) { s4 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c78); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; if (peg$c75.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.substr(peg$currPos, 4).toLowerCase() === peg$c77) { s4 = input.substr(peg$currPos, 4); peg$currPos += 4; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c78); } } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } } } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsetitle() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$parsecv_sep(); if (s1 === peg$FAILED) { s1 = peg$parsesequence_sep(); } if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c79) { s2 = peg$c79; peg$currPos += 5; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c80); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c81(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsein_book_of() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c82) { s2 = peg$c82; peg$currPos += 4; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c84) { s2 = peg$c84; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c85); } } if (s2 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c86) { s2 = peg$c86; peg$currPos += 2; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c87); } } } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s4 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c88) { s5 = peg$c88; peg$currPos += 3; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s5 !== peg$FAILED) { s6 = peg$parsesp(); if (s6 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c90) { s7 = peg$c90; peg$currPos += 4; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s7 !== peg$FAILED) { s8 = peg$parsesp(); if (s8 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c84) { s9 = peg$c84; peg$currPos += 2; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c85); } } if (s9 !== peg$FAILED) { s10 = peg$parsesp(); if (s10 !== peg$FAILED) { s5 = [s5, s6, s7, s8, s9, s10]; s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s1 = [s1, s2, s3, s4]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseabbrev() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s2 = peg$c18; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$currPos; s5 = peg$parsesp(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s6 = peg$c18; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s6 !== peg$FAILED) { s7 = peg$parsesp(); if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s8 = peg$c18; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s8 !== peg$FAILED) { s5 = [s5, s6, s7, s8]; s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } peg$silentFails--; if (s4 === peg$FAILED) { s3 = void 0; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseeu_cv_sep() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s2 = peg$c15; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsetranslation_sequence_enclosed() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { if (peg$c92.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c93); } } if (s2 !== peg$FAILED) { s3 = peg$parsesp(); if (s3 !== peg$FAILED) { s4 = peg$currPos; s5 = peg$parsetranslation(); if (s5 !== peg$FAILED) { s6 = []; s7 = peg$currPos; s8 = peg$parsesequence_sep(); if (s8 !== peg$FAILED) { s9 = peg$parsetranslation(); if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } while (s7 !== peg$FAILED) { s6.push(s7); s7 = peg$currPos; s8 = peg$parsesequence_sep(); if (s8 !== peg$FAILED) { s9 = peg$parsetranslation(); if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } if (s6 !== peg$FAILED) { s5 = [s5, s6]; s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s5 = peg$parsesp(); if (s5 !== peg$FAILED) { if (peg$c94.test(input.charAt(peg$currPos))) { s6 = input.charAt(peg$currPos); peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c95); } } if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c96(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsetranslation_sequence() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsesp(); if (s1 !== peg$FAILED) { s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c15; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s3 !== peg$FAILED) { s4 = peg$parsesp(); if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = peg$parsetranslation(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 !== peg$FAILED) { s8 = peg$parsetranslation(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$currPos; s7 = peg$parsesequence_sep(); if (s7 !== peg$FAILED) { s8 = peg$parsetranslation(); if (s8 !== peg$FAILED) { s7 = [s7, s8]; s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c96(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsetranslation() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 30) { s1 = peg$c97; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s1 !== peg$FAILED) { s2 = peg$parseany_integer(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 30) { s3 = peg$c97; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c99(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseinteger() { var res; if (res = /^[0-9]{1,3}(?!\d|,000)/.exec(input.substr(peg$currPos))) { peg$savedPos = peg$currPos; peg$currPos += res[0].length; return {"type": "integer", "value": parseInt(res[0], 10), "indices": [peg$savedPos, peg$currPos - 1]} } else { return peg$FAILED; } } function peg$parseany_integer() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c53.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c53.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c54); } } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c102(s1); } s0 = s1; return s0; } function peg$parseword() { var s0, s1, s2; s0 = peg$currPos; s1 = []; if (peg$c103.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c103.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c104); } } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c105(s1); } s0 = s1; return s0; } function peg$parseword_parenthesis() { var s0, s1; s0 = peg$currPos; if (peg$c92.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c93); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c106(s1); } s0 = s1; return s0; } function peg$parsesp() { var s0; s0 = peg$parsespace(); if (s0 === peg$FAILED) { s0 = null; } return s0; } function peg$parsespace() { var res; if (res = /^[\s\xa0*]+/.exec(input.substr(peg$currPos))) { peg$currPos += res[0].length; return []; } return peg$FAILED; } peg$result = peg$startRuleFunction(); if (peg$result !== peg$FAILED && peg$currPos === input.length) { return peg$result; } else { if (peg$result !== peg$FAILED && peg$currPos < input.length) { peg$fail(peg$endExpectation()); } throw peg$buildStructuredError( peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) ); } } grammar = { SyntaxError: peg$SyntaxError, parse: peg$parse }; })(this); }).call(this);
openbibleinfo/Bible-Passage-Reference-Parser
js/or_bcv_parser.js
JavaScript
mit
256,354
const path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const PATHS = { SRC: path.join(__dirname, 'src') }; const webpackConfig = { entry: ['./src/index.jsx'], plugins: [new ExtractTextPlugin('style.css')], devtool: 'source-map', node: { fs: 'empty' }, output: { path: __dirname, publicPath: '/', filename: 'bundle.js' }, module: { rules: [ { test: /\.(js|jsx)?$/, use: [ { loader: 'eslint-loader' } ], include: [PATHS.SRC], enforce: 'pre' }, { test: /\.jsx?$/, include: [path.resolve('src')], exclude: /node_modules/, use: [ { loader: 'babel-loader', options: { cacheDirectory: true } } ] }, { test: /\.css$/, use: ['style-loader', 'css-loader'] }, { test: /\.(woff|eot|ttf|woff2)$/, use: { loader: 'url-loader' } }, { test: /\.(jpg|gif|png|svg)$/, use: { loader: 'file-loader?name=[name].[hash].[ext]' } } ] }, resolve: { extensions: ['.js', '.jsx'] }, devServer: { historyApiFallback: true, contentBase: './' } }; module.exports = webpackConfig;
stanimirtt/react-shopping-cart
react-redux-shopping-cart/webpack.config.js
JavaScript
mit
1,388
var ctx,canvasWidth,canvasHeight; var img_pyr; var img_ryp; var lowpass1, lowpass2; function demo_app(videoWidth, videoHeight) { savnac.width = canvas.width = videoWidth savnac.height = canvas.height = videoHeight vidWidth = videoWidth vidHeight = videoHeight // canvasWidth = canvas.width; // canvasHeight = canvas.height; ctx = canvas.getContext('2d'); xtc = savnac.getContext('2d') ctx.fillStyle = "rgb(0,255,0)"; ctx.strokeStyle = "rgb(0,255,0)"; var num_deep = 5; img_pyr = new color_pyr(videoWidth, videoHeight, num_deep) img_ryp = new color_pyr(videoWidth, videoHeight, num_deep) lowpass1 = new color_pyr(videoWidth, videoHeight, num_deep) lowpass2 = new color_pyr(videoWidth, videoHeight, num_deep) filtered = new color_pyr(videoWidth, videoHeight, num_deep) } function color_pyr(W, H, num_deep){ function init_pyr(){ var pyr = new jsfeat.pyramid_t(num_deep); pyr.allocate(W, H, jsfeat.F32_t | jsfeat.C1_t); return pyr; } this.levels = num_deep; this.W = W; this.H = H; this.Y = init_pyr(); this.U = init_pyr(); this.V = init_pyr(); } color_pyr.prototype.pyrDown = function(){ function downchan(chan){ var i = 2, a = chan.data[0], b = chan.data[1]; jsfeat.imgproc.pyrdown(a, b); for(; i < chan.levels; i++){ a = b; b = chan.data[i]; jsfeat.imgproc.pyrdown(a, b); // jsfeat.imgproc.pyrup(b, img_ryp.data[i - 1]) } } downchan(this.Y); downchan(this.U); downchan(this.V); } color_pyr.prototype.pyrUp = function(source){ function upchan(chan, schan){ for(var i = 1; i < chan.levels; i++){ jsfeat.imgproc.pyrup(schan.data[i], chan.data[i - 1]) } } upchan(this.Y, source.Y) upchan(this.U, source.U) upchan(this.V, source.V) } color_pyr.prototype.lpyrUp = function(source){ function lchan(chan, schan){ var inner = chan.data[chan.levels - 2]; for(var i = 0; i < inner.cols * inner.rows; i++){ inner.data[i] = 0; } for(var i = chan.levels - 1; i > 0; i--){ jsfeat.imgproc.pyrup(chan.data[i], chan.data[i - 1]) imadd(chan.data[i - 1], schan.data[i - 1]) } } lchan(this.Y, source.Y) lchan(this.U, source.U) lchan(this.V, source.V) } color_pyr.prototype.lpyrDown = function(source){ function lchan(chan, schan){ for(var i = 0; i < chan.levels - 1; i++){ imsub(schan.data[i], chan.data[i]) } } lchan(this.Y, source.Y) lchan(this.U, source.U) lchan(this.V, source.V) } color_pyr.prototype.iirFilter = function(source, r){ function iir(chan, schan){ for(var i = 0; i < chan.levels - 1; i++){ var lpl = chan.data[i], pyl = schan.data[i]; for(var j = 0; j < pyl.cols * pyl.rows; j++) { lpl.data[j] = (1 - r) * lpl.data[j] + r * pyl.data[j]; } } } iir(this.Y, source.Y) iir(this.U, source.U) iir(this.V, source.V) } color_pyr.prototype.setSubtract = function(a, b) { function subp(chan, chana, chanb){ for(var i = 0; i < b.levels; i++){ var al = chana.data[i], bl = chanb.data[i], cl = chan.data[i]; for(var j = 0; j < al.cols * al.rows; j++) { cl.data[j] = (al.data[j] - bl.data[j]) } } } subp(this.Y, a.Y, b.Y) subp(this.U, a.U, b.U) subp(this.V, a.V, b.V) } color_pyr.prototype.fromRGBA = function(src) { var w = src.width, h = src.height; for(var y = 0; y < h; y++){ for(var x = 0; x < w; x++){ var r = src.data[(y * w + x) * 4], g = src.data[(y * w + x) * 4 + 1], b = src.data[(y * w + x) * 4 + 2]; var Y = r * .299000 + g * .587000 + b * .114000, U = r * -.168736 + g * -.331264 + b * .500000 + 128, V = r * .500000 + g * -.418688 + b * -.081312 + 128; this.Y.data[0].data[y * w + x] = Y; this.U.data[0].data[y * w + x] = U; this.V.data[0].data[y * w + x] = V; } } } color_pyr.prototype.mulLevel = function(n, c){ function mul(chan){ var d = chan.data[n]; for(var i = 0; i < d.cols * d.rows; i++){ d.data[i] *= c; } } mul(this.Y); mul(this.U); mul(this.V); } function immul(n, chan, schan, c){ var d = chan.data[n], e = schan.data[n]; for(var i = 0; i < d.cols * d.rows; i++){ d.data[i] = c * d.data[i] + e.data[i]; } } color_pyr.prototype.exportLayer = function(layer, dest) { var Yp = this.Y.data[layer].data, Up = this.U.data[layer].data, Vp = this.V.data[layer].data, Dd = dest.data; var w = this.Y.data[layer].cols, h = this.Y.data[layer].rows; for(var y = 0; y < h; y++){ for(var x = 0; x < w; x++){ var i = y * w + x; var Y = Yp[i], U = Up[i], V = Vp[i]; var r = Y + 1.4075 * (V - 128), g = Y - 0.3455 * (U - 128) - (0.7169 * (V - 128)), b = Y + 1.7790 * (U - 128); var n = 4 * (y * dest.width + x); Dd[n] = r; Dd[n + 1] = g; Dd[n + 2] = b; Dd[n + 3] = 255; } } } color_pyr.prototype.exportLayerRGB = function(layer, dest) { var Yp = this.Y.data[layer].data, Up = this.U.data[layer].data, Vp = this.V.data[layer].data, Dd = dest.data; var w = this.Y.data[layer].cols, h = this.Y.data[layer].rows; for(var y = 0; y < h; y++){ for(var x = 0; x < w; x++){ var i = y * w + x; var Y = Yp[i], U = Up[i], V = Vp[i]; var n = 4 * (y * dest.width + x); Dd[n] = 127 + 10 * Y; Dd[n + 1] = 127 + 10 * U; Dd[n + 2] = 127 + 10 * V; Dd[n + 3] = 255; } } } color_pyr.prototype.toRGBA = function(dest) { for(var i = 0; i < this.levels; i++) this.exportLayerRGB(i, dest); } function imadd(a, b){ var a_d = a.data, b_d = b.data; var w = a.cols, h = a.rows, n = w * h; for(var i = 0; i < n; ++i){ a_d[i] = a_d[i] + b_d[i]; } } function imsub(a, b){ var a_d = a.data, b_d = b.data; var w = a.cols, h = a.rows, n = w * h; for(var i = 0; i < n; ++i){ b_d[i] = (b_d[i] - a_d[i]); } } var first_frame = true; function evm(){ var imageData = ctx.getImageData(0, 0, vidWidth, vidHeight); img_pyr.fromRGBA(imageData) img_pyr.pyrDown() img_ryp.pyrUp(img_pyr) img_pyr.lpyrDown(img_ryp) lowpass1.iirFilter(img_pyr, r1); lowpass2.iirFilter(img_pyr, r2); filtered.setSubtract(lowpass1, lowpass2); var delta = lambda_c / 8 / (1+alpha); var lambda = Math.sqrt(vidHeight * vidHeight + vidWidth * vidWidth) / 3; // for(var n = filtered.levels - 1; n >= 0; n--){ for(var n = 0; n < filtered.levels; n++) { var currAlpha = lambda / delta / 8 - 1; currAlpha *= exaggeration_factor; if(n <= 0 || n == filtered.levels - 1) { filtered.mulLevel(n, 0) }else if(currAlpha > alpha){ filtered.mulLevel(n, alpha) }else{ filtered.mulLevel(n, currAlpha) } lambda = lambda / 2; } img_ryp.lpyrUp(filtered) var blah = ctx.createImageData(vidWidth, vidHeight) filtered.toRGBA(blah) xtc.putImageData(blah, 0, 0); var merp = ctx.createImageData(vidWidth, vidHeight) // img_ryp.toRGBA(merp) img_pyr.fromRGBA(imageData) // img_pyr.addLevel(0, img_ryp) immul(0, img_ryp.Y, img_pyr.Y, 1) immul(0, img_ryp.U, img_pyr.U, chromAttenuation) immul(0, img_ryp.V, img_pyr.V, chromAttenuation) img_ryp.exportLayer(0, merp) ctx.putImageData(merp, 0, 0); } function clamp(n) { return Math.max(0, Math.min(255, n))}
antimatter15/evm
color.js
JavaScript
mit
8,150
import { curry, range, always } from 'ramda' const FALSE = always(false) export const makeGrid = curry((cell, size) => { const r = range(0, size) return r.map((y) => r.map((x) => cell(y, x))) }) export const makeBlankGrid = makeGrid(FALSE)
alanrsoares/redux-game-of-life
src/lib/grid.js
JavaScript
mit
247
'use strict'; const resultsStorage = require('../lib/core/resultsStorage'); const moment = require('moment'); const expect = require('chai').expect; const timestamp = moment(); const timestampString = timestamp.format('YYYY-MM-DD-HH-mm-ss'); function createResultUrls(url, outputFolder, resultBaseURL) { return resultsStorage(url, timestamp, outputFolder, resultBaseURL).resultUrls; } describe('resultUrls', function() { describe('#hasBaseUrl', function() { it('should be false if base url is missing', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', undefined, undefined ); expect(resultUrls.hasBaseUrl()).to.be.false; }); it('should be true if base url is present', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', undefined, 'http://results.com' ); expect(resultUrls.hasBaseUrl()).to.be.true; }); }); describe('#reportSummaryUrl', function() { it('should create url with default output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', undefined, 'http://results.com' ); expect(resultUrls.reportSummaryUrl()).to.equal( `http://results.com/www.foo.bar/${timestampString}` ); }); it('should create url with absolute output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', '/root/leaf', 'http://results.com' ); expect(resultUrls.reportSummaryUrl()).to.equal('http://results.com/leaf'); }); it('should create url with relative output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', '../leaf', 'http://results.com' ); expect(resultUrls.reportSummaryUrl()).to.equal('http://results.com/leaf'); }); }); describe('#absoluteSummaryPageUrl', function() { it('should create url with default output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', undefined, 'http://results.com' ); expect( resultUrls.absoluteSummaryPageUrl('http://www.foo.bar/xyz') ).to.equal( `http://results.com/www.foo.bar/${ timestampString }/pages/www.foo.bar/xyz/` ); }); it('should create url with absolute output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', '/root/leaf', 'http://results.com' ); expect( resultUrls.absoluteSummaryPageUrl('http://www.foo.bar/xyz') ).to.equal('http://results.com/leaf/pages/www.foo.bar/xyz/'); }); it('should create url with relative output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', '../leaf', 'http://results.com' ); expect( resultUrls.absoluteSummaryPageUrl('http://www.foo.bar/xyz') ).to.equal('http://results.com/leaf/pages/www.foo.bar/xyz/'); }); }); describe('#relativeSummaryPageUrl', function() { it('should create url with default output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', undefined, 'http://results.com' ); expect( resultUrls.relativeSummaryPageUrl('http://www.foo.bar/xyz') ).to.equal('pages/www.foo.bar/xyz/'); }); it('should create url with absolute output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', '/root/leaf', 'http://results.com' ); expect( resultUrls.relativeSummaryPageUrl('http://www.foo.bar/xyz') ).to.equal('pages/www.foo.bar/xyz/'); }); it('should create url with relative output folder', function() { const resultUrls = createResultUrls( 'http://www.foo.bar', '../leaf', 'http://results.com' ); expect( resultUrls.relativeSummaryPageUrl('http://www.foo.bar/xyz') ).to.equal('pages/www.foo.bar/xyz/'); }); }); });
beenanner/sitespeed.io
test/resultUrlTests.js
JavaScript
mit
4,176
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // //= require jquery //= require jquery-ui //= require jquery_ujs //= require underscore-min //= require lumen/loader //= require lumen/bootswatch //= require bootstrap3-typeahead //= require bootstrap-datepicker //= require pages //= require airports //= require wishlists //= require base //= require reverse_geocoder // =require current_location //= require mapper //= require map_bounds //= require map
jaxi/hack
app/assets/javascripts/application.js
JavaScript
mit
985
container_interval_id = 0; password_interval_id = 0; distro_image = 'ubuntu.svg'; // Shows a message // Leave text empty to hide message // error is a boolean deciding whether or not to add an error class function message(text, error) { var message = document.getElementById('message'); message.innerHTML = text; message.className = text ? (error ? 'error' : '') : 'hidden'; } // Shows an error function show_error(text) { message(text, true); // Stop the script on error throw new Error(); } // Center the main login container function centerContainer() { var container = document.getElementById("box"); // Set absolute top to be half of viewport height minus half of container height container.style.top = (document.documentElement.clientHeight / 2) - (container.offsetHeight / 2) + 'px'; // Set absolute left to be half of viewport width minus half of container width container.style.left = (document.documentElement.clientWidth / 2) - (container.offsetWidth / 2) + 'px'; } // Centers the main container on container resize // Time to build a custom resize event emulator thingy! function centerContainerOnResize() { onResize(document.getElementById('box'), centerContainer); } // Executes a callback when an element is resized function onResize(el, callback) { var width = el.offsetWidth; var height = el.offsetHeight; container_interval_id = setInterval(function() { // If the width or height don't match up if( el.offsetWidth != width || el.offsetHeight != height ) { // Remove the old task (with the old width/height) clearInterval(container_interval_id); // Execute the callback if(callback) callback(); // And bind a new resize event (this makes sure we're always checking against the new width/height) onResize(el, callback); } },250); } // This is called by lightdm when the auth request is completed function authentication_complete() { if (lightdm.is_authenticated) { lightdm.login (lightdm.authentication_user, lightdm.default_session); } else { message("Authentication failed", true); lightdm.cancel_authentication(); } } // Ignore requests for timed logins function timed_login(user) {} // Attempts to log in with lightdm // Executes on form submit function attemptLogin() { message("Logging in..."); // Cancel weird timed logins lightdm.cancel_timed_login(); // Pass on user to lightdm var user = document.getElementById('user').value; lightdm.start_authentication(user); } // Called by lightdm when it wants us to show a password prompt // We wait until this is called to sen dlightdm our password function show_prompt(text) { // Pass on password to lightdm once we have actually started authenticating if(password_interval_id > 0) clearInterval(password_interval_id); password_interval_id = setInterval(function() { var password = document.getElementById('password').value; lightdm.provide_secret(password); }, 250); } // Updates elements with content like time, etc. function initializeWidgets() { // Start up the clock initializeClockWidget(); // Start up the hostname widget initializeHostnameWidget(); // Start up the distro widget initializeDistroWidget(); } function initializeDistroWidget() { // If we have a distro image if(distro_image) { // Add in the distro logo var el = document.getElementById('distro-widget'); var img = document.createElement('img'); el.appendChild(img); img.src = 'img/distro/'+distro_image; // Center the form elements in #form after the image has loaded img.onload = function() { var form = document.getElementById('form'); var content = document.getElementById('content'); // Set #form top margin to half of #content height minus half of #form height form.style.marginTop = ((content.offsetHeight / 2) - (form.offsetHeight / 2)) + 'px'; } } } function initializeClockWidget() { updateClockWidget(); setInterval(updateClockWidget, 1000); } function initializeHostnameWidget() { var el = document.getElementById("hostname-widget"); el.innerHTML = lightdm.hostname; } function updateClockWidget() { var el = document.getElementById("clock-widget"); var date = new Date(); var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; var dateString = '<span>' + (date.getHours()<10?'0':'') + date.getHours() + ':' + (date.getMinutes()<10?'0':'') + date.getMinutes() + '</span> :: ' + days[date.getDay()] + ', <span>' + date.getDate() + '</span> ' + months[date.getMonth()]; el.innerHTML = dateString; } //If we have a logged in user, add his username to the user field function initializeUsers() { var el = document.getElementById('user'); // Loop through users for (var i = 0; i < lightdm.users.length; i++) { var user = lightdm.users[i]; if(user.logged_in) { el.value = user.name; } } } // Loads actions like suspend, reboot, etc. function initializeActions() { var el = document.getElementById('actions-inner'); el.innerHTML = ''; if (lightdm.can_suspend) { var node = document.createElement('a'); node.className = 'iconic moon_fill'; node.onclick = function(e) { lightdm.suspend(); e.stopPropagation(); e.preventDefault(true); return false; }; el.appendChild(node); } if (lightdm.can_restart) { var node = document.createElement('a'); node.className = 'iconic spin'; node.onclick = function(e) { lightdm.restart(); e.stopPropagation(); e.preventDefault(true); return false; }; el.appendChild(node); } if (lightdm.can_shutdown) { var node = document.createElement('a'); node.className = 'iconic x'; node.onclick = function(e) { lightdm.shutdown(); e.stopPropagation(); e.preventDefault(true); return false; }; el.appendChild(node); } } // Focuses the user field (if empty), else focuses the password field function handleFocus() { var user = document.getElementById('user'); if(user.value == 'undefined' || user.value == '') { user.focus(); }else{ document.getElementById('password').focus(); } } // Initializes the script (function initialize() { // Center container initially centerContainer(); // Center container again on container resize centerContainerOnResize(); // Update elements that contain informations like time, date, hostname, etc. initializeWidgets(); // Load the list of users initializeUsers(); // Load actions (suspend, reboot, shutdown, etc.) initializeActions(); // Handle focusing handleFocus(); })();
kalmanolah/paddy-greeter
js/main.js
JavaScript
mit
7,316
import test from 'ava'; import Nightmare from 'nightmare'; const nightmare = new Nightmare({ show: process.env.SHOW }); test('food', async t => { await nightmare .goto('http://localhost:3333'); const visible = await nightmare .click('#food') .wait(500) .visible('[class*=_box_]'); t.true(visible); const hidden = await nightmare .click('[class*=_buttonList_] li:last-child a') .wait(500) .visible('[class*=_box_]'); t.false(hidden); const completeFood = await nightmare .click('#food') .wait(1000) .click('[class*=_buttonList_] li:first-child a') .wait(1000) .click('[class*=_buttonList_] li:first-child a') // Meat .wait(1000) .click('[class*=_convenientList_] li:first-child a') // Beaf .click('[class*=_buttonList_] a') // Next .wait(1000) .click('[class*=_buttonList_] a') // I got it .wait(1000) .visible('[class*=_box_]'); t.false(completeFood); const completeFoodResult = await nightmare .evaluate(() => { return JSON.parse(document.getElementById('answer').innerText); }); t.is(completeFoodResult.type, 'Meat'); t.is(completeFoodResult.meat, 'beef'); const completeFoodUsingInput = await nightmare .click('#food') .wait(1000) .click('[class*=_buttonList_] li:first-child a') .wait(1000) .click('[class*=_buttonList_] li:first-child a') // Meat .wait(1000) .click('[class*=_convenientList_] li:last-child a') // Other .click('[class*=_buttonList_] a') // Next .wait(1000) .type('[class*=_convenientInput_]', 'foo') .click('[class*=_buttonList_] a') // Next .wait(1000) .click('[class*=_buttonList_] a') // I got it .wait(1000) .visible('[class*=_box_]'); t.false(completeFoodUsingInput); const completeFoodUsingInputResult = await nightmare .evaluate(() => { return JSON.parse(document.getElementById('answer').innerText); }); t.is(completeFoodUsingInputResult.type, 'Meat'); t.is(completeFoodUsingInputResult.meat, 'foo'); });
nju33/hai
test/specs/nightmare.js
JavaScript
mit
2,039
/** * Created by faspert on 28.04.2015. */ 'use strict'; angular.module('gardenApp') .directive('gvDygraph', function () { return { restrict: 'EAC', //E = element, A = attribute, C = class, M = comment scope: true , //use parent's scope //replace: 'true', // replace directive by template in html template: '<div id="graphdiv"></div>', link: function (scope, element, attrs) { //DOM manipulation console.log('testing the stuff'); var g = new Dygraph(element.children()[0], [[0,0]], { title: 'Temperature / Humidite', }); scope.$watch("data", function () { console.log('scope changes'); var options = scope.options; if (options === undefined) { options = {}; } //do not update if data is empty if (scope.data.length != 0) options.file = scope.data; console.log(scope.data) g.updateOptions(options); g.resetZoom(); g.resize(); }, true); } } });
faspert/GeantVert
app/directives/graph.js
JavaScript
mit
1,342
'use strict'; //Setting up route angular.module('mean.system').config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { // For unmatched routes: $urlRouterProvider.otherwise('/'); // states for my app $stateProvider .state('home', { url: '/', templateUrl: 'public/system/views/index.html' }) .state('auth', { templateUrl: 'public/auth/views/index.html' }) .state('places', { url: '/places', templateUrl: 'public/system/views/places.html', reloadOnSearch: true, controller: 'PlacesController' }); } ]) .config(['$locationProvider', function($locationProvider) { $locationProvider.hashPrefix('!'); } ]);
miguelmota/find-me-burritos
public/system/routes/system.js
JavaScript
mit
982
module.exports = { extends: ["standard", "standard-react"], env: { browser: true, es6: true }, globals: { graphql: true }, plugins: ["class-property"], parser: "babel-eslint", rules: { indent: ["off"], "no-unused-vars": [ "error", { varsIgnorePattern: "React" } ], "jsx-quotes": ["error", "prefer-double"], "react/prop-types": "off", "react/jsx-uses-react": "error", "react/jsx-uses-vars": "error", "react/react-in-jsx-scope": "error", "space-before-function-paren": "off" } };
nilutz/portfolio
.eslintrc.js
JavaScript
mit
570
Rc4Random = function(seed) { var keySchedule = []; var keySchedule_i = 0; var keySchedule_j = 0; function init(seed) { for (var i = 0; i < 256; i++) { keySchedule[i] = i; } var j = 0; for (var i = 0; i < 256; i++) { j = (j + keySchedule[i] + seed.charCodeAt(i % seed.length)) % 256; var t = keySchedule[i]; keySchedule[i] = keySchedule[j]; keySchedule[j] = t; } } init(seed); function getRandomByte() { keySchedule_i = (keySchedule_i + 1) % 256; keySchedule_j = (keySchedule_j + keySchedule[keySchedule_i]) % 256; var t = keySchedule[keySchedule_i]; keySchedule[keySchedule_i] = keySchedule[keySchedule_j]; keySchedule[keySchedule_j] = t; return keySchedule[(keySchedule[keySchedule_i] + keySchedule[keySchedule_j]) % 256]; } this.getRandomNumber = function() { var number = 0; var multiplier = 1; for (var i = 0; i < 8; i++) { number += getRandomByte() * multiplier; multiplier *= 256; } return number / 18446744073709551616; } }
MaciekBaron/BMLTrafficJS
js/rc4random.js
JavaScript
mit
1,238
const TelegramBot = require('node-telegram-bot-api'); const EnchancedTelegramTest = require('./EnhancedTelegramTest'); const { track, trackInline } = require('../src/analytics'); const { initHandlers } = require('../src/handlers'); function createBot() { return new TelegramBot('0123456789abcdef', { webhook: true }); } function createTestServer(callback) { const bot = createBot(); const analytics = { track: (msg, name) => track(msg, name, callback), trackInline: msg => trackInline(msg, callback) }; initHandlers(bot, analytics); return new EnchancedTelegramTest(bot); } module.exports = { createBot, createTestServer };
edloidas/rollrobot
test/utils.js
JavaScript
mit
651
// Inject Bower components into source code // // grunt-wiredep: <https://github.com/stephenplusplus/grunt-wiredep> // wiredep: <https://github.com/taptapship/wiredep> 'use strict'; module.exports = { markups: {<% if (cfg.html) { %> src: ['<%%= path.markups %>/**/*.html']<% } %><% if (cfg.pug) { %> src: ['<%%= path.markups %>/**/*.{pug,jade}']<% } %><% if (cfg.modernizr) { %>, exclude: ['bower_components/modernizr/modernizr.js']<% } %>, // Force absolute URL // "../bower_components/xxxx" -> "/bower_components/xxxx" ignorePath: /(\.\.\/)*\.\.(?=\/)/<% if (cfg.pug) { %>, // Support "*.pug" files fileTypes: { pug: { block: /(([ \t]*)\/\/-?\s*bower:*(\S*))(\n|\r|.)*?(\/\/-?\s*endbower)/gi, detect: { js: /script\(.*src=['"]([^'"]+)/gi, css: /link\(.*href=['"]([^'"]+)/gi }, replace: { js: 'script(src=\'{{filePath}}\')', css: 'link(rel=\'stylesheet\', href=\'{{filePath}}\')' } } }<% } %> }<% if (cfg.sass || cfg.less || cfg.stylus) { %>, styles: {<% if (cfg.sass) { %> src: ['<%%= path.styles %>/**/*.{scss,sass}']<% } %><% if (cfg.less) { %> src: ['<%%= path.styles %>/**/*.less']<% } %><% if (cfg.stylus) { %> src: ['<%%= path.styles %>/**/*.styl']<% } %>, // Import from bower_components directory // "../bower_components/xxxx" -> "xxxx" ignorePath: /(\.\.\/)*bower_components\// }<% } %> };
rakuten-frontend/generator-rff
generators/app/templates/grunt/wiredep.js
JavaScript
mit
1,463
'use strict'; // WEB PUBLICO // ============================================================================= var express = require('express'); var router = express.Router(); //var request = require('request'); var Model = require('../../models/jugando.js'); /***********************alarma*************************** var http = require('http'); var url = require('url'); var SerialPort = require("serialport"); var com = new SerialPort("COM13"); var usuario1 = '_e4_0e_09_6f'; var alarma = 0; /*****************alarma******************* http.createServer(function(peticion, respuesta){ var query = url.parse(peticion.url,true).query; var puerta = query.puerta; var codigo = query.codigo; var actual = query.actual; console.log("puertaaaaaaaaaaaaaaaaaaaaaaaaaaaa",puerta); console.log("codigoooooooooooooooooooooooooooo",codigo); console.log("codigoooooooooooooooooooooooooooo",actual); respuesta.writeHead(200, {'Content-Type': 'text/html'}); respuesta.end(puerta); if (puerta === '0') { console.log('Puerta abierta'); if (alarma === 0) { console.log('Entrada habilitada.'); } else { com.write('<1'); /************************************* console.log('Alarma activada!.'); var nombre = "Alarma Activada!. La Puerta está abierta"; var alarma = "Alarma de Portón"; var index = Model.Alarma.build({ nombre: nombre, alarma: alarma }); index.add(function (success) { console.log('Se guardo la alarma'); }, function (err) { console.log(err); }); /************************************* } } if (puerta === '1') { console.log('Puerta igual a cerrada'); alarma = 1; } if (codigo ==='a' && puerta === '3') { if (actual === '0') { console.log('Puerta abierta'); com.write('<1'); } if (actual === '1') { console.log('Puerta cerrada'); alarma = 1; } } /*************************************leyendo para el lector******************************************************** var empleado = Model.Empleado.build(); console.log("codigo",codigo); //************************************ empleado.retrieveByCodigo(codigo, function (empleadooq) { if (empleadooq) { alarma = 0; console.log('Usuario registrado. Alarma desbloqueada.'); com.write('<0'); var f = new Date(); //new Date().toJSON().slice(0,10) var fechaIngreso = f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate(); var horaIngreso = f.getHours()+":"+f.getMinutes()+":"+f.getSeconds(); var observacionIngreso = "Ingreso del Usuario al Corral"; var EmpleadoIdEmpleado= empleadooq.idEmpleado; var index = Model.IngresoCorral.build({ fechaIngreso: fechaIngreso, horaIngreso: horaIngreso, observacionIngreso: observacionIngreso, EmpleadoIdEmpleado: EmpleadoIdEmpleado }); index.add(function (success) { console.log('Se guardo el acceso'); }, function (err) { console.log(err); }); } else{ alarma = 1; console.log('Alarma activada!.'); } }, function (error) { console.log('Empleado no encontrado',error); }); }).listen(8000); console.log('Servidor iniciado.'); com.on('error', function(err){ console.log('Error: ', err.message); }); /*******************************sector lector**************************************************/ var idlector = ""; var valor =""; var SerialPort = require('serialport'); var serialport = new SerialPort("/COM12", { baudRate: 115200 }); var buffer3 = new Buffer(6); buffer3[0] = 0xA0; buffer3[1] = 0x04; buffer3[2] = 0x01; buffer3[3] = 0x89; buffer3[4] = 0x01; buffer3[5] = 0xD1; serialport.on('data', function(data) { var buff = new Buffer(data, 'utf8'); var imprimir = buff.toString('hex'); var cmd = imprimir.charAt(3); var enviar = imprimir.slice(14,-4); if(cmd == 3){ console.log('este es cmd********', cmd); idlector = enviar.trim(); console.log('soy id del lector',idlector); var animal = Model.Animal.build(); console.log('estoy adentro y tengo el id:',idlector); animal.retrieveByTag(idlector, function (animales) { if (animales) { //console.log(animales); valor = animales.idAnimal; console.log('soy animalid--------',valor); }else{ console.log("error"); serialport.write(buffer3); } }); } }); // open errors will be emitted as an error event serialport.on('error', function(err) { console.log('Error: ', err.message); }); /******************************************************************************/ var horaC=""; var horasC=""; var nivelC=""; var pesoBatea=""; var pesoRacionC=""; var pesoBateaC=""; var idInsumoC=""; var consumoId=""; var niv = 5; var SerialPort = require('serialport'); var parsers = require('serialport').parsers; var port = new SerialPort("/COM14", { baudRate: 9600, parser: parsers.readline('\r\n') }); leerNivel(); leerPesoyRacion(); leerHora(); /************************leer el nivel actual del comedero***********************/ function leerNivel(){ port.on('open', function() { port.write('main screen turn on', function(err) { if (err) { return console.log('Error: ', err.message); } console.log('mensaje 2 escrito'); }); setTimeout(function(){ port.write('>2', function(err) { if (err) { return console.log('Error: ', err.message); } console.log('cmd 2'); }); }, 1000); }); } /*************leer la hora actual del comedero*********************/ function leerHora(){ port.on('open', function() { port.write('main screen turn on', function(err) { if (err) { return console.log('Error: ', err.message); } console.log('mensaje 1 escrito'); }); setTimeout(function(){ port.write('>1', function(err) { if (err) { return console.log('Error: ', err.message); } console.log('cmd 1'); }); }, 3000); }); } /*************leer el peso actual del comedero********************/ function leerPesoyRacion(){ port.on('open', function() { port.write('main screen turn on', function(err) { if (err) { return console.log('Error: ', err.message); } console.log('mensaje 4 escrito'); }); setTimeout(function(){ port.write('>4', function(err) { if (err) { return console.log('Error: ', err.message); } console.log('cmd 4'); }); }, 2000); }); } /***************funcion para leer datos recibidos del comedero*******************/ //setTimeout(function(){ port.on('data', function(data) { var imprimir = data.toString(); var cmd = imprimir.charAt(0); var enviar = imprimir.substring(1); console.log('valor**************', imprimir); if (cmd == 1) { console.log('dentro de cmd 1',cmd); horaC = enviar.trim(); console.log('hora:', horaC); } else if(cmd == 2){ console.log('dentro de cmd 2',cmd); nivelC = enviar.trim(); console.log('nivel:', nivelC); } else if(cmd == 4){ console.log('dentro de cmd 4',cmd); pesoRacionC = '2'; console.log('pesoRacion:', pesoRacionC); }else if(cmd == 3){ console.log('dentro de cmd 3',cmd); pesoBatea = enviar.trim(); console.log('pesoBatea:', pesoBatea); var detalleConsumo = Model.DetalleConsumo.build(); detalleConsumo.retrieveId(function (detalleQ) { if (detalleQ) { console.log('dentro de detalleQ ultimo id del detalle consumo>', detalleQ[0].dataValues['idDetalleConsumo']); var idDetalleQ = detalleQ[0].dataValues['idDetalleConsumo']; detalleConsumo.updateById2(idDetalleQ,pesoBatea,function (success) { if (success) { console.log('se guardo la sobra'); } else { console.log('Detalle Consumo1 no encontrado'); } }, function (error) { console.log('Detalle Consumo2 no encontrado'); }); } else { console.log('Detalle Consumo3 no encontrado'); } }, function (error) { res.send('Detalle Consumo4 no encontrado'); }); } else if(cmd == "x"){ //serialport.write(buffer3); console.log('dentro de cmd x',cmd); horasC = imprimir.substring(1,9); console.log('horas:', horasC); //pesoBateaC = imprimir.slice(9,-1); pesoBateaC = '2'; console.log('pesoBatea:', '2'); idInsumoC = imprimir.slice(-1); console.log('idInsumo:', idInsumoC); serialport.write(buffer3); var f = new Date(); var fecha = f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate(); var consumo = Model.Consumo.build(); var stock = Model.Stock.build(); serialport.write(buffer3); var index = Model.Consumo.build({ fechaConsumo: fecha, horaConsumo: horasC, InsumoIdInsumo: idInsumoC }); serialport.write(buffer3); index.add(function (success) { console.log("listo cabecera"); serialport.write(buffer3); consumo.retrieveId(function (consumoQ) { if (consumoQ) { consumoId = consumoQ[0].dataValues['idConsumo']; console.log("soy consumoId*********", consumoId); var index2 = Model.DetalleConsumo.build({ cantidad: 2, observacion: "Consumo de Balanceados", AnimalIdAnimal: valor, ConsumoIdConsumo: consumoId }); index2.add(function (success) { console.log("dentro"); stock.retrieveByInsumo(consumoId, pesoBateaC, function (detalleConsumos) { if (detalleConsumos) { console.log("listo xfin"); index2.guardar(consumoId, function (detalleConsumoss) { if (detalleConsumoss) { console.log('se guardo el total del consumo'); } else { console.log('No se puede cargar el total del consumo'); } },function (err) { console.log('Error al intentar cargar el total del consumo',err); }); } else { console.log('No se encontraron detalles'); } }, function (error) { console.log('Detalle no encontrado'); }); }, function (err) { console.log('error aca', err); }); }else { console.log('No se encontraron Consumos'); } }); }, function (err) { console.log(err); }); } }); //}, 1000); /*********************************************************************/ router.get('/abrir', function (req, res) { console.log('dentro de abrir'); port.write('>i'); }); /*router.get('/abrir', function (req, res) { console.log('dentro de abrir'); port.write('<1'); }); /********************************************************************/ router.get('/cerrar', function (req, res) { console.log('dentro de cerrar'); port.write('>j'); }); /* router.get('/cerrar', function (req, res) { console.log('dentro de cerrar'); port.write('<0'); }); /********************************************************************/ router.get('/liberar', function (req, res) { console.log('dentro de liberar'); console.log('obteniendo id del animal'); port.write('>x'); }); /********************************************************************/ router.get('/sobra', function (req, res) { console.log('dentro de sobra'); console.log('obteniendo id del animal'); port.write('>3'); }); /***************************************************************************/ router.get('/', function (req, res) { req.session.destroy(function(err) { if(err) { console.log(err); } else { res.render('publico/home/indexa.jade'); } }); }); /****************************************************************************/ router.get('/perfil', function (req, res) { //************************************ var mensaje = Model.Mensaje.build(); //************************************ var alarma = Model.Alarma.build(); //************************************ if(!req.session.user){ res.render('web/index/404.jade'); } var nivelUsuario = req.session.user.Nivel['nivel']; console.log('soy nivelUsuario', nivelUsuario); if(nivelUsuario =='admin'){ mensaje.retriveCount(function (mensaje1) { console.log('mensaje1', mensaje1); if (mensaje1) { mensaje.retrieveAll(function (mensaje2) { console.log('mensaje2', mensaje2); if (mensaje2) { console.log(req.body); alarma.retriveCount(function (alarma1) { console.log('alarma1', alarma1); if (alarma1) { alarma.retrieveAll(function (alarma2) { console.log('alarma2', alarma2); if (alarma2) { console.log(req.session); var usuario = req.session.user.usuario; var pass = req.session.user.pass; var fechaCreacion = req.session.user.fechaCreacion; res.render('web/index/perfil.jade',{ alarmas1: alarma1, alarmas2: alarma2, mensajes: mensaje1, mensajeria: mensaje2, usuarios: usuario, passs: pass, fechaCreacions: fechaCreacion }); }else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); }else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else{ mensaje.retriveCount(function (mensaje1) { console.log('mensaje1', mensaje1); if (mensaje1) { mensaje.retrieveAll(function (mensaje2) { console.log('mensaje2', mensaje2); if (mensaje2) { console.log(req.body); alarma.retriveCount(function (alarma1) { console.log('alarma1', alarma1); if (alarma1) { alarma.retrieveAll(function (alarma2) { console.log('alarma2', alarma2); if (alarma2) { console.log(req.body); var usuario = req.session.user.usuario; var pass = req.session.user.pass; var fechaCreacion = req.session.user.fechaCreacion; res.render('web/index/errores.jade',{ alarmas1: alarma1, alarmas2: alarma2, mensajes: mensaje1, mensajeria: mensaje2, usuarios: usuario, passs: pass, fechaCreacions: fechaCreacion }); }else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); }else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje1 no encontrado'); }); } }); /****************************************************************************/ router.get('/reportes', function (req, res) { //************************************ var mensaje = Model.Mensaje.build(); //************************************ var alarma = Model.Alarma.build(); //************************************ if(!req.session.user){ res.render('web/index/404.jade'); } var nivelUsuario = req.session.user.Nivel['nivel']; console.log('soy nivelUsuario', nivelUsuario); if(nivelUsuario =='admin'){ mensaje.retriveCount(function (mensaje1) { console.log('mensaje1', mensaje1); if (mensaje1) { mensaje.retrieveAll(function (mensaje2) { console.log('mensaje2', mensaje2); if (mensaje2) { console.log(req.body); alarma.retriveCount(function (alarma1) { console.log('alarma1', alarma1); if (alarma1) { alarma.retrieveAll(function (alarma2) { console.log('alarma2', alarma2); if (alarma2) { console.log(req.body); var usuario = req.session.user.usuario; var pass = req.session.user.pass; var fechaCreacion = req.session.user.fechaCreacion; console.log('soy nivelUsuario', nivelUsuario); res.render('web/index/reportes.jade',{ alarmas1: alarma1, alarmas2: alarma2, mensajes: mensaje1, mensajeria: mensaje2, usuarios: usuario, passs: pass, fechaCreacions: fechaCreacion }); }else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); }else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje1 no encontrado'); }); }else{ mensaje.retriveCount(function (mensaje1) { console.log('mensaje1', mensaje1); if (mensaje1) { mensaje.retrieveAll(function (mensaje2) { console.log('mensaje2', mensaje2); if (mensaje2) { console.log(req.body); alarma.retriveCount(function (alarma1) { console.log('alarma1', alarma1); if (alarma1) { alarma.retrieveAll(function (alarma2) { console.log('alarma2', alarma2); if (alarma2) { console.log(req.body); var usuario = req.session.user.usuario; var pass = req.session.user.pass; var fechaCreacion = req.session.user.fechaCreacion; res.render('web/index/errores.jade',{ alarmas1: alarma1, alarmas2: alarma2, mensajes: mensaje1, mensajeria: mensaje2, usuarios: usuario, passs: pass, fechaCreacions: fechaCreacion }); }else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); }else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje1 no encontrado'); }); } }); /*ruta para redireccionar al comedero donde al renderizar la pagina le paso la variable enviar a una variable de la vista llamada horas*/ router.get('/comedero', function(req, res) { var mensaje = Model.Mensaje.build(); var alarma = Model.Alarma.build(); if(!req.session.user){ res.render('web/index/404.jade'); } mensaje.retriveCount(function (mensaje1) { console.log('mensaje1', mensaje1); if (mensaje1) { mensaje.retrieveAll(function (mensaje2) { console.log('mensaje2', mensaje2); if (mensaje2) { alarma.retriveCount(function (alarma1) { console.log('alarma1', alarma1); if (alarma1) { alarma.retrieveAll(function (alarma2) { console.log('alarma2', alarma2); if (alarma2) { var usuario = req.session.user.usuario; var pass = req.session.user.pass; var fechaCreacion = req.session.user.fechaCreacion; res.render('web/index/Comedero.jade',{ alarmas1: alarma1, alarmas2: alarma2, mensajes: mensaje1, mensajeria: mensaje2, niveles: nivelC, horas: horasC, pesoRacion: 2, usuarios: usuario, passs: pass, fechaCreacions: fechaCreacion }); }else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); }else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensajes no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); }); //página principal del admin, panel de administración router.get('/principal', function (req, res) { var mensaje = Model.Mensaje.build(); var stock = Model.Stock.build(); var consumo = Model.Consumo.build(); var pesaje = Model.Pesaje.build(); var muerte = Model.Muertes.build(); var extraviado = Model.Extraviado.build(); var sanitacion = Model.Sanitacion.build(); var vacunacion = Model.Vacunacion.build(); var ventas = Model.FacturaVenta.build(); //************************************ var alarma = Model.Alarma.build(); if(!req.session.user){ console.log('dentro'); res.render('web/index/404.jade'); } leerCantidadMinima(); leerHerramienta(); if(niv <= "5"){ leerComederoMinima(); } mensaje.retriveCount(function (mensaje1) { console.log('mensaje1', mensaje1); if (mensaje1) { mensaje.retrieveAll(function (mensaje2) { console.log('mensaje2', mensaje2); if (mensaje2) { stock.retrieveAll(function (stockQ) { console.log('stockQ', stockQ); if (stockQ) { consumo.retrieveBar(function (consumobar) { console.log('consumobar', consumobar); if (consumobar) { pesaje.retrieveLine2(function (pesaje2) { console.log('pesaje2', pesaje2); if (pesaje2) { consumo.retrieveBar2(function (consumobar2) { console.log('consumobar2', consumobar2); if (consumobar2) { consumo.retrieveBar3(function (consumobar3) { console.log('consumobar3', consumobar3); if (consumobar3) { consumo.retrieveBar4(function (consumobar4) { console.log('consumobar4', consumobar4); if (consumobar4) { consumo.retrieveBar5(function (consumobar5) { console.log('consumobar5', consumobar5); if (consumobar5) { consumo.retrieveBar6(function (consumobar6) { console.log('consumobar6', consumobar6); if (consumobar6) { consumo.retrieveBar7(function (consumobar7) { console.log('consumobar7', consumobar7); if (consumobar7) { pesaje.retrieveLine3(function (pesaje3) { console.log('pesaje3', pesaje3); if (pesaje3) { pesaje.retrieveLine4(function (pesaje4) { console.log('pesaje4', pesaje4); if (pesaje4) { pesaje.retrieveLine5(function (pesaje5) { console.log('pesaje5', pesaje5); if (pesaje5) { pesaje.retrieveLine6(function (pesaje6) { console.log('pesaje6', pesaje6); if (pesaje6) { pesaje.retrieveLine7(function (pesaje7) { console.log('pesaje7', pesaje7); if (pesaje7) { stock.retrieveAll2(function (stockN) { console.log('stockN', stockN); if (stockN) { stock.retrieveAll3(function (stockL) { console.log('stockL', stockL); if (stockL) { stock.retrieveAll4(function (stockO) { console.log('stockO', stockO); if (stockO) { consumo.retrievePie(function (consumir) { console.log('consumir', consumir); if (consumir) { consumo.retrievePie2(function (consumir2) { console.log('consumir2', consumir2); if (consumir2) { stock.retrieveSAnimal2(function (animal2) { console.log('animal2', animal2); if (animal2) { pesaje.retrieveLine(function (pesaje) { console.log('pesaje', pesaje); if (pesaje) { muerte.retrieveSMuerte2(function (muertes) { console.log('muertes', muertes); if (muertes) { extraviado.retrieveExtraviado(function (extraviado) { console.log('extraviado', extraviado); if (extraviado) { sanitacion.retrieveSanitacion(function (sanitacion) { console.log('sanitacion', sanitacion); if (sanitacion) { vacunacion.retrieveVacunacion(function (vacunacion) { console.log('vacunacion', vacunacion); if (vacunacion) { ventas.retrieveVenta(function (ventas) { console.log('ventas', ventas); if (ventas) { alarma.retriveCount(function (alarma1) { console.log('alarma1', alarma1); if (alarma1) { alarma.retrieveAll(function (alarma2) { console.log('alarma2', alarma2); if (alarma2) { console.log(req.body); console.log(req.session.user); var usuario = req.session.user.usuario; var pass = req.session.user.pass; var fechaCreacion = req.session.user.fechaCreacion; res.render('web/index/PaginaPrincipal',{ usuarios: usuario, passs: pass, fechaCreacions: fechaCreacion, mensajes: mensaje1, mensajeria: mensaje2, peso2: pesaje2, peso3: pesaje3, peso4: pesaje4, peso5: pesaje5, peso6: pesaje6, peso7: pesaje7, consumoBar: consumobar, consumoBar2: consumobar2, consumoBar3: consumobar3, consumoBar4: consumobar4, consumoBar5: consumobar5, consumoBar6: consumobar6, consumoBar7: consumobar7, stock: stockQ, Stock2: stockN, Vtock3: stockL, consumiendo: consumir, Otock4: stockO, consusal: consumir2, animal2: animal2, peso: pesaje, muerted: muertes, extraviados: extraviado, sanitaciones: sanitacion, vacunaciones: vacunacion, alarmas1: alarma1, alarmas2: alarma2, ventass: ventas }); }else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se encontraron Alarmas'); } }, function (error) { res.send('Alarma no encontrado'); }); } else { res.send(401, 'No se Encontraron Ventas de Animales'); } }, function (error) { res.send('Ventas no encontrado'); }); } else { res.send(401, 'No se Encontraron Vacunacion de Animales'); } }, function (error) { res.send('Vacunacion no encontrado'); }); } else { res.send(401, 'No se Encontraron Sanitacion de Animales'); } }, function (error) { res.send('Sanitacion no encontrado'); }); } else { res.send(401, 'No se Encontraron Extraviados de Animales'); } }, function (error) { res.send('Extraviados no encontrado'); }); } else { res.send(401, 'No se Encontraron Muertes de Animales'); } }, function (error) { res.send('Muerte no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes de Animales'); } }, function (error) { res.send('Pesaje no encontrado'); }); } else { res.send(401, 'No se Encontraron Stock de Animales'); } }, function (error) { res.send('Stock no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos de Sal Mineral'); } }, function (error) { res.send('Consumo de sal no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos de Balanceados'); } }, function (error) { res.send('Consumo no encontrado'); }); } else { res.send(401, 'No se Encontraron Insumos de Medicamento'); } }, function (error) { res.send('Insumo de Medicamento no encontrado'); }); } else { res.send(401, 'No se Encontraron Insumos de Medicamento'); } }, function (error) { res.send('Insumo de Medicamento no encontrado'); }); } else { res.send(401, 'No se Encontraron Insumos de Sal'); } }, function (error) { res.send('Insumo de Sal no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes7'); } }, function (error) { res.send('Pesaje7 no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes6'); } }, function (error) { res.send('Pesaje6 no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes 5'); } }, function (error) { res.send('Pesaje5 no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes4'); } }, function (error) { res.send('Pesaje4 no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes3'); } }, function (error) { res.send('Pesaje3 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos7'); } }, function (error) { res.send('ConsumoBar7 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos6'); } }, function (error) { res.send('ConsumoBar6 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos5'); } }, function (error) { res.send('ConsumoBar5 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos4'); } }, function (error) { res.send('ConsumoBar4 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos3'); } }, function (error) { res.send('ConsumoBar3 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos2'); } }, function (error) { res.send('ConsumoBar2 no encontrado'); }); } else { res.send(401, 'No se Encontraron Pesajes'); } }, function (error) { res.send('Pesaje2 no encontrado'); }); } else { res.send(401, 'No se Encontraron Consumos'); } }, function (error) { res.send('ConsumoBar no encontrado'); }); }else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); } else { res.send(401, 'No se encontraron Mensajes'); } }, function (error) { res.send('Mensaje no encontrado'); }); }); //---------------------------alarmas function leerCantidadMinima(){ var stockA = Model.Stock.build(); var alarmaA = Model.Alarma.build(); stockA.retrieveAlarma(function (stock) { if (stock) { console.log("soy stock*********", stock[0].Insumo.nombreInsumo); alarmaA.retrieveByAlarma(stock[0].Insumo.nombreInsumo, function (alarma1) { if (alarma1) { console.log("ya existe la alarma"); }else { console.log("no existe la alarma, guardando...", stock[0].Insumo.nombreInsumo); var alarma2 = Model.Alarma.build({ nombre: "Cantidad Minima Alcanzada", alarma: stock[0].Insumo.nombreInsumo }); alarma2.add(function (success) { console.log("Se guardo alarma"); }, function (err) { console.log(err); }); } }, function (error) { console.log('Alarma no encontrado'); }); }else { console.log(401, 'No se encontraron Alarmas'); } }, function (error) { console.log('Cantidad Minima no encontrado'); }); } function leerHerramienta(){ var herramienta = Model.Herramienta.build(); var alarmaA = Model.Alarma.build(); var mantenimiento = new Date().toJSON().slice(0,10); console.log("soy mantenimiento*********", mantenimiento); herramienta.retrieveByAlarma(mantenimiento, function (herramientasq) { if (herramientasq) { console.log("soy herramienta*********", herramientasq.nombre); alarmaA.retrieveByAlarma(herramientasq.nombre, function (alarma1) { if (alarma1) { console.log("ya existe la alarma"); }else { console.log("no existe la alarma, guardando...", herramientasq.nombre); var alarma2 = Model.Alarma.build({ nombre: "Realizar Mantenimiento", alarma: herramientasq.nombre }); alarma2.add(function (success) { console.log("Se guardo la alarma"); }, function (err) { console.log(err); }); } }, function (error) { console.log('Alarma no encontrado'); }); }else { console.log(401, 'No se encontraron Herramientas'); } }, function (error) { console.log('Herramienta no encontrado'); }); } function leerComederoMinima(){ var stockA = Model.Stock.build(); var alarmaA = Model.Alarma.build(); stockA.retrieveAlarma(function (stock) { if (stock) { var comedero = 'Comedero Vacio' alarmaA.retrieveByAlarma(comedero, function (alarma1) { if (alarma1) { console.log("ya existe la alarma"); }else { console.log("no existe la alarma, guardando...", comedero); var alarma2 = Model.Alarma.build({ nombre: "Nivel Mínima Alcanzado", alarma: comedero }); alarma2.add(function (success) { console.log("Se guardo alarma"); }, function (err) { console.log(err); }); } }, function (error) { console.log('Alarma no encontrado'); }); }else { console.log(401, 'No se encontraron Alarmas'); } }, function (error) { console.log('Cantidad Minima no encontrado'); }); } module.exports = router;
andymi/Jugando
src/controllers/web/webPublico.js
JavaScript
mit
56,889
/* eslint no-console: [0] */ 'use strict' const Email = require('trailpack-proxy-email').Email module.exports = class Customer extends Email { /** * * @param customer * @param data * @param options * @returns {Promise.<{type: string, subject: string, text: string, html:string, send_email:boolean}>} */ invite(customer, data, options) { const Customer = this.app.orm['Customer'] let resCustomer return Customer.resolve(customer, options) .then(_customer => { if (!_customer) { throw new Error('Customer did not resolve') } resCustomer = _customer const subject = data.subject || `${ resCustomer.name } Invitation` const sendEmail = typeof data.send_email !== 'undefined' ? data.send_email : true return this.compose('invite', subject, resCustomer, sendEmail) }) } /** * * @param customer * @param data * @param options * @returns {Promise.<{type: string, subject: string, text: string, html:string, send_email:boolean}>} */ inviteAccepted(customer, data, options) { const Customer = this.app.orm['Customer'] let resCustomer return Customer.resolve(customer, options) .then(_customer => { if (!_customer) { throw new Error('Customer did not resolve') } resCustomer = _customer const subject = data.subject || `${ resCustomer.name } Invite Accepted` const sendEmail = typeof data.send_email !== 'undefined' ? data.send_email : true return this.compose('inviteAccepted', subject, resCustomer, sendEmail) }) } /** * * @param customer * @param data * @param options * @returns {Promise.<{type: string, subject: string, text: string, html:string, send_email:boolean}>} */ accountBalanceUpdated(customer, data, options) { const Customer = this.app.orm['Customer'] let resCustomer return Customer.resolve(customer, options) .then(_customer => { if (!_customer) { throw new Error('Customer did not resolve') } resCustomer = _customer const subject = data.subject || `${ resCustomer.name } Account Balance Updated` const sendEmail = typeof data.send_email !== 'undefined' ? data.send_email : true return this.compose('accountBalanceUpdated', subject, resCustomer, sendEmail) }) } /** * * @param customer * @param data * @param options */ accountBalanceDeducted(customer, data, options) { const Customer = this.app.orm['Customer'] let resCustomer return Customer.resolve(customer, options) .then(_customer => { if (!_customer) { throw new Error('Customer did not resolve') } resCustomer = _customer const subject = data.subject || `${ resCustomer.name } Account Balance Deducted` const sendEmail = typeof data.send_email !== 'undefined' ? data.send_email : true return this.compose('accountBalanceDeducted', subject, resCustomer, sendEmail) }) } /** * * @param customer * @param data * @param options */ retarget(customer, data, options) { const Customer = this.app.orm['Customer'] let resCustomer return Customer.resolve(customer, options) .then(_customer => { if (!_customer) { throw new Error('Customer did not resolve') } resCustomer = _customer const subject = data.subject || `${ resCustomer.name } you have items in your cart!` const sendEmail = typeof data.send_email !== 'undefined' ? data.send_email : true return this.compose('retarget', subject, resCustomer, sendEmail) }) } }
CaliStyle/trailpack-proxy-cart
api/emails/Customer.js
JavaScript
mit
3,717
/* eslint-disable global-require */ import React from 'react'; import { Router, Route, IndexRoute } from 'react-router'; import App from './modules/App/App'; import Landing from './modules/App/Landing'; import TalentInput from './modules/App/TalentInput'; import Performer from './modules/App/Performer'; // require.ensure polyfill for node if (typeof require.ensure !== 'function') { require.ensure = function requireModule(deps, callback) { callback(require); }; } /* Workaround for async react routes to work with react-hot-reloader till https://github.com/reactjs/react-router/issues/2182 and https://github.com/gaearon/react-hot-loader/issues/288 is fixed. */ if (process.env.NODE_ENV !== 'production') { // Require async routes only in development for react-hot-reloader to work. // require('./modules/Post/pages/PostListPage/PostListPage'); // require('./modules/Post/pages/PostDetailPage/PostDetailPage'); } // react-router setup with code-splitting // More info: http://blog.mxstbr.com/2016/01/react-apps-with-pages/ export default ( <Router> <Route path="/" component={Landing} /> {/*} <IndexRoute getComponent={(nextState, cb) => { require.ensure([], require => { cb(null, require('./modules/Post/pages/PostDetailPage/PostDetailPage').default); }); }} />*/} <Route path="/room" component={Performer} /> {/* <Route path="/index" getComponent={(nextState, cb) => { require.ensure([], require => { cb(null, require('./modules/Post/pages/PostDetailPage/PostDetailPage').default); }); }} />*/} {/*</Route>*/} <Route path="/talent" component={TalentInput} /> </Router> );
aksm/refactored-palm-tree
client/routes.js
JavaScript
mit
1,715
var async = require('async'); var rp = require('request-promise'); var Promise = require('bluebird'); /* LoL API object that deals with everything. */ var LoLAPI = { init: function(inputObj) { /* SET UP LOGGER */ if(typeof inputObj.logger !== 'undefined') { this.logger = inputObj.logger; } else { this.logger = console; } /* END SET UP LOGGER */ /* SET UP ERROR HANDLER */ if(typeof inputObj.errorHandler !== 'undefined') { this.errorHandler = inputObj.errorHandler; } else { this.errorHandler = this.logger.error; } /* END ERROR HANDLER */ /* SET UP CACHE TODO: replace with CHECK that global redis exists */ if(!inputObj.cache) { var redis = require('redis'); Promise.promisifyAll(redis.RedisClient.prototype); Promise.promisifyAll(redis.Multi.prototype); this.cache = redis.createClient('redis://' + inputObj.cacheServer + ':' + (inputObj.cachePort || '6379')); } else { this.cache = inputObj.cache; this.cache.on("error", function (err) { this.errorHandle(err); }.bind(this)); } this.cache.on('connect', function() { this.logger.log('LoL API Connected to Redis'); this.getOneHourCount().then(count => { this.logger.log(inputObj.limit_one_hour - count + ' API requests available in the hour.'); return this.timeToHourExpiry(); }) .then(ttl => { this.logger.log(ttl + ' seconds left until hour cache expiry'); }); }.bind(this)); /* END CACHE SETUP */ this.setApiKey(inputObj.api_key); this.failCount = inputObj.fail_count || 5; //Load all the handlers in the handlers dir. require('fs').readdirSync(__dirname + '/lib/handlers').forEach(function(file) { if (file.match(/\.js$/) !== null && file !== 'index.js') { var r = require('./lib/handlers/' + file); this.request[r.name] = r.handler.bind(this); } }.bind(this)); //Load all the helpers in the helpers dir. this.helper = {}; require('fs').readdirSync(__dirname + '/lib/helpers').forEach(function(file) { if (file.match(/\.js$/) !== null && file !== 'index.js') { var r = require('./lib/helpers/' + file); this.helper[file.replace(/\.js$/, '')] = r; } }.bind(this)); //Load all the route builders in the route builders dir. this.routeStem = {}; require('fs').readdirSync(__dirname + '/lib/route-stem').forEach(function(file) { if (file.match(/\.js$/) !== null && file !== 'index.js') { var r = require('./lib/route-stem/' + file); this.routeStem[file.replace(/\.js$/, '')] = r; } }.bind(this)); //TODO: do we definitely want -1? this.setRateLimit(inputObj.limit_ten_seconds-1, inputObj.limit_one_hour); //Set the timeouts for the queue master this.beginQueueInterval(); return this; }, beginQueueInterval: function() { this.queueInterval = setInterval(function() { return this.checkRateLimit() .then((spaces)=> { if(spaces && (this.queue.length > 0)) { return this.execQueue(spaces); } else { return; } }).bind(this); }.bind(this), 10); this.logger.log('Created LoL API Request Handler'); return; }, setApiKey: function(key) { return this.apiKey = key; }, timeToHourExpiry: function() { return this.cache.ttlAsync('lolapi_onehour'); }, refreshCache: function() { return this.cache.delAsync('lolapi_tenseconds', 'lolapi_onehour'); }, incrementTenSecondsCount: function() { //If not set then set return this.cache.multi().incr('lolapi_tenseconds').expire('lolapi_tenseconds', 11).execAsync() .then((value)=> { if(!value) { return this.logger("Couldn't set the 10 second rate key"); } return value; }).bind(this); }, incrementOneHourCount: function() { //If not set then set return this.cache.multi().incr('lolapi_onehour').expire('lolapi_onehour', 3601).execAsync() .then((value)=> { if(!value) { return this.logger("Couldn't set one hour key."); } return value; }).bind(this); }, getTenSecondsCount: function() { return this.cache.getAsync('lolapi_tenseconds') .then((key)=> { if(key) { return key; } else { return 0; } }); }, getOneHourCount: function() { return this.cache.getAsync('lolapi_onehour') .then((key)=> { if(key) { return key; } else { return 0; } }); }, rateLimit: { tenSeconds: null, oneHour: null, }, requestCount: { tenSeconds: 0, oneHour: 0, outstandingRequests: 0 }, failCount: 5, setRateLimit: function(ten_seconds, one_hour) { this.rateLimit.tenSeconds = ten_seconds; this.rateLimit.oneHour = one_hour; }, // If a 429 is discovered then it sends a retry-after seconds count, test if it greater than remaining time retryRateLimitOverride: function(retry_after) { //TODO: do I need to parse int here? var r = parseInt(retry_after) * 1000; //Always clear the 10s timeout just to be certain. //Clear interval and reset after retry after is cleared clearInterval(this.tenSecondsTimeout); this.logger.log(this.tenSecondsTimeout); }, checkRateLimit: function() { return this.getOneHourCount() //Get this first because we care about it less .then((oneHour)=> { return this.getTenSecondsCount() .then((tenSeconds)=> { //NESTED SO WE CAN ACCESS UPPER VARS IN SCOPE //TODO: there is a wierd type error here........ for some reason it outputs number for tenseconds and a string for hour if((parseInt(tenSeconds) + this.requestCount.outstandingRequests) >= this.rateLimit.tenSeconds) { return 0; } else if((parseInt(oneHour) + this.requestCount.outstandingRequests) >= this.rateLimit.oneHour) { return this.timeToHourExpiry() .then(ttl => { this.logger.log('Hit hour limit: ' + oneHour + '. ' + ttl + ' seconds to go until cache reset.'); return 0; // 0 Spaces }) } else { //return the smaller of the requests available var requests_left_hour = this.rateLimit.oneHour - parseInt(oneHour) - this.requestCount.outstandingRequests; var requests_left_ten_seconds = this.rateLimit.tenSeconds - parseInt(tenSeconds) - this.requestCount.outstandingRequests; //As we dont' need to worry about race conditions we don't have to recheck if positive if(requests_left_hour > requests_left_ten_seconds) { if(requests_left_ten_seconds > 0) { return requests_left_ten_seconds; } else { return 0; } } else { if(requests_left_hour > 0) { return requests_left_hour; } else { return 0; } } } }); }); }, initRequest: function(endpoint, returnVars) { //Add the request and set up as a promise var cb = function(endpoint, returnVars, times_failed) { return this.incrementOneHourCount() .then((oneHour)=> { return this.incrementTenSecondsCount() .then((tenSeconds)=> { this.requestCount.outstandingRequests += 1; var options = { uri: encodeURI(endpoint + '&api_key=' + this.apiKey), //Assume the ? has already been added by our endpoint json: true, resolveWithFullResponse: true } this.logger.log('Using ' + options.uri); this.logger.log(this.requestCount.outstandingRequests); this.logger.log(tenSeconds + ' ' + oneHour); return rp(options) .then( function(response) { this.requestCount.outstandingRequests -= 1; if(returnVars) { if(typeof returnVars === 'string') { if(response.body[returnVars]) { return response.body[returnVars]; //Resolve promise } else { this.infoHandle("Couldn't locate the requested returnVar " + returnVars + '. Returning full response.'); } } else { var tmp = {}; returnVars.forEach(function(item, i) { if(response[item]) { tmp[item] = response.body[item]; } else { var bFailedReturnVar = true; } }.bind(this)); if(!bFailedReturnVar) { return tmp; //Resolve promise } else { this.infoHandle("Couldn't locate the requested returnVar " + item + '. Returning full response.'); return response.body; //Resolve Promise } } } else { this.logger.log('SUCCESSFUL RESPONSE FROM: ' + endpoint); return response.body; //Resolve promise } }.bind(this), //REJECTION function(reason) { this.requestCount.outstandingRequests -= 1; if(reason.statusCode === 429) { this.logger.log('Rate limit reached!') //NOTE: Riot have been known to remove the header so including this to avoid breaking. if(typeof reason.response['headers']['retry-after'] !== 'undefined') { this.logger.log('Retrying after ' + reason.response['headers']['retry-after'] + 's'); // this.retryRateLimitOverride(reason.response['headers']['retry-after']); } else { this.logger.log('No Retry-After header'); this.logger.log(reason.response['headers']); } } if(reason.error.code == 'ENOTFOUND') { throw 'Request ' + endpoint + ' did not access a valid endpoint, please check the parameter structure of your request realm and/or platform names. NOT adding back to queue.'; } if(reason.statusCode === 404) { //404 isn't an error per se, so we don't throw this. return this.notFoundHandle('Request ' + endpoint + ' REJECTED with reason: ' + reason + '. NOT adding back to queue'); } if(typeof times_failed !== 'number') { times_failed = 1; } else { times_failed++; } this.infoHandle('Request ' + endpoint + ' REJECTED with reason: ' + reason + '. Adding back to queue. Failed ' + times_failed + ' times.'); return this.addToQueue(cb.bind(this, endpoint, returnVars, times_failed), times_failed, endpoint); }.bind(this)) .catch(err => { return this.errorHandle(err); }); }); //NOTE: I'm not sure why we can't bind here but if we do it causes times_failed to not increment }); } return this.addToQueue(cb.bind(this, endpoint, returnVars), 0, endpoint); }, infoHandle: function(str) { return this.logger.info(str); }, notFoundHandle: function(str) { return this.logger.info(str); }, addToQueue: function(fn, times_failed, endpoint) { if(times_failed >= this.failCount) { this.infoHandle('Request from endpoint "' + endpoint + '" exceeded fail count!'); throw 'Request from endpoint "' + endpoint + '" exceeded fail count!'; } else { //Turns function to deferred promise and adds to queue. this.logger.log('Adding ' + endpoint + ' to queue.'); var resolve, reject; var promise = new Promise(function(reso, reje) { resolve = reso; reject = reje; }) .then(function(times_failed) { this.logger.log('Executing queue item!'); return fn(); //NOTE: fn is prebound with arguments }.bind(this)); this.queue.push({ resolve: resolve, reject: reject, promise: promise }); return promise; } }, execQueue: function(end_index) { while(this.queue.length > 0 && end_index > 0 && this.cache.connected === true) { bUnloaded = true; var w = this.queue.shift(); w.resolve(); end_index--; } if(this.cache.connected === false) { this.logger.errorHandle('Attempted to execute queue but cache disconnected'); } if(bUnloaded) { this.logger.log(this.queue.length + ' in queue after unloading.'); } return; }, queue: [], request: {}, //contains all the handlers. Created in the INIT function above. helper: {}, // All the helpers replaceEndpointVariables: function(realm, endpoint, platform) { //Replaces $r and $p with platform and realm //Realm matches $r endpoint = endpoint.replace(/\$r/g, realm); if(platform) { endpoint = endpoint.replace(/\$p/g, platform); } return endpoint; }, errorHandle: function(str) { return this.errorHandler(str); }, shutdown: function(now) { return new Promise((resolve, reject) => { this.logger.log('LoL API shutting down...'); clearInterval(this.queueInterval); if(now) { this.cache.end(true); } else { this.cache.quit(); } this.cache.on('end', function() { this.logger.log('Redis connected severed.'); resolve(true); }.bind(this)); }).bind(this) } } module.exports = LoLAPI;
polyma/synergy-lol-api
index.js
JavaScript
mit
14,302
function solve(params) { var N = parseInt(params[0]), K = parseInt(params[1]), numbersAsString = params[2]; var numbers = numbersAsString.split(' ').map(Number); var result = []; for (var i = 0; i < N; i += 1) { if(i+K-1 === N) { break; } var min = 1000000000, max = -1000000000; for (var j = 0; j < K; j += 1) { if(numbers[i+j] > max) { max = numbers[j+i]; } if(numbers[i+j] < min) { min = numbers[j+i]; } } var sum = min + max; result.push(sum); } console.log(result.join(',')); //print answer } var test1 = ['4', '2', '1 3 1 8'], test2 = ['5', '3', '7 7 8 9 10']; console.log(solve(test1)); console.log(solve(test2));
kossov/Telerik-Academy
JavaScript/Fundamentals/RedoExam/Redo-Task1/index.js
JavaScript
mit
833
/** * Created by dima on 06.12.16. */ import React from 'react'; import ViButton from './ViButton'; import './ViFileDownload.css' const ViFileDownloadButton = function ({ onClick, assetUri, type, loading }) { return ( <div className="ViFileDownload"> {onClick && <ViButton onClick={() => { onClick(type) }} label={`Export ${type}`}/>} {assetUri && <div className="ViFileDownload-assetDownloadButtonWr"> <a className="ViFileDownload-assetDownloadButton" href={assetUri}>Download {type}</a> </div>} {loading && <div className="ViFileDownload-assetDownloadButtonWr">Loading...</div>} </div> ) } export default ViFileDownloadButton;
ddddm/item-images-frontend
src/ViFileDownload.js
JavaScript
mit
751
'use strict'; exports.BattleFormatsData = { bulbasaur: { randomBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "leechseed", "synthesis"], randomDoubleBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["sweetscent", "growth", "solarbeam", "synthesis"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "growl", "leechseed", "vinewhip"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tackle", "growl", "leechseed", "vinewhip"]}, {"generation": 5, "level": 1, "shiny": 1, "ivs": {"def": 31}, "isHidden": false, "moves":["falseswipe", "block", "frenzyplant", "weatherball"]}, {"generation": 6, "level": 5, "isHidden": false, "moves":["growl", "leechseed", "vinewhip", "poisonpowder"], "pokeball": "cherishball"}, {"generation": 6, "level": 5, "isHidden": true, "moves":["tackle", "growl", "celebrate"], "pokeball": "cherishball"}, ], tier: "LC", }, ivysaur: { randomBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "leechseed", "synthesis"], randomDoubleBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "protect"], tier: "NFE", }, venusaur: { randomBattleMoves: ["sunnyday", "sleeppowder", "gigadrain", "hiddenpowerfire", "sludgebomb", "leechseed", "substitute"], randomDoubleBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "protect"], eventPokemon: [ {"generation": 6, "level": 100, "isHidden": true, "moves":["solarbeam", "frenzyplant", "synthesis", "grasspledge"], "pokeball": "cherishball"}, ], tier: "RU", }, venusaurmega: { randomBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "sludgebomb", "leechseed", "synthesis", "earthquake", "knockoff"], randomDoubleBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "protect"], requiredItem: "Venusaurite", tier: "OU", }, charmander: { randomBattleMoves: ["flamethrower", "overheat", "dragonpulse", "hiddenpowergrass", "fireblast"], randomDoubleBattleMoves: ["heatwave", "dragonpulse", "hiddenpowergrass", "fireblast", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "growl", "ember"]}, {"generation": 4, "level": 40, "gender": "M", "nature": "Mild", "moves":["return", "hiddenpower", "quickattack", "howl"], "pokeball": "cherishball"}, {"generation": 4, "level": 40, "gender": "M", "nature": "Naive", "moves":["return", "hiddenpower", "quickattack", "howl"], "pokeball": "cherishball"}, {"generation": 4, "level": 40, "gender": "M", "nature": "Naughty", "moves":["return", "hiddenpower", "quickattack", "howl"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["scratch", "growl", "ember", "smokescreen"]}, {"generation": 4, "level": 40, "gender": "M", "nature": "Hardy", "moves":["return", "hiddenpower", "quickattack", "howl"], "pokeball": "cherishball"}, {"generation": 5, "level": 1, "shiny": 1, "ivs": {"spe": 31}, "isHidden": false, "moves":["falseswipe", "block", "blastburn", "acrobatics"]}, {"generation": 6, "level": 5, "isHidden": false, "moves":["growl", "ember", "smokescreen", "dragonrage"], "pokeball": "cherishball"}, {"generation": 6, "level": 5, "isHidden": true, "moves":["scratch", "growl", "celebrate"], "pokeball": "cherishball"}, ], tier: "LC", }, charmeleon: { randomBattleMoves: ["flamethrower", "overheat", "dragonpulse", "hiddenpowergrass", "fireblast", "dragondance", "flareblitz", "shadowclaw", "dragonclaw"], randomDoubleBattleMoves: ["heatwave", "dragonpulse", "hiddenpowergrass", "fireblast", "protect"], tier: "NFE", }, charizard: { randomBattleMoves: ["fireblast", "airslash", "focusblast", "roost", "swordsdance", "flamecharge", "acrobatics", "earthquake", "willowisp"], randomDoubleBattleMoves: ["heatwave", "fireblast", "airslash", "overheat", "dragonpulse", "roost", "tailwind", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["wingattack", "slash", "dragonrage", "firespin"]}, {"generation": 6, "level": 36, "gender": "M", "isHidden": false, "moves":["firefang", "flameburst", "airslash", "inferno"], "pokeball": "cherishball"}, {"generation": 6, "level": 36, "gender": "M", "isHidden": false, "moves":["firefang", "airslash", "dragonclaw", "dragonrage"], "pokeball": "cherishball"}, {"generation": 6, "level": 36, "shiny": true, "gender": "M", "isHidden": false, "moves":["overheat", "solarbeam", "focusblast", "holdhands"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "isHidden": true, "moves":["flareblitz", "blastburn", "scaryface", "firepledge"], "pokeball": "cherishball"}, {"generation": 7, "level": 40, "gender": "M", "nature": "Jolly", "isHidden": false, "moves":["flareblitz", "dragonclaw", "fly", "dragonrage"], "pokeball": "cherishball"}, {"generation": 7, "level": 40, "gender": "M", "nature": "Adamant", "isHidden": false, "moves":["flamethrower", "dragonrage", "slash", "seismictoss"], "pokeball": "pokeball"}, ], tier: "BL4", }, charizardmegax: { randomBattleMoves: ["dragondance", "flareblitz", "dragonclaw", "earthquake", "roost", "willowisp"], randomDoubleBattleMoves: ["dragondance", "flareblitz", "dragonclaw", "earthquake", "rockslide", "roost", "substitute"], requiredItem: "Charizardite X", tier: "OU", }, charizardmegay: { randomBattleMoves: ["fireblast", "airslash", "roost", "solarbeam", "focusblast", "dragonpulse"], randomDoubleBattleMoves: ["heatwave", "fireblast", "airslash", "roost", "solarbeam", "focusblast", "protect"], requiredItem: "Charizardite Y", tier: "OU", }, squirtle: { randomBattleMoves: ["icebeam", "hydropump", "rapidspin", "scald", "aquajet", "toxic"], randomDoubleBattleMoves: ["muddywater", "icebeam", "hydropump", "fakeout", "scald", "followme", "icywind", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "tailwhip", "bubble", "withdraw"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tackle", "tailwhip", "bubble", "withdraw"]}, {"generation": 5, "level": 1, "shiny": 1, "ivs": {"hp": 31}, "isHidden": false, "moves":["falseswipe", "block", "hydrocannon", "followme"]}, {"generation": 6, "level": 5, "isHidden": false, "moves":["tailwhip", "watergun", "withdraw", "bubble"], "pokeball": "cherishball"}, {"generation": 6, "level": 5, "isHidden": true, "moves":["tackle", "tailwhip", "celebrate"], "pokeball": "cherishball"}, ], tier: "LC", }, wartortle: { randomBattleMoves: ["icebeam", "hydropump", "rapidspin", "scald", "aquajet", "toxic"], randomDoubleBattleMoves: ["muddywater", "icebeam", "hydropump", "fakeout", "scald", "followme", "icywind", "protect"], tier: "NFE", }, blastoise: { randomBattleMoves: ["icebeam", "rapidspin", "scald", "toxic", "dragontail", "roar"], randomDoubleBattleMoves: ["muddywater", "icebeam", "hydropump", "fakeout", "scald", "followme", "icywind", "protect", "waterspout"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["protect", "raindance", "skullbash", "hydropump"]}, {"generation": 6, "level": 100, "isHidden": true, "moves":["hydropump", "hydrocannon", "irondefense", "waterpledge"], "pokeball": "cherishball"}, ], tier: "RU", }, blastoisemega: { randomBattleMoves: ["icebeam", "hydropump", "rapidspin", "scald", "dragontail", "darkpulse", "aurasphere"], randomDoubleBattleMoves: ["muddywater", "icebeam", "hydropump", "fakeout", "scald", "darkpulse", "aurasphere", "followme", "icywind", "protect"], requiredItem: "Blastoisinite", tier: "UU", }, caterpie: { randomBattleMoves: ["bugbite", "snore", "tackle", "electroweb"], tier: "LC", }, metapod: { randomBattleMoves: ["snore", "bugbite", "tackle", "electroweb"], tier: "NFE", }, butterfree: { randomBattleMoves: ["sleeppowder", "quiverdance", "bugbuzz", "airslash", "gigadrain", "substitute"], randomDoubleBattleMoves: ["quiverdance", "bugbuzz", "substitute", "sleeppowder", "airslash", "shadowball", "protect"], eventPokemon: [ {"generation": 3, "level": 30, "moves":["morningsun", "psychic", "sleeppowder", "aerialace"]}, ], tier: "PU", }, weedle: { randomBattleMoves: ["bugbite", "stringshot", "poisonsting", "electroweb"], tier: "LC", }, kakuna: { randomBattleMoves: ["electroweb", "bugbite", "irondefense", "poisonsting"], tier: "NFE", }, beedrill: { randomBattleMoves: ["toxicspikes", "tailwind", "uturn", "endeavor", "poisonjab", "knockoff"], randomDoubleBattleMoves: ["xscissor", "uturn", "poisonjab", "drillrun", "brickbreak", "knockoff", "protect", "stringshot"], eventPokemon: [ {"generation": 3, "level": 30, "moves":["batonpass", "sludgebomb", "twineedle", "swordsdance"]}, ], tier: "PU", }, beedrillmega: { randomBattleMoves: ["xscissor", "swordsdance", "uturn", "poisonjab", "drillrun", "knockoff"], randomDoubleBattleMoves: ["xscissor", "uturn", "substitute", "poisonjab", "drillrun", "knockoff", "protect"], requiredItem: "Beedrillite", tier: "UU", }, pidgey: { randomBattleMoves: ["roost", "bravebird", "heatwave", "return", "workup", "uturn", "thief"], randomDoubleBattleMoves: ["bravebird", "heatwave", "return", "uturn", "tailwind", "protect"], tier: "LC", }, pidgeotto: { randomBattleMoves: ["roost", "bravebird", "heatwave", "return", "workup", "uturn", "thief"], randomDoubleBattleMoves: ["bravebird", "heatwave", "return", "uturn", "tailwind", "protect"], eventPokemon: [ {"generation": 3, "level": 30, "abilities":["keeneye"], "moves":["refresh", "wingattack", "steelwing", "featherdance"]}, ], tier: "NFE", }, pidgeot: { randomBattleMoves: ["roost", "bravebird", "heatwave", "return", "doubleedge", "uturn", "hurricane"], randomDoubleBattleMoves: ["bravebird", "heatwave", "return", "doubleedge", "uturn", "tailwind", "protect"], eventPokemon: [ {"generation": 5, "level": 61, "gender": "M", "nature": "Naughty", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "abilities":["keeneye"], "moves":["whirlwind", "wingattack", "skyattack", "mirrormove"], "pokeball": "cherishball"}, ], tier: "PU", }, pidgeotmega: { randomBattleMoves: ["roost", "heatwave", "uturn", "hurricane", "defog"], randomDoubleBattleMoves: ["tailwind", "heatwave", "uturn", "hurricane", "protect"], requiredItem: "Pidgeotite", tier: "UU", }, rattata: { randomBattleMoves: ["facade", "flamewheel", "suckerpunch", "uturn", "wildcharge", "thunderwave", "crunch", "revenge"], randomDoubleBattleMoves: ["facade", "flamewheel", "suckerpunch", "uturn", "wildcharge", "superfang", "crunch", "protect"], tier: "LC", }, rattataalola: { tier: "LC", }, raticate: { randomBattleMoves: ["protect", "facade", "flamewheel", "suckerpunch", "uturn", "swordsdance"], randomDoubleBattleMoves: ["facade", "flamewheel", "suckerpunch", "uturn", "crunch", "protect"], eventPokemon: [ {"generation": 3, "level": 34, "moves":["refresh", "superfang", "scaryface", "hyperfang"]}, ], tier: "PU", }, raticatealola: { randomBattleMoves: ["swordsdance", "return", "suckerpunch", "crunch", "doubleedge"], randomDoubleBattleMoves: ["doubleedge", "suckerpunch", "protect", "crunch", "uturn"], tier: "PU", }, spearow: { randomBattleMoves: ["return", "drillpeck", "doubleedge", "uturn", "quickattack", "pursuit", "drillrun", "featherdance"], randomDoubleBattleMoves: ["return", "drillpeck", "doubleedge", "uturn", "quickattack", "drillrun", "protect"], eventPokemon: [ {"generation": 3, "level": 22, "moves":["batonpass", "falseswipe", "leer", "aerialace"]}, ], tier: "LC", }, fearow: { randomBattleMoves: ["return", "drillpeck", "doubleedge", "uturn", "pursuit", "drillrun"], randomDoubleBattleMoves: ["return", "drillpeck", "doubleedge", "uturn", "quickattack", "drillrun", "protect"], tier: "PU", }, ekans: { randomBattleMoves: ["coil", "gunkshot", "glare", "suckerpunch", "earthquake", "rest"], randomDoubleBattleMoves: ["gunkshot", "seedbomb", "suckerpunch", "aquatail", "earthquake", "rest", "rockslide", "protect"], eventPokemon: [ {"generation": 3, "level": 14, "gender": "F", "nature": "Docile", "ivs": {"hp": 26, "atk": 28, "def": 6, "spa": 14, "spd": 30, "spe": 11}, "abilities":["shedskin"], "moves":["leer", "wrap", "poisonsting", "bite"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["wrap", "leer", "poisonsting"]}, ], tier: "LC", }, arbok: { randomBattleMoves: ["coil", "gunkshot", "suckerpunch", "aquatail", "earthquake", "rest"], randomDoubleBattleMoves: ["gunkshot", "suckerpunch", "aquatail", "crunch", "earthquake", "rest", "rockslide", "protect"], eventPokemon: [ {"generation": 3, "level": 33, "moves":["refresh", "sludgebomb", "glare", "bite"]}, ], tier: "PU", }, pichu: { randomBattleMoves: ["fakeout", "volttackle", "encore", "irontail", "toxic", "thunderbolt"], randomDoubleBattleMoves: ["fakeout", "volttackle", "encore", "irontail", "protect", "thunderbolt"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["thundershock", "charm", "surf"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["thundershock", "charm", "wish"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["thundershock", "charm", "teeterdance"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["thundershock", "charm", "followme"]}, {"generation": 4, "level": 1, "moves":["volttackle", "thunderbolt", "grassknot", "return"]}, {"generation": 4, "level": 30, "shiny": true, "gender": "M", "nature": "Jolly", "moves":["charge", "volttackle", "endeavor", "endure"], "pokeball": "cherishball"}, ], tier: "LC", }, pichuspikyeared: { eventPokemon: [ {"generation": 4, "level": 30, "gender": "F", "nature": "Naughty", "moves":["helpinghand", "volttackle", "swagger", "painsplit"]}, ], eventOnly: true, gen: 4, tier: "Illegal", }, pikachu: { randomBattleMoves: ["thunderbolt", "volttackle", "voltswitch", "grassknot", "hiddenpowerice", "brickbreak", "extremespeed", "encore", "substitute", "knockoff"], randomDoubleBattleMoves: ["fakeout", "thunderbolt", "volttackle", "voltswitch", "grassknot", "hiddenpowerice", "brickbreak", "extremespeed", "encore", "substitute", "knockoff", "protect", "discharge"], eventPokemon: [ {"generation": 3, "level": 50, "moves":["thunderbolt", "agility", "thunder", "lightscreen"]}, {"generation": 3, "level": 10, "moves":["thundershock", "growl", "tailwhip", "thunderwave"]}, {"generation": 3, "level": 10, "moves":["fly", "tailwhip", "growl", "thunderwave"]}, {"generation": 3, "level": 5, "moves":["surf", "growl", "tailwhip", "thunderwave"]}, {"generation": 3, "level": 10, "moves":["fly", "growl", "tailwhip", "thunderwave"]}, {"generation": 3, "level": 10, "moves":["thundershock", "growl", "thunderwave", "surf"]}, {"generation": 3, "level": 70, "moves":["thunderbolt", "thunder", "lightscreen", "fly"]}, {"generation": 3, "level": 70, "moves":["thunderbolt", "thunder", "lightscreen", "surf"]}, {"generation": 3, "level": 70, "moves":["thunderbolt", "thunder", "lightscreen", "agility"]}, {"generation": 4, "level": 10, "gender": "F", "nature": "Hardy", "moves":["surf", "volttackle", "tailwhip", "thunderwave"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["thundershock", "growl", "tailwhip", "thunderwave"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Hardy", "moves":["surf", "thunderbolt", "lightscreen", "quickattack"], "pokeball": "cherishball"}, {"generation": 4, "level": 20, "gender": "F", "nature": "Bashful", "moves":["present", "quickattack", "thundershock", "tailwhip"], "pokeball": "cherishball"}, {"generation": 4, "level": 20, "gender": "M", "nature": "Jolly", "moves":["grassknot", "thunderbolt", "flash", "doubleteam"], "pokeball": "cherishball"}, {"generation": 4, "level": 40, "gender": "M", "nature": "Modest", "moves":["surf", "thunder", "protect"], "pokeball": "cherishball"}, {"generation": 4, "level": 20, "gender": "F", "nature": "Bashful", "moves":["quickattack", "thundershock", "tailwhip", "present"], "pokeball": "cherishball"}, {"generation": 4, "level": 40, "gender": "M", "nature": "Mild", "moves":["surf", "thunder", "protect"], "pokeball": "cherishball"}, {"generation": 4, "level": 20, "gender": "F", "nature": "Bashful", "moves":["present", "quickattack", "thunderwave", "tailwhip"], "pokeball": "cherishball"}, {"generation": 4, "level": 30, "gender": "M", "nature": "Naughty", "moves":["lastresort", "present", "thunderbolt", "quickattack"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "gender": "M", "nature": "Relaxed", "moves":["rest", "sleeptalk", "yawn", "snore"], "pokeball": "cherishball"}, {"generation": 4, "level": 20, "gender": "M", "nature": "Docile", "moves":["present", "quickattack", "thundershock", "tailwhip"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "gender": "M", "nature": "Naughty", "moves":["volttackle", "irontail", "quickattack", "thunderbolt"], "pokeball": "cherishball"}, {"generation": 4, "level": 20, "gender": "M", "nature": "Bashful", "moves":["present", "quickattack", "thundershock", "tailwhip"], "pokeball": "cherishball"}, {"generation": 5, "level": 30, "gender": "F", "isHidden": true, "moves":["sing", "teeterdance", "encore", "electroball"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "isHidden": false, "moves":["fly", "irontail", "electroball", "quickattack"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "shiny": 1, "gender": "F", "isHidden": false, "moves":["thunder", "volttackle", "grassknot", "quickattack"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "shiny": 1, "gender": "F", "isHidden": false, "moves":["extremespeed", "thunderbolt", "grassknot", "brickbreak"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "gender": "F", "nature": "Timid", "isHidden": true, "moves":["fly", "thunderbolt", "grassknot", "protect"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["thundershock", "tailwhip", "thunderwave", "headbutt"]}, {"generation": 5, "level": 100, "gender": "M", "isHidden": true, "moves":["volttackle", "quickattack", "feint", "voltswitch"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "gender": "M", "nature": "Brave", "isHidden": false, "moves":["thunderbolt", "quickattack", "irontail", "electroball"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "growl", "playnice", "quickattack"], "pokeball": "cherishball"}, {"generation": 6, "level": 22, "isHidden": false, "moves":["quickattack", "electroball", "doubleteam", "megakick"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "isHidden": false, "moves":["thunderbolt", "quickattack", "surf", "holdhands"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "gender": "F", "isHidden": false, "moves":["thunderbolt", "quickattack", "heartstamp", "holdhands"], "pokeball": "healball"}, {"generation": 6, "level": 36, "shiny": true, "isHidden": true, "moves":["thunder", "substitute", "playnice", "holdhands"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "gender": "F", "isHidden": false, "moves":["playnice", "charm", "nuzzle", "sweetkiss"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "gender": "M", "nature": "Naughty", "isHidden": false, "moves":["thunderbolt", "quickattack", "irontail", "electroball"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "shiny": true, "isHidden": false, "moves":["teeterdance", "playnice", "tailwhip", "nuzzle"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "perfectIVs": 2, "isHidden": true, "moves":["fakeout", "encore", "volttackle", "endeavor"], "pokeball": "cherishball"}, {"generation": 6, "level": 99, "isHidden": false, "moves":["happyhour", "playnice", "holdhands", "flash"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "isHidden": false, "moves":["fly", "surf", "agility", "celebrate"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "isHidden": false, "moves":["bestow", "holdhands", "return", "playnice"], "pokeball": "healball"}, {"generation": 7, "level": 10, "nature": "Jolly", "isHidden": false, "moves":["celebrate", "growl", "playnice", "quickattack"], "pokeball": "cherishball"}, {"generation": 7, "level": 10, "isHidden": false, "moves":["bestow", "holdhands", "return", "playnice"], "pokeball": "cherishball"}, {"generation": 7, "level": 10, "isHidden": false, "moves":["holdhands", "playnice", "teeterdance", "happyhour"], "pokeball": "cherishball"}, {"generation": 7, "level": 10, "isHidden": false, "moves":["growl", "quickattack", "thundershock", "happyhour"], "pokeball": "cherishball"}, ], tier: "NFE", }, pikachucosplay: { eventPokemon: [ {"generation": 6, "level": 20, "moves":["quickattack", "electroball", "thunderwave", "thundershock"]}, ], eventOnly: true, gen: 6, tier: "Illegal", }, pikachurockstar: { eventPokemon: [ {"generation": 6, "level": 20, "moves":["quickattack", "electroball", "thunderwave", "meteormash"]}, ], eventOnly: true, gen: 6, tier: "Illegal", }, pikachubelle: { eventPokemon: [ {"generation": 6, "level": 20, "moves":["quickattack", "electroball", "thunderwave", "iciclecrash"]}, ], eventOnly: true, gen: 6, tier: "Illegal", }, pikachupopstar: { eventPokemon: [ {"generation": 6, "level": 20, "moves":["quickattack", "electroball", "thunderwave", "drainingkiss"]}, ], eventOnly: true, gen: 6, tier: "Illegal", }, pikachuphd: { eventPokemon: [ {"generation": 6, "level": 20, "moves":["quickattack", "electroball", "thunderwave", "electricterrain"]}, ], eventOnly: true, gen: 6, tier: "Illegal", }, pikachulibre: { eventPokemon: [ {"generation": 6, "level": 20, "moves":["quickattack", "electroball", "thunderwave", "flyingpress"]}, ], eventOnly: true, gen: 6, tier: "Illegal", }, pikachuoriginal: { eventPokemon: [ {"generation": 7, "level": 1, "nature": "Hardy", "moves":["thunderbolt", "quickattack", "thunder", "agility"]}, ], eventOnly: true, gen: 7, tier: "PU", }, pikachuhoenn: { eventPokemon: [ {"generation": 7, "level": 6, "nature": "Hardy", "moves":["thunderbolt", "quickattack", "thunder", "irontail"]}, ], eventOnly: true, gen: 7, tier: "PU", }, pikachusinnoh: { eventPokemon: [ {"generation": 7, "level": 10, "nature": "Hardy", "moves":["thunderbolt", "quickattack", "irontail", "volttackle"]}, ], eventOnly: true, gen: 7, tier: "PU", }, pikachuunova: { eventPokemon: [ {"generation": 7, "level": 14, "nature": "Hardy", "moves":["thunderbolt", "quickattack", "irontail", "volttackle"]}, ], eventOnly: true, gen: 7, tier: "PU", }, pikachukalos: { eventPokemon: [ {"generation": 7, "level": 17, "nature": "Hardy", "moves":["thunderbolt", "quickattack", "irontail", "electroball"]}, ], eventOnly: true, gen: 7, tier: "PU", }, pikachualola: { eventPokemon: [ {"generation": 7, "level": 20, "nature": "Hardy", "moves":["thunderbolt", "quickattack", "irontail", "electroball"]}, ], eventOnly: true, gen: 7, tier: "PU", }, raichu: { randomBattleMoves: ["nastyplot", "encore", "thunderbolt", "grassknot", "hiddenpowerice", "focusblast", "voltswitch"], randomDoubleBattleMoves: ["fakeout", "encore", "thunderbolt", "grassknot", "hiddenpowerice", "focusblast", "voltswitch", "protect"], tier: "PU", }, raichualola: { randomBattleMoves: ["nastyplot", "thunderbolt", "psyshock", "focusblast", "voltswitch", "surf"], randomDoubleBattleMoves: ["thunderbolt", "fakeout", "encore", "psychic", "protect", "voltswitch"], tier: "PU", }, sandshrew: { randomBattleMoves: ["earthquake", "rockslide", "swordsdance", "rapidspin", "xscissor", "stealthrock", "toxic", "knockoff"], randomDoubleBattleMoves: ["earthquake", "rockslide", "swordsdance", "xscissor", "knockoff", "protect"], eventPokemon: [ {"generation": 3, "level": 12, "gender": "M", "nature": "Docile", "ivs": {"hp": 4, "atk": 23, "def": 8, "spa": 31, "spd": 1, "spe": 25}, "moves":["scratch", "defensecurl", "sandattack", "poisonsting"]}, ], tier: "LC", }, sandshrewalola: { eventPokemon: [ {"generation": 7, "level": 10, "isHidden": false, "moves":["rapidspin", "iceball", "powdersnow", "bide"], "pokeball": "cherishball"}, ], tier: "LC", }, sandslash: { randomBattleMoves: ["earthquake", "swordsdance", "rapidspin", "toxic", "stealthrock", "knockoff"], randomDoubleBattleMoves: ["earthquake", "rockslide", "stoneedge", "swordsdance", "xscissor", "knockoff", "protect"], tier: "PU", }, sandslashalola: { randomBattleMoves: ["substitute", "swordsdance", "iciclecrash", "ironhead", "earthquake", "rapidspin"], randomDoubleBattleMoves: ["protect", "swordsdance", "iciclecrash", "ironhead", "earthquake", "rockslide"], tier: "NU", }, nidoranf: { randomBattleMoves: ["toxicspikes", "crunch", "poisonjab", "honeclaws"], randomDoubleBattleMoves: ["helpinghand", "crunch", "poisonjab", "protect"], tier: "LC", }, nidorina: { randomBattleMoves: ["toxicspikes", "crunch", "poisonjab", "honeclaws", "icebeam", "thunderbolt", "shadowclaw"], randomDoubleBattleMoves: ["helpinghand", "crunch", "poisonjab", "protect", "icebeam", "thunderbolt", "shadowclaw"], tier: "NFE", }, nidoqueen: { randomBattleMoves: ["toxicspikes", "stealthrock", "fireblast", "icebeam", "earthpower", "sludgewave"], randomDoubleBattleMoves: ["protect", "fireblast", "icebeam", "earthpower", "sludgebomb", "thunderbolt"], eventPokemon: [ {"generation": 6, "level": 41, "perfectIVs": 2, "isHidden": false, "abilities":["poisonpoint"], "moves":["tailwhip", "doublekick", "poisonsting", "bodyslam"], "pokeball": "cherishball"}, ], tier: "RU", }, nidoranm: { randomBattleMoves: ["suckerpunch", "poisonjab", "headsmash", "honeclaws", "shadowclaw"], randomDoubleBattleMoves: ["suckerpunch", "poisonjab", "shadowclaw", "helpinghand", "protect"], tier: "LC", }, nidorino: { randomBattleMoves: ["suckerpunch", "poisonjab", "headsmash", "honeclaws", "shadowclaw"], randomDoubleBattleMoves: ["suckerpunch", "poisonjab", "shadowclaw", "helpinghand", "protect"], tier: "NFE", }, nidoking: { randomBattleMoves: ["substitute", "fireblast", "icebeam", "earthpower", "sludgewave", "superpower"], randomDoubleBattleMoves: ["protect", "fireblast", "thunderbolt", "icebeam", "earthpower", "sludgebomb", "focusblast"], tier: "UU", }, cleffa: { randomBattleMoves: ["reflect", "thunderwave", "lightscreen", "toxic", "fireblast", "encore", "wish", "protect", "aromatherapy"], randomDoubleBattleMoves: ["reflect", "thunderwave", "lightscreen", "safeguard", "fireblast", "protect"], tier: "LC", }, clefairy: { randomBattleMoves: ["healingwish", "reflect", "thunderwave", "lightscreen", "toxic", "fireblast", "encore", "wish", "protect", "aromatherapy", "stealthrock", "moonblast", "knockoff", "moonlight"], randomDoubleBattleMoves: ["reflect", "thunderwave", "lightscreen", "safeguard", "fireblast", "followme", "protect", "moonblast"], tier: "NFE", }, clefable: { randomBattleMoves: ["calmmind", "softboiled", "fireblast", "moonblast", "stealthrock", "thunderwave"], randomDoubleBattleMoves: ["reflect", "thunderwave", "lightscreen", "safeguard", "fireblast", "followme", "protect", "moonblast", "dazzlinggleam", "softboiled"], tier: "OU", }, vulpix: { randomBattleMoves: ["flamethrower", "fireblast", "willowisp", "energyball", "substitute", "toxic", "hypnosis", "painsplit"], randomDoubleBattleMoves: ["heatwave", "fireblast", "willowisp", "energyball", "substitute", "protect"], eventPokemon: [ {"generation": 3, "level": 18, "gender": "F", "nature": "Quirky", "ivs": {"hp": 15, "atk": 6, "def": 3, "spa": 25, "spd": 13, "spe": 22}, "moves":["tailwhip", "roar", "quickattack", "willowisp"]}, {"generation": 3, "level": 18, "moves":["charm", "heatwave", "ember", "dig"]}, ], tier: "LC Uber", }, vulpixalola: { eventPokemon: [ {"generation": 7, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "babydolleyes", "iceshard"], "pokeball": "cherishball"}, {"generation": 7, "level": 10, "gender": "F", "nature": "Modest", "isHidden": false, "moves":["powdersnow"], "pokeball": "cherishball"}, ], tier: "LC", }, ninetales: { randomBattleMoves: ["fireblast", "willowisp", "solarbeam", "nastyplot", "substitute", "hiddenpowerice"], randomDoubleBattleMoves: ["heatwave", "fireblast", "willowisp", "solarbeam", "substitute", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "gender": "M", "nature": "Bold", "ivs": {"def": 31}, "isHidden": true, "moves":["heatwave", "solarbeam", "psyshock", "willowisp"], "pokeball": "cherishball"}, ], tier: "PU", }, ninetalesalola: { randomBattleMoves: ["nastyplot", "blizzard", "moonblast", "substitute", "hiddenpowerfire", "freezedry", "auroraveil"], randomDoubleBattleMoves: ["blizzard", "moonblast", "protect", "hiddenpowerfire", "freezedry", "auroraveil", "encore"], tier: "OU", }, igglybuff: { randomBattleMoves: ["wish", "thunderwave", "reflect", "lightscreen", "healbell", "seismictoss", "counter", "protect"], randomDoubleBattleMoves: ["wish", "thunderwave", "reflect", "lightscreen", "seismictoss", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "abilities":["cutecharm"], "moves":["sing", "charm", "defensecurl", "tickle"]}, ], tier: "LC", }, jigglypuff: { randomBattleMoves: ["wish", "thunderwave", "reflect", "lightscreen", "healbell", "seismictoss", "counter", "stealthrock", "protect", "knockoff", "dazzlinggleam"], randomDoubleBattleMoves: ["wish", "thunderwave", "reflect", "lightscreen", "seismictoss", "protect", "knockoff", "dazzlinggleam"], tier: "NFE", }, wigglytuff: { randomBattleMoves: ["wish", "protect", "fireblast", "stealthrock", "dazzlinggleam", "hypervoice"], randomDoubleBattleMoves: ["thunderwave", "reflect", "lightscreen", "protect", "dazzlinggleam", "fireblast", "icebeam", "hypervoice"], tier: "PU", }, zubat: { randomBattleMoves: ["bravebird", "roost", "toxic", "taunt", "nastyplot", "gigadrain", "sludgebomb", "airslash", "uturn", "whirlwind", "heatwave", "superfang"], randomDoubleBattleMoves: ["bravebird", "taunt", "nastyplot", "gigadrain", "sludgebomb", "airslash", "uturn", "protect", "heatwave", "superfang"], tier: "LC", }, golbat: { randomBattleMoves: ["bravebird", "roost", "toxic", "taunt", "defog", "superfang", "uturn"], randomDoubleBattleMoves: ["bravebird", "taunt", "nastyplot", "gigadrain", "sludgebomb", "airslash", "uturn", "protect", "heatwave", "superfang"], tier: "NU", }, crobat: { randomBattleMoves: ["bravebird", "roost", "toxic", "taunt", "defog", "uturn", "superfang"], randomDoubleBattleMoves: ["bravebird", "taunt", "tailwind", "crosspoison", "uturn", "protect", "superfang"], eventPokemon: [ {"generation": 4, "level": 30, "gender": "M", "nature": "Timid", "moves":["heatwave", "airslash", "sludgebomb", "superfang"], "pokeball": "cherishball"}, ], tier: "UU", }, oddish: { randomBattleMoves: ["gigadrain", "sludgebomb", "synthesis", "sleeppowder", "stunspore", "toxic", "hiddenpowerfire", "leechseed", "dazzlinggleam", "sunnyday"], randomDoubleBattleMoves: ["gigadrain", "sludgebomb", "sleeppowder", "stunspore", "protect", "hiddenpowerfire", "leechseed", "dazzlinggleam", "sunnyday"], eventPokemon: [ {"generation": 3, "level": 26, "gender": "M", "nature": "Quirky", "ivs": {"hp": 23, "atk": 24, "def": 20, "spa": 21, "spd": 9, "spe": 16}, "moves":["poisonpowder", "stunspore", "sleeppowder", "acid"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["absorb", "leechseed"]}, ], tier: "LC", }, gloom: { randomBattleMoves: ["gigadrain", "sludgebomb", "synthesis", "sleeppowder", "stunspore", "toxic", "hiddenpowerfire", "leechseed", "dazzlinggleam", "sunnyday"], randomDoubleBattleMoves: ["gigadrain", "sludgebomb", "sleeppowder", "stunspore", "protect", "hiddenpowerfire", "leechseed", "dazzlinggleam", "sunnyday"], eventPokemon: [ {"generation": 3, "level": 50, "moves":["sleeppowder", "acid", "moonlight", "petaldance"]}, ], tier: "NFE", }, vileplume: { randomBattleMoves: ["gigadrain", "sludgebomb", "synthesis", "sleeppowder", "hiddenpowerfire", "aromatherapy"], randomDoubleBattleMoves: ["gigadrain", "sludgebomb", "sleeppowder", "stunspore", "protect", "hiddenpowerfire", "moonblast"], tier: "NU", }, bellossom: { randomBattleMoves: ["gigadrain", "sleeppowder", "hiddenpowerfire", "hiddenpowerrock", "quiverdance", "moonblast"], randomDoubleBattleMoves: ["gigadrain", "sludgebomb", "sleeppowder", "stunspore", "protect", "hiddenpowerfire", "moonblast", "sunnyday", "solarbeam"], tier: "PU", }, paras: { randomBattleMoves: ["spore", "stunspore", "xscissor", "seedbomb", "synthesis", "leechseed", "aromatherapy", "knockoff"], randomDoubleBattleMoves: ["spore", "stunspore", "xscissor", "seedbomb", "ragepowder", "leechseed", "protect", "knockoff", "wideguard"], eventPokemon: [ {"generation": 3, "level": 28, "abilities":["effectspore"], "moves":["refresh", "spore", "slash", "falseswipe"]}, ], tier: "LC", }, parasect: { randomBattleMoves: ["spore", "substitute", "leechlife", "seedbomb", "leechseed", "knockoff"], randomDoubleBattleMoves: ["spore", "stunspore", "leechlife", "seedbomb", "ragepowder", "leechseed", "protect", "knockoff", "wideguard"], tier: "PU", }, venonat: { randomBattleMoves: ["sleeppowder", "morningsun", "toxicspikes", "sludgebomb", "signalbeam", "stunspore", "psychic"], randomDoubleBattleMoves: ["sleeppowder", "morningsun", "ragepowder", "sludgebomb", "signalbeam", "stunspore", "psychic", "protect"], tier: "LC", }, venomoth: { randomBattleMoves: ["sleeppowder", "quiverdance", "batonpass", "bugbuzz", "sludgebomb", "substitute"], randomDoubleBattleMoves: ["sleeppowder", "roost", "ragepowder", "quiverdance", "protect", "bugbuzz", "sludgebomb", "gigadrain", "substitute", "psychic"], eventPokemon: [ {"generation": 3, "level": 32, "abilities":["shielddust"], "moves":["refresh", "silverwind", "substitute", "psychic"]}, ], tier: "BL2", }, diglett: { randomBattleMoves: ["earthquake", "rockslide", "stealthrock", "suckerpunch", "reversal", "substitute", "shadowclaw"], randomDoubleBattleMoves: ["earthquake", "rockslide", "protect", "suckerpunch", "shadowclaw"], tier: "LC", }, diglettalola: { eventPokemon: [ {"generation": 7, "level": 10, "isHidden": false, "abilities":["tanglinghair"], "moves":["mudslap", "astonish", "growl", "metalclaw"], "pokeball": "cherishball"}, ], tier: "LC", }, dugtrio: { randomBattleMoves: ["earthquake", "stoneedge", "stealthrock", "suckerpunch", "reversal", "substitute"], randomDoubleBattleMoves: ["earthquake", "rockslide", "protect", "suckerpunch", "stoneedge"], eventPokemon: [ {"generation": 3, "level": 40, "moves":["charm", "earthquake", "sandstorm", "triattack"]}, ], tier: "OU", }, dugtrioalola: { randomBattleMoves: ["earthquake", "ironhead", "substitute", "reversal", "stoneedge", "suckerpunch"], randomDoubleBattleMoves: ["earthquake", "ironhead", "protect", "rockslide", "stoneedge", "suckerpunch"], tier: "PU", }, meowth: { randomBattleMoves: ["fakeout", "uturn", "thief", "taunt", "return", "hypnosis"], randomDoubleBattleMoves: ["fakeout", "uturn", "nightslash", "taunt", "return", "hypnosis", "feint", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["scratch", "growl", "petaldance"]}, {"generation": 3, "level": 5, "moves":["scratch", "growl"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "growl", "bite"]}, {"generation": 3, "level": 22, "moves":["sing", "slash", "payday", "bite"]}, {"generation": 4, "level": 21, "gender": "F", "nature": "Jolly", "abilities":["pickup"], "moves":["bite", "fakeout", "furyswipes", "screech"], "pokeball": "cherishball"}, {"generation": 4, "level": 10, "gender": "M", "nature": "Jolly", "abilities":["pickup"], "moves":["fakeout", "payday", "assist", "scratch"], "pokeball": "cherishball"}, {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "abilities":["pickup"], "moves":["furyswipes", "sing", "nastyplot", "snatch"], "pokeball": "cherishball"}, {"generation": 6, "level": 20, "isHidden": false, "abilities":["pickup"], "moves":["happyhour", "screech", "bite", "fakeout"], "pokeball": "cherishball"}, ], tier: "LC", }, meowthalola: { tier: "LC", }, persian: { randomBattleMoves: ["fakeout", "uturn", "taunt", "return", "knockoff"], randomDoubleBattleMoves: ["fakeout", "uturn", "knockoff", "taunt", "return", "hypnosis", "feint", "protect"], tier: "PU", }, persianalola: { randomBattleMoves: ["nastyplot", "darkpulse", "powergem", "hypnosis", "hiddenpowerfighting"], randomDoubleBattleMoves: ["fakeout", "foulplay", "darkpulse", "powergem", "snarl", "hiddenpowerfighting", "partingshot", "protect"], tier: "PU", }, psyduck: { randomBattleMoves: ["hydropump", "scald", "icebeam", "hiddenpowergrass", "crosschop", "encore", "psychic", "signalbeam"], randomDoubleBattleMoves: ["hydropump", "scald", "icebeam", "hiddenpowergrass", "crosschop", "encore", "psychic", "signalbeam", "surf", "icywind", "protect"], eventPokemon: [ {"generation": 3, "level": 27, "gender": "M", "nature": "Lax", "ivs": {"hp": 31, "atk": 16, "def": 12, "spa": 29, "spd": 31, "spe": 14}, "abilities":["damp"], "moves":["tailwhip", "confusion", "disable", "screech"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["watersport", "scratch", "tailwhip", "mudsport"]}, ], tier: "LC", }, golduck: { randomBattleMoves: ["hydropump", "scald", "icebeam", "psyshock", "encore", "calmmind", "substitute"], randomDoubleBattleMoves: ["hydropump", "scald", "icebeam", "hiddenpowergrass", "focusblast", "encore", "psychic", "icywind", "protect"], eventPokemon: [ {"generation": 3, "level": 33, "moves":["charm", "waterfall", "psychup", "brickbreak"]}, ], tier: "PU", }, mankey: { randomBattleMoves: ["closecombat", "uturn", "icepunch", "rockslide", "punishment", "earthquake", "poisonjab"], randomDoubleBattleMoves: ["closecombat", "uturn", "icepunch", "rockslide", "punishment", "earthquake", "poisonjab", "protect"], tier: "LC", }, primeape: { randomBattleMoves: ["closecombat", "uturn", "icepunch", "stoneedge", "encore", "earthquake", "gunkshot"], randomDoubleBattleMoves: ["closecombat", "uturn", "icepunch", "rockslide", "punishment", "earthquake", "poisonjab", "protect", "taunt", "stoneedge"], eventPokemon: [ {"generation": 3, "level": 34, "abilities":["vitalspirit"], "moves":["helpinghand", "crosschop", "focusenergy", "reversal"]}, ], tier: "PU", }, growlithe: { randomBattleMoves: ["flareblitz", "wildcharge", "hiddenpowergrass", "closecombat", "morningsun", "willowisp", "toxic", "flamethrower"], randomDoubleBattleMoves: ["flareblitz", "wildcharge", "hiddenpowergrass", "closecombat", "willowisp", "snarl", "heatwave", "helpinghand", "protect"], eventPokemon: [ {"generation": 3, "level": 32, "gender": "F", "nature": "Quiet", "ivs": {"hp": 11, "atk": 24, "def": 28, "spa": 1, "spd": 20, "spe": 2}, "abilities":["intimidate"], "moves":["leer", "odorsleuth", "takedown", "flamewheel"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["bite", "roar", "ember"]}, {"generation": 3, "level": 28, "moves":["charm", "flamethrower", "bite", "takedown"]}, ], tier: "LC", }, arcanine: { randomBattleMoves: ["flareblitz", "wildcharge", "extremespeed", "closecombat", "morningsun", "willowisp", "toxic", "crunch", "roar"], randomDoubleBattleMoves: ["flareblitz", "wildcharge", "closecombat", "willowisp", "snarl", "protect", "extremespeed"], eventPokemon: [ {"generation": 4, "level": 50, "abilities":["intimidate"], "moves":["flareblitz", "thunderfang", "crunch", "extremespeed"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "isHidden": false, "abilities":["intimidate"], "moves":["flareblitz", "extremespeed", "willowisp", "protect"], "pokeball": "cherishball"}, ], tier: "UU", }, poliwag: { randomBattleMoves: ["hydropump", "icebeam", "encore", "bellydrum", "hypnosis", "waterfall", "return"], randomDoubleBattleMoves: ["hydropump", "icebeam", "encore", "icywind", "hypnosis", "waterfall", "return", "protect", "helpinghand"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["bubble", "sweetkiss"]}, ], tier: "LC", }, poliwhirl: { randomBattleMoves: ["hydropump", "icebeam", "encore", "bellydrum", "hypnosis", "waterfall", "return", "earthquake"], randomDoubleBattleMoves: ["hydropump", "icebeam", "encore", "icywind", "hypnosis", "waterfall", "return", "protect", "helpinghand", "earthquake"], tier: "NFE", }, poliwrath: { randomBattleMoves: ["hydropump", "focusblast", "icebeam", "rest", "sleeptalk", "scald", "circlethrow", "raindance"], randomDoubleBattleMoves: ["bellydrum", "encore", "waterfall", "protect", "icepunch", "earthquake", "brickbreak", "rockslide"], eventPokemon: [ {"generation": 3, "level": 42, "moves":["helpinghand", "hydropump", "raindance", "brickbreak"]}, ], tier: "PU", }, politoed: { randomBattleMoves: ["scald", "toxic", "encore", "perishsong", "protect", "hypnosis", "rest"], randomDoubleBattleMoves: ["scald", "hypnosis", "icywind", "encore", "helpinghand", "protect", "icebeam", "focusblast", "hydropump", "hiddenpowergrass"], eventPokemon: [ {"generation": 5, "level": 50, "gender": "M", "nature": "Calm", "ivs": {"hp": 31, "atk": 13, "def": 31, "spa": 5, "spd": 31, "spe": 5}, "isHidden": true, "moves":["scald", "icebeam", "perishsong", "protect"], "pokeball": "cherishball"}, ], tier: "PU", }, abra: { randomBattleMoves: ["calmmind", "psychic", "psyshock", "hiddenpowerfighting", "shadowball", "encore", "substitute"], randomDoubleBattleMoves: ["protect", "psychic", "psyshock", "hiddenpowerfighting", "shadowball", "encore", "substitute"], tier: "LC", }, kadabra: { randomBattleMoves: ["calmmind", "psychic", "psyshock", "hiddenpowerfighting", "shadowball", "encore", "substitute"], randomDoubleBattleMoves: ["protect", "psychic", "psyshock", "hiddenpowerfighting", "shadowball", "encore", "substitute"], tier: "NFE", }, alakazam: { randomBattleMoves: ["psyshock", "psychic", "focusblast", "shadowball", "hiddenpowerice", "hiddenpowerfire"], randomDoubleBattleMoves: ["protect", "psychic", "psyshock", "focusblast", "shadowball", "encore", "substitute", "dazzlinggleam"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["futuresight", "calmmind", "psychic", "trick"]}, ], tier: "BL", }, alakazammega: { randomBattleMoves: ["calmmind", "psyshock", "focusblast", "shadowball", "encore", "substitute"], randomDoubleBattleMoves: ["protect", "psychic", "psyshock", "focusblast", "shadowball", "encore", "substitute", "dazzlinggleam"], requiredItem: "Alakazite", tier: "OU", }, machop: { randomBattleMoves: ["dynamicpunch", "bulkup", "icepunch", "rockslide", "bulletpunch", "knockoff"], randomDoubleBattleMoves: ["dynamicpunch", "protect", "icepunch", "rockslide", "bulletpunch", "knockoff"], tier: "LC", }, machoke: { randomBattleMoves: ["dynamicpunch", "bulkup", "icepunch", "rockslide", "bulletpunch", "poweruppunch", "knockoff"], randomDoubleBattleMoves: ["dynamicpunch", "protect", "icepunch", "rockslide", "bulletpunch", "knockoff"], eventPokemon: [ {"generation": 5, "level": 30, "isHidden": false, "moves":["lowsweep", "foresight", "seismictoss", "revenge"], "pokeball": "cherishball"}, ], tier: "NFE", }, machamp: { randomBattleMoves: ["dynamicpunch", "icepunch", "stoneedge", "bulletpunch", "knockoff", "substitute"], randomDoubleBattleMoves: ["dynamicpunch", "protect", "icepunch", "stoneedge", "rockslide", "bulletpunch", "knockoff", "wideguard"], eventPokemon: [ {"generation": 3, "level": 38, "gender": "M", "nature": "Quiet", "ivs": {"hp": 9, "atk": 23, "def": 25, "spa": 20, "spd": 15, "spe": 10}, "abilities":["guts"], "moves":["seismictoss", "foresight", "revenge", "vitalthrow"]}, {"generation": 6, "level": 50, "shiny": true, "gender": "M", "nature": "Adamant", "ivs": {"hp": 31, "atk": 31, "def": 31, "spa": 31, "spd": 31, "spe": 31}, "isHidden": false, "abilities":["noguard"], "moves":["dynamicpunch", "stoneedge", "wideguard", "knockoff"], "pokeball": "cherishball"}, {"generation": 7, "level": 34, "gender": "F", "nature": "Brave", "ivs": {"atk": 31}, "isHidden": false, "abilities":["guts"], "moves":["strength", "bulkup", "quickguard", "doubleedge"], "pokeball": "cherishball"}, ], tier: "RU", }, bellsprout: { randomBattleMoves: ["swordsdance", "sleeppowder", "sunnyday", "growth", "solarbeam", "gigadrain", "sludgebomb", "weatherball", "suckerpunch", "seedbomb"], randomDoubleBattleMoves: ["swordsdance", "sleeppowder", "sunnyday", "growth", "solarbeam", "gigadrain", "sludgebomb", "weatherball", "suckerpunch", "seedbomb", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["vinewhip", "teeterdance"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["vinewhip", "growth"]}, ], tier: "LC", }, weepinbell: { randomBattleMoves: ["swordsdance", "sleeppowder", "sunnyday", "growth", "solarbeam", "gigadrain", "sludgebomb", "weatherball", "suckerpunch", "seedbomb", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "sleeppowder", "sunnyday", "growth", "solarbeam", "gigadrain", "sludgebomb", "weatherball", "suckerpunch", "seedbomb", "protect", "knockoff"], eventPokemon: [ {"generation": 3, "level": 32, "moves":["morningsun", "magicalleaf", "sludgebomb", "sweetscent"]}, ], tier: "NFE", }, victreebel: { randomBattleMoves: ["sleeppowder", "sunnyday", "growth", "solarbeam", "gigadrain", "sludgebomb", "weatherball", "suckerpunch", "powerwhip", "knockoff", "swordsdance"], randomDoubleBattleMoves: ["swordsdance", "sleeppowder", "sunnyday", "growth", "solarbeam", "gigadrain", "sludgebomb", "weatherball", "suckerpunch", "powerwhip", "protect", "knockoff"], tier: "PU", }, tentacool: { randomBattleMoves: ["toxicspikes", "rapidspin", "scald", "sludgebomb", "icebeam", "knockoff", "gigadrain", "toxic", "dazzlinggleam"], randomDoubleBattleMoves: ["muddywater", "scald", "sludgebomb", "icebeam", "knockoff", "gigadrain", "protect", "dazzlinggleam"], tier: "LC", }, tentacruel: { randomBattleMoves: ["toxicspikes", "rapidspin", "scald", "sludgebomb", "acidspray", "knockoff"], randomDoubleBattleMoves: ["muddywater", "scald", "sludgebomb", "acidspray", "icebeam", "knockoff", "gigadrain", "protect", "dazzlinggleam"], tier: "UU", }, geodude: { randomBattleMoves: ["stealthrock", "earthquake", "stoneedge", "suckerpunch", "hammerarm", "firepunch", "rockblast"], randomDoubleBattleMoves: ["rockslide", "earthquake", "stoneedge", "suckerpunch", "hammerarm", "firepunch", "protect"], tier: "LC", }, geodudealola: { tier: "LC", }, graveler: { randomBattleMoves: ["stealthrock", "earthquake", "stoneedge", "suckerpunch", "hammerarm", "firepunch", "rockblast"], randomDoubleBattleMoves: ["rockslide", "earthquake", "stoneedge", "suckerpunch", "hammerarm", "firepunch", "protect"], tier: "NFE", }, graveleralola: { tier: "NFE", }, golem: { randomBattleMoves: ["stealthrock", "earthquake", "explosion", "suckerpunch", "toxic", "rockblast"], randomDoubleBattleMoves: ["rockslide", "earthquake", "stoneedge", "suckerpunch", "hammerarm", "firepunch", "protect"], tier: "PU", }, golemalola: { randomBattleMoves: ["stealthrock", "stoneedge", "return", "thunderpunch", "earthquake", "toxic"], randomDoubleBattleMoves: ["doubleedge", "stoneedge", "rockslide", "earthquake", "protect"], tier: "PU", }, ponyta: { randomBattleMoves: ["flareblitz", "wildcharge", "morningsun", "hypnosis", "flamecharge"], randomDoubleBattleMoves: ["flareblitz", "wildcharge", "protect", "hypnosis", "flamecharge"], tier: "LC", }, rapidash: { randomBattleMoves: ["flareblitz", "wildcharge", "morningsun", "drillrun", "willowisp"], randomDoubleBattleMoves: ["flareblitz", "wildcharge", "protect", "hypnosis", "flamecharge", "megahorn", "drillrun", "willowisp"], eventPokemon: [ {"generation": 3, "level": 40, "moves":["batonpass", "solarbeam", "sunnyday", "flamethrower"]}, ], tier: "PU", }, slowpoke: { randomBattleMoves: ["scald", "aquatail", "zenheadbutt", "thunderwave", "toxic", "slackoff", "trickroom"], randomDoubleBattleMoves: ["scald", "aquatail", "zenheadbutt", "thunderwave", "slackoff", "trickroom", "protect"], eventPokemon: [ {"generation": 3, "level": 31, "gender": "F", "nature": "Naive", "ivs": {"hp": 17, "atk": 11, "def": 19, "spa": 20, "spd": 5, "spe": 10}, "abilities":["oblivious"], "moves":["watergun", "confusion", "disable", "headbutt"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["curse", "yawn", "tackle", "growl"]}, {"generation": 5, "level": 30, "isHidden": false, "moves":["confusion", "disable", "headbutt", "waterpulse"], "pokeball": "cherishball"}, ], tier: "LC", }, slowbro: { randomBattleMoves: ["scald", "toxic", "thunderwave", "psyshock", "fireblast", "icebeam", "slackoff"], randomDoubleBattleMoves: ["scald", "fireblast", "icebeam", "psychic", "grassknot", "thunderwave", "slackoff", "trickroom", "protect", "psyshock"], eventPokemon: [ {"generation": 6, "level": 100, "nature": "Quiet", "isHidden": false, "abilities":["oblivious"], "moves":["scald", "trickroom", "slackoff", "irontail"], "pokeball": "cherishball"}, ], tier: "NU", }, slowbromega: { randomBattleMoves: ["calmmind", "scald", "psyshock", "slackoff", "fireblast", "psychic", "icebeam"], randomDoubleBattleMoves: ["scald", "fireblast", "icebeam", "psychic", "thunderwave", "slackoff", "trickroom", "protect", "psyshock"], requiredItem: "Slowbronite", tier: "BL", }, slowking: { randomBattleMoves: ["scald", "fireblast", "icebeam", "psychic", "grassknot", "thunderwave", "toxic", "slackoff", "trickroom", "nastyplot", "dragontail", "psyshock"], randomDoubleBattleMoves: ["scald", "fireblast", "icebeam", "psychic", "grassknot", "thunderwave", "slackoff", "trickroom", "protect", "psyshock"], tier: "NU", }, magnemite: { randomBattleMoves: ["thunderbolt", "thunderwave", "magnetrise", "substitute", "flashcannon", "hiddenpowerice", "voltswitch"], randomDoubleBattleMoves: ["thunderbolt", "thunderwave", "magnetrise", "substitute", "flashcannon", "hiddenpowerice", "voltswitch", "protect", "electroweb", "discharge"], tier: "LC", }, magneton: { randomBattleMoves: ["thunderbolt", "substitute", "flashcannon", "hiddenpowerice", "voltswitch", "chargebeam", "hiddenpowerfire"], randomDoubleBattleMoves: ["thunderbolt", "thunderwave", "magnetrise", "substitute", "flashcannon", "hiddenpowerice", "voltswitch", "protect", "electroweb", "discharge", "hiddenpowerfire"], eventPokemon: [ {"generation": 3, "level": 30, "moves":["refresh", "doubleedge", "raindance", "thunder"]}, ], tier: "UU", }, magnezone: { randomBattleMoves: ["thunderbolt", "substitute", "flashcannon", "hiddenpowerice", "voltswitch", "hiddenpowerfire"], randomDoubleBattleMoves: ["thunderbolt", "substitute", "flashcannon", "hiddenpowerice", "voltswitch", "protect", "electroweb", "discharge", "hiddenpowerfire"], tier: "OU", }, farfetchd: { randomBattleMoves: ["bravebird", "swordsdance", "return", "leafblade", "roost", "nightslash"], randomDoubleBattleMoves: ["bravebird", "swordsdance", "return", "leafblade", "protect", "nightslash"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["yawn", "wish"]}, {"generation": 3, "level": 36, "moves":["batonpass", "slash", "swordsdance", "aerialace"]}, ], tier: "PU", }, doduo: { randomBattleMoves: ["bravebird", "return", "doubleedge", "roost", "quickattack", "pursuit"], randomDoubleBattleMoves: ["bravebird", "return", "doubleedge", "quickattack", "protect"], tier: "LC", }, dodrio: { randomBattleMoves: ["bravebird", "return", "swordsdance", "roost", "quickattack", "knockoff", "jumpkick"], randomDoubleBattleMoves: ["bravebird", "return", "doubleedge", "quickattack", "knockoff", "protect"], eventPokemon: [ {"generation": 3, "level": 34, "moves":["batonpass", "drillpeck", "agility", "triattack"]}, ], tier: "NU", }, seel: { randomBattleMoves: ["surf", "icebeam", "aquajet", "protect", "rest", "toxic", "drillrun"], randomDoubleBattleMoves: ["surf", "icebeam", "aquajet", "protect", "rest", "toxic", "fakeout", "drillrun", "icywind"], eventPokemon: [ {"generation": 3, "level": 23, "abilities":["thickfat"], "moves":["helpinghand", "surf", "safeguard", "icebeam"]}, ], tier: "LC", }, dewgong: { randomBattleMoves: ["surf", "icebeam", "perishsong", "encore", "toxic", "protect"], randomDoubleBattleMoves: ["surf", "icebeam", "protect", "perishsong", "fakeout", "encore", "toxic"], tier: "PU", }, grimer: { randomBattleMoves: ["curse", "gunkshot", "poisonjab", "shadowsneak", "painsplit", "icepunch", "firepunch", "memento"], randomDoubleBattleMoves: ["gunkshot", "poisonjab", "shadowsneak", "protect", "icepunch", "firepunch"], eventPokemon: [ {"generation": 3, "level": 23, "moves":["helpinghand", "sludgebomb", "shadowpunch", "minimize"]}, ], tier: "LC", }, grimeralola: { eventPokemon: [ {"generation": 7, "level": 10, "isHidden": false, "abilities":["poisontouch"], "moves":["bite", "harden", "poisongas", "pound"], "pokeball": "cherishball"}, ], tier: "LC", }, muk: { randomBattleMoves: ["curse", "gunkshot", "poisonjab", "shadowsneak", "icepunch", "firepunch", "memento"], randomDoubleBattleMoves: ["gunkshot", "poisonjab", "shadowsneak", "protect", "icepunch", "firepunch", "brickbreak"], tier: "PU", }, mukalola: { randomBattleMoves: ["curse", "gunkshot", "knockoff", "poisonjab", "shadowsneak", "stoneedge", "pursuit"], randomDoubleBattleMoves: ["gunkshot", "knockoff", "stoneedge", "snarl", "protect", "poisonjab", "shadowsneak"], tier: "UU", }, shellder: { randomBattleMoves: ["shellsmash", "hydropump", "razorshell", "rockblast", "iciclespear", "rapidspin"], randomDoubleBattleMoves: ["shellsmash", "hydropump", "razorshell", "rockblast", "iciclespear", "protect"], eventPokemon: [ {"generation": 3, "level": 24, "gender": "F", "nature": "Brave", "ivs": {"hp": 5, "atk": 19, "def": 18, "spa": 5, "spd": 11, "spe": 13}, "abilities":["shellarmor"], "moves":["withdraw", "iciclespear", "supersonic", "aurorabeam"]}, {"generation": 3, "level": 10, "gender": "M", "abilities":["shellarmor"], "moves":["tackle", "withdraw", "iciclespear"]}, {"generation": 3, "level": 29, "abilities":["shellarmor"], "moves":["refresh", "takedown", "surf", "aurorabeam"]}, ], tier: "LC", }, cloyster: { randomBattleMoves: ["shellsmash", "hydropump", "rockblast", "iciclespear", "iceshard", "rapidspin", "spikes", "toxicspikes"], randomDoubleBattleMoves: ["shellsmash", "hydropump", "razorshell", "rockblast", "iciclespear", "protect"], eventPokemon: [ {"generation": 5, "level": 30, "gender": "M", "nature": "Naughty", "isHidden": false, "abilities":["skilllink"], "moves":["iciclespear", "rockblast", "hiddenpower", "razorshell"]}, ], tier: "RU", }, gastly: { randomBattleMoves: ["shadowball", "sludgebomb", "hiddenpowerfighting", "thunderbolt", "substitute", "disable", "painsplit", "hypnosis", "gigadrain", "trick", "dazzlinggleam"], randomDoubleBattleMoves: ["shadowball", "sludgebomb", "hiddenpowerfighting", "thunderbolt", "substitute", "disable", "taunt", "hypnosis", "gigadrain", "trick", "dazzlinggleam", "protect"], tier: "LC", }, haunter: { randomBattleMoves: ["shadowball", "sludgebomb", "dazzlinggleam", "substitute", "destinybond"], randomDoubleBattleMoves: ["shadowball", "sludgebomb", "hiddenpowerfighting", "thunderbolt", "substitute", "disable", "taunt", "hypnosis", "gigadrain", "trick", "dazzlinggleam", "protect"], eventPokemon: [ {"generation": 5, "level": 30, "moves":["confuseray", "suckerpunch", "shadowpunch", "payback"], "pokeball": "cherishball"}, ], tier: "NFE", }, gengar: { randomBattleMoves: ["shadowball", "sludgewave", "focusblast", "substitute", "disable", "painsplit", "willowisp"], randomDoubleBattleMoves: ["shadowball", "sludgebomb", "focusblast", "substitute", "disable", "taunt", "hypnosis", "willowisp", "dazzlinggleam", "protect"], eventPokemon: [ {"generation": 3, "level": 23, "gender": "F", "nature": "Hardy", "ivs": {"hp": 19, "atk": 14, "def": 0, "spa": 14, "spd": 17, "spe": 27}, "moves":["spite", "curse", "nightshade", "confuseray"]}, {"generation": 6, "level": 25, "nature": "Timid", "moves":["psychic", "confuseray", "suckerpunch", "shadowpunch"], "pokeball": "cherishball"}, {"generation": 6, "level": 25, "moves":["nightshade", "confuseray", "suckerpunch", "shadowpunch"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "moves":["shadowball", "sludgebomb", "willowisp", "destinybond"], "pokeball": "cherishball"}, {"generation": 6, "level": 25, "shiny": true, "moves":["shadowball", "sludgewave", "confuseray", "astonish"], "pokeball": "duskball"}, {"generation": 6, "level": 50, "shiny": true, "gender": "M", "moves":["meanlook", "hypnosis", "psychic", "hyperbeam"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["meanlook", "hypnosis", "psychic", "hyperbeam"], "pokeball": "cherishball"}, ], tier: "OU", }, gengarmega: { randomBattleMoves: ["shadowball", "sludgewave", "focusblast", "taunt", "destinybond", "disable", "perishsong", "protect"], randomDoubleBattleMoves: ["shadowball", "sludgebomb", "focusblast", "substitute", "disable", "taunt", "hypnosis", "willowisp", "dazzlinggleam", "protect"], requiredItem: "Gengarite", tier: "Uber", }, onix: { randomBattleMoves: ["stealthrock", "earthquake", "stoneedge", "dragontail", "curse"], randomDoubleBattleMoves: ["stealthrock", "earthquake", "stoneedge", "rockslide", "protect", "explosion"], tier: "LC", }, steelix: { randomBattleMoves: ["stealthrock", "earthquake", "ironhead", "roar", "toxic", "rockslide"], randomDoubleBattleMoves: ["stealthrock", "earthquake", "ironhead", "rockslide", "protect", "explosion"], tier: "NU", }, steelixmega: { randomBattleMoves: ["stealthrock", "earthquake", "heavyslam", "roar", "toxic", "dragontail"], randomDoubleBattleMoves: ["stealthrock", "earthquake", "heavyslam", "rockslide", "protect", "explosion"], requiredItem: "Steelixite", tier: "UU", }, drowzee: { randomBattleMoves: ["psychic", "seismictoss", "thunderwave", "wish", "protect", "toxic", "shadowball", "trickroom", "calmmind", "dazzlinggleam"], randomDoubleBattleMoves: ["psychic", "seismictoss", "thunderwave", "wish", "protect", "hypnosis", "shadowball", "trickroom", "calmmind", "dazzlinggleam", "toxic"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "abilities":["insomnia"], "moves":["bellydrum", "wish"]}, ], tier: "LC", }, hypno: { randomBattleMoves: ["psychic", "seismictoss", "foulplay", "wish", "protect", "thunderwave", "toxic"], randomDoubleBattleMoves: ["psychic", "seismictoss", "thunderwave", "wish", "protect", "hypnosis", "trickroom", "dazzlinggleam", "foulplay"], eventPokemon: [ {"generation": 3, "level": 34, "abilities":["insomnia"], "moves":["batonpass", "psychic", "meditate", "shadowball"]}, ], tier: "PU", }, krabby: { randomBattleMoves: ["crabhammer", "swordsdance", "agility", "rockslide", "substitute", "xscissor", "superpower", "knockoff"], randomDoubleBattleMoves: ["crabhammer", "swordsdance", "rockslide", "substitute", "xscissor", "superpower", "knockoff", "protect"], tier: "LC", }, kingler: { randomBattleMoves: ["crabhammer", "xscissor", "rockslide", "swordsdance", "agility", "superpower", "knockoff"], randomDoubleBattleMoves: ["crabhammer", "xscissor", "rockslide", "substitute", "superpower", "knockoff", "protect", "wideguard"], tier: "PU", }, voltorb: { randomBattleMoves: ["voltswitch", "thunderbolt", "taunt", "foulplay", "hiddenpowerice"], randomDoubleBattleMoves: ["voltswitch", "thunderbolt", "taunt", "foulplay", "hiddenpowerice", "protect", "thunderwave"], eventPokemon: [ {"generation": 3, "level": 19, "moves":["refresh", "mirrorcoat", "spark", "swift"]}, ], tier: "LC", }, electrode: { randomBattleMoves: ["voltswitch", "thunderbolt", "taunt", "foulplay", "hiddenpowergrass", "signalbeam"], randomDoubleBattleMoves: ["voltswitch", "discharge", "taunt", "foulplay", "hiddenpowerice", "protect", "thunderwave"], tier: "PU", }, exeggcute: { randomBattleMoves: ["substitute", "leechseed", "gigadrain", "psychic", "sleeppowder", "stunspore", "hiddenpowerfire", "synthesis"], randomDoubleBattleMoves: ["substitute", "leechseed", "gigadrain", "psychic", "sleeppowder", "stunspore", "hiddenpowerfire", "protect", "trickroom"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["sweetscent", "wish"]}, ], tier: "LC", }, exeggutor: { randomBattleMoves: ["substitute", "leechseed", "gigadrain", "psychic", "sleeppowder", "hiddenpowerfire"], randomDoubleBattleMoves: ["substitute", "leechseed", "gigadrain", "psychic", "sleeppowder", "hiddenpowerfire", "protect", "trickroom", "psyshock"], eventPokemon: [ {"generation": 3, "level": 46, "moves":["refresh", "psychic", "hypnosis", "ancientpower"]}, ], tier: "PU", }, exeggutoralola: { randomBattleMoves: ["dracometeor", "leafstorm", "flamethrower", "earthquake", "woodhammer", "gigadrain", "dragonhammer"], randomDoubleBattleMoves: ["dracometeor", "leafstorm", "protect", "flamethrower", "trickroom", "woodhammer", "dragonhammer"], eventPokemon: [ {"generation": 7, "level": 50, "gender": "M", "nature": "Modest", "isHidden": true, "moves":["powerswap", "celebrate", "leafstorm", "dracometeor"], "pokeball": "cherishball"}, ], tier: "PU", }, cubone: { randomBattleMoves: ["substitute", "bonemerang", "doubleedge", "rockslide", "firepunch", "earthquake"], randomDoubleBattleMoves: ["substitute", "bonemerang", "doubleedge", "rockslide", "firepunch", "earthquake", "protect"], tier: "LC", }, marowak: { randomBattleMoves: ["bonemerang", "earthquake", "knockoff", "doubleedge", "stoneedge", "stealthrock", "substitute"], randomDoubleBattleMoves: ["substitute", "bonemerang", "doubleedge", "rockslide", "firepunch", "earthquake", "protect", "swordsdance"], eventPokemon: [ {"generation": 3, "level": 44, "moves":["sing", "earthquake", "swordsdance", "rockslide"]}, ], tier: "PU", }, marowakalola: { randomBattleMoves: ["flamecharge", "shadowbone", "bonemerang", "willowisp", "stoneedge", "flareblitz", "substitute"], randomDoubleBattleMoves: ["shadowbone", "bonemerang", "willowisp", "stoneedge", "flareblitz", "protect"], tier: "OU", }, tyrogue: { randomBattleMoves: ["highjumpkick", "rapidspin", "fakeout", "bulletpunch", "machpunch", "toxic", "counter"], randomDoubleBattleMoves: ["highjumpkick", "fakeout", "bulletpunch", "machpunch", "helpinghand", "protect"], tier: "LC", }, hitmonlee: { randomBattleMoves: ["highjumpkick", "knockoff", "stoneedge", "rapidspin", "machpunch", "poisonjab", "fakeout"], randomDoubleBattleMoves: ["knockoff", "rockslide", "machpunch", "fakeout", "highjumpkick", "earthquake", "blazekick", "wideguard", "protect"], eventPokemon: [ {"generation": 3, "level": 38, "abilities":["limber"], "moves":["refresh", "highjumpkick", "mindreader", "megakick"]}, ], tier: "NU", }, hitmonchan: { randomBattleMoves: ["bulkup", "drainpunch", "icepunch", "firepunch", "machpunch", "rapidspin"], randomDoubleBattleMoves: ["fakeout", "drainpunch", "icepunch", "firepunch", "machpunch", "earthquake", "rockslide", "protect", "thunderpunch"], eventPokemon: [ {"generation": 3, "level": 38, "abilities":["keeneye"], "moves":["helpinghand", "skyuppercut", "mindreader", "megapunch"]}, ], tier: "PU", }, hitmontop: { randomBattleMoves: ["suckerpunch", "machpunch", "rapidspin", "closecombat", "toxic"], randomDoubleBattleMoves: ["fakeout", "feint", "suckerpunch", "closecombat", "helpinghand", "machpunch", "wideguard"], eventPokemon: [ {"generation": 5, "level": 55, "gender": "M", "nature": "Adamant", "isHidden": false, "abilities":["intimidate"], "moves":["fakeout", "closecombat", "suckerpunch", "helpinghand"]}, ], tier: "NU", }, lickitung: { randomBattleMoves: ["wish", "protect", "dragontail", "curse", "bodyslam", "return", "powerwhip", "swordsdance", "earthquake", "toxic", "healbell"], randomDoubleBattleMoves: ["wish", "protect", "dragontail", "knockoff", "bodyslam", "return", "powerwhip", "swordsdance", "earthquake"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["healbell", "wish"]}, {"generation": 3, "level": 38, "moves":["helpinghand", "doubleedge", "defensecurl", "rollout"]}, ], tier: "LC", }, lickilicky: { randomBattleMoves: ["wish", "protect", "bodyslam", "knockoff", "dragontail", "healbell", "swordsdance", "explosion", "earthquake", "powerwhip"], randomDoubleBattleMoves: ["wish", "protect", "dragontail", "knockoff", "bodyslam", "rockslide", "powerwhip", "earthquake", "explosion"], tier: "PU", }, koffing: { randomBattleMoves: ["painsplit", "sludgebomb", "willowisp", "fireblast", "toxic", "clearsmog", "rest", "sleeptalk", "thunderbolt"], randomDoubleBattleMoves: ["protect", "sludgebomb", "willowisp", "fireblast", "toxic", "rest", "sleeptalk", "thunderbolt"], tier: "LC", }, weezing: { randomBattleMoves: ["painsplit", "sludgebomb", "willowisp", "fireblast", "protect", "toxicspikes"], randomDoubleBattleMoves: ["protect", "sludgebomb", "willowisp", "fireblast", "toxic", "painsplit", "thunderbolt", "explosion"], tier: "PU", }, rhyhorn: { randomBattleMoves: ["stoneedge", "earthquake", "aquatail", "megahorn", "stealthrock", "rockblast", "rockpolish"], randomDoubleBattleMoves: ["stoneedge", "earthquake", "aquatail", "megahorn", "stealthrock", "rockslide", "protect"], tier: "LC", }, rhydon: { randomBattleMoves: ["stealthrock", "earthquake", "rockblast", "roar", "swordsdance", "stoneedge", "megahorn", "rockpolish"], randomDoubleBattleMoves: ["stoneedge", "earthquake", "aquatail", "megahorn", "stealthrock", "rockslide", "protect"], eventPokemon: [ {"generation": 3, "level": 46, "moves":["helpinghand", "megahorn", "scaryface", "earthquake"]}, ], tier: "NU", }, rhyperior: { randomBattleMoves: ["stoneedge", "earthquake", "aquatail", "megahorn", "stealthrock", "rockblast", "rockpolish", "dragontail"], randomDoubleBattleMoves: ["stoneedge", "earthquake", "hammerarm", "megahorn", "stealthrock", "rockslide", "aquatail", "protect"], tier: "RU", }, happiny: { randomBattleMoves: ["aromatherapy", "toxic", "thunderwave", "counter", "endeavor", "lightscreen", "fireblast"], randomDoubleBattleMoves: ["aromatherapy", "toxic", "thunderwave", "helpinghand", "swagger", "lightscreen", "fireblast", "protect"], tier: "LC", }, chansey: { randomBattleMoves: ["softboiled", "healbell", "stealthrock", "thunderwave", "toxic", "seismictoss", "wish", "protect", "counter"], randomDoubleBattleMoves: ["aromatherapy", "toxic", "thunderwave", "helpinghand", "softboiled", "lightscreen", "seismictoss", "protect", "wish"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["sweetscent", "wish"]}, {"generation": 3, "level": 10, "moves":["pound", "growl", "tailwhip", "refresh"]}, {"generation": 3, "level": 39, "moves":["sweetkiss", "thunderbolt", "softboiled", "skillswap"]}, ], tier: "OU", }, blissey: { randomBattleMoves: ["toxic", "flamethrower", "seismictoss", "softboiled", "wish", "healbell", "protect", "thunderwave", "stealthrock"], randomDoubleBattleMoves: ["wish", "softboiled", "protect", "toxic", "aromatherapy", "seismictoss", "helpinghand", "thunderwave", "flamethrower", "icebeam"], eventPokemon: [ {"generation": 5, "level": 10, "isHidden": true, "moves":["pound", "growl", "tailwhip", "refresh"]}, ], tier: "UU", }, tangela: { randomBattleMoves: ["gigadrain", "sleeppowder", "hiddenpowerfire", "hiddenpowerice", "leechseed", "knockoff", "leafstorm", "sludgebomb", "synthesis"], randomDoubleBattleMoves: ["gigadrain", "sleeppowder", "hiddenpowerrock", "hiddenpowerice", "leechseed", "knockoff", "leafstorm", "stunspore", "protect", "hiddenpowerfire"], eventPokemon: [ {"generation": 3, "level": 30, "abilities":["chlorophyll"], "moves":["morningsun", "solarbeam", "sunnyday", "ingrain"]}, ], tier: "LC Uber", }, tangrowth: { randomBattleMoves: ["gigadrain", "leafstorm", "knockoff", "earthquake", "hiddenpowerfire", "rockslide", "sleeppowder", "leechseed", "synthesis"], randomDoubleBattleMoves: ["gigadrain", "sleeppowder", "hiddenpowerice", "leechseed", "knockoff", "ragepowder", "focusblast", "protect", "powerwhip", "earthquake"], eventPokemon: [ {"generation": 4, "level": 50, "gender": "M", "nature": "Brave", "moves":["sunnyday", "morningsun", "ancientpower", "naturalgift"], "pokeball": "cherishball"}, ], tier: "OU", }, kangaskhan: { randomBattleMoves: ["return", "suckerpunch", "earthquake", "drainpunch", "crunch", "fakeout"], randomDoubleBattleMoves: ["fakeout", "return", "suckerpunch", "earthquake", "doubleedge", "drainpunch", "crunch", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "abilities":["earlybird"], "moves":["yawn", "wish"]}, {"generation": 3, "level": 10, "abilities":["earlybird"], "moves":["cometpunch", "leer", "bite"]}, {"generation": 3, "level": 35, "abilities":["earlybird"], "moves":["sing", "earthquake", "tailwhip", "dizzypunch"]}, {"generation": 6, "level": 50, "isHidden": false, "abilities":["scrappy"], "moves":["fakeout", "return", "earthquake", "suckerpunch"], "pokeball": "cherishball"}, ], tier: "PU", }, kangaskhanmega: { randomBattleMoves: ["fakeout", "return", "suckerpunch", "earthquake", "poweruppunch", "crunch"], randomDoubleBattleMoves: ["fakeout", "return", "suckerpunch", "earthquake", "doubleedge", "poweruppunch", "drainpunch", "crunch", "protect"], requiredItem: "Kangaskhanite", tier: "Uber", }, horsea: { randomBattleMoves: ["hydropump", "icebeam", "substitute", "hiddenpowergrass", "raindance"], randomDoubleBattleMoves: ["hydropump", "icebeam", "substitute", "hiddenpowergrass", "raindance", "muddywater", "protect"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": true, "isHidden": false, "moves":["bubble"]}, ], tier: "LC", }, seadra: { randomBattleMoves: ["hydropump", "icebeam", "agility", "substitute", "hiddenpowergrass"], randomDoubleBattleMoves: ["hydropump", "icebeam", "substitute", "hiddenpowergrass", "agility", "muddywater", "protect"], eventPokemon: [ {"generation": 3, "level": 45, "abilities":["poisonpoint"], "moves":["leer", "watergun", "twister", "agility"]}, ], tier: "NFE", }, kingdra: { randomBattleMoves: ["dragondance", "waterfall", "outrage", "ironhead", "substitute", "raindance", "hydropump", "dracometeor"], randomDoubleBattleMoves: ["hydropump", "icebeam", "raindance", "dracometeor", "dragonpulse", "muddywater", "protect"], eventPokemon: [ {"generation": 3, "level": 50, "abilities":["swiftswim"], "moves":["leer", "watergun", "twister", "agility"]}, {"generation": 5, "level": 50, "gender": "M", "nature": "Timid", "ivs": {"hp": 31, "atk": 17, "def": 8, "spa": 31, "spd": 11, "spe": 31}, "isHidden": false, "abilities":["swiftswim"], "moves":["dracometeor", "muddywater", "dragonpulse", "protect"], "pokeball": "cherishball"}, ], tier: "OU", }, goldeen: { randomBattleMoves: ["waterfall", "megahorn", "knockoff", "drillrun", "icebeam"], randomDoubleBattleMoves: ["waterfall", "megahorn", "knockoff", "drillrun", "icebeam", "protect"], tier: "LC", }, seaking: { randomBattleMoves: ["waterfall", "megahorn", "knockoff", "drillrun", "scald", "icebeam"], randomDoubleBattleMoves: ["waterfall", "surf", "megahorn", "knockoff", "drillrun", "icebeam", "icywind", "protect"], tier: "PU", }, staryu: { randomBattleMoves: ["scald", "thunderbolt", "icebeam", "rapidspin", "recover", "dazzlinggleam", "hydropump"], randomDoubleBattleMoves: ["scald", "thunderbolt", "icebeam", "protect", "recover", "dazzlinggleam", "hydropump"], eventPokemon: [ {"generation": 3, "level": 50, "moves":["minimize", "lightscreen", "cosmicpower", "hydropump"]}, {"generation": 3, "level": 18, "nature": "Timid", "ivs": {"hp": 10, "atk": 3, "def": 22, "spa": 24, "spd": 3, "spe": 18}, "abilities":["illuminate"], "moves":["harden", "watergun", "rapidspin", "recover"]}, ], tier: "LC", }, starmie: { randomBattleMoves: ["thunderbolt", "icebeam", "rapidspin", "recover", "psyshock", "scald", "hydropump"], randomDoubleBattleMoves: ["surf", "thunderbolt", "icebeam", "protect", "recover", "psychic", "psyshock", "scald", "hydropump"], eventPokemon: [ {"generation": 3, "level": 41, "moves":["refresh", "waterfall", "icebeam", "recover"]}, ], tier: "UU", }, mimejr: { randomBattleMoves: ["batonpass", "psychic", "thunderwave", "hiddenpowerfighting", "healingwish", "nastyplot", "thunderbolt", "encore"], randomDoubleBattleMoves: ["fakeout", "psychic", "thunderwave", "hiddenpowerfighting", "healingwish", "nastyplot", "thunderbolt", "encore", "icywind", "protect"], tier: "LC", }, mrmime: { randomBattleMoves: ["nastyplot", "psychic", "psyshock", "dazzlinggleam", "shadowball", "batonpass", "focusblast", "healingwish", "encore"], randomDoubleBattleMoves: ["fakeout", "thunderwave", "hiddenpowerfighting", "psychic", "thunderbolt", "encore", "icywind", "protect", "wideguard", "dazzlinggleam", "followme"], eventPokemon: [ {"generation": 3, "level": 42, "abilities":["soundproof"], "moves":["followme", "psychic", "encore", "thunderpunch"]}, ], tier: "PU", }, scyther: { randomBattleMoves: ["swordsdance", "roost", "bugbite", "quickattack", "brickbreak", "aerialace", "batonpass", "uturn", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "protect", "bugbite", "quickattack", "brickbreak", "aerialace", "feint", "uturn", "knockoff"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["swarm"], "moves":["quickattack", "leer", "focusenergy"]}, {"generation": 3, "level": 40, "abilities":["swarm"], "moves":["morningsun", "razorwind", "silverwind", "slash"]}, {"generation": 5, "level": 30, "isHidden": false, "moves":["agility", "wingattack", "furycutter", "slash"], "pokeball": "cherishball"}, ], tier: "NU", }, scizor: { randomBattleMoves: ["swordsdance", "bulletpunch", "bugbite", "superpower", "uturn", "pursuit", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "roost", "bulletpunch", "bugbite", "superpower", "uturn", "protect", "feint", "knockoff"], eventPokemon: [ {"generation": 3, "level": 50, "gender": "M", "abilities":["swarm"], "moves":["furycutter", "metalclaw", "swordsdance", "slash"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Adamant", "abilities":["swarm"], "moves":["xscissor", "swordsdance", "irondefense", "agility"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "abilities":["technician"], "moves":["bulletpunch", "bugbite", "roost", "swordsdance"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["leer", "focusenergy", "pursuit", "steelwing"]}, {"generation": 6, "level": 50, "gender": "M", "isHidden": false, "moves":["xscissor", "nightslash", "doublehit", "ironhead"], "pokeball": "cherishball"}, {"generation": 6, "level": 25, "nature": "Adamant", "isHidden": false, "abilities":["technician"], "moves":["aerialace", "falseswipe", "agility", "furycutter"], "pokeball": "cherishball"}, {"generation": 6, "level": 25, "isHidden": false, "moves":["metalclaw", "falseswipe", "agility", "furycutter"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "isHidden": false, "abilities":["technician"], "moves":["bulletpunch", "swordsdance", "roost", "uturn"], "pokeball": "cherishball"}, ], tier: "UU", }, scizormega: { randomBattleMoves: ["swordsdance", "roost", "bulletpunch", "bugbite", "superpower", "uturn", "defog", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "roost", "bulletpunch", "bugbite", "superpower", "uturn", "protect", "feint", "knockoff"], requiredItem: "Scizorite", tier: "OU", }, smoochum: { randomBattleMoves: ["icebeam", "psychic", "hiddenpowerfighting", "trick", "shadowball", "grassknot"], randomDoubleBattleMoves: ["icebeam", "psychic", "hiddenpowerfighting", "trick", "shadowball", "grassknot", "fakeout", "protect"], tier: "LC", }, jynx: { randomBattleMoves: ["icebeam", "psychic", "focusblast", "trick", "nastyplot", "lovelykiss", "substitute", "psyshock"], randomDoubleBattleMoves: ["icebeam", "psychic", "hiddenpowerfighting", "shadowball", "protect", "lovelykiss", "substitute", "psyshock"], tier: "PU", }, elekid: { randomBattleMoves: ["thunderbolt", "crosschop", "voltswitch", "substitute", "icepunch", "psychic", "hiddenpowergrass"], randomDoubleBattleMoves: ["thunderbolt", "crosschop", "voltswitch", "substitute", "icepunch", "psychic", "hiddenpowergrass", "protect"], eventPokemon: [ {"generation": 3, "level": 20, "moves":["icepunch", "firepunch", "thunderpunch", "crosschop"]}, ], tier: "LC", }, electabuzz: { randomBattleMoves: ["thunderbolt", "voltswitch", "substitute", "hiddenpowerice", "hiddenpowergrass", "focusblast", "psychic"], randomDoubleBattleMoves: ["thunderbolt", "crosschop", "voltswitch", "substitute", "icepunch", "psychic", "hiddenpowergrass", "protect", "focusblast", "discharge"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["quickattack", "leer", "thunderpunch"]}, {"generation": 3, "level": 43, "moves":["followme", "crosschop", "thunderwave", "thunderbolt"]}, {"generation": 4, "level": 30, "gender": "M", "nature": "Naughty", "moves":["lowkick", "shockwave", "lightscreen", "thunderpunch"]}, {"generation": 5, "level": 30, "isHidden": false, "moves":["lowkick", "swift", "shockwave", "lightscreen"], "pokeball": "cherishball"}, {"generation": 6, "level": 30, "gender": "M", "isHidden": true, "moves":["lowkick", "shockwave", "lightscreen", "thunderpunch"], "pokeball": "cherishball"}, ], tier: "NFE", }, electivire: { randomBattleMoves: ["wildcharge", "crosschop", "icepunch", "flamethrower", "earthquake", "voltswitch"], randomDoubleBattleMoves: ["wildcharge", "crosschop", "icepunch", "substitute", "flamethrower", "earthquake", "protect", "followme"], eventPokemon: [ {"generation": 4, "level": 50, "gender": "M", "nature": "Adamant", "moves":["thunderpunch", "icepunch", "crosschop", "earthquake"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Serious", "moves":["lightscreen", "thunderpunch", "discharge", "thunderbolt"], "pokeball": "cherishball"}, ], tier: "PU", }, magby: { randomBattleMoves: ["flareblitz", "substitute", "fireblast", "hiddenpowergrass", "hiddenpowerice", "crosschop", "thunderpunch", "overheat"], tier: "LC", }, magmar: { randomBattleMoves: ["flareblitz", "substitute", "fireblast", "hiddenpowergrass", "hiddenpowerice", "crosschop", "thunderpunch", "focusblast"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["leer", "smog", "firepunch", "leer"]}, {"generation": 3, "level": 36, "moves":["followme", "fireblast", "crosschop", "thunderpunch"]}, {"generation": 4, "level": 30, "gender": "M", "nature": "Quiet", "moves":["smokescreen", "firespin", "confuseray", "firepunch"]}, {"generation": 5, "level": 30, "isHidden": false, "moves":["smokescreen", "feintattack", "firespin", "confuseray"], "pokeball": "cherishball"}, {"generation": 6, "level": 30, "gender": "M", "isHidden": true, "moves":["smokescreen", "firespin", "confuseray", "firepunch"], "pokeball": "cherishball"}, ], tier: "NFE", }, magmortar: { randomBattleMoves: ["fireblast", "focusblast", "hiddenpowergrass", "hiddenpowerice", "thunderbolt", "earthquake", "substitute"], randomDoubleBattleMoves: ["fireblast", "taunt", "focusblast", "hiddenpowergrass", "hiddenpowerice", "thunderbolt", "heatwave", "willowisp", "protect", "followme"], eventPokemon: [ {"generation": 4, "level": 50, "gender": "F", "nature": "Modest", "moves":["flamethrower", "psychic", "hyperbeam", "solarbeam"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Hardy", "moves":["confuseray", "firepunch", "lavaplume", "flamethrower"], "pokeball": "cherishball"}, ], tier: "PU", }, pinsir: { randomBattleMoves: ["earthquake", "xscissor", "closecombat", "stoneedge", "stealthrock", "knockoff"], randomDoubleBattleMoves: ["protect", "swordsdance", "xscissor", "earthquake", "closecombat", "substitute", "rockslide"], eventPokemon: [ {"generation": 3, "level": 35, "abilities":["hypercutter"], "moves":["helpinghand", "guillotine", "falseswipe", "submission"]}, {"generation": 6, "level": 50, "gender": "F", "nature": "Adamant", "isHidden": false, "moves":["xscissor", "earthquake", "stoneedge", "return"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "nature": "Jolly", "isHidden": true, "moves":["earthquake", "swordsdance", "feint", "quickattack"], "pokeball": "cherishball"}, ], tier: "PU", }, pinsirmega: { randomBattleMoves: ["swordsdance", "earthquake", "closecombat", "quickattack", "return"], randomDoubleBattleMoves: ["feint", "protect", "swordsdance", "xscissor", "earthquake", "closecombat", "substitute", "quickattack", "return", "rockslide"], requiredItem: "Pinsirite", tier: "OU", }, tauros: { randomBattleMoves: ["rockclimb", "earthquake", "zenheadbutt", "rockslide", "doubleedge"], randomDoubleBattleMoves: ["return", "earthquake", "zenheadbutt", "rockslide", "stoneedge", "protect", "doubleedge"], eventPokemon: [ {"generation": 3, "level": 25, "nature": "Docile", "ivs": {"hp": 14, "atk": 19, "def": 12, "spa": 17, "spd": 5, "spe": 26}, "abilities":["intimidate"], "moves":["rage", "hornattack", "scaryface", "pursuit"], "pokeball": "safariball"}, {"generation": 3, "level": 10, "abilities":["intimidate"], "moves":["tackle", "tailwhip", "rage", "hornattack"]}, {"generation": 3, "level": 46, "abilities":["intimidate"], "moves":["refresh", "earthquake", "tailwhip", "bodyslam"]}, ], tier: "BL4", }, magikarp: { randomBattleMoves: ["bounce", "flail", "tackle", "hydropump"], eventPokemon: [ {"generation": 4, "level": 5, "gender": "M", "nature": "Relaxed", "moves":["splash"]}, {"generation": 4, "level": 6, "gender": "F", "nature": "Rash", "moves":["splash"]}, {"generation": 4, "level": 7, "gender": "F", "nature": "Hardy", "moves":["splash"]}, {"generation": 4, "level": 5, "gender": "F", "nature": "Lonely", "moves":["splash"]}, {"generation": 4, "level": 4, "gender": "M", "nature": "Modest", "moves":["splash"]}, {"generation": 5, "level": 99, "shiny": true, "gender": "M", "isHidden": false, "moves":["flail", "hydropump", "bounce", "splash"], "pokeball": "cherishball"}, {"generation": 6, "level": 1, "shiny": 1, "isHidden": false, "moves":["splash", "celebrate", "happyhour"], "pokeball": "cherishball"}, {"generation": 7, "level": 19, "shiny": true, "isHidden": false, "moves":["splash", "bounce"], "pokeball": "cherishball"}, ], tier: "LC", }, gyarados: { randomBattleMoves: ["dragondance", "waterfall", "earthquake", "bounce", "rest", "sleeptalk", "dragontail", "stoneedge", "substitute"], randomDoubleBattleMoves: ["dragondance", "waterfall", "earthquake", "bounce", "taunt", "protect", "thunderwave", "stoneedge", "substitute", "icefang"], eventPokemon: [ {"generation": 6, "level": 50, "isHidden": false, "moves":["waterfall", "earthquake", "icefang", "dragondance"], "pokeball": "cherishball"}, {"generation": 6, "level": 20, "shiny": true, "isHidden": false, "moves":["waterfall", "bite", "icefang", "ironhead"], "pokeball": "cherishball"}, ], tier: "BL", }, gyaradosmega: { randomBattleMoves: ["dragondance", "waterfall", "earthquake", "substitute", "icefang", "crunch"], randomDoubleBattleMoves: ["dragondance", "waterfall", "earthquake", "bounce", "taunt", "protect", "thunderwave", "stoneedge", "substitute", "icefang", "crunch"], requiredItem: "Gyaradosite", tier: "OU", }, lapras: { randomBattleMoves: ["icebeam", "thunderbolt", "healbell", "toxic", "hydropump", "substitute"], randomDoubleBattleMoves: ["icebeam", "thunderbolt", "hydropump", "surf", "substitute", "protect", "iceshard", "icywind"], eventPokemon: [ {"generation": 3, "level": 44, "moves":["hydropump", "raindance", "blizzard", "healbell"]}, ], tier: "PU", }, ditto: { randomBattleMoves: ["transform"], eventPokemon: [ {"generation": 7, "level": 10, "isHidden": false, "moves":["transform"], "pokeball": "cherishball"}, ], tier: "PU", }, eevee: { randomBattleMoves: ["quickattack", "return", "bite", "batonpass", "irontail", "yawn", "protect", "wish"], randomDoubleBattleMoves: ["quickattack", "return", "bite", "helpinghand", "irontail", "yawn", "protect", "wish"], eventPokemon: [ {"generation": 4, "level": 10, "gender": "F", "nature": "Lonely", "abilities":["adaptability"], "moves":["covet", "bite", "helpinghand", "attract"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "shiny": true, "gender": "M", "nature": "Hardy", "abilities":["adaptability"], "moves":["irontail", "trumpcard", "flail", "quickattack"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "gender": "F", "nature": "Hardy", "isHidden": false, "abilities":["adaptability"], "moves":["sing", "return", "echoedvoice", "attract"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "sandattack", "babydolleyes", "swift"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "shiny": true, "isHidden": true, "moves":["swift", "quickattack", "babydolleyes", "helpinghand"], "pokeball": "cherishball"}, {"generation": 7, "level": 10, "nature": "Jolly", "isHidden": false, "moves":["celebrate", "sandattack", "babydolleyes"], "pokeball": "cherishball"}, ], tier: "LC", }, vaporeon: { randomBattleMoves: ["wish", "protect", "scald", "roar", "icebeam", "healbell", "batonpass"], randomDoubleBattleMoves: ["helpinghand", "wish", "protect", "scald", "muddywater", "icebeam", "toxic", "hydropump"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "watergun"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": true, "moves":["scald", "icebeam", "raindance", "rest"], "pokeball": "cherishball"}, ], tier: "NU", }, jolteon: { randomBattleMoves: ["thunderbolt", "voltswitch", "hiddenpowerice", "batonpass", "substitute", "signalbeam"], randomDoubleBattleMoves: ["thunderbolt", "voltswitch", "hiddenpowergrass", "hiddenpowerice", "helpinghand", "protect", "substitute", "signalbeam"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "thundershock"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": false, "moves":["thunderbolt", "shadowball", "lightscreen", "voltswitch"], "pokeball": "cherishball"}, ], tier: "RU", }, flareon: { randomBattleMoves: ["flamecharge", "facade", "flareblitz", "superpower", "quickattack", "batonpass"], randomDoubleBattleMoves: ["flamecharge", "facade", "flareblitz", "superpower", "wish", "protect", "helpinghand"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "ember"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": true, "moves":["flareblitz", "facade", "willowisp", "quickattack"], "pokeball": "cherishball"}, ], tier: "PU", }, espeon: { randomBattleMoves: ["psychic", "psyshock", "substitute", "shadowball", "calmmind", "morningsun", "batonpass", "dazzlinggleam"], randomDoubleBattleMoves: ["psychic", "psyshock", "substitute", "wish", "shadowball", "hiddenpowerfighting", "helpinghand", "protect", "dazzlinggleam"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["psybeam", "psychup", "psychic", "morningsun"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "confusion"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": true, "moves":["psychic", "dazzlinggleam", "shadowball", "reflect"], "pokeball": "cherishball"}, ], tier: "RU", }, umbreon: { randomBattleMoves: ["wish", "protect", "healbell", "toxic", "foulplay"], randomDoubleBattleMoves: ["moonlight", "wish", "protect", "healbell", "snarl", "foulplay", "helpinghand"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["feintattack", "meanlook", "screech", "moonlight"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "pursuit"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": false, "moves":["snarl", "toxic", "protect", "moonlight"], "pokeball": "cherishball"}, ], tier: "RU", }, leafeon: { randomBattleMoves: ["swordsdance", "leafblade", "substitute", "xscissor", "synthesis", "batonpass", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "leafblade", "substitute", "xscissor", "protect", "helpinghand", "knockoff"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "razorleaf"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": true, "moves":["leafblade", "swordsdance", "sunnyday", "synthesis"], "pokeball": "cherishball"}, ], tier: "PU", }, glaceon: { randomBattleMoves: ["icebeam", "hiddenpowerground", "shadowball", "healbell", "wish", "protect", "toxic"], randomDoubleBattleMoves: ["icebeam", "hiddenpowerground", "shadowball", "wish", "protect", "healbell", "helpinghand"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tailwhip", "tackle", "helpinghand", "sandattack"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "tailwhip", "sandattack", "icywind"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": false, "moves":["blizzard", "shadowball", "hail", "auroraveil"], "pokeball": "cherishball"}, ], tier: "PU", }, porygon: { randomBattleMoves: ["triattack", "icebeam", "recover", "toxic", "thunderwave", "discharge", "trick"], eventPokemon: [ {"generation": 5, "level": 10, "isHidden": true, "moves":["tackle", "conversion", "sharpen", "psybeam"]}, ], tier: "LC Uber", }, porygon2: { randomBattleMoves: ["triattack", "icebeam", "recover", "toxic", "thunderwave", "thunderbolt"], randomDoubleBattleMoves: ["triattack", "icebeam", "discharge", "shadowball", "thunderbolt", "protect", "recover"], tier: "RU", }, porygonz: { randomBattleMoves: ["triattack", "shadowball", "icebeam", "thunderbolt", "conversion", "trick", "nastyplot"], randomDoubleBattleMoves: ["protect", "triattack", "darkpulse", "hiddenpowerfighting", "icebeam", "thunderbolt", "agility", "trick", "nastyplot"], tier: "BL", }, omanyte: { randomBattleMoves: ["shellsmash", "surf", "icebeam", "earthpower", "hiddenpowerelectric", "spikes", "toxicspikes", "stealthrock", "hydropump"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "abilities":["swiftswim"], "moves":["bubblebeam", "supersonic", "withdraw", "bite"], "pokeball": "cherishball"}, ], tier: "LC", }, omastar: { randomBattleMoves: ["shellsmash", "scald", "icebeam", "earthpower", "spikes", "stealthrock", "hydropump"], randomDoubleBattleMoves: ["shellsmash", "muddywater", "icebeam", "earthpower", "hiddenpowerelectric", "protect", "hydropump"], tier: "NU", }, kabuto: { randomBattleMoves: ["aquajet", "rockslide", "rapidspin", "stealthrock", "honeclaws", "waterfall", "toxic"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "abilities":["battlearmor"], "moves":["confuseray", "dig", "scratch", "harden"], "pokeball": "cherishball"}, ], tier: "LC", }, kabutops: { randomBattleMoves: ["aquajet", "stoneedge", "rapidspin", "swordsdance", "waterfall", "knockoff"], randomDoubleBattleMoves: ["aquajet", "stoneedge", "protect", "rockslide", "swordsdance", "waterfall", "superpower", "knockoff"], tier: "PU", }, aerodactyl: { randomBattleMoves: ["stealthrock", "taunt", "stoneedge", "earthquake", "defog", "roost", "doubleedge"], randomDoubleBattleMoves: ["wideguard", "taunt", "stoneedge", "rockslide", "earthquake", "aquatail", "protect", "icefang", "skydrop", "tailwind"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "abilities":["pressure"], "moves":["steelwing", "icefang", "firefang", "thunderfang"], "pokeball": "cherishball"}, ], tier: "RU", }, aerodactylmega: { randomBattleMoves: ["aquatail", "pursuit", "honeclaws", "stoneedge", "firefang", "aerialace", "roost"], randomDoubleBattleMoves: ["wideguard", "taunt", "stoneedge", "rockslide", "earthquake", "ironhead", "aerialace", "protect", "icefang", "skydrop", "tailwind"], requiredItem: "Aerodactylite", tier: "UU", }, munchlax: { randomBattleMoves: ["rest", "curse", "sleeptalk", "bodyslam", "earthquake", "return", "firepunch", "icepunch", "whirlwind", "toxic"], eventPokemon: [ {"generation": 4, "level": 5, "moves":["metronome", "tackle", "defensecurl", "selfdestruct"]}, {"generation": 4, "level": 5, "gender": "F", "nature": "Relaxed", "abilities":["thickfat"], "moves":["metronome", "odorsleuth", "tackle", "curse"], "pokeball": "cherishball"}, {"generation": 7, "level": 5, "isHidden": false, "abilities":["thickfat"], "moves":["tackle", "metronome", "holdback", "happyhour"], "pokeball": "cherishball"}, ], tier: "LC", }, snorlax: { randomBattleMoves: ["rest", "curse", "sleeptalk", "bodyslam", "earthquake", "return", "firepunch", "crunch", "pursuit", "whirlwind"], randomDoubleBattleMoves: ["curse", "protect", "bodyslam", "earthquake", "return", "firepunch", "icepunch", "crunch", "selfdestruct"], eventPokemon: [ {"generation": 3, "level": 43, "moves":["refresh", "fissure", "curse", "bodyslam"]}, ], tier: "RU", }, articuno: { randomBattleMoves: ["icebeam", "roost", "freezedry", "toxic", "substitute", "hurricane"], randomDoubleBattleMoves: ["freezedry", "roost", "protect", "substitute", "hurricane", "tailwind"], eventPokemon: [ {"generation": 3, "level": 50, "shiny": 1, "moves":["mist", "agility", "mindreader", "icebeam"]}, {"generation": 3, "level": 70, "moves":["agility", "mindreader", "icebeam", "reflect"]}, {"generation": 3, "level": 50, "moves":["icebeam", "healbell", "extrasensory", "haze"]}, {"generation": 4, "level": 60, "shiny": 1, "moves":["agility", "icebeam", "reflect", "roost"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["mist", "agility", "mindreader", "icebeam"]}, {"generation": 6, "level": 70, "isHidden": false, "moves":["icebeam", "reflect", "hail", "tailwind"]}, {"generation": 6, "level": 70, "isHidden": true, "moves":["freezedry", "icebeam", "hail", "reflect"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "PU", }, zapdos: { randomBattleMoves: ["thunderbolt", "heatwave", "hiddenpowerice", "roost", "toxic", "uturn", "defog"], randomDoubleBattleMoves: ["thunderbolt", "heatwave", "hiddenpowergrass", "hiddenpowerice", "tailwind", "protect", "discharge"], eventPokemon: [ {"generation": 3, "level": 50, "shiny": 1, "moves":["thunderwave", "agility", "detect", "drillpeck"]}, {"generation": 3, "level": 70, "moves":["agility", "detect", "drillpeck", "charge"]}, {"generation": 3, "level": 50, "moves":["thunderbolt", "extrasensory", "batonpass", "metalsound"]}, {"generation": 4, "level": 60, "shiny": 1, "moves":["charge", "agility", "discharge", "roost"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["thunderwave", "agility", "detect", "drillpeck"]}, {"generation": 6, "level": 70, "isHidden": false, "moves":["agility", "discharge", "raindance", "lightscreen"]}, {"generation": 6, "level": 70, "isHidden": true, "moves":["discharge", "thundershock", "raindance", "agility"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, moltres: { randomBattleMoves: ["fireblast", "hiddenpowergrass", "roost", "substitute", "toxic", "willowisp", "hurricane"], randomDoubleBattleMoves: ["fireblast", "hiddenpowergrass", "airslash", "roost", "substitute", "protect", "uturn", "willowisp", "hurricane", "heatwave", "tailwind"], eventPokemon: [ {"generation": 3, "level": 50, "shiny": 1, "moves":["firespin", "agility", "endure", "flamethrower"]}, {"generation": 3, "level": 70, "moves":["agility", "endure", "flamethrower", "safeguard"]}, {"generation": 3, "level": 50, "moves":["extrasensory", "morningsun", "willowisp", "flamethrower"]}, {"generation": 4, "level": 60, "shiny": 1, "moves":["flamethrower", "safeguard", "airslash", "roost"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["firespin", "agility", "endure", "flamethrower"]}, {"generation": 6, "level": 70, "isHidden": false, "moves":["safeguard", "airslash", "sunnyday", "heatwave"]}, {"generation": 6, "level": 70, "isHidden": true, "moves":["skyattack", "heatwave", "sunnyday", "safeguard"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "RU", }, dratini: { randomBattleMoves: ["dragondance", "outrage", "waterfall", "fireblast", "extremespeed", "dracometeor", "substitute"], tier: "LC", }, dragonair: { randomBattleMoves: ["dragondance", "outrage", "waterfall", "fireblast", "extremespeed", "dracometeor", "substitute"], tier: "NFE", }, dragonite: { randomBattleMoves: ["dragondance", "outrage", "firepunch", "extremespeed", "earthquake", "roost"], randomDoubleBattleMoves: ["dragondance", "firepunch", "extremespeed", "dragonclaw", "earthquake", "roost", "substitute", "superpower", "dracometeor", "protect", "skydrop"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["agility", "safeguard", "wingattack", "outrage"]}, {"generation": 3, "level": 55, "moves":["healbell", "hyperbeam", "dragondance", "earthquake"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Mild", "moves":["dracometeor", "thunderbolt", "outrage", "dragondance"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "gender": "M", "isHidden": true, "moves":["extremespeed", "firepunch", "dragondance", "outrage"], "pokeball": "cherishball"}, {"generation": 5, "level": 55, "gender": "M", "isHidden": true, "moves":["dragonrush", "safeguard", "wingattack", "thunderpunch"]}, {"generation": 5, "level": 55, "gender": "M", "isHidden": true, "moves":["dragonrush", "safeguard", "wingattack", "extremespeed"]}, {"generation": 5, "level": 50, "gender": "M", "nature": "Brave", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "moves":["fireblast", "safeguard", "outrage", "hyperbeam"], "pokeball": "cherishball"}, {"generation": 6, "level": 55, "gender": "M", "isHidden": true, "moves":["dragondance", "outrage", "hurricane", "extremespeed"], "pokeball": "cherishball"}, {"generation": 6, "level": 62, "gender": "M", "ivs": {"hp": 31, "def": 31, "spa": 31, "spd": 31}, "isHidden": false, "moves":["agility", "slam", "barrier", "hyperbeam"], "pokeball": "cherishball"}, ], tier: "OU", }, mewtwo: { randomBattleMoves: ["psystrike", "aurasphere", "fireblast", "icebeam", "calmmind", "recover"], randomDoubleBattleMoves: ["psystrike", "aurasphere", "fireblast", "icebeam", "calmmind", "substitute", "recover", "thunderbolt", "willowisp", "taunt", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "shiny": 1, "moves":["swift", "recover", "safeguard", "psychic"]}, {"generation": 4, "level": 70, "shiny": 1, "moves":["psychocut", "amnesia", "powerswap", "guardswap"]}, {"generation": 5, "level": 70, "isHidden": false, "moves":["psystrike", "shadowball", "aurasphere", "electroball"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "nature": "Timid", "ivs": {"spa": 31, "spe": 31}, "isHidden": true, "moves":["psystrike", "icebeam", "healpulse", "hurricane"], "pokeball": "cherishball"}, {"generation": 6, "level": 70, "isHidden": false, "moves":["recover", "psychic", "barrier", "aurasphere"]}, {"generation": 6, "level": 100, "shiny": true, "isHidden": true, "moves":["psystrike", "psychic", "recover", "aurasphere"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, mewtwomegax: { randomBattleMoves: ["bulkup", "drainpunch", "earthquake", "taunt", "stoneedge", "zenheadbutt", "icebeam"], randomDoubleBattleMoves: ["bulkup", "drainpunch", "earthquake", "taunt", "stoneedge", "zenheadbutt", "icebeam"], requiredItem: "Mewtwonite X", tier: "Uber", }, mewtwomegay: { randomBattleMoves: ["psystrike", "aurasphere", "shadowball", "fireblast", "icebeam", "calmmind", "recover", "willowisp", "taunt"], randomDoubleBattleMoves: ["psystrike", "aurasphere", "shadowball", "fireblast", "icebeam", "calmmind", "recover", "willowisp", "taunt"], requiredItem: "Mewtwonite Y", tier: "Uber", }, mew: { randomBattleMoves: ["defog", "roost", "willowisp", "knockoff", "taunt", "icebeam", "earthpower", "aurasphere", "stealthrock", "nastyplot", "psyshock", "batonpass"], randomDoubleBattleMoves: ["taunt", "willowisp", "transform", "roost", "psyshock", "nastyplot", "aurasphere", "fireblast", "icebeam", "thunderbolt", "protect", "fakeout", "helpinghand", "tailwind"], eventPokemon: [ {"generation": 3, "level": 30, "shiny": 1, "moves":["pound", "transform", "megapunch", "metronome"]}, {"generation": 3, "level": 10, "moves":["pound", "transform"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["fakeout"]}, {"generation": 3, "level": 10, "moves":["fakeout"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["feintattack"]}, {"generation": 3, "level": 10, "moves":["feintattack"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["hypnosis"]}, {"generation": 3, "level": 10, "moves":["hypnosis"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["nightshade"]}, {"generation": 3, "level": 10, "moves":["nightshade"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["roleplay"]}, {"generation": 3, "level": 10, "moves":["roleplay"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["zapcannon"]}, {"generation": 3, "level": 10, "moves":["zapcannon"]}, {"generation": 4, "level": 50, "moves":["ancientpower", "metronome", "teleport", "aurasphere"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["barrier", "metronome", "teleport", "aurasphere"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["megapunch", "metronome", "teleport", "aurasphere"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["amnesia", "metronome", "teleport", "aurasphere"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["transform", "metronome", "teleport", "aurasphere"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["psychic", "metronome", "teleport", "aurasphere"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["synthesis", "return", "hypnosis", "teleport"], "pokeball": "cherishball"}, {"generation": 4, "level": 5, "moves":["pound"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["pound"], "pokeball": "cherishball"}, {"generation": 7, "level": 5, "moves":["pound"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "moves":["psychic", "barrier", "metronome", "transform"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, chikorita: { randomBattleMoves: ["reflect", "lightscreen", "aromatherapy", "grasswhistle", "leechseed", "toxic", "gigadrain", "synthesis"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "growl", "razorleaf"]}, {"generation": 3, "level": 5, "moves":["tackle", "growl", "ancientpower", "frenzyplant"]}, {"generation": 6, "level": 5, "isHidden": false, "moves":["tackle", "growl"], "pokeball": "cherishball"}, ], tier: "LC", }, bayleef: { randomBattleMoves: ["reflect", "lightscreen", "aromatherapy", "grasswhistle", "leechseed", "toxic", "gigadrain", "synthesis"], tier: "NFE", }, meganium: { randomBattleMoves: ["reflect", "lightscreen", "aromatherapy", "leechseed", "toxic", "gigadrain", "synthesis", "dragontail"], randomDoubleBattleMoves: ["reflect", "lightscreen", "leechseed", "leafstorm", "gigadrain", "synthesis", "dragontail", "healpulse", "toxic", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "isHidden": true, "moves":["solarbeam", "sunnyday", "synthesis", "bodyslam"]}, ], tier: "PU", }, cyndaquil: { randomBattleMoves: ["eruption", "fireblast", "flamethrower", "hiddenpowergrass", "hiddenpowerice"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "leer", "smokescreen"]}, {"generation": 3, "level": 5, "moves":["tackle", "leer", "reversal", "blastburn"]}, {"generation": 6, "level": 5, "isHidden": false, "moves":["tackle", "leer"], "pokeball": "cherishball"}, ], tier: "LC", }, quilava: { randomBattleMoves: ["eruption", "fireblast", "flamethrower", "hiddenpowergrass", "hiddenpowerice"], tier: "NFE", }, typhlosion: { randomBattleMoves: ["eruption", "fireblast", "hiddenpowergrass", "extrasensory", "focusblast"], randomDoubleBattleMoves: ["eruption", "fireblast", "hiddenpowergrass", "extrasensory", "focusblast", "heatwave", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["quickattack", "flamewheel", "swift", "flamethrower"]}, {"generation": 6, "level": 50, "isHidden": true, "moves":["overheat", "flamewheel", "flamecharge", "swift"]}, ], tier: "NU", }, totodile: { randomBattleMoves: ["aquajet", "waterfall", "crunch", "icepunch", "superpower", "dragondance", "swordsdance"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "leer", "rage"]}, {"generation": 3, "level": 5, "moves":["scratch", "leer", "crunch", "hydrocannon"]}, {"generation": 6, "level": 5, "isHidden": false, "moves":["scratch", "leer"], "pokeball": "cherishball"}, ], tier: "LC", }, croconaw: { randomBattleMoves: ["aquajet", "waterfall", "crunch", "icepunch", "superpower", "dragondance", "swordsdance"], tier: "NFE", }, feraligatr: { randomBattleMoves: ["aquajet", "waterfall", "crunch", "icepunch", "dragondance", "swordsdance", "earthquake"], randomDoubleBattleMoves: ["aquajet", "waterfall", "crunch", "icepunch", "dragondance", "swordsdance", "earthquake", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "isHidden": true, "moves":["icepunch", "crunch", "waterfall", "screech"]}, ], tier: "RU", }, sentret: { randomBattleMoves: ["superfang", "trick", "toxic", "uturn", "knockoff"], tier: "LC", }, furret: { randomBattleMoves: ["uturn", "trick", "aquatail", "firepunch", "knockoff", "doubleedge"], randomDoubleBattleMoves: ["uturn", "suckerpunch", "icepunch", "firepunch", "knockoff", "doubleedge", "superfang", "followme", "helpinghand", "protect"], tier: "PU", }, hoothoot: { randomBattleMoves: ["reflect", "toxic", "roost", "whirlwind", "nightshade", "magiccoat"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "growl", "foresight"]}, ], tier: "LC", }, noctowl: { randomBattleMoves: ["roost", "whirlwind", "airslash", "nightshade", "toxic", "defog"], randomDoubleBattleMoves: ["roost", "tailwind", "airslash", "hypervoice", "heatwave", "protect", "hypnosis"], tier: "PU", }, ledyba: { randomBattleMoves: ["roost", "agility", "lightscreen", "encore", "reflect", "knockoff", "swordsdance", "batonpass", "toxic"], eventPokemon: [ {"generation": 3, "level": 10, "moves":["refresh", "psybeam", "aerialace", "supersonic"]}, ], tier: "LC", }, ledian: { randomBattleMoves: ["roost", "lightscreen", "encore", "reflect", "knockoff", "toxic", "uturn"], randomDoubleBattleMoves: ["protect", "lightscreen", "encore", "reflect", "knockoff", "bugbuzz", "uturn", "tailwind"], tier: "PU", }, spinarak: { randomBattleMoves: ["agility", "toxic", "xscissor", "toxicspikes", "poisonjab", "batonpass", "stickyweb"], eventPokemon: [ {"generation": 3, "level": 14, "moves":["refresh", "dig", "signalbeam", "nightshade"]}, ], tier: "LC", }, ariados: { randomBattleMoves: ["megahorn", "toxicspikes", "poisonjab", "suckerpunch", "stickyweb"], randomDoubleBattleMoves: ["protect", "megahorn", "stringshot", "poisonjab", "stickyweb", "ragepowder"], tier: "PU", }, chinchou: { randomBattleMoves: ["voltswitch", "thunderbolt", "hiddenpowergrass", "hydropump", "icebeam", "surf", "thunderwave", "scald", "discharge", "healbell"], tier: "LC", }, lanturn: { randomBattleMoves: ["voltswitch", "hiddenpowergrass", "hydropump", "icebeam", "thunderwave", "scald", "thunderbolt", "healbell", "toxic"], randomDoubleBattleMoves: ["thunderbolt", "hiddenpowergrass", "hydropump", "icebeam", "thunderwave", "scald", "discharge", "protect", "surf"], tier: "PU", }, togepi: { randomBattleMoves: ["protect", "fireblast", "toxic", "thunderwave", "softboiled", "dazzlinggleam"], eventPokemon: [ {"generation": 3, "level": 20, "gender": "F", "abilities":["serenegrace"], "moves":["metronome", "charm", "sweetkiss", "yawn"]}, {"generation": 3, "level": 25, "moves":["triattack", "followme", "ancientpower", "helpinghand"]}, ], tier: "LC", }, togetic: { randomBattleMoves: ["nastyplot", "dazzlinggleam", "fireblast", "batonpass", "roost", "defog", "toxic", "thunderwave", "healbell"], tier: "NFE", }, togekiss: { randomBattleMoves: ["roost", "thunderwave", "nastyplot", "airslash", "aurasphere", "batonpass", "healbell", "defog"], randomDoubleBattleMoves: ["roost", "thunderwave", "nastyplot", "airslash", "followme", "dazzlinggleam", "tailwind", "protect"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["extremespeed", "aurasphere", "airslash", "present"]}, ], tier: "UU", }, natu: { randomBattleMoves: ["thunderwave", "roost", "toxic", "reflect", "lightscreen", "uturn", "wish", "psychic", "nightshade"], eventPokemon: [ {"generation": 3, "level": 22, "moves":["batonpass", "futuresight", "nightshade", "aerialace"]}, ], tier: "LC", }, xatu: { randomBattleMoves: ["thunderwave", "toxic", "roost", "psychic", "uturn", "reflect", "calmmind", "nightshade", "heatwave"], randomDoubleBattleMoves: ["thunderwave", "tailwind", "roost", "psychic", "uturn", "reflect", "lightscreen", "grassknot", "heatwave", "protect"], tier: "NU", }, mareep: { randomBattleMoves: ["reflect", "lightscreen", "thunderbolt", "discharge", "thunderwave", "toxic", "hiddenpowerice", "cottonguard", "powergem"], eventPokemon: [ {"generation": 3, "level": 37, "gender": "F", "moves":["thunder", "thundershock", "thunderwave", "cottonspore"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "growl", "thundershock"]}, {"generation": 3, "level": 17, "moves":["healbell", "thundershock", "thunderwave", "bodyslam"]}, {"generation": 6, "level": 10, "isHidden": false, "moves":["holdback", "tackle", "thunderwave", "thundershock"], "pokeball": "cherishball"}, ], tier: "LC", }, flaaffy: { randomBattleMoves: ["reflect", "lightscreen", "thunderbolt", "discharge", "thunderwave", "toxic", "hiddenpowerice", "cottonguard", "powergem"], tier: "NFE", }, ampharos: { randomBattleMoves: ["voltswitch", "reflect", "lightscreen", "focusblast", "thunderbolt", "toxic", "healbell", "hiddenpowerice"], randomDoubleBattleMoves: ["focusblast", "hiddenpowerice", "hiddenpowergrass", "thunderbolt", "discharge", "dragonpulse", "protect"], tier: "PU", }, ampharosmega: { randomBattleMoves: ["voltswitch", "focusblast", "agility", "thunderbolt", "healbell", "dragonpulse"], randomDoubleBattleMoves: ["focusblast", "hiddenpowerice", "hiddenpowergrass", "thunderbolt", "discharge", "dragonpulse", "protect"], requiredItem: "Ampharosite", tier: "UU", }, azurill: { randomBattleMoves: ["scald", "return", "bodyslam", "encore", "toxic", "protect", "knockoff"], tier: "LC", }, marill: { randomBattleMoves: ["waterfall", "knockoff", "encore", "toxic", "aquajet", "superpower", "icepunch", "protect", "playrough", "poweruppunch"], tier: "NFE", }, azumarill: { randomBattleMoves: ["waterfall", "aquajet", "playrough", "superpower", "bellydrum", "knockoff"], randomDoubleBattleMoves: ["waterfall", "aquajet", "playrough", "superpower", "bellydrum", "knockoff", "protect"], tier: "BL", }, bonsly: { randomBattleMoves: ["rockslide", "brickbreak", "doubleedge", "toxic", "stealthrock", "suckerpunch", "explosion"], tier: "LC", }, sudowoodo: { randomBattleMoves: ["headsmash", "earthquake", "suckerpunch", "woodhammer", "toxic", "stealthrock"], randomDoubleBattleMoves: ["headsmash", "earthquake", "suckerpunch", "woodhammer", "explosion", "stealthrock", "rockslide", "helpinghand", "protect"], tier: "PU", }, hoppip: { randomBattleMoves: ["encore", "sleeppowder", "uturn", "toxic", "leechseed", "substitute", "protect"], tier: "LC", }, skiploom: { randomBattleMoves: ["encore", "sleeppowder", "uturn", "toxic", "leechseed", "substitute", "protect"], tier: "NFE", }, jumpluff: { randomBattleMoves: ["swordsdance", "sleeppowder", "uturn", "encore", "toxic", "acrobatics", "leechseed", "seedbomb", "substitute"], randomDoubleBattleMoves: ["encore", "sleeppowder", "uturn", "helpinghand", "leechseed", "gigadrain", "ragepowder", "protect"], eventPokemon: [ {"generation": 5, "level": 27, "gender": "M", "isHidden": true, "moves":["falseswipe", "sleeppowder", "bulletseed", "leechseed"]}, ], tier: "PU", }, aipom: { randomBattleMoves: ["fakeout", "return", "brickbreak", "seedbomb", "knockoff", "uturn", "icepunch", "irontail"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "tailwhip", "sandattack"]}, ], tier: "LC", }, ambipom: { randomBattleMoves: ["fakeout", "return", "knockoff", "uturn", "switcheroo", "seedbomb", "lowkick"], randomDoubleBattleMoves: ["fakeout", "return", "knockoff", "uturn", "doublehit", "icepunch", "lowkick", "protect"], tier: "NU", }, sunkern: { randomBattleMoves: ["sunnyday", "gigadrain", "solarbeam", "hiddenpowerfire", "toxic", "earthpower", "leechseed"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["chlorophyll"], "moves":["absorb", "growth"]}, ], tier: "LC", }, sunflora: { randomBattleMoves: ["sunnyday", "gigadrain", "solarbeam", "hiddenpowerfire", "earthpower"], randomDoubleBattleMoves: ["sunnyday", "gigadrain", "solarbeam", "hiddenpowerfire", "hiddenpowerice", "earthpower", "protect", "encore"], tier: "PU", }, yanma: { randomBattleMoves: ["bugbuzz", "airslash", "hiddenpowerground", "uturn", "protect", "gigadrain", "ancientpower"], tier: "LC Uber", }, yanmega: { randomBattleMoves: ["bugbuzz", "airslash", "ancientpower", "uturn", "protect", "gigadrain"], tier: "BL3", }, wooper: { randomBattleMoves: ["recover", "earthquake", "scald", "toxic", "stockpile", "yawn", "protect"], tier: "LC", }, quagsire: { randomBattleMoves: ["recover", "earthquake", "scald", "toxic", "encore", "icebeam"], randomDoubleBattleMoves: ["icywind", "earthquake", "waterfall", "scald", "rockslide", "curse", "yawn", "icepunch", "protect"], tier: "RU", }, murkrow: { randomBattleMoves: ["substitute", "suckerpunch", "bravebird", "heatwave", "roost", "darkpulse", "thunderwave"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["insomnia"], "moves":["peck", "astonish"]}, ], tier: "LC Uber", }, honchkrow: { randomBattleMoves: ["substitute", "superpower", "suckerpunch", "bravebird", "roost", "heatwave", "pursuit"], randomDoubleBattleMoves: ["substitute", "superpower", "suckerpunch", "bravebird", "roost", "heatwave", "protect"], tier: "RU", }, misdreavus: { randomBattleMoves: ["nastyplot", "thunderbolt", "dazzlinggleam", "willowisp", "shadowball", "taunt", "painsplit"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["growl", "psywave", "spite"]}, ], tier: "LC Uber", }, mismagius: { randomBattleMoves: ["nastyplot", "substitute", "willowisp", "shadowball", "thunderbolt", "dazzlinggleam", "taunt", "painsplit", "destinybond"], randomDoubleBattleMoves: ["nastyplot", "substitute", "willowisp", "shadowball", "thunderbolt", "dazzlinggleam", "taunt", "protect"], tier: "NU", }, unown: { randomBattleMoves: ["hiddenpowerpsychic"], tier: "PU", }, wynaut: { randomBattleMoves: ["destinybond", "counter", "mirrorcoat", "encore"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["splash", "charm", "encore", "tickle"]}, ], tier: "LC", }, wobbuffet: { randomBattleMoves: ["counter", "mirrorcoat", "encore", "destinybond", "safeguard"], randomDoubleBattleMoves: ["counter", "mirrorcoat", "encore", "destinybond", "safeguard"], eventPokemon: [ {"generation": 3, "level": 5, "moves":["counter", "mirrorcoat", "safeguard", "destinybond"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["counter", "mirrorcoat", "safeguard", "destinybond"]}, {"generation": 6, "level": 10, "gender": "M", "isHidden": false, "moves":["counter"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "gender": "M", "isHidden": false, "moves":["counter", "mirrorcoat"], "pokeball": "cherishball"}, ], tier: "PU", }, girafarig: { randomBattleMoves: ["psychic", "psyshock", "thunderbolt", "nastyplot", "batonpass", "substitute", "hypervoice"], randomDoubleBattleMoves: ["psychic", "psyshock", "thunderbolt", "nastyplot", "protect", "agility", "hypervoice"], tier: "PU", }, pineco: { randomBattleMoves: ["rapidspin", "toxicspikes", "spikes", "bugbite", "stealthrock"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "protect", "selfdestruct"]}, {"generation": 3, "level": 20, "moves":["refresh", "pinmissile", "spikes", "counter"]}, ], tier: "LC", }, forretress: { randomBattleMoves: ["rapidspin", "toxic", "spikes", "voltswitch", "stealthrock", "gyroball"], randomDoubleBattleMoves: ["rockslide", "drillrun", "toxic", "voltswitch", "stealthrock", "gyroball", "protect"], tier: "UU", }, dunsparce: { randomBattleMoves: ["coil", "rockslide", "bite", "headbutt", "glare", "bodyslam", "roost"], randomDoubleBattleMoves: ["coil", "rockslide", "bite", "headbutt", "glare", "bodyslam", "protect"], tier: "PU", }, gligar: { randomBattleMoves: ["stealthrock", "toxic", "roost", "defog", "earthquake", "uturn", "knockoff"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["poisonsting", "sandattack"]}, ], tier: "RU", }, gliscor: { randomBattleMoves: ["roost", "substitute", "taunt", "earthquake", "protect", "toxic", "stealthrock", "knockoff"], randomDoubleBattleMoves: ["tailwind", "substitute", "taunt", "earthquake", "protect", "stoneedge", "knockoff"], tier: "UU", }, snubbull: { randomBattleMoves: ["thunderwave", "firepunch", "crunch", "closecombat", "icepunch", "earthquake", "playrough"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "scaryface", "tailwhip", "charm"]}, ], tier: "LC", }, granbull: { randomBattleMoves: ["thunderwave", "playrough", "crunch", "earthquake", "healbell"], randomDoubleBattleMoves: ["thunderwave", "playrough", "crunch", "earthquake", "snarl", "rockslide", "protect"], tier: "PU", }, qwilfish: { randomBattleMoves: ["toxicspikes", "waterfall", "spikes", "painsplit", "thunderwave", "taunt", "destinybond"], randomDoubleBattleMoves: ["poisonjab", "waterfall", "swordsdance", "protect", "thunderwave", "taunt", "destinybond"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "poisonsting", "harden", "minimize"]}, ], tier: "PU", }, shuckle: { randomBattleMoves: ["toxic", "encore", "stealthrock", "knockoff", "stickyweb", "infestation"], randomDoubleBattleMoves: ["encore", "stealthrock", "knockoff", "stickyweb", "guardsplit", "powersplit", "toxic", "helpinghand"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["sturdy"], "moves":["constrict", "withdraw", "wrap"]}, {"generation": 3, "level": 20, "abilities":["sturdy"], "moves":["substitute", "toxic", "sludgebomb", "encore"]}, ], tier: "NU", }, heracross: { randomBattleMoves: ["closecombat", "megahorn", "stoneedge", "swordsdance", "knockoff", "earthquake"], randomDoubleBattleMoves: ["closecombat", "megahorn", "stoneedge", "swordsdance", "knockoff", "earthquake", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "gender": "F", "nature": "Adamant", "isHidden": false, "moves":["bulletseed", "pinmissile", "closecombat", "megahorn"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "nature": "Adamant", "isHidden": false, "abilities":["guts"], "moves":["pinmissile", "bulletseed", "earthquake", "rockblast"], "pokeball": "cherishball"}, ], tier: "UU", }, heracrossmega: { randomBattleMoves: ["closecombat", "pinmissile", "rockblast", "swordsdance", "bulletseed", "substitute"], randomDoubleBattleMoves: ["closecombat", "pinmissile", "rockblast", "swordsdance", "bulletseed", "knockoff", "earthquake", "protect"], requiredItem: "Heracronite", tier: "BL", }, sneasel: { randomBattleMoves: ["iceshard", "iciclecrash", "lowkick", "pursuit", "swordsdance", "knockoff"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "leer", "taunt", "quickattack"]}, ], tier: "NU", }, weavile: { randomBattleMoves: ["iceshard", "iciclecrash", "knockoff", "pursuit", "swordsdance", "lowkick"], randomDoubleBattleMoves: ["iceshard", "iciclecrash", "knockoff", "fakeout", "swordsdance", "lowkick", "taunt", "protect", "feint"], eventPokemon: [ {"generation": 4, "level": 30, "gender": "M", "nature": "Jolly", "moves":["fakeout", "iceshard", "nightslash", "brickbreak"], "pokeball": "cherishball"}, {"generation": 6, "level": 48, "gender": "M", "perfectIVs": 2, "isHidden": false, "moves":["nightslash", "icepunch", "brickbreak", "xscissor"], "pokeball": "cherishball"}, ], tier: "UU", }, teddiursa: { randomBattleMoves: ["swordsdance", "protect", "facade", "closecombat", "firepunch", "crunch", "playrough", "gunkshot"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["pickup"], "moves":["scratch", "leer", "lick"]}, {"generation": 3, "level": 11, "abilities":["pickup"], "moves":["refresh", "metalclaw", "lick", "return"]}, ], tier: "LC", }, ursaring: { randomBattleMoves: ["swordsdance", "facade", "closecombat", "crunch", "protect"], randomDoubleBattleMoves: ["swordsdance", "facade", "closecombat", "earthquake", "crunch", "protect"], tier: "PU", }, slugma: { randomBattleMoves: ["stockpile", "recover", "lavaplume", "willowisp", "toxic", "hiddenpowergrass", "earthpower", "memento"], tier: "LC", }, magcargo: { randomBattleMoves: ["recover", "lavaplume", "toxic", "hiddenpowergrass", "stealthrock", "fireblast", "earthpower", "shellsmash", "ancientpower"], randomDoubleBattleMoves: ["protect", "heatwave", "willowisp", "shellsmash", "hiddenpowergrass", "ancientpower", "stealthrock", "fireblast", "earthpower"], eventPokemon: [ {"generation": 3, "level": 38, "moves":["refresh", "heatwave", "earthquake", "flamethrower"]}, ], tier: "PU", }, swinub: { randomBattleMoves: ["earthquake", "iciclecrash", "iceshard", "superpower", "endeavor", "stealthrock"], eventPokemon: [ {"generation": 3, "level": 22, "abilities":["oblivious"], "moves":["charm", "ancientpower", "mist", "mudshot"]}, ], tier: "LC", }, piloswine: { randomBattleMoves: ["earthquake", "iciclecrash", "iceshard", "endeavor", "stealthrock"], tier: "NFE", }, mamoswine: { randomBattleMoves: ["iceshard", "earthquake", "endeavor", "iciclecrash", "stealthrock", "superpower", "knockoff"], randomDoubleBattleMoves: ["iceshard", "earthquake", "rockslide", "iciclecrash", "protect", "superpower", "knockoff"], eventPokemon: [ {"generation": 5, "level": 34, "gender": "M", "isHidden": true, "moves":["hail", "icefang", "takedown", "doublehit"]}, {"generation": 6, "level": 50, "shiny": true, "gender": "M", "nature": "Adamant", "isHidden": true, "moves":["iciclespear", "earthquake", "iciclecrash", "rockslide"]}, ], tier: "UU", }, corsola: { randomBattleMoves: ["recover", "toxic", "powergem", "scald", "stealthrock"], randomDoubleBattleMoves: ["protect", "icywind", "powergem", "scald", "stealthrock", "earthpower", "icebeam"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["tackle", "mudsport"]}, ], tier: "PU", }, remoraid: { randomBattleMoves: ["waterspout", "hydropump", "fireblast", "hiddenpowerground", "icebeam", "seedbomb", "rockblast"], tier: "LC", }, octillery: { randomBattleMoves: ["hydropump", "fireblast", "icebeam", "energyball", "rockblast", "gunkshot", "scald"], randomDoubleBattleMoves: ["hydropump", "surf", "fireblast", "icebeam", "energyball", "chargebeam", "protect"], eventPokemon: [ {"generation": 4, "level": 50, "gender": "F", "nature": "Serious", "abilities":["suctioncups"], "moves":["octazooka", "icebeam", "signalbeam", "hyperbeam"], "pokeball": "cherishball"}, ], tier: "PU", }, delibird: { randomBattleMoves: ["rapidspin", "iceshard", "icepunch", "aerialace", "spikes", "destinybond"], randomDoubleBattleMoves: ["fakeout", "iceshard", "icepunch", "aerialace", "brickbreak", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["present"]}, {"generation": 6, "level": 10, "isHidden": false, "abilities":["vitalspirit"], "moves":["present", "happyhour"], "pokeball": "cherishball"}, ], tier: "PU", }, mantyke: { randomBattleMoves: ["raindance", "hydropump", "scald", "airslash", "icebeam", "rest", "sleeptalk", "toxic"], tier: "LC", }, mantine: { randomBattleMoves: ["scald", "airslash", "roost", "toxic", "defog"], randomDoubleBattleMoves: ["raindance", "scald", "airslash", "icebeam", "tailwind", "wideguard", "helpinghand", "protect", "surf"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "bubble", "supersonic"]}, ], tier: "UU", }, skarmory: { randomBattleMoves: ["whirlwind", "bravebird", "roost", "spikes", "stealthrock", "defog"], randomDoubleBattleMoves: ["skydrop", "bravebird", "tailwind", "taunt", "feint", "protect", "ironhead"], tier: "OU", }, houndour: { randomBattleMoves: ["pursuit", "suckerpunch", "fireblast", "darkpulse", "hiddenpowerfighting", "nastyplot"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["leer", "ember", "howl"]}, {"generation": 3, "level": 17, "moves":["charm", "feintattack", "ember", "roar"]}, ], tier: "LC", }, houndoom: { randomBattleMoves: ["nastyplot", "darkpulse", "suckerpunch", "fireblast", "hiddenpowergrass"], randomDoubleBattleMoves: ["nastyplot", "darkpulse", "suckerpunch", "heatwave", "hiddenpowerfighting", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "nature": "Timid", "isHidden": false, "abilities":["flashfire"], "moves":["flamethrower", "darkpulse", "solarbeam", "sludgebomb"], "pokeball": "cherishball"}, ], tier: "NU", }, houndoommega: { randomBattleMoves: ["nastyplot", "darkpulse", "taunt", "fireblast", "hiddenpowergrass"], randomDoubleBattleMoves: ["nastyplot", "darkpulse", "taunt", "heatwave", "hiddenpowergrass", "protect"], requiredItem: "Houndoominite", tier: "BL", }, phanpy: { randomBattleMoves: ["stealthrock", "earthquake", "iceshard", "headsmash", "knockoff", "seedbomb", "superpower", "playrough"], tier: "LC", }, donphan: { randomBattleMoves: ["stealthrock", "rapidspin", "iceshard", "earthquake", "knockoff", "stoneedge"], randomDoubleBattleMoves: ["stealthrock", "knockoff", "iceshard", "earthquake", "rockslide", "protect"], tier: "RU", }, stantler: { randomBattleMoves: ["doubleedge", "megahorn", "jumpkick", "earthquake", "suckerpunch"], randomDoubleBattleMoves: ["return", "megahorn", "jumpkick", "earthquake", "suckerpunch", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["intimidate"], "moves":["tackle", "leer"]}, ], tier: "PU", }, smeargle: { randomBattleMoves: ["spore", "spikes", "stealthrock", "destinybond", "whirlwind", "stickyweb"], randomDoubleBattleMoves: ["spore", "fakeout", "wideguard", "helpinghand", "followme", "tailwind", "kingsshield", "transform"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["owntempo"], "moves":["sketch"]}, {"generation": 5, "level": 50, "gender": "F", "nature": "Jolly", "ivs": {"atk": 31, "spe": 31}, "isHidden": false, "abilities":["technician"], "moves":["falseswipe", "spore", "odorsleuth", "meanlook"], "pokeball": "cherishball"}, ], tier: "UU", }, pokestarsmeargle: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 60, "gender": "M", "abilities":["owntempo"], "moves":["mindreader", "guillotine", "tailwhip", "gastroacid"]}, {"generation": 5, "level": 30, "gender": "M", "abilities":["owntempo"], "moves":["outrage", "magiccoat"]}, {"generation": 5, "level": 99, "gender": "M", "abilities":["owntempo"], "moves":["nastyplot", "sheercold", "attract", "shadowball"]}, ], gen: 5, tier: "Illegal", }, miltank: { randomBattleMoves: ["milkdrink", "stealthrock", "bodyslam", "healbell", "curse", "earthquake", "toxic"], randomDoubleBattleMoves: ["protect", "helpinghand", "bodyslam", "milkdrink", "curse", "earthquake", "thunderwave"], eventPokemon: [ {"generation": 6, "level": 20, "perfectIVs": 3, "isHidden": false, "abilities":["scrappy"], "moves":["rollout", "attract", "stomp", "milkdrink"], "pokeball": "cherishball"}, ], tier: "PU", }, raikou: { randomBattleMoves: ["thunderbolt", "hiddenpowerice", "aurasphere", "calmmind", "substitute", "voltswitch", "extrasensory"], randomDoubleBattleMoves: ["thunderbolt", "hiddenpowerice", "extrasensory", "calmmind", "substitute", "snarl", "protect"], eventPokemon: [ {"generation": 3, "level": 50, "shiny": 1, "moves":["thundershock", "roar", "quickattack", "spark"]}, {"generation": 3, "level": 70, "moves":["quickattack", "spark", "reflect", "crunch"]}, {"generation": 4, "level": 40, "shiny": 1, "moves":["roar", "quickattack", "spark", "reflect"]}, {"generation": 4, "level": 30, "shiny": true, "nature": "Rash", "moves":["zapcannon", "aurasphere", "extremespeed", "weatherball"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "moves":["spark", "reflect", "crunch", "thunderfang"]}, ], eventOnly: true, unreleasedHidden: true, tier: "UU", }, entei: { randomBattleMoves: ["extremespeed", "flareblitz", "bulldoze", "stoneedge", "sacredfire"], randomDoubleBattleMoves: ["extremespeed", "flareblitz", "ironhead", "bulldoze", "stoneedge", "sacredfire", "protect"], eventPokemon: [ {"generation": 3, "level": 50, "shiny": 1, "moves":["ember", "roar", "firespin", "stomp"]}, {"generation": 3, "level": 70, "moves":["firespin", "stomp", "flamethrower", "swagger"]}, {"generation": 4, "level": 40, "shiny": 1, "moves":["roar", "firespin", "stomp", "flamethrower"]}, {"generation": 4, "level": 30, "shiny": true, "nature": "Adamant", "moves":["flareblitz", "howl", "extremespeed", "crushclaw"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "moves":["stomp", "flamethrower", "swagger", "firefang"]}, ], eventOnly: true, unreleasedHidden: true, tier: "UU", }, suicune: { randomBattleMoves: ["hydropump", "icebeam", "scald", "hiddenpowergrass", "rest", "sleeptalk", "calmmind"], randomDoubleBattleMoves: ["hydropump", "icebeam", "scald", "hiddenpowergrass", "snarl", "tailwind", "protect", "calmmind"], eventPokemon: [ {"generation": 3, "level": 50, "shiny": 1, "moves":["bubblebeam", "raindance", "gust", "aurorabeam"]}, {"generation": 3, "level": 70, "moves":["gust", "aurorabeam", "mist", "mirrorcoat"]}, {"generation": 4, "level": 40, "shiny": 1, "moves":["raindance", "gust", "aurorabeam", "mist"]}, {"generation": 4, "level": 30, "shiny": true, "nature": "Relaxed", "moves":["sheercold", "airslash", "extremespeed", "aquaring"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "moves":["aurorabeam", "mist", "mirrorcoat", "icefang"]}, ], eventOnly: true, unreleasedHidden: true, tier: "UU", }, larvitar: { randomBattleMoves: ["earthquake", "stoneedge", "facade", "dragondance", "superpower", "crunch"], eventPokemon: [ {"generation": 3, "level": 20, "moves":["sandstorm", "dragondance", "bite", "outrage"]}, {"generation": 5, "level": 5, "shiny": true, "gender": "M", "isHidden": false, "moves":["bite", "leer", "sandstorm", "superpower"], "pokeball": "cherishball"}, ], tier: "LC", }, pupitar: { randomBattleMoves: ["earthquake", "stoneedge", "crunch", "dragondance", "superpower", "stealthrock"], tier: "NFE", }, tyranitar: { randomBattleMoves: ["crunch", "stoneedge", "pursuit", "earthquake", "fireblast", "icebeam", "stealthrock"], randomDoubleBattleMoves: ["crunch", "stoneedge", "rockslide", "earthquake", "firepunch", "icepunch", "stealthrock", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["thrash", "scaryface", "crunch", "earthquake"]}, {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["fireblast", "icebeam", "stoneedge", "crunch"], "pokeball": "cherishball"}, {"generation": 5, "level": 55, "gender": "M", "isHidden": true, "moves":["payback", "crunch", "earthquake", "seismictoss"]}, {"generation": 6, "level": 50, "isHidden": false, "moves":["stoneedge", "crunch", "earthquake", "icepunch"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "nature": "Jolly", "isHidden": false, "moves":["rockslide", "earthquake", "crunch", "stoneedge"], "pokeball": "cherishball"}, {"generation": 6, "level": 55, "shiny": true, "nature": "Adamant", "ivs": {"hp": 31, "atk": 31, "def": 31, "spa": 14, "spd": 31, "spe": 0}, "isHidden": false, "moves":["crunch", "rockslide", "lowkick", "protect"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "isHidden": false, "moves":["rockslide", "crunch", "icepunch", "lowkick"], "pokeball": "cherishball"}, ], tier: "OU", }, tyranitarmega: { randomBattleMoves: ["crunch", "stoneedge", "earthquake", "icepunch", "dragondance"], randomDoubleBattleMoves: ["crunch", "stoneedge", "earthquake", "icepunch", "dragondance", "rockslide", "protect"], requiredItem: "Tyranitarite", tier: "OU", }, lugia: { randomBattleMoves: ["toxic", "roost", "substitute", "whirlwind", "thunderwave", "dragontail", "aeroblast"], randomDoubleBattleMoves: ["aeroblast", "roost", "substitute", "tailwind", "icebeam", "psychic", "calmmind", "skydrop", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "shiny": 1, "moves":["recover", "hydropump", "raindance", "swift"]}, {"generation": 3, "level": 50, "moves":["psychoboost", "earthquake", "hydropump", "featherdance"]}, {"generation": 4, "level": 45, "shiny": 1, "moves":["extrasensory", "raindance", "hydropump", "aeroblast"]}, {"generation": 4, "level": 70, "shiny": 1, "moves":["aeroblast", "punishment", "ancientpower", "safeguard"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["whirlwind", "weatherball"], "pokeball": "dreamball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["raindance", "hydropump", "aeroblast", "punishment"]}, {"generation": 6, "level": 50, "nature": "Timid", "isHidden": false, "moves":["aeroblast", "hydropump", "dragonrush", "icebeam"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, hooh: { randomBattleMoves: ["substitute", "sacredfire", "bravebird", "earthquake", "roost", "toxic", "flamecharge"], randomDoubleBattleMoves: ["substitute", "sacredfire", "bravebird", "earthquake", "roost", "toxic", "tailwind", "skydrop", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "shiny": 1, "moves":["recover", "fireblast", "sunnyday", "swift"]}, {"generation": 4, "level": 45, "shiny": 1, "moves":["extrasensory", "sunnyday", "fireblast", "sacredfire"]}, {"generation": 4, "level": 70, "shiny": 1, "moves":["sacredfire", "punishment", "ancientpower", "safeguard"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["whirlwind", "weatherball"], "pokeball": "dreamball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["sunnyday", "fireblast", "sacredfire", "punishment"]}, {"generation": 6, "level": 50, "shiny": true, "isHidden": false, "moves":["sacredfire", "bravebird", "recover", "celebrate"], "pokeball": "cherishball"}, {"generation": 7, "level": 100, "isHidden": false, "moves":["sacredfire", "bravebird", "recover", "safeguard"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, celebi: { randomBattleMoves: ["nastyplot", "psychic", "gigadrain", "recover", "healbell", "batonpass", "earthpower", "hiddenpowerfire", "leafstorm", "uturn", "thunderwave"], randomDoubleBattleMoves: ["protect", "psychic", "gigadrain", "leechseed", "recover", "earthpower", "hiddenpowerfire", "nastyplot", "leafstorm", "uturn", "thunderwave"], eventPokemon: [ {"generation": 3, "level": 10, "moves":["confusion", "recover", "healbell", "safeguard"]}, {"generation": 3, "level": 70, "moves":["ancientpower", "futuresight", "batonpass", "perishsong"]}, {"generation": 3, "level": 10, "moves":["leechseed", "recover", "healbell", "safeguard"]}, {"generation": 3, "level": 30, "moves":["healbell", "safeguard", "ancientpower", "futuresight"]}, {"generation": 4, "level": 50, "moves":["leafstorm", "recover", "nastyplot", "healingwish"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "moves":["recover", "healbell", "safeguard", "holdback"], "pokeball": "luxuryball"}, {"generation": 6, "level": 100, "moves":["confusion", "recover", "healbell", "safeguard"], "pokeball": "cherishball"}, {"generation": 7, "level": 30, "moves":["healbell", "safeguard", "ancientpower", "futuresight"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "UU", }, treecko: { randomBattleMoves: ["substitute", "leechseed", "leafstorm", "hiddenpowerice", "hiddenpowerrock", "endeavor"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["pound", "leer", "absorb"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["pound", "leer", "absorb"]}, ], tier: "LC", }, grovyle: { randomBattleMoves: ["substitute", "leechseed", "gigadrain", "leafstorm", "hiddenpowerice", "hiddenpowerrock", "endeavor"], tier: "NFE", }, sceptile: { randomBattleMoves: ["gigadrain", "leafstorm", "hiddenpowerice", "focusblast", "hiddenpowerflying"], randomDoubleBattleMoves: ["gigadrain", "leafstorm", "hiddenpowerice", "focusblast", "hiddenpowerfire", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "moves":["leafstorm", "dragonpulse", "focusblast", "rockslide"], "pokeball": "cherishball"}, ], tier: "NU", }, sceptilemega: { randomBattleMoves: ["substitute", "gigadrain", "dragonpulse", "focusblast", "swordsdance", "outrage", "leafblade", "earthquake", "hiddenpowerfire"], randomDoubleBattleMoves: ["substitute", "gigadrain", "leafstorm", "hiddenpowerice", "focusblast", "dragonpulse", "hiddenpowerfire", "protect"], requiredItem: "Sceptilite", tier: "UU", }, torchic: { randomBattleMoves: ["protect", "batonpass", "substitute", "hiddenpowergrass", "swordsdance", "firepledge"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "growl", "focusenergy", "ember"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["scratch", "growl", "focusenergy", "ember"]}, {"generation": 6, "level": 10, "gender": "M", "isHidden": true, "moves":["scratch", "growl", "focusenergy", "ember"], "pokeball": "cherishball"}, ], tier: "LC", }, combusken: { randomBattleMoves: ["flareblitz", "skyuppercut", "protect", "swordsdance", "substitute", "batonpass", "shadowclaw"], tier: "NFE", }, blaziken: { randomBattleMoves: ["flareblitz", "highjumpkick", "protect", "swordsdance", "substitute", "batonpass", "stoneedge", "knockoff"], eventPokemon: [ {"generation": 3, "level": 70, "moves":["blazekick", "slash", "mirrormove", "skyuppercut"]}, {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "moves":["flareblitz", "highjumpkick", "thunderpunch", "stoneedge"], "pokeball": "cherishball"}, ], tier: "Uber", }, blazikenmega: { randomBattleMoves: ["flareblitz", "highjumpkick", "protect", "swordsdance", "substitute", "batonpass", "stoneedge", "knockoff"], requiredItem: "Blazikenite", tier: "Uber", }, mudkip: { randomBattleMoves: ["hydropump", "earthpower", "hiddenpowerelectric", "icebeam", "sludgewave"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["tackle", "growl", "mudslap", "watergun"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tackle", "growl", "mudslap", "watergun"]}, ], tier: "LC", }, marshtomp: { randomBattleMoves: ["waterfall", "earthquake", "superpower", "icepunch", "rockslide", "stealthrock"], tier: "NFE", }, swampert: { randomBattleMoves: ["stealthrock", "earthquake", "scald", "icebeam", "roar", "toxic", "protect"], randomDoubleBattleMoves: ["waterfall", "earthquake", "icebeam", "stealthrock", "wideguard", "scald", "rockslide", "muddywater", "protect", "icywind"], eventPokemon: [ {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "moves":["earthquake", "icebeam", "hydropump", "hammerarm"], "pokeball": "cherishball"}, ], tier: "UU", }, swampertmega: { randomBattleMoves: ["raindance", "waterfall", "earthquake", "icepunch", "superpower"], randomDoubleBattleMoves: ["waterfall", "earthquake", "raindance", "icepunch", "superpower", "protect"], requiredItem: "Swampertite", tier: "OU", }, poochyena: { randomBattleMoves: ["superfang", "foulplay", "suckerpunch", "toxic", "crunch", "firefang", "icefang", "poisonfang"], eventPokemon: [ {"generation": 3, "level": 10, "abilities":["runaway"], "moves":["healbell", "dig", "poisonfang", "howl"]}, ], tier: "LC", }, mightyena: { randomBattleMoves: ["crunch", "suckerpunch", "playrough", "firefang", "irontail"], randomDoubleBattleMoves: ["suckerpunch", "crunch", "playrough", "firefang", "taunt", "protect"], tier: "PU", }, zigzagoon: { randomBattleMoves: ["trick", "thunderwave", "icebeam", "thunderbolt", "gunkshot", "lastresort"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": true, "abilities":["pickup"], "moves":["tackle", "growl", "tailwhip"]}, {"generation": 3, "level": 5, "shiny": 1, "abilities":["pickup"], "moves":["tackle", "growl", "tailwhip", "extremespeed"]}, ], tier: "LC", }, linoone: { randomBattleMoves: ["bellydrum", "extremespeed", "seedbomb", "shadowclaw"], randomDoubleBattleMoves: ["bellydrum", "extremespeed", "seedbomb", "protect", "shadowclaw"], eventPokemon: [ {"generation": 6, "level": 50, "isHidden": false, "moves":["extremespeed", "helpinghand", "babydolleyes", "protect"], "pokeball": "cherishball"}, ], tier: "RU", }, wurmple: { randomBattleMoves: ["bugbite", "poisonsting", "tackle", "electroweb"], tier: "LC", }, silcoon: { randomBattleMoves: ["bugbite", "poisonsting", "tackle", "electroweb"], tier: "NFE", }, beautifly: { randomBattleMoves: ["quiverdance", "bugbuzz", "aircutter", "psychic", "gigadrain", "hiddenpowerrock"], randomDoubleBattleMoves: ["quiverdance", "bugbuzz", "gigadrain", "hiddenpowerrock", "aircutter", "tailwind", "stringshot", "protect"], tier: "PU", }, cascoon: { randomBattleMoves: ["bugbite", "poisonsting", "tackle", "electroweb"], tier: "NFE", }, dustox: { randomBattleMoves: ["roost", "defog", "bugbuzz", "sludgebomb", "quiverdance", "uturn", "shadowball"], randomDoubleBattleMoves: ["tailwind", "stringshot", "strugglebug", "bugbuzz", "protect", "sludgebomb", "quiverdance", "shadowball"], tier: "PU", }, lotad: { randomBattleMoves: ["gigadrain", "icebeam", "scald", "naturepower", "raindance"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["astonish", "growl", "absorb"]}, ], tier: "LC", }, lombre: { randomBattleMoves: ["fakeout", "swordsdance", "waterfall", "seedbomb", "icepunch", "firepunch", "thunderpunch", "poweruppunch", "gigadrain", "icebeam"], tier: "NFE", }, ludicolo: { randomBattleMoves: ["raindance", "hydropump", "scald", "gigadrain", "icebeam", "focusblast"], randomDoubleBattleMoves: ["raindance", "hydropump", "surf", "gigadrain", "icebeam", "fakeout", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "abilities":["swiftswim"], "moves":["fakeout", "hydropump", "icebeam", "gigadrain"], "pokeball": "cherishball"}, {"generation": 5, "level": 30, "gender": "M", "nature": "Calm", "isHidden": false, "abilities":["swiftswim"], "moves":["scald", "gigadrain", "icebeam", "sunnyday"]}, ], tier: "PU", }, seedot: { randomBattleMoves: ["defog", "naturepower", "seedbomb", "explosion", "foulplay"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["bide", "harden", "growth"]}, {"generation": 3, "level": 17, "moves":["refresh", "gigadrain", "bulletseed", "secretpower"]}, ], tier: "LC", }, nuzleaf: { randomBattleMoves: ["naturepower", "seedbomb", "explosion", "swordsdance", "rockslide", "lowsweep"], tier: "NFE", }, shiftry: { randomBattleMoves: ["leafstorm", "swordsdance", "leafblade", "suckerpunch", "defog", "lowkick", "knockoff"], randomDoubleBattleMoves: ["leafstorm", "swordsdance", "leafblade", "suckerpunch", "knockoff", "lowkick", "fakeout", "protect"], tier: "PU", }, taillow: { randomBattleMoves: ["bravebird", "facade", "quickattack", "uturn", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["peck", "growl", "focusenergy", "featherdance"]}, ], tier: "LC", }, swellow: { randomBattleMoves: ["protect", "facade", "bravebird", "uturn", "quickattack"], randomDoubleBattleMoves: ["bravebird", "facade", "quickattack", "uturn", "protect"], eventPokemon: [ {"generation": 3, "level": 43, "moves":["batonpass", "skyattack", "agility", "facade"]}, ], tier: "RU", }, wingull: { randomBattleMoves: ["scald", "icebeam", "tailwind", "uturn", "airslash", "knockoff", "defog"], tier: "LC", }, pelipper: { randomBattleMoves: ["scald", "uturn", "hurricane", "toxic", "roost", "defog", "knockoff"], randomDoubleBattleMoves: ["scald", "surf", "hurricane", "wideguard", "protect", "tailwind", "knockoff"], tier: "OU", }, ralts: { randomBattleMoves: ["trickroom", "destinybond", "psychic", "willowisp", "hypnosis", "dazzlinggleam", "substitute", "trick"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["growl", "wish"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["growl", "charm"]}, {"generation": 3, "level": 20, "moves":["sing", "shockwave", "reflect", "confusion"]}, {"generation": 6, "level": 1, "isHidden": true, "moves":["growl", "encore"]}, ], tier: "LC", }, kirlia: { randomBattleMoves: ["trick", "dazzlinggleam", "psychic", "willowisp", "signalbeam", "thunderbolt", "destinybond", "substitute"], tier: "NFE", }, gardevoir: { randomBattleMoves: ["psychic", "thunderbolt", "focusblast", "shadowball", "moonblast", "calmmind", "substitute", "willowisp"], randomDoubleBattleMoves: ["psyshock", "focusblast", "shadowball", "moonblast", "taunt", "willowisp", "thunderbolt", "trickroom", "helpinghand", "protect", "dazzlinggleam"], eventPokemon: [ {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "abilities":["trace"], "moves":["hypnosis", "thunderbolt", "focusblast", "psychic"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": true, "gender": "F", "isHidden": false, "abilities":["synchronize"], "moves":["dazzlinggleam", "moonblast", "storedpower", "calmmind"], "pokeball": "cherishball"}, ], tier: "RU", }, gardevoirmega: { randomBattleMoves: ["calmmind", "hypervoice", "psyshock", "focusblast", "substitute", "taunt", "willowisp"], randomDoubleBattleMoves: ["psyshock", "focusblast", "shadowball", "calmmind", "thunderbolt", "hypervoice", "protect"], requiredItem: "Gardevoirite", tier: "UU", }, gallade: { randomBattleMoves: ["bulkup", "drainpunch", "icepunch", "shadowsneak", "closecombat", "zenheadbutt", "knockoff", "trick"], randomDoubleBattleMoves: ["closecombat", "trick", "stoneedge", "shadowsneak", "drainpunch", "icepunch", "zenheadbutt", "knockoff", "trickroom", "protect", "helpinghand"], tier: "BL4", }, gallademega: { randomBattleMoves: ["swordsdance", "closecombat", "drainpunch", "knockoff", "zenheadbutt", "substitute"], randomDoubleBattleMoves: ["closecombat", "stoneedge", "drainpunch", "icepunch", "zenheadbutt", "swordsdance", "knockoff", "protect"], requiredItem: "Galladite", tier: "BL", }, surskit: { randomBattleMoves: ["hydropump", "signalbeam", "hiddenpowerfire", "stickyweb", "gigadrain", "powersplit"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["bubble", "mudsport"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["bubble", "quickattack"]}, ], tier: "LC", }, masquerain: { randomBattleMoves: ["quiverdance", "bugbuzz", "airslash", "hydropump", "roost", "batonpass", "stickyweb"], randomDoubleBattleMoves: ["hydropump", "bugbuzz", "airslash", "quiverdance", "tailwind", "roost", "strugglebug", "protect"], tier: "PU", }, shroomish: { randomBattleMoves: ["spore", "substitute", "leechseed", "gigadrain", "protect", "toxic", "stunspore"], eventPokemon: [ {"generation": 3, "level": 15, "abilities":["effectspore"], "moves":["refresh", "falseswipe", "megadrain", "stunspore"]}, ], tier: "LC", }, breloom: { randomBattleMoves: ["spore", "machpunch", "bulletseed", "rocktomb", "swordsdance"], randomDoubleBattleMoves: ["spore", "helpinghand", "machpunch", "bulletseed", "rocktomb", "protect", "drainpunch"], tier: "BL", }, slakoth: { randomBattleMoves: ["doubleedge", "hammerarm", "firepunch", "counter", "retaliate", "toxic"], tier: "LC", }, vigoroth: { randomBattleMoves: ["bulkup", "return", "earthquake", "firepunch", "suckerpunch", "slackoff", "icepunch", "lowkick"], tier: "NFE", }, slaking: { randomBattleMoves: ["earthquake", "pursuit", "nightslash", "doubleedge", "retaliate"], randomDoubleBattleMoves: ["earthquake", "nightslash", "doubleedge", "retaliate", "hammerarm", "rockslide"], eventPokemon: [ {"generation": 4, "level": 50, "gender": "M", "nature": "Adamant", "moves":["gigaimpact", "return", "shadowclaw", "aerialace"], "pokeball": "cherishball"}, ], tier: "PU", }, nincada: { randomBattleMoves: ["xscissor", "dig", "aerialace", "nightslash"], tier: "LC", }, ninjask: { randomBattleMoves: ["batonpass", "swordsdance", "substitute", "protect", "leechlife"], randomDoubleBattleMoves: ["batonpass", "swordsdance", "substitute", "protect", "leechlife", "aerialace"], tier: "PU", }, shedinja: { randomBattleMoves: ["swordsdance", "willowisp", "xscissor", "shadowsneak", "shadowclaw", "batonpass"], randomDoubleBattleMoves: ["swordsdance", "willowisp", "xscissor", "shadowsneak", "shadowclaw", "protect"], eventPokemon: [ {"generation": 3, "level": 50, "moves":["spite", "confuseray", "shadowball", "grudge"]}, {"generation": 3, "level": 20, "shiny": 1, "moves":["doubleteam", "furycutter", "screech"]}, {"generation": 3, "level": 25, "shiny": 1, "moves":["swordsdance"]}, {"generation": 3, "level": 31, "shiny": 1, "moves":["slash"]}, {"generation": 3, "level": 38, "shiny": 1, "moves":["agility"]}, {"generation": 3, "level": 45, "shiny": 1, "moves":["batonpass"]}, {"generation": 4, "level": 52, "shiny": 1, "moves":["xscissor"]}, ], tier: "PU", }, whismur: { randomBattleMoves: ["hypervoice", "fireblast", "shadowball", "icebeam", "extrasensory"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["pound", "uproar", "teeterdance"]}, ], tier: "LC", }, loudred: { randomBattleMoves: ["hypervoice", "fireblast", "shadowball", "icebeam", "circlethrow", "bodyslam"], tier: "NFE", }, exploud: { randomBattleMoves: ["boomburst", "fireblast", "icebeam", "surf", "focusblast"], randomDoubleBattleMoves: ["boomburst", "fireblast", "icebeam", "surf", "focusblast", "protect", "hypervoice"], eventPokemon: [ {"generation": 3, "level": 100, "moves":["roar", "rest", "sleeptalk", "hypervoice"]}, {"generation": 3, "level": 50, "moves":["stomp", "screech", "hyperbeam", "roar"]}, ], tier: "BL3", }, makuhita: { randomBattleMoves: ["crosschop", "bulletpunch", "closecombat", "icepunch", "bulkup", "fakeout", "earthquake"], eventPokemon: [ {"generation": 3, "level": 18, "moves":["refresh", "brickbreak", "armthrust", "rocktomb"]}, ], tier: "LC", }, hariyama: { randomBattleMoves: ["bulletpunch", "closecombat", "icepunch", "stoneedge", "bulkup", "knockoff"], randomDoubleBattleMoves: ["bulletpunch", "closecombat", "icepunch", "stoneedge", "fakeout", "knockoff", "helpinghand", "wideguard", "protect"], tier: "BL4", }, nosepass: { randomBattleMoves: ["powergem", "thunderwave", "stealthrock", "painsplit", "explosion", "voltswitch"], eventPokemon: [ {"generation": 3, "level": 26, "moves":["helpinghand", "thunderbolt", "thunderwave", "rockslide"]}, ], tier: "LC", }, probopass: { randomBattleMoves: ["stealthrock", "thunderwave", "toxic", "flashcannon", "powergem", "voltswitch", "painsplit"], randomDoubleBattleMoves: ["stealthrock", "thunderwave", "helpinghand", "earthpower", "powergem", "wideguard", "protect", "flashcannon"], tier: "PU", }, skitty: { randomBattleMoves: ["doubleedge", "zenheadbutt", "thunderwave", "fakeout", "playrough", "healbell"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "abilities":["cutecharm"], "moves":["tackle", "growl", "tailwhip", "payday"]}, {"generation": 3, "level": 5, "shiny": 1, "abilities":["cutecharm"], "moves":["growl", "tackle", "tailwhip", "rollout"]}, {"generation": 3, "level": 10, "gender": "M", "abilities":["cutecharm"], "moves":["growl", "tackle", "tailwhip", "attract"]}, ], tier: "LC", }, delcatty: { randomBattleMoves: ["doubleedge", "suckerpunch", "wildcharge", "fakeout", "thunderwave", "healbell"], randomDoubleBattleMoves: ["doubleedge", "suckerpunch", "playrough", "wildcharge", "fakeout", "thunderwave", "protect", "helpinghand"], eventPokemon: [ {"generation": 3, "level": 18, "abilities":["cutecharm"], "moves":["sweetkiss", "secretpower", "attract", "shockwave"]}, ], tier: "PU", }, sableye: { randomBattleMoves: ["recover", "willowisp", "taunt", "toxic", "knockoff", "foulplay"], randomDoubleBattleMoves: ["recover", "willowisp", "taunt", "fakeout", "knockoff", "foulplay", "helpinghand", "snarl", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "abilities":["keeneye"], "moves":["leer", "scratch", "foresight", "nightshade"]}, {"generation": 3, "level": 33, "abilities":["keeneye"], "moves":["helpinghand", "shadowball", "feintattack", "recover"]}, {"generation": 5, "level": 50, "gender": "M", "isHidden": true, "moves":["foulplay", "octazooka", "tickle", "trick"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "nature": "Relaxed", "ivs": {"hp": 31, "spa": 31}, "isHidden": true, "moves":["calmmind", "willowisp", "recover", "shadowball"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "nature": "Bold", "isHidden": true, "moves":["willowisp", "recover", "taunt", "shockwave"], "pokeball": "cherishball"}, ], tier: "PU", }, sableyemega: { randomBattleMoves: ["recover", "willowisp", "darkpulse", "calmmind", "shadowball"], randomDoubleBattleMoves: ["fakeout", "knockoff", "darkpulse", "shadowball", "willowisp", "protect"], requiredItem: "Sablenite", tier: "OU", }, mawile: { randomBattleMoves: ["swordsdance", "ironhead", "substitute", "playrough", "suckerpunch", "batonpass"], randomDoubleBattleMoves: ["swordsdance", "ironhead", "firefang", "substitute", "playrough", "suckerpunch", "knockoff", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["astonish", "faketears"]}, {"generation": 3, "level": 22, "moves":["sing", "falseswipe", "vicegrip", "irondefense"]}, {"generation": 6, "level": 50, "isHidden": false, "abilities":["intimidate"], "moves":["ironhead", "playrough", "firefang", "suckerpunch"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "isHidden": false, "abilities":["intimidate"], "moves":["suckerpunch", "protect", "playrough", "ironhead"], "pokeball": "cherishball"}, ], tier: "PU", }, mawilemega: { randomBattleMoves: ["swordsdance", "ironhead", "firefang", "substitute", "playrough", "suckerpunch", "knockoff", "focuspunch"], randomDoubleBattleMoves: ["swordsdance", "ironhead", "firefang", "substitute", "playrough", "suckerpunch", "knockoff", "protect"], requiredItem: "Mawilite", tier: "OU", }, aron: { randomBattleMoves: ["headsmash", "ironhead", "earthquake", "superpower", "stealthrock", "endeavor"], tier: "LC", }, lairon: { randomBattleMoves: ["headsmash", "ironhead", "earthquake", "superpower", "stealthrock"], tier: "NFE", }, aggron: { randomBattleMoves: ["autotomize", "headsmash", "earthquake", "lowkick", "heavyslam", "aquatail", "stealthrock"], randomDoubleBattleMoves: ["rockslide", "headsmash", "earthquake", "lowkick", "heavyslam", "aquatail", "stealthrock", "protect"], eventPokemon: [ {"generation": 3, "level": 100, "moves":["irontail", "protect", "metalsound", "doubleedge"]}, {"generation": 3, "level": 50, "moves":["takedown", "irontail", "protect", "metalsound"]}, {"generation": 6, "level": 50, "nature": "Brave", "isHidden": false, "abilities":["rockhead"], "moves":["ironhead", "earthquake", "headsmash", "rockslide"], "pokeball": "cherishball"}, ], tier: "PU", }, aggronmega: { randomBattleMoves: ["earthquake", "heavyslam", "icepunch", "stealthrock", "thunderwave", "roar", "toxic"], randomDoubleBattleMoves: ["rockslide", "earthquake", "lowkick", "heavyslam", "aquatail", "protect"], requiredItem: "Aggronite", tier: "UU", }, meditite: { randomBattleMoves: ["highjumpkick", "psychocut", "icepunch", "thunderpunch", "trick", "fakeout", "bulletpunch", "drainpunch", "zenheadbutt"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["bide", "meditate", "confusion"]}, {"generation": 3, "level": 20, "moves":["dynamicpunch", "confusion", "shadowball", "detect"]}, ], tier: "LC Uber", }, medicham: { randomBattleMoves: ["highjumpkick", "drainpunch", "zenheadbutt", "icepunch", "bulletpunch"], randomDoubleBattleMoves: ["highjumpkick", "drainpunch", "zenheadbutt", "icepunch", "bulletpunch", "protect", "fakeout"], tier: "BL4", }, medichammega: { randomBattleMoves: ["highjumpkick", "drainpunch", "icepunch", "fakeout", "zenheadbutt"], randomDoubleBattleMoves: ["highjumpkick", "drainpunch", "zenheadbutt", "icepunch", "bulletpunch", "protect", "fakeout"], requiredItem: "Medichamite", tier: "OU", }, electrike: { randomBattleMoves: ["voltswitch", "thunderbolt", "hiddenpowerice", "switcheroo", "flamethrower", "hiddenpowergrass"], tier: "LC", }, manectric: { randomBattleMoves: ["voltswitch", "thunderbolt", "hiddenpowerice", "hiddenpowergrass", "overheat", "flamethrower"], randomDoubleBattleMoves: ["voltswitch", "thunderbolt", "hiddenpowerice", "hiddenpowergrass", "overheat", "flamethrower", "snarl", "protect"], eventPokemon: [ {"generation": 3, "level": 44, "moves":["refresh", "thunder", "raindance", "bite"]}, {"generation": 6, "level": 50, "nature": "Timid", "isHidden": false, "abilities":["lightningrod"], "moves":["overheat", "thunderbolt", "voltswitch", "protect"], "pokeball": "cherishball"}, ], tier: "PU", }, manectricmega: { randomBattleMoves: ["voltswitch", "thunderbolt", "hiddenpowerice", "hiddenpowergrass", "overheat"], randomDoubleBattleMoves: ["voltswitch", "thunderbolt", "hiddenpowerice", "hiddenpowergrass", "overheat", "flamethrower", "snarl", "protect"], requiredItem: "Manectite", tier: "UU", }, plusle: { randomBattleMoves: ["nastyplot", "thunderbolt", "substitute", "batonpass", "hiddenpowerice", "encore"], randomDoubleBattleMoves: ["nastyplot", "thunderbolt", "substitute", "protect", "hiddenpowerice", "encore", "helpinghand"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["growl", "thunderwave", "mudsport"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["growl", "thunderwave", "quickattack"]}, ], tier: "PU", }, minun: { randomBattleMoves: ["nastyplot", "thunderbolt", "substitute", "batonpass", "hiddenpowerice", "encore"], randomDoubleBattleMoves: ["nastyplot", "thunderbolt", "substitute", "protect", "hiddenpowerice", "encore", "helpinghand"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["growl", "thunderwave", "watersport"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["growl", "thunderwave", "quickattack"]}, ], tier: "PU", }, volbeat: { randomBattleMoves: ["tailglow", "batonpass", "substitute", "bugbuzz", "thunderwave", "encore", "tailwind"], randomDoubleBattleMoves: ["stringshot", "strugglebug", "helpinghand", "bugbuzz", "thunderwave", "encore", "tailwind", "protect"], tier: "PU", }, illumise: { randomBattleMoves: ["substitute", "batonpass", "bugbuzz", "encore", "thunderbolt", "tailwind", "uturn", "thunderwave"], randomDoubleBattleMoves: ["protect", "helpinghand", "bugbuzz", "encore", "thunderbolt", "tailwind", "uturn"], tier: "PU", }, budew: { randomBattleMoves: ["spikes", "sludgebomb", "sleeppowder", "gigadrain", "stunspore", "rest"], tier: "LC", }, roselia: { randomBattleMoves: ["spikes", "toxicspikes", "sleeppowder", "gigadrain", "stunspore", "rest", "sludgebomb", "synthesis"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["absorb", "growth", "poisonsting"]}, {"generation": 3, "level": 22, "moves":["sweetkiss", "magicalleaf", "leechseed", "grasswhistle"]}, ], tier: "NFE", }, roserade: { randomBattleMoves: ["sludgebomb", "gigadrain", "sleeppowder", "leafstorm", "spikes", "toxicspikes", "rest", "synthesis", "hiddenpowerfire"], randomDoubleBattleMoves: ["sludgebomb", "gigadrain", "sleeppowder", "leafstorm", "protect", "hiddenpowerfire"], tier: "RU", }, gulpin: { randomBattleMoves: ["stockpile", "sludgebomb", "sludgewave", "icebeam", "toxic", "painsplit", "yawn", "encore"], eventPokemon: [ {"generation": 3, "level": 17, "moves":["sing", "shockwave", "sludge", "toxic"]}, ], tier: "LC", }, swalot: { randomBattleMoves: ["sludgebomb", "icebeam", "toxic", "yawn", "encore", "painsplit", "earthquake"], randomDoubleBattleMoves: ["sludgebomb", "icebeam", "protect", "yawn", "encore", "gunkshot", "earthquake"], tier: "PU", }, carvanha: { randomBattleMoves: ["protect", "hydropump", "icebeam", "waterfall", "crunch", "aquajet", "destinybond"], eventPokemon: [ {"generation": 3, "level": 15, "moves":["refresh", "waterpulse", "bite", "scaryface"]}, {"generation": 6, "level": 1, "isHidden": true, "moves":["leer", "bite", "hydropump"]}, ], tier: "LC", }, sharpedo: { randomBattleMoves: ["protect", "icebeam", "crunch", "earthquake", "waterfall"], randomDoubleBattleMoves: ["protect", "icebeam", "crunch", "earthquake", "waterfall"], eventPokemon: [ {"generation": 6, "level": 50, "nature": "Adamant", "isHidden": true, "moves":["aquajet", "crunch", "icefang", "destinybond"], "pokeball": "cherishball"}, {"generation": 6, "level": 43, "gender": "M", "perfectIVs": 2, "isHidden": false, "moves":["scaryface", "slash", "poisonfang", "crunch"], "pokeball": "cherishball"}, ], tier: "BL2", }, sharpedomega: { randomBattleMoves: ["protect", "crunch", "waterfall", "icefang", "psychicfangs", "destinybond"], randomDoubleBattleMoves: ["protect", "icefang", "crunch", "waterfall", "psychicfangs"], requiredItem: "Sharpedonite", tier: "UU", }, wailmer: { randomBattleMoves: ["waterspout", "surf", "hydropump", "icebeam", "hiddenpowergrass", "hiddenpowerelectric"], tier: "LC", }, wailord: { randomBattleMoves: ["waterspout", "hydropump", "icebeam", "hiddenpowergrass", "hiddenpowerfire"], randomDoubleBattleMoves: ["waterspout", "hydropump", "icebeam", "hiddenpowergrass", "hiddenpowerfire", "protect"], eventPokemon: [ {"generation": 3, "level": 100, "moves":["rest", "waterspout", "amnesia", "hydropump"]}, {"generation": 3, "level": 50, "moves":["waterpulse", "mist", "rest", "waterspout"]}, ], tier: "PU", }, numel: { randomBattleMoves: ["curse", "earthquake", "rockslide", "fireblast", "flamecharge", "rest", "sleeptalk", "stockpile", "hiddenpowerelectric", "earthpower", "lavaplume"], eventPokemon: [ {"generation": 3, "level": 14, "abilities":["oblivious"], "moves":["charm", "takedown", "dig", "ember"]}, {"generation": 6, "level": 1, "isHidden": false, "moves":["growl", "tackle", "ironhead"]}, ], tier: "LC", }, camerupt: { randomBattleMoves: ["rockpolish", "fireblast", "earthpower", "lavaplume", "stealthrock", "hiddenpowergrass", "roar", "stoneedge"], randomDoubleBattleMoves: ["rockpolish", "fireblast", "earthpower", "heatwave", "eruption", "hiddenpowergrass", "protect"], eventPokemon: [ {"generation": 6, "level": 43, "gender": "M", "perfectIVs": 2, "isHidden": false, "abilities":["solidrock"], "moves":["curse", "takedown", "rockslide", "yawn"], "pokeball": "cherishball"}, ], tier: "PU", }, cameruptmega: { randomBattleMoves: ["stealthrock", "fireblast", "earthpower", "ancientpower", "willowisp", "toxic"], randomDoubleBattleMoves: ["fireblast", "earthpower", "heatwave", "eruption", "rockslide", "protect"], requiredItem: "Cameruptite", tier: "RU", }, torkoal: { randomBattleMoves: ["shellsmash", "fireblast", "earthpower", "solarbeam", "stealthrock", "rapidspin", "yawn", "lavaplume"], randomDoubleBattleMoves: ["protect", "heatwave", "earthpower", "willowisp", "shellsmash", "fireblast", "solarbeam"], tier: "RU", }, spoink: { randomBattleMoves: ["psychic", "reflect", "lightscreen", "thunderwave", "trick", "healbell", "calmmind", "hiddenpowerfighting", "shadowball"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "abilities":["owntempo"], "moves":["splash", "uproar"]}, ], tier: "LC", }, grumpig: { randomBattleMoves: ["psychic", "thunderwave", "healbell", "whirlwind", "toxic", "focusblast", "reflect", "lightscreen"], randomDoubleBattleMoves: ["psychic", "psyshock", "thunderwave", "trickroom", "taunt", "protect", "focusblast", "reflect", "lightscreen"], tier: "PU", }, spinda: { randomBattleMoves: ["return", "superpower", "suckerpunch", "trickroom"], randomDoubleBattleMoves: ["doubleedge", "return", "superpower", "suckerpunch", "trickroom", "fakeout", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["tackle", "uproar", "sing"]}, ], tier: "PU", }, trapinch: { randomBattleMoves: ["earthquake", "rockslide", "crunch", "quickattack", "superpower"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": true, "isHidden": false, "moves":["bite"]}, ], tier: "LC", }, vibrava: { randomBattleMoves: ["substitute", "earthquake", "outrage", "roost", "uturn", "superpower", "defog"], tier: "NFE", }, flygon: { randomBattleMoves: ["earthquake", "outrage", "uturn", "roost", "defog", "firepunch", "dragondance"], randomDoubleBattleMoves: ["earthquake", "protect", "dragonclaw", "uturn", "rockslide", "firepunch", "fireblast", "tailwind", "dragondance"], eventPokemon: [ {"generation": 3, "level": 45, "moves":["sandtomb", "crunch", "dragonbreath", "screech"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Naive", "moves":["dracometeor", "uturn", "earthquake", "dragonclaw"], "pokeball": "cherishball"}, ], tier: "RU", }, cacnea: { randomBattleMoves: ["swordsdance", "spikes", "suckerpunch", "seedbomb", "drainpunch"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["poisonsting", "leer", "absorb", "encore"]}, ], tier: "LC", }, cacturne: { randomBattleMoves: ["swordsdance", "spikes", "suckerpunch", "seedbomb", "drainpunch", "substitute"], randomDoubleBattleMoves: ["swordsdance", "spikyshield", "suckerpunch", "seedbomb", "drainpunch", "substitute"], eventPokemon: [ {"generation": 3, "level": 45, "moves":["ingrain", "feintattack", "spikes", "needlearm"]}, ], tier: "PU", }, swablu: { randomBattleMoves: ["roost", "toxic", "cottonguard", "pluck", "hypervoice", "return"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["peck", "growl", "falseswipe"]}, {"generation": 5, "level": 1, "shiny": true, "isHidden": false, "moves":["peck", "growl"]}, {"generation": 6, "level": 1, "isHidden": true, "moves":["peck", "growl", "hypervoice"]}, ], tier: "LC", }, altaria: { randomBattleMoves: ["dragondance", "dracometeor", "outrage", "dragonclaw", "earthquake", "roost", "fireblast", "healbell"], randomDoubleBattleMoves: ["dragondance", "dracometeor", "protect", "dragonclaw", "earthquake", "fireblast", "tailwind"], eventPokemon: [ {"generation": 3, "level": 45, "moves":["takedown", "dragonbreath", "dragondance", "refresh"]}, {"generation": 3, "level": 36, "moves":["healbell", "dragonbreath", "solarbeam", "aerialace"]}, {"generation": 5, "level": 35, "gender": "M", "isHidden": true, "moves":["takedown", "naturalgift", "dragonbreath", "falseswipe"]}, {"generation": 6, "level": 100, "nature": "Modest", "isHidden": true, "moves":["hypervoice", "fireblast", "protect", "agility"], "pokeball": "cherishball"}, ], tier: "PU", }, altariamega: { randomBattleMoves: ["dragondance", "return", "hypervoice", "healbell", "earthquake", "roost", "dracometeor", "fireblast"], randomDoubleBattleMoves: ["dragondance", "return", "doubleedge", "dragonclaw", "earthquake", "protect", "fireblast"], requiredItem: "Altarianite", tier: "UU", }, zangoose: { randomBattleMoves: ["swordsdance", "closecombat", "knockoff", "quickattack", "facade"], randomDoubleBattleMoves: ["protect", "closecombat", "knockoff", "quickattack", "facade"], eventPokemon: [ {"generation": 3, "level": 18, "moves":["leer", "quickattack", "swordsdance", "furycutter"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["scratch", "leer", "quickattack", "swordsdance"]}, {"generation": 3, "level": 28, "moves":["refresh", "brickbreak", "counter", "crushclaw"]}, ], tier: "PU", }, seviper: { randomBattleMoves: ["flamethrower", "sludgewave", "gigadrain", "darkpulse", "switcheroo", "coil", "earthquake", "poisonjab", "suckerpunch"], randomDoubleBattleMoves: ["flamethrower", "gigadrain", "earthquake", "suckerpunch", "aquatail", "protect", "glare", "poisonjab", "sludgebomb"], eventPokemon: [ {"generation": 3, "level": 18, "moves":["wrap", "lick", "bite", "poisontail"]}, {"generation": 3, "level": 30, "moves":["poisontail", "screech", "glare", "crunch"]}, {"generation": 3, "level": 10, "gender": "M", "moves":["wrap", "lick", "bite"]}, ], tier: "PU", }, lunatone: { randomBattleMoves: ["psychic", "earthpower", "stealthrock", "rockpolish", "batonpass", "calmmind", "icebeam", "powergem", "moonlight", "toxic"], randomDoubleBattleMoves: ["psychic", "earthpower", "rockpolish", "calmmind", "helpinghand", "icebeam", "powergem", "moonlight", "trickroom", "protect"], eventPokemon: [ {"generation": 3, "level": 10, "moves":["tackle", "harden", "confusion"]}, {"generation": 3, "level": 25, "moves":["batonpass", "psychic", "raindance", "rocktomb"]}, {"generation": 7, "level": 30, "moves":["cosmicpower", "hiddenpower", "moonblast", "powergem"], "pokeball": "cherishball"}, ], tier: "PU", }, solrock: { randomBattleMoves: ["stealthrock", "explosion", "rockslide", "reflect", "lightscreen", "willowisp", "morningsun"], randomDoubleBattleMoves: ["protect", "helpinghand", "stoneedge", "zenheadbutt", "willowisp", "trickroom", "rockslide"], eventPokemon: [ {"generation": 3, "level": 10, "moves":["tackle", "harden", "confusion"]}, {"generation": 3, "level": 41, "moves":["batonpass", "psychic", "sunnyday", "cosmicpower"]}, {"generation": 7, "level": 30, "moves":["cosmicpower", "hiddenpower", "solarbeam", "stoneedge"], "pokeball": "cherishball"}, ], tier: "PU", }, barboach: { randomBattleMoves: ["dragondance", "waterfall", "earthquake", "return", "bounce"], tier: "LC", }, whiscash: { randomBattleMoves: ["dragondance", "waterfall", "earthquake", "stoneedge", "zenheadbutt"], randomDoubleBattleMoves: ["dragondance", "waterfall", "earthquake", "stoneedge", "zenheadbutt", "protect"], eventPokemon: [ {"generation": 4, "level": 51, "gender": "F", "nature": "Gentle", "abilities":["oblivious"], "moves":["earthquake", "aquatail", "zenheadbutt", "gigaimpact"], "pokeball": "cherishball"}, ], tier: "PU", }, corphish: { randomBattleMoves: ["dragondance", "waterfall", "crunch", "superpower", "swordsdance", "knockoff", "aquajet"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["bubble", "watersport"]}, ], tier: "LC", }, crawdaunt: { randomBattleMoves: ["dragondance", "crabhammer", "superpower", "swordsdance", "knockoff", "aquajet"], randomDoubleBattleMoves: ["dragondance", "crabhammer", "crunch", "superpower", "swordsdance", "knockoff", "aquajet", "protect"], eventPokemon: [ {"generation": 3, "level": 100, "moves":["taunt", "crabhammer", "swordsdance", "guillotine"]}, {"generation": 3, "level": 50, "moves":["knockoff", "taunt", "crabhammer", "swordsdance"]}, ], tier: "UU", }, baltoy: { randomBattleMoves: ["stealthrock", "earthquake", "toxic", "psychic", "reflect", "lightscreen", "icebeam", "rapidspin"], eventPokemon: [ {"generation": 3, "level": 17, "moves":["refresh", "rocktomb", "mudslap", "psybeam"]}, ], tier: "LC", }, claydol: { randomBattleMoves: ["stealthrock", "toxic", "psychic", "icebeam", "earthquake", "rapidspin"], randomDoubleBattleMoves: ["earthpower", "trickroom", "psychic", "icebeam", "earthquake", "protect"], tier: "NU", }, lileep: { randomBattleMoves: ["stealthrock", "recover", "ancientpower", "hiddenpowerfire", "gigadrain", "stockpile"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "moves":["recover", "rockslide", "constrict", "acid"], "pokeball": "cherishball"}, ], tier: "LC", }, cradily: { randomBattleMoves: ["stealthrock", "recover", "gigadrain", "toxic", "seedbomb", "rockslide", "curse"], randomDoubleBattleMoves: ["protect", "recover", "seedbomb", "rockslide", "earthquake", "curse", "swordsdance"], tier: "PU", }, anorith: { randomBattleMoves: ["stealthrock", "brickbreak", "toxic", "xscissor", "rockslide", "swordsdance", "rockpolish"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "moves":["harden", "mudsport", "watergun", "crosspoison"], "pokeball": "cherishball"}, ], tier: "LC", }, armaldo: { randomBattleMoves: ["stealthrock", "stoneedge", "toxic", "xscissor", "knockoff", "rapidspin", "earthquake"], randomDoubleBattleMoves: ["rockslide", "stoneedge", "stringshot", "xscissor", "swordsdance", "knockoff", "protect"], tier: "PU", }, feebas: { randomBattleMoves: ["protect", "confuseray", "hypnosis", "scald", "toxic"], eventPokemon: [ {"generation": 4, "level": 5, "gender": "F", "nature": "Calm", "moves":["splash", "mirrorcoat"], "pokeball": "cherishball"}, ], tier: "LC", }, milotic: { randomBattleMoves: ["recover", "scald", "toxic", "icebeam", "dragontail", "rest", "sleeptalk"], randomDoubleBattleMoves: ["recover", "scald", "hydropump", "icebeam", "dragontail", "hypnosis", "protect", "hiddenpowergrass"], eventPokemon: [ {"generation": 3, "level": 35, "moves":["waterpulse", "twister", "recover", "raindance"]}, {"generation": 4, "level": 50, "gender": "F", "nature": "Bold", "moves":["recover", "raindance", "icebeam", "hydropump"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "shiny": true, "gender": "M", "nature": "Timid", "moves":["raindance", "recover", "hydropump", "icywind"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "moves":["recover", "hydropump", "icebeam", "mirrorcoat"], "pokeball": "cherishball"}, {"generation": 5, "level": 58, "gender": "M", "nature": "Lax", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "moves":["recover", "surf", "icebeam", "toxic"], "pokeball": "cherishball"}, ], tier: "RU", }, castform: { tier: "PU", }, castformsunny: { randomBattleMoves: ["sunnyday", "weatherball", "solarbeam", "icebeam"], battleOnly: true, }, castformrainy: { randomBattleMoves: ["raindance", "weatherball", "thunder", "hurricane"], battleOnly: true, }, castformsnowy: { battleOnly: true, }, kecleon: { randomBattleMoves: ["fakeout", "knockoff", "drainpunch", "suckerpunch", "shadowsneak", "stealthrock", "recover"], randomDoubleBattleMoves: ["knockoff", "fakeout", "trickroom", "recover", "drainpunch", "suckerpunch", "shadowsneak", "protect"], tier: "PU", }, shuppet: { randomBattleMoves: ["trickroom", "destinybond", "taunt", "shadowsneak", "suckerpunch", "willowisp"], eventPokemon: [ {"generation": 3, "level": 45, "abilities":["insomnia"], "moves":["spite", "willowisp", "feintattack", "shadowball"]}, ], tier: "LC", }, banette: { randomBattleMoves: ["destinybond", "taunt", "shadowclaw", "suckerpunch", "willowisp", "shadowsneak", "knockoff"], randomDoubleBattleMoves: ["shadowclaw", "suckerpunch", "willowisp", "shadowsneak", "knockoff", "protect"], eventPokemon: [ {"generation": 3, "level": 37, "abilities":["insomnia"], "moves":["helpinghand", "feintattack", "shadowball", "curse"]}, {"generation": 5, "level": 37, "gender": "F", "isHidden": true, "moves":["feintattack", "hex", "shadowball", "cottonguard"]}, ], tier: "PU", }, banettemega: { randomBattleMoves: ["destinybond", "taunt", "shadowclaw", "suckerpunch", "willowisp", "knockoff"], randomDoubleBattleMoves: ["destinybond", "taunt", "shadowclaw", "suckerpunch", "willowisp", "knockoff", "protect"], requiredItem: "Banettite", tier: "RU", }, duskull: { randomBattleMoves: ["willowisp", "shadowsneak", "painsplit", "substitute", "nightshade", "destinybond", "trickroom"], eventPokemon: [ {"generation": 3, "level": 45, "moves":["pursuit", "curse", "willowisp", "meanlook"]}, {"generation": 3, "level": 19, "moves":["helpinghand", "shadowball", "astonish", "confuseray"]}, ], tier: "LC", }, dusclops: { randomBattleMoves: ["willowisp", "shadowsneak", "icebeam", "painsplit", "substitute", "seismictoss", "toxic", "trickroom"], tier: "NFE", }, dusknoir: { randomBattleMoves: ["willowisp", "shadowsneak", "icepunch", "painsplit", "substitute", "earthquake", "focuspunch"], randomDoubleBattleMoves: ["willowisp", "shadowsneak", "icepunch", "painsplit", "protect", "earthquake", "helpinghand", "trickroom"], tier: "PU", }, tropius: { randomBattleMoves: ["leechseed", "substitute", "airslash", "gigadrain", "toxic", "protect"], randomDoubleBattleMoves: ["leechseed", "protect", "airslash", "gigadrain", "earthquake", "hiddenpowerfire", "tailwind", "sunnyday", "roost"], eventPokemon: [ {"generation": 4, "level": 53, "gender": "F", "nature": "Jolly", "abilities":["chlorophyll"], "moves":["airslash", "synthesis", "sunnyday", "solarbeam"], "pokeball": "cherishball"}, ], tier: "PU", }, chingling: { randomBattleMoves: ["hypnosis", "reflect", "lightscreen", "toxic", "recover", "psychic", "signalbeam", "healbell"], tier: "LC", }, chimecho: { randomBattleMoves: ["psychic", "yawn", "recover", "calmmind", "shadowball", "healingwish", "healbell", "taunt"], randomDoubleBattleMoves: ["protect", "psychic", "thunderwave", "recover", "shadowball", "dazzlinggleam", "trickroom", "helpinghand", "taunt"], eventPokemon: [ {"generation": 3, "level": 10, "gender": "M", "moves":["wrap", "growl", "astonish"]}, ], tier: "PU", }, absol: { randomBattleMoves: ["swordsdance", "suckerpunch", "knockoff", "superpower", "pursuit", "playrough"], randomDoubleBattleMoves: ["swordsdance", "suckerpunch", "knockoff", "fireblast", "superpower", "protect", "playrough"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "abilities":["pressure"], "moves":["scratch", "leer", "wish"]}, {"generation": 3, "level": 5, "shiny": 1, "abilities":["pressure"], "moves":["scratch", "leer", "spite"]}, {"generation": 3, "level": 35, "abilities":["pressure"], "moves":["razorwind", "bite", "swordsdance", "spite"]}, {"generation": 3, "level": 70, "abilities":["pressure"], "moves":["doubleteam", "slash", "futuresight", "perishsong"]}, ], tier: "PU", }, absolmega: { randomBattleMoves: ["swordsdance", "suckerpunch", "knockoff", "fireblast", "superpower", "pursuit", "playrough", "icebeam"], randomDoubleBattleMoves: ["swordsdance", "suckerpunch", "knockoff", "fireblast", "superpower", "protect", "playrough"], requiredItem: "Absolite", tier: "BL2", }, snorunt: { randomBattleMoves: ["spikes", "icebeam", "iceshard", "shadowball", "toxic"], eventPokemon: [ {"generation": 3, "level": 20, "abilities":["innerfocus"], "moves":["sing", "waterpulse", "bite", "icywind"]}, ], tier: "LC", }, glalie: { randomBattleMoves: ["spikes", "icebeam", "iceshard", "taunt", "earthquake", "explosion", "superfang"], randomDoubleBattleMoves: ["icebeam", "iceshard", "taunt", "earthquake", "freezedry", "protect"], tier: "PU", }, glaliemega: { randomBattleMoves: ["freezedry", "iceshard", "earthquake", "explosion", "return", "spikes"], randomDoubleBattleMoves: ["crunch", "iceshard", "freezedry", "earthquake", "explosion", "protect", "return"], requiredItem: "Glalitite", tier: "RU", }, froslass: { randomBattleMoves: ["icebeam", "spikes", "destinybond", "shadowball", "taunt", "thunderwave"], randomDoubleBattleMoves: ["icebeam", "protect", "destinybond", "shadowball", "taunt", "thunderwave"], tier: "NU", }, spheal: { randomBattleMoves: ["substitute", "protect", "toxic", "surf", "icebeam", "yawn", "superfang"], eventPokemon: [ {"generation": 3, "level": 17, "abilities":["thickfat"], "moves":["charm", "aurorabeam", "watergun", "mudslap"]}, ], tier: "LC", }, sealeo: { randomBattleMoves: ["substitute", "protect", "toxic", "surf", "icebeam", "yawn", "superfang"], tier: "NFE", }, walrein: { randomBattleMoves: ["superfang", "protect", "toxic", "surf", "icebeam", "roar"], randomDoubleBattleMoves: ["protect", "icywind", "surf", "icebeam", "superfang", "roar"], eventPokemon: [ {"generation": 5, "level": 50, "isHidden": false, "abilities":["thickfat"], "moves":["icebeam", "brine", "hail", "sheercold"], "pokeball": "cherishball"}, ], tier: "PU", }, clamperl: { randomBattleMoves: ["shellsmash", "icebeam", "surf", "hiddenpowergrass", "hiddenpowerelectric", "substitute"], tier: "LC", }, huntail: { randomBattleMoves: ["shellsmash", "waterfall", "icebeam", "batonpass", "suckerpunch"], randomDoubleBattleMoves: ["shellsmash", "waterfall", "icefang", "batonpass", "suckerpunch", "protect"], tier: "PU", }, gorebyss: { randomBattleMoves: ["shellsmash", "batonpass", "hydropump", "icebeam", "hiddenpowergrass", "substitute"], randomDoubleBattleMoves: ["shellsmash", "batonpass", "surf", "icebeam", "hiddenpowergrass", "substitute", "protect"], tier: "PU", }, relicanth: { randomBattleMoves: ["headsmash", "waterfall", "earthquake", "doubleedge", "stealthrock", "toxic"], randomDoubleBattleMoves: ["headsmash", "waterfall", "earthquake", "doubleedge", "rockslide", "protect"], tier: "PU", }, luvdisc: { randomBattleMoves: ["icebeam", "toxic", "sweetkiss", "protect", "scald"], randomDoubleBattleMoves: ["icebeam", "toxic", "sweetkiss", "protect", "scald", "icywind", "healpulse"], tier: "PU", }, bagon: { randomBattleMoves: ["outrage", "dragondance", "firefang", "rockslide", "dragonclaw"], eventPokemon: [ {"generation": 3, "level": 5, "shiny": 1, "moves":["rage", "bite", "wish"]}, {"generation": 3, "level": 5, "shiny": 1, "moves":["rage", "bite", "irondefense"]}, {"generation": 5, "level": 1, "shiny": true, "isHidden": false, "moves":["rage"]}, {"generation": 6, "level": 1, "isHidden": false, "moves":["rage", "thrash"]}, ], tier: "LC", }, shelgon: { randomBattleMoves: ["outrage", "brickbreak", "dragonclaw", "dragondance", "crunch", "zenheadbutt"], tier: "NFE", }, salamence: { randomBattleMoves: ["outrage", "fireblast", "earthquake", "dracometeor", "dragondance", "dragonclaw", "fly"], randomDoubleBattleMoves: ["protect", "fireblast", "earthquake", "dracometeor", "tailwind", "dragondance", "dragonclaw", "hydropump", "rockslide"], eventPokemon: [ {"generation": 3, "level": 50, "moves":["protect", "dragonbreath", "scaryface", "fly"]}, {"generation": 3, "level": 50, "moves":["refresh", "dragonclaw", "dragondance", "aerialace"]}, {"generation": 4, "level": 50, "gender": "M", "nature": "Naughty", "moves":["hydropump", "stoneedge", "fireblast", "dragonclaw"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "moves":["dragondance", "dragonclaw", "outrage", "aerialace"], "pokeball": "cherishball"}, ], tier: "BL", }, salamencemega: { randomBattleMoves: ["doubleedge", "return", "fireblast", "earthquake", "dracometeor", "roost", "dragondance"], randomDoubleBattleMoves: ["doubleedge", "return", "fireblast", "earthquake", "dracometeor", "protect", "dragondance", "dragonclaw"], requiredItem: "Salamencite", tier: "Uber", }, beldum: { randomBattleMoves: ["ironhead", "zenheadbutt", "headbutt", "irondefense"], eventPokemon: [ {"generation": 6, "level": 5, "shiny": true, "isHidden": false, "moves":["holdback", "ironhead", "zenheadbutt", "irondefense"], "pokeball": "cherishball"}, ], tier: "LC", }, metang: { randomBattleMoves: ["stealthrock", "meteormash", "toxic", "earthquake", "bulletpunch", "zenheadbutt"], eventPokemon: [ {"generation": 3, "level": 30, "moves":["takedown", "confusion", "metalclaw", "refresh"]}, ], tier: "NFE", }, metagross: { randomBattleMoves: ["meteormash", "earthquake", "agility", "stealthrock", "zenheadbutt", "bulletpunch", "thunderpunch", "explosion", "icepunch"], randomDoubleBattleMoves: ["meteormash", "earthquake", "protect", "zenheadbutt", "bulletpunch", "thunderpunch", "explosion", "icepunch", "hammerarm"], eventPokemon: [ {"generation": 4, "level": 62, "nature": "Brave", "moves":["bulletpunch", "meteormash", "hammerarm", "zenheadbutt"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "shiny": 1, "isHidden": false, "moves":["meteormash", "earthquake", "bulletpunch", "hammerarm"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "isHidden": false, "moves":["bulletpunch", "zenheadbutt", "hammerarm", "icepunch"], "pokeball": "cherishball"}, {"generation": 5, "level": 45, "isHidden": false, "moves":["earthquake", "zenheadbutt", "protect", "meteormash"]}, {"generation": 5, "level": 45, "isHidden": true, "moves":["irondefense", "agility", "hammerarm", "doubleedge"]}, {"generation": 5, "level": 45, "isHidden": true, "moves":["psychic", "meteormash", "hammerarm", "doubleedge"]}, {"generation": 5, "level": 58, "nature": "Serious", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "moves":["earthquake", "hyperbeam", "psychic", "meteormash"], "pokeball": "cherishball"}, ], tier: "UU", }, metagrossmega: { randomBattleMoves: ["meteormash", "earthquake", "agility", "zenheadbutt", "hammerarm", "icepunch"], randomDoubleBattleMoves: ["meteormash", "earthquake", "protect", "zenheadbutt", "thunderpunch", "icepunch"], requiredItem: "Metagrossite", tier: "Uber", }, regirock: { randomBattleMoves: ["stealthrock", "thunderwave", "stoneedge", "drainpunch", "curse", "rest", "rockslide", "toxic"], randomDoubleBattleMoves: ["stealthrock", "thunderwave", "stoneedge", "drainpunch", "curse", "rockslide", "protect"], eventPokemon: [ {"generation": 3, "level": 40, "shiny": 1, "moves":["rockthrow", "curse", "superpower", "ancientpower"]}, {"generation": 3, "level": 40, "moves":["curse", "superpower", "ancientpower", "hyperbeam"]}, {"generation": 4, "level": 30, "shiny": 1, "moves":["stomp", "rockthrow", "curse", "superpower"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["irondefense", "chargebeam", "lockon", "zapcannon"]}, {"generation": 6, "level": 40, "shiny": 1, "isHidden": false, "moves":["bulldoze", "curse", "ancientpower", "irondefense"]}, {"generation": 6, "level": 50, "isHidden": true, "moves":["explosion", "icepunch", "stoneedge", "hammerarm"]}, ], eventOnly: true, tier: "PU", }, regice: { randomBattleMoves: ["thunderwave", "icebeam", "thunderbolt", "rest", "sleeptalk", "focusblast", "rockpolish"], randomDoubleBattleMoves: ["thunderwave", "icebeam", "thunderbolt", "icywind", "protect", "focusblast", "rockpolish"], eventPokemon: [ {"generation": 3, "level": 40, "shiny": 1, "moves":["icywind", "curse", "superpower", "ancientpower"]}, {"generation": 3, "level": 40, "moves":["curse", "superpower", "ancientpower", "hyperbeam"]}, {"generation": 4, "level": 30, "shiny": 1, "moves":["stomp", "icywind", "curse", "superpower"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["amnesia", "chargebeam", "lockon", "zapcannon"]}, {"generation": 6, "level": 40, "shiny": 1, "isHidden": false, "moves":["bulldoze", "curse", "ancientpower", "amnesia"]}, {"generation": 6, "level": 50, "isHidden": true, "moves":["thunderbolt", "amnesia", "icebeam", "hail"]}, ], eventOnly: true, tier: "PU", }, registeel: { randomBattleMoves: ["stealthrock", "thunderwave", "toxic", "protect", "seismictoss", "curse", "ironhead", "rest", "sleeptalk"], randomDoubleBattleMoves: ["stealthrock", "ironhead", "curse", "rest", "thunderwave", "protect", "seismictoss"], eventPokemon: [ {"generation": 3, "level": 40, "shiny": 1, "moves":["metalclaw", "curse", "superpower", "ancientpower"]}, {"generation": 3, "level": 40, "moves":["curse", "superpower", "ancientpower", "hyperbeam"]}, {"generation": 4, "level": 30, "shiny": 1, "moves":["stomp", "metalclaw", "curse", "superpower"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["amnesia", "chargebeam", "lockon", "zapcannon"]}, {"generation": 6, "level": 40, "shiny": 1, "isHidden": false, "moves":["curse", "ancientpower", "irondefense", "amnesia"]}, {"generation": 6, "level": 50, "isHidden": true, "moves":["ironhead", "rockslide", "gravity", "irondefense"]}, ], eventOnly: true, tier: "RU", }, latias: { randomBattleMoves: ["dracometeor", "psyshock", "hiddenpowerfire", "roost", "thunderbolt", "healingwish", "defog"], randomDoubleBattleMoves: ["dragonpulse", "psychic", "tailwind", "helpinghand", "healpulse", "lightscreen", "reflect", "protect"], eventPokemon: [ {"generation": 3, "level": 40, "shiny": 1, "moves":["watersport", "refresh", "mistball", "psychic"]}, {"generation": 3, "level": 50, "shiny": 1, "moves":["mistball", "psychic", "recover", "charm"]}, {"generation": 3, "level": 70, "moves":["mistball", "psychic", "recover", "charm"]}, {"generation": 4, "level": 35, "shiny": 1, "moves":["dragonbreath", "watersport", "refresh", "mistball"]}, {"generation": 4, "level": 40, "shiny": 1, "moves":["watersport", "refresh", "mistball", "zenheadbutt"]}, {"generation": 5, "level": 68, "shiny": 1, "moves":["psychoshift", "charm", "psychic", "healpulse"]}, {"generation": 6, "level": 30, "shiny": 1, "moves":["healpulse", "dragonbreath", "mistball", "psychoshift"]}, ], eventOnly: true, tier: "UU", }, latiasmega: { randomBattleMoves: ["calmmind", "dragonpulse", "surf", "dracometeor", "roost", "hiddenpowerfire", "substitute", "psyshock"], randomDoubleBattleMoves: ["dragonpulse", "psychic", "tailwind", "helpinghand", "healpulse", "lightscreen", "reflect", "protect"], requiredItem: "Latiasite", tier: "UU", }, latios: { randomBattleMoves: ["dracometeor", "hiddenpowerfire", "surf", "thunderbolt", "psyshock", "roost", "trick", "defog"], randomDoubleBattleMoves: ["dracometeor", "dragonpulse", "surf", "thunderbolt", "psyshock", "substitute", "trick", "tailwind", "protect", "hiddenpowerfire"], eventPokemon: [ {"generation": 3, "level": 40, "shiny": 1, "moves":["protect", "refresh", "lusterpurge", "psychic"]}, {"generation": 3, "level": 50, "shiny": 1, "moves":["lusterpurge", "psychic", "recover", "dragondance"]}, {"generation": 3, "level": 70, "moves":["lusterpurge", "psychic", "recover", "dragondance"]}, {"generation": 4, "level": 35, "shiny": 1, "moves":["dragonbreath", "protect", "refresh", "lusterpurge"]}, {"generation": 4, "level": 40, "shiny": 1, "moves":["protect", "refresh", "lusterpurge", "zenheadbutt"]}, {"generation": 5, "level": 68, "shiny": 1, "moves":["psychoshift", "dragondance", "psychic", "healpulse"]}, {"generation": 6, "level": 30, "shiny": 1, "moves":["healpulse", "dragonbreath", "lusterpurge", "psychoshift"]}, {"generation": 6, "level": 50, "nature": "Modest", "moves":["dragonpulse", "lusterpurge", "psychic", "healpulse"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, latiosmega: { randomBattleMoves: ["calmmind", "dracometeor", "hiddenpowerfire", "psyshock", "roost", "defog"], randomDoubleBattleMoves: ["dracometeor", "dragonpulse", "surf", "thunderbolt", "psyshock", "substitute", "tailwind", "protect", "hiddenpowerfire"], requiredItem: "Latiosite", tier: "(OU)", }, kyogre: { randomBattleMoves: ["waterspout", "originpulse", "scald", "thunder", "icebeam"], randomDoubleBattleMoves: ["waterspout", "muddywater", "originpulse", "thunder", "icebeam", "calmmind", "rest", "sleeptalk", "protect"], eventPokemon: [ {"generation": 3, "level": 45, "shiny": 1, "moves":["bodyslam", "calmmind", "icebeam", "hydropump"]}, {"generation": 3, "level": 70, "shiny": 1, "moves":["hydropump", "rest", "sheercold", "doubleedge"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["aquaring", "icebeam", "ancientpower", "waterspout"]}, {"generation": 5, "level": 80, "shiny": 1, "moves":["icebeam", "ancientpower", "waterspout", "thunder"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "moves":["waterspout", "thunder", "icebeam", "sheercold"], "pokeball": "cherishball"}, {"generation": 6, "level": 45, "moves":["bodyslam", "aquaring", "icebeam", "originpulse"]}, {"generation": 6, "level": 100, "nature": "Timid", "moves":["waterspout", "thunder", "sheercold", "icebeam"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, kyogreprimal: { randomBattleMoves: ["calmmind", "waterspout", "originpulse", "scald", "thunder", "icebeam", "rest", "sleeptalk"], randomDoubleBattleMoves: ["waterspout", "originpulse", "muddywater", "thunder", "icebeam", "calmmind", "rest", "sleeptalk", "protect"], requiredItem: "Blue Orb", }, groudon: { randomBattleMoves: ["earthquake", "stealthrock", "lavaplume", "stoneedge", "roar", "toxic", "thunderwave", "dragonclaw", "firepunch"], randomDoubleBattleMoves: ["precipiceblades", "rockslide", "protect", "stoneedge", "swordsdance", "rockpolish", "dragonclaw", "firepunch"], eventPokemon: [ {"generation": 3, "level": 45, "shiny": 1, "moves":["slash", "bulkup", "earthquake", "fireblast"]}, {"generation": 3, "level": 70, "shiny": 1, "moves":["fireblast", "rest", "fissure", "solarbeam"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["rest", "earthquake", "ancientpower", "eruption"]}, {"generation": 5, "level": 80, "shiny": 1, "moves":["earthquake", "ancientpower", "eruption", "solarbeam"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "moves":["eruption", "hammerarm", "earthpower", "solarbeam"], "pokeball": "cherishball"}, {"generation": 6, "level": 45, "moves":["lavaplume", "rest", "earthquake", "precipiceblades"]}, {"generation": 6, "level": 100, "nature": "Adamant", "moves":["firepunch", "solarbeam", "hammerarm", "rockslide"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, groudonprimal: { randomBattleMoves: ["stealthrock", "precipiceblades", "lavaplume", "stoneedge", "dragontail", "rockpolish", "swordsdance", "firepunch"], randomDoubleBattleMoves: ["precipiceblades", "lavaplume", "rockslide", "stoneedge", "swordsdance", "overheat", "rockpolish", "firepunch", "protect"], requiredItem: "Red Orb", }, rayquaza: { randomBattleMoves: ["outrage", "vcreate", "extremespeed", "dragondance", "earthquake", "dracometeor", "dragonclaw"], randomDoubleBattleMoves: ["tailwind", "vcreate", "extremespeed", "dragondance", "earthquake", "dracometeor", "dragonclaw", "protect"], eventPokemon: [ {"generation": 3, "level": 70, "shiny": 1, "moves":["fly", "rest", "extremespeed", "outrage"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["rest", "airslash", "ancientpower", "outrage"]}, {"generation": 5, "level": 70, "shiny": true, "moves":["dragonpulse", "ancientpower", "outrage", "dragondance"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "moves":["extremespeed", "hyperbeam", "dragonpulse", "vcreate"], "pokeball": "cherishball"}, {"generation": 6, "level": 70, "moves":["extremespeed", "dragonpulse", "dragondance", "dragonascent"]}, {"generation": 6, "level": 70, "shiny": true, "moves":["dragonpulse", "thunder", "twister", "extremespeed"], "pokeball": "cherishball"}, {"generation": 6, "level": 70, "shiny": true, "moves":["dragonascent", "dragonclaw", "extremespeed", "dragondance"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "shiny": true, "moves":["dragonascent", "dracometeor", "fly", "celebrate"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, rayquazamega: { // randomBattleMoves: ["vcreate", "extremespeed", "swordsdance", "earthquake", "dragonascent", "dragonclaw", "dragondance"], randomDoubleBattleMoves: ["vcreate", "extremespeed", "swordsdance", "earthquake", "dragonascent", "dragonclaw", "dragondance", "protect"], requiredMove: "Dragon Ascent", tier: "AG", }, jirachi: { randomBattleMoves: ["ironhead", "uturn", "firepunch", "icepunch", "trick", "stealthrock", "bodyslam", "toxic", "wish", "substitute"], randomDoubleBattleMoves: ["bodyslam", "ironhead", "icywind", "thunderwave", "helpinghand", "trickroom", "uturn", "followme", "zenheadbutt", "protect"], eventPokemon: [ {"generation": 3, "level": 5, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Bashful", "ivs": {"hp": 24, "atk": 3, "def": 30, "spa": 12, "spd": 16, "spe": 11}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Careful", "ivs": {"hp": 10, "atk": 0, "def": 10, "spa": 10, "spd": 26, "spe": 12}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Docile", "ivs": {"hp": 19, "atk": 7, "def": 10, "spa": 19, "spd": 10, "spe": 16}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Hasty", "ivs": {"hp": 3, "atk": 12, "def": 12, "spa": 7, "spd": 11, "spe": 9}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Jolly", "ivs": {"hp": 11, "atk": 8, "def": 6, "spa": 14, "spd": 5, "spe": 20}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Lonely", "ivs": {"hp": 31, "atk": 23, "def": 26, "spa": 29, "spd": 18, "spe": 5}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Naughty", "ivs": {"hp": 21, "atk": 31, "def": 31, "spa": 18, "spd": 24, "spe": 19}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Serious", "ivs": {"hp": 29, "atk": 10, "def": 31, "spa": 25, "spd": 23, "spe": 21}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 5, "shiny": true, "nature": "Timid", "ivs": {"hp": 15, "atk": 28, "def": 29, "spa": 3, "spd": 0, "spe": 7}, "moves":["wish", "confusion", "rest"]}, {"generation": 3, "level": 30, "moves":["helpinghand", "psychic", "refresh", "rest"]}, {"generation": 4, "level": 5, "moves":["wish", "confusion", "rest"], "pokeball": "cherishball"}, {"generation": 4, "level": 5, "moves":["wish", "confusion", "rest", "dracometeor"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "moves":["healingwish", "psychic", "swift", "meteormash"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "moves":["dracometeor", "meteormash", "wish", "followme"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "moves":["wish", "healingwish", "cosmicpower", "meteormash"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "moves":["wish", "healingwish", "swift", "return"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "shiny": true, "moves":["wish", "swift", "healingwish", "moonblast"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "shiny": true, "moves":["wish", "confusion", "helpinghand", "return"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["heartstamp", "playrough", "wish", "cosmicpower"], "pokeball": "cherishball"}, {"generation": 6, "level": 25, "shiny": true, "moves":["wish", "confusion", "swift", "happyhour"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["wish", "confusion", "rest"], "pokeball": "cherishball"}, {"generation": 7, "level": 15, "moves":["swift", "wish", "healingwish", "rest"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "BL", }, deoxys: { randomBattleMoves: ["psychoboost", "stealthrock", "spikes", "firepunch", "superpower", "extremespeed", "knockoff", "taunt"], randomDoubleBattleMoves: ["psychoboost", "superpower", "extremespeed", "icebeam", "thunderbolt", "firepunch", "protect", "knockoff", "psyshock"], eventPokemon: [ {"generation": 3, "level": 30, "shiny": 1, "moves":["taunt", "pursuit", "psychic", "superpower"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["knockoff", "spikes", "psychic", "snatch"]}, {"generation": 3, "level": 30, "shiny": 1, "moves":["knockoff", "pursuit", "psychic", "swift"]}, {"generation": 3, "level": 70, "moves":["cosmicpower", "recover", "psychoboost", "hyperbeam"]}, {"generation": 4, "level": 50, "moves":["psychoboost", "zapcannon", "irondefense", "extremespeed"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["psychoboost", "swift", "doubleteam", "extremespeed"]}, {"generation": 4, "level": 50, "moves":["psychoboost", "detect", "counter", "mirrorcoat"]}, {"generation": 4, "level": 50, "moves":["psychoboost", "meteormash", "superpower", "hyperbeam"]}, {"generation": 4, "level": 50, "moves":["psychoboost", "leer", "wrap", "nightshade"]}, {"generation": 5, "level": 100, "moves":["nastyplot", "darkpulse", "recover", "psychoboost"], "pokeball": "duskball"}, {"generation": 6, "level": 80, "moves":["cosmicpower", "recover", "psychoboost", "hyperbeam"]}, ], eventOnly: true, tier: "Uber", }, deoxysattack: { randomBattleMoves: ["psychoboost", "superpower", "icebeam", "knockoff", "extremespeed", "firepunch", "stealthrock"], randomDoubleBattleMoves: ["psychoboost", "superpower", "extremespeed", "icebeam", "thunderbolt", "firepunch", "protect", "knockoff"], eventOnly: true, tier: "Uber", }, deoxysdefense: { randomBattleMoves: ["spikes", "stealthrock", "recover", "taunt", "toxic", "seismictoss", "knockoff"], randomDoubleBattleMoves: ["protect", "stealthrock", "recover", "taunt", "reflect", "seismictoss", "lightscreen", "trickroom", "psychic"], eventOnly: true, tier: "Uber", }, deoxysspeed: { randomBattleMoves: ["spikes", "stealthrock", "superpower", "psychoboost", "taunt", "magiccoat", "knockoff"], randomDoubleBattleMoves: ["superpower", "icebeam", "psychoboost", "taunt", "lightscreen", "reflect", "protect", "knockoff"], eventOnly: true, tier: "Uber", }, turtwig: { randomBattleMoves: ["reflect", "lightscreen", "stealthrock", "seedbomb", "substitute", "leechseed", "toxic"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tackle", "withdraw", "absorb"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["tackle", "withdraw", "absorb", "stockpile"]}, ], tier: "LC", }, grotle: { randomBattleMoves: ["reflect", "lightscreen", "stealthrock", "seedbomb", "substitute", "leechseed", "toxic"], tier: "NFE", }, torterra: { randomBattleMoves: ["stealthrock", "earthquake", "woodhammer", "stoneedge", "synthesis", "rockpolish"], randomDoubleBattleMoves: ["protect", "earthquake", "woodhammer", "stoneedge", "rockslide", "wideguard", "rockpolish"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["woodhammer", "earthquake", "outrage", "stoneedge"], "pokeball": "cherishball"}, ], tier: "PU", }, chimchar: { randomBattleMoves: ["stealthrock", "overheat", "hiddenpowergrass", "fakeout", "uturn", "gunkshot"], eventPokemon: [ {"generation": 4, "level": 40, "gender": "M", "nature": "Mild", "moves":["flamethrower", "thunderpunch", "grassknot", "helpinghand"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["scratch", "leer", "ember", "taunt"]}, {"generation": 4, "level": 40, "gender": "M", "nature": "Hardy", "moves":["flamethrower", "thunderpunch", "grassknot", "helpinghand"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["leer", "ember", "taunt", "fakeout"]}, ], tier: "LC", }, monferno: { randomBattleMoves: ["stealthrock", "overheat", "hiddenpowergrass", "fakeout", "vacuumwave", "uturn", "gunkshot"], tier: "NFE", }, infernape: { randomBattleMoves: ["stealthrock", "uturn", "earthquake", "closecombat", "flareblitz", "stoneedge", "machpunch", "nastyplot", "fireblast", "vacuumwave", "grassknot", "hiddenpowerice"], randomDoubleBattleMoves: ["fakeout", "heatwave", "closecombat", "uturn", "grassknot", "stoneedge", "machpunch", "feint", "taunt", "flareblitz", "hiddenpowerice", "thunderpunch", "protect"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["fireblast", "closecombat", "uturn", "grassknot"], "pokeball": "cherishball"}, {"generation": 6, "level": 88, "isHidden": true, "moves":["fireblast", "closecombat", "firepunch", "focuspunch"], "pokeball": "cherishball"}, ], tier: "UU", }, piplup: { randomBattleMoves: ["stealthrock", "hydropump", "scald", "icebeam", "hiddenpowerelectric", "hiddenpowerfire", "yawn", "defog"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["pound", "growl", "bubble"]}, {"generation": 5, "level": 15, "shiny": 1, "isHidden": false, "moves":["hydropump", "featherdance", "watersport", "peck"], "pokeball": "cherishball"}, {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "moves":["sing", "round", "featherdance", "peck"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["pound", "growl", "bubble", "featherdance"]}, {"generation": 6, "level": 7, "isHidden": false, "moves":["pound", "growl", "return"], "pokeball": "cherishball"}, {"generation": 7, "level": 30, "gender": "M", "nature": "Hardy", "isHidden": false, "moves":["hydropump", "bubblebeam", "whirlpool", "drillpeck"], "pokeball": "pokeball"}, ], tier: "LC", }, prinplup: { randomBattleMoves: ["stealthrock", "hydropump", "scald", "icebeam", "hiddenpowerelectric", "hiddenpowerfire", "yawn", "defog"], tier: "NFE", }, empoleon: { randomBattleMoves: ["hydropump", "flashcannon", "grassknot", "hiddenpowerfire", "icebeam", "scald", "toxic", "roar", "stealthrock"], randomDoubleBattleMoves: ["icywind", "scald", "surf", "icebeam", "hiddenpowerelectric", "protect", "grassknot", "flashcannon"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["hydropump", "icebeam", "aquajet", "grassknot"], "pokeball": "cherishball"}, ], tier: "UU", }, starly: { randomBattleMoves: ["bravebird", "return", "uturn", "pursuit"], eventPokemon: [ {"generation": 4, "level": 1, "gender": "M", "nature": "Mild", "moves":["tackle", "growl"]}, ], tier: "LC", }, staravia: { randomBattleMoves: ["bravebird", "return", "uturn", "pursuit", "defog"], tier: "NFE", }, staraptor: { randomBattleMoves: ["bravebird", "closecombat", "uturn", "quickattack", "roost", "doubleedge"], randomDoubleBattleMoves: ["bravebird", "closecombat", "uturn", "quickattack", "doubleedge", "tailwind", "protect"], tier: "BL", }, bidoof: { randomBattleMoves: ["return", "aquatail", "curse", "quickattack", "stealthrock", "superfang"], eventPokemon: [ {"generation": 4, "level": 1, "gender": "M", "nature": "Lonely", "abilities":["simple"], "moves":["tackle"]}, ], tier: "LC", }, bibarel: { randomBattleMoves: ["return", "waterfall", "swordsdance", "quickattack", "aquajet"], randomDoubleBattleMoves: ["return", "waterfall", "curse", "aquajet", "quickattack", "protect", "rest"], tier: "PU", }, kricketot: { randomBattleMoves: ["endeavor", "mudslap", "bugbite", "strugglebug"], tier: "LC", }, kricketune: { randomBattleMoves: ["leechlife", "endeavor", "taunt", "toxic", "stickyweb", "knockoff"], randomDoubleBattleMoves: ["leechlife", "protect", "taunt", "stickyweb", "knockoff"], tier: "PU", }, shinx: { randomBattleMoves: ["wildcharge", "icefang", "firefang", "crunch"], tier: "LC", }, luxio: { randomBattleMoves: ["wildcharge", "icefang", "firefang", "crunch"], tier: "NFE", }, luxray: { randomBattleMoves: ["wildcharge", "icefang", "voltswitch", "crunch", "superpower", "facade"], randomDoubleBattleMoves: ["wildcharge", "icefang", "voltswitch", "crunch", "superpower", "facade", "protect"], tier: "PU", }, cranidos: { randomBattleMoves: ["headsmash", "rockslide", "earthquake", "zenheadbutt", "firepunch", "rockpolish", "crunch"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "moves":["pursuit", "takedown", "crunch", "headbutt"], "pokeball": "cherishball"}, ], tier: "LC", }, rampardos: { randomBattleMoves: ["headsmash", "earthquake", "rockpolish", "crunch", "rockslide", "firepunch"], randomDoubleBattleMoves: ["headsmash", "earthquake", "zenheadbutt", "rockslide", "crunch", "stoneedge", "protect"], tier: "PU", }, shieldon: { randomBattleMoves: ["stealthrock", "metalburst", "fireblast", "icebeam", "protect", "toxic", "roar"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "moves":["metalsound", "takedown", "bodyslam", "protect"], "pokeball": "cherishball"}, ], tier: "LC", }, bastiodon: { randomBattleMoves: ["stealthrock", "rockblast", "metalburst", "protect", "toxic", "roar"], randomDoubleBattleMoves: ["stealthrock", "stoneedge", "metalburst", "protect", "wideguard", "guardsplit"], tier: "PU", }, burmy: { randomBattleMoves: ["bugbite", "hiddenpowerice", "electroweb", "protect"], tier: "LC", }, wormadam: { randomBattleMoves: ["gigadrain", "bugbuzz", "quiverdance", "hiddenpowerrock", "leafstorm"], randomDoubleBattleMoves: ["leafstorm", "gigadrain", "bugbuzz", "hiddenpowerice", "hiddenpowerrock", "stringshot", "protect"], tier: "PU", }, wormadamsandy: { randomBattleMoves: ["earthquake", "toxic", "protect", "stealthrock"], randomDoubleBattleMoves: ["earthquake", "suckerpunch", "rockblast", "protect", "stringshot"], tier: "PU", }, wormadamtrash: { randomBattleMoves: ["stealthrock", "toxic", "gyroball", "protect"], randomDoubleBattleMoves: ["strugglebug", "stringshot", "gyroball", "bugbuzz", "flashcannon", "suckerpunch", "protect"], tier: "PU", }, mothim: { randomBattleMoves: ["quiverdance", "bugbuzz", "airslash", "gigadrain", "hiddenpowerground", "uturn"], randomDoubleBattleMoves: ["quiverdance", "bugbuzz", "airslash", "gigadrain", "roost", "protect"], tier: "PU", }, combee: { randomBattleMoves: ["bugbuzz", "aircutter", "endeavor", "ominouswind", "tailwind"], tier: "LC", }, vespiquen: { randomBattleMoves: ["substitute", "healorder", "toxic", "attackorder", "defendorder", "infestation"], randomDoubleBattleMoves: ["tailwind", "healorder", "stringshot", "attackorder", "strugglebug", "protect"], tier: "PU", }, pachirisu: { randomBattleMoves: ["nuzzle", "thunderbolt", "superfang", "toxic", "uturn"], randomDoubleBattleMoves: ["nuzzle", "thunderbolt", "superfang", "followme", "uturn", "helpinghand", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "nature": "Impish", "ivs": {"hp": 31, "atk": 31, "def": 31, "spa": 14, "spd": 31, "spe": 31}, "isHidden": true, "moves":["nuzzle", "superfang", "followme", "protect"], "pokeball": "cherishball"}, ], tier: "PU", }, buizel: { randomBattleMoves: ["waterfall", "aquajet", "switcheroo", "brickbreak", "bulkup", "batonpass", "icepunch"], tier: "LC", }, floatzel: { randomBattleMoves: ["bulkup", "batonpass", "waterfall", "icepunch", "substitute", "taunt", "aquajet", "brickbreak"], randomDoubleBattleMoves: ["waterfall", "aquajet", "switcheroo", "raindance", "protect", "icepunch", "crunch", "taunt"], tier: "PU", }, cherubi: { randomBattleMoves: ["sunnyday", "solarbeam", "weatherball", "hiddenpowerice", "aromatherapy", "dazzlinggleam"], tier: "LC", }, cherrim: { randomBattleMoves: ["energyball", "dazzlinggleam", "hiddenpowerfire", "synthesis", "healingwish"], randomDoubleBattleMoves: ["sunnyday", "solarbeam", "weatherball", "gigadrain", "protect"], tier: "PU", }, cherrimsunshine: { randomBattleMoves: ["sunnyday", "solarbeam", "gigadrain", "weatherball", "hiddenpowerice"], randomDoubleBattleMoves: ["sunnyday", "solarbeam", "gigadrain", "weatherball", "protect"], battleOnly: true, }, shellos: { randomBattleMoves: ["scald", "clearsmog", "recover", "toxic", "icebeam", "stockpile"], tier: "LC", }, gastrodon: { randomBattleMoves: ["earthquake", "icebeam", "scald", "toxic", "recover", "clearsmog"], randomDoubleBattleMoves: ["earthpower", "icebeam", "scald", "muddywater", "recover", "icywind", "protect"], tier: "PU", }, drifloon: { randomBattleMoves: ["shadowball", "substitute", "calmmind", "hypnosis", "hiddenpowerfighting", "thunderbolt", "destinybond", "willowisp"], tier: "LC Uber", }, drifblim: { randomBattleMoves: ["acrobatics", "willowisp", "substitute", "destinybond", "shadowball", "hex"], randomDoubleBattleMoves: ["shadowball", "substitute", "hypnosis", "hiddenpowerfighting", "thunderbolt", "destinybond", "willowisp", "protect"], tier: "PU", }, buneary: { randomBattleMoves: ["fakeout", "return", "switcheroo", "thunderpunch", "jumpkick", "firepunch", "icepunch", "healingwish"], tier: "LC", }, lopunny: { randomBattleMoves: ["return", "switcheroo", "highjumpkick", "icepunch", "healingwish"], randomDoubleBattleMoves: ["return", "switcheroo", "highjumpkick", "firepunch", "icepunch", "fakeout", "protect", "encore"], tier: "PU", }, lopunnymega: { randomBattleMoves: ["return", "highjumpkick", "substitute", "fakeout", "icepunch"], randomDoubleBattleMoves: ["return", "highjumpkick", "protect", "fakeout", "icepunch", "encore"], requiredItem: "Lopunnite", tier: "OU", }, glameow: { randomBattleMoves: ["fakeout", "uturn", "suckerpunch", "hypnosis", "quickattack", "return", "foulplay"], tier: "LC", }, purugly: { randomBattleMoves: ["fakeout", "uturn", "suckerpunch", "quickattack", "return", "knockoff"], randomDoubleBattleMoves: ["fakeout", "uturn", "suckerpunch", "quickattack", "return", "knockoff", "protect"], tier: "PU", }, stunky: { randomBattleMoves: ["pursuit", "suckerpunch", "crunch", "fireblast", "explosion", "taunt", "playrough", "defog"], tier: "LC", }, skuntank: { randomBattleMoves: ["pursuit", "suckerpunch", "crunch", "fireblast", "taunt", "poisonjab", "defog"], randomDoubleBattleMoves: ["protect", "suckerpunch", "crunch", "fireblast", "taunt", "poisonjab", "playrough", "snarl"], tier: "PU", }, bronzor: { randomBattleMoves: ["stealthrock", "psychic", "toxic", "hypnosis", "reflect", "lightscreen", "trickroom", "trick"], tier: "LC", }, bronzong: { randomBattleMoves: ["stealthrock", "earthquake", "toxic", "reflect", "lightscreen", "trickroom", "explosion", "gyroball"], randomDoubleBattleMoves: ["earthquake", "protect", "reflect", "lightscreen", "trickroom", "explosion", "gyroball"], tier: "RU", }, chatot: { randomBattleMoves: ["nastyplot", "boomburst", "heatwave", "hiddenpowerground", "substitute", "chatter", "uturn"], randomDoubleBattleMoves: ["nastyplot", "heatwave", "encore", "substitute", "chatter", "uturn", "protect", "hypervoice", "boomburst"], eventPokemon: [ {"generation": 4, "level": 25, "gender": "M", "nature": "Jolly", "abilities":["keeneye"], "moves":["mirrormove", "furyattack", "chatter", "taunt"]}, ], tier: "PU", }, spiritomb: { randomBattleMoves: ["shadowsneak", "suckerpunch", "pursuit", "willowisp", "darkpulse", "rest", "sleeptalk", "foulplay", "painsplit", "calmmind"], randomDoubleBattleMoves: ["shadowsneak", "suckerpunch", "icywind", "willowisp", "snarl", "darkpulse", "protect", "foulplay", "painsplit"], eventPokemon: [ {"generation": 5, "level": 61, "gender": "F", "nature": "Quiet", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "moves":["darkpulse", "psychic", "silverwind", "embargo"], "pokeball": "cherishball"}, ], tier: "NU", }, gible: { randomBattleMoves: ["outrage", "dragonclaw", "earthquake", "fireblast", "stoneedge", "stealthrock"], tier: "LC", }, gabite: { randomBattleMoves: ["outrage", "dragonclaw", "earthquake", "fireblast", "stoneedge", "stealthrock"], tier: "NFE", }, garchomp: { randomBattleMoves: ["outrage", "dragonclaw", "earthquake", "stoneedge", "fireblast", "swordsdance", "stealthrock", "firefang"], randomDoubleBattleMoves: ["substitute", "dragonclaw", "earthquake", "stoneedge", "rockslide", "swordsdance", "protect", "firefang"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["outrage", "earthquake", "swordsdance", "stoneedge"], "pokeball": "cherishball"}, {"generation": 5, "level": 48, "gender": "M", "isHidden": true, "moves":["dragonclaw", "dig", "crunch", "outrage"]}, {"generation": 6, "level": 48, "gender": "M", "isHidden": false, "moves":["dracometeor", "dragonclaw", "dig", "crunch"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "gender": "M", "isHidden": false, "moves":["slash", "dragonclaw", "dig", "crunch"], "pokeball": "cherishball"}, {"generation": 6, "level": 66, "gender": "F", "perfectIVs": 3, "isHidden": false, "moves":["dragonrush", "earthquake", "brickbreak", "gigaimpact"], "pokeball": "cherishball"}, ], tier: "OU", }, garchompmega: { randomBattleMoves: ["outrage", "dracometeor", "earthquake", "stoneedge", "fireblast", "swordsdance"], randomDoubleBattleMoves: ["substitute", "dragonclaw", "earthquake", "stoneedge", "rockslide", "swordsdance", "protect", "fireblast"], requiredItem: "Garchompite", tier: "(OU)", }, riolu: { randomBattleMoves: ["crunch", "rockslide", "copycat", "drainpunch", "highjumpkick", "icepunch", "swordsdance"], eventPokemon: [ {"generation": 4, "level": 30, "gender": "M", "nature": "Serious", "abilities":["steadfast"], "moves":["aurasphere", "shadowclaw", "bulletpunch", "drainpunch"]}, ], tier: "LC", }, lucario: { randomBattleMoves: ["swordsdance", "closecombat", "crunch", "extremespeed", "icepunch", "nastyplot", "aurasphere", "darkpulse", "vacuumwave", "flashcannon"], randomDoubleBattleMoves: ["followme", "closecombat", "crunch", "extremespeed", "icepunch", "bulletpunch", "aurasphere", "darkpulse", "vacuumwave", "flashcannon", "protect"], eventPokemon: [ {"generation": 4, "level": 50, "gender": "M", "nature": "Modest", "abilities":["steadfast"], "moves":["aurasphere", "darkpulse", "dragonpulse", "waterpulse"], "pokeball": "cherishball"}, {"generation": 4, "level": 30, "gender": "M", "nature": "Adamant", "abilities":["innerfocus"], "moves":["forcepalm", "bonerush", "sunnyday", "blazekick"], "pokeball": "cherishball"}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["detect", "metalclaw", "counter", "bulletpunch"]}, {"generation": 5, "level": 50, "gender": "M", "nature": "Naughty", "ivs": {"atk": 31}, "isHidden": true, "moves":["bulletpunch", "closecombat", "stoneedge", "shadowclaw"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "nature": "Jolly", "isHidden": false, "abilities":["innerfocus"], "moves":["closecombat", "aurasphere", "flashcannon", "quickattack"], "pokeball": "cherishball"}, {"generation": 7, "level": 40, "gender": "M", "nature": "Serious", "isHidden": false, "abilities":["steadfast"], "moves":["aurasphere", "highjumpkick", "dragonpulse", "extremespeed"], "pokeball": "pokeball"}, ], tier: "BL2", }, lucariomega: { randomBattleMoves: ["swordsdance", "closecombat", "crunch", "icepunch", "bulletpunch", "nastyplot", "aurasphere", "darkpulse", "flashcannon"], randomDoubleBattleMoves: ["followme", "closecombat", "crunch", "extremespeed", "icepunch", "bulletpunch", "aurasphere", "darkpulse", "vacuumwave", "flashcannon", "protect"], requiredItem: "Lucarionite", tier: "Uber", }, hippopotas: { randomBattleMoves: ["earthquake", "slackoff", "whirlwind", "stealthrock", "protect", "toxic", "stockpile"], tier: "LC", }, hippowdon: { randomBattleMoves: ["earthquake", "slackoff", "whirlwind", "stealthrock", "toxic", "stoneedge"], randomDoubleBattleMoves: ["earthquake", "slackoff", "rockslide", "stealthrock", "protect", "stoneedge", "whirlwind"], tier: "UU", }, skorupi: { randomBattleMoves: ["toxicspikes", "xscissor", "poisonjab", "knockoff", "pinmissile", "whirlwind"], tier: "LC", }, drapion: { randomBattleMoves: ["knockoff", "taunt", "toxicspikes", "poisonjab", "whirlwind", "swordsdance", "aquatail", "earthquake"], randomDoubleBattleMoves: ["snarl", "taunt", "protect", "earthquake", "aquatail", "swordsdance", "poisonjab", "knockoff"], tier: "RU", }, croagunk: { randomBattleMoves: ["fakeout", "vacuumwave", "suckerpunch", "drainpunch", "darkpulse", "knockoff", "gunkshot", "toxic"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["astonish", "mudslap", "poisonsting", "taunt"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["mudslap", "poisonsting", "taunt", "poisonjab"]}, ], tier: "LC", }, toxicroak: { randomBattleMoves: ["swordsdance", "gunkshot", "drainpunch", "suckerpunch", "icepunch", "substitute"], randomDoubleBattleMoves: ["suckerpunch", "drainpunch", "substitute", "swordsdance", "knockoff", "icepunch", "gunkshot", "fakeout", "protect"], tier: "NU", }, carnivine: { randomBattleMoves: ["swordsdance", "powerwhip", "return", "sleeppowder", "substitute", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "powerwhip", "return", "sleeppowder", "substitute", "leechseed", "knockoff", "ragepowder", "protect"], tier: "PU", }, finneon: { randomBattleMoves: ["surf", "uturn", "icebeam", "hiddenpowerelectric", "hiddenpowergrass"], tier: "LC", }, lumineon: { randomBattleMoves: ["scald", "icebeam", "uturn", "toxic", "defog"], randomDoubleBattleMoves: ["surf", "uturn", "icebeam", "toxic", "raindance", "tailwind", "scald", "protect"], tier: "PU", }, snover: { randomBattleMoves: ["blizzard", "iceshard", "gigadrain", "leechseed", "substitute", "woodhammer"], tier: "LC", }, abomasnow: { randomBattleMoves: ["woodhammer", "iceshard", "blizzard", "gigadrain", "leechseed", "substitute", "focuspunch", "earthquake"], randomDoubleBattleMoves: ["blizzard", "iceshard", "gigadrain", "protect", "focusblast", "woodhammer", "earthquake"], tier: "PU", }, abomasnowmega: { randomBattleMoves: ["blizzard", "gigadrain", "woodhammer", "earthquake", "iceshard", "hiddenpowerfire"], randomDoubleBattleMoves: ["blizzard", "iceshard", "gigadrain", "protect", "focusblast", "woodhammer", "earthquake"], requiredItem: "Abomasite", tier: "RU", }, rotom: { randomBattleMoves: ["thunderbolt", "voltswitch", "shadowball", "substitute", "painsplit", "hiddenpowerice", "trick", "willowisp"], randomDoubleBattleMoves: ["thunderbolt", "voltswitch", "shadowball", "substitute", "painsplit", "hiddenpowerice", "trick", "willowisp", "electroweb", "protect"], eventPokemon: [ {"generation": 5, "level": 10, "nature": "Naughty", "moves":["uproar", "astonish", "trick", "thundershock"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "nature": "Quirky", "moves":["shockwave", "astonish", "trick", "thunderwave"], "pokeball": "cherishball"}, ], tier: "NU", }, rotomheat: { randomBattleMoves: ["overheat", "thunderbolt", "voltswitch", "hiddenpowerice", "painsplit", "willowisp", "trick"], randomDoubleBattleMoves: ["overheat", "thunderbolt", "voltswitch", "substitute", "painsplit", "hiddenpowerice", "willowisp", "trick", "electroweb", "protect"], tier: "RU", }, rotomwash: { randomBattleMoves: ["hydropump", "thunderbolt", "voltswitch", "painsplit", "hiddenpowerice", "willowisp", "trick"], randomDoubleBattleMoves: ["hydropump", "thunderbolt", "voltswitch", "substitute", "painsplit", "hiddenpowerice", "willowisp", "trick", "electroweb", "protect", "hiddenpowergrass"], tier: "UU", }, rotomfrost: { randomBattleMoves: ["blizzard", "thunderbolt", "voltswitch", "substitute", "painsplit", "willowisp", "trick"], randomDoubleBattleMoves: ["blizzard", "thunderbolt", "voltswitch", "substitute", "painsplit", "willowisp", "trick", "electroweb", "protect"], tier: "PU", }, rotomfan: { randomBattleMoves: ["airslash", "thunderbolt", "voltswitch", "painsplit", "willowisp", "trick"], randomDoubleBattleMoves: ["airslash", "thunderbolt", "voltswitch", "substitute", "painsplit", "hiddenpowerice", "willowisp", "electroweb", "discharge", "protect"], tier: "PU", }, rotommow: { randomBattleMoves: ["leafstorm", "thunderbolt", "voltswitch", "painsplit", "hiddenpowerfire", "willowisp", "trick"], randomDoubleBattleMoves: ["leafstorm", "thunderbolt", "voltswitch", "substitute", "painsplit", "hiddenpowerfire", "willowisp", "trick", "electroweb", "protect"], tier: "NU", }, uxie: { randomBattleMoves: ["stealthrock", "thunderwave", "psychic", "uturn", "healbell", "knockoff", "yawn"], randomDoubleBattleMoves: ["uturn", "psyshock", "yawn", "healbell", "stealthrock", "thunderbolt", "protect", "helpinghand", "thunderwave"], eventPokemon: [ {"generation": 4, "level": 50, "shiny": 1, "moves":["confusion", "yawn", "futuresight", "amnesia"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["swift", "yawn", "futuresight", "amnesia"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["futuresight", "amnesia", "extrasensory", "flail"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["yawn", "futuresight", "amnesia", "extrasensory"]}, ], eventOnly: true, tier: "NU", }, mesprit: { randomBattleMoves: ["calmmind", "psychic", "psyshock", "energyball", "signalbeam", "hiddenpowerfire", "icebeam", "healingwish", "stealthrock", "uturn"], randomDoubleBattleMoves: ["calmmind", "psychic", "thunderbolt", "icebeam", "substitute", "uturn", "trick", "protect", "knockoff", "helpinghand"], eventPokemon: [ {"generation": 4, "level": 50, "shiny": 1, "moves":["confusion", "luckychant", "futuresight", "charm"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["swift", "luckychant", "futuresight", "charm"]}, {"generation": 5, "level": 50, "shiny": 1, "moves":["futuresight", "charm", "extrasensory", "copycat"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["luckychant", "futuresight", "charm", "extrasensory"]}, ], eventOnly: true, tier: "PU", }, azelf: { randomBattleMoves: ["nastyplot", "psyshock", "fireblast", "dazzlinggleam", "stealthrock", "knockoff", "taunt", "explosion"], randomDoubleBattleMoves: ["nastyplot", "psychic", "fireblast", "thunderbolt", "icepunch", "knockoff", "zenheadbutt", "uturn", "trick", "taunt", "protect", "dazzlinggleam"], eventPokemon: [ {"generation": 4, "level": 50, "shiny": 1, "moves":["confusion", "uproar", "futuresight", "nastyplot"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["swift", "uproar", "futuresight", "nastyplot"]}, {"generation": 5, "level": 50, "shiny": 1, "moves":["futuresight", "nastyplot", "extrasensory", "lastresort"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["uproar", "futuresight", "nastyplot", "extrasensory"]}, ], eventOnly: true, tier: "UU", }, dialga: { randomBattleMoves: ["stealthrock", "toxic", "dracometeor", "fireblast", "flashcannon", "roar", "thunderbolt"], randomDoubleBattleMoves: ["dracometeor", "dragonpulse", "protect", "thunderbolt", "flashcannon", "earthpower", "fireblast", "aurasphere"], eventPokemon: [ {"generation": 4, "level": 47, "shiny": 1, "moves":["metalclaw", "ancientpower", "dragonclaw", "roaroftime"]}, {"generation": 4, "level": 70, "shiny": 1, "moves":["roaroftime", "healblock", "earthpower", "slash"]}, {"generation": 4, "level": 1, "shiny": 1, "moves":["dragonbreath", "scaryface"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["dragonbreath", "scaryface"], "pokeball": "dreamball"}, {"generation": 5, "level": 100, "shiny": true, "isHidden": false, "moves":["dragonpulse", "dracometeor", "aurasphere", "roaroftime"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["aurasphere", "irontail", "roaroftime", "flashcannon"]}, {"generation": 6, "level": 100, "nature": "Modest", "isHidden": true, "moves":["metalburst", "overheat", "roaroftime", "flashcannon"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, palkia: { randomBattleMoves: ["spacialrend", "dracometeor", "hydropump", "thunderwave", "dragontail", "fireblast"], randomDoubleBattleMoves: ["spacialrend", "dracometeor", "surf", "hydropump", "thunderbolt", "fireblast", "protect"], eventPokemon: [ {"generation": 4, "level": 47, "shiny": 1, "moves":["waterpulse", "ancientpower", "dragonclaw", "spacialrend"]}, {"generation": 4, "level": 70, "shiny": 1, "moves":["spacialrend", "healblock", "earthpower", "slash"]}, {"generation": 4, "level": 1, "shiny": 1, "moves":["dragonbreath", "scaryface"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["dragonbreath", "scaryface"], "pokeball": "dreamball"}, {"generation": 5, "level": 100, "shiny": true, "isHidden": false, "moves":["hydropump", "dracometeor", "spacialrend", "aurasphere"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["earthpower", "aurasphere", "spacialrend", "hydropump"]}, {"generation": 6, "level": 100, "nature": "Timid", "isHidden": true, "moves":["earthpower", "aurasphere", "spacialrend", "hydropump"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, heatran: { randomBattleMoves: ["fireblast", "lavaplume", "stealthrock", "earthpower", "flashcannon", "protect", "toxic", "roar"], randomDoubleBattleMoves: ["heatwave", "substitute", "earthpower", "protect", "eruption", "willowisp"], eventPokemon: [ {"generation": 4, "level": 70, "shiny": 1, "moves":["scaryface", "lavaplume", "firespin", "ironhead"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["metalsound", "crunch", "scaryface", "lavaplume"]}, {"generation": 4, "level": 50, "nature": "Quiet", "moves":["eruption", "magmastorm", "earthpower", "ancientpower"]}, {"generation": 5, "level": 68, "shiny": 1, "isHidden": false, "moves":["scaryface", "lavaplume", "firespin", "ironhead"]}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["metalsound", "crunch", "scaryface", "lavaplume"]}, ], eventOnly: true, unreleasedHidden: true, tier: "OU", }, regigigas: { randomBattleMoves: ["thunderwave", "confuseray", "substitute", "return", "knockoff", "drainpunch"], randomDoubleBattleMoves: ["thunderwave", "substitute", "return", "icywind", "rockslide", "earthquake", "knockoff", "wideguard"], eventPokemon: [ {"generation": 4, "level": 70, "shiny": 1, "moves":["confuseray", "stomp", "superpower", "zenheadbutt"]}, {"generation": 4, "level": 1, "shiny": 1, "moves":["dizzypunch", "knockoff", "foresight", "confuseray"]}, {"generation": 4, "level": 100, "moves":["ironhead", "rockslide", "icywind", "crushgrip"], "pokeball": "cherishball"}, {"generation": 5, "level": 68, "shiny": 1, "moves":["revenge", "wideguard", "zenheadbutt", "payback"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["foresight", "revenge", "wideguard", "zenheadbutt"]}, ], eventOnly: true, tier: "PU", }, giratina: { randomBattleMoves: ["rest", "sleeptalk", "dragontail", "roar", "willowisp", "shadowball", "dragonpulse"], randomDoubleBattleMoves: ["tailwind", "shadowsneak", "protect", "dragontail", "willowisp", "calmmind", "dragonpulse", "shadowball"], eventPokemon: [ {"generation": 4, "level": 70, "shiny": 1, "moves":["shadowforce", "healblock", "earthpower", "slash"]}, {"generation": 4, "level": 47, "shiny": 1, "moves":["ominouswind", "ancientpower", "dragonclaw", "shadowforce"]}, {"generation": 4, "level": 1, "shiny": 1, "moves":["dragonbreath", "scaryface"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["dragonbreath", "scaryface"], "pokeball": "dreamball"}, {"generation": 5, "level": 100, "shiny": true, "isHidden": false, "moves":["dragonpulse", "dragonclaw", "aurasphere", "shadowforce"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["aurasphere", "shadowclaw", "shadowforce", "hex"]}, {"generation": 6, "level": 100, "nature": "Brave", "isHidden": true, "moves":["aurasphere", "dracometeor", "shadowforce", "ironhead"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, giratinaorigin: { randomBattleMoves: ["dracometeor", "shadowsneak", "dragontail", "willowisp", "defog", "toxic", "shadowball", "earthquake"], randomDoubleBattleMoves: ["dracometeor", "shadowsneak", "tailwind", "hiddenpowerfire", "willowisp", "calmmind", "substitute", "dragonpulse", "shadowball", "aurasphere", "protect", "earthquake"], eventOnly: true, requiredItem: "Griseous Orb", tier: "Uber", }, cresselia: { randomBattleMoves: ["moonlight", "psychic", "icebeam", "thunderwave", "toxic", "substitute", "psyshock", "moonblast", "calmmind"], randomDoubleBattleMoves: ["psyshock", "icywind", "thunderwave", "trickroom", "moonblast", "moonlight", "skillswap", "reflect", "lightscreen", "icebeam", "protect", "helpinghand"], eventPokemon: [ {"generation": 4, "level": 50, "shiny": 1, "moves":["mist", "aurorabeam", "futuresight", "slash"]}, {"generation": 5, "level": 68, "shiny": 1, "moves":["futuresight", "slash", "moonlight", "psychocut"]}, {"generation": 5, "level": 68, "nature": "Modest", "moves":["icebeam", "psyshock", "energyball", "hiddenpower"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["mist", "aurorabeam", "futuresight", "slash"]}, ], eventOnly: true, tier: "RU", }, phione: { randomBattleMoves: ["raindance", "scald", "uturn", "rest", "icebeam"], randomDoubleBattleMoves: ["raindance", "scald", "uturn", "rest", "icebeam", "helpinghand", "icywind", "protect"], eventPokemon: [ {"generation": 4, "level": 50, "moves":["grassknot", "raindance", "rest", "surf"], "pokeball": "cherishball"}, ], tier: "PU", }, manaphy: { randomBattleMoves: ["tailglow", "surf", "icebeam", "energyball", "psychic"], randomDoubleBattleMoves: ["tailglow", "surf", "icebeam", "energyball", "protect", "scald", "icywind", "helpinghand"], eventPokemon: [ {"generation": 4, "level": 5, "moves":["tailglow", "bubble", "watersport"]}, {"generation": 4, "level": 1, "shiny": 1, "moves":["tailglow", "bubble", "watersport"]}, {"generation": 4, "level": 50, "moves":["heartswap", "waterpulse", "whirlpool", "acidarmor"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "nature": "Impish", "moves":["aquaring", "waterpulse", "watersport", "heartswap"], "pokeball": "cherishball"}, {"generation": 6, "level": 1, "moves":["tailglow", "bubble", "watersport", "heartswap"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["tailglow", "bubble", "watersport"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, darkrai: { randomBattleMoves: ["hypnosis", "darkpulse", "focusblast", "nastyplot", "substitute", "sludgebomb"], randomDoubleBattleMoves: ["darkpulse", "focusblast", "nastyplot", "substitute", "snarl", "icebeam", "protect"], eventPokemon: [ {"generation": 4, "level": 40, "shiny": 1, "moves":["quickattack", "hypnosis", "pursuit", "nightmare"]}, {"generation": 4, "level": 50, "moves":["roaroftime", "spacialrend", "nightmare", "hypnosis"], "pokeball": "cherishball"}, {"generation": 4, "level": 50, "moves":["darkvoid", "darkpulse", "shadowball", "doubleteam"]}, {"generation": 4, "level": 50, "shiny": 1, "moves":["hypnosis", "feintattack", "nightmare", "doubleteam"]}, {"generation": 5, "level": 50, "moves":["darkvoid", "ominouswind", "feintattack", "nightmare"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "moves":["darkvoid", "darkpulse", "phantomforce", "dreameater"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["darkvoid", "ominouswind", "nightmare", "feintattack"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, shaymin: { randomBattleMoves: ["seedflare", "earthpower", "airslash", "psychic", "rest", "substitute", "leechseed"], randomDoubleBattleMoves: ["seedflare", "earthpower", "airslash", "hiddenpowerfire", "rest", "substitute", "leechseed", "tailwind", "protect"], eventPokemon: [ {"generation": 4, "level": 50, "moves":["seedflare", "aromatherapy", "substitute", "energyball"], "pokeball": "cherishball"}, {"generation": 4, "level": 30, "shiny": 1, "moves":["growth", "magicalleaf", "leechseed", "synthesis"]}, {"generation": 5, "level": 50, "moves":["seedflare", "leechseed", "synthesis", "sweetscent"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "moves":["growth", "magicalleaf", "seedflare", "airslash"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["seedflare", "aromatherapy", "substitute", "energyball"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "RU", }, shayminsky: { randomBattleMoves: ["seedflare", "earthpower", "airslash", "hiddenpowerfire", "substitute", "leechseed", "healingwish"], randomDoubleBattleMoves: ["seedflare", "earthpower", "airslash", "hiddenpowerfire", "rest", "substitute", "leechseed", "tailwind", "protect", "hiddenpowerice"], eventOnly: true, tier: "Uber", }, arceus: { randomBattleMoves: ["swordsdance", "extremespeed", "shadowclaw", "earthquake", "recover"], randomDoubleBattleMoves: ["swordsdance", "extremespeed", "shadowclaw", "earthquake", "recover", "protect"], eventPokemon: [ {"generation": 4, "level": 100, "moves":["judgment", "roaroftime", "spacialrend", "shadowforce"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "moves":["recover", "hyperbeam", "perishsong", "judgment"]}, {"generation": 6, "level": 100, "shiny": 1, "moves":["judgment", "blastburn", "hydrocannon", "earthpower"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["judgment", "perishsong", "hyperbeam", "recover"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, arceusbug: { randomBattleMoves: ["swordsdance", "xscissor", "stoneedge", "recover", "earthquake", "ironhead"], randomDoubleBattleMoves: ["swordsdance", "xscissor", "stoneedge", "recover", "earthquake", "ironhead", "protect"], eventOnly: true, requiredItems: ["Insect Plate", "Buginium Z"], }, arceusdark: { randomBattleMoves: ["calmmind", "judgment", "recover", "fireblast", "thunderbolt"], randomDoubleBattleMoves: ["calmmind", "judgment", "recover", "focusblast", "safeguard", "snarl", "willowisp", "protect"], eventOnly: true, requiredItems: ["Dread Plate", "Darkinium Z"], }, arceusdragon: { randomBattleMoves: ["swordsdance", "outrage", "extremespeed", "earthquake", "recover", "calmmind", "judgment", "fireblast", "earthpower"], randomDoubleBattleMoves: ["swordsdance", "dragonclaw", "extremespeed", "earthquake", "recover", "protect"], eventOnly: true, requiredItems: ["Draco Plate", "Dragonium Z"], }, arceuselectric: { randomBattleMoves: ["calmmind", "judgment", "recover", "icebeam", "grassknot", "fireblast", "willowisp"], randomDoubleBattleMoves: ["calmmind", "judgment", "recover", "icebeam", "protect"], eventOnly: true, requiredItems: ["Zap Plate", "Electrium Z"], }, arceusfairy: { randomBattleMoves: ["calmmind", "judgment", "recover", "willowisp", "defog", "thunderbolt", "toxic", "fireblast"], randomDoubleBattleMoves: ["calmmind", "judgment", "recover", "willowisp", "protect", "earthpower", "thunderbolt"], eventOnly: true, requiredItems: ["Pixie Plate", "Fairium Z"], }, arceusfighting: { randomBattleMoves: ["calmmind", "judgment", "stoneedge", "shadowball", "recover", "toxic", "defog"], randomDoubleBattleMoves: ["calmmind", "judgment", "icebeam", "shadowball", "recover", "willowisp", "protect"], eventOnly: true, requiredItems: ["Fist Plate", "Fightinium Z"], }, arceusfire: { randomBattleMoves: ["calmmind", "judgment", "grassknot", "thunderbolt", "icebeam", "recover"], randomDoubleBattleMoves: ["calmmind", "judgment", "thunderbolt", "recover", "heatwave", "protect", "willowisp"], eventOnly: true, requiredItems: ["Flame Plate", "Firium Z"], }, arceusflying: { randomBattleMoves: ["calmmind", "judgment", "earthpower", "fireblast", "substitute", "recover"], randomDoubleBattleMoves: ["calmmind", "judgment", "safeguard", "recover", "substitute", "tailwind", "protect"], eventOnly: true, requiredItems: ["Sky Plate", "Flyinium Z"], }, arceusghost: { randomBattleMoves: ["calmmind", "judgment", "focusblast", "recover", "swordsdance", "shadowforce", "brickbreak", "willowisp", "roar", "defog"], randomDoubleBattleMoves: ["calmmind", "judgment", "focusblast", "recover", "swordsdance", "shadowforce", "brickbreak", "willowisp", "protect"], eventOnly: true, requiredItems: ["Spooky Plate", "Ghostium Z"], }, arceusgrass: { randomBattleMoves: ["judgment", "recover", "calmmind", "icebeam", "fireblast"], randomDoubleBattleMoves: ["calmmind", "icebeam", "judgment", "earthpower", "recover", "safeguard", "thunderwave", "protect"], eventOnly: true, requiredItems: ["Meadow Plate", "Grassium Z"], }, arceusground: { randomBattleMoves: ["swordsdance", "earthquake", "stoneedge", "recover", "extremespeed", "icebeam"], randomDoubleBattleMoves: ["swordsdance", "earthquake", "stoneedge", "recover", "calmmind", "judgment", "icebeam", "rockslide", "protect"], eventOnly: true, requiredItems: ["Earth Plate", "Groundium Z"], }, arceusice: { randomBattleMoves: ["calmmind", "judgment", "thunderbolt", "fireblast", "recover"], randomDoubleBattleMoves: ["calmmind", "judgment", "thunderbolt", "focusblast", "recover", "protect", "icywind"], eventOnly: true, requiredItems: ["Icicle Plate", "Icium Z"], }, arceuspoison: { randomBattleMoves: ["calmmind", "sludgebomb", "fireblast", "recover", "willowisp", "defog", "thunderwave"], randomDoubleBattleMoves: ["calmmind", "judgment", "sludgebomb", "heatwave", "recover", "willowisp", "protect", "earthpower"], eventOnly: true, requiredItems: ["Toxic Plate", "Poisonium Z"], }, arceuspsychic: { randomBattleMoves: ["judgment", "calmmind", "focusblast", "recover", "defog", "thunderbolt", "willowisp"], randomDoubleBattleMoves: ["calmmind", "psyshock", "focusblast", "recover", "willowisp", "judgment", "protect"], eventOnly: true, requiredItems: ["Mind Plate", "Psychium Z"], }, arceusrock: { randomBattleMoves: ["recover", "swordsdance", "earthquake", "stoneedge", "extremespeed"], randomDoubleBattleMoves: ["swordsdance", "stoneedge", "recover", "rockslide", "earthquake", "protect"], eventOnly: true, requiredItems: ["Stone Plate", "Rockium Z"], }, arceussteel: { randomBattleMoves: ["calmmind", "judgment", "recover", "willowisp", "thunderbolt", "swordsdance", "ironhead", "earthquake", "stoneedge"], randomDoubleBattleMoves: ["calmmind", "judgment", "recover", "protect", "willowisp"], eventOnly: true, requiredItems: ["Iron Plate", "Steelium Z"], }, arceuswater: { randomBattleMoves: ["recover", "calmmind", "judgment", "substitute", "willowisp", "thunderbolt"], randomDoubleBattleMoves: ["recover", "calmmind", "judgment", "icebeam", "fireblast", "icywind", "surf", "protect"], eventOnly: true, requiredItems: ["Splash Plate", "Waterium Z"], }, victini: { randomBattleMoves: ["vcreate", "boltstrike", "uturn", "zenheadbutt", "grassknot", "focusblast", "blueflare"], randomDoubleBattleMoves: ["vcreate", "boltstrike", "uturn", "psychic", "focusblast", "blueflare", "protect"], eventPokemon: [ {"generation": 5, "level": 15, "moves":["quickattack", "incinerate", "confusion", "endure"]}, {"generation": 5, "level": 50, "moves":["vcreate", "fusionflare", "fusionbolt", "searingshot"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "moves":["vcreate", "blueflare", "boltstrike", "glaciate"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "moves":["confusion", "quickattack", "vcreate", "searingshot"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["incinerate", "quickattack", "endure", "confusion"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "moves":["quickattack", "swagger", "vcreate"], "pokeball": "cherishball"}, {"generation": 7, "level": 15, "moves":["vcreate", "reversal", "storedpower", "celebrate"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "BL", }, snivy: { randomBattleMoves: ["leafstorm", "hiddenpowerfire", "substitute", "leechseed", "hiddenpowerice", "gigadrain"], eventPokemon: [ {"generation": 5, "level": 5, "gender": "M", "nature": "Hardy", "isHidden": false, "moves":["growth", "synthesis", "energyball", "aromatherapy"], "pokeball": "cherishball"}, ], tier: "LC", }, servine: { randomBattleMoves: ["leafstorm", "hiddenpowerfire", "substitute", "leechseed", "hiddenpowerice", "gigadrain"], tier: "NFE", }, serperior: { randomBattleMoves: ["leafstorm", "dragonpulse", "hiddenpowerfire", "substitute", "leechseed", "glare"], randomDoubleBattleMoves: ["leafstorm", "hiddenpowerfire", "substitute", "taunt", "dragonpulse", "protect"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["leafstorm", "substitute", "gigadrain", "leechseed"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "isHidden": true, "moves":["leafstorm", "holdback", "wringout", "gigadrain"], "pokeball": "cherishball"}, ], tier: "BL", }, tepig: { randomBattleMoves: ["flamecharge", "flareblitz", "wildcharge", "superpower", "headsmash"], tier: "LC", }, pignite: { randomBattleMoves: ["flamecharge", "flareblitz", "wildcharge", "superpower", "headsmash"], tier: "NFE", }, emboar: { randomBattleMoves: ["flareblitz", "superpower", "wildcharge", "stoneedge", "fireblast", "grassknot", "suckerpunch"], randomDoubleBattleMoves: ["flareblitz", "superpower", "flamecharge", "wildcharge", "headsmash", "protect", "heatwave", "rockslide"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["flareblitz", "hammerarm", "wildcharge", "headsmash"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "isHidden": true, "moves":["flareblitz", "holdback", "headsmash", "takedown"], "pokeball": "cherishball"}, ], tier: "NU", }, oshawott: { randomBattleMoves: ["swordsdance", "waterfall", "aquajet", "xscissor"], tier: "LC", }, dewott: { randomBattleMoves: ["swordsdance", "waterfall", "aquajet", "xscissor"], tier: "NFE", }, samurott: { randomBattleMoves: ["swordsdance", "waterfall", "aquajet", "megahorn", "superpower", "hydropump", "icebeam", "grassknot"], randomDoubleBattleMoves: ["hydropump", "aquajet", "icebeam", "scald", "hiddenpowergrass", "taunt", "helpinghand", "protect"], eventPokemon: [ {"generation": 5, "level": 100, "gender": "M", "isHidden": false, "moves":["hydropump", "icebeam", "megahorn", "superpower"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "isHidden": true, "moves":["razorshell", "holdback", "confide", "hydropump"], "pokeball": "cherishball"}, ], tier: "BL4", }, patrat: { randomBattleMoves: ["swordsdance", "batonpass", "substitute", "hypnosis", "return", "superfang"], tier: "LC", }, watchog: { randomBattleMoves: ["hypnosis", "substitute", "batonpass", "superfang", "swordsdance", "return", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "knockoff", "substitute", "hypnosis", "return", "superfang", "protect"], tier: "PU", }, lillipup: { randomBattleMoves: ["return", "wildcharge", "firefang", "crunch", "icefang"], tier: "LC", }, herdier: { randomBattleMoves: ["return", "wildcharge", "firefang", "crunch", "icefang"], tier: "NFE", }, stoutland: { randomBattleMoves: ["return", "crunch", "wildcharge", "superpower", "icefang"], randomDoubleBattleMoves: ["return", "wildcharge", "superpower", "crunch", "icefang", "protect"], tier: "PU", }, purrloin: { randomBattleMoves: ["encore", "taunt", "uturn", "knockoff", "thunderwave"], tier: "LC", }, liepard: { randomBattleMoves: ["knockoff", "encore", "suckerpunch", "thunderwave", "uturn", "substitute", "nastyplot", "darkpulse", "copycat"], randomDoubleBattleMoves: ["encore", "thunderwave", "substitute", "knockoff", "playrough", "uturn", "suckerpunch", "fakeout", "protect"], eventPokemon: [ {"generation": 5, "level": 20, "gender": "F", "nature": "Jolly", "isHidden": true, "moves":["fakeout", "foulplay", "encore", "swagger"]}, ], tier: "PU", }, pansage: { randomBattleMoves: ["leafstorm", "hiddenpowerfire", "hiddenpowerice", "gigadrain", "nastyplot", "substitute", "leechseed"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": 1, "gender": "M", "nature": "Brave", "ivs": {"spa": 31}, "isHidden": false, "moves":["bulletseed", "bite", "solarbeam", "dig"]}, {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["leer", "lick", "vinewhip", "leafstorm"]}, {"generation": 5, "level": 30, "gender": "M", "nature": "Serious", "isHidden": false, "moves":["seedbomb", "solarbeam", "rocktomb", "dig"], "pokeball": "cherishball"}, ], tier: "LC", }, simisage: { randomBattleMoves: ["nastyplot", "gigadrain", "focusblast", "hiddenpowerice", "substitute", "leafstorm", "knockoff", "superpower"], randomDoubleBattleMoves: ["nastyplot", "leafstorm", "hiddenpowerfire", "hiddenpowerice", "gigadrain", "focusblast", "substitute", "taunt", "synthesis", "helpinghand", "protect"], tier: "PU", }, pansear: { randomBattleMoves: ["nastyplot", "fireblast", "hiddenpowerelectric", "hiddenpowerground", "sunnyday", "solarbeam", "overheat"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["leer", "lick", "incinerate", "heatwave"]}, ], tier: "LC", }, simisear: { randomBattleMoves: ["substitute", "nastyplot", "fireblast", "focusblast", "grassknot", "hiddenpowerrock"], randomDoubleBattleMoves: ["nastyplot", "fireblast", "focusblast", "grassknot", "hiddenpowerground", "substitute", "heatwave", "taunt", "protect"], eventPokemon: [ {"generation": 6, "level": 5, "perfectIVs": 2, "isHidden": false, "moves":["workup", "honeclaws", "poweruppunch", "gigaimpact"], "pokeball": "cherishball"}, ], tier: "PU", }, panpour: { randomBattleMoves: ["nastyplot", "hydropump", "hiddenpowergrass", "substitute", "surf", "icebeam"], eventPokemon: [ {"generation": 5, "level": 10, "gender": "M", "isHidden": true, "moves":["leer", "lick", "watergun", "hydropump"]}, ], tier: "LC", }, simipour: { randomBattleMoves: ["substitute", "nastyplot", "hydropump", "icebeam", "focusblast"], randomDoubleBattleMoves: ["nastyplot", "hydropump", "icebeam", "substitute", "surf", "taunt", "helpinghand", "protect"], tier: "PU", }, munna: { randomBattleMoves: ["psychic", "hiddenpowerfighting", "hypnosis", "calmmind", "moonlight", "thunderwave", "batonpass", "psyshock", "healbell", "signalbeam"], tier: "LC", }, musharna: { randomBattleMoves: ["calmmind", "psychic", "psyshock", "signalbeam", "batonpass", "moonlight", "healbell", "thunderwave"], randomDoubleBattleMoves: ["trickroom", "thunderwave", "moonlight", "psychic", "hiddenpowerfighting", "helpinghand", "psyshock", "hypnosis", "signalbeam", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "isHidden": true, "moves":["defensecurl", "luckychant", "psybeam", "hypnosis"]}, ], tier: "PU", }, pidove: { randomBattleMoves: ["pluck", "uturn", "return", "detect", "roost", "wish"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": 1, "gender": "F", "nature": "Hardy", "ivs": {"atk": 31}, "isHidden": false, "abilities":["superluck"], "moves":["gust", "quickattack", "aircutter"]}, ], tier: "LC", }, tranquill: { randomBattleMoves: ["pluck", "uturn", "return", "detect", "roost", "wish"], tier: "NFE", }, unfezant: { randomBattleMoves: ["return", "pluck", "hypnosis", "tailwind", "uturn", "roost", "nightslash"], randomDoubleBattleMoves: ["pluck", "uturn", "return", "protect", "tailwind", "taunt", "roost", "nightslash"], tier: "PU", }, blitzle: { randomBattleMoves: ["voltswitch", "hiddenpowergrass", "wildcharge", "mefirst"], tier: "LC", }, zebstrika: { randomBattleMoves: ["voltswitch", "hiddenpowergrass", "overheat", "wildcharge", "thunderbolt"], randomDoubleBattleMoves: ["voltswitch", "hiddenpowergrass", "overheat", "wildcharge", "protect"], tier: "PU", }, roggenrola: { randomBattleMoves: ["autotomize", "stoneedge", "stealthrock", "rockblast", "earthquake", "explosion"], tier: "LC", }, boldore: { randomBattleMoves: ["autotomize", "stoneedge", "stealthrock", "rockblast", "earthquake", "explosion"], tier: "NFE", }, gigalith: { randomBattleMoves: ["stealthrock", "rockblast", "earthquake", "explosion", "stoneedge", "superpower"], randomDoubleBattleMoves: ["stealthrock", "rockslide", "earthquake", "explosion", "stoneedge", "autotomize", "superpower", "wideguard", "protect"], tier: "RU", }, woobat: { randomBattleMoves: ["calmmind", "psychic", "airslash", "gigadrain", "roost", "heatwave", "storedpower"], tier: "LC", }, swoobat: { randomBattleMoves: ["substitute", "calmmind", "storedpower", "heatwave", "psychic", "airslash", "roost"], randomDoubleBattleMoves: ["calmmind", "psychic", "airslash", "gigadrain", "protect", "heatwave", "tailwind"], tier: "PU", }, drilbur: { randomBattleMoves: ["swordsdance", "rapidspin", "earthquake", "rockslide", "shadowclaw", "return", "xscissor"], tier: "LC", }, excadrill: { randomBattleMoves: ["swordsdance", "earthquake", "ironhead", "rockslide", "rapidspin"], randomDoubleBattleMoves: ["swordsdance", "drillrun", "earthquake", "rockslide", "ironhead", "substitute", "protect"], tier: "OU", }, audino: { randomBattleMoves: ["wish", "protect", "healbell", "toxic", "thunderwave", "reflect", "lightscreen", "doubleedge"], randomDoubleBattleMoves: ["healpulse", "protect", "healbell", "trickroom", "thunderwave", "reflect", "lightscreen", "doubleedge", "helpinghand", "hypervoice"], eventPokemon: [ {"generation": 5, "level": 30, "gender": "F", "nature": "Calm", "isHidden": false, "abilities":["healer"], "moves":["healpulse", "helpinghand", "refresh", "doubleslap"], "pokeball": "cherishball"}, {"generation": 5, "level": 30, "gender": "F", "nature": "Serious", "isHidden": false, "abilities":["healer"], "moves":["healpulse", "helpinghand", "refresh", "present"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "nature": "Relaxed", "isHidden": false, "abilities":["regenerator"], "moves":["trickroom", "healpulse", "simplebeam", "thunderbolt"], "pokeball": "cherishball"}, ], tier: "PU", }, audinomega: { randomBattleMoves: ["wish", "calmmind", "healbell", "dazzlinggleam", "hypervoice", "protect", "fireblast"], randomDoubleBattleMoves: ["healpulse", "protect", "healbell", "trickroom", "thunderwave", "hypervoice", "helpinghand", "dazzlinggleam"], requiredItem: "Audinite", tier: "NU", }, timburr: { randomBattleMoves: ["machpunch", "bulkup", "drainpunch", "icepunch", "knockoff"], tier: "LC", }, gurdurr: { randomBattleMoves: ["bulkup", "machpunch", "drainpunch", "icepunch", "knockoff"], tier: "NFE", }, conkeldurr: { randomBattleMoves: ["bulkup", "drainpunch", "icepunch", "knockoff", "machpunch"], randomDoubleBattleMoves: ["wideguard", "machpunch", "drainpunch", "icepunch", "knockoff", "protect"], tier: "BL", }, tympole: { randomBattleMoves: ["hydropump", "surf", "sludgewave", "earthpower", "hiddenpowerelectric"], tier: "LC", }, palpitoad: { randomBattleMoves: ["hydropump", "surf", "sludgewave", "earthpower", "hiddenpowerelectric", "stealthrock"], tier: "NFE", }, seismitoad: { randomBattleMoves: ["hydropump", "scald", "sludgewave", "earthquake", "knockoff", "stealthrock", "toxic", "raindance"], randomDoubleBattleMoves: ["hydropump", "muddywater", "sludgebomb", "earthquake", "hiddenpowerelectric", "icywind", "protect"], tier: "NU", }, throh: { randomBattleMoves: ["bulkup", "circlethrow", "icepunch", "stormthrow", "rest", "sleeptalk", "knockoff"], randomDoubleBattleMoves: ["helpinghand", "circlethrow", "icepunch", "stormthrow", "wideguard", "knockoff", "protect"], tier: "PU", }, sawk: { randomBattleMoves: ["closecombat", "earthquake", "icepunch", "poisonjab", "bulkup", "knockoff"], randomDoubleBattleMoves: ["closecombat", "knockoff", "icepunch", "rockslide", "protect"], tier: "BL4", }, sewaddle: { randomBattleMoves: ["calmmind", "gigadrain", "bugbuzz", "hiddenpowerfire", "hiddenpowerice", "airslash"], tier: "LC", }, swadloon: { randomBattleMoves: ["calmmind", "gigadrain", "bugbuzz", "hiddenpowerfire", "hiddenpowerice", "airslash", "stickyweb"], tier: "NFE", }, leavanny: { randomBattleMoves: ["stickyweb", "swordsdance", "leafblade", "xscissor", "knockoff", "batonpass"], randomDoubleBattleMoves: ["swordsdance", "leafblade", "xscissor", "protect", "stickyweb", "poisonjab"], tier: "PU", }, venipede: { randomBattleMoves: ["toxicspikes", "infestation", "spikes", "endeavor", "protect"], tier: "LC", }, whirlipede: { randomBattleMoves: ["toxicspikes", "infestation", "spikes", "endeavor", "protect"], tier: "NFE", }, scolipede: { randomBattleMoves: ["substitute", "spikes", "toxicspikes", "megahorn", "rockslide", "earthquake", "swordsdance", "batonpass", "poisonjab"], randomDoubleBattleMoves: ["substitute", "protect", "megahorn", "rockslide", "poisonjab", "swordsdance", "batonpass", "aquatail", "superpower"], tier: "BL", }, cottonee: { randomBattleMoves: ["encore", "taunt", "substitute", "leechseed", "toxic", "stunspore"], tier: "LC", }, whimsicott: { randomBattleMoves: ["encore", "taunt", "substitute", "leechseed", "uturn", "toxic", "stunspore", "memento", "tailwind", "moonblast"], randomDoubleBattleMoves: ["encore", "taunt", "substitute", "leechseed", "uturn", "helpinghand", "stunspore", "moonblast", "tailwind", "dazzlinggleam", "gigadrain", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "gender": "F", "nature": "Timid", "ivs": {"spe": 31}, "isHidden": false, "abilities":["prankster"], "moves":["swagger", "gigadrain", "beatup", "helpinghand"], "pokeball": "cherishball"}, ], tier: "NU", }, petilil: { randomBattleMoves: ["sunnyday", "sleeppowder", "solarbeam", "hiddenpowerfire", "hiddenpowerice", "healingwish"], tier: "LC", }, lilligant: { randomBattleMoves: ["sleeppowder", "quiverdance", "petaldance", "gigadrain", "hiddenpowerfire", "hiddenpowerrock"], randomDoubleBattleMoves: ["quiverdance", "gigadrain", "sleeppowder", "hiddenpowerice", "hiddenpowerfire", "hiddenpowerrock", "petaldance", "helpinghand", "protect"], tier: "PU", }, basculin: { randomBattleMoves: ["waterfall", "aquajet", "superpower", "crunch", "headsmash"], randomDoubleBattleMoves: ["waterfall", "aquajet", "superpower", "crunch", "doubleedge", "protect"], tier: "PU", }, basculinbluestriped: { randomBattleMoves: ["waterfall", "aquajet", "superpower", "crunch", "headsmash"], randomDoubleBattleMoves: ["waterfall", "aquajet", "superpower", "crunch", "doubleedge", "protect"], tier: "PU", }, sandile: { randomBattleMoves: ["earthquake", "stoneedge", "pursuit", "crunch"], tier: "LC", }, krokorok: { randomBattleMoves: ["earthquake", "stoneedge", "pursuit", "crunch"], tier: "NFE", }, krookodile: { randomBattleMoves: ["earthquake", "stoneedge", "pursuit", "knockoff", "stealthrock", "superpower"], randomDoubleBattleMoves: ["earthquake", "stoneedge", "protect", "knockoff", "superpower"], tier: "UU", }, darumaka: { randomBattleMoves: ["uturn", "flareblitz", "firepunch", "rockslide", "superpower"], tier: "LC", }, darmanitan: { randomBattleMoves: ["uturn", "flareblitz", "rockslide", "earthquake", "superpower"], randomDoubleBattleMoves: ["uturn", "flareblitz", "firepunch", "rockslide", "earthquake", "superpower", "protect"], eventPokemon: [ {"generation": 5, "level": 35, "isHidden": true, "moves":["thrash", "bellydrum", "flareblitz", "hammerarm"]}, {"generation": 6, "level": 35, "gender": "M", "nature": "Calm", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": true, "moves":["thrash", "bellydrum", "flareblitz", "hammerarm"], "pokeball": "cherishball"}, ], tier: "UU", }, darmanitanzen: { requiredAbility: "Zen Mode", battleOnly: true, }, maractus: { randomBattleMoves: ["spikes", "gigadrain", "leechseed", "hiddenpowerfire", "toxic", "suckerpunch", "spikyshield"], randomDoubleBattleMoves: ["grassyterrain", "gigadrain", "leechseed", "hiddenpowerfire", "helpinghand", "suckerpunch", "spikyshield"], tier: "PU", }, dwebble: { randomBattleMoves: ["stealthrock", "spikes", "shellsmash", "earthquake", "rockblast", "xscissor", "stoneedge"], tier: "LC", }, crustle: { randomBattleMoves: ["stealthrock", "spikes", "shellsmash", "earthquake", "rockblast", "xscissor", "stoneedge"], randomDoubleBattleMoves: ["protect", "shellsmash", "earthquake", "rockslide", "xscissor", "stoneedge"], tier: "PU", }, scraggy: { randomBattleMoves: ["dragondance", "icepunch", "highjumpkick", "drainpunch", "rest", "bulkup", "crunch", "knockoff"], eventPokemon: [ {"generation": 5, "level": 1, "gender": "M", "nature": "Adamant", "isHidden": false, "abilities":["moxie"], "moves":["headbutt", "leer", "highjumpkick", "lowkick"], "pokeball": "cherishball"}, ], tier: "LC", }, scrafty: { randomBattleMoves: ["dragondance", "icepunch", "highjumpkick", "drainpunch", "rest", "bulkup", "knockoff"], randomDoubleBattleMoves: ["fakeout", "drainpunch", "knockoff", "icepunch", "stoneedge", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "gender": "M", "nature": "Brave", "isHidden": false, "abilities":["moxie"], "moves":["firepunch", "payback", "drainpunch", "substitute"], "pokeball": "cherishball"}, ], tier: "NU", }, sigilyph: { randomBattleMoves: ["cosmicpower", "roost", "storedpower", "psychoshift"], randomDoubleBattleMoves: ["psyshock", "heatwave", "icebeam", "airslash", "energyball", "shadowball", "tailwind", "protect"], tier: "NU", }, yamask: { randomBattleMoves: ["nastyplot", "trickroom", "shadowball", "hiddenpowerfighting", "willowisp", "haze", "rest", "sleeptalk", "painsplit"], tier: "LC", }, cofagrigus: { randomBattleMoves: ["nastyplot", "trickroom", "shadowball", "hiddenpowerfighting", "willowisp", "haze", "painsplit"], randomDoubleBattleMoves: ["nastyplot", "trickroom", "shadowball", "hiddenpowerfighting", "willowisp", "protect", "painsplit"], tier: "BL3", }, tirtouga: { randomBattleMoves: ["shellsmash", "aquajet", "waterfall", "stoneedge", "earthquake", "stealthrock"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "isHidden": false, "abilities":["sturdy"], "moves":["bite", "protect", "aquajet", "bodyslam"], "pokeball": "cherishball"}, ], tier: "LC", }, carracosta: { randomBattleMoves: ["shellsmash", "aquajet", "liquidation", "stoneedge", "earthquake", "stealthrock"], randomDoubleBattleMoves: ["shellsmash", "aquajet", "waterfall", "stoneedge", "earthquake", "protect", "wideguard", "rockslide"], tier: "PU", }, archen: { randomBattleMoves: ["stoneedge", "rockslide", "earthquake", "uturn", "pluck", "headsmash"], eventPokemon: [ {"generation": 5, "level": 15, "gender": "M", "moves":["headsmash", "wingattack", "doubleteam", "scaryface"], "pokeball": "cherishball"}, ], tier: "LC", }, archeops: { randomBattleMoves: ["headsmash", "acrobatics", "stoneedge", "earthquake", "aquatail", "uturn", "tailwind"], randomDoubleBattleMoves: ["stoneedge", "rockslide", "earthquake", "uturn", "acrobatics", "tailwind", "taunt", "protect"], tier: "PU", }, trubbish: { randomBattleMoves: ["clearsmog", "toxicspikes", "spikes", "gunkshot", "painsplit", "toxic"], tier: "LC", }, garbodor: { randomBattleMoves: ["spikes", "toxicspikes", "gunkshot", "haze", "painsplit", "toxic", "drainpunch"], randomDoubleBattleMoves: ["protect", "painsplit", "gunkshot", "seedbomb", "drainpunch", "explosion", "rockblast"], tier: "NU", }, zorua: { randomBattleMoves: ["suckerpunch", "extrasensory", "darkpulse", "hiddenpowerfighting", "uturn", "knockoff"], tier: "LC", }, zoroark: { randomBattleMoves: ["suckerpunch", "darkpulse", "focusblast", "flamethrower", "uturn", "nastyplot", "knockoff", "trick", "sludgebomb"], randomDoubleBattleMoves: ["suckerpunch", "darkpulse", "focusblast", "flamethrower", "uturn", "nastyplot", "knockoff", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "gender": "M", "nature": "Quirky", "moves":["agility", "embargo", "punishment", "snarl"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "moves":["sludgebomb", "darkpulse", "flamethrower", "suckerpunch"], "pokeball": "ultraball"}, ], tier: "RU", }, minccino: { randomBattleMoves: ["return", "tailslap", "wakeupslap", "uturn", "aquatail"], tier: "LC", }, cinccino: { randomBattleMoves: ["tailslap", "aquatail", "uturn", "knockoff", "bulletseed", "rockblast"], randomDoubleBattleMoves: ["tailslap", "aquatail", "uturn", "knockoff", "bulletseed", "rockblast", "protect"], tier: "NU", }, gothita: { randomBattleMoves: ["psychic", "thunderbolt", "hiddenpowerfighting", "shadowball", "substitute", "calmmind", "trick", "grassknot"], tier: "LC Uber", }, gothorita: { randomBattleMoves: ["psychic", "psyshock", "thunderbolt", "hiddenpowerfighting", "shadowball", "substitute", "calmmind", "trick", "grassknot"], eventPokemon: [ {"generation": 5, "level": 32, "gender": "M", "isHidden": true, "moves":["psyshock", "flatter", "futuresight", "mirrorcoat"]}, {"generation": 5, "level": 32, "gender": "M", "isHidden": true, "moves":["psyshock", "flatter", "futuresight", "imprison"]}, ], tier: "NFE", }, gothitelle: { randomBattleMoves: ["psychic", "thunderbolt", "shadowball", "hiddenpowerfire", "hiddenpowerfighting", "substitute", "calmmind", "trick", "psyshock"], randomDoubleBattleMoves: ["psychic", "thunderbolt", "shadowball", "hiddenpowerfighting", "reflect", "lightscreen", "psyshock", "energyball", "trickroom", "taunt", "healpulse", "protect"], tier: "PU", }, solosis: { randomBattleMoves: ["calmmind", "recover", "psychic", "hiddenpowerfighting", "shadowball", "trickroom", "psyshock"], tier: "LC", }, duosion: { randomBattleMoves: ["calmmind", "recover", "psychic", "hiddenpowerfighting", "shadowball", "trickroom", "psyshock"], tier: "NFE", }, reuniclus: { randomBattleMoves: ["calmmind", "recover", "psychic", "focusblast", "shadowball", "trickroom", "psyshock"], randomDoubleBattleMoves: ["energyball", "helpinghand", "psychic", "focusblast", "shadowball", "trickroom", "psyshock", "hiddenpowerfire", "protect"], tier: "BL2", }, ducklett: { randomBattleMoves: ["scald", "airslash", "roost", "hurricane", "icebeam", "hiddenpowergrass", "bravebird", "defog"], tier: "LC", }, swanna: { randomBattleMoves: ["airslash", "roost", "hurricane", "icebeam", "raindance", "defog", "scald"], randomDoubleBattleMoves: ["airslash", "roost", "hurricane", "surf", "icebeam", "raindance", "tailwind", "scald", "protect"], tier: "PU", }, vanillite: { randomBattleMoves: ["icebeam", "explosion", "hiddenpowerelectric", "hiddenpowerfighting", "autotomize"], tier: "LC", }, vanillish: { randomBattleMoves: ["icebeam", "explosion", "hiddenpowerelectric", "hiddenpowerfighting", "autotomize"], tier: "NFE", }, vanilluxe: { randomBattleMoves: ["blizzard", "explosion", "hiddenpowerground", "flashcannon", "autotomize", "freezedry"], randomDoubleBattleMoves: ["blizzard", "taunt", "hiddenpowerground", "flashcannon", "autotomize", "protect", "freezedry"], tier: "NU", }, deerling: { randomBattleMoves: ["agility", "batonpass", "seedbomb", "jumpkick", "synthesis", "return", "thunderwave"], eventPokemon: [ {"generation": 5, "level": 30, "gender": "F", "isHidden": true, "moves":["feintattack", "takedown", "jumpkick", "aromatherapy"]}, ], tier: "LC", }, sawsbuck: { randomBattleMoves: ["swordsdance", "hornleech", "jumpkick", "return", "substitute", "batonpass"], randomDoubleBattleMoves: ["swordsdance", "hornleech", "jumpkick", "return", "substitute", "synthesis", "protect"], tier: "PU", }, emolga: { randomBattleMoves: ["encore", "chargebeam", "batonpass", "substitute", "thunderbolt", "airslash", "roost"], randomDoubleBattleMoves: ["helpinghand", "tailwind", "encore", "substitute", "thunderbolt", "airslash", "roost", "protect"], tier: "PU", }, karrablast: { randomBattleMoves: ["swordsdance", "megahorn", "return", "substitute"], eventPokemon: [ {"generation": 5, "level": 30, "isHidden": false, "moves":["furyattack", "headbutt", "falseswipe", "bugbuzz"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "isHidden": false, "moves":["megahorn", "takedown", "xscissor", "flail"], "pokeball": "cherishball"}, ], tier: "LC", }, escavalier: { randomBattleMoves: ["megahorn", "pursuit", "ironhead", "knockoff", "swordsdance", "drillrun"], randomDoubleBattleMoves: ["megahorn", "protect", "ironhead", "knockoff", "swordsdance", "drillrun"], tier: "RU", }, foongus: { randomBattleMoves: ["spore", "stunspore", "gigadrain", "clearsmog", "hiddenpowerfire", "synthesis", "sludgebomb"], tier: "LC", }, amoonguss: { randomBattleMoves: ["spore", "stunspore", "gigadrain", "clearsmog", "hiddenpowerfire", "synthesis", "sludgebomb", "foulplay"], randomDoubleBattleMoves: ["spore", "stunspore", "gigadrain", "ragepowder", "hiddenpowerfire", "synthesis", "sludgebomb", "protect"], tier: "UU", }, frillish: { randomBattleMoves: ["scald", "willowisp", "recover", "toxic", "shadowball", "taunt"], tier: "LC", }, jellicent: { randomBattleMoves: ["scald", "willowisp", "recover", "toxic", "shadowball", "icebeam", "taunt"], randomDoubleBattleMoves: ["scald", "willowisp", "recover", "trickroom", "shadowball", "icebeam", "waterspout", "icywind", "protect"], eventPokemon: [ {"generation": 5, "level": 40, "isHidden": true, "moves":["waterpulse", "ominouswind", "brine", "raindance"]}, ], tier: "NU", }, alomomola: { randomBattleMoves: ["wish", "protect", "knockoff", "toxic", "scald"], randomDoubleBattleMoves: ["wish", "protect", "knockoff", "icywind", "scald", "helpinghand", "wideguard"], tier: "UU", }, joltik: { randomBattleMoves: ["thunderbolt", "bugbuzz", "hiddenpowerice", "gigadrain", "voltswitch"], tier: "LC", }, galvantula: { randomBattleMoves: ["thunder", "hiddenpowerice", "gigadrain", "bugbuzz", "voltswitch", "stickyweb"], randomDoubleBattleMoves: ["thunder", "hiddenpowerice", "gigadrain", "bugbuzz", "voltswitch", "stickyweb", "protect"], tier: "RU", }, ferroseed: { randomBattleMoves: ["spikes", "stealthrock", "leechseed", "seedbomb", "protect", "thunderwave", "gyroball"], tier: "LC", }, ferrothorn: { randomBattleMoves: ["spikes", "stealthrock", "leechseed", "powerwhip", "protect", "knockoff", "gyroball"], randomDoubleBattleMoves: ["gyroball", "stealthrock", "leechseed", "powerwhip", "knockoff", "protect"], tier: "OU", }, klink: { randomBattleMoves: ["shiftgear", "return", "geargrind", "wildcharge", "substitute"], tier: "LC", }, klang: { randomBattleMoves: ["shiftgear", "return", "geargrind", "wildcharge", "substitute"], tier: "NFE", }, klinklang: { randomBattleMoves: ["shiftgear", "return", "geargrind", "wildcharge", "substitute"], randomDoubleBattleMoves: ["shiftgear", "return", "geargrind", "wildcharge", "protect"], tier: "BL4", }, tynamo: { randomBattleMoves: ["spark", "chargebeam", "thunderwave", "tackle"], tier: "LC", }, eelektrik: { randomBattleMoves: ["uturn", "voltswitch", "acidspray", "wildcharge", "thunderbolt", "gigadrain", "aquatail", "coil"], tier: "NFE", }, eelektross: { randomBattleMoves: ["thunderbolt", "flamethrower", "uturn", "voltswitch", "acidspray", "gigadrain", "knockoff", "superpower", "aquatail"], randomDoubleBattleMoves: ["thunderbolt", "flamethrower", "uturn", "voltswitch", "knockoff", "gigadrain", "protect"], tier: "PU", }, elgyem: { randomBattleMoves: ["nastyplot", "psychic", "thunderbolt", "hiddenpowerfighting", "recover", "trickroom", "signalbeam"], tier: "LC", }, beheeyem: { randomBattleMoves: ["nastyplot", "psychic", "psyshock", "thunderbolt", "hiddenpowerfighting", "trick", "trickroom", "signalbeam"], randomDoubleBattleMoves: ["nastyplot", "psychic", "thunderbolt", "hiddenpowerfighting", "recover", "trick", "trickroom", "signalbeam", "protect"], tier: "PU", }, litwick: { randomBattleMoves: ["shadowball", "energyball", "fireblast", "hiddenpowerground", "trickroom", "substitute", "painsplit"], tier: "LC", }, lampent: { randomBattleMoves: ["calmmind", "shadowball", "energyball", "fireblast", "hiddenpowerground", "substitute", "painsplit"], tier: "NFE", }, chandelure: { randomBattleMoves: ["calmmind", "shadowball", "energyball", "fireblast", "hiddenpowerground", "trick", "substitute", "painsplit"], randomDoubleBattleMoves: ["shadowball", "energyball", "overheat", "heatwave", "hiddenpowerice", "trick", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "gender": "F", "nature": "Modest", "ivs": {"spa": 31}, "isHidden": false, "abilities":["flashfire"], "moves":["heatwave", "shadowball", "energyball", "psychic"], "pokeball": "cherishball"}, ], tier: "UU", }, axew: { randomBattleMoves: ["dragondance", "outrage", "dragonclaw", "swordsdance", "aquatail", "superpower", "poisonjab", "taunt", "substitute"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": 1, "gender": "M", "nature": "Naive", "ivs": {"spe": 31}, "isHidden": false, "abilities":["moldbreaker"], "moves":["scratch", "dragonrage"]}, {"generation": 5, "level": 10, "gender": "F", "isHidden": false, "abilities":["moldbreaker"], "moves":["dragonrage", "return", "endure", "dragonclaw"], "pokeball": "cherishball"}, {"generation": 5, "level": 30, "gender": "M", "nature": "Naive", "isHidden": false, "abilities":["rivalry"], "moves":["dragonrage", "scratch", "outrage", "gigaimpact"], "pokeball": "cherishball"}, ], tier: "LC", }, fraxure: { randomBattleMoves: ["dragondance", "swordsdance", "outrage", "dragonclaw", "aquatail", "superpower", "poisonjab", "taunt", "substitute"], tier: "NFE", }, haxorus: { randomBattleMoves: ["dragondance", "swordsdance", "outrage", "dragonclaw", "earthquake", "poisonjab", "taunt", "substitute"], randomDoubleBattleMoves: ["dragondance", "swordsdance", "protect", "dragonclaw", "earthquake", "poisonjab", "taunt", "substitute"], eventPokemon: [ {"generation": 5, "level": 59, "gender": "F", "nature": "Naive", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "abilities":["moldbreaker"], "moves":["earthquake", "dualchop", "xscissor", "dragondance"], "pokeball": "cherishball"}, ], tier: "UU", }, cubchoo: { randomBattleMoves: ["icebeam", "surf", "hiddenpowergrass", "superpower"], eventPokemon: [ {"generation": 5, "level": 15, "isHidden": false, "moves":["powdersnow", "growl", "bide", "icywind"], "pokeball": "cherishball"}, ], tier: "LC", }, beartic: { randomBattleMoves: ["iciclecrash", "superpower", "nightslash", "stoneedge", "swordsdance", "aquajet"], randomDoubleBattleMoves: ["iciclecrash", "superpower", "nightslash", "stoneedge", "swordsdance", "aquajet", "protect"], tier: "PU", }, cryogonal: { randomBattleMoves: ["icebeam", "recover", "toxic", "rapidspin", "haze", "freezedry", "hiddenpowerground"], randomDoubleBattleMoves: ["icebeam", "recover", "icywind", "protect", "reflect", "freezedry", "hiddenpowerground"], tier: "NU", }, shelmet: { randomBattleMoves: ["spikes", "yawn", "substitute", "acidarmor", "batonpass", "recover", "toxic", "bugbuzz", "infestation"], eventPokemon: [ {"generation": 5, "level": 30, "isHidden": false, "moves":["strugglebug", "megadrain", "yawn", "protect"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "isHidden": false, "moves":["encore", "gigadrain", "bodyslam", "bugbuzz"], "pokeball": "cherishball"}, ], tier: "LC", }, accelgor: { randomBattleMoves: ["spikes", "yawn", "bugbuzz", "focusblast", "gigadrain", "hiddenpowerrock", "encore"], randomDoubleBattleMoves: ["protect", "yawn", "bugbuzz", "focusblast", "gigadrain", "hiddenpowerrock", "encore", "sludgebomb"], tier: "NU", }, stunfisk: { randomBattleMoves: ["discharge", "earthpower", "scald", "toxic", "rest", "sleeptalk", "stealthrock"], randomDoubleBattleMoves: ["discharge", "earthpower", "scald", "electroweb", "protect", "stealthrock"], tier: "PU", }, mienfoo: { randomBattleMoves: ["uturn", "drainpunch", "stoneedge", "swordsdance", "batonpass", "highjumpkick", "fakeout", "knockoff"], tier: "LC", }, mienshao: { randomBattleMoves: ["uturn", "fakeout", "highjumpkick", "stoneedge", "substitute", "swordsdance", "batonpass", "knockoff"], randomDoubleBattleMoves: ["uturn", "fakeout", "highjumpkick", "stoneedge", "drainpunch", "swordsdance", "wideguard", "knockoff", "feint", "protect"], tier: "UU", }, druddigon: { randomBattleMoves: ["outrage", "earthquake", "suckerpunch", "dragonclaw", "dragontail", "substitute", "glare", "stealthrock", "firepunch", "gunkshot"], randomDoubleBattleMoves: ["superpower", "earthquake", "suckerpunch", "dragonclaw", "glare", "protect", "firepunch", "thunderpunch"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": true, "isHidden": false, "moves":["leer", "scratch"]}, ], tier: "NU", }, golett: { randomBattleMoves: ["earthquake", "shadowpunch", "dynamicpunch", "icepunch", "stealthrock", "rockpolish"], tier: "LC", }, golurk: { randomBattleMoves: ["earthquake", "shadowpunch", "dynamicpunch", "icepunch", "stealthrock", "rockpolish"], randomDoubleBattleMoves: ["earthquake", "shadowpunch", "dynamicpunch", "icepunch", "stoneedge", "protect", "rockpolish"], eventPokemon: [ {"generation": 5, "level": 70, "shiny": true, "isHidden": false, "abilities":["ironfist"], "moves":["shadowpunch", "hyperbeam", "gyroball", "hammerarm"], "pokeball": "cherishball"}, ], tier: "PU", }, pawniard: { randomBattleMoves: ["swordsdance", "substitute", "suckerpunch", "ironhead", "brickbreak", "knockoff"], tier: "LC", }, bisharp: { randomBattleMoves: ["swordsdance", "substitute", "suckerpunch", "ironhead", "brickbreak", "knockoff"], randomDoubleBattleMoves: ["swordsdance", "substitute", "suckerpunch", "ironhead", "brickbreak", "knockoff", "protect"], tier: "OU", }, bouffalant: { randomBattleMoves: ["headcharge", "earthquake", "stoneedge", "megahorn", "swordsdance", "superpower"], randomDoubleBattleMoves: ["headcharge", "earthquake", "stoneedge", "megahorn", "swordsdance", "superpower", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "nature": "Adamant", "ivs": {"hp": 31, "atk": 31}, "isHidden": true, "moves":["headcharge", "facade", "earthquake", "rockslide"], "pokeball": "cherishball"}, ], tier: "PU", }, rufflet: { randomBattleMoves: ["bravebird", "rockslide", "return", "uturn", "substitute", "bulkup", "roost"], tier: "LC", }, braviary: { randomBattleMoves: ["bravebird", "superpower", "return", "uturn", "substitute", "rockslide", "bulkup", "roost"], randomDoubleBattleMoves: ["bravebird", "superpower", "return", "uturn", "tailwind", "rockslide", "bulkup", "roost", "skydrop", "protect"], eventPokemon: [ {"generation": 5, "level": 25, "gender": "M", "isHidden": true, "moves":["wingattack", "honeclaws", "scaryface", "aerialace"]}, ], tier: "NU", }, vullaby: { randomBattleMoves: ["knockoff", "roost", "taunt", "whirlwind", "toxic", "defog", "uturn", "bravebird"], tier: "LC", }, mandibuzz: { randomBattleMoves: ["foulplay", "knockoff", "roost", "taunt", "whirlwind", "toxic", "uturn", "bravebird", "defog"], randomDoubleBattleMoves: ["knockoff", "roost", "taunt", "tailwind", "snarl", "uturn", "bravebird", "protect"], eventPokemon: [ {"generation": 5, "level": 25, "gender": "F", "isHidden": true, "moves":["pluck", "nastyplot", "flatter", "feintattack"]}, ], tier: "UU", }, heatmor: { randomBattleMoves: ["fireblast", "suckerpunch", "focusblast", "gigadrain", "knockoff"], randomDoubleBattleMoves: ["fireblast", "suckerpunch", "focusblast", "gigadrain", "heatwave", "protect"], tier: "PU", }, durant: { randomBattleMoves: ["honeclaws", "ironhead", "xscissor", "stoneedge", "batonpass", "superpower"], randomDoubleBattleMoves: ["honeclaws", "ironhead", "xscissor", "rockslide", "protect", "superpower"], tier: "RU", }, deino: { randomBattleMoves: ["outrage", "crunch", "firefang", "dragontail", "thunderwave", "superpower"], eventPokemon: [ {"generation": 5, "level": 1, "shiny": true, "moves":["tackle", "dragonrage"]}, ], tier: "LC", }, zweilous: { randomBattleMoves: ["outrage", "crunch", "headsmash", "dragontail", "superpower", "rest", "sleeptalk"], tier: "NFE", }, hydreigon: { randomBattleMoves: ["uturn", "dracometeor", "dragonpulse", "earthpower", "fireblast", "darkpulse", "roost", "flashcannon", "superpower"], randomDoubleBattleMoves: ["uturn", "dracometeor", "dragonpulse", "earthpower", "fireblast", "darkpulse", "roost", "flashcannon", "superpower", "tailwind", "protect"], eventPokemon: [ {"generation": 5, "level": 70, "shiny": true, "gender": "M", "moves":["hypervoice", "dragonbreath", "flamethrower", "focusblast"], "pokeball": "cherishball"}, {"generation": 6, "level": 52, "gender": "M", "perfectIVs": 2, "moves":["dragonrush", "crunch", "rockslide", "frustration"], "pokeball": "cherishball"}, ], tier: "UU", }, larvesta: { randomBattleMoves: ["flareblitz", "uturn", "wildcharge", "zenheadbutt", "morningsun", "willowisp"], tier: "LC", }, volcarona: { randomBattleMoves: ["quiverdance", "fierydance", "fireblast", "bugbuzz", "roost", "gigadrain", "hiddenpowerice", "hiddenpowerground"], randomDoubleBattleMoves: ["quiverdance", "fierydance", "fireblast", "bugbuzz", "roost", "gigadrain", "hiddenpowerice", "heatwave", "willowisp", "ragepowder", "tailwind", "protect"], eventPokemon: [ {"generation": 5, "level": 35, "isHidden": false, "moves":["stringshot", "leechlife", "gust", "firespin"]}, {"generation": 5, "level": 77, "gender": "M", "nature": "Calm", "ivs": {"hp": 30, "atk": 30, "def": 30, "spa": 30, "spd": 30, "spe": 30}, "isHidden": false, "moves":["bugbuzz", "overheat", "hyperbeam", "quiverdance"], "pokeball": "cherishball"}, ], tier: "OU", }, cobalion: { randomBattleMoves: ["closecombat", "ironhead", "swordsdance", "substitute", "stoneedge", "voltswitch", "hiddenpowerice", "taunt", "stealthrock"], randomDoubleBattleMoves: ["closecombat", "ironhead", "swordsdance", "substitute", "stoneedge", "thunderwave", "protect"], eventPokemon: [ {"generation": 5, "level": 42, "shiny": 1, "moves":["helpinghand", "retaliate", "ironhead", "sacredsword"]}, {"generation": 5, "level": 45, "shiny": 1, "moves":["helpinghand", "retaliate", "ironhead", "sacredsword"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["sacredsword", "swordsdance", "quickguard", "workup"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["retaliate", "ironhead", "sacredsword", "swordsdance"]}, ], eventOnly: true, tier: "UU", }, terrakion: { randomBattleMoves: ["stoneedge", "closecombat", "swordsdance", "substitute", "stealthrock", "earthquake"], randomDoubleBattleMoves: ["stoneedge", "closecombat", "substitute", "rockslide", "earthquake", "taunt", "protect"], eventPokemon: [ {"generation": 5, "level": 42, "shiny": 1, "moves":["helpinghand", "retaliate", "rockslide", "sacredsword"]}, {"generation": 5, "level": 45, "shiny": 1, "moves":["helpinghand", "retaliate", "rockslide", "sacredsword"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["sacredsword", "swordsdance", "quickguard", "workup"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["retaliate", "rockslide", "sacredsword", "swordsdance"]}, ], eventOnly: true, tier: "UU", }, virizion: { randomBattleMoves: ["swordsdance", "closecombat", "leafblade", "stoneedge", "calmmind", "focusblast", "gigadrain", "hiddenpowerice", "substitute"], randomDoubleBattleMoves: ["taunt", "closecombat", "stoneedge", "leafblade", "swordsdance", "synthesis", "protect"], eventPokemon: [ {"generation": 5, "level": 42, "shiny": 1, "moves":["helpinghand", "retaliate", "gigadrain", "sacredsword"]}, {"generation": 5, "level": 45, "shiny": 1, "moves":["helpinghand", "retaliate", "gigadrain", "sacredsword"]}, {"generation": 5, "level": 65, "shiny": 1, "moves":["sacredsword", "swordsdance", "quickguard", "workup"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["retaliate", "gigadrain", "sacredsword", "swordsdance"]}, ], eventOnly: true, tier: "NU", }, tornadus: { randomBattleMoves: ["bulkup", "acrobatics", "knockoff", "substitute", "hurricane", "heatwave", "superpower", "uturn", "taunt", "tailwind"], randomDoubleBattleMoves: ["hurricane", "airslash", "uturn", "superpower", "focusblast", "taunt", "substitute", "heatwave", "tailwind", "protect", "skydrop"], eventPokemon: [ {"generation": 5, "level": 40, "shiny": 1, "isHidden": false, "moves":["revenge", "aircutter", "extrasensory", "agility"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["uproar", "astonish", "gust"], "pokeball": "dreamball"}, {"generation": 5, "level": 70, "isHidden": false, "moves":["hurricane", "hammerarm", "airslash", "hiddenpower"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["extrasensory", "agility", "airslash", "crunch"]}, ], eventOnly: true, tier: "BL2", }, tornadustherian: { randomBattleMoves: ["hurricane", "airslash", "heatwave", "knockoff", "superpower", "uturn", "taunt"], randomDoubleBattleMoves: ["hurricane", "airslash", "focusblast", "uturn", "heatwave", "skydrop", "tailwind", "taunt", "protect"], eventOnly: true, tier: "BL", }, thundurus: { randomBattleMoves: ["thunderwave", "nastyplot", "thunderbolt", "hiddenpowerice", "hiddenpowerflying", "focusblast", "substitute", "knockoff", "taunt"], randomDoubleBattleMoves: ["thunderwave", "nastyplot", "thunderbolt", "hiddenpowerice", "hiddenpowerflying", "focusblast", "substitute", "knockoff", "taunt", "protect"], eventPokemon: [ {"generation": 5, "level": 40, "shiny": 1, "isHidden": false, "moves":["revenge", "shockwave", "healblock", "agility"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["uproar", "astonish", "thundershock"], "pokeball": "dreamball"}, {"generation": 5, "level": 70, "isHidden": false, "moves":["thunder", "hammerarm", "focusblast", "wildcharge"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "isHidden": false, "moves":["healblock", "agility", "discharge", "crunch"]}, ], eventOnly: true, tier: "BL", }, thundurustherian: { randomBattleMoves: ["nastyplot", "thunderbolt", "hiddenpowerflying", "hiddenpowerice", "focusblast", "voltswitch"], randomDoubleBattleMoves: ["nastyplot", "thunderbolt", "hiddenpowerflying", "hiddenpowerice", "focusblast", "voltswitch", "protect"], eventOnly: true, tier: "BL", }, reshiram: { randomBattleMoves: ["blueflare", "dracometeor", "dragonpulse", "toxic", "flamecharge", "stoneedge", "roost"], randomDoubleBattleMoves: ["blueflare", "dracometeor", "dragonpulse", "heatwave", "flamecharge", "roost", "protect", "tailwind"], eventPokemon: [ {"generation": 5, "level": 50, "moves":["dragonbreath", "slash", "extrasensory", "fusionflare"]}, {"generation": 5, "level": 70, "moves":["extrasensory", "fusionflare", "dragonpulse", "imprison"]}, {"generation": 5, "level": 100, "moves":["blueflare", "fusionflare", "mist", "dracometeor"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "moves":["dragonbreath", "slash", "extrasensory", "fusionflare"]}, ], eventOnly: true, tier: "Uber", }, zekrom: { randomBattleMoves: ["boltstrike", "outrage", "dragonclaw", "dracometeor", "voltswitch", "honeclaws", "substitute", "roost"], randomDoubleBattleMoves: ["voltswitch", "protect", "dragonclaw", "boltstrike", "honeclaws", "substitute", "dracometeor", "fusionbolt", "roost", "tailwind"], eventPokemon: [ {"generation": 5, "level": 50, "moves":["dragonbreath", "slash", "zenheadbutt", "fusionbolt"]}, {"generation": 5, "level": 70, "moves":["zenheadbutt", "fusionbolt", "dragonclaw", "imprison"]}, {"generation": 5, "level": 100, "moves":["boltstrike", "fusionbolt", "haze", "outrage"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": 1, "moves":["dragonbreath", "slash", "zenheadbutt", "fusionbolt"]}, ], eventOnly: true, tier: "Uber", }, landorus: { randomBattleMoves: ["calmmind", "rockpolish", "earthpower", "focusblast", "psychic", "sludgewave", "stealthrock", "knockoff", "rockslide"], randomDoubleBattleMoves: ["earthpower", "focusblast", "hiddenpowerice", "psychic", "sludgebomb", "rockslide", "protect"], eventPokemon: [ {"generation": 5, "level": 70, "shiny": 1, "isHidden": false, "moves":["rockslide", "earthquake", "sandstorm", "fissure"]}, {"generation": 5, "level": 5, "isHidden": true, "moves":["block", "mudshot", "rocktomb"], "pokeball": "dreamball"}, {"generation": 6, "level": 65, "shiny": 1, "isHidden": false, "moves":["extrasensory", "swordsdance", "earthpower", "rockslide"]}, {"generation": 6, "level": 50, "nature": "Adamant", "ivs": {"hp": 31, "atk": 31, "def": 31, "spa": 1, "spd": 31, "spe": 24}, "isHidden": false, "moves":["earthquake", "knockoff", "uturn", "rocktomb"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, landorustherian: { randomBattleMoves: ["swordsdance", "rockpolish", "earthquake", "stoneedge", "uturn", "superpower", "stealthrock", "fly"], randomDoubleBattleMoves: ["rockslide", "earthquake", "stoneedge", "uturn", "superpower", "knockoff", "protect"], eventOnly: true, tier: "OU", }, kyurem: { randomBattleMoves: ["dracometeor", "icebeam", "earthpower", "outrage", "substitute", "dragonpulse", "focusblast", "roost"], randomDoubleBattleMoves: ["substitute", "icebeam", "dracometeor", "dragonpulse", "focusblast", "glaciate", "earthpower", "roost", "protect"], eventPokemon: [ {"generation": 5, "level": 75, "shiny": 1, "moves":["glaciate", "dragonpulse", "imprison", "endeavor"]}, {"generation": 5, "level": 70, "shiny": 1, "moves":["scaryface", "glaciate", "dragonpulse", "imprison"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["dragonbreath", "slash", "scaryface", "glaciate"]}, {"generation": 6, "level": 100, "moves":["glaciate", "scaryface", "dracometeor", "ironhead"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "BL2", }, kyuremblack: { randomBattleMoves: ["outrage", "fusionbolt", "icebeam", "roost", "substitute", "earthpower", "dragonclaw"], randomDoubleBattleMoves: ["protect", "fusionbolt", "icebeam", "roost", "substitute", "honeclaws", "earthpower", "dragonclaw"], eventPokemon: [ {"generation": 5, "level": 75, "shiny": 1, "moves":["freezeshock", "dragonpulse", "imprison", "endeavor"]}, {"generation": 5, "level": 70, "shiny": 1, "moves":["fusionbolt", "freezeshock", "dragonpulse", "imprison"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["dragonbreath", "slash", "fusionbolt", "freezeshock"]}, {"generation": 6, "level": 100, "moves":["freezeshock", "fusionbolt", "dracometeor", "ironhead"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, kyuremwhite: { randomBattleMoves: ["dracometeor", "icebeam", "fusionflare", "earthpower", "focusblast", "dragonpulse", "substitute", "roost", "toxic"], randomDoubleBattleMoves: ["dracometeor", "dragonpulse", "icebeam", "fusionflare", "earthpower", "focusblast", "roost", "protect"], eventPokemon: [ {"generation": 5, "level": 75, "shiny": 1, "moves":["iceburn", "dragonpulse", "imprison", "endeavor"]}, {"generation": 5, "level": 70, "shiny": 1, "moves":["fusionflare", "iceburn", "dragonpulse", "imprison"]}, {"generation": 6, "level": 50, "shiny": 1, "moves":["dragonbreath", "slash", "fusionflare", "iceburn"]}, {"generation": 6, "level": 100, "moves":["iceburn", "fusionflare", "dracometeor", "ironhead"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, keldeo: { randomBattleMoves: ["hydropump", "secretsword", "calmmind", "hiddenpowerflying", "hiddenpowerelectric", "substitute", "scald", "icywind"], randomDoubleBattleMoves: ["hydropump", "secretsword", "protect", "hiddenpowerflying", "hiddenpowerelectric", "substitute", "surf", "icywind", "taunt"], eventPokemon: [ {"generation": 5, "level": 15, "moves":["aquajet", "leer", "doublekick", "bubblebeam"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "moves":["sacredsword", "hydropump", "aquajet", "swordsdance"], "pokeball": "cherishball"}, {"generation": 6, "level": 15, "moves":["aquajet", "leer", "doublekick", "hydropump"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["aquajet", "leer", "doublekick", "bubblebeam"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, keldeoresolute: { eventOnly: true, requiredMove: "Secret Sword", }, meloetta: { randomBattleMoves: ["uturn", "calmmind", "psyshock", "hypervoice", "shadowball", "focusblast"], randomDoubleBattleMoves: ["calmmind", "psyshock", "thunderbolt", "hypervoice", "shadowball", "focusblast", "protect"], eventPokemon: [ {"generation": 5, "level": 15, "moves":["quickattack", "confusion", "round"], "pokeball": "cherishball"}, {"generation": 5, "level": 50, "moves":["round", "teeterdance", "psychic", "closecombat"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "RU", }, meloettapirouette: { randomBattleMoves: ["relicsong", "closecombat", "knockoff", "return"], randomDoubleBattleMoves: ["relicsong", "closecombat", "knockoff", "return", "protect"], requiredMove: "Relic Song", battleOnly: true, }, genesect: { randomBattleMoves: ["uturn", "bugbuzz", "icebeam", "flamethrower", "thunderbolt", "ironhead", "shiftgear", "extremespeed", "blazekick"], randomDoubleBattleMoves: ["uturn", "bugbuzz", "icebeam", "flamethrower", "thunderbolt", "ironhead", "shiftgear", "extremespeed", "blazekick", "protect"], eventPokemon: [ {"generation": 5, "level": 50, "moves":["technoblast", "magnetbomb", "solarbeam", "signalbeam"], "pokeball": "cherishball"}, {"generation": 5, "level": 15, "moves":["technoblast", "magnetbomb", "solarbeam", "signalbeam"], "pokeball": "cherishball"}, {"generation": 5, "level": 100, "shiny": true, "nature": "Hasty", "ivs": {"atk": 31, "spe": 31}, "moves":["extremespeed", "technoblast", "blazekick", "shiftgear"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "moves":["technoblast", "magnetbomb", "solarbeam", "signalbeam"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, genesectburn: { randomBattleMoves: ["uturn", "bugbuzz", "icebeam", "technoblast", "thunderbolt", "ironhead", "extremespeed"], randomDoubleBattleMoves: ["uturn", "bugbuzz", "icebeam", "technoblast", "thunderbolt", "ironhead", "extremespeed", "protect"], eventOnly: true, requiredItem: "Burn Drive", }, genesectchill: { randomBattleMoves: ["uturn", "bugbuzz", "technoblast", "flamethrower", "thunderbolt", "ironhead", "extremespeed"], randomDoubleBattleMoves: ["uturn", "bugbuzz", "technoblast", "flamethrower", "thunderbolt", "ironhead", "extremespeed", "protect"], eventOnly: true, requiredItem: "Chill Drive", }, genesectdouse: { randomBattleMoves: ["uturn", "bugbuzz", "icebeam", "flamethrower", "thunderbolt", "technoblast", "ironhead", "extremespeed"], randomDoubleBattleMoves: ["uturn", "bugbuzz", "icebeam", "flamethrower", "thunderbolt", "technoblast", "ironhead", "extremespeed", "protect"], eventOnly: true, requiredItem: "Douse Drive", }, genesectshock: { randomBattleMoves: ["uturn", "bugbuzz", "icebeam", "flamethrower", "technoblast", "ironhead", "extremespeed"], randomDoubleBattleMoves: ["uturn", "bugbuzz", "icebeam", "flamethrower", "technoblast", "ironhead", "extremespeed", "protect"], eventOnly: true, requiredItem: "Shock Drive", }, chespin: { randomBattleMoves: ["curse", "gyroball", "seedbomb", "stoneedge", "spikes", "synthesis"], tier: "LC", }, quilladin: { randomBattleMoves: ["curse", "gyroball", "seedbomb", "stoneedge", "spikes", "synthesis"], tier: "NFE", }, chesnaught: { randomBattleMoves: ["leechseed", "synthesis", "spikes", "drainpunch", "spikyshield", "woodhammer"], randomDoubleBattleMoves: ["leechseed", "synthesis", "hammerarm", "spikyshield", "stoneedge", "woodhammer", "rockslide"], tier: "RU", }, fennekin: { randomBattleMoves: ["fireblast", "psychic", "psyshock", "grassknot", "willowisp", "hypnosis", "hiddenpowerrock", "flamecharge"], eventPokemon: [ {"generation": 6, "level": 15, "gender": "F", "nature": "Hardy", "isHidden": false, "moves":["scratch", "flamethrower", "hiddenpower"], "pokeball": "cherishball"}, ], tier: "LC", }, braixen: { randomBattleMoves: ["fireblast", "flamethrower", "psychic", "psyshock", "grassknot", "willowisp", "hiddenpowerrock"], tier: "NFE", }, delphox: { randomBattleMoves: ["calmmind", "fireblast", "psyshock", "grassknot", "switcheroo", "shadowball"], randomDoubleBattleMoves: ["calmmind", "fireblast", "psyshock", "grassknot", "switcheroo", "shadowball", "heatwave", "dazzlinggleam", "protect"], tier: "NU", }, froakie: { randomBattleMoves: ["quickattack", "hydropump", "icebeam", "waterfall", "toxicspikes", "poweruppunch", "uturn"], eventPokemon: [ {"generation": 6, "level": 7, "isHidden": false, "moves":["pound", "growl", "bubble", "return"], "pokeball": "cherishball"}, ], tier: "LC", }, frogadier: { randomBattleMoves: ["hydropump", "surf", "icebeam", "uturn", "taunt", "toxicspikes"], tier: "NFE", }, greninja: { randomBattleMoves: ["hydropump", "icebeam", "darkpulse", "gunkshot", "uturn", "spikes", "toxicspikes", "taunt"], randomDoubleBattleMoves: ["hydropump", "uturn", "surf", "icebeam", "matblock", "taunt", "darkpulse", "protect"], eventPokemon: [ {"generation": 6, "level": 36, "ivs": {"spe": 31}, "isHidden": true, "moves":["watershuriken", "shadowsneak", "hydropump", "substitute"], "pokeball": "cherishball"}, {"generation": 6, "level": 100, "isHidden": true, "moves":["hydrocannon", "gunkshot", "matblock", "happyhour"], "pokeball": "cherishball"}, ], tier: "OU", }, greninjaash: { randomBattleMoves: ["hydropump", "icebeam", "darkpulse", "watershuriken", "uturn"], eventPokemon: [ {"generation": 7, "level": 36, "ivs": {"hp": 20, "atk": 31, "def": 20, "spa": 31, "spd": 20, "spe": 31}, "moves":["watershuriken", "aerialace", "doubleteam", "nightslash"]}, ], eventOnly: true, gen: 7, requiredAbility: "Battle Bond", battleOnly: true, tier: "OU", }, bunnelby: { randomBattleMoves: ["agility", "earthquake", "return", "quickattack", "uturn", "stoneedge", "spikes", "bounce"], tier: "LC", }, diggersby: { randomBattleMoves: ["earthquake", "return", "wildcharge", "uturn", "swordsdance", "quickattack", "knockoff", "agility"], randomDoubleBattleMoves: ["earthquake", "uturn", "return", "wildcharge", "protect", "quickattack"], tier: "BL", }, fletchling: { randomBattleMoves: ["roost", "swordsdance", "uturn", "return", "overheat", "flamecharge", "tailwind"], tier: "LC", }, fletchinder: { randomBattleMoves: ["roost", "swordsdance", "uturn", "return", "overheat", "flamecharge", "tailwind", "acrobatics"], tier: "NFE", }, talonflame: { randomBattleMoves: ["bravebird", "flareblitz", "roost", "swordsdance", "uturn", "willowisp", "tailwind"], randomDoubleBattleMoves: ["bravebird", "flareblitz", "roost", "swordsdance", "uturn", "willowisp", "tailwind", "taunt", "protect"], tier: "BL2", }, scatterbug: { randomBattleMoves: ["tackle", "stringshot", "stunspore", "bugbite", "poisonpowder"], tier: "LC", }, spewpa: { randomBattleMoves: ["tackle", "stringshot", "stunspore", "bugbite", "poisonpowder"], tier: "NFE", }, vivillon: { randomBattleMoves: ["sleeppowder", "quiverdance", "hurricane", "bugbuzz", "substitute"], randomDoubleBattleMoves: ["sleeppowder", "quiverdance", "hurricane", "bugbuzz", "roost", "protect"], tier: "NU", }, vivillonfancy: { eventPokemon: [ {"generation": 6, "level": 12, "isHidden": false, "moves":["gust", "lightscreen", "strugglebug", "holdhands"], "pokeball": "cherishball"}, ], eventOnly: true, }, vivillonpokeball: { eventPokemon: [ {"generation": 6, "level": 12, "isHidden": false, "moves":["stunspore", "gust", "lightscreen", "strugglebug"]}, ], eventOnly: true, }, litleo: { randomBattleMoves: ["hypervoice", "fireblast", "willowisp", "bulldoze", "yawn"], tier: "LC", }, pyroar: { randomBattleMoves: ["sunnyday", "fireblast", "hypervoice", "solarbeam", "willowisp", "darkpulse"], randomDoubleBattleMoves: ["hypervoice", "fireblast", "willowisp", "protect", "sunnyday", "solarbeam"], eventPokemon: [ {"generation": 6, "level": 49, "gender": "M", "perfectIVs": 2, "isHidden": false, "abilities":["unnerve"], "moves":["hypervoice", "fireblast", "darkpulse"], "pokeball": "cherishball"}, ], tier: "PU", }, flabebe: { randomBattleMoves: ["moonblast", "toxic", "wish", "psychic", "aromatherapy", "protect", "calmmind"], tier: "LC", }, floette: { randomBattleMoves: ["moonblast", "toxic", "wish", "psychic", "aromatherapy", "protect", "calmmind"], tier: "NFE", }, floetteeternal: { randomBattleMoves: ["lightofruin", "psychic", "hiddenpowerfire", "hiddenpowerground", "moonblast"], randomDoubleBattleMoves: ["lightofruin", "dazzlinggleam", "wish", "psychic", "aromatherapy", "protect", "calmmind"], isUnreleased: true, tier: "Unreleased", }, florges: { randomBattleMoves: ["calmmind", "moonblast", "synthesis", "aromatherapy", "wish", "toxic", "protect"], randomDoubleBattleMoves: ["moonblast", "dazzlinggleam", "wish", "psychic", "aromatherapy", "protect", "calmmind"], tier: "RU", }, skiddo: { randomBattleMoves: ["hornleech", "brickbreak", "bulkup", "leechseed", "milkdrink", "rockslide"], tier: "LC", }, gogoat: { randomBattleMoves: ["bulkup", "hornleech", "earthquake", "rockslide", "substitute", "leechseed", "milkdrink"], randomDoubleBattleMoves: ["hornleech", "earthquake", "brickbreak", "bulkup", "leechseed", "milkdrink", "rockslide", "protect"], tier: "PU", }, pancham: { randomBattleMoves: ["partingshot", "skyuppercut", "crunch", "stoneedge", "bulldoze", "shadowclaw", "bulkup"], eventPokemon: [ {"generation": 6, "level": 30, "gender": "M", "nature": "Adamant", "isHidden": false, "abilities":["moldbreaker"], "moves":["armthrust", "stoneedge", "darkpulse"], "pokeball": "cherishball"}, ], tier: "LC", }, pangoro: { randomBattleMoves: ["knockoff", "superpower", "gunkshot", "icepunch", "partingshot", "drainpunch"], randomDoubleBattleMoves: ["partingshot", "hammerarm", "crunch", "circlethrow", "icepunch", "earthquake", "poisonjab", "protect"], tier: "RU", }, furfrou: { randomBattleMoves: ["return", "cottonguard", "thunderwave", "substitute", "toxic", "suckerpunch", "uturn", "rest"], randomDoubleBattleMoves: ["return", "cottonguard", "uturn", "thunderwave", "suckerpunch", "snarl", "wildcharge", "protect"], tier: "PU", }, espurr: { randomBattleMoves: ["fakeout", "yawn", "thunderwave", "psychic", "trick", "darkpulse"], tier: "LC", }, meowstic: { randomBattleMoves: ["toxic", "yawn", "thunderwave", "psychic", "reflect", "lightscreen", "healbell"], randomDoubleBattleMoves: ["fakeout", "thunderwave", "psychic", "reflect", "lightscreen", "safeguard", "protect"], tier: "PU", }, meowsticf: { randomBattleMoves: ["calmmind", "psychic", "psyshock", "shadowball", "energyball", "thunderbolt"], randomDoubleBattleMoves: ["psyshock", "darkpulse", "fakeout", "energyball", "signalbeam", "thunderbolt", "protect", "helpinghand"], tier: "PU", }, honedge: { randomBattleMoves: ["swordsdance", "shadowclaw", "shadowsneak", "ironhead", "rockslide", "aerialace", "destinybond"], tier: "LC", }, doublade: { randomBattleMoves: ["swordsdance", "shadowclaw", "shadowsneak", "ironhead", "sacredsword"], randomDoubleBattleMoves: ["swordsdance", "shadowclaw", "shadowsneak", "ironhead", "sacredsword", "rockslide", "protect"], tier: "RU", }, aegislash: { randomBattleMoves: ["kingsshield", "swordsdance", "shadowclaw", "sacredsword", "ironhead", "shadowsneak", "hiddenpowerice", "shadowball", "flashcannon"], randomDoubleBattleMoves: ["kingsshield", "swordsdance", "shadowclaw", "sacredsword", "ironhead", "shadowsneak", "wideguard", "hiddenpowerice", "shadowball", "flashcannon"], eventPokemon: [ {"generation": 6, "level": 50, "gender": "F", "nature": "Quiet", "moves":["wideguard", "kingsshield", "shadowball", "flashcannon"], "pokeball": "cherishball"}, ], tier: "Uber", }, aegislashblade: { battleOnly: true, }, spritzee: { randomBattleMoves: ["calmmind", "drainingkiss", "moonblast", "psychic", "aromatherapy", "wish", "trickroom", "thunderbolt"], tier: "LC", }, aromatisse: { randomBattleMoves: ["wish", "protect", "moonblast", "aromatherapy", "reflect", "lightscreen"], randomDoubleBattleMoves: ["moonblast", "aromatherapy", "wish", "trickroom", "thunderbolt", "protect", "healpulse"], eventPokemon: [ {"generation": 6, "level": 50, "nature": "Relaxed", "isHidden": true, "moves":["trickroom", "healpulse", "disable", "moonblast"], "pokeball": "cherishball"}, ], tier: "NU", }, swirlix: { randomBattleMoves: ["calmmind", "drainingkiss", "dazzlinggleam", "surf", "psychic", "flamethrower", "bellydrum", "thunderbolt", "return", "thief", "cottonguard"], tier: "LC Uber", }, slurpuff: { randomBattleMoves: ["substitute", "bellydrum", "playrough", "return", "drainpunch", "calmmind", "drainingkiss", "dazzlinggleam", "flamethrower", "surf"], randomDoubleBattleMoves: ["substitute", "bellydrum", "playrough", "return", "drainpunch", "dazzlinggleam", "surf", "psychic", "flamethrower", "protect"], tier: "BL3", }, inkay: { randomBattleMoves: ["topsyturvy", "switcheroo", "superpower", "psychocut", "flamethrower", "rockslide", "trickroom"], eventPokemon: [ {"generation": 6, "level": 10, "isHidden": false, "moves":["happyhour", "foulplay", "hypnosis", "topsyturvy"], "pokeball": "cherishball"}, ], tier: "LC", }, malamar: { randomBattleMoves: ["superpower", "knockoff", "psychocut", "rockslide", "substitute", "trickroom"], randomDoubleBattleMoves: ["superpower", "psychocut", "rockslide", "trickroom", "knockoff", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "nature": "Adamant", "ivs": {"hp": 31, "atk": 31}, "isHidden": false, "abilities":["contrary"], "moves":["superpower", "knockoff", "facade", "rockslide"], "pokeball": "cherishball"}, ], tier: "NU", }, binacle: { randomBattleMoves: ["shellsmash", "razorshell", "stoneedge", "earthquake", "crosschop", "poisonjab", "xscissor", "rockslide"], tier: "LC", }, barbaracle: { randomBattleMoves: ["shellsmash", "stoneedge", "razorshell", "earthquake", "crosschop", "stealthrock"], randomDoubleBattleMoves: ["shellsmash", "razorshell", "earthquake", "crosschop", "rockslide", "protect"], tier: "NU", }, skrelp: { randomBattleMoves: ["scald", "sludgebomb", "thunderbolt", "shadowball", "toxicspikes", "hydropump"], tier: "LC", }, dragalge: { randomBattleMoves: ["dracometeor", "sludgewave", "focusblast", "scald", "hiddenpowerfire", "toxicspikes", "dragonpulse"], randomDoubleBattleMoves: ["dracometeor", "sludgebomb", "focusblast", "scald", "hiddenpowerfire", "protect", "dragonpulse"], tier: "RU", }, clauncher: { randomBattleMoves: ["waterpulse", "flashcannon", "uturn", "crabhammer", "aquajet", "sludgebomb"], tier: "LC", }, clawitzer: { randomBattleMoves: ["scald", "waterpulse", "darkpulse", "aurasphere", "icebeam", "uturn"], randomDoubleBattleMoves: ["waterpulse", "icebeam", "uturn", "darkpulse", "aurasphere", "muddywater", "helpinghand", "protect"], tier: "NU", }, helioptile: { randomBattleMoves: ["surf", "voltswitch", "hiddenpowerice", "raindance", "thunder", "darkpulse", "thunderbolt"], tier: "LC", }, heliolisk: { randomBattleMoves: ["raindance", "thunder", "hypervoice", "surf", "darkpulse", "hiddenpowerice", "voltswitch", "thunderbolt"], randomDoubleBattleMoves: ["surf", "voltswitch", "hiddenpowerice", "raindance", "thunder", "darkpulse", "thunderbolt", "electricterrain", "protect"], tier: "RU", }, tyrunt: { randomBattleMoves: ["stealthrock", "dragondance", "stoneedge", "dragonclaw", "earthquake", "icefang", "firefang"], eventPokemon: [ {"generation": 6, "level": 10, "isHidden": true, "moves":["tailwhip", "tackle", "roar", "stomp"], "pokeball": "cherishball"}, ], tier: "LC", }, tyrantrum: { randomBattleMoves: ["stealthrock", "dragondance", "dragonclaw", "earthquake", "superpower", "outrage", "headsmash"], randomDoubleBattleMoves: ["rockslide", "dragondance", "headsmash", "dragonclaw", "earthquake", "icefang", "firefang", "protect"], tier: "BL3", }, amaura: { randomBattleMoves: ["naturepower", "hypervoice", "ancientpower", "thunderbolt", "darkpulse", "thunderwave", "dragontail", "flashcannon"], eventPokemon: [ {"generation": 6, "level": 10, "isHidden": true, "moves":["growl", "powdersnow", "thunderwave", "rockthrow"], "pokeball": "cherishball"}, ], tier: "LC", }, aurorus: { randomBattleMoves: ["ancientpower", "blizzard", "thunderwave", "earthpower", "freezedry", "hypervoice", "stealthrock"], randomDoubleBattleMoves: ["hypervoice", "ancientpower", "thunderwave", "flashcannon", "freezedry", "icywind", "protect"], tier: "NU", }, sylveon: { randomBattleMoves: ["hypervoice", "calmmind", "wish", "protect", "psyshock", "batonpass", "shadowball"], randomDoubleBattleMoves: ["hypervoice", "calmmind", "wish", "protect", "psyshock", "helpinghand", "shadowball", "hiddenpowerground"], eventPokemon: [ {"generation": 6, "level": 10, "isHidden": false, "moves":["celebrate", "helpinghand", "sandattack", "fairywind"], "pokeball": "cherishball"}, {"generation": 6, "level": 10, "gender": "F", "isHidden": false, "moves":["disarmingvoice", "babydolleyes", "quickattack", "drainingkiss"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "gender": "F", "isHidden": true, "moves":["hyperbeam", "drainingkiss", "psyshock", "calmmind"], "pokeball": "cherishball"}, ], tier: "UU", }, hawlucha: { randomBattleMoves: ["substitute", "swordsdance", "highjumpkick", "acrobatics", "roost", "stoneedge"], randomDoubleBattleMoves: ["swordsdance", "highjumpkick", "uturn", "stoneedge", "skydrop", "encore", "protect"], tier: "OU", }, dedenne: { randomBattleMoves: ["substitute", "recycle", "thunderbolt", "nuzzle", "grassknot", "hiddenpowerice", "toxic"], randomDoubleBattleMoves: ["voltswitch", "thunderbolt", "nuzzle", "grassknot", "hiddenpowerice", "uturn", "helpinghand", "protect"], tier: "PU", }, carbink: { randomBattleMoves: ["stealthrock", "lightscreen", "reflect", "explosion", "powergem", "moonblast"], randomDoubleBattleMoves: ["trickroom", "lightscreen", "reflect", "explosion", "powergem", "moonblast", "protect"], tier: "PU", }, goomy: { randomBattleMoves: ["sludgebomb", "thunderbolt", "toxic", "protect", "infestation"], eventPokemon: [ {"generation": 7, "level": 1, "shiny": 1, "isHidden": true, "moves":["bodyslam", "dragonpulse", "counter"], "pokeball": "cherishball"}, ], tier: "LC", }, sliggoo: { randomBattleMoves: ["sludgebomb", "thunderbolt", "toxic", "protect", "infestation", "icebeam"], tier: "NFE", }, goodra: { randomBattleMoves: ["dracometeor", "dragonpulse", "fireblast", "sludgebomb", "thunderbolt", "earthquake", "dragontail"], randomDoubleBattleMoves: ["thunderbolt", "icebeam", "dragonpulse", "fireblast", "muddywater", "dracometeor", "focusblast", "protect"], tier: "RU", }, klefki: { randomBattleMoves: ["reflect", "lightscreen", "spikes", "magnetrise", "playrough", "thunderwave", "foulplay", "toxic"], randomDoubleBattleMoves: ["reflect", "lightscreen", "safeguard", "playrough", "substitute", "thunderwave", "protect", "flashcannon", "dazzlinggleam"], tier: "UU", }, phantump: { randomBattleMoves: ["hornleech", "leechseed", "phantomforce", "substitute", "willowisp", "rest"], tier: "LC", }, trevenant: { randomBattleMoves: ["hornleech", "shadowclaw", "leechseed", "willowisp", "rest", "substitute", "phantomforce"], randomDoubleBattleMoves: ["hornleech", "woodhammer", "leechseed", "shadowclaw", "willowisp", "trickroom", "earthquake", "rockslide", "protect"], tier: "PU", }, pumpkaboo: { randomBattleMoves: ["willowisp", "shadowsneak", "destinybond", "synthesis", "seedbomb", "leechseed"], tier: "LC", }, pumpkaboosmall: { randomBattleMoves: ["willowisp", "shadowsneak", "destinybond", "synthesis", "seedbomb"], unreleasedHidden: true, tier: "LC", }, pumpkaboolarge: { randomBattleMoves: ["willowisp", "shadowsneak", "leechseed", "synthesis", "seedbomb"], unreleasedHidden: true, tier: "LC", }, pumpkaboosuper: { randomBattleMoves: ["willowisp", "shadowsneak", "leechseed", "synthesis", "seedbomb"], eventPokemon: [ {"generation": 6, "level": 50, "moves":["trickortreat", "astonish", "scaryface", "shadowsneak"], "pokeball": "cherishball"}, ], tier: "LC", }, gourgeist: { randomBattleMoves: ["willowisp", "seedbomb", "leechseed", "shadowsneak", "substitute", "synthesis"], randomDoubleBattleMoves: ["willowisp", "shadowsneak", "painsplit", "seedbomb", "leechseed", "phantomforce", "explosion", "protect"], tier: "PU", }, gourgeistsmall: { randomBattleMoves: ["willowisp", "seedbomb", "leechseed", "shadowsneak", "substitute", "synthesis"], randomDoubleBattleMoves: ["willowisp", "shadowsneak", "painsplit", "seedbomb", "leechseed", "phantomforce", "explosion", "protect"], unreleasedHidden: true, tier: "PU", }, gourgeistlarge: { randomBattleMoves: ["willowisp", "seedbomb", "leechseed", "shadowsneak", "substitute", "synthesis"], randomDoubleBattleMoves: ["willowisp", "shadowsneak", "painsplit", "seedbomb", "leechseed", "phantomforce", "explosion", "protect", "trickroom"], unreleasedHidden: true, tier: "PU", }, gourgeistsuper: { randomBattleMoves: ["willowisp", "seedbomb", "leechseed", "shadowsneak", "substitute", "synthesis"], randomDoubleBattleMoves: ["willowisp", "shadowsneak", "painsplit", "seedbomb", "leechseed", "phantomforce", "explosion", "protect", "trickroom"], tier: "PU", }, bergmite: { randomBattleMoves: ["avalanche", "recover", "stoneedge", "curse", "gyroball", "rapidspin"], tier: "LC", }, avalugg: { randomBattleMoves: ["avalanche", "recover", "toxic", "rapidspin", "roar", "earthquake"], randomDoubleBattleMoves: ["avalanche", "recover", "earthquake", "protect"], tier: "PU", }, noibat: { randomBattleMoves: ["airslash", "hurricane", "dracometeor", "uturn", "roost", "switcheroo"], tier: "LC", }, noivern: { randomBattleMoves: ["dracometeor", "hurricane", "airslash", "flamethrower", "boomburst", "switcheroo", "uturn", "roost", "taunt"], randomDoubleBattleMoves: ["airslash", "hurricane", "dragonpulse", "dracometeor", "focusblast", "flamethrower", "uturn", "roost", "boomburst", "switcheroo", "tailwind", "taunt", "protect"], tier: "BL3", }, xerneas: { randomBattleMoves: ["geomancy", "moonblast", "thunder", "focusblast", "thunderbolt", "hiddenpowerfire", "psyshock", "rockslide", "closecombat"], randomDoubleBattleMoves: ["geomancy", "dazzlinggleam", "thunder", "focusblast", "thunderbolt", "hiddenpowerfire", "psyshock", "rockslide", "closecombat", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "moves":["gravity", "geomancy", "moonblast", "megahorn"]}, {"generation": 6, "level": 100, "shiny": true, "moves":["geomancy", "moonblast", "aromatherapy", "focusblast"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, yveltal: { randomBattleMoves: ["darkpulse", "hurricane", "foulplay", "oblivionwing", "uturn", "suckerpunch", "taunt", "toxic", "roost"], randomDoubleBattleMoves: ["darkpulse", "oblivionwing", "taunt", "focusblast", "hurricane", "roost", "suckerpunch", "snarl", "skydrop", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "moves":["snarl", "oblivionwing", "disable", "darkpulse"]}, {"generation": 6, "level": 100, "shiny": true, "moves":["oblivionwing", "suckerpunch", "darkpulse", "foulplay"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, zygarde: { randomBattleMoves: ["dragondance", "thousandarrows", "outrage", "extremespeed", "irontail"], randomDoubleBattleMoves: ["dragondance", "thousandarrows", "extremespeed", "rockslide", "coil", "stoneedge", "glare", "protect"], eventPokemon: [ {"generation": 6, "level": 70, "moves":["crunch", "earthquake", "camouflage", "dragonpulse"]}, {"generation": 6, "level": 100, "moves":["landswrath", "extremespeed", "glare", "outrage"], "pokeball": "cherishball"}, {"generation": 7, "level": 50, "moves":["bind", "landswrath", "sandstorm", "haze"]}, {"generation": 7, "level": 50, "isHidden": true, "moves":["bind", "landswrath", "sandstorm", "haze"]}, ], eventOnly: true, tier: "OU", }, zygarde10: { randomBattleMoves: ["dragondance", "thousandarrows", "outrage", "extremespeed", "irontail", "substitute"], randomDoubleBattleMoves: ["dragondance", "thousandarrows", "extremespeed", "irontail", "protect"], eventPokemon: [ {"generation": 7, "level": 30, "moves":["safeguard", "dig", "bind", "landswrath"]}, {"generation": 7, "level": 50, "isHidden": true, "moves":["safeguard", "dig", "bind", "landswrath"]}, ], eventOnly: true, gen: 7, tier: "RU", }, zygardecomplete: { gen: 7, requiredAbility: "Power Construct", battleOnly: true, tier: "Uber", }, diancie: { randomBattleMoves: ["reflect", "lightscreen", "stealthrock", "diamondstorm", "moonblast", "hiddenpowerfire"], randomDoubleBattleMoves: ["diamondstorm", "moonblast", "reflect", "lightscreen", "safeguard", "substitute", "calmmind", "psychic", "dazzlinggleam", "protect"], eventPokemon: [ {"generation": 6, "level": 50, "perfectIVs": 0, "moves":["diamondstorm", "reflect", "return", "moonblast"], "pokeball": "cherishball"}, {"generation": 6, "level": 50, "shiny": true, "moves":["diamondstorm", "moonblast", "reflect", "return"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "RU", }, dianciemega: { randomBattleMoves: ["calmmind", "moonblast", "earthpower", "hiddenpowerfire", "psyshock", "diamondstorm"], randomDoubleBattleMoves: ["diamondstorm", "moonblast", "calmmind", "psyshock", "earthpower", "hiddenpowerfire", "dazzlinggleam", "protect"], requiredItem: "Diancite", tier: "OU", }, hoopa: { randomBattleMoves: ["nastyplot", "psyshock", "shadowball", "focusblast", "trick"], randomDoubleBattleMoves: ["hyperspacehole", "shadowball", "focusblast", "protect", "psychic", "trickroom"], eventPokemon: [ {"generation": 6, "level": 50, "moves":["hyperspacehole", "nastyplot", "psychic", "astonish"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "RU", }, hoopaunbound: { randomBattleMoves: ["nastyplot", "substitute", "psyshock", "psychic", "darkpulse", "focusblast", "hyperspacefury", "zenheadbutt", "icepunch", "drainpunch", "gunkshot", "knockoff", "trick"], randomDoubleBattleMoves: ["psychic", "darkpulse", "focusblast", "protect", "hyperspacefury", "zenheadbutt", "icepunch", "drainpunch", "gunkshot"], eventOnly: true, tier: "BL", }, volcanion: { randomBattleMoves: ["substitute", "steameruption", "fireblast", "sludgewave", "hiddenpowerice", "earthpower", "superpower"], randomDoubleBattleMoves: ["substitute", "steameruption", "heatwave", "sludgebomb", "rockslide", "earthquake", "protect"], eventPokemon: [ {"generation": 6, "level": 70, "moves":["steameruption", "overheat", "hydropump", "mist"], "pokeball": "cherishball"}, {"generation": 6, "level": 70, "moves":["steameruption", "flamethrower", "hydropump", "explosion"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "UU", }, rowlet: { unreleasedHidden: true, tier: "LC", }, dartrix: { unreleasedHidden: true, tier: "NFE", }, decidueye: { randomBattleMoves: ["spiritshackle", "uturn", "leafblade", "roost", "swordsdance", "suckerpunch"], randomDoubleBattleMoves: ["spiritshackle", "leafblade", "bravebird", "protect", "suckerpunch"], unreleasedHidden: true, tier: "RU", }, litten: { unreleasedHidden: true, tier: "LC", }, torracat: { unreleasedHidden: true, tier: "NFE", }, incineroar: { randomBattleMoves: ["fakeout", "darkestlariat", "flareblitz", "uturn", "earthquake"], randomDoubleBattleMoves: ["fakeout", "darkestlariat", "flareblitz", "crosschop", "willowisp", "taunt", "snarl"], unreleasedHidden: true, tier: "NU", }, popplio: { unreleasedHidden: true, tier: "LC", }, brionne: { unreleasedHidden: true, tier: "NFE", }, primarina: { randomBattleMoves: ["hydropump", "moonblast", "scald", "psychic", "hiddenpowerfire"], randomDoubleBattleMoves: ["hypervoice", "moonblast", "substitute", "protect", "icebeam"], unreleasedHidden: true, tier: "UU", }, pikipek: { tier: "LC", }, trumbeak: { tier: "NFE", }, toucannon: { randomBattleMoves: ["substitute", "beakblast", "swordsdance", "roost", "brickbreak", "bulletseed", "rockblast"], randomDoubleBattleMoves: ["bulletseed", "rockblast", "bravebird", "tailwind", "protect"], tier: "PU", }, yungoos: { tier: "LC", }, gumshoos: { randomBattleMoves: ["uturn", "return", "crunch", "earthquake"], randomDoubleBattleMoves: ["uturn", "return", "superfang", "protect", "crunch"], tier: "PU", }, grubbin: { tier: "LC", }, charjabug: { tier: "NFE", }, vikavolt: { randomBattleMoves: ["agility", "bugbuzz", "thunderbolt", "voltswitch", "energyball", "hiddenpowerice"], randomDoubleBattleMoves: ["thunderbolt", "bugbuzz", "stringshot", "protect", "voltswitch", "hiddenpowerice"], tier: "NU", }, crabrawler: { tier: "LC", }, crabominable: { randomBattleMoves: ["icehammer", "closecombat", "earthquake", "stoneedge"], randomDoubleBattleMoves: ["icehammer", "closecombat", "stoneedge", "protect", "wideguard", "earthquake"], tier: "PU", }, oricorio: { randomBattleMoves: ["revelationdance", "hurricane", "toxic", "roost", "uturn"], randomDoubleBattleMoves: ["revelationdance", "airslash", "hurricane", "tailwind", "protect"], tier: "PU", }, oricoriopompom: { randomBattleMoves: ["revelationdance", "hurricane", "toxic", "roost", "uturn"], randomDoubleBattleMoves: ["revelationdance", "airslash", "hurricane", "tailwind", "protect"], tier: "PU", }, oricoriopau: { randomBattleMoves: ["revelationdance", "hurricane", "toxic", "roost", "uturn"], randomDoubleBattleMoves: ["revelationdance", "airslash", "hurricane", "tailwind", "protect"], tier: "PU", }, oricoriosensu: { randomBattleMoves: ["revelationdance", "hurricane", "toxic", "roost", "uturn"], randomDoubleBattleMoves: ["revelationdance", "airslash", "hurricane", "tailwind", "protect"], tier: "PU", }, cutiefly: { tier: "LC Uber", }, ribombee: { randomBattleMoves: ["quiverdance", "bugbuzz", "moonblast", "hiddenpowerfire", "roost", "batonpass"], randomDoubleBattleMoves: ["quiverdance", "pollenpuff", "moonblast", "protect", "batonpass"], tier: "BL3", }, rockruff: { tier: "LC", }, lycanroc: { randomBattleMoves: ["swordsdance", "accelerock", "stoneedge", "crunch", "firefang"], randomDoubleBattleMoves: ["accelerock", "stoneedge", "crunch", "firefang", "protect", "taunt"], tier: "PU", }, lycanrocmidnight: { randomBattleMoves: ["bulkup", "stoneedge", "stealthrock", "suckerpunch", "swordsdance", "firefang"], randomDoubleBattleMoves: ["stoneedge", "suckerpunch", "swordsdance", "protect", "taunt"], eventPokemon: [ {"generation": 7, "level": 50, "isHidden": true, "moves":["stoneedge", "firefang", "suckerpunch", "swordsdance"], "pokeball": "cherishball"}, ], tier: "PU", }, wishiwashi: { randomBattleMoves: ["scald", "hydropump", "icebeam", "hiddenpowergrass", "earthquake"], randomDoubleBattleMoves: ["hydropump", "icebeam", "endeavor", "protect", "hiddenpowergrass", "earthquake", "helpinghand"], tier: "PU", }, wishiwashischool: { battleOnly: true, }, mareanie: { eventPokemon: [ {"generation": 7, "level": 1, "shiny": 1, "isHidden": true, "moves":["toxic", "stockpile", "swallow"], "pokeball": "cherishball"}, ], tier: "LC", }, toxapex: { randomBattleMoves: ["toxicspikes", "banefulbunker", "recover", "scald", "haze"], randomDoubleBattleMoves: ["scald", "banefulbunker", "haze", "wideguard", "lightscreen"], tier: "OU", }, mudbray: { tier: "LC", }, mudsdale: { randomBattleMoves: ["earthquake", "closecombat", "payback", "rockslide", "heavyslam"], randomDoubleBattleMoves: ["highhorsepower", "heavyslam", "closecombat", "rockslide", "protect", "earthquake", "rocktomb"], tier: "PU", }, dewpider: { tier: "LC", }, araquanid: { randomBattleMoves: ["liquidation", "leechlife", "lunge", "toxic", "mirrorcoat", "crunch"], randomDoubleBattleMoves: ["liquidation", "leechlife", "lunge", "poisonjab", "protect", "wideguard"], tier: "RU", }, fomantis: { tier: "LC", }, lurantis: { randomBattleMoves: ["leafstorm", "hiddenpowerfire", "gigadrain", "substitute"], randomDoubleBattleMoves: ["leafstorm", "gigadrain", "hiddenpowerice", "hiddenpowerfire", "protect"], tier: "PU", }, morelull: { tier: "LC", }, shiinotic: { randomBattleMoves: ["spore", "strengthsap", "moonblast", "substitute", "leechseed"], randomDoubleBattleMoves: ["spore", "gigadrain", "moonblast", "sludgebomb", "protect"], tier: "PU", }, salandit: { tier: "LC", }, salazzle: { randomBattleMoves: ["nastyplot", "fireblast", "sludgewave", "hiddenpowerground"], randomDoubleBattleMoves: ["protect", "flamethrower", "sludgebomb", "hiddenpowerground", "hiddenpowerice", "fakeout", "encore", "willowisp", "taunt"], eventPokemon: [ {"generation": 7, "level": 50, "isHidden": false, "moves":["fakeout", "toxic", "sludgebomb", "flamethrower"], "pokeball": "cherishball"}, ], tier: "RU", }, stufful: { tier: "LC", }, bewear: { randomBattleMoves: ["hammerarm", "icepunch", "swordsdance", "return", "shadowclaw", "doubleedge"], randomDoubleBattleMoves: ["hammerarm", "icepunch", "doubleedge", "protect", "wideguard"], eventPokemon: [ {"generation": 7, "level": 50, "gender": "F", "isHidden": true, "moves":["babydolleyes", "brutalswing", "superpower", "bind"], "pokeball": "cherishball"}, ], tier: "RU", }, bounsweet: { tier: "LC", }, steenee: { eventPokemon: [ {"generation": 7, "level": 20, "nature": "Naive", "isHidden": false, "abilities":["leafguard"], "moves":["magicalleaf", "doubleslap", "sweetscent"], "pokeball": "cherishball"}, ], tier: "NFE", }, tsareena: { randomBattleMoves: ["highjumpkick", "tropkick", "playrough", "uturn"], randomDoubleBattleMoves: ["highjumpkick", "playrough", "tropkick", "uturn", "feint", "protect"], tier: "RU", }, comfey: { randomBattleMoves: ["aromatherapy", "drainingkiss", "toxic", "synthesis", "uturn"], randomDoubleBattleMoves: ["floralhealing", "drainingkiss", "uturn", "lightscreen", "taunt"], eventPokemon: [ {"generation": 7, "level": 10, "nature": "Jolly", "isHidden": false, "moves":["celebrate", "leechseed", "drainingkiss", "magicalleaf"], "pokeball": "cherishball"}, ], tier: "RU", }, oranguru: { randomBattleMoves: ["nastyplot", "psyshock", "focusblast", "thunderbolt"], randomDoubleBattleMoves: ["trickroom", "foulplay", "instruct", "psychic", "protect", "lightscreen", "reflect"], eventPokemon: [ {"generation": 7, "level": 1, "shiny": 1, "isHidden": false, "abilities":["telepathy"], "moves":["instruct", "psychic", "psychicterrain"], "pokeball": "cherishball"}, ], unreleasedHidden: true, tier: "PU", }, passimian: { randomBattleMoves: ["rockslide", "closecombat", "earthquake", "ironhead", "uturn"], randomDoubleBattleMoves: ["closecombat", "uturn", "rockslide", "protect", "ironhead", "taunt"], eventPokemon: [ {"generation": 7, "level": 1, "shiny": 1, "isHidden": false, "moves":["bestow", "fling", "feint"], "pokeball": "cherishball"}, ], unreleasedHidden: true, tier: "PU", }, wimpod: { tier: "LC", }, golisopod: { randomBattleMoves: ["spikes", "firstimpression", "liquidation", "suckerpunch", "aquajet", "toxic", "leechlife"], randomDoubleBattleMoves: ["firstimpression", "aquajet", "liquidation", "leechlife", "protect", "suckerpunch", "wideguard"], tier: "RU", }, sandygast: { tier: "LC", }, palossand: { randomBattleMoves: ["shoreup", "earthpower", "shadowball", "protect", "toxic"], randomDoubleBattleMoves: ["shoreup", "protect", "shadowball", "earthpower"], tier: "PU", }, pyukumuku: { randomBattleMoves: ["batonpass", "counter", "reflect", "lightscreen"], randomDoubleBattleMoves: ["reflect", "lightscreen", "counter", "helpinghand", "safeguard", "memento"], tier: "PU", }, typenull: { eventPokemon: [ {"generation": 7, "level": 40, "shiny": 1, "perfectIVs": 3, "moves":["crushclaw", "scaryface", "xscissor", "takedown"]}, ], eventOnly: true, tier: "NFE", }, silvally: { randomBattleMoves: ["swordsdance", "return", "doubleedge", "crunch", "flamecharge", "flamethrower", "icebeam", "uturn", "ironhead"], randomDoubleBattleMoves: ["protect", "doubleedge", "uturn", "crunch", "icebeam", "partingshot", "flamecharge", "swordsdance", "explosion"], eventPokemon: [ {"generation": 7, "level": 100, "shiny": true, "moves":["multiattack", "partingshot", "punishment", "scaryface"], "pokeball": "cherishball"}, ], tier: "PU", }, silvallybug: { randomBattleMoves: ["flamethrower", "icebeam", "thunderbolt", "uturn"], randomDoubleBattleMoves: ["protect", "uturn", "flamethrower", "icebeam", "thunderbolt", "thunderwave"], requiredItem: "Bug Memory", tier: "PU", }, silvallydark: { randomBattleMoves: ["multiattack", "swordsdance", "flamecharge", "ironhead"], randomDoubleBattleMoves: ["protect", "multiattack", "icebeam", "partingshot", "uturn", "snarl", "thunderwave"], requiredItem: "Dark Memory", tier: "PU", }, silvallydragon: { randomBattleMoves: ["multiattack", "ironhead", "flamecharge", "flamethrower", "icebeam", "dracometeor", "swordsdance", "uturn"], randomDoubleBattleMoves: ["protect", "dracometeor", "icebeam", "flamethrower", "partingshot", "uturn", "thunderwave"], requiredItem: "Dragon Memory", tier: "PU", }, silvallyelectric: { randomBattleMoves: ["multiattack", "flamethrower", "icebeam", "partingshot", "toxic"], randomDoubleBattleMoves: ["protect", "thunderbolt", "icebeam", "uturn", "partingshot", "snarl", "thunderwave"], requiredItem: "Electric Memory", tier: "PU", }, silvallyfairy: { randomBattleMoves: ["multiattack", "flamethrower", "rockslide", "thunderwave", "partingshot"], randomDoubleBattleMoves: ["protect", "multiattack", "uturn", "icebeam", "partingshot", "flamethrower", "thunderwave"], requiredItem: "Fairy Memory", tier: "PU", }, silvallyfighting: { randomBattleMoves: ["swordsdance", "multiattack", "shadowclaw", "flamecharge", "ironhead"], randomDoubleBattleMoves: ["protect", "multiattack", "rockslide", "swordsdance", "flamecharge"], requiredItem: "Fighting Memory", tier: "PU", }, silvallyfire: { randomBattleMoves: ["multiattack", "icebeam", "thunderbolt", "uturn"], randomDoubleBattleMoves: ["protect", "flamethrower", "snarl", "uturn", "thunderbolt", "icebeam", "thunderwave"], requiredItem: "Fire Memory", tier: "PU", }, silvallyflying: { randomBattleMoves: ["multiattack", "flamethrower", "ironhead", "partingshot", "thunderwave"], randomDoubleBattleMoves: ["protect", "multiattack", "partingshot", "swordsdance", "flamecharge", "uturn", "ironhead", "thunderwave"], requiredItem: "Flying Memory", tier: "PU", }, silvallyghost: { randomBattleMoves: ["multiattack", "flamethrower", "icebeam", "partingshot", "toxic"], randomDoubleBattleMoves: ["protect", "multiattack", "uturn", "icebeam", "partingshot"], requiredItem: "Ghost Memory", tier: "PU", }, silvallygrass: { randomBattleMoves: ["multiattack", "flamethrower", "icebeam", "partingshot", "toxic"], randomDoubleBattleMoves: ["protect", "flamethrower", "multiattack", "icebeam", "uturn", "partingshot", "thunderwave"], requiredItem: "Grass Memory", tier: "PU", }, silvallyground: { randomBattleMoves: ["multiattack", "swordsdance", "flamecharge", "rockslide"], randomDoubleBattleMoves: ["protect", "multiattack", "icebeam", "thunderbolt", "flamecharge", "rockslide", "swordsdance"], requiredItem: "Ground Memory", tier: "PU", }, silvallyice: { randomBattleMoves: ["multiattack", "thunderbolt", "flamethrower", "uturn", "toxic"], randomDoubleBattleMoves: ["protect", "icebeam", "thunderbolt", "partingshot", "uturn", "thunderwave"], requiredItem: "Ice Memory", tier: "PU", }, silvallypoison: { randomBattleMoves: ["multiattack", "flamethrower", "icebeam", "partingshot", "toxic"], randomDoubleBattleMoves: ["protect", "multiattack", "uturn", "partingshot", "flamethrower", "icebeam", "thunderwave"], requiredItem: "Poison Memory", tier: "PU", }, silvallypsychic: { randomBattleMoves: ["multiattack", "flamethrower", "rockslide", "partingshot", "thunderwave"], randomDoubleBattleMoves: ["protect", "multiattack", "partingshot", "uturn", "flamethrower", "thunderwave"], requiredItem: "Psychic Memory", tier: "PU", }, silvallyrock: { randomBattleMoves: ["multiattack", "flamethrower", "icebeam", "partingshot", "toxic"], randomDoubleBattleMoves: ["protect", "rockslide", "uturn", "icebeam", "flamethrower", "partingshot"], requiredItem: "Rock Memory", tier: "PU", }, silvallysteel: { randomBattleMoves: ["multiattack", "crunch", "flamethrower", "thunderbolt"], randomDoubleBattleMoves: ["protect", "multiattack", "swordsdance", "rockslide", "flamecharge", "uturn", "partingshot"], requiredItem: "Steel Memory", tier: "PU", }, silvallywater: { randomBattleMoves: ["multiattack", "icebeam", "thunderbolt", "partingshot"], randomDoubleBattleMoves: ["protect", "multiattack", "icebeam", "thunderbolt", "flamethrower", "partingshot", "uturn", "thunderwave"], requiredItem: "Water Memory", tier: "PU", }, minior: { randomBattleMoves: ["shellsmash", "powergem", "acrobatics", "earthquake"], randomDoubleBattleMoves: ["shellsmash", "powergem", "acrobatics", "earthquake", "protect"], tier: "NU", }, miniormeteor: { battleOnly: true, }, komala: { randomBattleMoves: ["return", "suckerpunch", "woodhammer", "earthquake", "playrough", "uturn"], randomDoubleBattleMoves: ["protect", "return", "uturn", "suckerpunch", "woodhammer", "shadowclaw", "playrough", "swordsdance"], tier: "PU", }, turtonator: { randomBattleMoves: ["fireblast", "shelltrap", "earthquake", "dragontail", "explosion", "dracometeor"], randomDoubleBattleMoves: ["dragonpulse", "dracometeor", "fireblast", "shellsmash", "protect", "focusblast", "explosion"], eventPokemon: [ {"generation": 7, "level": 1, "shiny": 1, "moves":["flamethrower", "bodyslam", "wideguard"], "pokeball": "cherishball"}, {"generation": 7, "level": 30, "gender": "M", "nature": "Brave", "moves":["flamethrower", "shelltrap", "dragontail"], "pokeball": "cherishball"}, ], tier: "PU", }, togedemaru: { randomBattleMoves: ["spikyshield", "zingzap", "nuzzle", "uturn", "wish"], randomDoubleBattleMoves: ["zingzap", "nuzzle", "spikyshield", "encore", "fakeout", "uturn"], tier: "PU", }, mimikyu: { randomBattleMoves: ["swordsdance", "shadowsneak", "playrough", "woodhammer", "shadowclaw"], randomDoubleBattleMoves: ["trickroom", "shadowclaw", "playrough", "woodhammer", "willowisp", "shadowsneak", "swordsdance", "protect"], eventPokemon: [ {"generation": 7, "level": 10, "moves":["copycat", "babydolleyes", "splash", "astonish"], "pokeball": "cherishball"}, {"generation": 7, "level": 10, "moves":["astonish", "playrough", "copycat", "substitute"], "pokeball": "cherishball"}, ], tier: "OU", }, mimikyubusted: { battleOnly: true, }, bruxish: { randomBattleMoves: ["psychicfangs", "crunch", "waterfall", "icefang", "aquajet", "swordsdance"], randomDoubleBattleMoves: ["trickroom", "psychicfangs", "crunch", "waterfall", "protect", "swordsdance"], tier: "RU", }, drampa: { randomBattleMoves: ["dracometeor", "dragonpulse", "hypervoice", "fireblast", "thunderbolt", "glare", "substitute", "roost"], randomDoubleBattleMoves: ["dracometeor", "dragonpulse", "hypervoice", "fireblast", "icebeam", "energyball", "thunderbolt", "protect", "roost"], eventPokemon: [ {"generation": 7, "level": 1, "shiny": 1, "isHidden": true, "moves":["playnice", "echoedvoice", "hurricane"], "pokeball": "cherishball"}, ], tier: "PU", }, dhelmise: { randomBattleMoves: ["swordsdance", "powerwhip", "phantomforce", "anchorshot", "switcheroo", "earthquake"], randomDoubleBattleMoves: ["powerwhip", "shadowclaw", "anchorshot", "protect", "gyroball"], tier: "RU", }, jangmoo: { tier: "LC", }, hakamoo: { tier: "NFE", }, kommoo: { randomBattleMoves: ["dragondance", "outrage", "dragonclaw", "skyuppercut", "poisonjab"], randomDoubleBattleMoves: ["clangingscales", "focusblast", "flashcannon", "substitute", "protect", "dracometeor"], tier: "RU", }, tapukoko: { randomBattleMoves: ["wildcharge", "voltswitch", "naturesmadness", "bravebird", "uturn", "dazzlinggleam"], randomDoubleBattleMoves: ["wildcharge", "voltswitch", "dazzlinggleam", "bravebird", "protect", "thunderbolt", "hiddenpowerice", "taunt", "skydrop", "naturesmadness", "uturn"], eventPokemon: [ {"generation": 7, "level": 60, "isHidden": false, "moves":["naturesmadness", "discharge", "agility", "electroball"]}, {"generation": 7, "level": 60, "shiny": true, "nature": "Timid", "isHidden": false, "moves":["naturesmadness", "discharge", "agility", "electroball"], "pokeball": "cherishball"}, ], eventOnly: true, unreleasedHidden: true, tier: "OU", }, tapulele: { randomBattleMoves: ["moonblast", "psyshock", "calmmind", "focusblast", "taunt"], randomDoubleBattleMoves: ["moonblast", "psychic", "dazzlinggleam", "focusblast", "protect", "taunt", "shadowball", "thunderbolt"], eventPokemon: [ {"generation": 7, "level": 60, "isHidden": false, "moves":["naturesmadness", "extrasensory", "flatter", "moonblast"]}, ], eventOnly: true, unreleasedHidden: true, tier: "OU", }, tapubulu: { randomBattleMoves: ["woodhammer", "hornleech", "stoneedge", "superpower", "megahorn", "bulkup"], randomDoubleBattleMoves: ["woodhammer", "hornleech", "stoneedge", "superpower", "leechseed", "protect", "naturesmadness"], eventPokemon: [ {"generation": 7, "level": 60, "isHidden": false, "moves":["naturesmadness", "zenheadbutt", "megahorn", "skullbash"]}, ], eventOnly: true, unreleasedHidden: true, tier: "OU", }, tapufini: { randomBattleMoves: ["calmmind", "moonblast", "surf", "substitute", "icebeam", "hydropump"], randomDoubleBattleMoves: ["muddywater", "moonblast", "calmmind", "icebeam", "healpulse", "protect", "taunt", "swagger"], eventPokemon: [ {"generation": 7, "level": 60, "isHidden": false, "moves":["naturesmadness", "muddywater", "aquaring", "hydropump"]}, ], eventOnly: true, unreleasedHidden: true, tier: "OU", }, cosmog: { eventPokemon: [ {"generation": 7, "level": 5, "moves":["splash"]}, ], eventOnly: true, tier: "LC", }, cosmoem: { tier: "NFE", }, solgaleo: { randomBattleMoves: ["sunsteelstrike", "zenheadbutt", "flareblitz", "morningsun", "stoneedge", "earthquake"], randomDoubleBattleMoves: ["wideguard", "protect", "sunsteelstrike", "morningsun", "zenheadbutt", "flareblitz"], eventPokemon: [ {"generation": 7, "level": 55, "moves":["sunsteelstrike", "cosmicpower", "crunch", "zenheadbutt"]}, ], tier: "Uber", }, lunala: { randomBattleMoves: ["moongeistbeam", "psyshock", "calmmind", "focusblast", "roost"], randomDoubleBattleMoves: ["wideguard", "protect", "roost", "moongeistbeam", "psychic", "focusblast"], eventPokemon: [ {"generation": 7, "level": 55, "moves":["moongeistbeam", "cosmicpower", "nightdaze", "shadowball"]}, ], tier: "Uber", }, nihilego: { randomBattleMoves: ["stealthrock", "acidspray", "powergem", "toxicspikes", "sludgewave"], randomDoubleBattleMoves: ["powergem", "sludgebomb", "grassknot", "protect", "thunderbolt", "hiddenpowerice"], eventPokemon: [ {"generation": 7, "level": 55, "moves":["powergem", "mirrorcoat", "acidspray", "venomdrench"]}, ], eventOnly: true, tier: "UU", }, buzzwole: { randomBattleMoves: ["superpower", "leechlife", "stoneedge", "poisonjab", "earthquake"], randomDoubleBattleMoves: ["hammerarm", "superpower", "leechlife", "icepunch", "poisonjab"], eventPokemon: [ {"generation": 7, "level": 65, "moves":["counter", "hammerarm", "lunge", "dynamicpunch"]}, ], eventOnly: true, tier: "BL", }, pheromosa: { randomBattleMoves: ["highjumpkick", "uturn", "icebeam", "poisonjab", "bugbuzz"], randomDoubleBattleMoves: ["highjumpkick", "uturn", "icebeam", "poisonjab", "bugbuzz", "protect", "speedswap"], eventPokemon: [ {"generation": 7, "level": 60, "moves":["triplekick", "lunge", "bugbuzz", "mefirst"]}, ], eventOnly: true, tier: "Uber", }, xurkitree: { randomBattleMoves: ["thunderbolt", "voltswitch", "energyball", "dazzlinggleam", "hiddenpowerice"], randomDoubleBattleMoves: ["thunderbolt", "hiddenpowerice", "tailglow", "protect", "energyball", "hypnosis"], eventPokemon: [ {"generation": 7, "level": 65, "moves":["hypnosis", "discharge", "electricterrain", "powerwhip"]}, ], eventOnly: true, tier: "BL", }, celesteela: { randomBattleMoves: ["autotomize", "heavyslam", "airslash", "fireblast", "earthquake", "leechseed", "protect"], randomDoubleBattleMoves: ["protect", "heavyslam", "fireblast", "earthquake", "wideguard", "leechseed", "flamethrower", "substitute"], eventPokemon: [ {"generation": 7, "level": 65, "moves":["autotomize", "seedbomb", "skullbash", "irondefense"]}, ], eventOnly: true, tier: "OU", }, kartana: { randomBattleMoves: ["leafblade", "sacredsword", "smartstrike", "psychocut", "swordsdance"], randomDoubleBattleMoves: ["leafblade", "sacredsword", "smartstrike", "psychocut", "protect", "nightslash"], eventPokemon: [ {"generation": 7, "level": 60, "moves":["leafblade", "xscissor", "detect", "airslash"]}, ], eventOnly: true, tier: "OU", }, guzzlord: { randomBattleMoves: ["dracometeor", "hammerarm", "crunch", "earthquake", "fireblast"], randomDoubleBattleMoves: ["dracometeor", "crunch", "darkpulse", "wideguard", "fireblast", "protect"], eventPokemon: [ {"generation": 7, "level": 70, "moves":["thrash", "gastroacid", "heavyslam", "wringout"]}, ], eventOnly: true, tier: "PU", }, necrozma: { randomBattleMoves: ["calmmind", "psychic", "darkpulse", "moonlight", "stealthrock", "storedpower"], randomDoubleBattleMoves: ["calmmind", "autotomize", "irondefense", "trickroom", "moonlight", "storedpower", "psyshock"], eventPokemon: [ {"generation": 7, "level": 75, "moves":["stealthrock", "irondefense", "wringout", "prismaticlaser"]}, ], eventOnly: true, tier: "BL3", }, magearna: { randomBattleMoves: ["shiftgear", "flashcannon", "aurasphere", "fleurcannon", "ironhead", "thunderbolt", "icebeam"], randomDoubleBattleMoves: ["dazzlinggleam", "flashcannon", "substitute", "protect", "trickroom", "fleurcannon", "aurasphere", "voltswitch"], eventPokemon: [ {"generation": 7, "level": 50, "moves":["fleurcannon", "flashcannon", "luckychant", "helpinghand"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "OU", }, magearnaoriginal: { isUnreleased: true, tier: "Unreleased", }, marshadow: { randomBattleMoves: ["spectralthief", "closecombat", "stoneedge", "shadowsneak", "icepunch"], randomDoubleBattleMoves: ["spectralthief", "closecombat", "shadowsneak", "icepunch", "protect"], eventPokemon: [ {"generation": 7, "level": 50, "moves":["spectralthief", "closecombat", "forcepalm", "shadowball"], "pokeball": "cherishball"}, ], eventOnly: true, tier: "Uber", }, missingno: { randomBattleMoves: ["watergun", "skyattack", "doubleedge", "metronome"], isNonstandard: true, tier: "Illegal", }, tomohawk: { randomBattleMoves: ["aurasphere", "roost", "stealthrock", "rapidspin", "hurricane", "airslash", "taunt", "substitute", "toxic", "naturepower", "earthpower"], isNonstandard: true, tier: "CAP", }, necturna: { randomBattleMoves: ["powerwhip", "hornleech", "willowisp", "shadowsneak", "stoneedge", "sacredfire", "boltstrike", "vcreate", "extremespeed", "closecombat", "shellsmash", "spore", "milkdrink", "batonpass", "stickyweb"], isNonstandard: true, tier: "CAP", }, mollux: { randomBattleMoves: ["fireblast", "thunderbolt", "sludgebomb", "thunderwave", "willowisp", "recover", "rapidspin", "trick", "stealthrock", "toxicspikes", "lavaplume"], isNonstandard: true, tier: "CAP", }, aurumoth: { randomBattleMoves: ["dragondance", "quiverdance", "closecombat", "bugbuzz", "hydropump", "megahorn", "psychic", "blizzard", "thunder", "focusblast", "zenheadbutt"], isNonstandard: true, tier: "CAP", }, malaconda: { randomBattleMoves: ["powerwhip", "glare", "toxic", "suckerpunch", "rest", "substitute", "uturn", "synthesis", "rapidspin", "knockoff"], isNonstandard: true, tier: "CAP", }, cawmodore: { randomBattleMoves: ["bellydrum", "bulletpunch", "drainpunch", "acrobatics", "drillpeck", "substitute", "ironhead", "quickattack"], isNonstandard: true, tier: "CAP", }, volkraken: { randomBattleMoves: ["scald", "powergem", "hydropump", "memento", "hiddenpowerice", "fireblast", "willowisp", "uturn", "substitute", "flashcannon", "surf"], isNonstandard: true, tier: "CAP", }, plasmanta: { randomBattleMoves: ["sludgebomb", "thunderbolt", "substitute", "hiddenpowerice", "psyshock", "dazzlinggleam", "flashcannon"], isNonstandard: true, tier: "CAP", }, naviathan: { randomBattleMoves: ["dragondance", "waterfall", "ironhead", "iciclecrash"], isNonstandard: true, tier: "CAP", }, crucibelle: { randomBattleMoves: ["headsmash", "gunkshot", "coil", "lowkick", "uturn", "stealthrock"], isNonstandard: true, tier: "CAP", }, crucibellemega: { randomBattleMoves: ["headsmash", "gunkshot", "coil", "woodhammer", "lowkick", "uturn"], requiredItem: "Crucibellite", isNonstandard: true, tier: "CAP", }, kerfluffle: { randomBattleMoves: ["aurasphere", "moonblast", "taunt", "partingshot", "gigadrain", "yawn"], isNonstandard: true, eventPokemon: [ {"generation": 6, "level": 16, "isHidden": false, "abilities":["naturalcure"], "moves":["celebrate", "holdhands", "fly", "metronome"], "pokeball": "cherishball"}, ], tier: "CAP", }, syclant: { randomBattleMoves: ["bugbuzz", "icebeam", "blizzard", "earthpower", "spikes", "superpower", "tailglow", "uturn", "focusblast"], isNonstandard: true, tier: "CAP", }, revenankh: { randomBattleMoves: ["bulkup", "shadowsneak", "drainpunch", "rest", "moonlight", "icepunch", "glare"], isNonstandard: true, tier: "CAP", }, pyroak: { randomBattleMoves: ["leechseed", "lavaplume", "substitute", "protect", "gigadrain"], isNonstandard: true, tier: "CAP", }, fidgit: { randomBattleMoves: ["spikes", "stealthrock", "toxicspikes", "wish", "rapidspin", "encore", "uturn", "sludgebomb", "earthpower"], isNonstandard: true, tier: "CAP", }, stratagem: { randomBattleMoves: ["paleowave", "earthpower", "fireblast", "gigadrain", "calmmind", "substitute"], isNonstandard: true, tier: "CAP", }, arghonaut: { randomBattleMoves: ["recover", "bulkup", "waterfall", "drainpunch", "crosschop", "stoneedge", "thunderpunch", "aquajet", "machpunch"], isNonstandard: true, tier: "CAP", }, kitsunoh: { randomBattleMoves: ["shadowstrike", "earthquake", "superpower", "meteormash", "uturn", "icepunch", "trick", "willowisp"], isNonstandard: true, tier: "CAP", }, cyclohm: { randomBattleMoves: ["slackoff", "dracometeor", "dragonpulse", "fireblast", "thunderbolt", "hydropump", "discharge", "healbell"], isNonstandard: true, tier: "CAP", }, colossoil: { randomBattleMoves: ["earthquake", "crunch", "suckerpunch", "uturn", "rapidspin", "encore", "pursuit", "knockoff"], isNonstandard: true, tier: "CAP", }, krilowatt: { randomBattleMoves: ["surf", "thunderbolt", "icebeam", "earthpower"], isNonstandard: true, tier: "CAP", }, voodoom: { randomBattleMoves: ["aurasphere", "darkpulse", "taunt", "painsplit", "substitute", "hiddenpowerice", "vacuumwave", "flashcannon"], isNonstandard: true, tier: "CAP", }, syclar: { isNonstandard: true, tier: "CAP LC", }, embirch: { isNonstandard: true, tier: "CAP LC", }, flarelm: { isNonstandard: true, tier: "CAP NFE", }, breezi: { isNonstandard: true, tier: "CAP LC", }, scratchet: { isNonstandard: true, tier: "CAP LC", }, necturine: { isNonstandard: true, tier: "CAP LC", }, cupra: { isNonstandard: true, tier: "CAP LC", }, argalis: { isNonstandard: true, tier: "CAP NFE", }, brattler: { isNonstandard: true, tier: "CAP LC", }, cawdet: { isNonstandard: true, tier: "CAP LC", }, volkritter: { isNonstandard: true, tier: "CAP LC", }, snugglow: { isNonstandard: true, tier: "CAP LC", }, floatoy: { isNonstandard: true, tier: "CAP LC", }, caimanoe: { isNonstandard: true, tier: "CAP NFE", }, pluffle: { isNonstandard: true, tier: "CAP LC", }, pokestarufo: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 38, "moves": ["bubblebeam", "counter", "recover", "signalbeam"]}, ], gen: 5, tier: "Illegal", }, pokestarufo2: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 47, "moves": ["darkpulse", "flamethrower", "hyperbeam", "icebeam"]}, ], gen: 5, tier: "Illegal", }, pokestarbrycenman: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 56, "moves": ["icebeam", "nightshade", "psychic", "uturn"]}, ], gen: 5, tier: "Illegal", }, pokestarmt: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 63, "moves": ["earthquake", "ironhead", "spark", "surf"]}, ], gen: 5, tier: "Illegal", }, pokestarmt2: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 72, "moves": ["dragonpulse", "flamethrower", "metalburst", "thunderbolt"]}, ], gen: 5, tier: "Illegal", }, pokestartransport: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 20, "moves": ["clearsmog", "flameburst", "discharge"]}, {"generation": 5, "level": 50, "moves": ["iciclecrash", "overheat", "signalbeam"]}, ], gen: 5, tier: "Illegal", }, pokestargiant: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 99, "moves": ["crushgrip", "focuspunch", "growl", "rage"]}, ], gen: 5, tier: "Illegal", }, pokestargiant2: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 99, "moves": ["crushgrip", "doubleslap", "teeterdance", "stomp"]}, ], gen: 5, tier: "Illegal", }, pokestarhumanoid: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 20, "gender": "M", "moves": ["scratch", "shadowclaw", "acid"]}, {"generation": 5, "level": 30, "gender": "M", "moves": ["darkpulse", "shadowclaw", "slash"]}, {"generation": 5, "level": 20, "gender": "F", "moves": ["acid", "nightslash"]}, {"generation": 5, "level": 20, "gender": "M", "moves": ["acid", "doubleedge"]}, {"generation": 5, "level": 20, "gender": "F", "moves": ["acid", "rockslide"]}, {"generation": 5, "level": 20, "gender": "M", "moves": ["acid", "thudnerpunch"]}, {"generation": 5, "level": 20, "gender": "F", "moves": ["acid", "icepunch"]}, {"generation": 5, "level": 40, "gender": "F", "moves": ["explosion", "selfdestruct"]}, {"generation": 5, "level": 40, "gender": "F", "moves": ["shadowclaw", "scratch"]}, {"generation": 5, "level": 40, "gender": "M", "moves": ["nightslash", "scratch"]}, {"generation": 5, "level": 40, "gender": "M", "moves": ["doubleedge", "scratch"]}, {"generation": 5, "level": 40, "gender": "F", "moves": ["rockslide", "scratch"]}, ], gen: 5, tier: "Illegal", }, pokestarmonster: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 50, "moves": ["darkpulse", "confusion"]}, ], gen: 5, tier: "Illegal", }, pokestarf00: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 10, "moves": ["teeterdance", "growl", "flail", "chatter"]}, {"generation": 5, "level": 58, "moves": ["needlearm", "headsmash", "headbutt", "defensecurl"]}, {"generation": 5, "level": 60, "moves": ["hammerarm", "perishsong", "ironhead", "thrash"]}, ], gen: 5, tier: "Illegal", }, pokestarf002: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 52, "moves": ["flareblitz", "ironhead", "psychic", "wildcharge"]}, ], gen: 5, tier: "Illegal", }, pokestarspirit: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 99, "moves": ["crunch", "dualchop", "slackoff", "swordsdance"]}, ], gen: 5, tier: "Illegal", }, pokestarblackdoor: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 53, "moves": ["luckychant", "amnesia", "ingrain", "rest"]}, {"generation": 5, "level": 70, "moves": ["batonpass", "counter", "flamecharge", "toxic"]}, ], gen: 5, tier: "Illegal", }, pokestarwhitedoor: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 7, "moves": ["batonpass", "inferno", "mirrorcoat", "toxic"]}, ], gen: 5, tier: "Illegal", }, pokestarblackbelt: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 30, "moves": ["focuspunch", "machpunch", "taunt"]}, {"generation": 5, "level": 40, "moves": ["machpunch", "hammerarm", "jumpkick"]}, ], gen: 5, tier: "Illegal", }, pokestargiantpropo2: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 99, "moves": ["crushgrip", "doubleslap", "teeterdance", "stomp"]}, ], gen: 5, tier: "Illegal", }, pokestarufopropu2: { isNonstandard: true, eventPokemon: [ {"generation": 5, "level": 47, "moves": ["darkpulse", "flamethrower", "hyperbeam", "icebeam"]}, ], gen: 5, tier: "Illegal", }, };
HoeenCoder/SpacialGaze
data/formats-data.js
JavaScript
mit
360,357
/* * GET home page. */ exports.index = function(req, res){ res.render('index', { title: 'DSA' }); }; exports.game = function (req,res){ res.render('game',{title: req.params.id }) };
tkschmidt/unitedRPG
routes/index.js
JavaScript
mit
189
const fs = require('fs'); module.exports = (params) => () => { fs.writeFileSync(`${params.projectRoot}/License.md`, params.license); return 'licenseMd: ok'; };
tomekwi/boilerplate
templates/_/actions/licenseMd.js
JavaScript
mit
166
function Improvement(options) { this.name = options.name; this.image = options.image; this.depth = options.depth || 0; this.parent = options.parent; this.children = options.children || []; this.siblings = options.siblings || []; this.toDisplay = options.toDisplay || []; this.toBuild = options.toBuild || []; this.cost = options.cost; this.materials = options.materials; this.buildEvent = 'event:'+options.buildEvent; } Improvement.prototype = { /* * The build function will build the improvement, adding it to the list of * improvements built in the GameState and removing the needed materials * from the character's inventory. */ build: function() { GameState.buildImprovement(this.code); var character = GameState.getCharacter(); character.adjustCurrency(-this.cost); $.each(this.materials, function(key, value) { character.removeItem({ item:key, count:value }); }); }, /* * An improvement is active when it has been built and none of its children * have been built. */ isActive: function() { if (!GameState.isImprovementBuilt(this.code)) { return false; } for (var i=0; i<this.children.length; i++) { if (GameState.isImprovementBuilt(this.children[i])) { return false; } } return true; }, /* * Function used to check to see if the improvement can be built regardless * of whether the character has the materials or not. If this improvement * has a parent location that hasn't been built then this improvement cannot * be built. If this improvement has any sibling improvements that have been * built then this improvement cannot be built. */ canBuild: function() { if (this.canDisplay() == false) { return false; } for (var i=0; i<this.siblings.length; i++) { if (GameState.isImprovementBuilt(this.siblings[i])) { return false; } } return Resolver.meetsRequirements(this.toBuild); }, /* * Function used to check to see if an improvement should be displayed in * the list of improvements. Improvements with parent improvements will not * be displayed until their parent improvements have been built. */ canDisplay: function() { if (this.parent && !GameState.isImprovementBuilt(this.parent)) { return false; } return Resolver.meetsRequirements(this.toDisplay); }, /* * Function used to check to see if the character has both the currency and * materials needed to build the improvement. */ hasMaterials: function() { var character = GameState.getCharacter(); if (character.getCurrency() < this.cost) { return false; } var result = true; $.each(this.materials, function(key, value) { if (character.getItemQuantity(key) < value) { result = false; } }); return result; }, /* Get the description of the improvement from the interface data. */ getDescription: function() { return Data.getInterface('improvement_'+this.getCode()); }, getBuildEvent: function() { return this.buildEvent; }, getCode: function() { return this.code; }, getCost: function() { return this.cost; }, getDepth: function() { return this.depth; }, getImage: function() { return this.image; }, getMaterials: function() { return this.materials; }, getName: function() { return this.name; }, };
maldrasen/archive
Mephidross/library/model/Improvement.js
JavaScript
mit
3,400
(function($, UI) { "use strict"; var $win = $(window), $doc = $(document), scrollspies = [], checkScrollSpy = function() { for(var i=0; i < scrollspies.length; i++) { UI.support.requestAnimationFrame.apply(window, [scrollspies[i].check]); } }; UI.component('scrollspy', { defaults: { "cls" : "uk-scrollspy-inview", "initcls" : "uk-scrollspy-init-inview", "topoffset" : 0, "leftoffset" : 0, "repeat" : false, "delay" : 0 }, init: function() { var $this = this, idle, inviewstate, initinview, fn = function(){ var inview = UI.Utils.isInView($this.element, $this.options); if(inview && !inviewstate) { if(idle) clearTimeout(idle); if(!initinview) { $this.element.addClass($this.options.initcls); $this.offset = $this.element.offset(); initinview = true; $this.trigger("uk.scrollspy.init"); } idle = setTimeout(function(){ if(inview) { $this.element.addClass("uk-scrollspy-inview").addClass($this.options.cls).width(); } }, $this.options.delay); inviewstate = true; $this.trigger("uk.scrollspy.inview"); } if (!inview && inviewstate && $this.options.repeat) { $this.element.removeClass("uk-scrollspy-inview").removeClass($this.options.cls); inviewstate = false; $this.trigger("uk.scrollspy.outview"); } }; fn(); this.check = fn; scrollspies.push(this); } }); var scrollspynavs = [], checkScrollSpyNavs = function() { for(var i=0; i < scrollspynavs.length; i++) { UI.support.requestAnimationFrame.apply(window, [scrollspynavs[i].check]); } }; UI.component('scrollspynav', { defaults: { "cls" : 'uk-active', "closest" : false, "topoffset" : 0, "leftoffset" : 0, "smoothscroll" : false }, init: function() { var ids = [], links = this.find("a[href^='#']").each(function(){ ids.push($(this).attr("href")); }), targets = $(ids.join(",")); var $this = this, inviews, fn = function(){ inviews = []; for(var i=0 ; i < targets.length ; i++) { if(UI.Utils.isInView(targets.eq(i), $this.options)) { inviews.push(targets.eq(i)); } } if(inviews.length) { var scrollTop = $win.scrollTop(), target = (function(){ for(var i=0; i< inviews.length;i++){ if(inviews[i].offset().top >= scrollTop){ return inviews[i]; } } })(); if(!target) return; if($this.options.closest) { links.closest($this.options.closest).removeClass($this.options.cls).end().filter("a[href='#"+target.attr("id")+"']").closest($this.options.closest).addClass($this.options.cls); } else { links.removeClass($this.options.cls).filter("a[href='#"+target.attr("id")+"']").addClass($this.options.cls); } } }; if(this.options.smoothscroll && UI["smoothScroll"]) { links.each(function(){ UI.smoothScroll(this, $this.options.smoothscroll); }); } fn(); this.element.data("scrollspynav", this); this.check = fn; scrollspynavs.push(this); } }); var fnCheck = function(){ checkScrollSpy(); checkScrollSpyNavs(); }; // listen to scroll and resize $doc.on("uk-scroll", fnCheck); $win.on("resize orientationchange", UI.Utils.debounce(fnCheck, 50)); // init code $doc.on("uk-domready", function(e) { $("[data-uk-scrollspy]").each(function() { var element = $(this); if (!element.data("scrollspy")) { var obj = UI.scrollspy(element, UI.Utils.options(element.attr("data-uk-scrollspy"))); } }); $("[data-uk-scrollspy-nav]").each(function() { var element = $(this); if (!element.data("scrollspynav")) { var obj = UI.scrollspynav(element, UI.Utils.options(element.attr("data-uk-scrollspy-nav"))); } }); }); })(jQuery, jQuery.UIkit);
depapp/tambut
vendor/uikit/uikit/src/js/scrollspy.js
JavaScript
mit
5,317
var typecheck = require('./typeinference').typecheck, macroexpand = require('./macroexpand').macroexpand, loadModule = require('./modules').loadModule, exportType = require('./modules').exportType, types = require('./types'), nodeToType = require('./typeinference').nodeToType, nodes = require('./nodes').nodes, lexer = require('./lexer'), parser = require('../lib/parser').parser, typeparser = require('../lib/typeparser').parser, _ = require('underscore'); // Assigning the nodes to `parser.yy` allows the grammar to access the nodes from // the `yy` namespace. parser.yy = typeparser.yy = nodes; parser.lexer = typeparser.lexer = { "lex": function() { var token = this.tokens[this.pos] ? this.tokens[this.pos++] : ['EOF']; this.yytext = token[1]; this.yylineno = token[2]; return token[0]; }, "setInput": function(tokens) { this.tokens = tokens; this.pos = 0; }, "upcomingInput": function() { return ""; } }; // Separate end comments from other expressions var splitComments = function(body) { return _.reduceRight(body, function(accum, node) { if(!accum.body.length && node instanceof nodes.Comment) { accum.comments.unshift(node); return accum; } accum.body.unshift(node); return accum; }, { body: [], comments: [] }); }; // Compile an abstract syntax tree (AST) node to JavaScript. var indent = 0; var getIndent = function(extra) { if(!extra) { extra = 0; } var spacing = ""; var i; for(i = 0; i < indent + extra; i++) { spacing += " "; } return spacing; }; var joinIndent = function(args, extra) { var lineIndent = "\n" + getIndent(extra); var argIndent = args.join("\n" + getIndent(extra)); if(argIndent) { return argIndent + lineIndent; } return ""; }; var pushIndent = function() { indent++; return getIndent(); }; var popIndent = function() { indent--; return getIndent(); }; var compileNodeWithEnv = function(n, env, opts) { if(!opts) opts = {}; var compileNode = function(n) { return compileNodeWithEnv(n, env); }; return n.accept({ // Function definition to JavaScript function. visitFunction: function() { var getArgs = function(a) { return _.map(a, function(v) { return v.name; }).join(", "); }; pushIndent(); var split = splitComments(n.body); var compiledWhereDecls = _.map(n.whereDecls, compileNode); var compiledNodeBody = _.map(split.body, compileNode); var init = []; if(compiledWhereDecls.length > 0) { init.push(compiledWhereDecls.join(';\n' + getIndent()) + ';'); } if(compiledNodeBody.length > 1) { init.push(compiledNodeBody.slice(0, compiledNodeBody.length - 1).join(';\n' + getIndent()) + ';'); } var lastString = compiledNodeBody[compiledNodeBody.length - 1]; var varEquals = ""; if(n.name) { varEquals = "var " + n.name + " = "; } var compiledEndComments = ""; if(split.comments.length) { compiledEndComments = getIndent() + _.map(split.comments, compileNode).join("\n" + getIndent()) + "\n"; } return varEquals + "function(" + getArgs(n.args) + ") {\n" + getIndent() + joinIndent(init) + "return " + lastString + ";\n" + compiledEndComments + popIndent() + "}"; }, visitIfThenElse: function() { var compiledCondition = compileNode(n.condition); var compileAppendSemicolon = function(n) { return compileNode(n) + ';'; }; var ifTrue = splitComments(n.ifTrue); var ifFalse = splitComments(n.ifFalse); pushIndent(); pushIndent(); var compiledIfTrueInit = joinIndent(_.map(ifTrue.body.slice(0, ifTrue.body.length - 1), compileAppendSemicolon)); var compiledIfTrueLast = compileNode(ifTrue.body[ifTrue.body.length - 1]); var compiledIfTrueEndComments = ""; if(ifTrue.comments.length) { compiledIfTrueEndComments = getIndent() + _.map(ifTrue.comments, compileNode).join("\n" + getIndent()) + "\n"; } var compiledIfFalseInit = joinIndent(_.map(ifFalse.body.slice(0, ifFalse.body.length - 1), compileAppendSemicolon)); var compiledIfFalseLast = compileNode(ifFalse.body[ifFalse.body.length - 1]); var compiledIfFalseEndComments = ""; if(ifFalse.comments.length) { compiledIfFalseEndComments = getIndent() + _.map(ifFalse.comments, compileNode).join("\n" + getIndent()) + "\n"; } popIndent(); popIndent(); return "(function() {\n" + getIndent(1) + "if(" + compiledCondition + ") {\n" + getIndent(2) + compiledIfTrueInit + "return " + compiledIfTrueLast + ";\n" + compiledIfTrueEndComments + getIndent(1) + "} else {\n" + getIndent(2) + compiledIfFalseInit + "return " + compiledIfFalseLast + ";\n" + compiledIfFalseEndComments + getIndent(1) + "}\n" + getIndent() + "})()"; }, // Let binding to JavaScript variable. visitLet: function() { return "var " + n.name + " = " + compileNode(n.value); }, visitInstance: function() { return "var " + n.name + " = " + compileNode(n.object); }, visitAssignment: function() { return compileNode(n.name) + " = " + compileNode(n.value) + ";"; }, visitData: function() { var defs = _.map(n.tags, compileNode); return defs.join(";\n"); }, visitExpression: function() { // No need to retain parenthesis for operations of higher // precendence in JS if(n.value instanceof nodes.Function || n.value instanceof nodes.Call) { return compileNode(n.value); } return '(' + compileNode(n.value) + ')'; }, visitReplacement: function() { return n.value; }, visitQuoted: function() { var serializeNode = { visitReplacement: function(v) { return "new nodes.Replacement(" + compileNode(v.value) + ")"; }, visitIdentifier: function(v) { return "new nodes.Identifier(" + JSON.stringify(v.value) + ")"; }, visitAccess: function(v) { return "new nodes.Access(" + serialize(v.value) + ", " + JSON.stringify(v.property) + ")"; }, visitPropertyAccess: function(v) { return "new nodes.PropertyAccess(" + serialize(v.value) + ", " + JSON.stringify(v.property) + ")"; }, visitCall: function(v) { return "new nodes.Call(" + serialize(v.func) + ", [" + _.map(v.args, serialize).join(', ') + "])"; } }; var serialize = function(v) { return v.accept(serializeNode); }; return serialize(n.value); }, visitReturn: function() { return "__monad__.return(" + compileNode(n.value) + ");"; }, visitBind: function() { var init = n.rest.slice(0, n.rest.length - 1); var last = n.rest[n.rest.length - 1]; return "__monad__.bind(" + compileNode(n.value) + ", function(" + n.name + ") {\n" + pushIndent() + _.map(init, compileNode).join(";\n" + getIndent()) + "\n" + getIndent() + "return " + compileNode(last) + "\n" + popIndent() + "});"; }, visitDo: function() { var compiledInit = []; var firstBind; var lastBind; var lastBindIndex = 0; _.each(n.body, function(node, i) { if(node instanceof nodes.Bind) { if(!lastBind) { firstBind = node; } else { lastBind.rest = n.body.slice(lastBindIndex + 1, i + 1); } lastBindIndex = i; lastBind = node; } else { if(!lastBind) { compiledInit.push(compileNode(node)); } } }); if(lastBind) { lastBind.rest = n.body.slice(lastBindIndex + 1); } return "(function(){\n" + pushIndent() + "var __monad__ = " + compileNode(n.value) + ";\n" + getIndent() + (!firstBind ? 'return ' : '') + compiledInit.join(';\n' + getIndent()) + '\n' + getIndent() + (firstBind ? 'return ' + compileNode(firstBind) : '') + "\n" + popIndent() + "})()"; }, visitTag: function() { var args = _.map(n.vars, function(v, i) { return v.value + "_" + i; }); var setters = _.map(args, function(v, i) { return "this._" + i + " = " + v; }); pushIndent(); var constructorString = "if(!(this instanceof " + n.name + ")) {\n" + getIndent(1) + "return new " + n.name + "(" + args.join(", ") + ");\n" + getIndent() + "}"; var settersString = (setters.length === 0 ? "" : "\n" + getIndent() + setters.join(";\n" + getIndent()) + ";"); popIndent(); return "var " + n.name + " = function(" + args.join(", ") + ") {\n" + getIndent(1) + constructorString + settersString + getIndent() + "\n}"; }, visitMatch: function() { var flatMap = function(a, f) { return _.flatten(_.map(a, f)); }; var pathConditions = _.map(n.cases, function(c) { var getVars = function(pattern, varPath) { return flatMap(pattern.vars, function(a, i) { var nextVarPath = varPath.slice(); nextVarPath.push(i); return a.accept({ visitIdentifier: function() { if(a.value == '_') return []; var accessors = _.map(nextVarPath, function(x) { return "._" + x; }).join(''); return ["var " + a.value + " = " + compileNode(n.value) + accessors + ";"]; }, visitPattern: function() { return getVars(a, nextVarPath); } }); }); }; var vars = getVars(c.pattern, []); var getTagPaths = function(pattern, patternPath) { return flatMap(pattern.vars, function(a, i) { var nextPatternPath = patternPath.slice(); nextPatternPath.push(i); return a.accept({ visitIdentifier: function() { return []; }, visitPattern: function() { var inner = getTagPaths(a, nextPatternPath); inner.unshift({path: nextPatternPath, tag: a.tag}); return inner; } }); }); }; var tagPaths = getTagPaths(c.pattern, []); var compiledValue = compileNode(n.value); var extraConditions = _.map(tagPaths, function(e) { return ' && ' + compiledValue + '._' + e.path.join('._') + ' instanceof ' + e.tag.value; }).join(''); // More specific patterns need to appear first // Need to sort by the length of the path var maxTagPath = _.max(tagPaths, function(t) { return t.path.length; }); var maxPath = maxTagPath ? maxTagPath.path : []; return { path: maxPath, condition: "if(" + compiledValue + " instanceof " + c.pattern.tag.value + extraConditions + ") {\n" + getIndent(2) + joinIndent(vars, 2) + "return " + compileNode(c.value) + ";\n" + getIndent(1) + "}" }; }); var cases = _.map(_.sortBy(pathConditions, function(t) { return -t.path.length; }), function(e) { return e.condition; }); return "(function() {\n" + getIndent(1) + cases.join(" else ") + "\n" + getIndent() + "})()"; }, // Call to JavaScript call. visitCall: function() { var typeClasses = ''; if(n.typeClassInstance) { typeClasses = n.typeClassInstance + ', '; } if(n.func.value == 'import') { return importModule(JSON.parse(n.args[0].value), env, opts); } return compileNode(n.func) + "(" + typeClasses + _.map(n.args, compileNode).join(", ") + ")"; }, visitPropertyAccess: function() { return compileNode(n.value) + "." + n.property; }, visitAccess: function() { return compileNode(n.value) + "[" + compileNode(n.property) + "]"; }, visitUnaryBooleanOperator: function() { return [n.name, compileNode(n.value)].join(" "); }, visitBinaryGenericOperator: function() { return [compileNode(n.left), n.name, compileNode(n.right)].join(" "); }, visitBinaryNumberOperator: function() { return [compileNode(n.left), n.name, compileNode(n.right)].join(" "); }, visitBinaryBooleanOperator: function() { return [compileNode(n.left), n.name, compileNode(n.right)].join(" "); }, visitBinaryStringOperator: function() { return [compileNode(n.left), n.name, compileNode(n.right)].join(" "); }, visitWith: function() { var args = compileNode(n.left) + ', ' + compileNode(n.right); var inner = _.map(['__l__', '__r__'], function(name) { return 'for(__n__ in ' + name + ') {\n' + getIndent(2) + '__o__[__n__] = ' + name + '[__n__];\n' + getIndent(1) + '}'; }); return joinIndent(['(function(__l__, __r__) {', 'var __o__ = {}, __n__;'], 1) + joinIndent(inner, 1) + 'return __o__;\n' + getIndent() + '})(' + args + ')'; }, // Print all other nodes directly. visitComment: function() { return n.value; }, visitIdentifier: function() { var typeClassAccessor = ''; if(n.typeClassInstance) { typeClassAccessor = n.typeClassInstance + '.'; } return typeClassAccessor + n.value; }, visitNumber: function() { return n.value; }, visitString: function() { return n.value; }, visitBoolean: function() { return n.value; }, visitUnit: function() { return "null"; }, visitArray: function() { return '[' + _.map(n.values, compileNode).join(', ') + ']'; }, visitTuple: function() { return '[' + _.map(n.values, compileNode).join(', ') + ']'; }, visitObject: function() { var key; var pairs = []; pushIndent(); for(key in n.values) { pairs.push("\"" + key + "\": " + compileNode(n.values[key])); } return "{\n" + getIndent() + pairs.join(",\n" + getIndent()) + "\n" + popIndent() + "}"; } }); }; exports.compileNodeWithEnv = compileNodeWithEnv; var compile = function(source, env, aliases, opts) { if(!env) env = {}; if(!aliases) aliases = {}; if(!opts) opts = {}; if(!opts.exported) opts.exported = {}; // Parse the file to an AST. var tokens = lexer.tokenise(source); var ast = parser.parse(tokens); ast = macroexpand(ast, env, opts); // Typecheck the AST. Any type errors will throw an exception. var resultType = typecheck(ast, env, aliases); // Export types ast = _.map(ast, function(n) { if(n instanceof nodes.Call && n.func.value == 'export') { return exportType(n.args[0], env, opts.exported, opts.nodejs); } return n; }); var output = []; if(!opts.nodejs) { output.push("(function() {"); } if(opts.strict) { output.push('"use strict";'); } var outputLine = output.length + 1; _.each(ast, function(v) { var compiled = compileNodeWithEnv(v, env, opts), j, lineCount; if(compiled) { lineCount = compiled.split('\n').length; if(opts.sourceMap && v.lineno > 1) { opts.sourceMap.addMapping({ source: opts.filename, original: { line: v.lineno, column: 0 }, generated: { line: outputLine, column: 0 } }); } outputLine += lineCount; output.push(compiled + (v instanceof nodes.Comment ? '' : ';')); } }); if(!opts.nodejs) { output.push("})();"); } // Add a newline at the end output.push(""); return {type: resultType, output: output.join('\n')}; }; exports.compile = compile; var getSandbox = function() { var sandbox = {require: require, exports: exports}; var name; for(name in global) { sandbox[name] = global[name]; } return sandbox; }; var getFileContents = function(filename) { var fs = require('fs'), exts = ["", ".roy", ".lroy"], filenames = _.map(exts, function(ext){ return filename + ext; }), foundFilename, source, err, i; // Check to see if an extension is specified, if so, don't bother // checking others if (/\..+$/.test(filename)) { source = fs.readFileSync(filename, 'utf8'); filenames = [filename]; } else { foundFilename = _.find(filenames, function(filename) { return fs.existsSync(filename); }); if(foundFilename) { source = fs.readFileSync(foundFilename, 'utf8'); } } if(!source) { throw new Error("File(s) not found: " + filenames.join(", ")); } return source; }; var nodeRepl = function(opts) { var readline = require('readline'), path = require('path'), vm = require('vm'), prettyPrint = require('./prettyprint').prettyPrint; var stdout = process.stdout; var stdin = process.openStdin(); var repl = readline.createInterface(stdin, stdout); var env = {}; var sources = {}; var aliases = {}; var sandbox = getSandbox(); var colorLog = function(color) { var args = [].slice.call(arguments, 1); if(opts.colorConsole) { args[0] = '\u001b[' + color + 'm' + args[0]; args[args.length - 1] = args[args.length - 1] + '\u001b[0m'; } console.log.apply(console, args); }; // Include the standard library var fs = require('fs'); var prelude = fs.readFileSync(path.dirname(__dirname) + '/lib/prelude.roy', 'utf8'); vm.runInNewContext(compile(prelude, env, {}, {nodejs: true}).output, sandbox, 'eval'); repl.setPrompt('roy> '); repl.on('close', function() { stdin.destroy(); }); repl.on('line', function(line) { var compiled; var output; var filename; var source; var tokens; var ast; // Check for a "metacommand" // e.g. ":q" or ":l test.roy" var metacommand = line.replace(/^\s+/, '').split(' '); try { switch(metacommand[0]) { case ":q": // Exit process.exit(); break; case ":l": // Load filename = metacommand[1]; source = getFileContents(filename); compiled = compile(source, env, aliases, {nodejs: true, filename: ".", run: true}); break; case ":t": if(metacommand[1] in env) { console.log(env[metacommand[1]].toString()); } else { colorLog(33, metacommand[1], "is not defined."); } break; case ":s": // Source if(sources[metacommand[1]]) { colorLog(33, metacommand[1], "=", prettyPrint(sources[metacommand[1]])); } else { if(metacommand[1]){ colorLog(33, metacommand[1], "is not defined."); }else{ console.log("Usage :s command "); console.log(":s [identifier] :: show original code about identifier."); } } break; case ":?": // Help colorLog(32, "Commands available from the prompt"); console.log(":l -- load and run an external file"); console.log(":q -- exit REPL"); console.log(":s -- show original code about identifier"); console.log(":t -- show the type of the identifier"); console.log(":? -- show help"); break; default: // The line isn't a metacommand // Remember the source if it's a binding tokens = lexer.tokenise(line); ast = parser.parse(tokens); ast[0].accept({ visitLet: function(n) { sources[n.name] = n.value; } }); // Just eval it compiled = compile(line, env, aliases, {nodejs: true, filename: ".", run: true}); break; } if(compiled) { output = vm.runInNewContext(compiled.output, sandbox, 'eval'); if(typeof output != 'undefined') { colorLog(32, (typeof output == 'object' ? JSON.stringify(output) : output) + " : " + compiled.type); } } } catch(e) { colorLog(31, (e.stack || e.toString())); } repl.prompt(); }); repl.prompt(); }; var writeModule = function(env, exported, filename) { var fs = require('fs'); var moduleOutput = _.map(exported, function(v, k) { if(v instanceof types.TagType) { return 'type ' + v.toString().replace(/#/g, ''); } return k + ': ' + v.toString(); }).join('\n') + '\n'; fs.writeFile(filename, moduleOutput, 'utf8'); }; var importModule = function(name, env, opts) { var addTypesToEnv = function(moduleTypes) { _.each(moduleTypes, function(v, k) { var dataType = [new types.TagNameType(k)]; _.each(function() { dataType.push(new types.Variable()); }); env[k] = new types.TagType(dataType); }); }; var moduleTypes; if(opts.nodejs) { // Need to convert to absolute paths for the CLI if(opts.run) { var path = require("path"); name = path.resolve(path.dirname(opts.filename), name); } moduleTypes = loadModule(name, opts); addTypesToEnv(moduleTypes.types); var variable = name.substr(name.lastIndexOf("/") + 1); env[variable] = new types.Variable(); var props = {}; _.each(moduleTypes.env, function(v, k) { props[k] = nodeToType(v, env, {}); }); env[variable] = new types.ObjectType(props); console.log("Using sync CommonJS module:", name); return variable + " = require(" + JSON.stringify(name) + ")"; } else { moduleTypes = loadModule(name, opts); addTypesToEnv(moduleTypes.types); _.each(moduleTypes.env, function(v, k) { env[k] = nodeToType(v, env, {}); }); if(console) console.log("Using browser module:", name); return ""; } }; var main = function() { var argv = process.argv.slice(2); // Meta-commands configuration var opts = { colorConsole: false }; // Roy package information var fs = require('fs'), path = require('path'); var info = JSON.parse(fs.readFileSync(path.dirname(__dirname) + '/package.json', 'utf8')); if(process.argv.length < 3) { console.log("Roy: " + info.description); console.log(info.author); console.log(":? for help"); nodeRepl(opts); return; } var source; var vm; var browserModules = false; var run = false; var includePrelude = true; switch(argv[0]) { case "-v": case "--version": console.log("Roy: " + info.description); console.log(info.version); process.exit(); break; case "--help": case "-h": console.log("Roy: " + info.description + "\n"); console.log("-v : show current version"); console.log("-r [file] : run Roy-code without JavaScript output"); console.log("-p : run without prelude (standard library)"); console.log("-c : colorful REPL mode"); console.log("-h : show this help"); return; case "--stdio": source = ''; process.stdin.resume(); process.stdin.setEncoding('utf8'); process.stdin.on('data', function(data) { source += data; }); process.stdin.on('end', function() { console.log(compile(source).output); }); return; case "-p": includePrelude = false; /* falls through */ case "-r": vm = require('vm'); run = true; argv.shift(); break; case "-b": case "--browser": browserModules = true; argv.shift(); break; case "-c": case "--color": opts.colorConsole = true; nodeRepl(opts); return; } var extensions = /\.l?roy$/; var literateExtension = /\.lroy$/; var exported; var env = {}; var aliases = {}; var sandbox = getSandbox(); if(run) { // Include the standard library if(includePrelude) { argv.unshift(path.dirname(__dirname) + '/lib/prelude.roy'); } } else { var modules = []; if(!argv.length || argv[0] != 'lib/prelude.roy') { modules.push(path.dirname(__dirname) + '/lib/prelude'); } _.each(modules, function(module) { var moduleTypes = loadModule(module, {filename: '.'}); _.each(moduleTypes.env, function(v, k) { env[k] = new types.Variable(); env[k] = nodeToType(v, env, aliases); }); }); } _.each(argv, function(filename) { // Read the file content. var source = getFileContents(filename); if(filename.match(literateExtension)) { // Strip out the Markdown. source = source.match(/^ {4,}.+$/mg).join('\n').replace(/^ {4}/gm, ''); } else { console.assert(filename.match(extensions), 'Filename must end with ".roy" or ".lroy"'); } exported = {}; var outputPath = filename.replace(extensions, '.js'); var SourceMapGenerator = require('source-map').SourceMapGenerator; var sourceMap = new SourceMapGenerator({file: path.basename(outputPath)}); var compiled = compile(source, env, aliases, { nodejs: !browserModules, filename: filename, run: run, exported: exported, sourceMap: sourceMap }); if(run) { // Execute the JavaScript output. output = vm.runInNewContext(compiled.output, sandbox, 'eval'); } else { // Write the JavaScript output. fs.writeFile(outputPath, compiled.output + '//@ sourceMappingURL=' + path.basename(outputPath) + '.map\n', 'utf8'); fs.writeFile(outputPath + '.map', sourceMap.toString(), 'utf8'); writeModule(env, exported, filename.replace(extensions, '.roym')); } }); }; exports.main = main; if(exports && !module.parent) { main(); }
non/roy
src/compile.js
JavaScript
mit
29,569
// @license // Redistribution and use in source and binary forms ... // Class for sending and receiving postMessages. // Based off the library by Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com) // // Dependencies: // * None // // Copyright 2014 Carnegie Mellon University. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ''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 CARNEGIE MELLON UNIVERSITY 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. // // The views and conclusions contained in the software and documentation are those of the // authors and should not be interpreted as representing official policies, either expressed // or implied, of Carnegie Mellon University. // // Authors: // Paul Dille (pdille@andrew.cmu.edu) // "use strict"; (function(window) { // Send postMessages. window.pm = function(options) { pm.send(options); }; // Bind a handler to a postMessage response. window.pm.bind = function(type, fn) { pm.bind(type, fn); }; // Unbind postMessage handlers window.pm.unbind = function(type, fn) { pm.unbind(type, fn); }; var pm = { // The origin domain. _origin: null, // Internal storage (keep track of listeners, etc). data: function(key, value) { if (value === undefined) { return pm._data[key]; } pm._data[key] = value; return value; }, _data: {}, // Send postMessages. send: function(options) { if (!options) { console.warn("Need to specify at least 3 options (origin, target, type)."); return; } if (options.origin) { if (!pm._origin) { pm._origin = options.origin; } } else { console.warn("postMessage origin must be specified."); return; } var target = options.target; if (!target) { console.warn("postMessage target window required."); return; } if (!options.type) { console.warn("postMessage message type required."); return; } var msg = {data: options.data, type: options.type}; if ("postMessage" in target) { // Send the postMessage. try { target.postMessage(JSON.stringify(msg), options.origin); } catch (ex) { console.warn("postMessage failed with " + ex.name + ":", ex.message); } } else { console.warn("postMessage not supported"); } }, // Listen to incoming postMessages. bind: function(type, fn) { if (!pm.data("listening.postMessage")) { if (window.addEventListener) { window.addEventListener("message", pm._dispatch, false); } // Make sure we create only one receiving postMessage listener. pm.data("listening.postMessage", true); } // Keep track of listeners and their handlers. var listeners = pm.data("listeners.postMessage"); if (!listeners) { listeners = {}; pm.data("listeners.postMessage", listeners); } var fns = listeners[type]; if (!fns) { fns = []; listeners[type] = fns; } fns.push({fn: fn, origin: pm._origin}); }, // Unbind postMessage listeners. unbind: function(type, fn) { var listeners = pm.data("listeners.postMessage"); if (listeners) { if (type) { if (fn) { // Remove specific listener var fns = listeners[type]; if (fns) { var newListeners = []; for (var i = 0, len = fns.length; i < len; i++) { var obj = fns[i]; if (obj.fn !== fn) { newListeners.push(obj); } } listeners[type] = newListeners; } } else { // Remove all listeners by type delete listeners[type]; } } else { // Unbind all listeners of all types for (var i in listeners) { delete listeners[i]; } } } }, // Run the handler, if one exists, based on the type defined in the postMessage. _dispatch: function(e) { var msg = {}; try { msg = JSON.parse(e.data); } catch (ex) { console.warn("postMessage data parsing failed: ", ex); return; } if (!msg.type) { console.warn("postMessage message type required."); return; } var listeners = pm.data("listeners.postMessage") || {}; var fns = listeners[msg.type] || []; for (var i = 0, len = fns.length; i < len; i++) { var obj = fns[i]; if (obj.origin && obj.origin !== '*' && e.origin !== obj.origin) { console.warn("postMessage message origin mismatch: ", e.origin, obj.origin); continue; } // Run handler try { obj.fn(msg.data); } catch (ex) { throw ex; } } } }; })(this);
CI-WATER/tmaps
tmc-1.2.1-linux/timemachine-viewer/js/org/gigapan/postmessage.js
JavaScript
mit
6,134
"use strict"; /* The MIT License (MIT) Copyright (c) Bryan Hughes <bryan@nebri.us> 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. */ Object.defineProperty(exports, "__esModule", { value: true }); const i2c_bus_1 = require("i2c-bus"); const child_process_1 = require("child_process"); const raspi_peripheral_1 = require("raspi-peripheral"); const raspi_board_1 = require("raspi-board"); function checkAddress(address) { if (typeof address !== 'number' || address < 0 || address > 0x7f) { throw new Error(`Invalid I2C address ${address}. Valid addresses are 0 through 0x7f.`); } } function checkRegister(register) { if (register !== undefined && (typeof register !== 'number' || register < 0 || register > 0xff)) { throw new Error(`Invalid I2C register ${register}. Valid registers are 0 through 0xff.`); } } function checkLength(length, hasRegister) { if (typeof length !== 'number' || length < 0 || (hasRegister && length > 32)) { // Enforce 32 byte length limit only for SMBus. throw new Error(`Invalid I2C length ${length}. Valid lengths are 0 through 32.`); } } function checkBuffer(buffer, hasRegister) { if (!Buffer.isBuffer(buffer) || buffer.length < 0 || (hasRegister && buffer.length > 32)) { // Enforce 32 byte length limit only for SMBus. throw new Error(`Invalid I2C buffer. Valid lengths are 0 through 32.`); } } function checkByte(byte) { if (typeof byte !== 'number' || byte < 0 || byte > 0xff) { throw new Error(`Invalid I2C byte ${byte}. Valid values are 0 through 0xff.`); } } function checkWord(word) { if (typeof word !== 'number' || word < 0 || word > 0xffff) { throw new Error(`Invalid I2C word ${word}. Valid values are 0 through 0xffff.`); } } function checkCallback(cb) { if (typeof cb !== 'function') { throw new Error('Invalid I2C callback'); } } function createReadBufferCallback(suppliedCallback) { return (err, resultOrBytesRead, result) => { if (suppliedCallback) { if (err) { suppliedCallback(err, null); } else if (typeof result !== 'undefined') { suppliedCallback(null, result); } else if (Buffer.isBuffer(resultOrBytesRead)) { suppliedCallback(null, resultOrBytesRead); } } }; } function createReadNumberCallback(suppliedCallback) { return (err, result) => { if (suppliedCallback) { if (err) { suppliedCallback(err, null); } else if (typeof result !== 'undefined') { suppliedCallback(null, result); } } }; } function createWriteCallback(suppliedCallback) { return (err) => { if (suppliedCallback) { suppliedCallback(err || null); } }; } class I2C extends raspi_peripheral_1.Peripheral { constructor() { super(['SDA0', 'SCL0']); this._devices = []; child_process_1.execSync('modprobe i2c-dev'); } destroy() { this._devices.forEach((device) => device.closeSync()); this._devices = []; super.destroy(); } read(address, registerOrLength, lengthOrCb, cb) { this.validateAlive(); let length; let register; if (typeof cb === 'function' && typeof lengthOrCb === 'number') { length = lengthOrCb; register = registerOrLength; } else if (typeof lengthOrCb === 'function') { cb = lengthOrCb; length = registerOrLength; register = undefined; } else { throw new TypeError('Invalid I2C read arguments'); } checkAddress(address); checkRegister(register); checkLength(length, !!register); checkCallback(cb); const buffer = new Buffer(length); if (register === undefined) { this._getDevice(address).i2cRead(address, length, buffer, createReadBufferCallback(cb)); } else { this._getDevice(address).readI2cBlock(address, register, length, buffer, createReadBufferCallback(cb)); } } readSync(address, registerOrLength, length) { this.validateAlive(); let register; if (typeof length === 'undefined') { length = +registerOrLength; } else { register = registerOrLength; length = +length; } checkAddress(address); checkRegister(register); checkLength(length, !!register); const buffer = new Buffer(length); if (register === undefined) { this._getDevice(address).i2cReadSync(address, length, buffer); } else { this._getDevice(address).readI2cBlockSync(address, register, length, buffer); } return buffer; } readByte(address, registerOrCb, cb) { this.validateAlive(); let register; if (typeof registerOrCb === 'function') { cb = registerOrCb; register = undefined; } checkAddress(address); checkRegister(register); checkCallback(cb); if (register === undefined) { const buffer = new Buffer(1); this._getDevice(address).i2cRead(address, buffer.length, buffer, (err) => { if (err) { if (cb) { cb(err, null); } } else if (cb) { cb(null, buffer[0]); } }); } else { this._getDevice(address).readByte(address, register, createReadNumberCallback(cb)); } } readByteSync(address, register) { this.validateAlive(); checkAddress(address); checkRegister(register); let byte; if (register === undefined) { const buffer = new Buffer(1); this._getDevice(address).i2cReadSync(address, buffer.length, buffer); byte = buffer[0]; } else { byte = this._getDevice(address).readByteSync(address, register); } return byte; } readWord(address, registerOrCb, cb) { this.validateAlive(); let register; if (typeof registerOrCb === 'function') { cb = registerOrCb; } else { register = registerOrCb; } checkAddress(address); checkRegister(register); checkCallback(cb); if (register === undefined) { const buffer = new Buffer(2); this._getDevice(address).i2cRead(address, buffer.length, buffer, (err) => { if (cb) { if (err) { return cb(err, null); } cb(null, buffer.readUInt16LE(0)); } }); } else { this._getDevice(address).readWord(address, register, createReadNumberCallback(cb)); } } readWordSync(address, register) { this.validateAlive(); checkAddress(address); checkRegister(register); let byte; if (register === undefined) { const buffer = new Buffer(2); this._getDevice(address).i2cReadSync(address, buffer.length, buffer); byte = buffer.readUInt16LE(0); } else { byte = this._getDevice(address).readWordSync(address, register); } return byte; } write(address, registerOrBuffer, bufferOrCb, cb) { this.validateAlive(); let buffer; let register; if (Buffer.isBuffer(registerOrBuffer)) { cb = bufferOrCb; buffer = registerOrBuffer; register = undefined; } else if (typeof registerOrBuffer === 'number' && Buffer.isBuffer(bufferOrCb)) { register = registerOrBuffer; buffer = bufferOrCb; } else { throw new TypeError('Invalid I2C write arguments'); } checkAddress(address); checkRegister(register); checkBuffer(buffer, !!register); if (register === undefined) { this._getDevice(address).i2cWrite(address, buffer.length, buffer, createWriteCallback(cb)); } else { this._getDevice(address).writeI2cBlock(address, register, buffer.length, buffer, createWriteCallback(cb)); } } writeSync(address, registerOrBuffer, buffer) { this.validateAlive(); let register; if (Buffer.isBuffer(registerOrBuffer)) { buffer = registerOrBuffer; } else { if (!buffer) { throw new Error('Invalid I2C write arguments'); } register = registerOrBuffer; } checkAddress(address); checkRegister(register); checkBuffer(buffer, !!register); if (register === undefined) { this._getDevice(address).i2cWriteSync(address, buffer.length, buffer); } else { this._getDevice(address).writeI2cBlockSync(address, register, buffer.length, buffer); } } writeByte(address, registerOrByte, byteOrCb, cb) { this.validateAlive(); let byte; let register; if (typeof byteOrCb === 'number') { byte = byteOrCb; register = registerOrByte; } else { cb = byteOrCb; byte = registerOrByte; } checkAddress(address); checkRegister(register); checkByte(byte); if (register === undefined) { this._getDevice(address).i2cWrite(address, 1, new Buffer([byte]), createWriteCallback(cb)); } else { this._getDevice(address).writeByte(address, register, byte, createWriteCallback(cb)); } } writeByteSync(address, registerOrByte, byte) { this.validateAlive(); let register; if (byte === undefined) { byte = registerOrByte; } else { register = registerOrByte; } checkAddress(address); checkRegister(register); checkByte(byte); if (register === undefined) { this._getDevice(address).i2cWriteSync(address, 1, new Buffer([byte])); } else { this._getDevice(address).writeByteSync(address, register, byte); } } writeWord(address, registerOrWord, wordOrCb, cb) { this.validateAlive(); let register; let word; if (typeof wordOrCb === 'number') { register = registerOrWord; word = wordOrCb; } else if (typeof wordOrCb === 'function') { word = registerOrWord; cb = wordOrCb; } else { throw new Error('Invalid I2C write arguments'); } checkAddress(address); checkRegister(register); checkWord(word); if (register === undefined) { const buffer = new Buffer(2); buffer.writeUInt16LE(word, 0); this._getDevice(address).i2cWrite(address, buffer.length, buffer, createWriteCallback(cb)); } else { this._getDevice(address).writeWord(address, register, word, createWriteCallback(cb)); } } writeWordSync(address, registerOrWord, word) { this.validateAlive(); let register; if (word === undefined) { word = registerOrWord; } else { register = registerOrWord; } checkAddress(address); checkRegister(register); checkWord(word); if (register === undefined) { const buffer = new Buffer(2); buffer.writeUInt16LE(word, 0); this._getDevice(address).i2cWriteSync(address, buffer.length, buffer); } else { this._getDevice(address).writeWordSync(address, register, word); } } _getDevice(address) { let device = this._devices[address]; if (device === undefined) { device = i2c_bus_1.openSync(raspi_board_1.getBoardRevision() === raspi_board_1.VERSION_1_MODEL_B_REV_1 ? 0 : 1); this._devices[address] = device; } return device; } } exports.I2C = I2C; exports.module = { createI2C() { return new I2C(); } }; //# sourceMappingURL=index.js.map
nebrius/raspi-i2c
dist/index.js
JavaScript
mit
13,584
require.config({ urlArgs: "v=" + (new Date()).getTime() }); require(["game"], function(game) { // I know it's ugly but it works, make game a global object G = game; G.init(); $(window).resize(G.camera.resize); G.render(); });
Smotko/jumpdrive
game/main.js
JavaScript
mit
253
define([], function () { var TAGNAMES = { 'select':'input', 'change':'input', 'submit':'form', 'reset':'form', 'error':'img', 'load':'img', 'abort':'img' }; var Utility = function() { }; Utility.isEventSupported = function(eventName) { var el = document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; var isSupported = (eventName in el); if (!isSupported) { el.setAttribute(eventName, 'return;'); isSupported = typeof el[eventName] == 'function'; } el = null; return isSupported; }; Utility.getSupportedEvent = function(events) { // get the length var len = events.length; if (typeof(len) == 'undefined') { len = 0; } for (var i = 0; i < len; i++) { if (Utility.isEventSupported(events[i])) { return events[i]; } } return null; }; return Utility; });
pmeisen/js-misc
src/net/meisen/general/Utility.js
JavaScript
mit
954
if($.cookie('age') !== 'pass') { $('body').addClass('uh-oh'); $('#age-verify').show(); } //generate map function showMap() { //set locations var location = new google.maps.LatLng(39.90658,-105.09859); var stylesArray = [ { "stylers": [ { "saturation": -100 } ] },{ "featureType": "road", "elementType": "geometry", "stylers": [ { "visibility": "simplified" } ] },{ "elementType": "labels.text.stroke", "stylers": [ { "visibility": "off" } ] },{ "elementType": "labels.text.fill", "stylers": [ { "lightness": 3 } ] },{ "featureType": "administrative.land_parcel", "elementType": "geometry", "stylers": [ { "visibility": "simplified" } ] } ]; //set options var myOptions = { center: location, zoom: 14, styles: stylesArray, disableDefaultUI: true, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; //create map var map = new google.maps.Map(document.getElementById('map'), myOptions); //Add a marker and modal box var image = new google.maps.MarkerImage('/assets/img/icn.map-marker.png', //Marker size new google.maps.Size(100, 160), //Origin new google.maps.Point(0,0), //Anchor new google.maps.Point(50, 160)); //place a custom marker var marker = new google.maps.Marker({ position: location, map: map, icon: image }); map.controls[google.maps.ControlPosition.TOP_RIGHT].push(new ZoomPanControl(map)); //create elements function CreateElement(tagName, properties) { var elem = document.createElement(tagName); for (var prop in properties) { if (prop == "style") elem.style.cssText = properties[prop]; else if (prop == "class") elem.className = properties[prop]; else elem.setAttribute(prop, properties[prop]); } return elem; } //add map custom map controls function ZoomPanControl(map) { this.map = map var t = this var zoomPanContainer = CreateElement("div", { 'class':'map-controls' }) //Map Controls div = CreateElement("div", {'title': 'Zoom in', 'class':'zoom-in' }) google.maps.event.addDomListener(div, "click", function() { t.zoom(ZoomDirection.IN); }) zoomPanContainer.appendChild(div) div = CreateElement("div", {'title': 'Center', 'class':'center-map' }) google.maps.event.addDomListener(div, "click", function() { map.setCenter(location); }) zoomPanContainer.appendChild(div) div = CreateElement("div", {'title': 'Zoom out', 'class':'zoom-out' }) google.maps.event.addDomListener(div, "click", function() { t.zoom(ZoomDirection.OUT); }) zoomPanContainer.appendChild(div) return zoomPanContainer } ZoomPanControl.prototype.zoom = function(direction) { var zoom = this.map.getZoom(); if (direction == ZoomDirection.IN && zoom < 19) this.map.setZoom(zoom + 1); else if (direction == ZoomDirection.OUT && zoom > 1) this.map.setZoom(zoom - 1); } var ZoomDirection = { IN: 0, OUT: 1 } } //load articles function loadPost(href) { $('#beer').fadeIn(400) $('#beer').load(href + ' #beer > *', function(response, status, xhr) { if ( status == "error" ) { console.log(xhr.status) } else { $('body').addClass('beer') } }) } (function() { // Highlight current section while scrolling DOWN $('.section').waypoint(function(direction) { if (direction === 'down') { var $link = $('a[href="/' + this.id + '"]'); $('ul.nav.navbar-nav li').removeClass('active'); $link.parent().addClass('active'); } }, { offset: '50%' }); // Highlight current section while scrolling UP $('.section').waypoint(function(direction) { if (direction === 'up') { var $link = $('a[href="/' + this.id + '"]'); $('ul.nav.navbar-nav li').removeClass('active'); $link.parent().addClass('active'); } }, { offset: function() { // This is the calculation that would give you // "bottom of element hits middle of window" return $.waypoints('viewportHeight') / 2 - $(this).outerHeight(); } }); // history.js if(!$('body').hasClass('blog')) { $('ul.nav.navbar-nav li:not(".external") a, .beer > a').on('click', addressUpdate) } function addressUpdate(ev) { ev.preventDefault() var $that = $(this) var separator = ' | ' var title = $(document).find('title').text() title = title.substring(title.indexOf(separator), title.length) //set title if($('h3', this).length) { title = $('h3', this).text() + title } else { title = $that.text() + title } //update url + title var href = $that.attr('href') History.pushState(null, title, href) //load post if($that.parent().hasClass('beer')) { loadPost(href) //scroll to section } else { $('#beer').fadeOut(400, function() { $('body').removeClass('beer') }).empty() $('html, body').stop().animate({ scrollTop: ($('#' + href.replace('/', '')).offset().top-88) }, 2000,'easeInOutExpo') } } })(); //on page load $(window).load(function() { //scroll to section var path = document.location.pathname var article = path.split('/')[2] path = path.substring(path.lastIndexOf('/') + 1, path.length) if ($('#' + path).length && !article) { $('html, body').stop().animate({ scrollTop: ($('#' + path).offset().top-88) }, 2000,'easeInOutExpo') } else if (typeof article !== 'undefined') { $(document).scrollTop($('#blog').offset().top) $('body').addClass('fixed') } }) google.maps.event.addDomListener(window, "load", showMap); $(document).ready(function() { // resizeContent() // //attach on resize event // $(window).resize(function() { // resizeContent() // }); // $('.hero-photo').each(function() { // var img = $('> img', this) // $(this).backstretch(img.attr('src')) // img.hide() // }) //setup full-screen images $('.full-img').each(function() { var img = $('> img', this) $(this).backstretch(img.attr('src')) img.hide() }) //slider $('.slider').slick({ autoplay: true, infinite: true, arrows: false, speed: 800, cssEase: 'cubic-bezier(0.86, 0, 0.07, 1)', slidesToShow: 1, slidesToScroll: 1, responsive: [ { breakpoint: 480, settings: { dots: true, arrows: false } } ] }) $('.trucks, .beers').slick({ infinite: true, arrows: true, prevArrow: '<button type="button" class="slick-prev"><i class="fa fa-angle-left"></i></button>', nextArrow: '<button type="button" class="slick-next"><i class="fa fa-angle-right"></i></button>', speed: 800, cssEase: 'cubic-bezier(0.86, 0, 0.07, 1)', slidesToShow: 5, responsive: [ { breakpoint: 1100, settings: { slidesToShow: 4, slidesToScroll: 1 } }, { breakpoint: 900, settings: { slidesToShow: 3, slidesToScroll: 1 } }, { breakpoint: 640, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: true } } ] }) //truck hover text // $('.truck').on('hover', function () { // //stuff to do on mouse enter // $('.overlay', this).stop().fadeIn(200) // }, // function () { // //stuff to do on mouse leave // $('.overlay', this).stop().fadeOut(200) // }); $(document).on({ mouseenter: function () { //stuff to do on mouse enter $('.overlay', this).stop().fadeIn(200) }, mouseleave: function () { //stuff to do on mouse leave $('.overlay', this).stop().fadeOut(200) } }, '.truck'); //mobile help $(document).on('touchstart touchend', function(e) { e.preventDefault() $('.overlay', this).stop().fadeToggle(200) }, '.truck'); $('#mc-form').ajaxChimp({ url: 'http://nickdimatteo.us2.list-manage.com/subscribe/post?u=3d3f46742d639b10307a1d9d8&amp;id=a1365fcbea' }); //age verification $('#age-verify #enter').on('click', function(e) { e.preventDefault(); $.cookie('age', 'pass'); $('#age-verify').fadeOut(400, function() { $('body').removeClass('uh-oh'); }); }); //go to admin $(document).keyup(function(e) { if (e.keyCode == 27) { console.log('hello') window.location.href = '/admin'; } }); })
ndimatteo/4noses-theme
assets/js/main.js
JavaScript
mit
8,777
(function($) { $.extend({ tablesorter: new function() { var parsers = [], widgets = []; this.defaults = { cssHeader: "header", cssAsc: "headerSortUp", cssDesc: "headerSortDown", sortInitialOrder: "asc", sortMultiSortKey: "shiftKey", sortForce: null, sortAppend: null, textExtraction: "simple", parsers: {}, widgets: [], widgetZebra: {css: ["even","odd"]}, headers: {}, widthFixed: false, cancelSelection: true, sortList: [], headerList: [], dateFormat: "us", decimal: '.', debug: false }; /* debuging utils */ function benchmark(s,d) { log(s + "," + (new Date().getTime() - d.getTime()) + "ms"); } this.benchmark = benchmark; function log(s) { if (typeof console != "undefined" && typeof console.debug != "undefined") { console.log(s); } else { alert(s); } } /* parsers utils */ function buildParserCache(table,$headers) { if(table.config.debug) { var parsersDebug = ""; } var rows = table.tBodies[0].rows; if(table.tBodies[0].rows[0]) { var list = [], cells = rows[0].cells, l = cells.length; for (var i=0;i < l; i++) { var p = false; if($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter) ) { p = getParserById($($headers[i]).metadata().sorter); } else if((table.config.headers[i] && table.config.headers[i].sorter)) { p = getParserById(table.config.headers[i].sorter); } if(!p) { p = detectParserForColumn(table,cells[i]); } if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; } list.push(p); } } if(table.config.debug) { log(parsersDebug); } return list; }; function detectParserForColumn(table,node) { var l = parsers.length; for(var i=1; i < l; i++) { if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)) { return parsers[i]; } } // 0 is always the generic parser (text) return parsers[0]; } function getParserById(name) { var l = parsers.length; for(var i=0; i < l; i++) { if(parsers[i].id.toLowerCase() == name.toLowerCase()) { return parsers[i]; } } return false; } /* utils */ function buildCache(table) { if(table.config.debug) { var cacheTime = new Date(); } var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0, totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0, parsers = table.config.parsers, cache = {row: [], normalized: []}; for (var i=0;i < totalRows; ++i) { /** Add the table data to main data array */ var c = table.tBodies[0].rows[i], cols = []; cache.row.push($(c)); for(var j=0; j < totalCells; ++j) { cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j])); } cols.push(i); // add position for rowCache cache.normalized.push(cols); cols = null; }; if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); } return cache; }; function getElementText(config,node) { if(!node) return ""; var t = ""; if(config.textExtraction == "simple") { if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) { t = node.childNodes[0].innerHTML; } else { t = node.innerHTML; } } else { if(typeof(config.textExtraction) == "function") { t = config.textExtraction(node); } else { t = $(node).text(); } } return t; } function appendToTable(table,cache) { if(table.config.debug) {var appendTime = new Date()} var c = cache, r = c.row, n= c.normalized, totalRows = n.length, checkCell = (n[0].length-1), tableBody = $(table.tBodies[0]), rows = []; for (var i=0;i < totalRows; i++) { rows.push(r[n[i][checkCell]]); if(!table.config.appender) { var o = r[n[i][checkCell]]; var l = o.length; for(var j=0; j < l; j++) { tableBody[0].appendChild(o[j]); } //tableBody.append(r[n[i][checkCell]]); } } if(table.config.appender) { table.config.appender(table,rows); } rows = null; if(table.config.debug) { benchmark("Rebuilt table:", appendTime); } //apply table widgets applyWidget(table); // trigger sortend setTimeout(function() { $(table).trigger("sortEnd"); },0); }; function buildHeaders(table) { if(table.config.debug) { var time = new Date(); } var meta = ($.metadata) ? true : false, tableHeadersRows = []; for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; }; $tableHeaders = $("thead th",table); $tableHeaders.each(function(index) { this.count = 0; this.column = index; this.order = formatSortingOrder(table.config.sortInitialOrder); if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true; if(!this.sortDisabled) { $(this).addClass(table.config.cssHeader); } // add cell to headerList table.config.headerList[index]= this; }); if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); } return $tableHeaders; }; function checkCellColSpan(table, rows, row) { var arr = [], r = table.tHead.rows, c = r[row].cells; for(var i=0; i < c.length; i++) { var cell = c[i]; if ( cell.colSpan > 1) { arr = arr.concat(checkCellColSpan(table, headerArr,row++)); } else { if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) { arr.push(cell); } //headerArr[row] = (i+row); } } return arr; }; function checkHeaderMetadata(cell) { if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; }; return false; } function checkHeaderOptions(table,i) { if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; }; return false; } function applyWidget(table) { var c = table.config.widgets; var l = c.length; for(var i=0; i < l; i++) { getWidgetById(c[i]).format(table); } } function getWidgetById(name) { var l = widgets.length; for(var i=0; i < l; i++) { if(widgets[i].id.toLowerCase() == name.toLowerCase() ) { return widgets[i]; } } }; function formatSortingOrder(v) { if(typeof(v) != "Number") { i = (v.toLowerCase() == "desc") ? 1 : 0; } else { i = (v == (0 || 1)) ? v : 0; } return i; } function isValueInArray(v, a) { var l = a.length; for(var i=0; i < l; i++) { if(a[i][0] == v) { return true; } } return false; } function setHeadersCss(table,$headers, list, css) { // remove all header information $headers.removeClass(css[0]).removeClass(css[1]); var h = []; $headers.each(function(offset) { if(!this.sortDisabled) { h[this.column] = $(this); } }); var l = list.length; for(var i=0; i < l; i++) { h[list[i][0]].addClass(css[list[i][1]]); } } function fixColumnWidth(table,$headers) { var c = table.config; if(c.widthFixed) { var colgroup = $('<colgroup>'); $("tr:first td",table.tBodies[0]).each(function() { colgroup.append($('<col>').css('width',$(this).width())); }); $(table).prepend(colgroup); }; } function updateHeaderSortCount(table,sortList) { var c = table.config, l = sortList.length; for(var i=0; i < l; i++) { var s = sortList[i], o = c.headerList[s[0]]; o.count = s[1]; o.count++; } } /* sorting methods */ function multisort(table,sortList,cache) { if(table.config.debug) { var sortTime = new Date(); } var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length; for(var i=0; i < l; i++) { var c = sortList[i][0]; var order = sortList[i][1]; var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc"); var e = "e" + i; dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); "; dynamicExp += "if(" + e + ") { return " + e + "; } "; dynamicExp += "else { "; } // if value is the same keep orignal order var orgOrderCol = cache.normalized[0].length - 1; dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];"; for(var i=0; i < l; i++) { dynamicExp += "}; "; } dynamicExp += "return 0; "; dynamicExp += "}; "; eval(dynamicExp); cache.normalized.sort(sortWrapper); if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); } return cache; }; function sortText(a,b) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }; function sortTextDesc(a,b) { return ((b < a) ? -1 : ((b > a) ? 1 : 0)); }; function sortNumeric(a,b) { return a-b; }; function sortNumericDesc(a,b) { return b-a; }; function getCachedSortType(parsers,i) { return parsers[i].type; }; /* public methods */ this.construct = function(settings) { return this.each(function() { if(!this.tHead || !this.tBodies) return; var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder; this.config = {}; config = $.extend(this.config, $.tablesorter.defaults, settings); // store common expression for speed $this = $(this); // build headers $headers = buildHeaders(this); // try to auto detect column type, and store in tables config this.config.parsers = buildParserCache(this,$headers); // build the cache for the tbody cells cache = buildCache(this); // get the css class names, could be done else where. var sortCSS = [config.cssDesc,config.cssAsc]; // fixate columns if the users supplies the fixedWidth option fixColumnWidth(this); // apply event handling to headers // this is to big, perhaps break it out? $headers.click(function(e) { $this.trigger("sortStart"); var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; if(!this.sortDisabled && totalRows > 0) { // store exp, for speed var $cell = $(this); // get current column index var i = this.column; // get current column sort order this.order = this.count++ % 2; // user only whants to sort on one column if(!e[config.sortMultiSortKey]) { // flush the sort list config.sortList = []; if(config.sortForce != null) { var a = config.sortForce; for(var j=0; j < a.length; j++) { if(a[j][0] != i) { config.sortList.push(a[j]); } } } // add column to sort list config.sortList.push([i,this.order]); // multi column sorting } else { // the user has clicked on an all ready sortet column. if(isValueInArray(i,config.sortList)) { // revers the sorting direction for all tables. for(var j=0; j < config.sortList.length; j++) { var s = config.sortList[j], o = config.headerList[s[0]]; if(s[0] == i) { o.count = s[1]; o.count++; s[1] = o.count % 2; } } } else { // add column to sort list array config.sortList.push([i,this.order]); } }; setTimeout(function() { //set css for headers setHeadersCss($this[0],$headers,config.sortList,sortCSS); appendToTable($this[0],multisort($this[0],config.sortList,cache)); },1); // stop normal event by returning false return false; } // cancel selection }).mousedown(function() { if(config.cancelSelection) { this.onselectstart = function() {return false}; return false; } }); // apply easy methods that trigger binded events $this.bind("update",function() { // rebuild parsers. this.config.parsers = buildParserCache(this,$headers); // rebuild the cache map cache = buildCache(this); }).bind("sorton",function(e,list) { $(this).trigger("sortStart"); config.sortList = list; // update and store the sortlist var sortList = config.sortList; // update header count index updateHeaderSortCount(this,sortList); //set css for headers setHeadersCss(this,$headers,sortList,sortCSS); // sort the table and append it to the dom appendToTable(this,multisort(this,sortList,cache)); }).bind("appendCache",function() { appendToTable(this,cache); }).bind("applyWidgetId",function(e,id) { getWidgetById(id).format(this); }).bind("applyWidgets",function() { // apply widgets applyWidget(this); }); if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) { config.sortList = $(this).metadata().sortlist; } // if user has supplied a sort list to constructor. if(config.sortList.length > 0) { $this.trigger("sorton",[config.sortList]); } // apply widgets applyWidget(this); }); }; this.addParser = function(parser) { var l = parsers.length, a = true; for(var i=0; i < l; i++) { if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) { a = false; } } if(a) { parsers.push(parser); }; }; this.addWidget = function(widget) { widgets.push(widget); }; this.formatFloat = function(s) { var i = parseFloat(s); return (isNaN(i)) ? 0 : i; }; this.formatInt = function(s) { var i = parseInt(s); return (isNaN(i)) ? 0 : i; }; this.isDigit = function(s,config) { var DECIMAL = '\\' + config.decimal; var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/'; return RegExp(exp).test($.trim(s)); }; this.clearTableBody = function(table) { if($.browser.msie) { function empty() { while ( this.firstChild ) this.removeChild( this.firstChild ); } empty.apply(table.tBodies[0]); } else { table.tBodies[0].innerHTML = ""; } }; } }); // extend plugin scope $.fn.extend({ tablesorter: $.tablesorter.construct }); var ts = $.tablesorter; // add default parsers ts.addParser({ id: "text", is: function(s) { return true; }, format: function(s) { return $.trim(s.toLowerCase()); }, type: "text" }); ts.addParser({ id: "digit", is: function(s,table) { var c = table.config; return $.tablesorter.isDigit(s,c); }, format: function(s) { return $.tablesorter.formatFloat(s); }, type: "numeric" }); ts.addParser({ id: "currency", is: function(s) { return /^[£$€?.]/.test(s); }, format: function(s) { return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),"")); }, type: "numeric" }); ts.addParser({ id: "ipAddress", is: function(s) { return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s); }, format: function(s) { var a = s.split("."), r = "", l = a.length; for(var i = 0; i < l; i++) { var item = a[i]; if(item.length == 2) { r += "0" + item; } else { r += item; } } return $.tablesorter.formatFloat(r); }, type: "numeric" }); ts.addParser({ id: "url", is: function(s) { return /^(https?|ftp|file):\/\/$/.test(s); }, format: function(s) { return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),'')); }, type: "text" }); ts.addParser({ id: "isoDate", is: function(s) { return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s); }, format: function(s) { return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0"); }, type: "numeric" }); ts.addParser({ id: "percent", is: function(s) { return /\%$/.test($.trim(s)); }, format: function(s) { return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),"")); }, type: "numeric" }); ts.addParser({ id: "usLongDate", is: function(s) { return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)); }, format: function(s) { return $.tablesorter.formatFloat(new Date(s).getTime()); }, type: "numeric" }); ts.addParser({ id: "shortDate", is: function(s) { return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s); }, format: function(s,table) { var c = table.config; s = s.replace(/\-/g,"/"); if(c.dateFormat == "us") { // reformat the string in ISO format s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2"); } else if(c.dateFormat == "uk") { //reformat the string in ISO format s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1"); } else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") { s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3"); } return $.tablesorter.formatFloat(new Date(s).getTime()); }, type: "numeric" }); ts.addParser({ id: "time", is: function(s) { return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s); }, format: function(s) { return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime()); }, type: "numeric" }); ts.addParser({ id: "metadata", is: function(s) { return false; }, format: function(s,table,cell) { var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName; return $(cell).metadata()[p]; }, type: "numeric" }); // add default widgets ts.addWidget({ id: "zebra", format: function(table) { if(table.config.debug) { var time = new Date(); } $("tr:visible",table.tBodies[0]) .filter(':even') .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]) .end().filter(':odd') .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]); if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); } } }); })(jQuery);
hlmurray/PaintingPal
www/js/tablesorter.js
JavaScript
mit
19,434
var exec = require('child_process').exec; exports.setHostname = function(envSettings){ var command = 'hostname'; exec(command,[], function (error, stdout, stderr) { if(error){ console.log('error when executing: ' + command); console.log('output : ' + stderr); } console.log('hostname : ' + stdout); var result = stdout.replace(/(\r\n|\n|\r)/gm,""); envSettings.serverPath = result; }); };
Schibsted-Tech-Polska/stp.project_analysis
custom_modules/envInformationModule.js
JavaScript
mit
408
//AppliedRules.defineSetByView module.exports = (function( viewId ){ return this.defineSetByTag( viewId ); });
kennethchatfield/rule-evaluator
lib/AppliedRules/setters/defineSetByView.js
JavaScript
mit
116
/* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * DS201: Simplify complex destructure assignments * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const { CompositeDisposable } = require('atom') let MinimapBookmarksBinding module.exports = { isActive () { return this.active }, activate () { this.active = false this.subscriptions = new CompositeDisposable() this.bindings = new Map() require('atom-package-deps').install('minimap-git-diff') }, consumeMinimapServiceV1 (minimap) { this.minimap = minimap this.minimap.registerPlugin('bookmarks', this) }, deactivate () { if (this.minimap) { this.minimap.unregisterPlugin('bookmarks') } this.minimap = null }, activatePlugin () { if (this.active) { return } const bookmarksPkg = atom.packages.getLoadedPackage('bookmarks') if (!bookmarksPkg) { return } const bookmarks = bookmarksPkg.mainModule this.active = true this.minimapsSubscription = this.minimap.observeMinimaps(minimap => { if (!MinimapBookmarksBinding) { MinimapBookmarksBinding = require('./minimap-bookmarks-binding') } const binding = new MinimapBookmarksBinding(minimap, bookmarks) this.bindings.set(minimap.id, binding) const subscription = minimap.onDidDestroy(() => { binding.destroy() this.subscriptions.remove(subscription) subscription.dispose() this.bindings.delete(minimap.id) }) this.subscriptions.add(subscription) }) }, deactivatePlugin () { if (!this.active) { return } const bindings = this.bindings.values() for (const binding of bindings) { binding.destroy() } this.bindings.clear() this.active = false this.minimapsSubscription.dispose() this.subscriptions.dispose() }, }
atom-minimap/minimap-bookmarks
lib/minimap-bookmarks.js
JavaScript
mit
1,827
/* global ga */ import 'core-js/fn/array/find-index' import 'core-js/fn/string/starts-with' import './index.css' import '../node_modules/md-components/style.css' import React from 'react' import ReactDOM from 'react-dom' import {Route, NavLink, HashRouter} from 'react-router-dom' import {Shell} from 'md-components' import BottomNavigationRoute from './bottomnavigationRoute' import ButtonRoute from './buttonRoute' import CardRoute from './cardRoute' import CheckboxRoute from './checkboxRoute' import ChipRoute from './chipRoute' import ExpansionPanelRoute from './expansionpanelRoute' import HeaderRoute from './headerRoute' import HomeRoute from './homeRoute' import IconRoute from './iconRoute' import ListRoute from './listRoute' import MenuRoute from './menuRoute' import ModalRoute from './modalRoute' import NavigationRoute from './navigationRoute' import ProgressRoute from './progressRoute' import RadiobuttonRoute from './radiobuttonRoute' import SelectRoute from './selectRoute' import SelectNativeRoute from './selectnativeRoute' import SliderRoute from './sliderRoute' import SnackbarRoute from './snackbarRoute' // import StepperRoute from './stepperRoute' import SwitchRoute from './switchRoute' import TableRoute from './tableRoute' import TabsRoute from './tabsRoute' import TabsControlledRoute from './tabscontrolledRoute' import TextfieldRoute from './textfieldRoute' import TextareaRoute from './textareaRoute' // import TooltipRoute from './tooltipRoute' class App extends React.Component { state = { title: 'HBM/md-components', subtitle: '' } onLinkChange = event => { const link = event.currentTarget // use google analytics to track single page apps // https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications if (window.ga) { ga('set', 'page', link.href) ga('send', 'pageview') } this.setState({ title: 'md-components', subtitle: link.text }) } componentDidMount () { this.setState({ subtitle: document.querySelector('a.active').text }) } render () { const links = [ <NavLink to='/' exact>Home</NavLink>, <NavLink to='/bottomnavigation'>Bottom Navigation</NavLink>, <NavLink to='/button'>Button</NavLink>, <NavLink to='/card'>Card</NavLink>, <NavLink to='/checkbox'>Checkbox</NavLink>, <NavLink to='/chip'>Chip</NavLink>, <NavLink to='/expansionpanel'>Expansion Panel</NavLink>, <NavLink to='/header'>Header</NavLink>, <NavLink to='/icon'>Icon</NavLink>, <NavLink to='/list'>List</NavLink>, <NavLink to='/menu'>Menu</NavLink>, <NavLink to='/modal'>Modal</NavLink>, <NavLink to='/navigation'>Navigation</NavLink>, <NavLink to='/progress'>Progress</NavLink>, <NavLink to='/radiobutton'>Radiobutton</NavLink>, <NavLink to='/select'>Select</NavLink>, <NavLink to='/selectnative'>Select Native</NavLink>, <NavLink to='/slider'>Slider</NavLink>, <NavLink to='/snackbar'>Snackbar</NavLink>, <NavLink to='/switch'>Switch</NavLink>, <NavLink to='/table'>Table</NavLink>, <NavLink to='/tabs'>Tabs</NavLink>, <NavLink to='/tabscontrolled'>TabsControlled</NavLink>, <NavLink to='/textfield'>Textfield</NavLink>, <NavLink to='/textarea'>Textarea</NavLink> ].map(link => React.cloneElement(link, {onClick: this.onLinkChange})) return ( <HashRouter> <Shell links={links} title={this.state.title} subtitle={this.state.subtitle} > <Route exact path='/' component={HomeRoute} /> <Route path='/bottomnavigation' component={BottomNavigationRoute} /> <Route path='/button' component={ButtonRoute} /> <Route path='/card' component={CardRoute} /> <Route path='/checkbox' component={CheckboxRoute} /> <Route path='/chip' component={ChipRoute} /> <Route path='/expansionpanel' component={ExpansionPanelRoute} /> <Route path='/header' component={HeaderRoute} /> <Route path='/icon' component={IconRoute} /> <Route path='/list' component={ListRoute} /> <Route path='/menu' component={MenuRoute} /> <Route path='/modal' component={ModalRoute} /> <Route path='/navigation' component={NavigationRoute} /> <Route path='/progress' component={ProgressRoute} /> <Route path='/radiobutton' component={RadiobuttonRoute} /> <Route path='/select' component={SelectRoute} /> <Route path='/selectnative' component={SelectNativeRoute} /> <Route path='/slider' component={SliderRoute} /> <Route path='/snackbar' component={SnackbarRoute} /> <Route path='/switch' component={SwitchRoute} /> <Route path='/table' component={TableRoute} /> <Route path='/tabs' component={TabsRoute} /> <Route path='/tabscontrolled' component={TabsControlledRoute} /> <Route path='/textfield' component={TextfieldRoute} /> <Route path='/textarea' component={TextareaRoute} /> </Shell> </HashRouter> ) } } ReactDOM.render(<App />, document.getElementById('root'))
HBM/md-components
examples/src/index.js
JavaScript
mit
5,249
import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; import { lodash } from 'meteor/stevezhu:lodash'; import { Bert } from 'meteor/themeteorchef:bert'; import { moment } from 'meteor/momentjs:moment'; import 'meteor/sacha:spin'; import { Workshops } from '../../../api/workshops/schema.js'; import { UserQuestions } from '../../../api/userQuestions/schema.js'; import './myDay.jade'; import '../../components/connect/connect.js'; Template.myDay.onCreated(function() { this.autorun(() => { this.subscribe('allWorkshopsForTheDay'); this.subscribe('resultForQuestionsAnswered', Meteor.userId()); }); }); Template.myDay.helpers({ workshopData() { return Workshops.findOne({ _id: this._id }, { fields: { name: 1, dateStart: 1, dateEnd: 1, color: 1, peopleToGo: 1, description: 1 } }); }, workshopColor(index) { if (index % 2 === 0) { return 'grey2'; } else { return false; } }, customWorkshops() { let questions = UserQuestions.find({ userId: Meteor.userId(), answered: true, deprecated: false }, { fields: { result: 1 } }).fetch(); let questionsObject = {}; let questionsArray = []; questions.map((cur) => { cur.result.map((cur1) => { if (cur1.workshopId) { if (questionsObject[cur1.workshopId]) { questionsObject[cur1.workshopId].value += cur1.result; questionsObject[cur1.workshopId].long += 1; } else { questionsObject[cur1.workshopId] = { value: cur1.result, long: 1 }; } } }); }); for (var prop in questionsObject) { questionsArray.push({ _id: prop, value: lodash.round(questionsObject[prop].value / questionsObject[prop].long * 100, 2) }); } questionsArray.sort((a, b) => { if (a.value < b.value) { return 1; } else if (a.value > b.value) { return -1; } else { return 0; } }); return questionsArray; }, dateStart() { return moment(this.dateStart).format('H:mm'); }, dateEnd() { return moment(this.dateEnd).format('H:mm'); }, isUserAlreadyIn() { if (lodash.findIndex(this.peopleToGo, ['userId', Meteor.userId()]) !== -1) { return true; } else { return false; } } }); Template.myDay.events({ 'click .goToWorkshop': function(event) { event.preventDefault(); const data = { userId: Meteor.userId(), workshopId: this._id }; Meteor.call('addUserToWorkshop', data, (error) => { if (error) { return Bert.alert(error.message, 'danger', 'growl-top-right'); } }); }, 'click .removeFromWorkshop': function(event) { event.preventDefault(); const data = { userId: Meteor.userId(), workshopId: this._id }; Meteor.call('removeUserFromWorkshop', data, (error) => { if (error) { return Bert.alert(error.message, 'danger', 'growl-top-right'); } }); } });
EKlore/EKlore
imports/ui/pages/myDay/myDay.js
JavaScript
mit
2,837
angular.module('luhbot',[ 'ui.router', 'dashboard' ]) //TODO: Persistance of socket .factory('IO',function(Toasts){ var IO = function(){ this.namespace = null; this.socket = {}; var self = this; this.connect = function(namespace){ if(namespace){ this.namespace = String('/').concat(namespace); this.socket = io.connect(String("http://").concat(window.location.hostname).concat(':7171').concat(this.namespace)); return this; } this.socket = io.connect(String("http://").concat(window.location.hostname).concat(':7171').concat(this.namespace)); return this; } this.listenNewMessages = function(){ this.socket.on('newMessage',function(data){ Toasts.makeToast(data.msg); }); return this; } this.joinChannel = function(channel){ this.socket.emit('joinChannel', channel); console.log('join') return this; } return this; } return new IO; }) .factory('Toasts',function(){ function makeToast(message){ Materialize.toast(message, 4000); } return { makeToast: makeToast } }) .factory('BOT',function($http,Toasts){ function connect(){ $http.get('/api/irc/turn/on') .success(function(data,status){ Toasts.makeToast(data.msg) }) .error(function(data,status){ Toasts.makeToast(data.msg) }); $http.get('/api/twitch/update/user') } function disconnect(){ $http.get('/api/irc/turn/off') .success(function(data,status){ Toasts.makeToast(data.msg) }) .error(function(data,status){ Toasts.makeToast(data.msg) }); } function ping(){ $http.get('/api/irc/ping') .success(function(data,status){ Toasts.makeToast(data.msg) }) .error(function(data,status){ Toasts.makeToast(data.msg) }); } function restart(){ $http.get('/api/irc/force') .success(function(data,status){ Toasts.makeToast(data.msg) }) .error(function(data,status){ Toasts.makeToast(data.msg) }); } return { connect : connect, disconnect: disconnect, ping : ping } }) .factory('User',function($http,$q){ var _user = new Object(); var df = $q.defer(); function getUserApi(){ $http.get('/api/users/me') .success(function(data,status){ df.resolve(data); }) .error(function(data,status){ console.error(data); df.reject(data) }); return df.promise; } function retrieveUserData(property){ if(!Object.keys(_user).length){ return getUserApi().then(function(data){ _user = data; if(property){ return _user[property]; } return _user; }); ; } if(property){ return _user[property]; } return _user; } return { getData: retrieveUserData } }) .config(function($urlRouterProvider){ $urlRouterProvider.otherwise('/dashboard'); }) .run(function(IO, User){ User.getData('twitchUser').then(function(channel){ IO.connect('alerts').listenNewMessages().joinChannel(channel); }); });
GreenLabsTech/Luhbot
public/js/app.js
JavaScript
mit
3,150
class ias_machineaccountvalidation { constructor() { } // System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType) CreateObjRef() { } // bool Equals(System.Object obj) Equals() { } // int GetHashCode() GetHashCode() { } // System.Object GetLifetimeService() GetLifetimeService() { } // type GetType() GetType() { } // System.Object InitializeLifetimeService() InitializeLifetimeService() { } // string ToString() ToString() { } } module.exports = ias_machineaccountvalidation;
mrpapercut/wscript
testfiles/COMobjects/JSclasses/IAS.MachineAccountValidation.js
JavaScript
mit
593
var utils = require('./utils') var webpack = require('webpack') var config = require('../config') var merge = require('webpack-merge') var baseWebpackConfig = require('./webpack.base.conf') var HtmlWebpackPlugin = require('html-webpack-plugin') var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') // add hot-reload related code to entry chunks Object.keys(baseWebpackConfig.entry).forEach(function (name) { baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) }) module.exports = merge(baseWebpackConfig, { node: { console: false, fs: 'empty', net: 'empty', tls: 'empty' }, module: { rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) }, { loader: 'file-loader', options: { name: '../static/theme/2001/*.fmi' } }, { loader: 'file-loader', options: { name: '../static/10347/10347.fmap' } }, // cheap-module-eval-source-map is faster for development devtool: '#cheap-module-eval-source-map', plugins: [ new webpack.DefinePlugin({ 'process.env': config.dev.env }), // https://github.com/glenjamin/webpack-hot-middleware#installation--usage new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin(), // https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ filename: 'index.html', template: 'index.html', inject: true }), new FriendlyErrorsPlugin() ] })
hkqdtc1/uKanTrack
build/webpack.dev.conf.js
JavaScript
mit
1,509