Showing preview only (1,971K chars total). Download the full file or copy to clipboard to get everything.
Repository: IceCreamYou/MainLoop.js
Branch: gh-pages
Commit: 8df73b0dabfc
Files: 23
Total size: 1.9 MB
Directory structure:
gitextract_tvzw8ahg/
├── .gitignore
├── .jscs.json
├── .jsduck.json
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── LICENSE.txt
├── README.md
├── bower.json
├── demo/
│ └── index.html
├── docs/
│ ├── app-0c945a27f43452df695771ddb60b3d14.js
│ ├── data-2ac7dd15e8c9f3475a3d8a544da392e1.js
│ ├── eg-iframe.html
│ ├── extjs/
│ │ └── ext-all.js
│ ├── index.html
│ ├── output/
│ │ └── MainLoop.js
│ ├── resources/
│ │ ├── css/
│ │ │ └── app-4689d2a5522dcd3c9e9923ca59c33f27.css
│ │ └── prettify/
│ │ ├── prettify.css
│ │ └── prettify.js
│ ├── source/
│ │ └── mainloop.html
│ └── styles-3eba09980fa05ead185cb17d9c0deb0f.css
├── package.json
└── src/
└── mainloop.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# NPM
node_modules/
# Windows
Desktop.ini
# JetBrains IDEs
*.iml
.idea/
.webstorm/
# OSX
.DS_Store
.AppleDouble
.LSOverride
**/Thumbs.db
# Icon must end with two \r
Icon
#
compiled
================================================
FILE: .jscs.json
================================================
{
"disallowEmptyBlocks": {
"allExcept": ["comments"]
},
"disallowImplicitTypeConversion": [],
"disallowKeywords": ["with"],
"disallowKeywordsOnNewLine": [],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowOperatorBeforeLineBreak": ["."],
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "~", "!"],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceBeforeComma": {
"allExcept": ["sparseArrays"]
},
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpaceBeforeSemicolon": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideBrackets": {
"allExcept": ["[", "]", "{", "}"]
},
"disallowSpacesInsideParenthesizedExpression": true,
"disallowTabs": true,
"disallowTrailingWhitespace": true,
"disallowYodaConditions": true,
"requireBlocksOnNewline": 1,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": ["for", "while", "do", "try", "catch"],
"requireKeywordsOnNewLine": ["else"],
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requireObjectKeysOnNewLine": {
"allExcept": ["sameLine"]
},
"requireParenthesesAroundIIFE": true,
"requireSemicolons": true,
"requireSpaceAfterBinaryOperators": ["=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireSpaceAfterComma": {
"allExcept": ["trailing"]
},
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "case", "return", "try", "void", "with", "typeof"],
"requireSpaceAfterLineComment": {
"allExcept": ["#", "="]
},
"requireSpaceBeforeBinaryOperators": ["=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInConditionalExpression": {
"afterTest": true,
"beforeConsequent": true,
"afterConsequent": true,
"beforeAlternate": true
},
"requireSpacesInForStatement": true,
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"validateQuoteMarks": {
"escape": true,
"mark": "'"
}
}
================================================
FILE: .jsduck.json
================================================
{
"--": [
"src"
],
"--output": "docs",
"--title": "MainLoop.js Documentation",
"--warnings": [
"-global"
],
"--local-storage-db": "jsduckml",
"--external": "DOMHighResTimeStamp",
"--footer": "<span style=\"color: #444; font-size: 12px;\"><span style=\"float: left; padding-left: 1em;\"><a href=\"https://github.com/IceCreamYou/MainLoop.js\" style=\"color: #083772;\">Fork this project on Github</a></span><span style=\"clear: both;\">By <a href=\"http://www.isaacsukin.com/\" style=\"color: #083772;\">Isaac Sukin</a> (<a href=\"https://github.com/IceCreamYou\" style=\"color: #083772;\">IceCreamYou</a>)</span></span>"
}
================================================
FILE: .travis.yml
================================================
---
language: node_js
sudo: false
node_js:
- "5"
install: npm install
before_script:
- npm install -g grunt-cli
script: grunt lint
cache:
directories:
- node_modules
branches:
only:
- gh-pages
================================================
FILE: CONTRIBUTING.md
================================================
Thank you for your interest in contributing to this library!
## Using the issue tracker
The issue tracker on GitHub is the preferred channel for bug reports, feature
requests, and submitting pull requests about this project.
## Pull requests
If you submit a pull request that changes source code, please run a build
before submitting so that your pull request also includes the built code and
documentation. Running a build will also run code style checks. When you submit
a pull request, the code changes will be automatically linted by
[Travis CI](https://travis-ci.com/) and the pull request will only be merged if
the checks pass.
To run a build or lint, you must have the following dependencies installed:
- [node.js](https://nodejs.org/en/)
- [grunt-cli](http://gruntjs.com/getting-started)
- [ruby](https://www.ruby-lang.org/en/) (to generate documentation)
- [jsduck](https://github.com/senchalabs/jsduck) (to generate documentation)
To set up the build, run `npm install` on the command line from the directory
containing the library's code. This will install software (listed in
`package.json` if you want to check) which is used to perform the build and
linting. Once you do this, you will not need to do it again. To upgrade these
developer dependencies, run `npm update`.
To run a build, just run `grunt` on the command line from the directory
containing the extension's code. To run just the code style checks, run
`grunt lint`. If you'd like the linting to run any time you change a source
code file, run `grunt watch` and it will run in the background.
## License
By submitting a contribution to this project, you agree to allow the project
owners to license your work as part of this project under this project's
[license](LICENSE.txt).
================================================
FILE: Gruntfile.js
================================================
module.exports = function(grunt) {
var banner = '/**\n' +
' * mainloop.js <%= pkg.version %>-<%= grunt.template.today("yyyymmdd") %>\n' +
' *\n' +
' * @author <%= pkg.author %>\n' +
' * @license <%= pkg.license %>\n' +
' */\n';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: banner,
compress: {
dead_code: false,
side_effects: false,
unused: false,
},
mangle: true,
preserveComments: function(node, comment) {
return (/^!/).test(comment.value);
},
report: 'min',
sourceMap: true,
},
target: {
files: {
'build/mainloop.min.js': ['src/mainloop.js'],
},
},
},
jshint: {
options: {
browser: true, // include browser globals
eqeqeq: true, // require strict equality
futurehostile: true, // warn if future-ES keywords are used
globals: { // globally available variable names; value = is writable
alert: false,
define: false, // for AMD exports
module: false, // for CommonJS exports
},
latedef: 'nofunc', // disallow using variables before they're defined
noarg: true, // disallow using arguments.caller and arguments.callee
nonbsp: true, // disallow non-breaking spaces
undef: true, // warn if a variable is used without being defined
unused: true, // warn if a variable is defined but not used
typed: true, // support typed array globals
worker: true, // support Web Worker globals
},
target: {
src: [
'src/mainloop.js',
'Gruntfile.js',
],
},
},
jscs: {
options: {
config: '.jscs.json',
},
main: [
'src/mainloop.js',
'Gruntfile.js',
],
},
watch: {
files: [
'src/mainloop.js',
],
tasks: ['uglify', 'exec:jsduck_notify'],
},
exec: {
jsduck_notify: {
// For some reason I can't get jsduck to run programmatically on
// Windows, but it works manually, so this is a workaround.
command: 'node -p "\'You need to run \\"jsduck --config=.jsduck.json\\" from the project directory to generate updated documentation.\'"',
},
jsduck: {
command: 'jsduck --config=.jsduck.json',
},
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-jscs');
grunt.registerTask('default', ['uglify', 'jshint', 'jscs', 'exec:jsduck_notify']);
grunt.registerTask('lint', ['jshint', 'jscs']);
grunt.registerTask('docs', ['exec:jsduck']);
};
================================================
FILE: LICENSE.txt
================================================
The MIT License
Copyright (C) 2016 Isaac Sukin
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.
================================================
FILE: README.md
================================================
[](https://travis-ci.org/IceCreamYou/MainLoop.js) [](https://www.npmjs.com/package/mainloop.js)
MainLoop.js provides a **well-constructed main loop** useful for JavaScript
games and other animated or time-dependent applications.
The main loop is a core part of any application in which state changes over
time. In games, it is typically responsible for computing physics and AI as
well as drawing the result on the screen.
Main loops are
[difficult to write correctly](http://www.isaacsukin.com/news/2015/01/detailed-explanation-javascript-game-loops-and-timing)
due to timing issues. **The vast majority of main loops found online are
written incorrectly**, resulting in applications that speed up or slow down
depending on the frame rate. This can cause unfortunate behavior like
characters running through walls or being unable to jump over obstacles. These
main loops can also result in applications that are non-deterministic. This
project solves these problems.
## Get started
- **[Example](https://icecreamyou.github.io/MainLoop.js/demo/)**
([source code](https://github.com/IceCreamYou/MainLoop.js/blob/gh-pages/demo/index.html))
- **[API documentation](https://icecreamyou.github.io/MainLoop.js/docs/#!/api/MainLoop)**
- **[MainLoop.js source code](https://github.com/IceCreamYou/MainLoop.js/blob/gh-pages/src/mainloop.js)**
(heavily documented to explain how it works - the source is about 75% docs)
- **[How it works](http://www.isaacsukin.com/news/2015/01/detailed-explanation-javascript-game-loops-and-timing)**
and a detailed walkthrough of what problems this project solves
### Installation
You can download the script normally, install it with npm
(`npm install mainloop.js`), or install it with Bower
(`bower install mainloop`). To include it on a page client-side without a
module loader:
```html
<!-- from a direct download or git clone -->
<script src="build/mainloop.min.js"></script>
<!-- from npm -->
<script src="node_modules/mainloop.js/build/mainloop.min.js"></script>
<!-- from Bower -->
<script src="bower_components/mainloop.js/build/mainloop.min.js"></script>
<!-- via CDN -->
<script src="https://cdn.jsdelivr.net/npm/mainloop.js@latest/build/mainloop.min.js"></script>
```
You then have access to the `MainLoop` global.
MainLoop.js is also compatible with CommonJS (e.g. with node.js or
browserify) and AMD (e.g. with RequireJS). This means that if you are using
a module loader or want to use MainLoop server-side you can call
`require('mainloop.js')` to get the `MainLoop` object or include `'mainloop.js'` in
the dependencies you pass to a `define()` call.
For TypeScript users, there are
[typings](https://www.npmjs.com/package/@types/mainloop.js)
available. Install them with `npm install --save-dev @types/mainloop.js`.
For Svelte users, you may want to try
[svelte-mainloop](https://github.com/retrotheft/svelte-mainloop),
a wrapper that adds several conveniences.
### Usage
`MainLoop` works by running functions you define every time the browser is
ready to update the screen (up to about 60 times per second on most monitors).
There are four such functions, all of which are optional. You can set them
using the following methods:
- `MainLoop.setBegin()`: the `begin` function runs at the beginning of each
frame and is typically used to process input.
- `MainLoop.setUpdate()`: the `update` function runs zero or more times per
frame depending on the frame rate. It is used to compute anything affected
by time - typically physics and AI movements.
- `MainLoop.setDraw()`: the `draw` function should update the screen, usually
by changing the DOM or painting a canvas.
- `MainLoop.setEnd()`: the `end` function runs at the end of each frame and is
typically used for cleanup tasks such as adjusting the visual quality based
on the frame rate.
The `update` function receives a `delta` parameter which holds the amount of
time in milliseconds that should be simulated. This should be used to calculate
movement. For example, if an object `obj` has an x-axis velocity of 100 units
per second (0.1 units per millisecond), the `update` function might look like
this:
```javascript
function update(delta) {
obj.x += 0.1 * delta;
}
```
This structure will ensure that your application behaves regardless of the
frame rate.
To start the application, simply call `MainLoop.start()`. For example, to start
the application for the first time, you might write:
```javascript
MainLoop.setUpdate(update).setDraw(draw).start();
```
You can call `MainLoop.stop()` to stop the application.
For more detail about the API, check out the
[documentation](https://icecreamyou.github.io/MainLoop.js/docs/#!/api/MainLoop).
You can also check out a
[usage example](https://icecreamyou.github.io/MainLoop.js/demo/)
([source code](https://github.com/IceCreamYou/MainLoop.js/blob/gh-pages/demo/index.html)).
## Notes
This project is
[MIT-licensed](https://github.com/IceCreamYou/MainLoop.js/blob/gh-pages/LICENSE.txt).
Compatible with all modern browsers (IE9+) including mobile browsers, as well
as node.js. There are no dependencies.
Contributions are welcome. To get started contributing, run `npm install` in
the project's directory, then run `grunt` before submitting a pull request to
update the minified script and the docs as well as to perform a style check.
The library is < 1KB minified and gzipped.
[Isaac Sukin](http://www.isaacsukin.com/)
([@IceCreamYou](https://twitter.com/IceCreamYou)) is the author of this
project. I'd love to hear about what you make! Special thanks to
[Ian Langworth](https://github.com/statico) for reviewing a version of this I
wrote for my
[book about making 3D browser games](http://www.packtpub.com/game-development-with-three-js/book)
and for some tips about web workers.
================================================
FILE: bower.json
================================================
{
"name": "MainLoop.js",
"version": "1.0.4",
"main": "build/mainloop.min.js",
"keywords": [
"main",
"loop",
"game",
"animation",
"time"
],
"ignore": [
"node_modules"
]
}
================================================
FILE: demo/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>MainLoop.js demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"> <!-- Display full-screen in standalone mode -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
</head>
<body>
<style>
/* Don't highlight anything on click-and-drag. */
:not(input):not(textarea) {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
html, body {
font-family: Arial,sans-serif;
font-size: 20px;
height: 100%;
letter-spacing: 0.5px;
line-height: 1.4;
overflow: hidden;
margin: 0;
padding: 0;
}
label {
cursor: pointer;
font-weight: bold;
}
canvas {
background-color: #EEEEEE;
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
}
#fpspicker,
#fpscounter {
bottom: 20px;
display: block;
left: 20px;
position: absolute;
}
#fpscounter {
left: auto;
right: 20px;
}
#fps {
margin-bottom: -5px;
}
#forkme {
position: absolute;
right: 0;
top: 0;
}
#forkme img {
border: 0;
}
</style>
<canvas id="canvas"></canvas>
<div id="fpspicker">
<label for="fps">Maximum FPS:</label>
<input type="range" id="fps" min=1 max=60 step=1 value=60>
<span id="fpsvalue">60</span>
</div>
<div id="fpscounter">0 FPS</div>
<a href="https://github.com/IceCreamYou/MainLoop.js" id="forkme" target="_blank">
<img src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png">
</a>
<script src="../build/mainloop.min.js"></script>
<script>
/**
* Draw a filled-in circle on the canvas.
*
* @param {Number} x
* The x-coordinate of the center of the circle.
* @param {Number} y
* The y-coordinate of the center of the circle.
* @param {Number} r
* The radius of the circle.
* @param {Mixed} [fillStyle]
* A canvas fillStyle used to fill the circle. If not specified, the circle
* uses the current fillStyle.
*
* @member CanvasRenderingContext2D
*/
CanvasRenderingContext2D.prototype.circle = function(x, y, r, fillStyle) {
this.beginPath();
this.arc(x, y, r, 0, 2 * Math.PI, false);
if (fillStyle) {
this.fillStyle = fillStyle;
}
this.fill();
};
/**
* The Planet class - an orbiting circle.
*
* @param {Object} center
* An object with `x` and `y` parameters representing coordinates for the
* center of the planet's orbit.
* @param {Number} radius
* The radius of the planet.
* @param {Number} [orbitRadius=0]
* The radius of the planet's orbit.
* @param {Number} [velocity=0]
* The velocity of the planet.
* @param {String} [color='black']
* The color of the planet.
*/
function Planet(center, radius, orbitRadius, velocity, color) {
this.center = center;
this.x = center.x + orbitRadius;
this.y = center.y;
this.lastX = this.x;
this.lastY = this.y;
this.radius = radius;
this.orbitRadius = orbitRadius || 0;
this.velocity = velocity || 0;
this.theta = 0;
this.color = color || 'black';
}
/**
* Updates the planet's position.
*
* @param {Number} delta
* The amount of time since the last time the planet was updated, in seconds.
*/
Planet.prototype.update = function(delta) {
this.lastX = this.x;
this.lastY = this.y;
this.theta += this.velocity * delta;
this.x = this.center.x + Math.cos(this.theta) * this.orbitRadius;
this.y = this.center.y + Math.sin(this.theta) * this.orbitRadius;
};
/**
* Draws the planet.
*
* @param {Number} interpolationPercentage
* How much to interpolate between frames.
*/
Planet.prototype.draw = function(interpolationPercentage) {
// Interpolate with the last position to reduce stuttering.
var x = this.lastX + (this.x - this.lastX) * interpolationPercentage,
y = this.lastY + (this.y - this.lastY) * interpolationPercentage;
context.circle(x, y, this.radius, this.color);
};
/**
* Updates all planets.
*
* @param {Number} delta
* The amount of time since the last update, in seconds.
*/
function update(delta) {
for (var i = 0, l = planets.length; i < l; i++) {
planets[i].update(delta);
}
}
/**
* Draws all planets.
*
* @param {Number} interpolationPercentage
* How much to interpolate between frames.
*/
function draw(interpolationPercentage) {
context.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0, l = planets.length; i < l; i++) {
planets[i].draw(interpolationPercentage);
}
}
/**
* Updates the FPS counter.
*
* @param {Number} fps
* The smoothed frames per second.
* @param {Boolean} panic
* Whether the main loop panicked because the simulation fell too far behind
* real time.
*/
function end(fps, panic) {
fpsCounter.textContent = Math.round(fps) + ' FPS';
if (panic) {
// This pattern introduces non-deterministic behavior, but in this case
// it's better than the alternative (the application would look like it
// was running very quickly until the simulation caught up to real
// time). See the documentation for `MainLoop.setEnd()` for additional
// explanation.
var discardedTime = Math.round(MainLoop.resetFrameDelta());
console.warn('Main loop panicked, probably because the browser tab was put in the background. Discarding ' + discardedTime + 'ms');
}
}
// Set up the canvas.
var canvas = document.getElementById('canvas'),
context = canvas.getContext('2d'),
fpsCounter = document.getElementById('fpscounter'),
fpsValue = document.getElementById('fpsvalue');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Set up the planets.
var smallerDimension = Math.min(window.innerWidth, window.innerHeight),
earthOrbitRadius = smallerDimension * 0.38,
moonOrbitRadius = smallerDimension * 0.10,
moonRadius = smallerDimension * 0.01,
sunRadius = earthOrbitRadius * 0.5,
earthRadius = earthOrbitRadius * 0.15,
sun = new Planet({x: canvas.width*0.5, y: canvas.height * 0.5}, sunRadius, 0, 0, '#FFD000'),
earth = new Planet(sun, earthRadius, earthOrbitRadius, 0.03 * Math.PI / 180, 'blue'),
moon = new Planet(earth, moonRadius, moonOrbitRadius, 0.1 * Math.PI / 180, 'gray'),
planets = [sun, earth, moon];
// Start the main loop.
MainLoop.setUpdate(update).setDraw(draw).setEnd(end).start();
// Update the slider value label while the slider is being dragged.
document.getElementById('fps').addEventListener('input', function() {
fpsValue.textContent = Math.round(this.value);
});
// Throttle the FPS when the slider value is set.
document.getElementById('fps').addEventListener('change', function() {
var val = parseInt(this.value, 10);
MainLoop.setMaxAllowedFPS(val === 60 ? Infinity : val);
});
</script>
</body>
</html>
================================================
FILE: docs/app-0c945a27f43452df695771ddb60b3d14.js
================================================
var CodeMirror=(function(){function u(aM,aJ){var b1={},bj=u.defaults;for(var az in bj){if(bj.hasOwnProperty(az)){b1[az]=(aJ&&aJ.hasOwnProperty(az)?aJ:bj)[az]}}var aD=document.createElement("div");aD.className="CodeMirror"+(b1.lineWrapping?" CodeMirror-wrap":"");aD.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor"> </pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>';if(aM.appendChild){aM.appendChild(aD)}else{aM(aD)}var bX=aD.firstChild,bm=bX.firstChild,bk=aD.lastChild,bM=bk.firstChild,cg=bM.firstChild,aH=cg.firstChild,aY=aH.firstChild,bu=aH.nextSibling.firstChild,av=bu.firstChild,bc=av.nextSibling,bg=bc.nextSibling,aq=bg.nextSibling;cD();if(s){bm.style.width="0px"}if(!f){bu.draggable=true}bu.style.outline="none";if(b1.tabindex!=null){bm.tabIndex=b1.tabindex}if(b1.autofocus){bz()}if(!b1.gutter&&!b1.lineNumbers){aH.style.display="none"}if(m){bX.style.height="1px",bX.style.position="absolute"}try{ct("x")}catch(b8){if(b8.message.match(/runtime/i)){b8=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")}throw b8}var b7=new z(),aw=new z(),cP;var cb,cy=new i([new ah([new e("")])]),ch,cj;bT();var cW={from:{line:0,ch:0},to:{line:0,ch:0},inverted:false};var ci,bq,aZ,bF=0,bb,cn=false,cs=false;var cp,b6,aB,cN,aP,bf,aS,cA;var bd=0,cQ=0,bL=0,bN=0;var b4;var bD="",aF;var ap={};ar(function(){aW(b1.value||"");cp=false})();var a8=new k();r(bk,"mousedown",ar(ck));r(bk,"dblclick",ar(bW));r(bu,"selectstart",T);if(!N){r(bk,"contextmenu",a1)}r(bk,"scroll",function(){bF=bk.scrollTop;cd([]);if(b1.fixedGutter){aH.style.left=bk.scrollLeft+"px"}if(b1.onScroll){b1.onScroll(b9)}});r(window,"resize",function(){cd(true)});r(bm,"keyup",ar(cl));r(bm,"input",aQ);r(bm,"keydown",ar(cc));r(bm,"keypress",ar(bn));r(bm,"focus",cU);r(bm,"blur",aE);if(b1.dragDrop){r(bu,"dragstart",aI);function bC(cZ){if(b1.onDragEvent&&b1.onDragEvent(b9,O(cZ))){return}w(cZ)}r(bk,"dragenter",bC);r(bk,"dragover",bC);r(bk,"drop",ar(an))}r(bk,"paste",function(){bz();aQ()});r(bm,"paste",aQ);r(bm,"cut",ar(function(){if(!b1.readOnly){bs("")}}));if(m){r(bM,"mouseup",function(){if(document.activeElement==bm){bm.blur()}bz()})}var cw;try{cw=(document.activeElement==bm)}catch(b8){}if(cw||b1.autofocus){setTimeout(cU,20)}else{aE()}function br(cZ){return cZ>=0&&cZ<cy.size}var b9=aD.CodeMirror={getValue:b2,setValue:ar(aW),getSelection:b3,replaceSelection:ar(bs),focus:function(){window.focus();bz();cU();aQ()},setOption:function(c0,c1){var cZ=b1[c0];b1[c0]=c1;if(c0=="mode"||c0=="indentUnit"){bT()}else{if(c0=="readOnly"&&c1=="nocursor"){aE();bm.blur()}else{if(c0=="readOnly"&&!c1){cC(true)}else{if(c0=="theme"){cD()}else{if(c0=="lineWrapping"&&cZ!=c1){ar(cG)()}else{if(c0=="tabSize"){cd(true)}}}}}}if(c0=="lineNumbers"||c0=="gutter"||c0=="firstLineNumber"||c0=="theme"){be();cd(true)}},getOption:function(cZ){return b1[cZ]},undo:ar(cT),redo:ar(cJ),indentLine:ar(function(c0,cZ){if(typeof cZ!="string"){if(cZ==null){cZ=b1.smartIndent?"smart":"prev"}else{cZ=cZ?"add":"subtract"}}if(br(c0)){by(c0,cZ)}}),indentSelection:ar(cB),historySize:function(){return{undo:a8.done.length,redo:a8.undone.length}},clearHistory:function(){a8=new k()},matchBrackets:ar(function(){ce(true)}),getTokenAt:ar(function(cZ){cZ=aT(cZ);return cF(cZ.line).getTokenAt(cb,cu(cZ.line),cZ.ch)}),getStateAfter:function(cZ){cZ=bZ(cZ==null?cy.size-1:cZ);return cu(cZ+1)},cursorCoords:function(c0,cZ){if(c0==null){c0=cW.inverted}return this.charCoords(c0?cW.from:cW.to,cZ)},charCoords:function(c0,cZ){c0=aT(c0);if(cZ=="local"){return cR(c0,false)}if(cZ=="div"){return cR(c0,true)}return ao(c0)},coordsChar:function(cZ){var c0=ak(bu);return bH(cZ.x-c0.left,cZ.y-c0.top)},markText:ar(bE),setBookmark:aU,findMarksAt:bo,setMarker:ar(bV),clearMarker:ar(au),setLineClass:ar(bl),hideLine:ar(function(cZ){return cK(cZ,true)}),showLine:ar(function(cZ){return cK(cZ,false)}),onDeleteLine:function(cZ,c0){if(typeof cZ=="number"){if(!br(cZ)){return null}cZ=cF(cZ)}(cZ.handlers||(cZ.handlers=[])).push(c0);return cZ},lineInfo:aV,addWidget:function(c3,c1,c5,c2,c7){c3=cR(aT(c3));var c4=c3.yBot,c0=c3.x;c1.style.position="absolute";bM.appendChild(c1);if(c2=="over"){c4=c3.y}else{if(c2=="near"){var cZ=Math.max(bk.offsetHeight,cy.height*bP()),c6=Math.max(bM.clientWidth,bu.clientWidth)-a5();if(c3.yBot+c1.offsetHeight>cZ&&c3.y>c1.offsetHeight){c4=c3.y-c1.offsetHeight}if(c0+c1.offsetWidth>c6){c0=c6-c1.offsetWidth}}}c1.style.top=(c4+cr())+"px";c1.style.left=c1.style.right="";if(c7=="right"){c0=bM.clientWidth-c1.offsetWidth;c1.style.right="0px"}else{if(c7=="left"){c0=0}else{if(c7=="middle"){c0=(bM.clientWidth-c1.offsetWidth)/2}}c1.style.left=(c0+a5())+"px"}if(c5){aA(c0,c4,c0+c1.offsetWidth,c4+c1.offsetHeight)}},lineCount:function(){return cy.size},clipPos:aT,getCursor:function(cZ){if(cZ==null){cZ=cW.inverted}return aa(cZ?cW.from:cW.to)},somethingSelected:function(){return !ad(cW.from,cW.to)},setCursor:ar(function(cZ,c1,c0){if(c1==null&&typeof cZ.line=="number"){a6(cZ.line,cZ.ch,c0)}else{a6(cZ,c1,c0)}}),setSelection:ar(function(c1,c0,cZ){(cZ?bx:bw)(aT(c1),aT(c0||c1))}),getLine:function(cZ){if(br(cZ)){return cF(cZ).text}},getLineHandle:function(cZ){if(br(cZ)){return cF(cZ)}},setLine:ar(function(cZ,c0){if(br(cZ)){bQ(c0,{line:cZ,ch:0},{line:cZ,ch:cF(cZ).text.length})}}),removeLine:ar(function(cZ){if(br(cZ)){bQ("",{line:cZ,ch:0},aT({line:cZ+1,ch:0}))}}),replaceRange:ar(bQ),getRange:function(c0,cZ){return cO(aT(c0),aT(cZ))},triggerOnKeyDown:ar(cc),execCommand:function(cZ){return L[cZ](b9)},moveH:ar(cE),deleteH:ar(cm),moveV:ar(cx),toggleOverwrite:function(){if(cn){cn=false;bc.className=bc.className.replace(" CodeMirror-overwrite","")}else{cn=true;bc.className+=" CodeMirror-overwrite"}},posFromIndex:function(c0){var c1=0,cZ;cy.iter(0,cy.size,function(c2){var c3=c2.text.length+1;if(c3>c0){cZ=c0;return true}c0-=c3;++c1});return aT({line:c1,ch:cZ})},indexFromPos:function(c0){if(c0.line<0||c0.ch<0){return 0}var cZ=c0.ch;cy.iter(0,c0.line,function(c1){cZ+=c1.text.length+1});return cZ},scrollTo:function(cZ,c0){if(cZ!=null){bk.scrollLeft=cZ}if(c0!=null){bk.scrollTop=c0}cd([])},operation:function(cZ){return ar(cZ)()},compoundChange:function(cZ){return bO(cZ)},refresh:function(){cd(true);if(bk.scrollHeight>bF){bk.scrollTop=bF}},getInputField:function(){return bm},getWrapperElement:function(){return aD},getScrollerElement:function(){return bk},getGutterElement:function(){return aH}};function cF(cZ){return C(cy,cZ)}function a3(c0,cZ){aS=true;var c1=cZ-c0.height;for(var c2=c0;c2;c2=c2.parent){c2.height+=c1}}function aW(cZ){var c0={line:0,ch:0};aO(c0,{line:cy.size-1,ch:cF(cy.size-1).text.length},A(cZ),c0,c0);cp=true}function b2(){var cZ=[];cy.iter(0,cy.size,function(c0){cZ.push(c0.text)});return cZ.join("\n")}function ck(c8){a4(y(c8,"shiftKey"));for(var c3=j(c8);c3!=aD;c3=c3.parentNode){if(c3.parentNode==bM&&c3!=cg){return}}for(var c3=j(c8);c3!=aD;c3=c3.parentNode){if(c3.parentNode==aY){if(b1.onGutterClick){b1.onGutterClick(b9,q(aY.childNodes,c3)+cQ,c8)}return T(c8)}}var cZ=a2(c8);switch(x(c8)){case 3:if(N&&!M){a1(c8)}return;case 2:if(cZ){a6(cZ.line,cZ.ch,true)}return}if(!cZ){if(j(c8)==bk){T(c8)}return}if(!cj){cU()}var c0=+new Date;if(aZ&&aZ.time>c0-400&&ad(aZ.pos,cZ)){T(c8);setTimeout(bz,20);return aK(cZ.line)}else{if(bq&&bq.time>c0-400&&ad(bq.pos,cZ)){aZ={time:c0,pos:cZ};T(c8);return bI(cZ)}else{bq={time:c0,pos:cZ}}}var da=cZ,c1;if(b1.dragDrop&&F&&!b1.readOnly&&!ad(cW.from,cW.to)&&!Z(cZ,cW.from)&&!Z(cW.to,cZ)){if(f){bu.draggable=true}function c4(db){if(f){bu.draggable=false}bb=false;c7();c2();if(Math.abs(c8.clientX-db.clientX)+Math.abs(c8.clientY-db.clientY)<10){T(db);a6(cZ.line,cZ.ch,true);bz()}}var c7=r(document,"mouseup",ar(c4),true);var c2=r(bk,"drop",ar(c4),true);bb=true;if(bu.dragDrop){bu.dragDrop()}return}T(c8);a6(cZ.line,cZ.ch,true);function c9(db){var dd=a2(db,true);if(dd&&!ad(dd,da)){if(!cj){cU()}da=dd;bx(cZ,dd);cp=false;var dc=bA();if(dd.line>=dc.to||dd.line<dc.from){c1=setTimeout(ar(function(){c9(db)}),150)}}}function c6(db){clearTimeout(c1);var dc=a2(db);if(dc){bx(cZ,dc)}T(db);bz();cp=true;c5();c7()}var c5=r(document,"mousemove",ar(function(db){clearTimeout(c1);T(db);if(!I&&!x(db)){c6(db)}else{c9(db)}}),true);var c7=r(document,"mouseup",ar(c6),true)}function bW(cZ){for(var c1=j(cZ);c1!=aD;c1=c1.parentNode){if(c1.parentNode==aY){return T(cZ)}}var c0=a2(cZ);if(!c0){return}aZ={time:+new Date,pos:c0};T(cZ);bI(c0)}function an(c3){if(b1.onDragEvent&&b1.onDragEvent(b9,O(c3))){return}c3.preventDefault();var c6=a2(c3,true),c0=c3.dataTransfer.files;if(!c6||b1.readOnly){return}if(c0&&c0.length&&window.FileReader&&window.File){function c2(c9,c8){var c7=new FileReader;c7.onload=function(){c4[c8]=c7.result;if(++c1==c5){c6=aT(c6);ar(function(){var da=bQ(c4.join(""),c6,c6);bx(c6,da)})()}};c7.readAsText(c9)}var c5=c0.length,c4=Array(c5),c1=0;for(var cZ=0;cZ<c5;++cZ){c2(c0[cZ],cZ)}}else{try{var c4=c3.dataTransfer.getData("Text");if(c4){bO(function(){var c8=cW.from,c7=cW.to;bx(c6,c6);if(bb){bQ("",c8,c7)}bs(c4);bz()})}}catch(c3){}}}function aI(c1){var cZ=b3();c1.dataTransfer.setData("Text",cZ);if(N||af){var c0=document.createElement("img");c0.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=";c1.dataTransfer.setDragImage(c0,0,0)}}function bi(c1,cZ){if(typeof c1=="string"){c1=L[c1];if(!c1){return false}}var c0=ci;try{if(b1.readOnly){cs=true}if(cZ){ci=null}c1(b9)}catch(c2){if(c2!=ab){throw c2}return false}finally{ci=c0;cs=false}return true}function cL(c5){var cZ=c(b1.keyMap),c2=cZ.auto;clearTimeout(bB);if(c2&&!Q(c5)){bB=setTimeout(function(){if(c(b1.keyMap)==cZ){b1.keyMap=(c2.call?c2.call(null,b9):c2)}},50)}var c0=R[y(c5,"keyCode")],c4=false;if(c0==null||c5.altGraphKey){return false}if(y(c5,"altKey")){c0="Alt-"+c0}if(y(c5,"ctrlKey")){c0="Ctrl-"+c0}if(y(c5,"metaKey")){c0="Cmd-"+c0}var c3=false;function c1(){c3=true}if(y(c5,"shiftKey")){c4=l("Shift-"+c0,b1.extraKeys,b1.keyMap,function(c6){return bi(c6,true)},c1)||l(c0,b1.extraKeys,b1.keyMap,function(c6){if(typeof c6=="string"&&/^go[A-Z]/.test(c6)){return bi(c6)}},c1)}else{c4=l(c0,b1.extraKeys,b1.keyMap,bi,c1)}if(c3){c4=false}if(c4){T(c5);if(I){c5.oldKeyCode=c5.keyCode;c5.keyCode=0}}return c4}function bY(c1,cZ){var c0=l("'"+cZ+"'",b1.extraKeys,b1.keyMap,function(c2){return bi(c2,true)});if(c0){T(c1)}return c0}var cI=null,bB;function cc(c1){if(!cj){cU()}if(I&&c1.keyCode==27){c1.returnValue=false}if(bt){if(bK()){bt=false}}if(b1.onKeyEvent&&b1.onKeyEvent(b9,O(c1))){return}var cZ=y(c1,"keyCode");a4(cZ==16||y(c1,"shiftKey"));var c0=cL(c1);if(window.opera){cI=c0?cZ:null;if(!c0&&cZ==88&&y(c1,M?"metaKey":"ctrlKey")){bs("")}}}function bn(c2){if(bt){bK()}if(b1.onKeyEvent&&b1.onKeyEvent(b9,O(c2))){return}var c1=y(c2,"keyCode"),cZ=y(c2,"charCode");if(window.opera&&c1==cI){cI=null;T(c2);return}if(((window.opera&&!c2.which)||m)&&cL(c2)){return}var c0=String.fromCharCode(cZ==null?c1:cZ);if(b1.electricChars&&cb.electricChars&&b1.smartIndent&&!b1.readOnly){if(cb.electricChars.indexOf(c0)>-1){setTimeout(ar(function(){by(cW.to.line,"smart")}),75)}}if(bY(c2,c0)){return}aQ()}function cl(cZ){if(b1.onKeyEvent&&b1.onKeyEvent(b9,O(cZ))){return}if(y(cZ,"keyCode")==16){ci=null}}function cU(){if(b1.readOnly=="nocursor"){return}if(!cj){if(b1.onFocus){b1.onFocus(b9)}cj=true;if(aD.className.search(/\bCodeMirror-focused\b/)==-1){aD.className+=" CodeMirror-focused"}if(!bf){cC(true)}}am();cM()}function aE(){if(cj){if(b1.onBlur){b1.onBlur(b9)}cj=false;if(b4){ar(function(){if(b4){b4();b4=null}})()}aD.className=aD.className.replace(" CodeMirror-focused","")}clearInterval(cP);setTimeout(function(){if(!cj){ci=null}},150)}function aO(c4,c3,c2,c0,cZ){if(cs){return}if(a8){var c1=[];cy.iter(c4.line,c3.line+1,function(c5){c1.push(c5.text)});a8.addChange(c4.line,c2.length,c1);while(a8.done.length>b1.undoDepth){a8.done.shift()}}at(c4,c3,c2,c0,cZ)}function ca(c4,c5){if(!c4.length){return}var c6=c4.pop(),c0=[];for(var c1=c6.length-1;c1>=0;c1-=1){var c3=c6[c1];var c7=[],cZ=c3.start+c3.added;cy.iter(c3.start,cZ,function(c8){c7.push(c8.text)});c0.push({start:c3.start,added:c3.old.length,old:c7});var c2=aT({line:c3.start+c3.old.length-1,ch:W(c7[c7.length-1],c3.old[c3.old.length-1])});at({line:c3.start,ch:0},{line:cZ-1,ch:cF(cZ-1).text.length},c3.old,c2,c2)}cp=true;c5.push(c0)}function cT(){ca(a8.done,a8.undone)}function cJ(){ca(a8.undone,a8.done)}function at(de,c3,dk,cZ,dl){if(cs){return}var dj=false,c2=bD.length;if(!b1.lineWrapping){cy.iter(de.line,c3.line+1,function(dm){if(dm.text.length==c2){dj=true;return true}})}if(de.line!=c3.line||dk.length>1){aS=true}var db=c3.line-de.line,da=cF(de.line),c0=cF(c3.line);if(de.ch==0&&c3.ch==0&&dk[dk.length-1]==""){var c8=[],c9=null;if(de.line){c9=cF(de.line-1);c9.fixMarkEnds(c0)}else{c0.fixMarkStarts()}for(var dg=0,di=dk.length-1;dg<di;++dg){c8.push(e.inheritMarks(dk[dg],c9))}if(db){cy.remove(de.line,db,cA)}if(c8.length){cy.insert(de.line,c8)}}else{if(da==c0){if(dk.length==1){da.replace(de.ch,c3.ch,dk[0])}else{c0=da.split(c3.ch,dk[dk.length-1]);da.replace(de.ch,null,dk[0]);da.fixMarkEnds(c0);var c8=[];for(var dg=1,di=dk.length-1;dg<di;++dg){c8.push(e.inheritMarks(dk[dg],da))}c8.push(c0);cy.insert(de.line+1,c8)}}else{if(dk.length==1){da.replace(de.ch,null,dk[0]);c0.replace(null,c3.ch,"");da.append(c0);cy.remove(de.line+1,db,cA)}else{var c8=[];da.replace(de.ch,null,dk[0]);c0.replace(null,c3.ch,dk[dk.length-1]);da.fixMarkEnds(c0);for(var dg=1,di=dk.length-1;dg<di;++dg){c8.push(e.inheritMarks(dk[dg],da))}if(db>1){cy.remove(de.line+1,db-1,cA)}cy.insert(de.line+1,c8)}}}if(b1.lineWrapping){var c5=Math.max(5,bk.clientWidth/bh()-3);cy.iter(de.line,de.line+dk.length,function(dm){if(dm.hidden){return}var dn=Math.ceil(dm.text.length/c5)||1;if(dn!=dm.height){a3(dm,dn)}})}else{cy.iter(de.line,de.line+dk.length,function(dn){var dm=dn.text;if(dm.length>c2){bD=dm;c2=dm.length;aF=null;dj=false}});if(dj){c2=0;bD="";aF=null;cy.iter(0,cy.size,function(dn){var dm=dn.text;if(dm.length>c2){c2=dm.length;bD=dm}})}}var c1=[],c7=dk.length-db-1;for(var dg=0,dd=ch.length;dg<dd;++dg){var dh=ch[dg];if(dh<de.line){c1.push(dh)}else{if(dh>c3.line){c1.push(dh+c7)}}}var df=de.line+Math.min(dk.length,500);cH(de.line,df);c1.push(df);ch=c1;bG(100);aB.push({from:de.line,to:c3.line+1,diff:c7});var c6={from:de,to:c3,text:dk};if(cN){for(var c4=cN;c4.next;c4=c4.next){}c4.next=c6}else{cN=c6}function dc(dm){return dm<=Math.min(c3.line,c3.line+c7)?dm:dm+c7}bw(cZ,dl,dc(cW.from.line),dc(cW.to.line));if(bk.clientHeight){bM.style.height=(cy.height*bP()+2*cr())+"px"}}function bQ(c0,c3,c2){c3=aT(c3);if(!c2){c2=c3}else{c2=aT(c2)}c0=A(c0);function c1(c6){if(Z(c6,c3)){return c6}if(!Z(c2,c6)){return cZ}var c4=c6.line+c0.length-(c2.line-c3.line)-1;var c5=c6.ch;if(c6.line==c2.line){c5+=c0[c0.length-1].length-(c2.ch-(c2.line==c3.line?c3.ch:0))}return{line:c4,ch:c5}}var cZ;aC(c0,c3,c2,function(c4){cZ=c4;return{from:c1(cW.from),to:c1(cW.to)}});return cZ}function bs(cZ,c0){aC(A(cZ),cW.from,cW.to,function(c1){if(c0=="end"){return{from:c1,to:c1}}else{if(c0=="start"){return{from:cW.from,to:cW.from}}else{return{from:cW.from,to:c1}}}})}function aC(c2,c4,c3,cZ){var c1=c2.length==1?c2[0].length+c4.ch:c2[c2.length-1].length;var c0=cZ({line:c4.line+c2.length-1,ch:c1});aO(c4,c3,c2,c0.from,c0.to)}function cO(c3,c2){var c0=c3.line,cZ=c2.line;if(c0==cZ){return cF(c0).text.slice(c3.ch,c2.ch)}var c1=[cF(c0).text.slice(c3.ch)];cy.iter(c0+1,cZ,function(c4){c1.push(c4.text)});c1.push(cF(cZ).text.slice(0,c2.ch));return c1.join("\n")}function b3(){return cO(cW.from,cW.to)}var bt=false;function am(){if(bt){return}b7.set(b1.pollInterval,function(){aN();bK();if(cj){am()}ay()})}function aQ(){var cZ=false;bt=true;function c0(){aN();var c1=bK();if(!c1&&!cZ){cZ=true;b7.set(60,c0)}else{bt=false;am()}ay()}b7.set(20,c0)}var ba="";function bK(){if(bf||!cj||ae(bm)||b1.readOnly){return false}var c0=bm.value;if(c0==ba){return false}ci=null;var c1=0,cZ=Math.min(ba.length,c0.length);while(c1<cZ&&ba[c1]==c0[c1]){++c1}if(c1<ba.length){cW.from={line:cW.from.line,ch:cW.from.ch-(ba.length-c1)}}else{if(cn&&ad(cW.from,cW.to)){cW.to={line:cW.to.line,ch:Math.min(cF(cW.to.line).text.length,cW.to.ch+(c0.length-c1))}}}bs(c0.slice(c1),"end");ba=c0;return true}function cC(cZ){if(!ad(cW.from,cW.to)){ba="";bm.value=b3();a(bm)}else{if(cZ){ba=bm.value=""}}}function bz(){if(b1.readOnly!="nocursor"){bm.focus()}}function cY(){if(!bc.getBoundingClientRect){return}var cZ=bc.getBoundingClientRect();if(I&&cZ.top==cZ.bottom){return}var c0=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);if(cZ.top<0||cZ.bottom>c0){bc.scrollIntoView()}}function cf(){var c0=cR(cW.inverted?cW.from:cW.to);var cZ=b1.lineWrapping?Math.min(c0.x,bu.offsetWidth):c0.x;return aA(cZ,c0.y,cZ,c0.yBot)}function aA(c1,c7,cZ,c6){var c4=a5(),dc=cr();c7+=dc;c6+=dc;c1+=c4;cZ+=c4;var c9=bk.clientHeight,c2=bk.scrollTop,c0=false,db=true;if(c7<c2){bk.scrollTop=Math.max(0,c7);c0=true}else{if(c6>c2+c9){bk.scrollTop=c6-c9;c0=true}}var c8=bk.clientWidth,da=bk.scrollLeft;var c5=b1.fixedGutter?aH.clientWidth:0;var c3=c1<c5+c4+10;if(c1<da+c5||c3){if(c3){c1=0}bk.scrollLeft=Math.max(0,c1-10-c5);c0=true}else{if(cZ>c8+da-3){bk.scrollLeft=cZ+10-c8;c0=true;if(cZ>bM.clientWidth){db=false}}}if(c0&&b1.onScroll){b1.onScroll(b9)}return db}function bA(){var cZ=bP(),c2=bk.scrollTop-cr();var c1=Math.max(0,Math.floor(c2/cZ));var c0=Math.ceil((c2+bk.clientHeight)/cZ);return{from:X(cy,c1),to:X(cy,c0)}}function cd(c7,c3){if(!bk.clientWidth){cQ=bL=bd=0;return}var c2=bA();if(c7!==true&&c7.length==0&&c2.from>cQ&&c2.to<bL){return}var c8=Math.max(c2.from-100,0),c9=Math.min(cy.size,c2.to+100);if(cQ<c8&&c8-cQ<20){c8=cQ}if(bL>c9&&bL-c9<20){c9=Math.min(cy.size,bL)}var db=c7===true?[]:b0([{from:cQ,to:bL,domStart:0}],c7);var c6=0;for(var c4=0;c4<db.length;++c4){var c5=db[c4];if(c5.from<c8){c5.domStart+=(c8-c5.from);c5.from=c8}if(c5.to>c9){c5.to=c9}if(c5.from>=c5.to){db.splice(c4--,1)}else{c6+=c5.to-c5.from}}if(c6==c9-c8&&c8==cQ&&c9==bL){return}db.sort(function(dd,dc){return dd.domStart-dc.domStart});var c1=bP(),cZ=aH.style.display;aq.style.display="none";aR(c8,c9,db);aq.style.display=aH.style.display="";var c0=c8!=cQ||c9!=bL||bN!=bk.clientHeight+c1;if(c0){bN=bk.clientHeight+c1}cQ=c8;bL=c9;bd=g(cy,c8);cg.style.top=(bd*c1)+"px";if(bk.clientHeight){bM.style.height=(cy.height*c1+2*cr())+"px"}if(aq.childNodes.length!=bL-cQ){throw new Error("BAD PATCH! "+JSON.stringify(db)+" size="+(bL-cQ)+" nodes="+aq.childNodes.length)}function da(){aF=bk.clientWidth;var dd=aq.firstChild,dc=false;cy.iter(cQ,bL,function(df){if(!df.hidden){var de=Math.round(dd.offsetHeight/c1)||1;if(df.height!=de){a3(df,de);aS=dc=true}}dd=dd.nextSibling});if(dc){bM.style.height=(cy.height*c1+2*cr())+"px"}return dc}if(b1.lineWrapping){da()}else{if(aF==null){aF=ct(bD)}if(aF>bk.clientWidth){bu.style.width=aF+"px";bM.style.width="";bM.style.width=bk.scrollWidth+"px"}else{bu.style.width=bM.style.width=""}}aH.style.display=cZ;if(c0||aS){aL()&&b1.lineWrapping&&da()&&aL()}cV();if(!c3&&b1.onUpdate){b1.onUpdate(b9)}return true}function b0(c8,c6){for(var c3=0,c1=c6.length||0;c3<c1;++c3){var c5=c6[c3],cZ=[],c7=c5.diff||0;for(var c2=0,c0=c8.length;c2<c0;++c2){var c4=c8[c2];if(c5.to<=c4.from&&c5.diff){cZ.push({from:c4.from+c7,to:c4.to+c7,domStart:c4.domStart})}else{if(c5.to<=c4.from||c5.from>=c4.to){cZ.push(c4)}else{if(c5.from>c4.from){cZ.push({from:c4.from,to:c5.from,domStart:c4.domStart})}if(c5.to<c4.to){cZ.push({from:c5.to+c7,to:c4.to+c7,domStart:c4.domStart+(c5.to-c4.from)})}}}}c8=cZ}return c8}function aR(c8,c9,db){if(!db.length){aq.innerHTML=""}else{function cZ(dd){var dc=dd.nextSibling;dd.parentNode.removeChild(dd);return dc}var c3=0,c1=aq.firstChild,c0;for(var c4=0;c4<db.length;++c4){var da=db[c4];while(da.domStart>c3){c1=cZ(c1);c3++}for(var c2=0,c6=da.to-da.from;c2<c6;++c2){c1=c1.nextSibling;c3++}}while(c1){c1=cZ(c1)}}var c5=db.shift(),c1=aq.firstChild,c2=c8;var c7=document.createElement("div");cy.iter(c8,c9,function(dc){if(c5&&c5.to==c2){c5=db.shift()}if(!c5||c5.from>c2){if(dc.hidden){var dd=c7.innerHTML="<pre></pre>"}else{var dd="<pre"+(dc.className?' class="'+dc.className+'"':"")+">"+dc.getHTML(a9)+"</pre>";if(dc.bgClassName){dd='<div style="position: relative"><pre class="'+dc.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2"> </pre>'+dd+"</div>"}}c7.innerHTML=dd;aq.insertBefore(c7.firstChild,c1)}else{c1=c1.nextSibling}++c2})}function aL(){if(!b1.gutter&&!b1.lineNumbers){return}var c0=cg.offsetHeight,c8=bk.clientHeight;aH.style.height=(c0-c8<2?c8:c0)+"px";var c6=[],c4=cQ,c7;cy.iter(cQ,Math.max(bL,cQ+1),function(da){if(da.hidden){c6.push("<pre></pre>")}else{var c9=da.gutterMarker;var dc=b1.lineNumbers?c4+b1.firstLineNumber:null;if(c9&&c9.text){dc=c9.text.replace("%N%",dc!=null?dc:"")}else{if(dc==null){dc="\u00a0"}}c6.push((c9&&c9.style?'<pre class="'+c9.style+'">':"<pre>"),dc);for(var db=1;db<da.height;++db){c6.push("<br/> ")}c6.push("</pre>");if(!c9){c7=c4}}++c4});aH.style.display="none";aY.innerHTML=c6.join("");if(c7!=null){var c2=aY.childNodes[c7-cQ];var c3=String(cy.size).length,cZ=H(c2),c1="";while(cZ.length+c1.length<c3){c1+="\u00a0"}if(c1){c2.insertBefore(document.createTextNode(c1),c2.firstChild)}}aH.style.display="";var c5=Math.abs((parseInt(bu.style.marginLeft)||0)-aH.offsetWidth)>2;bu.style.marginLeft=aH.offsetWidth+"px";aS=false;return c5}function cV(){var c2=ad(cW.from,cW.to);var dd=cR(cW.from,true);var c8=c2?dd:cR(cW.to,true);var c6=cW.inverted?dd:c8,c0=bP();var cZ=ak(aD),c1=ak(aq);bX.style.top=Math.max(0,Math.min(bk.offsetHeight,c6.y+c1.top-cZ.top))+"px";bX.style.left=Math.max(0,Math.min(bk.offsetWidth,c6.x+c1.left-cZ.left))+"px";if(c2){bc.style.top=c6.y+"px";bc.style.left=(b1.lineWrapping?Math.min(c6.x,bu.offsetWidth):c6.x)+"px";bc.style.display="";bg.style.display="none"}else{var db=dd.y==c8.y,c4="";var c9=bu.clientWidth||bu.offsetWidth;var c5=bu.clientHeight||bu.offsetHeight;function dc(di,dh,dg,de){var df=E?"width: "+(!dg?c9:c9-dg-di)+"px":"right: "+dg+"px";c4+='<div class="CodeMirror-selected" style="position: absolute; left: '+di+"px; top: "+dh+"px; "+df+"; height: "+de+'px"></div>'}if(cW.from.ch&&dd.y>=0){var da=db?c9-c8.x:0;dc(dd.x,dd.y,da,c0)}var c3=Math.max(0,dd.y+(cW.from.ch?c0:0));var c7=Math.min(c8.y,c5)-c3;if(c7>0.2*c0){dc(0,c3,0,c7)}if((!db||!cW.from.ch)&&c8.y<c5-0.5*c0){dc(0,c8.y,c9-c8.x,c0)}bg.innerHTML=c4;bc.style.display="none";bg.style.display=""}}function a4(cZ){if(cZ){ci=ci||(cW.inverted?cW.to:cW.from)}else{ci=null}}function bx(c1,c0){var cZ=ci&&aT(ci);if(cZ){if(Z(cZ,c1)){c1=cZ}else{if(Z(c0,cZ)){c0=cZ}}}bw(c1,c0);b6=true}function bw(c6,c5,cZ,c4){cv=null;if(cZ==null){cZ=cW.from.line;c4=cW.to.line}if(ad(cW.from,c6)&&ad(cW.to,c5)){return}if(Z(c5,c6)){var c2=c5;c5=c6;c6=c2}if(c6.line!=cZ){var c3=bR(c6,cZ,cW.from.ch);if(!c3){cK(c6.line,false)}else{c6=c3}}if(c5.line!=c4){c5=bR(c5,c4,cW.to.ch)}if(ad(c6,c5)){cW.inverted=false}else{if(ad(c6,cW.to)){cW.inverted=false}else{if(ad(c5,cW.from)){cW.inverted=true}}}if(b1.autoClearEmptyLines&&ad(cW.from,cW.to)){var c1=cW.inverted?c6:c5;if(c1.line!=cW.from.line&&cW.from.line<cy.size){var c0=cF(cW.from.line);if(/^\s+$/.test(c0.text)){setTimeout(ar(function(){if(c0.parent&&/^\s+$/.test(c0.text)){var c7=Y(c0);bQ("",{line:c7,ch:0},{line:c7,ch:c0.text.length})}},10))}}}cW.from=c6;cW.to=c5;aP=true}function bR(c4,c0,c1){function c3(c7){var c9=c4.line+c7,c6=c7==1?cy.size:-1;while(c9!=c6){var c5=cF(c9);if(!c5.hidden){var c8=c4.ch;if(c2||c8>c1||c8>c5.text.length){c8=c5.text.length}return{line:c9,ch:c8}}c9+=c7}}var cZ=cF(c4.line);var c2=c4.ch==cZ.text.length&&c4.ch!=c1;if(!cZ.hidden){return c4}if(c4.line>=c0){return c3(1)||c3(-1)}else{return c3(-1)||c3(1)}}function a6(cZ,c1,c0){var c2=aT({line:cZ,ch:c1||0});(c0?bx:bw)(c2,c2)}function bZ(cZ){return Math.max(0,Math.min(cZ,cy.size-1))}function aT(c1){if(c1.line<0){return{line:0,ch:0}}if(c1.line>=cy.size){return{line:cy.size-1,ch:cF(cy.size-1).text.length}}var cZ=c1.ch,c0=cF(c1.line).text.length;if(cZ==null||cZ>c0){return{line:c1.line,ch:c0}}else{if(cZ<0){return{line:c1.line,ch:0}}else{return c1}}}function co(c2,c6){var c3=cW.inverted?cW.from:cW.to,c7=c3.line,cZ=c3.ch;var c5=cF(c7);function c0(){for(var c8=c7+c2,da=c2<0?-1:cy.size;c8!=da;c8+=c2){var c9=cF(c8);if(!c9.hidden){c7=c8;c5=c9;return true}}}function c4(c8){if(cZ==(c2<0?0:c5.text.length)){if(!c8&&c0()){cZ=c2<0?c5.text.length:0}else{return false}}else{cZ+=c2}return true}if(c6=="char"){c4()}else{if(c6=="column"){c4(true)}else{if(c6=="word"){var c1=false;for(;;){if(c2<0){if(!c4()){break}}if(ag(c5.text.charAt(cZ))){c1=true}else{if(c1){if(c2<0){c2=1;c4()}break}}if(c2>0){if(!c4()){break}}}}}}return{line:c7,ch:cZ}}function cE(cZ,c0){var c1=cZ<0?cW.from:cW.to;if(ci||ad(cW.from,cW.to)){c1=co(cZ,c0)}a6(c1.line,c1.ch,true)}function cm(cZ,c0){if(!ad(cW.from,cW.to)){bQ("",cW.from,cW.to)}else{if(cZ<0){bQ("",co(cZ,c0),cW.to)}else{bQ("",cW.from,co(cZ,c0))}}b6=true}var cv=null;function cx(cZ,c0){var c2=0,c3=cR(cW.inverted?cW.from:cW.to,true);if(cv!=null){c3.x=cv}if(c0=="page"){c2=Math.min(bk.clientHeight,window.innerHeight||document.documentElement.clientHeight)}else{if(c0=="line"){c2=bP()}}var c1=bH(c3.x,c3.y+c2*cZ+2);if(c0=="page"){bk.scrollTop+=cR(c1,true).y-c3.y}a6(c1.line,c1.ch,true);cv=c3.x}function bI(c2){var c0=cF(c2.line).text;var c1=c2.ch,cZ=c2.ch;while(c1>0&&ag(c0.charAt(c1-1))){--c1}while(cZ<c0.length&&ag(c0.charAt(cZ))){++cZ}bx({line:c2.line,ch:c1},{line:c2.line,ch:cZ})}function aK(cZ){bx({line:cZ,ch:0},aT({line:cZ+1,ch:0}))}function cB(c1){if(ad(cW.from,cW.to)){return by(cW.from.line,c1)}var c0=cW.to.line-(cW.to.ch?0:1);for(var cZ=cW.from.line;cZ<=c0;++cZ){by(cZ,c1)}}function by(c1,c8){if(!c8){c8="add"}if(c8=="smart"){if(!cb.indent){c8="prev"}else{var cZ=cu(c1)}}var c9=cF(c1),c3=c9.indentation(b1.tabSize),c0=c9.text.match(/^\s*/)[0],c5;if(c8=="prev"){if(c1){c5=cF(c1-1).indentation(b1.tabSize)}else{c5=0}}else{if(c8=="smart"){c5=cb.indent(cZ,c9.text.slice(c0.length),c9.text)}else{if(c8=="add"){c5=c3+b1.indentUnit}else{if(c8=="subtract"){c5=c3-b1.indentUnit}}}}c5=Math.max(0,c5);var c7=c5-c3;if(!c7){if(cW.from.line!=c1&&cW.to.line!=c1){return}var c6=c0}else{var c6="",c4=0;if(b1.indentWithTabs){for(var c2=Math.floor(c5/b1.tabSize);c2;--c2){c4+=b1.tabSize;c6+="\t"}}while(c4<c5){++c4;c6+=" "}}bQ(c6,{line:c1,ch:0},{line:c1,ch:c0.length})}function bT(){cb=u.getMode(b1,b1.mode);cy.iter(0,cy.size,function(cZ){cZ.stateAfter=null});ch=[0];bG()}function be(){var cZ=b1.gutter||b1.lineNumbers;aH.style.display=cZ?"":"none";if(cZ){aS=true}else{aq.parentNode.style.marginLeft=0}}function cG(c1,c0){if(b1.lineWrapping){aD.className+=" CodeMirror-wrap";var cZ=bk.clientWidth/bh()-3;cy.iter(0,cy.size,function(c2){if(c2.hidden){return}var c3=Math.ceil(c2.text.length/cZ)||1;if(c3!=1){a3(c2,c3)}});bu.style.width=bM.style.width=""}else{aD.className=aD.className.replace(" CodeMirror-wrap","");aF=null;bD="";cy.iter(0,cy.size,function(c2){if(c2.height!=1&&!c2.hidden){a3(c2,1)}if(c2.text.length>bD.length){bD=c2.text}})}aB.push({from:0,to:cy.size})}function a9(c0){var cZ=b1.tabSize-c0%b1.tabSize,c2=ap[cZ];if(c2){return c2}for(var c3='<span class="cm-tab">',c1=0;c1<cZ;++c1){c3+=" "}return(ap[cZ]={html:c3+"</span>",width:cZ})}function cD(){bk.className=bk.className.replace(/\s*cm-s-\S+/g,"")+b1.theme.replace(/(^|\s)\s*/g," cm-s-")}function cX(){this.set=[]}cX.prototype.clear=ar(function(){var c4=Infinity,c0=-Infinity;for(var c3=0,c6=this.set.length;c3<c6;++c3){var c1=this.set[c3],cZ=c1.marked;if(!cZ||!c1.parent){continue}var c5=Y(c1);c4=Math.min(c4,c5);c0=Math.max(c0,c5);for(var c2=0;c2<cZ.length;++c2){if(cZ[c2].marker==this){cZ.splice(c2--,1)}}}if(c4!=Infinity){aB.push({from:c4,to:c0+1})}});cX.prototype.find=function(){var c4,c5;for(var c1=0,c3=this.set.length;c1<c3;++c1){var c7=this.set[c1],c2=c7.marked;for(var c0=0;c0<c2.length;++c0){var cZ=c2[c0];if(cZ.marker==this){if(cZ.from!=null||cZ.to!=null){var c6=Y(c7);if(c6!=null){if(cZ.from!=null){c4={line:c6,ch:cZ.from}}if(cZ.to!=null){c5={line:c6,ch:cZ.to}}}}}}}return{from:c4,to:c5}};function bE(c5,c4,c1){c5=aT(c5);c4=aT(c4);var cZ=new cX();if(!Z(c5,c4)){return cZ}function c3(c6,c9,c8,c7){cF(c6).addMark(new K(c9,c8,c7,cZ))}if(c5.line==c4.line){c3(c5.line,c5.ch,c4.ch,c1)}else{c3(c5.line,c5.ch,null,c1);for(var c0=c5.line+1,c2=c4.line;c0<c2;++c0){c3(c0,null,null,c1)}c3(c4.line,null,c4.ch,c1)}aB.push({from:c5.line,to:c4.line+1});return cZ}function aU(c0){c0=aT(c0);var cZ=new G(c0.ch);cF(c0.line).addMark(cZ);return cZ}function bo(c4){c4=aT(c4);var c3=[],c1=cF(c4.line).marked;if(!c1){return c3}for(var c0=0,c2=c1.length;c0<c2;++c0){var cZ=c1[c0];if((cZ.from==null||cZ.from<=c4.ch)&&(cZ.to==null||cZ.to>=c4.ch)){c3.push(cZ.marker||cZ)}}return c3}function bV(cZ,c1,c0){if(typeof cZ=="number"){cZ=cF(bZ(cZ))}cZ.gutterMarker={text:c1,style:c0};aS=true;return cZ}function au(cZ){if(typeof cZ=="number"){cZ=cF(bZ(cZ))}cZ.gutterMarker=null;aS=true}function aX(c0,c2){var c1=c0,cZ=c0;if(typeof c0=="number"){cZ=cF(bZ(c0))}else{c1=Y(c0)}if(c1==null){return null}if(c2(cZ,c1)){aB.push({from:c1,to:c1+1})}else{return null}return cZ}function bl(c0,cZ,c1){return aX(c0,function(c2){if(c2.className!=cZ||c2.bgClassName!=c1){c2.className=cZ;c2.bgClassName=c1;return true}})}function cK(c0,cZ){return aX(c0,function(c1,c4){if(c1.hidden!=cZ){c1.hidden=cZ;a3(c1,cZ?0:1);var c3=cW.from.line,c2=cW.to.line;if(cZ&&(c3==c4||c2==c4)){var c6=c3==c4?bR({line:c3,ch:0},c3,0):cW.from;var c5=c2==c4?bR({line:c2,ch:0},c2,0):cW.to;if(!c5){return}bw(c6,c5)}return(aS=true)}})}function aV(c0){if(typeof c0=="number"){if(!br(c0)){return null}var c1=c0;c0=cF(c0);if(!c0){return null}}else{var c1=Y(c0);if(c1==null){return null}}var cZ=c0.gutterMarker;return{line:c1,handle:c0,text:c0.text,markerText:cZ&&cZ.text,markerClass:cZ&&cZ.style,lineClass:c0.className,bgClass:c0.bgClassName}}function ct(cZ){av.innerHTML="<pre><span>x</span></pre>";av.firstChild.firstChild.firstChild.nodeValue=cZ;return av.firstChild.firstChild.offsetWidth||10}function aG(db,c5){if(c5<=0){return 0}var c2=cF(db),c8=c2.text;function c9(dc){return b5(c2,dc).left}var c6=0,c4=0,c7=c8.length,c3;var c0=Math.min(c7,Math.ceil(c5/bh()));for(;;){var c1=c9(c0);if(c1<=c5&&c0<c7){c0=Math.min(c7,Math.ceil(c0*1.2))}else{c3=c1;c7=c0;break}}if(c5>c3){return c7}c0=Math.floor(c7*0.8);c1=c9(c0);if(c1<c5){c6=c0;c4=c1}for(;;){if(c7-c6<=1){return(c3-c5>c5-c4)?c6:c7}var da=Math.ceil((c6+c7)/2),cZ=c9(da);if(cZ>c5){c7=da;c3=cZ}else{c6=da;c4=cZ}}}var cz="CodeMirror-temp-"+Math.floor(Math.random()*16777215).toString(16);function b5(c0,c3){if(c3==0){return{top:0,left:0}}var cZ=b1.lineWrapping&&c3<c0.text.length&&o.test(c0.text.slice(c3-1,c3+1));av.innerHTML="<pre>"+c0.getHTML(a9,c3,cz,cZ)+"</pre>";var c2=document.getElementById(cz);var c5=c2.offsetTop,c4=c2.offsetLeft;if(I&&c5==0&&c4==0){var c1=document.createElement("span");c1.innerHTML="x";c2.parentNode.insertBefore(c1,c2.nextSibling);c5=c1.offsetTop}return{top:c5,left:c4}}function cR(c4,c2){var cZ,c0=bP(),c3=c0*(g(cy,c4.line)-(c2?bd:0));if(c4.ch==0){cZ=0}else{var c1=b5(cF(c4.line),c4.ch);cZ=c1.left;if(b1.lineWrapping){c3+=Math.max(0,c1.top)}}return{x:cZ,y:c3,yBot:c3+c0}}function bH(c8,c7){if(c7<0){c7=0}var c5=bP(),c3=bh(),de=bd+Math.floor(c7/c5);var c9=X(cy,de);if(c9>=cy.size){return{line:cy.size-1,ch:cF(cy.size-1).text.length}}var c0=cF(c9),db=c0.text;var dg=b1.lineWrapping,c6=dg?de-g(cy,c9):0;if(c8<=0&&c6==0){return{line:c9,ch:0}}function df(di){var dj=b5(c0,di);if(dg){var dk=Math.round(dj.top/c5);return Math.max(0,dj.left+(dk-c6)*bk.clientWidth)}return dj.left}var dd=0,dc=0,c1=db.length,cZ;var da=Math.min(c1,Math.ceil((c8+c6*bk.clientWidth*0.9)/c3));for(;;){var c4=df(da);if(c4<=c8&&da<c1){da=Math.min(c1,Math.ceil(da*1.2))}else{cZ=c4;c1=da;break}}if(c8>cZ){return{line:c9,ch:c1}}da=Math.floor(c1*0.8);c4=df(da);if(c4<c8){dd=da;dc=c4}for(;;){if(c1-dd<=1){return{line:c9,ch:(cZ-c8>c8-dc)?dd:c1}}var dh=Math.ceil((dd+c1)/2),c2=df(dh);if(c2>c8){c1=dh;cZ=c2}else{dd=dh;dc=c2}}}function ao(c1){var cZ=cR(c1,true),c0=ak(bu);return{x:c0.left+cZ.x,y:c0.top+cZ.y,yBot:c0.top+cZ.yBot}}var a0,ax,bU;function bP(){if(bU==null){bU="<pre>";for(var c0=0;c0<49;++c0){bU+="x<br/>"}bU+="x</pre>"}var cZ=aq.clientHeight;if(cZ==ax){return a0}ax=cZ;av.innerHTML=bU;a0=av.firstChild.offsetHeight/50||1;av.innerHTML="";return a0}var cS,bv=0;function bh(){if(bk.clientWidth==bv){return cS}bv=bk.clientWidth;return(cS=ct("x"))}function cr(){return bu.offsetTop}function a5(){return bu.offsetLeft}function a2(c3,c2){var c1=ak(bk,true),cZ,c4;try{cZ=c3.clientX;c4=c3.clientY}catch(c3){return null}if(!c2&&(cZ-c1.left>bk.clientWidth||c4-c1.top>bk.clientHeight)){return null}var c0=ak(bu,true);return bH(cZ-c0.left,c4-c0.top)}function a1(c0){var c5=a2(c0),c4=bk.scrollTop;if(!c5||window.opera){return}if(ad(cW.from,cW.to)||Z(c5,cW.from)||!Z(c5,cW.to)){ar(a6)(c5.line,c5.ch)}var c3=bm.style.cssText;bX.style.position="absolute";bm.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(c0.clientY-5)+"px; left: "+(c0.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";bf=true;var c2=bm.value=b3();bz();a(bm);function cZ(){var c6=A(bm.value).join("\n");if(c6!=c2){ar(bs)(c6,"end")}bX.style.position="relative";bm.style.cssText=c3;if(B){bk.scrollTop=c4}bf=false;cC(true);am()}if(N){w(c0);var c1=r(window,"mouseup",function(){c1();setTimeout(cZ,20)},true)}else{setTimeout(cZ,50)}}function cM(){clearInterval(cP);var cZ=true;bc.style.visibility="";cP=setInterval(function(){bc.style.visibility=(cZ=!cZ)?"":"hidden"},650)}var bp={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function ce(c5){var cZ=cW.inverted?cW.from:cW.to,c7=cF(cZ.line),c0=cZ.ch-1;var c4=(c0>=0&&bp[c7.text.charAt(c0)])||bp[c7.text.charAt(++c0)];if(!c4){return}var c8=c4.charAt(0),c6=c4.charAt(1)==">",di=c6?1:-1,dd=c7.styles;for(var dj=c0+1,df=0,dh=dd.length;df<dh;df+=2){if((dj-=dd[df].length)<=0){var dg=dd[df+1];break}}var c2=[c7.text.charAt(c0)],dc=/[(){}[\]]/;function da(dw,dr,ds){if(!dw.text){return}var dv=dw.styles,dq=c6?0:dw.text.length-1,dt;for(var dm=c6?0:dv.length-2,dp=c6?dv.length:-2;dm!=dp;dm+=2*di){var du=dv[dm];if(dv[dm+1]!=null&&dv[dm+1]!=dg){dq+=di*du.length;continue}for(var dl=c6?0:du.length-1,dk=c6?du.length:-1;dl!=dk;dl+=di,dq+=di){if(dq>=dr&&dq<ds&&dc.test(dt=du.charAt(dl))){var dn=bp[dt];if(dn.charAt(1)==">"==c6){c2.push(dt)}else{if(c2.pop()!=dn.charAt(0)){return{pos:dq,match:false}}else{if(!c2.length){return{pos:dq,match:true}}}}}}}}for(var df=cZ.line,dh=c6?Math.min(df+100,cy.size):Math.max(-1,df-100);df!=dh;df+=di){var c7=cF(df),c3=df==cZ.line;var c9=da(c7,c3&&c6?c0+1:0,c3&&!c6?c0:c7.text.length);if(c9){break}}if(!c9){c9={pos:null,match:false}}var dg=c9.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";var de=bE({line:cZ.line,ch:c0},{line:cZ.line,ch:c0+1},dg),c1=c9.pos!=null&&bE({line:df,ch:c9.pos},{line:df,ch:c9.pos+1},dg);var db=ar(function(){de.clear();c1&&c1.clear()});if(c5){setTimeout(db,800)}else{b4=db}}function a7(c5){var c4,c1;for(var c0=c5,c2=c5-40;c0>c2;--c0){if(c0==0){return 0}var cZ=cF(c0-1);if(cZ.stateAfter){return c0}var c3=cZ.indentation(b1.tabSize);if(c1==null||c4>c3){c1=c0-1;c4=c3}}return c1}function cu(c1){var c0=a7(c1),cZ=c0&&cF(c0-1).stateAfter;if(!cZ){cZ=V(cb)}else{cZ=p(cb,cZ)}cy.iter(c0,c1,function(c2){c2.highlight(cb,cZ,b1.tabSize);c2.stateAfter=p(cb,cZ)});if(c0<c1){aB.push({from:c0,to:c1})}if(c1<cy.size&&!cF(c1).stateAfter){ch.push(c1)}return cZ}function cH(c1,cZ){var c0=cu(c1);cy.iter(c1,cZ,function(c2){c2.highlight(cb,c0,b1.tabSize);c2.stateAfter=p(cb,c0)})}function bS(){var c5=+new Date+b1.workTime;var c8=ch.length;while(ch.length){if(!cF(cQ).stateAfter){var c2=cQ}else{var c2=ch.pop()}if(c2>=cy.size){continue}var c0=a7(c2),cZ=c0&&cF(c0-1).stateAfter;if(cZ){cZ=p(cb,cZ)}else{cZ=V(cb)}var c4=0,c1=cb.compareStates,c7=false,c6=c0,c3=false;cy.iter(c6,cy.size,function(da){var db=da.stateAfter;if(+new Date>c5){ch.push(c6);bG(b1.workDelay);if(c7){aB.push({from:c2,to:c6+1})}return(c3=true)}var dc=da.highlight(cb,cZ,b1.tabSize);if(dc){c7=true}da.stateAfter=p(cb,cZ);var c9=null;if(c1){var dd=db&&c1(db,cZ);if(dd!=ab){c9=!!dd}}if(c9==null){if(dc!==false||!db){c4=0}else{if(++c4>3&&(!cb.indent||cb.indent(db,"")==cb.indent(cZ,""))){c9=true}}}if(c9){return true}++c6});if(c3){return}if(c7){aB.push({from:c2,to:c6+1})}}if(c8&&b1.onHighlightComplete){b1.onHighlightComplete(b9)}}function bG(cZ){if(!ch.length){return}aw.set(cZ,ar(bS))}function aN(){cp=b6=cN=null;aB=[];aP=false;cA=[]}function ay(){var c3=false,c0;if(aP){c3=!cf()}if(aB.length){c0=cd(aB,true)}else{if(aP){cV()}if(aS){aL()}}if(c3){cf()}if(aP){cY();cM()}if(cj&&!bf&&(cp===true||(cp!==false&&aP))){cC(b6)}if(aP&&b1.matchBrackets){setTimeout(ar(function(){if(b4){b4();b4=null}if(ad(cW.from,cW.to)){ce(false)}}),20)}var cZ=cN,c1=cA;if(aP&&b1.onCursorActivity){b1.onCursorActivity(b9)}if(cZ&&b1.onChange&&b9){b1.onChange(b9,cZ)}for(var c2=0;c2<c1.length;++c2){c1[c2](b9)}if(c0&&b1.onUpdate){b1.onUpdate(b9)}}var cq=0;function ar(cZ){return function(){if(!cq++){aN()}try{var c0=cZ.apply(this,arguments)}finally{if(!--cq){ay()}}return c0}}function bO(cZ){a8.startCompound();try{return cZ()}finally{a8.endCompound()}}for(var bJ in ac){if(ac.propertyIsEnumerable(bJ)&&!b9.propertyIsEnumerable(bJ)){b9[bJ]=ac[bJ]}}return b9}u.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:false,smartIndent:true,tabSize:4,keyMap:"default",extraKeys:null,electricChars:true,autoClearEmptyLines:false,onKeyEvent:null,onDragEvent:null,lineWrapping:false,lineNumbers:false,gutter:false,fixedGutter:false,firstLineNumber:1,readOnly:false,dragDrop:true,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:false,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var s=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var M=s||/Mac/.test(navigator.platform);var U=/Win/.test(navigator.platform);var aj=u.modes={},S=u.mimeModes={};u.defineMode=function(am,ao){if(!u.defaults.mode&&am!="null"){u.defaults.mode=am}if(arguments.length>2){ao.dependencies=[];for(var an=2;an<arguments.length;++an){ao.dependencies.push(arguments[an])}}aj[am]=ao};u.defineMIME=function(an,am){S[an]=am};u.resolveMode=function(am){if(typeof am=="string"&&S.hasOwnProperty(am)){am=S[am]}else{if(typeof am=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(am)){return u.resolveMode("application/xml")}}if(typeof am=="string"){return{name:am}}else{return am||{name:"null"}}};u.getMode=function(an,am){var am=u.resolveMode(am);var ao=aj[am.name];if(!ao){return u.getMode(an,"text/plain")}return ao(an,am)};u.listModes=function(){var an=[];for(var am in aj){if(aj.propertyIsEnumerable(am)){an.push(am)}}return an};u.listMIMEs=function(){var an=[];for(var am in S){if(S.propertyIsEnumerable(am)){an.push({mime:am,mode:S[am]})}}return an};var ac=u.extensions={};u.defineExtension=function(am,an){ac[am]=an};var L=u.commands={selectAll:function(am){am.setSelection({line:0,ch:0},{line:am.lineCount()-1})},killLine:function(am){var ap=am.getCursor(true),ao=am.getCursor(false),an=!ad(ap,ao);if(!an&&am.getLine(ap.line).length==ap.ch){am.replaceRange("",ap,{line:ap.line+1,ch:0})}else{am.replaceRange("",ap,an?ao:{line:ap.line})}},deleteLine:function(am){var an=am.getCursor().line;am.replaceRange("",{line:an,ch:0},{line:an})},undo:function(am){am.undo()},redo:function(am){am.redo()},goDocStart:function(am){am.setCursor(0,0,true)},goDocEnd:function(am){am.setSelection({line:am.lineCount()-1},null,true)},goLineStart:function(am){am.setCursor(am.getCursor().line,0,true)},goLineStartSmart:function(am){var ap=am.getCursor();var ao=am.getLine(ap.line),an=Math.max(0,ao.search(/\S/));am.setCursor(ap.line,ap.ch<=an&&ap.ch?0:an,true)},goLineEnd:function(am){am.setSelection({line:am.getCursor().line},null,true)},goLineUp:function(am){am.moveV(-1,"line")},goLineDown:function(am){am.moveV(1,"line")},goPageUp:function(am){am.moveV(-1,"page")},goPageDown:function(am){am.moveV(1,"page")},goCharLeft:function(am){am.moveH(-1,"char")},goCharRight:function(am){am.moveH(1,"char")},goColumnLeft:function(am){am.moveH(-1,"column")},goColumnRight:function(am){am.moveH(1,"column")},goWordLeft:function(am){am.moveH(-1,"word")},goWordRight:function(am){am.moveH(1,"word")},delCharLeft:function(am){am.deleteH(-1,"char")},delCharRight:function(am){am.deleteH(1,"char")},delWordLeft:function(am){am.deleteH(-1,"word")},delWordRight:function(am){am.deleteH(1,"word")},indentAuto:function(am){am.indentSelection("smart")},indentMore:function(am){am.indentSelection("add")},indentLess:function(am){am.indentSelection("subtract")},insertTab:function(am){am.replaceSelection("\t","end")},transposeChars:function(am){var ao=am.getCursor(),an=am.getLine(ao.line);if(ao.ch>0&&ao.ch<an.length-1){am.replaceRange(an.charAt(ao.ch)+an.charAt(ao.ch-1),{line:ao.line,ch:ao.ch-1},{line:ao.line,ch:ao.ch+1})}},newlineAndIndent:function(am){am.replaceSelection("\n","end");am.indentLine(am.getCursor().line)},toggleOverwrite:function(am){am.toggleOverwrite()}};var v=u.keyMap={};v.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"insertTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};v.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};v.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]};v["default"]=M?v.macDefault:v.pcDefault;v.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};function c(am){if(typeof am=="string"){return v[am]}else{return am}}function l(an,am,ar,ap,ao){function aq(ax){ax=c(ax);var av=ax[an];if(av!=null&&ap(av)){return true}if(ax.nofallthrough){if(ao){ao()}return true}var au=ax.fallthrough;if(au==null){return false}if(Object.prototype.toString.call(au)!="[object Array]"){return aq(au)}for(var at=0,aw=au.length;at<aw;++at){if(aq(au[at])){return true}}return false}if(am&&aq(am)){return true}return aq(ar)}function Q(an){var am=R[y(an,"keyCode")];return am=="Ctrl"||am=="Alt"||am=="Shift"||am=="Mod"}u.fromTextArea=function(an,ap){if(!ap){ap={}}ap.value=an.value;if(!ap.tabindex&&an.tabindex){ap.tabindex=an.tabindex}if(ap.autofocus==null&&an.getAttribute("autofocus")!=null){ap.autofocus=true}function ar(){an.value=am.getValue()}if(an.form){var aq=r(an.form,"submit",ar,true);if(typeof an.form.submit=="function"){var ao=an.form.submit;function at(){ar();an.form.submit=ao;an.form.submit();an.form.submit=at}an.form.submit=at}}an.style.display="none";var am=u(function(au){an.parentNode.insertBefore(au,an.nextSibling)},ap);am.save=ar;am.getTextArea=function(){return an};am.toTextArea=function(){ar();an.parentNode.removeChild(am.getWrapperElement());an.style.display="";if(an.form){aq();if(typeof an.form.submit=="function"){an.form.submit=ao}}};return am};function p(ap,am){if(am===true){return am}if(ap.copyState){return ap.copyState(am)}var ao={};for(var aq in am){var an=am[aq];if(an instanceof Array){an=an.concat([])}ao[aq]=an}return ao}u.copyState=p;function V(ao,an,am){return ao.startState?ao.startState(an,am):true}u.startState=V;function b(am,an){this.pos=this.start=0;this.string=am;this.tabSize=an||8}b.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}},eat:function(am){var ao=this.string.charAt(this.pos);if(typeof am=="string"){var an=ao==am}else{var an=ao&&(am.test?am.test(ao):am(ao))}if(an){++this.pos;return ao}},eatWhile:function(am){var an=this.pos;while(this.eat(am)){}return this.pos>an},eatSpace:function(){var am=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>am},skipToEnd:function(){this.pos=this.string.length},skipTo:function(am){var an=this.string.indexOf(am,this.pos);if(an>-1){this.pos=an;return true}},backUp:function(am){this.pos-=am},column:function(){return n(this.string,this.start,this.tabSize)},indentation:function(){return n(this.string,null,this.tabSize)},match:function(ap,an,am){if(typeof ap=="string"){function aq(ar){return am?ar.toLowerCase():ar}if(aq(this.string).indexOf(aq(ap),this.pos)==this.pos){if(an!==false){this.pos+=ap.length}return true}}else{var ao=this.string.slice(this.pos).match(ap);if(ao&&an!==false){this.pos+=ao[0].length}return ao}},current:function(){return this.string.slice(this.start,this.pos)}};u.StringStream=b;function K(ap,ao,an,am){this.from=ap;this.to=ao;this.style=an;this.marker=am}K.prototype={attach:function(am){this.marker.set.push(am)},detach:function(an){var am=q(this.marker.set,an);if(am>-1){this.marker.set.splice(am,1)}},split:function(ap,am){if(this.to<=ap&&this.to!=null){return null}var ao=this.from<ap||this.from==null?null:this.from-ap+am;var an=this.to==null?null:this.to-ap+am;return new K(ao,an,this.style,this.marker)},dup:function(){return new K(null,null,this.style,this.marker)},clipTo:function(an,aq,am,ap,ao){if(an&&ap>this.from&&(ap<this.to||this.to==null)){this.from=null}else{if(this.from!=null&&this.from>=aq){this.from=Math.max(ap,this.from)+ao}}if(am&&(aq<this.to||this.to==null)&&(aq>this.from||this.from==null)){this.to=null}else{if(this.to!=null&&this.to>aq){this.to=ap<this.to?this.to+ao:aq}}},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(am){return this.marker==am.marker}};function G(am){this.from=am;this.to=am;this.line=null}G.prototype={attach:function(am){this.line=am},detach:function(am){if(this.line==am){this.line=null}},split:function(an,am){if(an<this.from){this.from=this.to=(this.from-an)+am;return this}},isDead:function(){return this.from>this.to},clipTo:function(an,aq,am,ap,ao){if((an||aq<this.from)&&(am||ap>this.to)){this.from=0;this.to=-1}else{if(this.from>aq){this.from=this.to=Math.max(ap,this.from)+ao}}},sameSet:function(am){return false},find:function(){if(!this.line||!this.line.parent){return null}return{line:Y(this.line),ch:this.from}},clear:function(){if(this.line){var am=q(this.line.marked,this);if(am!=-1){this.line.marked.splice(am,1)}this.line=null}}};function e(an,am){this.styles=am||[an,null];this.text=an;this.height=1;this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null;this.stateAfter=this.parent=this.hidden=null}e.inheritMarks=function(aq,au){var ap=new e(aq),am=au&&au.marked;if(am){for(var ao=0;ao<am.length;++ao){if(am[ao].to==null&&am[ao].style){var an=ap.marked||(ap.marked=[]),at=am[ao];var ar=at.dup();an.push(ar);ar.attach(ap)}}}return ap};e.prototype={replace:function(aq,ap,au){var av=[],ao=this.marked,ar=ap==null?this.text.length:ap;al(0,aq,this.styles,av);if(au){av.push(au,null)}al(ar,this.text.length,this.styles,av);this.styles=av;this.text=this.text.slice(0,aq)+au+this.text.slice(ar);this.stateAfter=null;if(ao){var at=au.length-(ar-aq);for(var an=0;an<ao.length;++an){var am=ao[an];am.clipTo(aq==null,aq||0,ap==null,ar,at);if(am.isDead()){am.detach(this);ao.splice(an--,1)}}}},split:function(au,ar){var ap=[ar,null],an=this.marked;al(au,this.text.length,this.styles,ap);var ao=new e(ar+this.text.slice(au),ap);if(an){for(var aq=0;aq<an.length;++aq){var at=an[aq];var am=at.split(au,ar.length);if(am){if(!ao.marked){ao.marked=[]}ao.marked.push(am);am.attach(ao);if(am==at){an.splice(aq--,1)}}}}return ao},append:function(an){var at=this.text.length,am=an.marked,aq=this.marked;this.text+=an.text;al(0,an.text.length,an.styles,this.styles);if(aq){for(var ar=0;ar<aq.length;++ar){if(aq[ar].to==null){aq[ar].to=at}}}if(am&&am.length){if(!aq){this.marked=aq=[]}outer:for(var ar=0;ar<am.length;++ar){var au=am[ar];if(!au.from){for(var ap=0;ap<aq.length;++ap){var ao=aq[ap];if(ao.to==at&&ao.sameSet(au)){ao.to=au.to==null?null:au.to+at;if(ao.isDead()){ao.detach(this);am.splice(ar--,1)}continue outer}}}aq.push(au);au.attach(this);au.from+=at;if(au.to!=null){au.to+=at}}}},fixMarkEnds:function(an){var am=this.marked,aq=an.marked;if(!am){return}for(var ap=0;ap<am.length;++ap){var at=am[ap],ar=at.to==null;if(ar&&aq){for(var ao=0;ao<aq.length;++ao){if(aq[ao].sameSet(at)){ar=false;break}}}if(ar){at.to=this.text.length}}},fixMarkStarts:function(){var am=this.marked;if(!am){return}for(var an=0;an<am.length;++an){if(am[an].from==null){am[an].from=0}}},addMark:function(am){am.attach(this);if(this.marked==null){this.marked=[]}this.marked.push(am);this.marked.sort(function(ao,an){return(ao.from||0)-(an.from||0)})},highlight:function(ar,an,at){var aw=new b(this.text,at),ax=this.styles,au=0;var aq=false,ao=ax[0],av;if(this.text==""&&ar.blankLine){ar.blankLine(an)}while(!aw.eol()){var am=ar.token(aw,an);var ap=this.text.slice(aw.start,aw.pos);aw.start=aw.pos;if(au&&ax[au-1]==am){ax[au-2]+=ap}else{if(ap){if(!aq&&(ax[au+1]!=am||(au&&ax[au-2]!=av))){aq=true}ax[au++]=ap;ax[au++]=am;av=ao;ao=ax[au]}}if(aw.pos>5000){ax[au++]=this.text.slice(aw.pos);ax[au++]=null;break}}if(ax.length!=au){ax.length=au;aq=true}if(au&&ax[au-2]!=av){aq=true}return aq||(ax.length<5&&this.text.length<10?null:false)},getTokenAt:function(ar,ap,ao){var am=this.text,aq=new b(am);while(aq.pos<ao&&!aq.eol()){aq.start=aq.pos;var an=ar.token(aq,ap)}return{start:aq.start,end:aq.pos,string:aq.current(),className:an||null,state:ap}},indentation:function(am){return n(this.text,null,am)},getHTML:function(aM,am,ao,aq){var ax=[],av=true,at=0;function aI(aY,aW){if(!aY){return}if(av&&I&&aY.charAt(0)==" "){aY="\u00a0"+aY.slice(1)}av=false;if(aY.indexOf("\t")==-1){at+=aY.length;var aX=P(aY)}else{var aX="";for(var aZ=0;;){var aU=aY.indexOf("\t",aZ);if(aU==-1){aX+=P(aY.slice(aZ));at+=aY.length-aZ;break}else{at+=aU-aZ;var aV=aM(at);aX+=P(aY.slice(aZ,aU))+aV.html;at+=aV.width;aZ=aU+1}}}if(aW){ax.push('<span class="',aW,'">',aX,"</span>")}else{ax.push(aX)}}var aL=aI;if(am!=null){var aG=0,aB='<span id="'+ao+'">';aL=function(aW,aV){var aU=aW.length;if(am>=aG&&am<aG+aU){if(am>aG){aI(aW.slice(0,am-aG),aV);if(aq){ax.push("<wbr>")}}ax.push(aB);aI(aW.slice(am-aG),aV);ax.push("</span>");am--;aG+=aU}else{aG+=aU;aI(aW,aV);if(aG==am&&aG==aQ){ax.push(aB+"</span>")}else{if(aG>am+10&&/\s/.test(aW)){aL=function(){}}}}}}var aF=this.styles,aw=this.text,aC=this.marked;var aQ=aw.length;function ar(aU){if(!aU){return null}return"cm-"+aU.replace(/ +/g," cm-")}if(!aw&&am==null){aL(" ")}else{if(!aC||!aC.length){for(var aN=0,ay=0;ay<aQ;aN+=2){var aE=aF[aN],aP=aF[aN+1],aH=aE.length;if(ay+aH>aQ){aE=aE.slice(0,aQ-ay)}ay+=aH;aL(aE,ar(aP))}}else{var au=0,aN=0,aA="",aP,aT=0;var aS=aC[0].from||0,aK=[],aR=0;function aO(){var aU;while(aR<aC.length&&((aU=aC[aR]).from==au||aU.from==null)){if(aU.style!=null){aK.push(aU)}++aR}aS=aR<aC.length?aC[aR].from:Infinity;for(var aV=0;aV<aK.length;++aV){var aW=aK[aV].to||Infinity;if(aW==au){aK.splice(aV--,1)}else{aS=Math.min(aW,aS)}}}var aD=0;while(au<aQ){if(aS==au){aO()}var az=Math.min(aQ,aS);while(true){if(aA){var ap=au+aA.length;var an=aP;for(var aJ=0;aJ<aK.length;++aJ){an=(an?an+" ":"")+aK[aJ].style}aL(ap>az?aA.slice(0,az-au):aA,an);if(ap>=az){aA=aA.slice(az-au);au=az;break}au=ap}aA=aF[aN++];aP=ar(aF[aN++])}}}}return ax.join("")},cleanUp:function(){this.parent=null;if(this.marked){for(var am=0,an=this.marked.length;am<an;++am){this.marked[am].detach(this)}}}};function al(at,au,am,av){for(var aq=0,ar=0,an=0;ar<au;aq+=2){var ao=am[aq],ap=ar+ao.length;if(an==0){if(ap>at){av.push(ao.slice(at-ar,Math.min(ao.length,au-ar)),am[aq+1])}if(ap>=at){an=1}}else{if(an==1){if(ap>au){av.push(ao.slice(0,au-ar),am[aq+1])}else{av.push(ao,am[aq+1])}}}ar=ap}}function ah(an){this.lines=an;this.parent=null;for(var ao=0,ap=an.length,am=0;ao<ap;++ao){an[ao].parent=this;am+=an[ao].height}this.height=am}ah.prototype={chunkSize:function(){return this.lines.length},remove:function(am,au,aq){for(var ap=am,ar=am+au;ap<ar;++ap){var an=this.lines[ap];this.height-=an.height;an.cleanUp();if(an.handlers){for(var ao=0;ao<an.handlers.length;++ao){aq.push(an.handlers[ao])}}}this.lines.splice(am,au)},collapse:function(am){am.splice.apply(am,[am.length,0].concat(this.lines))},insertHeight:function(an,ao,am){this.height+=am;if(I){this.lines=this.lines.slice(0,an).concat(ao).concat(this.lines.slice(an))}else{this.lines.splice.apply(this.lines,[an,0].concat(ao))}for(var ap=0,aq=ao.length;ap<aq;++ap){ao[ap].parent=this}},iterN:function(am,ap,ao){for(var an=am+ap;am<an;++am){if(ao(this.lines[am])){return true}}}};function i(ap){this.children=ap;var ao=0,am=0;for(var an=0,ar=ap.length;an<ar;++an){var aq=ap[an];ao+=aq.chunkSize();am+=aq.height;aq.parent=this}this.size=ao;this.height=am;this.parent=null}i.prototype={chunkSize:function(){return this.size},remove:function(ao,an,ar){this.size-=an;for(var ap=0;ap<this.children.length;++ap){var am=this.children[ap],au=am.chunkSize();if(ao<au){var aq=Math.min(an,au-ao),av=am.height;am.remove(ao,aq,ar);this.height-=av-am.height;if(au==aq){this.children.splice(ap--,1);am.parent=null}if((an-=aq)==0){break}ao=0}else{ao-=au}}if(this.size-an<25){var aw=[];this.collapse(aw);this.children=[new ah(aw)];this.children[0].parent=this}},collapse:function(am){for(var an=0,ao=this.children.length;an<ao;++an){this.children[an].collapse(am)}},insert:function(an,ao){var am=0;for(var ap=0,aq=ao.length;ap<aq;++ap){am+=ao[ap].height}this.insertHeight(an,ao,am)},insertHeight:function(an,aw,av){this.size+=aw.length;this.height+=av;for(var ao=0,aq=this.children.length;ao<aq;++ao){var am=this.children[ao],ar=am.chunkSize();if(an<=ar){am.insertHeight(an,aw,av);if(am.lines&&am.lines.length>50){while(am.lines.length>50){var ap=am.lines.splice(am.lines.length-25,25);var au=new ah(ap);am.height-=au.height;this.children.splice(ao+1,0,au);au.parent=this}this.maybeSpill()}break}an-=ar}},maybeSpill:function(){if(this.children.length<=10){return}var ap=this;do{var an=ap.children.splice(ap.children.length-5,5);var ao=new i(an);if(!ap.parent){var aq=new i(ap.children);aq.parent=ap;ap.children=[aq,ao];ap=aq}else{ap.size-=ao.size;ap.height-=ao.height;var am=q(ap.parent.children,ap);ap.parent.children.splice(am+1,0,ao)}ao.parent=ap.parent}while(ap.children.length>10);ap.parent.maybeSpill()},iter:function(ao,an,am){this.iterN(ao,an-ao,am)},iterN:function(am,av,au){for(var an=0,aq=this.children.length;an<aq;++an){var ar=this.children[an],ap=ar.chunkSize();if(am<ap){var ao=Math.min(av,ap-am);if(ar.iterN(am,ao,au)){return true}if((av-=ao)==0){break}am=0}else{am-=ap}}}};function C(am,aq){while(!am.lines){for(var an=0;;++an){var ap=am.children[an],ao=ap.chunkSize();if(aq<ao){am=ap;break}aq-=ao}}return am.lines[aq]}function Y(am){if(am.parent==null){return null}var ar=am.parent,aq=q(ar.lines,am);for(var an=ar.parent;an;ar=an,an=an.parent){for(var ao=0,ap=an.children.length;;++ao){if(an.children[ao]==ar){break}aq+=an.children[ao].chunkSize()}}return aq}function X(at,aq){var ao=0;outer:do{for(var ap=0,ar=at.children.length;ap<ar;++ap){var an=at.children[ap],am=an.height;if(aq<am){at=an;continue outer}aq-=am;ao+=an.chunkSize()}return ao}while(!at.lines);for(var ap=0,ar=at.lines.length;ap<ar;++ap){var av=at.lines[ap],au=av.height;if(aq<au){break}aq-=au}return ao+ap}function g(am,at){var ao=0;outer:do{for(var an=0,aq=am.children.length;an<aq;++an){var ar=am.children[an],ap=ar.chunkSize();if(at<ap){am=ar;continue outer}at-=ap;ao+=ar.height}return ao}while(!am.lines);for(var an=0;an<at;++an){ao+=am.lines[an].height}return ao}function k(){this.time=0;this.done=[];this.undone=[];this.compound=0;this.closed=false}k.prototype={addChange:function(am,ar,an){this.undone.length=0;var ao=+new Date,au=this.done[this.done.length-1],av=au&&au[au.length-1];var aq=ao-this.time;if(this.compound&&au&&!this.closed){au.push({start:am,added:ar,old:an})}else{if(aq>400||!av||this.closed||av.start>am+an.length||av.start+av.added<am){this.done.push([{start:am,added:ar,old:an}]);this.closed=false}else{var at=Math.max(0,av.start-am),aw=Math.max(0,(am+an.length)-(av.start+av.added));for(var ap=at;ap>0;--ap){av.old.unshift(an[ap-1])}for(var ap=aw;ap>0;--ap){av.old.push(an[an.length-ap])}if(at){av.start=am}av.added+=ar-(an.length-at-aw)}}this.time=ao},startCompound:function(){if(!this.compound++){this.closed=true}},endCompound:function(){if(!--this.compound){this.closed=true}}};function J(){w(this)}function O(am){if(!am.stop){am.stop=J}return am}function T(am){if(am.preventDefault){am.preventDefault()}else{am.returnValue=false}}function D(am){if(am.stopPropagation){am.stopPropagation()}else{am.cancelBubble=true}}function w(am){T(am);D(am)}u.e_stop=w;u.e_preventDefault=T;u.e_stopPropagation=D;function j(am){return am.target||am.srcElement}function x(am){if(am.which){return am.which}else{if(am.button&1){return 1}else{if(am.button&2){return 3}else{if(am.button&4){return 2}}}}}function y(an,ao){var am=an.override&&an.override.hasOwnProperty(ao);return am?an.override[ao]:an[ao]}function r(ap,ao,an,am){if(typeof ap.addEventListener=="function"){ap.addEventListener(ao,an,false);if(am){return function(){ap.removeEventListener(ao,an,false)}}}else{var aq=function(ar){an(ar||window.event)};ap.attachEvent("on"+ao,aq);if(am){return function(){ap.detachEvent("on"+ao,aq)}}}}u.connect=r;function z(){this.id=null}z.prototype={set:function(am,an){clearTimeout(this.id);this.id=setTimeout(an,am)}};var ab=u.Pass={toString:function(){return"CodeMirror.Pass"}};var N=/gecko\/\d{7}/i.test(navigator.userAgent);var I=/MSIE \d/.test(navigator.userAgent);var B=/MSIE [1-8]\b/.test(navigator.userAgent);var E=I&&document.documentMode==5;var f=/WebKit\//.test(navigator.userAgent);var af=/Chrome\//.test(navigator.userAgent);var h=/Apple Computer/.test(navigator.vendor);var m=/KHTML\//.test(navigator.userAgent);var F=function(){if(B){return false}var am=document.createElement("div");return"draggable" in am||"dragDrop" in am}();var d=function(){var am=document.createElement("textarea");am.value="foo\nbar";if(am.value.indexOf("\r")>-1){return"\r\n"}return"\n"}();var o=/^$/;if(N){o=/$'/}else{if(h){o=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/}else{if(af){o=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/}}}function n(an,am,ap){if(am==null){am=an.search(/[^\s\u00a0]/);if(am==-1){am=an.length}}for(var ao=0,aq=0;ao<am;++ao){if(an.charAt(ao)=="\t"){aq+=ap-(aq%ap)}else{++aq}}return aq}function t(am){if(am.currentStyle){return am.currentStyle}return window.getComputedStyle(am,null)}function ak(an,aw){var ap=an.ownerDocument.body;var av=0,au=0,ar=false;for(var am=an;am;am=am.offsetParent){var at=am.offsetLeft,ao=am.offsetTop;if(am==ap){av+=Math.abs(at);au+=Math.abs(ao)}else{av+=at,au+=ao}if(aw&&t(am).position=="fixed"){ar=true}}var aq=aw&&!ar?null:ap;for(var am=an.parentNode;am!=aq;am=am.parentNode){if(am.scrollLeft!=null){av-=am.scrollLeft;au-=am.scrollTop}}return{left:av,top:au}}if(document.documentElement.getBoundingClientRect!=null){ak=function(ap,am){try{var ao=ap.getBoundingClientRect();ao={top:ao.top,left:ao.left}}catch(aq){ao={top:0,left:0}}if(!am){if(window.pageYOffset==null){var an=document.documentElement||document.body.parentNode;if(an.scrollTop==null){an=document.body}ao.top+=an.scrollTop;ao.left+=an.scrollLeft}else{ao.top+=window.pageYOffset;ao.left+=window.pageXOffset}}return ao}}function H(am){return am.textContent||am.innerText||am.nodeValue||""}function a(am){if(s){am.selectionStart=0;am.selectionEnd=am.value.length}else{am.select()}}function ad(an,am){return an.line==am.line&&an.ch==am.ch}function Z(an,am){return an.line<am.line||(an.line==am.line&&an.ch<am.ch)}function aa(am){return{line:am.line,ch:am.ch}}var ai=document.createElement("pre");function P(am){ai.textContent=am;return ai.innerHTML}if(P("a")=="\na"){P=function(am){ai.textContent=am;return ai.innerHTML.slice(1)}}else{if(P("\t")!="\t"){P=function(am){ai.innerHTML="";ai.appendChild(document.createTextNode(am));return ai.innerHTML}}}u.htmlEscape=P;function W(ap,ao){if(!ao){return 0}if(!ap){return ao.length}for(var an=ap.length,am=ao.length;an>=0&&am>=0;--an,--am){if(ap.charAt(an)!=ao.charAt(am)){break}}return am+1}function q(ap,am){if(ap.indexOf){return ap.indexOf(am)}for(var an=0,ao=ap.length;an<ao;++an){if(ap[an]==am){return an}}return -1}function ag(am){return/\w/.test(am)||am.toUpperCase()!=am.toLowerCase()}var A="\n\nb".split(/\n/).length!=3?function(ao){var ap=0,an,am=[];while((an=ao.indexOf("\n",ap))>-1){am.push(ao.slice(ap,ao.charAt(an-1)=="\r"?an-1:an));ap=an+1}am.push(ao.slice(ap));return am}:function(am){return am.split(/\r?\n/)};u.splitLines=A;var ae=window.getSelection?function(an){try{return an.selectionStart!=an.selectionEnd}catch(am){return false}}:function(ao){try{var am=ao.ownerDocument.selection.createRange()}catch(an){}if(!am||am.parentElement()!=ao){return false}return am.compareEndPoints("StartToEnd",am)!=0};u.defineMode("null",function(){return{token:function(am){am.skipToEnd()}}});u.defineMIME("text/plain","null");var R={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};u.keyNames=R;(function(){for(var am=0;am<10;am++){R[am+48]=String(am)}for(var am=65;am<=90;am++){R[am]=String.fromCharCode(am)}for(var am=1;am<=12;am++){R[am+111]=R[am+63235]="F"+am}})();return u})();CodeMirror.defineMode("javascript",function(I,M){var v=I.indentUnit;var Q=M.json;var b=function(){function W(Z){return{type:Z,style:"keyword"}}var T=W("keyword a"),Y=W("keyword b"),X=W("keyword c");var U=W("operator"),V={type:"atom",style:"atom"};return{"if":T,"while":T,"with":T,"else":Y,"do":Y,"try":Y,"finally":Y,"return":X,"break":X,"continue":X,"new":X,"delete":X,"throw":X,"var":W("var"),"const":W("var"),let:W("var"),"function":W("function"),"catch":W("catch"),"for":W("for"),"switch":W("switch"),"case":W("case"),"default":W("default"),"in":U,"typeof":U,"instanceof":U,"true":V,"false":V,"null":V,"undefined":V,"NaN":V,"Infinity":V}}();var N=/[+\-*&%=<>!?|]/;function R(V,U,T){U.tokenize=T;return T(V,U)}function h(W,T){var V=false,U;while((U=W.next())!=null){if(U==T&&!V){return false}V=!V&&U=="\\"}return V}var S,p;function B(V,U,T){S=V;p=T;return U}function l(X,V){var T=X.next();if(T=='"'||T=="'"){return R(X,V,z(T))}else{if(/[\[\]{}\(\),;\:\.]/.test(T)){return B(T)}else{if(T=="0"&&X.eat(/x/i)){X.eatWhile(/[\da-f]/i);return B("number","number")}else{if(/\d/.test(T)){X.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return B("number","number")}else{if(T=="/"){if(X.eat("*")){return R(X,V,f)}else{if(X.eat("/")){X.skipToEnd();return B("comment","comment")}else{if(V.reAllowed){h(X,"/");X.eatWhile(/[gimy]/);return B("regexp","string-2")}else{X.eatWhile(N);return B("operator",null,X.current())}}}}else{if(T=="#"){X.skipToEnd();return B("error","error")}else{if(N.test(T)){X.eatWhile(N);return B("operator",null,X.current())}else{X.eatWhile(/[\w\$_]/);var W=X.current(),U=b.propertyIsEnumerable(W)&&b[W];return(U&&V.kwAllowed)?B(U.type,U.style,W):B("variable","variable",W)}}}}}}}}function z(T){return function(V,U){if(!h(V,T)){U.tokenize=l}return B("string","string")}}function f(W,V){var T=false,U;while(U=W.next()){if(U=="/"&&T){V.tokenize=l;break}T=(U=="*")}return B("comment","comment")}var k={atom:true,number:true,variable:true,string:true,regexp:true};function t(Y,U,T,X,V,W){this.indented=Y;this.column=U;this.type=T;this.prev=V;this.info=W;if(X!=null){this.align=X}}function w(V,U){for(var T=V.localVars;T;T=T.next){if(T.name==U){return true}}}function E(X,U,T,W,Y){var Z=X.cc;u.state=X;u.stream=Y;u.marked=null,u.cc=Z;if(!X.lexical.hasOwnProperty("align")){X.lexical.align=true}while(true){var V=Z.length?Z.pop():Q?x:y;if(V(T,W)){while(Z.length&&Z[Z.length-1].lex){Z.pop()()}if(u.marked){return u.marked}if(T=="variable"&&w(X,W)){return"variable-2"}return U}}}var u={state:null,column:null,marked:null,cc:null};function a(){for(var T=arguments.length-1;T>=0;T--){u.cc.push(arguments[T])}}function G(){a.apply(null,arguments);return true}function m(U){var V=u.state;if(V.context){u.marked="def";for(var T=V.localVars;T;T=T.next){if(T.name==U){return}}V.localVars={name:U,next:V.localVars}}}var D={name:"this",next:{name:"arguments"}};function s(){if(!u.state.context){u.state.localVars=D}u.state.context={prev:u.state.context,vars:u.state.localVars}}function r(){u.state.localVars=u.state.context.vars;u.state.context=u.state.context.prev}function j(U,V){var T=function(){var W=u.state;W.lexical=new t(W.indented,u.stream.column(),U,null,W.lexical,V)};T.lex=true;return T}function F(){var T=u.state;if(T.lexical.prev){if(T.lexical.type==")"){T.indented=T.lexical.indented}T.lexical=T.lexical.prev}}F.lex=true;function c(U){return function T(V){if(V==U){return G()}else{if(U==";"){return a()}else{return G(arguments.callee)}}}}function y(T){if(T=="var"){return G(j("vardef"),J,c(";"),F)}if(T=="keyword a"){return G(j("form"),x,y,F)}if(T=="keyword b"){return G(j("form"),y,F)}if(T=="{"){return G(j("}"),n,F)}if(T==";"){return G()}if(T=="function"){return G(i)}if(T=="for"){return G(j("form"),c("("),j(")"),g,c(")"),F,y,F)}if(T=="variable"){return G(j("stat"),C)}if(T=="switch"){return G(j("form"),x,j("}","switch"),c("{"),n,F,F)}if(T=="case"){return G(x,c(":"))}if(T=="default"){return G(c(":"))}if(T=="catch"){return G(j("form"),s,c("("),q,c(")"),y,F,r)}return a(j("stat"),x,c(";"),F)}function x(T){if(k.hasOwnProperty(T)){return G(L)}if(T=="function"){return G(i)}if(T=="keyword c"){return G(A)}if(T=="("){return G(j(")"),A,c(")"),F,L)}if(T=="operator"){return G(x)}if(T=="["){return G(j("]"),O(x,"]"),F,L)}if(T=="{"){return G(j("}"),O(o,"}"),F,L)}return G()}function A(T){if(T.match(/[;\}\)\],]/)){return a()}return a(x)}function L(T,U){if(T=="operator"&&/\+\+|--/.test(U)){return G(L)}if(T=="operator"||T==":"){return G(x)}if(T==";"){return}if(T=="("){return G(j(")"),O(x,")"),F,L)}if(T=="."){return G(P,L)}if(T=="["){return G(j("]"),x,c("]"),F,L)}}function C(T){if(T==":"){return G(F,y)}return a(L,c(";"),F)}function P(T){if(T=="variable"){u.marked="property";return G()}}function o(T){if(T=="variable"){u.marked="property"}if(k.hasOwnProperty(T)){return G(c(":"),x)}}function O(V,T){function U(X){if(X==","){return G(V,U)}if(X==T){return G()}return G(c(T))}return function W(X){if(X==T){return G()}else{return a(V,U)}}}function n(T){if(T=="}"){return G()}return a(y,n)}function J(T,U){if(T=="variable"){m(U);return G(H)}return G()}function H(T,U){if(U=="="){return G(x,H)}if(T==","){return G(J)}}function g(T){if(T=="var"){return G(J,e)}if(T==";"){return a(e)}if(T=="variable"){return G(K)}return a(e)}function K(T,U){if(U=="in"){return G(x)}return G(L,e)}function e(T,U){if(T==";"){return G(d)}if(U=="in"){return G(x)}return G(x,c(";"),d)}function d(T){if(T!=")"){G(x)}}function i(T,U){if(T=="variable"){m(U);return G(i)}if(T=="("){return G(j(")"),s,O(q,")"),F,y,r)}}function q(T,U){if(T=="variable"){m(U);return G()}}return{startState:function(T){return{tokenize:l,reAllowed:true,kwAllowed:true,cc:[],lexical:new t((T||0)-v,0,"block",false),localVars:M.localVars,context:M.localVars&&{vars:M.localVars},indented:0}},token:function(V,U){if(V.sol()){if(!U.lexical.hasOwnProperty("align")){U.lexical.align=false}U.indented=V.indentation()}if(V.eatSpace()){return null}var T=U.tokenize(V,U);if(S=="comment"){return T}U.reAllowed=!!(S=="operator"||S=="keyword c"||S.match(/^[\[{}\(,;:]$/));U.kwAllowed=S!=".";return E(U,T,S,p,V)},indent:function(Y,T){if(Y.tokenize!=l){return 0}var X=T&&T.charAt(0),V=Y.lexical;if(V.type=="stat"&&X=="}"){V=V.prev}var W=V.type,U=X==W;if(W=="vardef"){return V.indented+4}else{if(W=="form"&&X=="{"){return V.indented}else{if(W=="stat"||W=="form"){return V.indented+v}else{if(V.info=="switch"&&!U){return V.indented+(/^(?:case|default)\b/.test(T)?v:2*v)}else{if(V.align){return V.column+(U?0:1)}else{return V.indented+(U?0:v)}}}}}},electricChars:":{}"}});CodeMirror.defineMIME("text/javascript","javascript");CodeMirror.defineMIME("application/json",{name:"javascript",json:true});CodeMirror.defineMode("xml",function(y,k){var r=y.indentUnit;var x=k.htmlMode?{autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:false}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false};var a=k.alignCDATA;var f,g;function o(E,D){function B(G){D.tokenize=G;return G(E,D)}var C=E.next();if(C=="<"){if(E.eat("!")){if(E.eat("[")){if(E.match("CDATA[")){return B(w("atom","]]>"))}else{return null}}else{if(E.match("--")){return B(w("comment","-->"))}else{if(E.match("DOCTYPE",true,true)){E.eatWhile(/[\w\._\-]/);return B(z(1))}else{return null}}}}else{if(E.eat("?")){E.eatWhile(/[\w\._\-]/);D.tokenize=w("meta","?>");return"meta"}else{g=E.eat("/")?"closeTag":"openTag";E.eatSpace();f="";var F;while((F=E.eat(/[^\s\u00a0=<>\"\'\/?]/))){f+=F}D.tokenize=n;return"tag"}}}else{if(C=="&"){var A;if(E.eat("#")){if(E.eat("x")){A=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";")}else{A=E.eatWhile(/[\d]/)&&E.eat(";")}}else{A=E.eatWhile(/[\w\.\-:]/)&&E.eat(";")}return A?"atom":"error"}else{E.eatWhile(/[^&<]/);return null}}}function n(C,B){var A=C.next();if(A==">"||(A=="/"&&C.eat(">"))){B.tokenize=o;g=A==">"?"endTag":"selfcloseTag";return"tag"}else{if(A=="="){g="equals";return null}else{if(/[\'\"]/.test(A)){B.tokenize=j(A);return B.tokenize(C,B)}else{C.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);return"word"}}}}function j(A){return function(C,B){while(!C.eol()){if(C.next()==A){B.tokenize=n;break}}return"string"}}function w(B,A){return function(D,C){while(!D.eol()){if(D.match(A)){C.tokenize=o;break}D.next()}return B}}function z(A){return function(D,C){var B;while((B=D.next())!=null){if(B=="<"){C.tokenize=z(A+1);return C.tokenize(D,C)}else{if(B==">"){if(A==1){C.tokenize=o;break}else{C.tokenize=z(A-1);return C.tokenize(D,C)}}}}return"meta"}}var l,h;function b(){for(var A=arguments.length-1;A>=0;A--){l.cc.push(arguments[A])}}function e(){b.apply(null,arguments);return true}function i(A,C){var B=x.doNotIndent.hasOwnProperty(A)||(l.context&&l.context.noIndent);l.context={prev:l.context,tagName:A,indent:l.indented,startOfLine:C,noIndent:B}}function u(){if(l.context){l.context=l.context.prev}}function d(A){if(A=="openTag"){l.tagName=f;return e(m,c(l.startOfLine))}else{if(A=="closeTag"){var B=false;if(l.context){if(l.context.tagName!=f){if(x.implicitlyClosed.hasOwnProperty(l.context.tagName.toLowerCase())){u()}B=!l.context||l.context.tagName!=f}}else{B=true}if(B){h="error"}return e(s(B))}}return e()}function c(A){return function(B){if(B=="selfcloseTag"||(B=="endTag"&&x.autoSelfClosers.hasOwnProperty(l.tagName.toLowerCase()))){q(l.tagName.toLowerCase());return e()}if(B=="endTag"){q(l.tagName.toLowerCase());i(l.tagName,A);return e()}return e()}}function s(A){return function(B){if(A){h="error"}if(B=="endTag"){u();return e()}h="error";return e(arguments.callee)}}function q(B){var A;while(true){if(!l.context){return}A=l.context.tagName.toLowerCase();if(!x.contextGrabbers.hasOwnProperty(A)||!x.contextGrabbers[A].hasOwnProperty(B)){return}u()}}function m(A){if(A=="word"){h="attribute";return e(p,m)}if(A=="endTag"||A=="selfcloseTag"){return b()}h="error";return e(m)}function p(A){if(A=="equals"){return e(v,m)}if(!x.allowMissing){h="error"}return(A=="endTag"||A=="selfcloseTag")?b():e()}function v(A){if(A=="string"){return e(t)}if(A=="word"&&x.allowUnquoted){h="string";return e()}h="error";return(A=="endTag"||A=="selfCloseTag")?b():e()}function t(A){if(A=="string"){return e(t)}else{return b()}}return{startState:function(){return{tokenize:o,cc:[],indented:0,startOfLine:true,tagName:null,context:null}},token:function(D,C){if(D.sol()){C.startOfLine=true;C.indented=D.indentation()}if(D.eatSpace()){return null}h=g=f=null;var B=C.tokenize(D,C);C.type=g;if((B||g)&&B!="comment"){l=C;while(true){var A=C.cc.pop()||d;if(A(g||B)){break}}}C.startOfLine=false;return h||B},indent:function(D,A,C){var B=D.context;if((D.tokenize!=n&&D.tokenize!=o)||B&&B.noIndent){return C?C.match(/^(\s*)/)[0].length:0}if(a&&/<!\[CDATA\[/.test(A)){return 0}if(B&&/^<\//.test(A)){B=B.prev}while(B&&!B.startOfLine){B=B.prev}if(B){return B.indent+r}else{return 0}},compareStates:function(D,B){if(D.indented!=B.indented||D.tokenize!=B.tokenize){return false}for(var C=D.context,A=B.context;;C=C.prev,A=A.prev){if(!C||!A){return C==A}if(C.tagName!=A.tagName){return false}}},electricChars:"/"}});CodeMirror.defineMIME("application/xml","xml");if(!CodeMirror.mimeModes.hasOwnProperty("text/html")){CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:true})}CodeMirror.defineMode("markdown",function(B,m){var i=CodeMirror.getMode(B,{name:"xml",htmlMode:true});var y="header",d="comment",A="quote",z="string",E="hr",s="link",D="string",g="em",j="strong",w="emstrong";var F=/^([*\-=_])(?:\s*\1){2,}\s*$/,p=/^[*\-+]\s+/,u=/^[0-9]+\.\s+/,n=/^(?:\={3,}|-{3,})$/,f=/^[^\[*_\\<>`]+/;function e(I,H,G){H.f=H.inline=G;return G(I,H)}function r(I,H,G){H.f=H.block=G;return G(I,H)}function o(G){G.em=false;G.strong=false;return null}function l(I,H){var G;if(H.indentationDiff>=4){H.indentation-=H.indentationDiff;I.skipToEnd();return d}else{if(I.eatSpace()){return null}else{if(I.peek()==="#"||I.match(n)){H.header=true}else{if(I.eat(">")){H.indentation++;H.quote=true}else{if(I.peek()==="["){return e(I,H,k)}else{if(I.match(F,true)){return E}else{if(G=I.match(p,true)||I.match(u,true)){H.indentation+=G[0].length;return z}}}}}}}return e(I,H,H.inline)}function x(I,H){var G=i.token(I,H.htmlState);if(G==="tag"&&H.htmlState.type!=="openTag"&&!H.htmlState.context){H.f=q;H.block=l}return G}function t(H){var G=[];if(H.strong){G.push(H.em?w:j)}else{if(H.em){G.push(g)}}if(H.header){G.push(y)}if(H.quote){G.push(A)}return G.length?G.join(" "):null}function b(H,G){if(H.match(f,true)){return t(G)}return undefined}function q(K,J){var I=J.text(K,J);if(typeof I!=="undefined"){return I}var H=K.next();if(H==="\\"){K.next();return t(J)}if(H==="`"){return e(K,J,v(d,"`"))}if(H==="["){return e(K,J,C)}if(H==="<"&&K.match(/^\w/,false)){K.backUp(1);return r(K,J,x)}var G=t(J);if(H==="*"||H==="_"){if(K.eat(H)){return(J.strong=!J.strong)?t(J):G}return(J.em=!J.em)?t(J):G}return t(J)}function C(I,H){while(!I.eol()){var G=I.next();if(G==="\\"){I.next()}if(G==="]"){H.inline=H.f=h;return s}}return s}function h(I,H){I.eatSpace();var G=I.next();if(G==="("||G==="["){return e(I,H,v(D,G==="("?")":"]"))}return"error"}function k(H,G){if(H.match(/^[^\]]*\]:/,true)){G.f=a;return s}return e(H,G,q)}function a(H,G){H.eatSpace();H.match(/^[^\s]+/,true);G.f=G.inline=q;return D}function c(G){if(!c[G]){c[G]=new RegExp("^(?:[^\\\\\\"+G+"]|\\\\.)*(?:\\"+G+"|$)")}return c[G]}function v(H,I,G){G=G||q;return function(K,J){K.match(c(I));J.inline=J.f=G;return H}}return{startState:function(){return{f:l,block:l,htmlState:i.startState(),indentation:0,inline:q,text:b,em:false,strong:false,header:false,quote:false}},copyState:function(G){return{f:G.f,block:G.block,htmlState:CodeMirror.copyState(i,G.htmlState),indentation:G.indentation,inline:G.inline,text:G.text,em:G.em,strong:G.strong,header:G.header,quote:G.quote}},token:function(I,H){if(I.sol()){if(I.match(/^\s*$/,true)){return o(H)}H.header=false;H.quote=false;H.f=H.block;var G=I.match(/^\s*/,true)[0].replace(/\t/g," ").length;H.indentationDiff=G-H.indentation;H.indentation=G;if(G>0){return null}}return H.f(I,H)},blankLine:o,getType:t}},"xml");CodeMirror.defineMIME("text/x-markdown","markdown");Ext.define("Docs.History",{singleton:true,init:function(){Ext.util.History.useTopWindow=false;Ext.util.History.init(function(){this.historyLoaded=true;this.initialNavigate()},this);Ext.util.History.on("change",function(b){this.navigate(b,true)},this)},notifyTabsLoaded:function(){this.tabsLoaded=true;this.initialNavigate()},initialNavigate:function(){if(this.tabsLoaded&&this.historyLoaded){this.navigate(Ext.util.History.getToken(),true)}},navigate:function(e,g){var f=this.parseToken(e);if(f.url=="#!/api"){Docs.App.getController("Classes").loadIndex(g)}else{if(f.type==="api"){Docs.App.getController("Classes").loadClass(f.url,g)}else{if(f.url==="#!/guide"){Docs.App.getController("Guides").loadIndex(g)}else{if(f.type==="guide"){Docs.App.getController("Guides").loadGuide(f.url,g)}else{if(f.url==="#!/video"){Docs.App.getController("Videos").loadIndex(g)}else{if(f.type==="video"){Docs.App.getController("Videos").loadVideo(f.url,g)}else{if(f.url==="#!/example"){Docs.App.getController("Examples").loadIndex()}else{if(f.type==="example"){Docs.App.getController("Examples").loadExample(f.url,g)}else{if(f.url==="#!/comment"){Docs.App.getController("Comments").loadIndex()}else{if(f.url==="#!/tests"){Docs.App.getController("Tests").loadIndex()}else{if(Docs.App.getController("Welcome").isActive()){Docs.App.getController("Welcome").loadIndex(g)}else{if(!this.noRepeatNav){this.noRepeatNav=true;var h=Ext.getCmp("doctabs").staticTabs[0];if(h){this.navigate(h.href,g)}}}}}}}}}}}}}},parseToken:function(d){var c=d&&d.match(/!?(\/(api|guide|example|video|comment|tests)(\/(.*))?)/);return c?{type:c[2],url:"#!"+c[1]}:{}},push:function(e,f){e=this.cleanUrl(e);if(!/^#!?/.test(e)){e="#!"+e}var d=Ext.util.History.getToken()||"";if("#"+d.replace(/^%21/,"!")!==e){Ext.util.History.add(e)}},cleanUrl:function(b){return b.replace(/^[^#]*#/,"#")}});Ext.define("Docs.Auth",{singleton:true,requires:["Ext.Ajax","Ext.util.Cookies"],init:function(c,d){Ext.Ajax.request({url:Docs.data.commentsUrl+"/session",params:{sid:this.getSid()},method:"GET",cors:true,callback:function(g,a,h){if(h&&h.responseText){var b=Ext.JSON.decode(h.responseText);if(b&&b.sessionID){this.setSid(b.sessionID)}if(b&&b.userName){this.currentUser=b}c.call(d,true)}else{c.call(d,false)}},scope:this})},login:function(b){Ext.Ajax.request({url:Docs.data.commentsUrl+"/login",method:"POST",cors:true,params:{username:b.username,password:b.password},callback:function(h,f,a){var g=Ext.JSON.decode(a.responseText);if(g.success){this.currentUser=g;this.setSid(g.sessionID,b.remember);b.success&&b.success.call(b.scope)}else{b.failure&&b.failure.call(b.scope,g.reason)}},scope:this})},logout:function(c,d){Ext.Ajax.request({url:Docs.data.commentsUrl+"/logout?sid="+this.getSid(),method:"POST",cors:true,callback:function(){this.currentUser=undefined;c&&c.call(d)},scope:this})},setSid:function(d,f){this.sid=d;if(d){var e=null;if(f){e=new Date();e.setTime(e.getTime()+(60*60*24*30*1000))}Ext.util.Cookies.set("sid",d,e)}else{Ext.util.Cookies.clear("sid")}},getSid:function(){if(!this.sid){this.sid=Ext.util.Cookies.get("sid")}return this.sid},getUser:function(){return this.currentUser},isLoggedIn:function(){return !!this.getUser()},isModerator:function(){return this.getUser()&&this.getUser().mod},getRegistrationUrl:function(){return Docs.data.commentsUrl+"/register"}});Ext.define("Docs.CommentCounts",{constructor:function(b){this.counts={};Ext.Array.each(b,function(a){this.counts[a._id]=a.value},this)},get:function(b){return this.counts[b.join("__")]||0},change:function(c,d){delete this.totals;return this.counts[c.join("__")]=this.get(c)+d},getClassTotal:function(b){if(!this.totals){this.totals={};Ext.Object.each(this.counts,function(a,f){var e=a.split("__");if(e[0]==="class"){this.totals[e[1]]=(this.totals[e[1]]||0)+f}},this)}return this.totals[b]}});Ext.define("Docs.CommentSubscriptions",{constructor:function(b){this.subscriptions={};Ext.Array.each(b,function(a){this.subscriptions[a.join("__")]=true},this)},has:function(b){return this.subscriptions[b.join("__")]},set:function(c,d){this.subscriptions[c.join("__")]=d}});Ext.define("Docs.LocalStore",{storeName:"",init:function(){this.localStorage=!!window.localStorage;this.store=Ext.create(this.storeName);if(this.localStorage){this.cleanup();this.store.load();if(window.addEventListener){window.addEventListener("storage",Ext.Function.bind(this.onStorageChange,this),false)}else{window.attachEvent("onstorage",Ext.Function.bind(this.onStorageChange,this))}}},onStorageChange:function(b){b=b||window.event;if(b.key===this.store.getProxy().id){this.store.load()}},syncStore:function(){this.localStorage&&this.store.sync()},cleanup:function(){var f=/-settings/;for(var d=0;d<window.localStorage.length;d++){var e=window.localStorage.key(d);if(!f.test(e)){window.localStorage.removeItem(e)}}}});Ext.define("Docs.view.Header",{extend:"Ext.container.Container",alias:"widget.docheader",contentEl:"header-content",initComponent:function(){if(Docs.otherProducts){this.style="cursor: pointer;",this.cls="dropdown";this.menu=Ext.create("Ext.menu.Menu",{renderTo:Ext.getBody(),plain:true,items:Docs.otherProducts})}this.callParent()},listeners:{afterrender:function(b){if(this.menu){b.el.addListener("click",function(d,a){this.menu.showBy(this.el,"bl",[120,0])},this)}}}});Ext.define("Docs.view.examples.Container",{extend:"Ext.panel.Panel",alias:"widget.examplecontainer",layout:"fit",initComponent:function(){this.dockedItems=[{xtype:"container",dock:"top",html:['<div class="cls-grouping example-toolbar">',"<div>",'<button class="new-window">Open in new window</button>',"</div>","</div>"].join("")}];this.tpl=new Ext.XTemplate('<iframe style="width: 100%; height: 100%; border: 0;" src="{url}"></iframe>');this.callParent(arguments)},load:function(b){this.update(this.tpl.apply(b))},clear:function(){this.update("")}});Ext.define("Docs.controller.Content",{extend:"Ext.app.Controller",MIDDLE:1,title:"",loadIndex:function(b){b||Docs.History.push(this.baseUrl);this.getViewport().setPageTitle(this.title);Ext.getCmp("doctabs").activateTab(this.baseUrl);Ext.getCmp("card-panel").layout.setActiveItem(this.getIndex());this.getIndex().restoreScrollState()},opensNewWindow:function(b){return b.button===this.MIDDLE||b.shiftKey||b.ctrlKey},getBaseUrl:function(){return document.location.href.replace(/\/?(index.html|template.html)?(\?[^#]*)?#.*/,"")}});Ext.define("Docs.ClassRegistry",{singleton:true,canonicalName:function(b){if(!this.altNames){this.altNames={};Ext.each(Docs.data.search,function(a){if(a.type==="class"&&!/:/.test(a.cls)){this.altNames[a.cls]=a.id}},this)}return this.altNames[b]||b},shortName:function(b){return b.split(/\./).pop()},packageName:function(b){return b.slice(0,-this.shortName(b).length-1)||""},search:function(S,H){var J=5;var T=4;var X=3;var K=new Array(J*T*X);for(var E=0;E<K.length;E++){K[E]=[]}var O=J*T*0;var Z=J*T*1;var R=J*T*2;var U=J*0;var L=J*1;var W=J*2;var F=J*3;if(H){var P=4;for(var E=0;E<H.length;E++){var i=H[E];if(i.score>5){K[P+U+O].push(i)}else{if(i.score>1){K[P+U+Z].push(i)}else{K[P+U+R].push(i)}}}}var M=/[.:]/.test(S);var G=Ext.escapeRe(S);var g=new RegExp("^"+G+"$","i");var Y=new RegExp("^"+G,"i");var N=new RegExp(G,"i");var V=Docs.data.search;for(var E=0,r=V.length;E<r;E++){var Q=V[E];var I=M?Q.fullName:Q.name;var D=Q.meta.removed?F:(Q.meta["private"]?W:(Q.meta.deprecated?L:U));if(g.test(I)){K[Q.sort+D+O].push(this.highlightMatch(Q,g))}else{if(Y.test(I)){K[Q.sort+D+Z].push(this.highlightMatch(Q,Y))}else{if(N.test(I)){K[Q.sort+D+R].push(this.highlightMatch(Q,N))}}}}return Ext.Array.flatten(K)},highlightMatch:function(c,d){c=Ext.apply({},c);c.name=c.name.replace(d,"<strong>$&</strong>");c.fullName=c.fullName.replace(d,"<strong>$&</strong>");return c}});Ext.define("Docs.GuideSearch",{singleton:true,isEnabled:function(){return !!Docs.data.guideSearch.url},deferredSearch:function(f,h,j,g){clearTimeout(this.timeout);var i=this.timeout=Ext.Function.defer(function(){this.search(f,function(a){if(i===this.timeout){h.call(j,a)}},this)},g,this)},search:function(f,g,e){var h=this.currentRequest=Ext.data.JsonP.request({url:Docs.data.guideSearch.url,params:{fragsize:32,max_fragments:1,q:f,product:Docs.data.guideSearch.product,version:Docs.data.guideSearch.version,start:0,limit:100},callback:function(a,b){if(a&&b.success&&this.currentRequest===h){g.call(e,Ext.Array.map(b.docs,this.adaptJson,this))}},scope:this})},adaptJson:function(b){return{icon:"icon-guide",name:this.format(b.title),fullName:this.format(b.body),url:b.url,meta:{},score:b.score}},format:function(c){var d=c.replace(/\s+/g," ");return d.replace(/<em class="match">(.*?)<\/em>/g,"<strong>$1</strong>")}});Ext.define("Docs.store.Search",{extend:"Ext.data.Store",fields:["name","fullName","icon","url","meta","sort"],proxy:{type:"memory",reader:{type:"json"}}});Ext.define("Docs.Syntax",{singleton:true,highlight:function(b){Ext.Array.forEach(Ext.query("pre",b.dom||b),function(a){a=Ext.get(a);if(a.child("code")){if(!(a.hasCls("inline-example")&&a.hasCls("preview"))){a.addCls("prettyprint")}}else{if(!a.parent(".CodeMirror")&&!a.hasCls("hierarchy")){a.addCls("notpretty")}}});prettyPrint()}});Ext.define("Docs.model.Setting",{fields:["id","key","value"],extend:"Ext.data.Model",requires:["Ext.data.proxy.LocalStorage"],proxy:{type:window.localStorage?"localstorage":"memory",id:Docs.data.localStorageDb+"-settings"}});Ext.define("Docs.view.TabMenu",{extend:"Ext.menu.Menu",plain:true,componentCls:"tab-menu",initComponent:function(){this.addEvents("tabItemClick","closeAllTabs");this.items=[{text:"Close other tabs",iconCls:"close",cls:"close-all",handler:function(){this.fireEvent("closeAllTabs")},scope:this}];this.callParent()},addTab:function(c,d){this.insert(this.items.length-1,{text:c.text,iconCls:c.iconCls,origIcon:c.iconCls,href:c.href,cls:d,handler:this.onTabItemClick,scope:this})},onTabItemClick:function(b){this.fireEvent("tabItemClick",b)},addTabCls:function(c,d){this.items.each(function(a){if(a.href===c.href){a.addCls(d)}})}});Ext.define("Docs.view.Scrolling",{onClassMixedIn:function(b){Ext.Function.interceptBefore(b.prototype,"initComponent",this.prototype.initScrolling)},initScrolling:function(){this.scrollContext="index";this.scrollState={};this.on("afterrender",function(){this.getScrollEl().addListener("scroll",this.saveScrollState,this)},this)},setScrollContext:function(b){this.scrollContext=b},eraseScrollContext:function(b){delete this.scrollState[b]},saveScrollState:function(){this.scrollState[this.scrollContext]=this.getScrollTop()},restoreScrollState:function(){this.setScrollTop(this.scrollState[this.scrollContext]||0)},scrollToView:function(d,c){d=Ext.get(d);c=c||{};if(d){this.setScrollTop(this.getScrollTop()+d.getY()+(c.offset||0));this.setScrollLeft(0);c.highlight&&d.highlight()}},getScrollTop:function(){return this.getScrollEl().getScroll()["top"]},setScrollTop:function(b){return this.getScrollEl().scrollTo("top",b)},setScrollLeft:function(b){return this.getScrollEl().scrollTo("left",b)},scrollToTop:function(){this.getScrollEl().scrollTo("top")},getScrollEl:function(){return this.body||this.el}});Ext.define("Docs.ContentGrabber",{singleton:true,get:function(f){var e;var d=Ext.get(f);if(d){e=d.dom.innerHTML;d.remove()}return e}});Ext.define("Docs.view.comments.HeaderMenu",{extend:"Ext.container.Container",alias:"widget.commentsHeaderMenu",componentCls:"comments-header-menu",html:["<h1>",' <a href="#" class="users selected">Users</a>',' <a href="#" class="targets">Topics</a>',' <a href="#" class="tags">Tags</a>',"</h1>"].join(""),afterRender:function(){this.callParent(arguments);Ext.Array.forEach(["users","targets","tags"],function(d){var c=this.getEl().down("a."+d);c.on("click",function(b,a){this.getEl().select("a",true).removeCls("selected");c.addCls("selected");this.fireEvent("select",d)},this,{preventDefault:true})},this)}});Ext.define("Docs.view.examples.Device",{config:{url:"",id:undefined,device:"phone",orientation:"landscape"},constructor:function(b){this.initConfig(b);Ext.apply(this,this.getIframeSize());this.id=this.id||Ext.id();this.tpl=new Ext.XTemplate('<div class="touchExample {device} {orientation}">','<iframe id={id} style="width: {width}; height: {height}; border: 0;" ','src="{[this.deviceUrl(values)]}"></iframe>',"</div>",{deviceUrl:function(a){return a.url+"?deviceType="+(a.device==="tablet"?"Tablet":"Phone")}})},toHtml:function(){return this.tpl.apply(this)},setDevice:function(b){this.device=b;Ext.apply(this,this.getIframeSize())},setOrientation:function(b){this.orientation=b;Ext.apply(this,this.getIframeSize())},getIframeSize:function(){var b={phone:{width:"481px",height:"320px"},miniphone:{width:"320px",height:"219px"},tablet:{width:"717px",height:"538px"}}[this.device];if(this.orientation==="landscape"){return b}else{return{width:b.height,height:b.width}}}});Ext.define("Docs.model.Test",{extend:"Ext.data.Model",fields:["id","name","href","code","options",{name:"status",defaultValue:"ready"},"message"]});Ext.define("Docs.view.examples.InlineToolbar",{extend:"Ext.toolbar.Toolbar",componentCls:"inline-example-tb",height:30,initComponent:function(){this.addEvents("buttonclick");this.items=[{iconCls:"code",padding:"0 2 0 0",margin:"0 3 0 0",text:"Code Editor",handler:this.createEventFirerer("code")},{padding:0,margin:"0 3 0 0",iconCls:"preview",text:"Live Preview",handler:this.createEventFirerer("preview")},"->",{padding:0,margin:0,iconCls:"copy",text:"Select Code",handler:this.createEventFirerer("copy")}];this.callParent(arguments)},createEventFirerer:function(b){return Ext.Function.bind(function(){this.fireEvent("buttonclick",b)},this)},activateButton:function(b){Ext.Array.each(this.query("button"),function(a){a.removeCls("active")});Ext.Array.each(this.query("button[iconCls="+b+"]"),function(a){a.addCls("active")})}});Ext.define("Docs.view.Signature",{singleton:true,render:function(f,d){d=d||"short";var e=Ext.Array.map(Docs.data.signatures,function(a){return f[a.tagname]?'<span class="'+a.tagname+'">'+(a[d])+"</span>":""}).join(" ");return'<span class="signature">'+e+"</span>"}});Ext.define("Docs.view.DocTree",{extend:"Ext.tree.Panel",alias:"widget.doctree",cls:"doc-tree iScroll",useArrows:true,rootVisible:false,border:false,bodyBorder:false,initComponent:function(){this.addEvents("urlclick");this.root.expanded=true;this.on("itemclick",this.onItemClick,this);this.on("beforeitemcollapse",this.handleBeforeExpandCollapse,this);this.on("beforeitemexpand",this.handleBeforeExpandCollapse,this);this.callParent();this.nodeTpl=new Ext.XTemplate('<a href="{url}" rel="{url}">{text}</a>');this.initNodeLinks()},initNodeLinks:function(){this.getRootNode().cascadeBy(this.applyNodeTpl,this)},applyNodeTpl:function(b){if(b.get("leaf")){b.set("text",this.nodeTpl.apply({text:b.get("text"),url:b.raw.url}));b.commit()}},onItemClick:function(h,j,k,l,i){var e=j.raw?j.raw.url:j.data.url;if(e){this.fireEvent("urlclick",e,i)}else{if(!j.isLeaf()){if(j.isExpanded()){j.collapse(false)}else{j.expand(false)}}}},selectUrl:function(d){var c=this.findNodeByUrl(d);if(c){c.bubble(function(a){a.expand()});this.getSelectionModel().select(c)}else{this.getSelectionModel().deselectAll()}},findNodeByUrl:function(b){return this.getRootNode().findChildBy(function(a){return b===a.raw.url},this,true)},findRecordByUrl:function(d){var c=this.findNodeByUrl(d);return c?c.raw:undefined},handleBeforeExpandCollapse:function(b){if(this.getView().isAnimating(b)){return false}}});Ext.define("Docs.Tip",{singleton:true,show:function(g,e,f){f=f||"right";this.tips=this.tips||{};if(this.tips[f]){var h=this.tips[f];h.update(g);h.setTarget(e);h.show()}else{var h=this.tips[f]=Ext.create("Ext.tip.ToolTip",{anchor:f,target:e,html:g});h.show()}}});Ext.define("Docs.view.comments.Pager",{extend:"Ext.Component",alias:"widget.commentsPager",componentCls:"recent-comments-pager",afterRender:function(){this.callParent(arguments);this.getEl().on("click",function(){this.fireEvent("loadMore",this.offset+this.limit)},this,{preventDefault:true,delegate:"a.fetchMoreComments"})},configure:function(b){Ext.apply(this,b);this.update(this.getPagerHtml())},reset:function(){this.update("<span></span>No comments found.")},getPagerHtml:function(){var d=this.total_rows||0;var e=this.offset+this.limit;var f=Math.min(this.limit,d-e);if(d>e){return["<span></span>",'<a href="#" class="fetchMoreComments" rel="'+e+'">',"Showing comments 1-"+e+" of "+d+". ","Click to load "+f+" more...","</a>"].join("")}else{return"<span></span>That's all. Total "+d+" comments."}}});Ext.define("Docs.view.SimpleSelectBehavior",{mixins:{observable:"Ext.util.Observable"},constructor:function(c,d){this.mixins.observable.constructor.call(this,{listeners:d});c.on({select:this.onSelect,deselect:this.onDeselect,scope:this})},onSelect:function(c,d){this.selectedItem=d;this.fireEvent("select",d)},onDeselect:function(c,d){this.selectedItem=undefined;Ext.Function.defer(function(){if(!this.selectedItem){this.fireEvent("deselect",d)}},10,this)}});Ext.define("Docs.view.comments.FilterField",{extend:"Ext.form.field.Trigger",alias:"widget.commentsFilterField",triggerCls:"reset",componentCls:"comments-filter-field",hideTrigger:true,enableKeyEvents:true,initComponent:function(){this.callParent(arguments);this.on({keyup:this.onKeyUp,specialkey:this.onSpecialKey,scope:this})},onKeyUp:function(){this.fireEvent("filter",this.getValue());this.setHideTrigger(this.getValue().length===0)},onSpecialKey:function(c,d){if(d.keyCode===Ext.EventObject.ESC){this.reset();this.fireEvent("filter","")}},onTriggerClick:function(){this.reset();this.focus();this.fireEvent("filter","");this.setHideTrigger(true)}});Ext.define("Docs.view.comments.TopList",{extend:"Ext.panel.Panel",componentCls:"comments-toplist",requires:["Docs.view.SimpleSelectBehavior","Docs.view.comments.FilterField"],layout:"border",displayField:"text",scoreField:"score",filterEmptyText:"Filter by name...",initComponent:function(){this.items=[this.tabpanel=Ext.widget("tabpanel",{plain:true,region:"north",height:50,items:[{title:"By comment count"}],dockedItems:[{dock:"bottom",items:[{xtype:"commentsFilterField",emptyText:this.filterEmptyText,width:320,height:20,listeners:{filter:this.onFilter,scope:this}}]}]}),this.list=Ext.widget("dataview",{region:"center",cls:"iScroll top-list",autoScroll:true,store:new Ext.data.Store({model:this.model}),allowDeselect:true,tpl:["<ul>",'<tpl for=".">',"<li>",'<span class="score">{'+this.scoreField+"}</span>",'<span class="text">{'+this.displayField+"}</span>","</li>","</tpl>","</ul>"],itemSelector:"li"})];new Docs.view.SimpleSelectBehavior(this.list,{select:this.onSelect,deselect:this.onDeselect,scope:this});this.callParent(arguments)},afterRender:function(){this.callParent(arguments);this.list.getStore().load()},onFilter:function(b){this.list.getSelectionModel().deselectAll();this.list.getStore().clearFilter(true);this.list.getStore().filter({property:this.displayField,value:b,anyMatch:true})},deselectAll:function(){this.list.getSelectionModel().deselectAll()},onSelect:function(b){this.fireEvent("select",b)},onDeselect:function(){this.fireEvent("select",undefined)}});Ext.define("Docs.view.cls.MemberWrap",{constructor:function(b){Ext.apply(this,b);this.el=Ext.get(b.el)},setExpanded:function(b){if(b){if(!this.isExpanded()){this.el.addCls("open")}}else{this.el.removeCls("open")}},isExpanded:function(){return this.el.hasCls("open")},getDefinedIn:function(){return this.el.down(".meta .defined-in").getAttribute("rel")},getMemberId:function(){return this.el.getAttribute("id")}});Ext.define("Docs.view.examples.InlineEditor",{extend:"Ext.Panel",bodyPadding:2,autoScroll:true,componentCls:"inline-example-editor",initComponent:function(){this.addEvents("init","change");this.on("afterlayout",this.initCodeMirror,this);this.callParent(arguments)},initCodeMirror:function(b){if(!this.codemirror){this.codemirror=CodeMirror(this.body,{mode:"javascript",indentUnit:4,value:this.value,extraKeys:{Tab:"indentMore","Shift-Tab":"indentLess"},onChange:Ext.Function.bind(function(a){this.fireEvent("change")},this)});this.fireEvent("init")}},refresh:function(){this.codemirror.refresh()},getValue:function(){return this.codemirror?this.codemirror.getValue():this.value},getHeight:function(){var b=this.el.down(".CodeMirror-lines");return b?b.getHeight():undefined},selectAll:function(){var d=this.codemirror.lineCount()-1;var c=this.codemirror.getLine(d).length;this.codemirror.setSelection({line:0,ch:0},{line:d,ch:c})}});Ext.define("Docs.view.examples.InlinePreview",{extend:"Ext.Panel",requires:["Docs.view.examples.Device"],bodyPadding:"0 10",statics:{iframeCounter:0,getNextIframeId:function(){this.iframeCounter++;return this.iframeCounter.toString()}},options:{},constructor:function(b){b=b||{};b.iframeId=this.self.getNextIframeId();b.id="inline-preview-"+b.iframeId;this.callParent([b]);this.addEvents(["previewsuccess","previewfailure"])},initComponent:function(){this.html=this.getHtml();this.callParent(arguments)},getHtml:function(){if(Docs.data.touchExamplesUi){return Ext.create("Docs.view.examples.Device",{url:"eg-iframe.html",id:this.iframeId,device:this.options.device,orientation:this.options.orientation}).toHtml()}else{var b=new Ext.XTemplate('<iframe id="{id}" style="width: 100%; height: 100%; border: 0" frameBorder="0"></iframe>');return b.apply({id:this.iframeId})}},update:function(h){var f=this.options;var e=Ext.get(this.iframeId);var g=Ext.Function.bind(this.iframeCallback,this);if(e){e.on("load",function(){Ext.Function.defer(function(){e.dom.contentWindow.loadInlineExample(h+"\n",f,g)},100)},this,{single:true});e.dom.src="eg-iframe.html"}},iframeCallback:function(c,d){if(c){this.fireEvent("previewsuccess",this)}else{this.fireEvent("previewfailure",this,d)}},getHeight:function(){return document.getElementById(this.iframeId).parentNode.clientHeight}});Ext.define("Docs.view.cls.Logic",{showPrivateClasses:false,constructor:function(b){Ext.apply(this,b)}});Ext.define("Docs.view.comments.Form",{extend:"Ext.Component",alias:"widget.commentsForm",requires:["Docs.Tip"],tpl:['<form class="commentForm <tpl if="!updateComment">newComment</tpl>">','<tpl if="title">',"<p>{title}</p>","</tpl>","<textarea>{content}</textarea>",'<div class="com-meta">',"{[Docs.Comments.avatar(values.user.emailHash)]}",'<div class="form-author">Logged in as {user.userName}</div>','<tpl if="!updateComment">','<label class="subscribe">','Email updates? <input type="checkbox" class="subscriptionCheckbox" <tpl if="userSubscribed">checked="checked"</tpl> />','<span class="sep"> | </span>',"</label>","</tpl>",'<a href="#" class="toggleCommentGuide">Show help ↓</a>','<input type="submit" class="sub submitComment" value="{[values.updateComment ? "Update" : "Post"]} comment" />','<tpl if="updateComment">',' or <a href="#" class="cancelUpdateComment">cancel</a>',"</tpl>","</div>",'<div class="commentGuideTxt" style="display: none;">',"<ul>",'<li>Use <strong><a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown</a></strong>'," for formatting:</li>","</ul>",'<div class="markdown preview">',"<h4>Markdown</h4>","<pre>","**Bold**, _italic_\n","and `monospaced font`.\n","\n"," Indent with 4 spaces\n"," for a code block.\n","\n","1. numbered lists\n","2. are cool\n","\n","- bulleted lists\n","- make your point\n","\n","[External link](http//example.com)\n","\n","Leave a blank line\n","between paragraphs.\n","</pre>","</div>",'<div class="markdown result">',"<h4>Result</h4>","<strong>Bold</strong>, <em>italic</em> and<br/>","<code>monospaced font</code>.<br/>",'<pre class="prettyprint">',"Indent with 4 spaces\n","for a code block.","</pre>","<ol>","<li>numbered lists</li>","<li>are cool</li>","</ol>","<ul>","<li>bulleted lists</li>","<li>make your point</li>","</ul>",'<a href="http://example.com">External link</a><br/>',"<br/>","Leave a blank line between paragraphs.<br/><br/>","</div>","<ul>","<li>Use comments to:","<ul>","<li>Inform us about <strong>bugs in documentation.</strong></li>","<li>Give <strong>useful tips</strong> to other developers.</li>","<li><strong>Warn about bugs</strong> and problems that might bite.</li>","</ul>","</li>","<li>Don't post comments for:","<ul>","<li><strong>Questions about code or usage</strong>",' - use the <a href="http://www.sencha.com/forum" target="_blank">Sencha Forum</a>.</li>',"<li><strong>SDK bugs</strong>",' - use the <a href="http://www.sencha.com/forum" target="_blank">Sencha Forum</a>.</li>',"<li><strong>Docs App bugs</strong>",' - use the <a href="https://github.com/senchalabs/jsduck/issues" target="_blank">GitHub Issue tracker</a>.</li>',"</ul></li>","<li>Comments may be edited or deleted at any time by a moderator.</li>",'<li>Avatars can be managed at <a href="http://www.gravatar.com" target="_blank">Gravatar</a> (use your forum email address).</li>',"<li>To write a reply use <strong><code>@username</code></strong> syntax – the user will get notified.</li>","</ul>","</div>","</form>"],initComponent:function(){this.data={title:this.title,updateComment:(this.content!==undefined),content:this.content,userSubscribed:this.userSubscribed,user:this.user};this.callParent(arguments)},setValue:function(b){this.codeMirror.setValue(b)},afterRender:function(){this.callParent(arguments);this.makeCodeMirror(this.getEl().down("textarea").dom);this.bindEvents()},makeCodeMirror:function(d){var c=true;this.codeMirror=CodeMirror.fromTextArea(d,{mode:"markdown",lineWrapping:true,indentUnit:4,extraKeys:{Tab:"indentMore","Shift-Tab":"indentLess"},onFocus:Ext.Function.bind(function(){if(c&&this.codeMirror.getValue()===""){this.toggleGuide(true)}c=false},this)})},bindEvents:function(){this.getEl().on("click",function(){this.toggleGuide()},this,{preventDefault:true,delegate:"a.toggleCommentGuide"});this.getEl().on("click",function(){this.fireEvent("cancel")},this,{preventDefault:true,delegate:"a.cancelUpdateComment"});this.getEl().on("click",function(){this.fireEvent("submit",this.codeMirror.getValue())},this,{preventDefault:true,delegate:"input.submitComment"});this.getEl().on("click",function(c,d){this.fireEvent("subscriptionChange",Ext.get(d).dom.checked)},this,{delegate:"input.subscriptionCheckbox"})},toggleGuide:function(f){var d=this.getEl().down(".commentGuideTxt");d.setVisibilityMode(Ext.dom.Element.DISPLAY);var e=this.getEl().down(".toggleCommentGuide");if(!d.isVisible()||f===true){d.show(true);e.update("Hide help ↑")}else{d.hide(true);e.update("Show help ↓")}},showSubscriptionMessage:function(d){var e=this.getEl().down("input.subscriptionCheckbox");var f=d?"Updates to this thread will be e-mailed to you":"You have unsubscribed from this thread";Docs.Tip.show(f,e,"bottom")}});Ext.define("Docs.view.comments.DragZone",{extend:"Ext.dd.DragZone",constructor:function(d,c){this.view=d;this.callParent([d.getEl(),c])},getDragData:function(f){var d=f.getTarget("img.drag-handle",10);if(d){var e=Ext.fly(d).up(this.view.itemSelector).dom;return{sourceEl:e,repairXY:Ext.fly(e).getXY(),ddel:this.cloneCommentEl(e),comment:this.view.getRecord(e)}}return false},cloneCommentEl:function(e){var f=e.cloneNode(true);var d=Ext.fly(f).down(".comments-list-with-form");d&&d.remove();f.id=Ext.id();return f},getRepairXY:function(){return this.dragData.repairXY}});Ext.define("Docs.view.comments.DropZone",{extend:"Ext.dd.DropZone",constructor:function(d,c){this.view=d;this.callParent([d.getEl(),c])},getTargetFromEvent:function(b){return b.getTarget(this.view.itemSelector,10)},onNodeEnter:function(g,f,h,e){if(this.isValidDropTarget(g,e)){Ext.fly(g).addCls("drop-target-hover")}},onNodeOut:function(g,f,h,e){Ext.fly(g).removeCls("drop-target-hover")},onNodeOver:function(g,f,h,e){if(this.isValidDropTarget(g,e)){return this.dropAllowed}else{return false}},isValidDropTarget:function(d,e){var f=this.view.getRecord(d);return f&&f.get("id")!==e.comment.get("id")},onNodeDrop:function(g,f,h,e){if(this.isValidDropTarget(g,e)){this.onValidDrop(e.comment,this.view.getRecord(g));return true}return false},onValidDrop:Ext.emptyFn});Ext.define("Docs.view.comments.TopLevelDropZone",{extend:"Ext.dd.DropZone",getTargetFromEvent:function(b){return b.getTarget("a.side.toggleComments",10)},onNodeEnter:function(g,f,h,e){if(this.isValidDropTarget(e)){Ext.fly(g).addCls("drop-target-hover")}},onNodeOut:function(g,f,h,e){Ext.fly(g).removeCls("drop-target-hover")},onNodeOver:function(g,f,h,e){if(this.isValidDropTarget(e)){return this.dropAllowed}else{return false}},isValidDropTarget:function(b){return !!b.comment.get("parentId")},onNodeDrop:function(g,f,h,e){if(this.isValidDropTarget(e)){this.onValidDrop(e.comment,undefined);return true}return false},onValidDrop:Ext.emptyFn});Ext.define("Docs.Comments",{extend:"Ext.util.Observable",singleton:true,requires:["Docs.Auth","Docs.CommentCounts","Docs.CommentSubscriptions","Ext.data.JsonP","Ext.Ajax"],init:function(c,d){if(!(Docs.data.commentsUrl&&Docs.data.commentsDomain&&this.isBrowserSupported())){c.call(d);return}Docs.Auth.init(function(a){if(a){this.enabled=true;this.fetchCountsAndSubscriptions(function(f,b){this.counts=new Docs.CommentCounts(f);this.subscriptions=new Docs.CommentSubscriptions(b);c.call(d)},this)}else{c.call(d)}},this)},isBrowserSupported:function(){return("withCredentials" in new XMLHttpRequest())||(Ext.ieVersion>=8)},fetchCountsAndSubscriptions:function(c,d){this.request("jsonp",{url:"/comments_meta",method:"GET",success:function(a){c.call(d,a.comments,a.subscriptions)},scope:this})},loadSubscriptions:function(c,d){this.fetchSubscriptions(function(a){this.subscriptions=new Docs.CommentSubscriptions(a);c.call(d)},this)},clearSubscriptions:function(){this.subscriptions=new Docs.CommentSubscriptions([])},fetchSubscriptions:function(c,d){this.request("jsonp",{url:"/subscriptions",method:"GET",success:function(a){c.call(d,a.subscriptions)},scope:this})},isEnabled:function(){return this.enabled},getCount:function(b){return this.enabled?this.counts.get(b):0},changeCount:function(f,e){var d=this.counts.change(f,e);this.fireEvent("countChange",f,d)},hasSubscription:function(b){return this.subscriptions.has(b)},getClassTotalCount:function(b){return this.counts.getClassTotal(b)},load:function(d,f,e){this.request("jsonp",{url:"/comments",method:"GET",params:{startkey:Ext.JSON.encode(d)},success:f,scope:e})},loadReplies:function(f,d,e){this.request("jsonp",{url:"/replies",method:"GET",params:{parentId:f},success:d,scope:e})},post:function(b){this.request("ajax",{url:"/comments",method:"POST",params:{target:Ext.JSON.encode(b.target),parentId:b.parentId,comment:b.content,url:this.buildPostUrl(b.target)},callback:function(h,f,a){var g=Ext.JSON.decode(a.responseText);if(f&&g.success){this.changeCount(b.target,+1);b.callback&&b.callback.call(b.scope,g.comment)}},scope:this})},buildPostUrl:function(i){var f=i[0];var g=i[1];var h=i[2];if(f=="video"){var j="#!/video/"+g}else{if(f=="guide"){var j="#!/guide/"+g}else{var j="#!/api/"+g+(h?"-"+h:"")}}return"http://"+window.location.host+window.location.pathname+j},subscribe:function(h,e,g,f){this.request("ajax",{url:"/subscribe",method:"POST",params:{target:Ext.JSON.encode(h),subscribed:e},callback:function(c,a,d){var b=Ext.JSON.decode(d.responseText);if(a&&b.success){this.subscriptions.set(h,e);g&&g.call(f)}},scope:this})},request:function(c,d){d.url=this.buildRequestUrl(d.url);if(c==="jsonp"){Ext.data.JsonP.request(d)}else{d.cors=true;Ext.Ajax.request(d)}},buildRequestUrl:function(b){b=Docs.data.commentsUrl+"/"+Docs.data.commentsDomain+b;return b+(b.match(/\?/)?"&":"?")+"sid="+Docs.Auth.getSid()},avatar:function(c,d){return'<img class="avatar '+(d||"")+'" width="25" height="25" src="http://www.gravatar.com/avatar/'+c+'?s=25&r=PG&d=identicon">'},counterHtml:function(b){return b>0?'<span class="comment-counter-small">'+b+"</span>":""}});Ext.define("Docs.controller.Auth",{extend:"Ext.app.Controller",requires:["Docs.Auth","Docs.Comments"],refs:[{ref:"authHeaderForm",selector:"authHeaderForm"}],init:function(){this.control({"authHeaderForm, authForm":{login:this.login,logout:this.logout}});var b=this.getController("Tabs");b.onLaunch=Ext.Function.createSequence(b.onLaunch,this.afterTabsLaunch,this)},afterTabsLaunch:function(){if(Docs.Comments.isEnabled()){if(Docs.Auth.isLoggedIn()){this.setLoggedIn()}else{this.setLoggedOut()}}},login:function(e,g,f,h){Docs.Auth.login({username:g,password:f,remember:h,success:this.setLoggedIn,failure:function(a){e.showMessage(a)},scope:this})},logout:function(b){Docs.Auth.logout(this.setLoggedOut,this)},setLoggedIn:function(){Docs.Comments.loadSubscriptions(function(){this.getAuthHeaderForm().showLoggedIn(Docs.Auth.getUser());this.eachCmp("commentsListWithForm",function(b){b.showCommentingForm()});this.eachCmp("commentsList",function(b){b.refresh()});this.getController("Tabs").showCommentsTab()},this)},setLoggedOut:function(){Docs.Comments.clearSubscriptions();this.getAuthHeaderForm().showLoggedOut();this.eachCmp("commentsListWithForm",function(b){b.showAuthForm()});this.eachCmp("commentsList",function(b){b.refresh()});this.getController("Tabs").hideCommentsTab()},eachCmp:function(e,f,d){Ext.Array.forEach(Ext.ComponentQuery.query(e),f,d)}});Ext.define("Docs.controller.Welcome",{extend:"Docs.controller.Content",baseUrl:"#",refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#welcomeindex"}],init:function(){this.addEvents("loadIndex")},loadIndex:function(){this.fireEvent("loadIndex");Ext.getCmp("treecontainer").hide();this.callParent([true])},isActive:function(){return !!this.getIndex().getTab()}});Ext.define("Docs.controller.Failure",{extend:"Docs.controller.Content",baseUrl:"#",refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#failure"}],show404:function(c){var d=new Ext.XTemplate("<h1>Oops...</h1>","<p>{msg}</p>","<p>Maybe it was renamed to something else?<br> Or maybe your internet connection has failed?<br> ","This would be sad. Hopefully it's just a bug on our side.</p>","<p>Most likely you just followed a broken link inside this very documentation. ","Go and report it to the authors of the docs.</p>","<p>But if you think it's a bug in JSDuck documentation-generator itself, feel free to open ","an issue at the <a href='https://github.com/senchalabs/jsduck/issues'>JSDuck issue tracker</a>.</p>","<p>Sorry for all this :(</p>");Ext.getCmp("failure").update(d.apply({msg:c}));Ext.getCmp("card-panel").layout.setActiveItem("failure")}});Ext.define("Docs.controller.Search",{extend:"Ext.app.Controller",requires:["Docs.ClassRegistry","Docs.GuideSearch","Docs.store.Search","Docs.History"],stores:["Search"],refs:[{ref:"field",selector:"#search-field"}],pageIndex:0,pageSize:10,basicSearchDelay:50,guideSearchDelay:500,dropdownHideDelay:500,init:function(){this.control({"#search-dropdown":{itemclick:function(c,d){this.loadRecord(d)},changePage:function(c,d){this.pageIndex+=d;this.displayResults();this.keepDropdown()},footerClick:function(b){this.keepDropdown()}},"#search-field":{keyup:function(m,l){var j=this.getDropdown();m.setHideTrigger(m.getValue().length===0);if(l.keyCode===Ext.EventObject.ESC||!m.value){j.hide();m.setValue("");return}else{j.show()}var h=j.getSelectionModel();var i=h.getLastSelected();var n=j.store.indexOf(i);var k=j.store.getCount()-1;if(l.keyCode===Ext.EventObject.UP){if(n===undefined){h.select(0)}else{h.select(n===0?k:(n-1))}}else{if(l.keyCode===Ext.EventObject.DOWN){if(n===undefined){h.select(0)}else{h.select(n===k?0:n+1)}}else{if(l.keyCode===Ext.EventObject.ENTER){l.preventDefault();i&&this.loadRecord(i)}else{this.pageIndex=0;clearTimeout(this.searchTimeout);this.searchTimeout=Ext.Function.defer(function(){this.search(m.value)},this.basicSearchDelay,this)}}}},focus:function(b){if(b.value&&this.getDropdown().store.getCount()>0){this.getDropdown().show()}},blur:function(){var b=this.getDropdown();this.hideTimeout=Ext.Function.defer(b.hide,this.dropdownHideDelay,b)}}})},getDropdown:function(){return this.dropdown||(this.dropdown=Ext.getCmp("search-dropdown"))},keepDropdown:function(){clearTimeout(this.hideTimeout);this.getField().focus()},loadRecord:function(b){Docs.History.navigate(b.get("url"));this.getDropdown().hide()},search:function(b){if(b===this.previousTerm){return}this.previousTerm=b;this.basicSearch(b);if(Docs.GuideSearch.isEnabled()){this.guideSearch(b)}},guideSearch:function(b){Docs.GuideSearch.deferredSearch(b,function(a){this.basicSearch(b,a)},this,this.guideSearchDelay)},basicSearch:function(c,d){this.displayResults(Docs.ClassRegistry.search(c,d))},displayResults:function(d){d=d||this.previousResults;if(this.pageIndex<0){this.pageIndex=0}else{if(this.pageIndex>Math.floor(d.length/this.pageSize)){this.pageIndex=Math.floor(d.length/this.pageSize)}}var f=this.pageIndex*this.pageSize;var e=f+this.pageSize;this.getDropdown().setTotal(d.length);this.getDropdown().setStart(f);this.getDropdown().getStore().loadData(d.slice(f,e));this.getDropdown().alignTo("search-field","bl",[-12,-2]);if(d.length>0){this.getDropdown().getSelectionModel().select(0)}this.previousResults=d}});Ext.define("Docs.controller.Classes",{extend:"Docs.controller.Content",baseUrl:"#!/api",title:"API Documentation",requires:["Docs.History","Docs.Syntax","Docs.ClassRegistry"],refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#classindex"},{ref:"header",selector:"classheader"},{ref:"overview",selector:"classoverview"},{ref:"tabPanel",selector:"classtabpanel"},{ref:"tree",selector:"#classtree"},{ref:"favoritesGrid",selector:"#favorites-grid"}],cache:{},init:function(){this.addEvents("showIndex","showClass","showMember");Ext.getBody().addListener("click",function(c,d){this.handleUrlClick(decodeURI(d.href),c)},this,{preventDefault:true,delegate:".docClass"});this.control({classtree:{urlclick:function(d,c){this.handleUrlClick(d,c,this.getTree())}},toolbar:{toggleExpanded:function(b){this.getOverview().setAllMembersExpanded(b)}},classoverview:{afterrender:function(b){b.el.addListener("click",function(i,k){var h=Ext.get(k).up(".member"),l=h.down(".meta .defined-in"),j=l.getAttribute("rel"),a=h.getAttribute("id");if(this.getOverview().isMemberExpanded(a)){this.setExpanded(a,false)}else{this.setExpanded(a,true);this.fireEvent("showMember",j,a)}},this,{preventDefault:true,delegate:".expandable"});b.el.addListener("click",Ext.emptyFn,this,{preventDefault:true,delegate:".not-expandable"})}},treecontainer:{afterrender:function(b){b.el.addListener("dblclick",function(){if(b.getWidth()<30){b.setWidth(b.expandedWidth)}else{b.expandedWidth=b.getWidth();b.setWidth(20)}},this,{delegate:".x-resizable-handle"})}},doctabs:{tabClose:function(b){this.getOverview().eraseScrollContext(b)}}})},setExpanded:function(f,d){var e=this.currentCls;if(!e.expanded){e.expanded={}}this.getOverview().setMemberExpanded(f,d);if(d){e.expanded[f]=d}else{delete e.expanded[f]}},applyExpanded:function(b){Ext.Object.each(b.expanded||{},function(a){Ext.get(a).addCls("open")},this)},handleUrlClick:function(d,f,e){d=Docs.History.cleanUrl(d);if(this.opensNewWindow(f)){window.open(d);e&&e.selectUrl(this.currentCls?"#!/api/"+this.currentCls.name:"")}else{this.loadClass(d)}},loadIndex:function(b){Ext.getCmp("treecontainer").showTree("classtree");this.callParent(arguments);this.fireEvent("showIndex")},loadClass:function(f,i){Ext.getCmp("card-panel").layout.setActiveItem("classcontainer");Ext.getCmp("treecontainer").showTree("classtree");i||Docs.History.push(f);var j=f.match(/^#!\/api\/(.*?)(?:-(.*))?$/);var g=Docs.ClassRegistry.canonicalName(j[1]);var h=j[2];if(this.getOverview()){this.getOverview().setLoading(true)}if(this.cache[g]){this.showClass(this.cache[g],h)}else{this.cache[g]="in-progress";Ext.data.JsonP.request({url:this.getBaseUrl()+"/output/"+g+".js",callbackName:g.replace(/\./g,"_"),success:function(b,a){this.cache[g]=b;this.showClass(b,h)},failure:function(b,a){this.cache[g]=false;this.getOverview().setLoading(false);this.getController("Failure").show404("Class <b>"+Ext.String.htmlEncode(g)+"</b> was not found.")},scope:this})}},showClass:function(e,f){var d=false;if(e==="in-progress"){return}this.getOverview().setLoading(false);this.getViewport().setPageTitle(e.name);if(this.currentCls!==e){this.currentCls=e;this.getHeader().load(e);this.getOverview().load(e);this.applyExpanded(e);d=true}this.currentCls=e;this.getOverview().setScrollContext("#!/api/"+e.name);if(f){this.getOverview().scrollToEl("#"+f);this.fireEvent("showMember",e.name,f)}else{this.getOverview().restoreScrollState()}this.getTree().selectUrl("#!/api/"+e.name);this.fireEvent("showClass",e.name,{reRendered:d})}});Ext.define("Docs.controller.Examples",{extend:"Docs.controller.Content",baseUrl:"#!/example",title:"Examples",refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#exampleindex"},{ref:"tree",selector:"#exampletree"},{ref:"page",selector:"#example"}],init:function(){this.addEvents("showExample");this.control({"#exampletree":{urlclick:function(d,c){this.loadExample(d)}},"exampleindex > thumblist":{urlclick:function(b){this.loadExample(b)}},"touchexamplecontainer, examplecontainer":{afterrender:function(b){b.el.addListener("click",function(d,a){this.openInNewWindow()},this,{delegate:"button.new-window"})}},touchexamplecontainer:{afterrender:function(b){b.el.addListener("click",function(d,a){this.changeDevice("tablet")},this,{delegate:"button.tablet"});b.el.addListener("click",function(d,a){this.changeDevice("phone")},this,{delegate:"button.phone"});b.el.addListener("click",function(d,a){this.changeOrientation("portrait")},this,{delegate:"button.portrait"});b.el.addListener("click",function(d,a){this.changeOrientation("landscape")},this,{delegate:"button.landscape"})}}})},loadIndex:function(){Ext.getCmp("treecontainer").showTree("exampletree");this.callParent()},loadExample:function(d,f){var e=this.getExample(d);if(!e){this.getController("Failure").show404("Example <b>"+Ext.String.htmlEncode(d)+"</b> was not found.");return}this.getViewport().setPageTitle(e.text);if(this.activeUrl!==d){this.getPage().clear();this.activateExampleCard();this.getPage().load(e)}else{this.activateExampleCard()}f||Docs.History.push(d);this.fireEvent("showExample",d);this.getTree().selectUrl(d);this.activeUrl=d},activateExampleCard:function(){Ext.getCmp("card-panel").layout.setActiveItem("example");Ext.getCmp("treecontainer").showTree("exampletree")},getExample:function(b){if(!this.map){this.map={};Ext.Array.forEach(Docs.data.examples,function(a){Ext.Array.forEach(a.items,function(d){this.map["#!/example/"+d.name]=d},this)},this)}return this.map[b]},changeOrientation:function(b){this.getPage().setOrientation(b)},changeDevice:function(b){this.getPage().setDevice(b)},openInNewWindow:function(){window.open(this.getExample(this.activeUrl).url)}});Ext.define("Docs.controller.Videos",{extend:"Docs.controller.Content",baseUrl:"#!/video",title:"Videos",refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#videoindex"},{ref:"tree",selector:"#videotree"}],init:function(){this.addEvents("showVideo");this.control({"#videotree":{urlclick:function(b){this.loadVideo(b)}},"videoindex > thumblist":{urlclick:function(b){this.loadVideo(b)}}})},loadIndex:function(){Ext.getCmp("treecontainer").showTree("videotree");this.callParent()},loadVideo:function(j,h){var f=false;Ext.getCmp("card-panel").layout.setActiveItem("video");Ext.getCmp("treecontainer").showTree("videotree");var g=j.match(/^#!\/video\/(.*)$/)[1];var i=this.getVideo(g);if(!i){this.getController("Failure").show404("Video <b>"+Ext.String.htmlEncode(g)+"</b> was not found.");return}this.getViewport().setPageTitle(i.title);if(this.activeUrl!==j){Ext.getCmp("video").load(i);f=true}h||Docs.History.push(j);this.fireEvent("showVideo",g,{reRendered:f});this.getTree().selectUrl(j);this.activeUrl=j},getVideo:function(b){if(!this.map){this.map={};Ext.Array.forEach(Docs.data.videos,function(a){Ext.Array.forEach(a.items,function(d){this.map[d.name]=d},this)},this)}return this.map[b]}});Ext.define("Docs.controller.Guides",{extend:"Docs.controller.Content",baseUrl:"#!/guide",title:"Guides",refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#guideindex"},{ref:"tree",selector:"#guidetree"},{ref:"guide",selector:"#guide"}],cache:{},init:function(){this.addEvents("showGuide");this.control({"#guidetree":{urlclick:function(d,c){this.handleUrlClick(d,c,this.getTree())}},"guideindex > thumblist":{urlclick:function(b){this.loadGuide(b)}},indexcontainer:{afterrender:function(b){b.el.addListener("click",function(d,a){this.handleUrlClick(a.href,d)},this,{preventDefault:true,delegate:".guide"})}},doctabs:{tabClose:function(b){this.getGuide().eraseScrollContext(b)}}})},handleUrlClick:function(d,f,e){d=d.replace(/.*#!?/,"#!");if(this.opensNewWindow(f)){window.open(d);e&&e.selectUrl(this.activeUrl?this.activeUrl:"")}else{this.loadGuide(d)}},loadIndex:function(){Ext.getCmp("treecontainer").showTree("guidetree");this.callParent()},loadGuide:function(j,h){Ext.getCmp("card-panel").layout.setActiveItem("guide");Ext.getCmp("treecontainer").showTree("guidetree");var g=j.match(/^#!\/guide\/(.*?)(-section-.*)?$/);var f=g[1];var i=g[2];j="#!/guide/"+f;h||Docs.History.push(j);if(this.cache[f]){this.showGuide(this.cache[f],j,f,i)}else{this.cache[f]="in-progress";Ext.data.JsonP.request({url:this.getBaseUrl()+"/guides/"+f+"/README.js",callbackName:f,success:function(a){this.cache[f]=a;this.showGuide(a,j,f,i)},failure:function(b,a){this.cache[f]=false;this.getController("Failure").show404("Guide <b>"+Ext.String.htmlEncode(f)+"</b> was not found.")},scope:this})}},showGuide:function(i,j,f,h){var g=false;if(i==="in-progress"){return}this.getViewport().setPageTitle(i.title);if(this.activeUrl!==j){Ext.getCmp("guide").load({name:f,content:i.guide});g=true}this.activeUrl=j;this.getGuide().setScrollContext(this.activeUrl);if(h){this.getGuide().scrollToEl(f+h)}else{this.getGuide().restoreScrollState()}this.fireEvent("showGuide",f,{reRendered:g});this.getTree().selectUrl(j)}});Ext.define("Docs.controller.CommentCounts",{extend:"Ext.app.Controller",requires:["Docs.Comments"],refs:[{ref:"class",selector:"classoverview"},{ref:"classIndex",selector:"#classindex"},{ref:"guide",selector:"#guide"},{ref:"guideIndex",selector:"#guideindex"},{ref:"video",selector:"#video"},{ref:"videoIndex",selector:"#videoindex"}],init:function(){Docs.Comments.on("countChange",this.updateCounts,this)},updateCounts:function(c,d){this.getClass().updateCommentCounts();this.getClassIndex().updateCommentCounts();this.getGuide().updateCommentCounts();this.getGuideIndex().updateCommentCounts();this.getVideo().updateCommentCounts();this.getVideoIndex().updateCommentCounts()}});Ext.define("Docs.controller.Tests",{extend:"Docs.controller.Content",baseUrl:"#!/tests",refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#testsindex"}],init:function(){this.addEvents("loadIndex");this.control({"#testsgrid":{afterrender:this.loadExamples}})},loadIndex:function(){this.fireEvent("loadIndex");Ext.getCmp("treecontainer").hide();this.callParent([true])},isActive:function(){return !!this.getIndex().getTab()},loadExamples:function(){this.getIndex().disable();Ext.data.JsonP.request({url:this.getBaseUrl()+"/inline-examples.js",callbackName:"__inline_examples__",success:function(b){this.getIndex().addExamples(b);this.getIndex().enable()},scope:this})}});Ext.define("Docs.store.Settings",{extend:"Ext.data.Store",requires:["Docs.model.Setting"],model:"Docs.model.Setting"});Ext.define("Docs.Settings",{extend:"Docs.LocalStore",singleton:true,requires:"Docs.store.Settings",storeName:"Docs.store.Settings",defaults:{show:{"public":true,"protected":false,"private":false,deprecated:false,removed:false,inherited:true,accessor:true},comments:{hideRead:false},showPrivateClasses:false,classTreeLogic:"PackageLogic"},set:function(d,f){var e=this.store.findExact("key",d);if(e>-1){this.store.removeAt(e)}this.store.add({key:d,value:f});this.syncStore()},get:function(c){var d=this.store.findExact("key",c);return d>-1?this.store.getAt(d).get("value"):this.defaults[c]}});Ext.define("Docs.controller.Tabs",{extend:"Ext.app.Controller",requires:["Docs.History","Docs.Settings"],refs:[{ref:"welcomeIndex",selector:"#welcomeindex"},{ref:"classIndex",selector:"#classindex"},{ref:"guideIndex",selector:"#guideindex"},{ref:"videoIndex",selector:"#videoindex"},{ref:"exampleIndex",selector:"#exampleindex"},{ref:"testsIndex",selector:"#testsindex"},{ref:"commentIndex",selector:"#commentindex"},{ref:"classTree",selector:"#classtree"},{ref:"guideTree",selector:"#guidetree"},{ref:"exampleTree",selector:"#exampletree"},{ref:"videoTree",selector:"#videotree"},{ref:"doctabs",selector:"#doctabs"}],init:function(){this.getController("Classes").addListener({showClass:function(b){this.addTabFromTree("#!/api/"+b)},scope:this});this.getController("Guides").addListener({showGuide:function(b){this.addTabFromTree("#!/guide/"+b)},scope:this});this.getController("Examples").addListener({showExample:function(b){this.addTabFromTree(b)},scope:this});this.getController("Videos").addListener({showVideo:function(b){this.addTabFromTree("#!/video/"+b)},scope:this});this.control({"[componentCls=doctabs]":{tabActivate:function(d,c){Docs.History.push(d,c)},scope:this}})},onLaunch:function(){this.getDoctabs().setStaticTabs(Ext.Array.filter([this.getWelcomeIndex().getTab(),this.getClassIndex().getTab(),this.getGuideIndex().getTab(),this.getVideoIndex().getTab(),this.getExampleIndex().getTab(),this.getTestsIndex().getTab()],function(a){return a}));this.commentsTab=this.getCommentIndex().getTab();var b=Docs.Settings.get("tabs");if(b){Ext.Array.forEach(b,function(a){this.addTabFromTree(a,{animate:false})},this)}Docs.History.notifyTabsLoaded()},showCommentsTab:function(){var b=this.getDoctabs().getStaticTabs();this.getDoctabs().setStaticTabs(b.concat(this.commentsTab))},hideCommentsTab:function(){var b=this.getDoctabs().getStaticTabs();this.getDoctabs().setStaticTabs(Ext.Array.remove(b,this.commentsTab))},addTabFromTree:function(h,g){var e=this.getTree(h);var f=e.findRecordByUrl(h);if(f){this.addTab(f,g)}},addTab:function(d,c){c=c||{animate:true,activate:true};this.getDoctabs().addTab({href:d.url,text:d.text,iconCls:d.iconCls},c)},getTree:function(b){if(/#!?\/api/.test(b)){return this.getClassTree()}else{if(/#!?\/guide/.test(b)){return this.getGuideTree()}else{if(/#!?\/video/.test(b)){return this.getVideoTree()}else{if(/#!?\/example/.test(b)){return this.getExampleTree()}else{return this.getClassTree()}}}}}});Ext.define("Docs.controller.Comments",{extend:"Docs.controller.Content",baseUrl:"#!/comment",title:"Comments",requires:["Docs.Settings","Docs.Comments"],refs:[{ref:"viewport",selector:"#viewport"},{ref:"index",selector:"#commentindex"},{ref:"commentsFullList",selector:"commentsFullList"}],recentCommentsSettings:{},init:function(){this.control({commentsFullList:{hideReadChange:function(){this.fetchRecentComments()},sortOrderChange:function(b){this.recentCommentsSettings.sortByScore=(b==="votes");this.fetchRecentComments()}},commentsPager:{loadMore:function(b){this.fetchRecentComments(b)}},commentsUsers:{select:function(b){this.recentCommentsSettings.username=b;this.fetchRecentComments()}},commentsTargets:{select:function(b){this.recentCommentsSettings.targetId=b&&b.get("id");this.fetchRecentComments()}},commentsTags:{select:function(b){this.recentCommentsSettings.tagname=b&&b.get("tagname");this.fetchRecentComments()}}})},loadIndex:function(){this.fireEvent("loadIndex");Ext.getCmp("treecontainer").hide();if(!this.recentComments){this.fetchRecentComments();this.recentComments=true}this.callParent([true])},fetchRecentComments:function(f){var e=Docs.Settings.get("comments");var d={offset:f||0,limit:100,hideRead:e.hideRead?1:undefined,sortByScore:this.recentCommentsSettings.sortByScore?1:undefined,username:this.recentCommentsSettings.username,targetId:this.recentCommentsSettings.targetId,tagname:this.recentCommentsSettings.tagname};this.getCommentsFullList().setMasked(true);Docs.Comments.request("jsonp",{url:"/comments_recent",method:"GET",params:d,success:function(a){this.getCommentsFullList().setMasked(false);var b=f>0;this.getCommentsFullList().load(a,b)},scope:this})}});Ext.define("Docs.view.Tabs",{extend:"Ext.container.Container",alias:"widget.doctabs",id:"doctabs",componentCls:"doctabs",requires:["Docs.History","Docs.ClassRegistry","Docs.view.TabMenu"],minTabWidth:80,maxTabWidth:160,animDuration:150,tabs:[],tabsInBar:[],tabCache:{},staticTabs:[],initComponent:function(){this.addEvents("tabActivate","tabClose");this.tpl=Ext.create("Ext.XTemplate",'<tpl for=".">','<div class="doctab overview {cls}{active}">','<div class="l"></div>','<div class="m">','<tpl if="text">','<a class="tabUrl ov-tab-text" href="{href}">{text}</a>',"<tpl else>",'<a class="tabUrl ov-tab" href="{href}"> </a>',"</tpl>","</div>",'<div class="r"></div>',"</div>","</tpl>",'<div style="float: left; width: 8px"> </div>','<div class="tab-overflow"></div>');this.html=this.tpl.applyTemplate(this.staticTabs);this.tabTpl=Ext.create("Ext.XTemplate",'<div class="doctab','{[values.active ? (" active") : ""]}','" style="','{[values.width ? ("width: " + values.width + "px;") : ""]}','{[values.visible ? "" : "visibility: hidden;"]}">','<div class="l"></div>','<div class="m">','<span class="icn {iconCls}"> </span>','<a class="tabUrl main-tab" href="{href}">{text}</a>',"</div>",'<div class="r"><a class="close" href="#"> </a></div>',"</div>");this.on("afterrender",this.initListeners,this);this.on("resize",this.refresh,this);this.callParent()},initListeners:function(){this.el.on("mouseover",function(c,d){Ext.get(d).addCls("ovr")},this,{delegate:".close"});this.el.on("mouseout",function(c,d){Ext.get(d).removeCls("ovr")},this,{delegate:".close"});this.el.on("click",function(f,d){var e=Ext.get(d).up(".doctab").down(".tabUrl").getAttribute("href");e=Docs.History.cleanUrl(e);this.removeTab(e);this.fireEvent("tabClose",e)},this,{delegate:".close",preventDefault:true});this.el.on("click",function(f,d){if(Ext.fly(f.getTarget()).hasCls("close")){return}var e=Ext.get(d).down(".tabUrl").getAttribute("href");this.fireEvent("tabActivate",e,{navigate:true})},this,{delegate:".doctab"});this.el.on("contextmenu",function(c,d){if(!Ext.get(d).hasCls("overview")){this.createMenu().showBy(d)}},this,{delegate:".doctab",preventDefault:true});this.el.on("click",Ext.emptyFn,this,{delegate:".tabUrl",preventDefault:true});this.el.on("mouseleave",function(){if(this.shouldResize){this.resizeTabs({animate:true})}},this)},setStaticTabs:function(b){this.staticTabs=b;this.refresh()},getStaticTabs:function(b){return this.staticTabs},addTab:function(d,c){d=this.formatTabTexts(d);this.tabCache[d.href]=d;if(!this.hasTab(d.href)){this.tabs.push(d.href);if(this.roomForNewTab()){this.addTabToBar(d,c)}this.addTabToMenu(this.overflowButton.menu,d)}if(c.activate){this.activateTab(d.href)}this.saveTabs()},formatTabTexts:function(c){if(/#!?\/api\//.test(c.href)){var d=c.href.replace(/^.*#!?\/api\//,"");c.text=Docs.ClassRegistry.shortName(d);c.tooltip=d}else{c.tooltip=c.text}return c},removeTab:function(d){if(!this.hasTab(d)){return}this.removeFromArray(this.tabs,d);var e=this.removeFromArray(this.tabsInBar,d);var f=this.tabs[this.tabsInBar.length];if(f){this.tabsInBar.push(f)}if(this.activeTab===d){if(this.tabs.length===0){Docs.App.getController(this.getControllerName(d)).loadIndex()}else{if(e===this.tabs.length){e-=1}this.activateTab(this.tabs[e]);this.fireEvent("tabActivate",this.tabs[e])}}if(this.tabs.length>=this.maxTabsInBar()){this.refresh()}else{this.removeTabFromBar(d)}this.saveTabs()},removeFromArray:function(f,d){var e=Ext.Array.indexOf(f,d);if(e!==-1){Ext.Array.erase(f,e,1)}return e},activateTab:function(d){this.activeTab=d;if(!this.inTabs(d)){this.swapLastTabWith(d)}Ext.Array.each(Ext.query(".doctab a.tabUrl"),function(a){Ext.get(a).up(".doctab").removeCls(["active","highlight"])});var e=Ext.query('.doctab a[href="'+d+'"]')[0];if(e){var f=Ext.get(e).up(".doctab");f.addCls("active")}this.highlightOverviewTab(d)},refresh:function(){var i=this.tpl.applyTemplate(this.staticTabs);var f=this.maxTabsInBar()<this.tabs.length?this.maxTabsInBar():this.tabs.length;this.tabsInBar=this.tabs.slice(0,f);for(var j=0;j<f;j++){var h=this.tabCache[this.tabs[j]];var g=Ext.apply(h,{visible:true,active:this.activeTab===h.href,width:this.tabWidth()});i+=this.tabTpl.applyTemplate(g)}this.el.dom.innerHTML=i;if(this.activeTab&&this.activeTab!==this.tabs[f-1]){this.activateTab(this.activeTab);this.fireEvent("tabActivate",this.activeTab)}this.highlightOverviewTab(this.activeTab);this.createOverflowButton();this.addToolTips()},closeAllTabs:function(){if(this.inTabBar(this.activeTab)){this.tabs=this.tabsInBar=[this.activeTab]}else{this.tabs=this.tabsInBar=[]}this.refresh();this.saveTabs()},tabData:function(){return Ext.Array.map(this.tabs,function(b){return this.tabCache[b]},this)},roomForNewTab:function(){return this.tabsInBar.length<this.maxTabsInBar()},hasTab:function(b){return Ext.Array.contains(this.tabs,b)},addTabToBar:function(e,d){this.tabsInBar.push(e.href);var f=Ext.get(this.tabTpl.append(this.el.dom,e));this.addMainTabTooltip(f,e);if(d.animate&&!Ext.isIE){f.setStyle("width","10px");f.setStyle({visibility:"visible"});f.animate({to:{width:this.tabWidth()}})}else{f.setStyle({visibility:"visible"})}this.resizeTabs(d)},inTabBar:function(b){return Ext.Array.contains(this.tabsInBar,b)},inTabs:function(d){var c=Ext.Array.pluck(this.staticTabs,"href").concat(this.tabsInBar);return Ext.Array.contains(c,d)},removeTabFromBar:function(d){var c=this.getTabEl(d);c.dom.removed=true;if(Ext.isIE){c.remove();this.createOverflowButton()}else{c.animate({to:{top:30},duration:this.animDuration}).animate({to:{width:10},duration:this.animDuration,listeners:{afteranimate:function(){c.remove();this.shouldResize=true;this.createOverflowButton()},scope:this}})}},swapLastTabWith:function(d){var e=this.getTabEl(this.tabsInBar[this.tabsInBar.length-1]);if(e){var f=this.tabTpl.append(document.body,this.tabCache[d]);e.dom.parentNode.replaceChild(f,e.dom);this.tabsInBar[this.tabsInBar.length-1]=d;Ext.get(f).setStyle({visibility:"visible",width:String(this.tabWidth())+"px"});this.addMainTabTooltip(f,this.tabCache[d])}},highlightOverviewTab:function(d){var c=Ext.query(".doctab."+this.getControllerName(d).toLowerCase());if(c&&c[0]){Ext.get(c[0]).addCls("highlight")}},maxTabsInBar:function(){return Math.floor(this.tabBarWidth()/this.minTabWidth)},tabWidth:function(){var b=Math.floor(this.tabBarWidth()/this.tabsInBar.length)+6;if(b>this.maxTabWidth){return this.maxTabWidth}else{if(b<this.minTabWidth){return this.minTabWidth}else{return b}}},tabBarWidth:function(){return this.getWidth()-(this.staticTabs.length*50)-15},resizeTabs:function(b){this.shouldResize=false;Ext.Array.each(Ext.query(".doctab"),function(a){var d=Ext.get(a);if(!d.dom.removed&&!d.hasCls("overview")){if(b&&b.animate&&!Ext.isIE){d.animate({to:{width:this.tabWidth()}})}else{d.setWidth(this.tabWidth())}}},this)},getTabEl:function(c){var d=Ext.query('.doctab a[href="'+c+'"]');if(d&&d[0]){return Ext.get(d[0]).up(".doctab")}},createOverflowButton:function(){if(this.overflowButton){this.overflowButton.destroy()}this.overflowButton=Ext.create("Ext.button.Button",{baseCls:"",renderTo:this.getEl().down(".tab-overflow"),menu:this.createMenu()})},createMenu:function(){var b=new Docs.view.TabMenu({listeners:{closeAllTabs:this.closeAllTabs,tabItemClick:function(a){this.fireEvent("tabActivate",a.href,{navigate:true})},scope:this}});Ext.Array.each(this.tabs,function(a){this.addTabToMenu(b,this.tabCache[a])},this);return b},addTabToMenu:function(g,h){var f=Ext.Array.indexOf(this.tabs,h.href);if(this.tabs.length>this.tabsInBar.length&&f===this.maxTabsInBar()){g.addTabCls(h,"overflow")}var e=this.inTabBar(h.href);g.addTab(h,e?"":"overflow")},addToolTips:function(){Ext.Array.each(this.staticTabs,function(c){var d=Ext.get(Ext.query(".doctab."+c.cls)[0]);if(d){Ext.create("Ext.tip.ToolTip",{target:d,html:c.tooltip})}});Ext.Array.each(this.tabsInBar,function(e){var f=Ext.get(Ext.query('a.main-tab[href="'+e+'"]')[0]);var d=this.tabCache[e];if(f){this.addMainTabTooltip(f.up(".doctab"),d)}},this)},addMainTabTooltip:function(c,d){if(d.tooltip){Ext.create("Ext.tip.ToolTip",{target:c,html:d.tooltip})}},saveTabs:function(){Docs.Settings.set("tabs",this.tabs)},getControllerName:function(b){if(/#!?\/api/.test(b)){return"Classes"}else{if(/#!?\/guide/.test(b)){return"Guides"}else{if(/#!?\/video/.test(b)){return"Videos"}else{if(/#!?\/example/.test(b)){return"Examples"}else{if(/#!?\/tests/.test(b)){return"Tests"}else{if(/#!?\/comment/.test(b)){return"Comments"}else{return"Index"}}}}}}}});Ext.define("Docs.view.welcome.Index",{extend:"Ext.container.Container",alias:"widget.welcomeindex",mixins:["Docs.view.Scrolling"],requires:["Docs.ContentGrabber"],cls:"welcome iScroll",initComponent:function(){this.html=Docs.ContentGrabber.get("welcome-content");this.hasContent=!!this.html;this.callParent(arguments)},getTab:function(){return this.hasContent?{cls:"index",href:"#",tooltip:"Home"}:false}});Ext.define("Docs.view.cls.Index",{extend:"Ext.container.Container",alias:"widget.classindex",requires:["Docs.ContentGrabber","Docs.Comments"],mixins:["Docs.view.Scrolling"],cls:"class-categories iScroll",margin:"15 10",autoScroll:true,initComponent:function(){this.tpl=new Ext.XTemplate('<h1 class="top" style="padding-bottom: 10px">API Documentation</h1>','<tpl if="notice">','<div class="notice">{notice}</div>',"</tpl>","{categories}","{news}");this.data={notice:Docs.data.message||Docs.ContentGrabber.get("notice-text"),categories:Docs.ContentGrabber.get("categories-content"),news:Docs.ContentGrabber.get("news-content")};this.callParent(arguments)},afterRender:function(){this.callParent(arguments);if(!Docs.Comments.isEnabled()){return}this.initComments()},initComments:function(){this.getEl().select("a.docClass").each(function(a){var f=a.getHTML();var e=Docs.Comments.getClassTotalCount(f);if(e){Ext.DomHelper.append(a,Docs.Comments.counterHtml(e))}},this)},updateCommentCounts:function(){if(!this.getEl()){return}this.getEl().select(".comment-counter-small").remove();this.initComments()},getTab:function(){var b=(Docs.data.classes||[]).length>0;return b?{cls:"classes",href:"#!/api",tooltip:"API Documentation"}:false}});Ext.define("Docs.view.examples.TouchContainer",{extend:"Ext.panel.Panel",alias:"widget.touchexamplecontainer",requires:["Docs.view.examples.Device"],layout:"fit",cls:"example-container iScroll",autoScroll:true,bodyPadding:"10 0 5 0",initComponent:function(){this.dockedItems=[{xtype:"container",dock:"top",html:['<h1 class="example-title">Example</h1>','<div class="cls-grouping example-toolbar">','<div class="devices">','<button class="phone selected">Phone</button>','<button class="tablet">Tablet</button>',"</div>",'<span class="separator"> </span>','<div class="orientations">','<button class="landscape selected">Landscape</button>','<button class="portrait">Portrait</button>',"</div>","<div>",'<button class="new-window">Open in new window</button>',"</div>","</div>"].join("")}];this.callParent(arguments)},load:function(b){this.title=b.title+" Example";this.device=Ext.create("Docs.view.examples.Device",{url:b.url,device:b.device||"phone",orientation:b.orientation||"landscape"});this.refresh()},refresh:function(){this.update(this.device.toHtml());this.updateScale();this.updateTitle();this.updateButtons()},setDevice:function(b){this.device.setDevice(b);this.refresh()},setOrientation:function(b){this.device.setOrientation(b);this.refresh()},updateScale:function(){var b=Ext.query("iframe",this.el.dom)[0];if(b){b.onload=Ext.Function.bind(function(){var d=document.createElement("style");var a="html { overflow: hidden }";if(this.device.getDevice()==="tablet"){a+="body { font-size: 79.8% !important; }"}d.innerHTML=a;b.contentWindow.document.body.appendChild(d)},this)}},updateTitle:function(){Ext.get(Ext.query(".example-title")).update(this.title)},updateButtons:function(){Ext.Array.each(Ext.query(".example-toolbar .orientations button"),function(b){Ext.get(b).removeCls("selected")});Ext.get(Ext.query(".example-toolbar .orientations button."+this.device.getOrientation())).addCls("selected");Ext.Array.each(Ext.query(".example-toolbar .devices button"),function(b){Ext.get(b).removeCls("selected")});Ext.get(Ext.query(".example-toolbar .devices button."+this.device.getDevice())).addCls("selected")},clear:function(){this.update("")}});Ext.define("Docs.view.search.Dropdown",{extend:"Ext.view.View",alias:"widget.searchdropdown",requires:["Docs.view.Signature"],floating:true,autoShow:false,autoRender:true,toFrontOnShow:true,focusOnToFront:false,store:"Search",id:"search-dropdown",overItemCls:"x-view-over",trackOver:true,itemSelector:"div.item",singleSelect:true,pageStart:0,pageSize:10,initComponent:function(){this.addEvents("changePage","footerClick");this.tpl=new Ext.XTemplate('<tpl for=".">','<div class="item">','<div class="icon {icon}"></div>','<div class="meta">{[this.getMetaTags(values.meta)]}</div>','<div class="title {[this.getCls(values.meta)]}">{name}</div>','<div class="class">{fullName}</div>',"</div>","</tpl>",'<div class="footer">','<tpl if="this.getTotal()">','<a href="#" class="prev"><</a>','<span class="total">{[this.getStart()+1]}-{[this.getEnd()]} of {[this.getTotal()]}</span>','<a href="#" class="next">></a>',"<tpl else>",'<span class="total">Nothing found</span>',"</tpl>","</div>",{getCls:function(b){return b["private"]?"private":(b.removed?"removed":"")},getMetaTags:function(b){return Docs.view.Signature.render(b)},getTotal:Ext.bind(this.getTotal,this),getStart:Ext.bind(this.getStart,this),getEnd:Ext.bind(this.getEnd,this)});this.on("afterrender",function(){this.el.addListener("click",function(){this.fireEvent("changePage",this,-1)},this,{preventDefault:true,delegate:".prev"});this.el.addListener("click",function(){this.fireEvent("changePage",this,+1)},this,{preventDefault:true,delegate:".next"});this.el.addListener("click",function(){this.fireEvent("footerClick",this)},this,{delegate:".footer"})},this);this.callParent(arguments)},setTotal:function(b){this.total=b},getTotal:function(){return this.total},setStart:function(b){this.pageStart=b},getStart:function(b){return this.pageStart},getEnd:function(c){var d=this.pageStart+this.pageSize;return d>this.total?this.total:d}});Ext.define("Docs.view.search.Container",{extend:"Ext.container.Container",alias:"widget.searchcontainer",requires:"Docs.view.search.Dropdown",initComponent:function(){if(Docs.data.search.length){this.cls="search";this.items=[{xtype:"triggerfield",triggerCls:"reset",emptyText:"Search",width:170,id:"search-field",enableKeyEvents:true,hideTrigger:true,onTriggerClick:function(){this.reset();this.focus();this.setHideTrigger(true);Ext.getCmp("search-dropdown").hide()}},{xtype:"searchdropdown"}]}this.callParent()}});Ext.define("Docs.view.GroupTree",{extend:"Docs.view.DocTree",alias:"widget.grouptree",initComponent:function(){this.root={text:"Root",children:this.buildTree(this.data)};this.callParent()},buildTree:function(b){return Ext.Array.map(b,function(a){if(a.items){return{text:a.title,expanded:true,iconCls:"icon-pkg",children:this.buildTree(a.items)}}else{return this.convert(a)}},this)}});Ext.define("Docs.view.auth.BaseForm",{extend:"Ext.Component",requires:["Docs.Tip","Docs.Auth"],createLoginFormHtml:function(){return['<form class="loginForm">','<input class="username" type="text" name="username" placeholder="Username" />','<input class="password" type="password" name="password" placeholder="Password" />','<label><input type="checkbox" name="remember" /> Remember Me</label>','<input class="submit" type="submit" value="Sign in" />'," or ",'<a class="register" href="'+Docs.Auth.getRegistrationUrl()+'" target="_blank">Register</a>',"</form>"].join("")},bindFormSubmitEvent:function(){this.getEl().down("form").on("submit",this.submitLogin,this,{preventDefault:true})},submitLogin:function(m,h){var n=Ext.get(h);var j=n.down("input[name=username]").getValue();var i=n.down("input[name=password]").getValue();var l=n.down("input[name=remember]");var k=l?!!(l.getAttribute("checked")):false;this.fireEvent("login",this,j,i,k)},showMessage:function(c){var d=this.getEl().down("input[type=submit]");Docs.Tip.show(c,d,"bottom")}});Ext.define("Docs.view.auth.HeaderForm",{extend:"Docs.view.auth.BaseForm",alias:"widget.authHeaderForm",requires:["Docs.Comments"],afterRender:function(){this.callParent(arguments);this.getEl().addListener("click",this.showLoginForm,this,{preventDefault:true,delegate:".login"});this.getEl().addListener("click",function(){this.fireEvent("logout",this)},this,{preventDefault:true,delegate:".logout"})},showLoginForm:function(){this.update(this.createLoginFormHtml());this.bindFormSubmitEvent()},showLoggedIn:function(d){var c=Docs.Comments.avatar(d.emailHash);this.update(c+"<div><span>"+d.userName+'</span> | <a href="#" class="logout">Logout</a></div>')},showLoggedOut:function(){this.update('<a href="#" class="login">Sign in / Register</a>')}});Ext.define("Docs.view.comments.Users",{alias:"widget.commentsUsers",extend:"Ext.panel.Panel",componentCls:"comments-users",requires:["Docs.Comments","Docs.view.SimpleSelectBehavior","Docs.view.comments.FilterField"],layout:"border",initComponent:function(){this.items=[this.tabpanel=Ext.widget("tabpanel",{plain:true,region:"north",height:50,items:[{title:"Votes"},{title:"Comments"}],dockedItems:[{dock:"bottom",items:[{xtype:"commentsFilterField",emptyText:"Filter users by name...",width:320,height:20,listeners:{filter:this.onFilter,scope:this}}]}],listeners:{tabchange:this.onTabChange,scope:this}}),this.list=Ext.widget("dataview",{region:"center",cls:"iScroll users-list",autoScroll:true,store:Ext.create("Ext.data.Store",{fields:["userName","score","emailHash","mod"]}),allowDeselect:true,tpl:["<ul>",'<tpl for=".">',"<li>",'<span class="score">{score}</span>',"{[Docs.Comments.avatar(values.emailHash)]}",'<span class="username <tpl if="mod">moderator</tpl>">{userName}</span>',"</li>","</tpl>","</ul>"],itemSelector:"li"})];new Docs.view.SimpleSelectBehavior(this.list,{select:this.onSelect,deselect:this.onDeselect,scope:this});this.callParent(arguments)},afterRender:function(){this.callParent(arguments);this.fetchUsers("votes")},onTabChange:function(d,c){if(c.title==="Votes"){this.fetchUsers("votes")}else{this.fetchUsers("comments")}},onFilter:function(b){this.list.getSelectionModel().deselectAll();this.list.getStore().clearFilter(true);this.list.getStore().filter({property:"userName",value:b,anyMatch:true})},deselectAll:function(){this.list.getSelectionModel().deselectAll()},onSelect:function(b){this.selectedUser=b;this.fireEvent("select",b.get("userName"))},onDeselect:function(){this.selectedUser=undefined;this.fireEvent("select",undefined)},fetchUsers:function(b){Docs.Comments.request("jsonp",{url:"/users",method:"GET",params:{sortBy:b},success:this.loadUsers,scope:this})},loadUsers:function(c){this.list.getStore().loadData(c.data);if(this.selectedUser){var d=this.list.getStore().findExact("userName",this.selectedUser.get("userName"));this.list.getSelectionModel().select(d,false,true)}}});Ext.define("Docs.view.cls.Header",{extend:"Ext.container.Container",requires:["Docs.view.Signature"],alias:"widget.classheader",cls:"classheader",padding:"10 0 17 0",height:55,initComponent:function(){this.tpl=Ext.create("Ext.XTemplate",'<h1 class="{[this.getClass(values)]}">','<tpl if="Docs.data.source">','<a href="#" class="class-source-link">{name}','<span class="class-source-tip">View source...</span>',"</a>","<tpl else>",'<strong class="class-source-link">{name}</strong>',"</tpl>",'<tpl if="singleton">','<span class="singleton">singleton</span>',"</tpl>","<tpl if=\"values['enum']\">",'<span class="enum">enum of <b>{[values["enum"].type]}</b></span>',"</tpl>","{[this.renderAliases(values.aliases)]}","{[this.renderMetaTags(values.meta)]}","</h1>",'<tpl if="Docs.data.showPrintButton">','<a class="print" href="?print=/api/{name}" target="_blank">Print</a>',"</tpl>",{getClass:function(b){if(b.singleton){return"singleton"}else{if(b.component){return"component"}else{return"class"}}},renderAliases:function(e){var f={widget:"xtype",plugin:"ptype",feature:"ftype"};var d=[];e&&Ext.Object.each(e,function(a,b){d.push((f[a]||a)+": "+b.join(", "))});if(d.length>0){return"<span class='xtype'>"+d.join(", ")+"</span>"}else{return""}},renderMetaTags:function(b){return" "+Docs.view.Signature.render(b,"long")}});if(Docs.data.source){this.on("render",this.initSourceLink,this)}this.callParent()},initSourceLink:function(){this.classLinkEvent("click",function(){var d=this.loadedCls.files;if(d.length===1){window.open("source/"+d[0].href)}else{var c=this.createFileMenu(d);c.showBy(this,undefined,[58,-20])}},this);this.classLinkEvent("mouseover",function(){this.el.down(".class-source-tip").addCls("hover")},this);this.classLinkEvent("mouseout",function(){this.el.down(".class-source-tip").removeCls("hover")},this)},classLinkEvent:function(d,e,f){this.el.on(d,e,f,{preventDefault:true,delegate:"a.class-source-link"})},createFileMenu:function(b){return new Ext.menu.Menu({items:Ext.Array.map(b,function(a){return{text:a.filename,handler:function(){window.open("source/"+a.href)}}},this)})},load:function(b){this.loadedCls=b;this.update(this.tpl.apply(b))}});Ext.override(Ext.dom.Element,{getAttribute:(Ext.isIE6||Ext.isIE7||Ext.isIE8)?function(f,h){var g=this.dom,d;if(h){d=typeof g[h+":"+f];if(d!="undefined"&&d!="unknown"){return g[h+":"+f]||null}return null}if(f==="for"){f="htmlFor"}return g[f]||null}:function(e,d){var f=this.dom;if(d){return f.getAttributeNS(d,e)||f.getAttribute(d+":"+e)}return f.getAttribute(e)||f[e]||null}});Ext.define("Docs.view.ThumbList",{extend:"Ext.view.View",alias:"widget.thumblist",requires:["Docs.Comments"],cls:"thumb-list",itemSelector:"dl",urlField:"url",commentType:"",itemTpl:[],initComponent:function(){this.addEvents("urlclick");Ext.Array.forEach(this.data,function(c,d){c.id="sample-"+d});this.store=Ext.create("Ext.data.JsonStore",{fields:["id","title","items"]});this.store.loadData(this.flattenSubgroups(this.data));this.tpl=new Ext.XTemplate(Ext.Array.flatten(["<div>",'<tpl for=".">','<div><a name="{id}"></a><h2><div>{title}</div></h2>',"<dl>",'<tpl for="items">',this.itemTpl,"</tpl>",'<div style="clear:left"></div></dl></div>',"</tpl>","</div>"]));this.itemTpl=undefined;this.data=undefined;this.on("viewready",function(){this.initHover();if(Docs.Comments.isEnabled()){this.initComments()}},this);this.callParent(arguments)},initHover:function(){this.getEl().on("mouseover",function(c,d){Ext.get(d).addCls("over")},this,{delegate:"dd"});this.getEl().on("mouseout",function(c,d){Ext.get(d).removeCls("over")},this,{delegate:"dd"})},initComments:function(){this.getEl().select("dd").each(function(e){var d=e.getAttributeNS("ext",this.urlField).replace(/^.*\//,"");var f=Docs.Comments.getCount([this.commentType,d,""]);if(f){Ext.DomHelper.append(e.down("p"),Docs.Comments.counterHtml(f))}},this)},updateCommentCounts:function(){if(!this.getEl()){return}this.getEl().select(".comment-counter-small").remove();this.initComments()},flattenSubgroups:function(c){function d(a){if(a.items){return Ext.Array.map(a.items,d)}else{return a}}return Ext.Array.map(c,function(a){return{id:a.id,title:a.title,items:Ext.Array.map(a.items,function(b){if(b.items){var f=Ext.apply({},d(b)[0]);f.title=b.title;return f}else{return b}})}})},onContainerClick:function(c){var d=c.getTarget("h2",3,true);if(d){d.up("div").toggleCls("collapsed")}},onItemClick:function(h,j,l,i){var k=i.getTarget("dd",5,true);if(k&&!i.getTarget("a",2)){var e=k.getAttributeNS("ext",this.urlField);this.fireEvent("urlclick",e)}return this.callParent(arguments)}});Ext.define("Docs.view.guides.Index",{extend:"Ext.container.Container",alias:"widget.guideindex",requires:["Docs.view.ThumbList"],mixins:["Docs.view.Scrolling"],cls:"iScroll",margin:"10 0 0 0",autoScroll:true,initComponent:function(){this.items=[{xtype:"container",html:'<h1 class="eg">Guides</h1>'},Ext.create("Docs.view.ThumbList",{commentType:"guide",itemTpl:['<dd ext:url="#!/guide/{name}"><div class="thumb"><img src="guides/{name}/icon.png"/></div>',"<div><h4>{title}</h4><p>{description}</p></div>","</dd>"],data:Docs.data.guides})];this.callParent(arguments)},getTab:function(){var b=(Docs.data.guides||[]).length>0;return b?{cls:"guides",href:"#!/guide",tooltip:"Guides"}:false},updateCommentCounts:function(){this.down("thumblist").updateCommentCounts()}});Ext.define("Docs.view.videos.Index",{extend:"Ext.container.Container",alias:"widget.videoindex",requires:["Docs.view.ThumbList"],mixins:["Docs.view.Scrolling"],cls:"iScroll",margin:"10 0 0 0",autoScroll:true,initComponent:function(){this.items=[{xtype:"container",html:'<h1 class="eg">Videos</h1>'},Ext.create("Docs.view.ThumbList",{commentType:"video",itemTpl:['<dd ext:url="#!/video/{name}"><div class="thumb"><img src="{thumb}"/></div>',"<div><h4>{title}","</h4><p>{[values.description.substr(0,80)]}...</p></div>","</dd>"],data:Docs.data.videos})];this.callParent(arguments)},getTab:function(){var b=(Docs.data.videos||[]).length>0;return b?{cls:"videos",href:"#!/video",tooltip:"Videos"}:false},updateCommentCounts:function(){this.down("thumblist").updateCommentCounts()}});Ext.define("Docs.view.examples.Index",{extend:"Ext.container.Container",alias:"widget.exampleindex",requires:["Docs.view.ThumbList"],mixins:["Docs.view.Scrolling"],cls:"iScroll",margin:"10 0 0 0",autoScroll:true,initComponent:function(){this.cls+=Docs.data.touchExamplesUi?" touch-examples-ui":"";this.items=[{xtype:"container",html:'<h1 class="eg">Examples</h1>'},Ext.create("Docs.view.ThumbList",{itemTpl:['<dd ext:url="#!/example/{name}">','<div class="thumb"><img src="{icon}"/></div>',"<div><h4>{title}","<tpl if=\"status === 'new'\">",'<span class="new-sample"> (New)</span>',"</tpl>","<tpl if=\"status === 'updated'\">",'<span class="updated-sample"> (Updated)</span>',"</tpl>","<tpl if=\"status === 'experimental'\">",'<span class="new-sample"> (Experimental)</span>',"</tpl>","</h4><p>{description}</p></div>","</dd>"],data:Docs.data.examples})];this.callParent(arguments)},getTab:function(){var b=(Docs.data.examples||[]).length>0;return b?{cls:"examples",href:"#!/example",tooltip:"Examples"}:false}});Ext.define("Docs.view.examples.Inline",{extend:"Ext.Panel",alias:"widget.inlineexample",requires:["Docs.view.examples.InlineEditor","Docs.view.examples.InlinePreview"],componentCls:"inline-example-cmp",layout:"card",border:0,resizable:{transparent:true,handles:"s",constrainTo:false},maxCodeHeight:400,options:{},constructor:function(){this.callParent(arguments);this.addEvents("previewsuccess","previewfailure")},initComponent:function(){this.options=Ext.apply({device:"phone",orientation:"landscape"},this.options);this.items=[this.editor=Ext.create("Docs.view.examples.InlineEditor",{cmpName:"code",value:this.value,listeners:{init:this.updateHeight,change:this.updateHeight,scope:this}}),this.preview=Ext.create("Docs.view.examples.InlinePreview",{cmpName:"preview",options:this.options})];this.relayEvents(this.preview,["previewsuccess","previewfailure"]);if(this.options.preview){this.activeItem=1;if(this.toolbar){this.toolbar.activateButton("preview")}}else{this.activeItem=0;if(this.toolbar){this.toolbar.activateButton("code")}}this.on("afterrender",this.init,this);this.callParent(arguments)},init:function(){var b=this.layout.getActiveItem();if(b.cmpName==="preview"){this.showPreview()}this.updateHeight();if(this.toolbar){this.initToolbarEvents()}},initToolbarEvents:function(){this.toolbar.on("buttonclick",function(b){if(b==="code"){this.showCode()}else{if(b==="preview"){this.showPreview()}else{if(b==="copy"){this.showCode();this.editor.selectAll()}}}},this)},showCode:function(){this.layout.setActiveItem(0);this.updateHeight();if(this.toolbar){this.toolbar.activateButton("code")}},showPreview:function(){this.preview.update(this.editor.getValue());this.layout.setActiveItem(1);this.updateHeight();if(this.toolbar){this.toolbar.activateButton("preview")}},updateHeight:function(){var d=this.preview.getHeight();var e=this.editor.getHeight();var f=30;if(Docs.data.touchExamplesUi&&d>0){this.setHeight(d+f)}else{if(e>0){this.setHeight(Ext.Number.constrain(e+f,0,this.maxCodeHeight))}}}});Ext.define("Docs.view.examples.InlineWrap",{requires:["Docs.view.examples.Inline","Docs.view.examples.InlineToolbar"],constructor:function(c){this.pre=c;var d=this.parseOptions(c.className);this.initToolbar();if(d.preview){this.replacePre(d)}else{this.tb.on("buttonclick",function(a){d.preview=(a==="preview");this.replacePre(d)},this,{single:true})}},parseOptions:function(c){var d={};Ext.Array.forEach(c.split(/ +/),function(a){if(a==="phone"||a==="miniphone"||a==="tablet"){d.device=a}else{if(a==="ladscape"||a==="portrait"){d.orientation=a}else{d[a]=true}}});return d},initToolbar:function(){var b=document.createElement("div");this.pre.parentNode.insertBefore(b,this.pre);this.tb=Ext.create("Docs.view.examples.InlineToolbar",{renderTo:b})},replacePre:function(d){var c=document.createElement("div");this.pre.parentNode.replaceChild(c,this.pre);Ext.create("Docs.view.examples.Inline",{height:200,renderTo:c,value:Ext.String.htmlDecode(Ext.util.Format.stripTags(this.pre.innerHTML)),options:d,toolbar:this.tb})}});Ext.define("Docs.controller.InlineExamples",{extend:"Ext.app.Controller",requires:["Docs.view.examples.InlineWrap"],init:function(){this.control({classoverview:{resize:this.createResizer(".class-overview"),afterload:this.replaceExampleDivs},guidecontainer:{resize:this.createResizer(".guide-container"),afterload:this.replaceExampleDivs}})},createResizer:function(b){return function(){Ext.Array.each(Ext.ComponentQuery.query(b+" .inlineexample"),function(a){if(a.editor&&a.isVisible()){a.doLayout()}})}},replaceExampleDivs:function(){Ext.Array.each(Ext.query(".inline-example"),function(b){Ext.create("Docs.view.examples.InlineWrap",b)},this)}});Ext.define("Docs.view.tests.BatchRunner",{extend:"Ext.container.Container",requires:["Docs.view.examples.Inline"],initComponent:function(){this.addEvents("start","finish","statuschange");this.callParent(arguments)},run:function(b){this.fireEvent("start");this.runNext({pass:0,fail:0,total:b.length,remaining:b})},runNext:function(h){this.fireEvent("statuschange",h);if(!h.remaining||h.remaining.length<1){this.fireEvent("finish");return}var j=h.remaining.shift();var i=j.get("options");i.preview=false;var f="var alert = function(){};\n";var g=Ext.create("Docs.view.examples.Inline",{cls:"doc-test-preview",height:0,value:f+j.get("code"),options:i,listeners:{previewsuccess:function(a){this.onSuccess(j,h)},previewfailure:function(a,b){this.onFailure(j,h,b)},scope:this}});this.removeAll();this.add(g);g.showPreview()},onSuccess:function(d,c){d.set("status","success");d.commit();c.pass++;this.runNext(c)},onFailure:function(e,f,d){e.set("status","failure");e.set("message",d.toString());e.commit();f.fail++;this.runNext(f)}});Ext.define("Docs.view.tests.Index",{extend:"Ext.container.Container",requires:["Docs.model.Test","Docs.view.tests.BatchRunner"],mixins:["Docs.view.Scrolling"],alias:"widget.testsindex",layout:{type:"vbox",align:"stretch",shrinkToFit:true},padding:10,initComponent:function(){this.store=Ext.create("Ext.data.Store",{model:"Docs.model.Test",data:[]});this.grid=Ext.create("Ext.grid.Panel",{itemId:"testsgrid",padding:"5 0 5 0",autoScroll:true,flex:1,store:this.store,selModel:{mode:"MULTI"},columns:[{xtype:"templatecolumn",text:"Name",width:300,tpl:'<a href="{href}">{name}</a>'},{xtype:"templatecolumn",text:"Status",width:80,tpl:'<span class="doc-test-{status}">{status}</span>'},{text:"Message",flex:1,dataIndex:"message"}],listeners:{itemdblclick:function(c,d){this.batchRunner.run([d])},scope:this}});this.batchRunner=Ext.create("Docs.view.tests.BatchRunner",{height:0,listeners:{start:this.disable,finish:this.enable,statuschange:this.updateTestStatus,scope:this}});this.items=[{html:"<h1>Inline examples test page</h1>",height:30},{itemId:"testcontainer",layout:{type:"vbox",align:"stretch",shrinkToFit:true},flex:1,items:[{itemId:"testcontrols",layout:"hbox",items:[{html:"<b>Double-click</b> to run an example, or",margin:"5 5 5 0"},{xtype:"button",itemId:"run-selected-button",text:"Run Selected",margin:5,handler:function(){this.batchRunner.run(this.grid.getSelectionModel().getSelection())},scope:this},{html:"or",margin:5},{xtype:"button",itemId:"run-all-button",text:"Run All Examples",margin:5,handler:function(){this.batchRunner.run(this.store.getRange())},scope:this},{itemId:"testStatus",margin:"5 5 5 15"}]},this.grid]},this.batchRunner];this.callParent(arguments)},getTab:function(){return Docs.data.tests?{cls:"tests",href:"#!/tests",tooltip:"Tests",text:"Tests"}:false},addExamples:function(b){this.store.add(b);this.setStatus(true,this.store.getCount()+" examples loaded.")},updateTestStatus:function(d){var c=d.pass+d.fail;this.setStatus(d.fail===0,c+"/"+d.total+" examples tested, "+d.fail+" failures")},setStatus:function(d,f){var e=d?"doc-test-success":"doc-test-failure";this.down("#testStatus").update('<span class="'+e+'">'+f+"</span>")}});Ext.define("Docs.view.cls.PackageLogic",{extend:"Docs.view.cls.Logic",requires:"Docs.ClassRegistry",create:function(){this.root={children:[],text:"Root"};this.packages={"":this.root};this.privates=[];Ext.Array.forEach(this.classes,this.addClass,this);this.sortTree(this.root);return{root:this.root,privates:this.privates}},sortTree:function(b){b.children.sort(this.compare);Ext.Array.forEach(b.children,this.sortTree,this)},compare:function(g,h){if(g.leaf===h.leaf){var b=g.text.toLowerCase();var a=h.text.toLowerCase();return b>a?1:(b<a?-1:0)}else{return g.leaf?1:-1}},addClass:function(g){if(g["private"]&&!this.showPrivateClasses){this.privates.push(this.classNode(g));return}if(this.packages[g.name]){var f=this.packages[g.name];var i=this.classNode(g);f.iconCls=i.iconCls;f.url=i.url}else{var h=Docs.ClassRegistry.packageName(g.name);var j=this.packages[h]||this.addPackage(h);var i=this.classNode(g);this.addChild(j,i);this.packages[g.name]=i}},addPackage:function(e){var g=Docs.ClassRegistry.packageName(e);var h=this.packages[g]||this.addPackage(g);var f=this.packageNode(e);this.addChild(h,f);this.packages[e]=f;return f},addChild:function(d,c){d.children.push(c);if(d.leaf){d.leaf=false}},classNode:function(b){return{text:Docs.ClassRegistry.shortName(b.name),url:"#!/api/"+b.name,iconCls:b.icon,cls:b["private"]?"private":"",leaf:true,children:[]}},packageNode:function(b){return{text:Docs.ClassRegistry.shortName(b),iconCls:"icon-pkg",leaf:false,children:[]}}});Ext.define("Docs.view.cls.InheritanceLogic",{extend:"Docs.view.cls.Logic",create:function(){this.root={children:[],text:"Root"};this.privates=[];this.subclasses=this.buildLookupTable(this.classes);Ext.Array.forEach(this.classes,this.addClass,this);if(!this.showPrivateClasses){this.stripPrivateClasses(this.root)}this.sortTree(this.root);return{root:this.root,privates:this.privates}},sortTree:function(b){b.children.sort(Ext.bind(this.compare,this));Ext.Array.forEach(b.children,this.sortTree,this)},compare:function(g,h){var b=g.text.toLowerCase();var a=h.text.toLowerCase();return b>a?1:(b<a?-1:0)},buildLookupTable:function(d){var c={};Ext.Array.forEach(d,function(b){var a=b["extends"];if(a&&a!=="Object"){if(!c[a]){c[a]=[]}c[a].push(b)}},this);return c},classNode:function(b){return{text:b.name,url:"#!/api/"+b.name,iconCls:b.icon,cls:b["private"]?"private":""}},addClass:function(e){var d=e["extends"];if(!d||d==="Object"){var f=this.classNode(e);this.root.children.push(f);f.children=this.getSubclasses(e.name);f.leaf=f.children.length===0}},getSubclasses:function(b){if(!this.subclasses[b]){return[]}return Ext.Array.map(this.subclasses[b],function(a){var d=this.classNode(a);d.children=this.getSubclasses(a.name);d.leaf=d.children.length===0;return d},this)},stripPrivateClasses:function(b){b.children=Ext.Array.filter(b.children,function(a){this.stripPrivateClasses(a);if(a.cls==="private"&&a.children.length===0){this.privates.push(a);return false}else{return true}},this)}});Ext.define("Docs.view.cls.Tree",{extend:"Docs.view.DocTree",alias:"widget.classtree",requires:["Docs.view.cls.PackageLogic","Docs.view.cls.InheritanceLogic","Docs.Settings"],initComponent:function(){this.setLogic(Docs.Settings.get("classTreeLogic"),Docs.Settings.get("showPrivateClasses"));this.dockedItems=[{xtype:"container",dock:"bottom",layout:"hbox",items:[{width:34},{xtype:"checkbox",boxLabel:"Show private classes",cls:"cls-private-cb",checked:Docs.Settings.get("showPrivateClasses"),listeners:{change:function(d,c){this.setLogic(Docs.Settings.get("classTreeLogic"),c)},scope:this}}]},{xtype:"container",dock:"bottom",cls:"cls-grouping",html:[this.makeButtonHtml("PackageLogic","By Package"),this.makeButtonHtml("InheritanceLogic","By Inheritance")].join("")}];this.on("afterrender",this.setupButtonClickHandler,this);this.callParent()},makeButtonHtml:function(d,c){return Ext.String.format('<button class="{0} {1}">{2}</button>',d,Docs.Settings.get("classTreeLogic")===d?"selected":"",c)},setupButtonClickHandler:function(){this.el.addListener("click",function(g,h){var f=Ext.get(h),e=Ext.get(Ext.query(".cls-grouping button.selected")[0]);if(e.dom===f.dom){return}e.removeCls("selected");f.addCls("selected");if(f.hasCls("PackageLogic")){this.setLogic("PackageLogic",Docs.Settings.get("showPrivateClasses"))}else{this.setLogic("InheritanceLogic",Docs.Settings.get("showPrivateClasses"))}},this,{delegate:"button"})},setLogic:function(i,f){Docs.Settings.set("classTreeLogic",i);Docs.Settings.set("showPrivateClasses",f);var g=new Docs.view.cls[i]({classes:this.data,showPrivateClasses:f});if(this.root){var h=this.getSelectionModel().getLastSelected();var j=g.create();this.expandLonelyNode(j.root);this.setRootNode(j.root);this.initNodeLinks();h&&this.selectUrl(h.raw.url)}else{var j=g.create();this.root=j.root;this.expandLonelyNode(this.root)}this.privates=j.privates},expandLonelyNode:function(d){var c=Ext.Array.filter(d.children,function(a){return a.children.length>0});if(c.length==1){c[0].expanded=true}},findRecordByUrl:function(b){return this.callParent([b])||this.findPrivateRecordByUrl(b)},findPrivateRecordByUrl:function(e){var f=this.privates;for(var d=0;d<f.length;d++){if(f[d].url===e){return f[d]}}return undefined}});Ext.define("Docs.view.TreeContainer",{extend:"Ext.panel.Panel",alias:"widget.treecontainer",requires:["Docs.view.cls.Tree","Docs.view.GroupTree"],cls:"iScroll",layout:"card",resizable:true,resizeHandles:"e",collapsible:true,hideCollapseTool:true,animCollapse:true,header:false,initComponent:function(){this.items=[{},{xtype:"classtree",id:"classtree",data:Docs.data.classes},{xtype:"grouptree",id:"exampletree",data:Docs.data.examples,convert:function(b){return{leaf:true,text:b.title,url:"#!/example/"+b.name,iconCls:"icon-example"}}},{xtype:"grouptree",id:"guidetree",data:Docs.data.guides,convert:function(b){return{leaf:true,text:b.title,url:"#!/guide/"+b.name,iconCls:"icon-guide"}}},{xtype:"grouptree",id:"videotree",data:Docs.data.videos,convert:function(b){return{leaf:true,text:b.title,url:"#!/video/"+b.name,iconCls:"icon-video"}}}];this.callParent()},showTree:function(b){this.show();this.layout.setActiveItem(b)}});Ext.define("Docs.view.comments.Expander",{alias:"widget.commentsExpander",extend:"Ext.Component",requires:["Docs.Comments","Docs.view.comments.TopLevelDropZone"],uses:["Docs.view.comments.ListWithForm"],componentCls:"comments-expander",initComponent:function(){this.tpl=new Ext.XTemplate('<a href="#" class="side toggleComments"><span></span></a>','<a href="#" class="name toggleComments">',"{[this.renderCount(values.count)]}","</a>",{renderCount:this.renderCount});this.data={count:this.count};this.callParent(arguments)},renderCount:function(b){if(b===1){return"View 1 comment."}else{if(b>1){return"View "+b+" comments."}else{return"No comments. Click to add."}}},afterRender:function(){this.callParent(arguments);this.getEl().select(".toggleComments").each(function(b){b.on("click",this.toggle,this,{preventDefault:true})},this);new Docs.view.comments.TopLevelDropZone(this.getEl().down(".side.toggleComments"),{onValidDrop:Ext.Function.bind(this.setParent,this)})},setParent:function(c,d){c.setParent(d,this.reload,this)},toggle:function(){this.expanded?this.collapse():this.expand()},expand:function(){this.expanded=true;this.getEl().addCls("open");this.getEl().down(".name").setStyle("display","none");if(this.list){this.list.show()}else{this.loadComments()}},collapse:function(){this.expanded=false;this.getEl().removeCls("open");this.getEl().down(".name").setStyle("display","block");if(this.list){this.list.hide()}},loadComments:function(){this.list=new Docs.view.comments.ListWithForm({target:this.target,newCommentTitle:this.newCommentTitle,renderTo:this.getEl(),listeners:{reorder:this.reload,scope:this}});this.reload()},reload:function(){Docs.Comments.load(this.target,function(b){this.list.load(b)},this)},setCount:function(b){this.getEl().down(".name").update(this.renderCount(b))}});Ext.define("Docs.view.comments.LargeExpander",{requires:["Docs.Comments","Docs.view.comments.Expander"],html:['<div class="comments-large-expander">','<h3 class="icon-comment">Comments</h3>',"<div></div>","</div>"].join(""),type:"class",constructor:function(e){Ext.apply(this,e);this.el=Ext.get(e.el);var d=Ext.DomHelper.append(this.el,this.html,true).down("div");var f=[this.type,this.name,""];this.expander=new Docs.view.comments.Expander({count:Docs.Comments.getCount(f),target:f,renderTo:d,onCountUpdated:this.onCountUpdated})},getExpander:function(){return this.expander}});Ext.define("Docs.view.guides.Container",{extend:"Ext.panel.Panel",alias:"widget.guidecontainer",componentCls:"guide-container",mixins:["Docs.view.Scrolling"],requires:["Docs.Comments","Docs.view.comments.LargeExpander"],initComponent:function(){this.addEvents("afterload");this.callParent(arguments)},scrollToEl:function(c){var d=Ext.get(c);if(!d){d=Ext.get(Ext.query("a[name='"+c+"']")[0])}this.scrollToView(d,{highlight:true,offset:-100})},load:function(b){this.guide=b;this.tpl=this.tpl||new Ext.XTemplate(Docs.data.showPrintButton?'<a class="print guide" href="?print=/guide/{name}" target="_blank">Print</a>':"","{content}");this.update(this.tpl.apply(b));Docs.Syntax.highlight(this.getEl());if(Docs.Comments.isEnabled()){this.initComments()}this.fireEvent("afterload")},initComments:function(){this.expander=new Docs.view.comments.LargeExpander({type:"guide",name:this.guide.name,el:this.getEl().down(".x-panel-body")})},updateCommentCounts:function(){if(!this.expander){return}this.expander.getExpander().setCount(Docs.Comments.getCount(["guide",this.guide.name,""]))}});Ext.define("Docs.view.videos.Container",{extend:"Ext.panel.Panel",alias:"widget.videocontainer",componentCls:"video-container",requires:["Docs.Comments","Docs.view.comments.LargeExpander"],initComponent:function(){this.callParent(arguments);this.on("hide",this.pauseVideo,this)},pauseVideo:function(){var b=document.getElementById("video_player");if(b&&b.api_pause){b.api_pause()}},load:function(b){this.video=b;this.tpl=this.tpl||new Ext.XTemplate('<iframe src="http://player.vimeo.com/video/{id}" width="640" height="360" frameborder="0" ',"webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>","<h1>{title}</h1>","<p>{[this.linkify(values.description)]}</p>",{linkify:function(a){return a.replace(/(\bhttps?:\/\/\S+)/ig,"<a href='$1'>$1</a>")}});this.update(this.tpl.apply(b));if(Docs.Comments.isEnabled()){this.initComments()}},initComments:function(){this.expander=new Docs.view.comments.LargeExpander({type:"video",name:this.video.name,el:this.getEl().down(".x-panel-body")})},updateCommentCounts:function(){if(!this.expander){return}this.expander.getExpander().setCount(Docs.Comments.getCount(["video",this.video.name,""]))}});Ext.define("Docs.view.comments.MemberWrap",{extend:"Docs.view.cls.MemberWrap",requires:["Docs.Comments","Docs.view.comments.Expander"],constructor:function(d){this.callParent([d]);var c=Docs.Comments.getCount(this.getTarget());if(c>0){this.updateSignatureCommentCount(c)}},getTarget:function(){if(!this.target){this.target=["class",this.getDefinedIn(),this.getMemberId()]}return this.target},getExpander:function(){if(!this.expander){var b=Ext.DomHelper.append(this.el.down(".long"),"<div></div>");this.expander=new Docs.view.comments.Expander({count:Docs.Comments.getCount(this.getTarget()),target:this.getTarget(),newCommentTitle:this.getNewCommentTitle(),renderTo:b})}return this.expander},setCount:function(b){this.getExpander().setCount(b);this.updateSignatureCommentCount(b)},updateSignatureCommentCount:function(g){var e=this.el.down(".title");var f=e.down(".comment-counter-small");if(g>0){if(f){f.update(""+g)}else{var h=Ext.DomHelper.append(e,Docs.Comments.counterHtml(g),true);h.on("click",function(){this.el.addCls("open");this.getExpander().expand();this.parent.scrollToEl(this.getExpander().getEl())},this)}}else{if(f){f.remove()}}},getNewCommentTitle:function(){if(this.getDefinedIn()!==this.className){return["<b>Be aware.</b> This member is inherited from <b>"+thi
gitextract_tvzw8ahg/
├── .gitignore
├── .jscs.json
├── .jsduck.json
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── LICENSE.txt
├── README.md
├── bower.json
├── demo/
│ └── index.html
├── docs/
│ ├── app-0c945a27f43452df695771ddb60b3d14.js
│ ├── data-2ac7dd15e8c9f3475a3d8a544da392e1.js
│ ├── eg-iframe.html
│ ├── extjs/
│ │ └── ext-all.js
│ ├── index.html
│ ├── output/
│ │ └── MainLoop.js
│ ├── resources/
│ │ ├── css/
│ │ │ └── app-4689d2a5522dcd3c9e9923ca59c33f27.css
│ │ └── prettify/
│ │ ├── prettify.css
│ │ └── prettify.js
│ ├── source/
│ │ └── mainloop.html
│ └── styles-3eba09980fa05ead185cb17d9c0deb0f.css
├── package.json
└── src/
└── mainloop.js
SYMBOL INDEX (222 symbols across 4 files)
FILE: docs/app-0c945a27f43452df695771ddb60b3d14.js
function u (line 1) | function u(aM,aJ){var b1={},bj=u.defaults;for(var az in bj){if(bj.hasOwn...
function c (line 1) | function c(am){if(typeof am=="string"){return v[am]}else{return am}}
function l (line 1) | function l(an,am,ar,ap,ao){function aq(ax){ax=c(ax);var av=ax[an];if(av!...
function Q (line 1) | function Q(an){var am=R[y(an,"keyCode")];return am=="Ctrl"||am=="Alt"||a...
function ar (line 1) | function ar(){an.value=am.getValue()}
function at (line 1) | function at(){ar();an.form.submit=ao;an.form.submit();an.form.submit=at}
function p (line 1) | function p(ap,am){if(am===true){return am}if(ap.copyState){return ap.cop...
function V (line 1) | function V(ao,an,am){return ao.startState?ao.startState(an,am):true}
function b (line 1) | function b(am,an){this.pos=this.start=0;this.string=am;this.tabSize=an||8}
function aq (line 1) | function aq(ar){return am?ar.toLowerCase():ar}
function K (line 1) | function K(ap,ao,an,am){this.from=ap;this.to=ao;this.style=an;this.marke...
function G (line 1) | function G(am){this.from=am;this.to=am;this.line=null}
function e (line 1) | function e(an,am){this.styles=am||[an,null];this.text=an;this.height=1;t...
function aI (line 1) | function aI(aY,aW){if(!aY){return}if(av&&I&&aY.charAt(0)==" "){aY="\u00a...
function ar (line 1) | function ar(aU){if(!aU){return null}return"cm-"+aU.replace(/ +/g," cm-")}
function aO (line 1) | function aO(){var aU;while(aR<aC.length&&((aU=aC[aR]).from==au||aU.from=...
function al (line 1) | function al(at,au,am,av){for(var aq=0,ar=0,an=0;ar<au;aq+=2){var ao=am[a...
function ah (line 1) | function ah(an){this.lines=an;this.parent=null;for(var ao=0,ap=an.length...
function i (line 1) | function i(ap){this.children=ap;var ao=0,am=0;for(var an=0,ar=ap.length;...
function C (line 1) | function C(am,aq){while(!am.lines){for(var an=0;;++an){var ap=am.childre...
function Y (line 1) | function Y(am){if(am.parent==null){return null}var ar=am.parent,aq=q(ar....
function X (line 1) | function X(at,aq){var ao=0;outer:do{for(var ap=0,ar=at.children.length;a...
function g (line 1) | function g(am,at){var ao=0;outer:do{for(var an=0,aq=am.children.length;a...
function k (line 1) | function k(){this.time=0;this.done=[];this.undone=[];this.compound=0;thi...
function J (line 1) | function J(){w(this)}
function O (line 1) | function O(am){if(!am.stop){am.stop=J}return am}
function T (line 1) | function T(am){if(am.preventDefault){am.preventDefault()}else{am.returnV...
function D (line 1) | function D(am){if(am.stopPropagation){am.stopPropagation()}else{am.cance...
function w (line 1) | function w(am){T(am);D(am)}
function j (line 1) | function j(am){return am.target||am.srcElement}
function x (line 1) | function x(am){if(am.which){return am.which}else{if(am.button&1){return ...
function y (line 1) | function y(an,ao){var am=an.override&&an.override.hasOwnProperty(ao);ret...
function r (line 1) | function r(ap,ao,an,am){if(typeof ap.addEventListener=="function"){ap.ad...
function z (line 1) | function z(){this.id=null}
function n (line 1) | function n(an,am,ap){if(am==null){am=an.search(/[^\s\u00a0]/);if(am==-1)...
function t (line 1) | function t(am){if(am.currentStyle){return am.currentStyle}return window....
function ak (line 1) | function ak(an,aw){var ap=an.ownerDocument.body;var av=0,au=0,ar=false;f...
function H (line 1) | function H(am){return am.textContent||am.innerText||am.nodeValue||""}
function a (line 1) | function a(am){if(s){am.selectionStart=0;am.selectionEnd=am.value.length...
function ad (line 1) | function ad(an,am){return an.line==am.line&&an.ch==am.ch}
function Z (line 1) | function Z(an,am){return an.line<am.line||(an.line==am.line&&an.ch<am.ch)}
function aa (line 1) | function aa(am){return{line:am.line,ch:am.ch}}
function P (line 1) | function P(am){ai.textContent=am;return ai.innerHTML}
function W (line 1) | function W(ap,ao){if(!ao){return 0}if(!ap){return ao.length}for(var an=a...
function q (line 1) | function q(ap,am){if(ap.indexOf){return ap.indexOf(am)}for(var an=0,ao=a...
function ag (line 1) | function ag(am){return/\w/.test(am)||am.toUpperCase()!=am.toLowerCase()}
function W (line 1) | function W(Z){return{type:Z,style:"keyword"}}
function R (line 1) | function R(V,U,T){U.tokenize=T;return T(V,U)}
function h (line 1) | function h(W,T){var V=false,U;while((U=W.next())!=null){if(U==T&&!V){ret...
function B (line 1) | function B(V,U,T){S=V;p=T;return U}
function l (line 1) | function l(X,V){var T=X.next();if(T=='"'||T=="'"){return R(X,V,z(T))}els...
function z (line 1) | function z(T){return function(V,U){if(!h(V,T)){U.tokenize=l}return B("st...
function f (line 1) | function f(W,V){var T=false,U;while(U=W.next()){if(U=="/"&&T){V.tokenize...
function t (line 1) | function t(Y,U,T,X,V,W){this.indented=Y;this.column=U;this.type=T;this.p...
function w (line 1) | function w(V,U){for(var T=V.localVars;T;T=T.next){if(T.name==U){return t...
function E (line 1) | function E(X,U,T,W,Y){var Z=X.cc;u.state=X;u.stream=Y;u.marked=null,u.cc...
function a (line 1) | function a(){for(var T=arguments.length-1;T>=0;T--){u.cc.push(arguments[...
function G (line 1) | function G(){a.apply(null,arguments);return true}
function m (line 1) | function m(U){var V=u.state;if(V.context){u.marked="def";for(var T=V.loc...
function s (line 1) | function s(){if(!u.state.context){u.state.localVars=D}u.state.context={p...
function r (line 1) | function r(){u.state.localVars=u.state.context.vars;u.state.context=u.st...
function j (line 1) | function j(U,V){var T=function(){var W=u.state;W.lexical=new t(W.indente...
function F (line 1) | function F(){var T=u.state;if(T.lexical.prev){if(T.lexical.type==")"){T....
function c (line 1) | function c(U){return function T(V){if(V==U){return G()}else{if(U==";"){r...
function y (line 1) | function y(T){if(T=="var"){return G(j("vardef"),J,c(";"),F)}if(T=="keywo...
function x (line 1) | function x(T){if(k.hasOwnProperty(T)){return G(L)}if(T=="function"){retu...
function A (line 1) | function A(T){if(T.match(/[;\}\)\],]/)){return a()}return a(x)}
function L (line 1) | function L(T,U){if(T=="operator"&&/\+\+|--/.test(U)){return G(L)}if(T=="...
function C (line 1) | function C(T){if(T==":"){return G(F,y)}return a(L,c(";"),F)}
function P (line 1) | function P(T){if(T=="variable"){u.marked="property";return G()}}
function o (line 1) | function o(T){if(T=="variable"){u.marked="property"}if(k.hasOwnProperty(...
function O (line 1) | function O(V,T){function U(X){if(X==","){return G(V,U)}if(X==T){return G...
function n (line 1) | function n(T){if(T=="}"){return G()}return a(y,n)}
function J (line 1) | function J(T,U){if(T=="variable"){m(U);return G(H)}return G()}
function H (line 1) | function H(T,U){if(U=="="){return G(x,H)}if(T==","){return G(J)}}
function g (line 1) | function g(T){if(T=="var"){return G(J,e)}if(T==";"){return a(e)}if(T=="v...
function K (line 1) | function K(T,U){if(U=="in"){return G(x)}return G(L,e)}
function e (line 1) | function e(T,U){if(T==";"){return G(d)}if(U=="in"){return G(x)}return G(...
function d (line 1) | function d(T){if(T!=")"){G(x)}}
function i (line 1) | function i(T,U){if(T=="variable"){m(U);return G(i)}if(T=="("){return G(j...
function q (line 1) | function q(T,U){if(T=="variable"){m(U);return G()}}
function o (line 1) | function o(E,D){function B(G){D.tokenize=G;return G(E,D)}var C=E.next();...
function n (line 1) | function n(C,B){var A=C.next();if(A==">"||(A=="/"&&C.eat(">"))){B.tokeni...
function j (line 1) | function j(A){return function(C,B){while(!C.eol()){if(C.next()==A){B.tok...
function w (line 1) | function w(B,A){return function(D,C){while(!D.eol()){if(D.match(A)){C.to...
function z (line 1) | function z(A){return function(D,C){var B;while((B=D.next())!=null){if(B=...
function b (line 1) | function b(){for(var A=arguments.length-1;A>=0;A--){l.cc.push(arguments[...
function e (line 1) | function e(){b.apply(null,arguments);return true}
function i (line 1) | function i(A,C){var B=x.doNotIndent.hasOwnProperty(A)||(l.context&&l.con...
function u (line 1) | function u(){if(l.context){l.context=l.context.prev}}
function d (line 1) | function d(A){if(A=="openTag"){l.tagName=f;return e(m,c(l.startOfLine))}...
function c (line 1) | function c(A){return function(B){if(B=="selfcloseTag"||(B=="endTag"&&x.a...
function s (line 1) | function s(A){return function(B){if(A){h="error"}if(B=="endTag"){u();ret...
function q (line 1) | function q(B){var A;while(true){if(!l.context){return}A=l.context.tagNam...
function m (line 1) | function m(A){if(A=="word"){h="attribute";return e(p,m)}if(A=="endTag"||...
function p (line 1) | function p(A){if(A=="equals"){return e(v,m)}if(!x.allowMissing){h="error...
function v (line 1) | function v(A){if(A=="string"){return e(t)}if(A=="word"&&x.allowUnquoted)...
function t (line 1) | function t(A){if(A=="string"){return e(t)}else{return b()}}
function e (line 1) | function e(I,H,G){H.f=H.inline=G;return G(I,H)}
function r (line 1) | function r(I,H,G){H.f=H.block=G;return G(I,H)}
function o (line 1) | function o(G){G.em=false;G.strong=false;return null}
function l (line 1) | function l(I,H){var G;if(H.indentationDiff>=4){H.indentation-=H.indentat...
function x (line 1) | function x(I,H){var G=i.token(I,H.htmlState);if(G==="tag"&&H.htmlState.t...
function t (line 1) | function t(H){var G=[];if(H.strong){G.push(H.em?w:j)}else{if(H.em){G.pus...
function b (line 1) | function b(H,G){if(H.match(f,true)){return t(G)}return undefined}
function q (line 1) | function q(K,J){var I=J.text(K,J);if(typeof I!=="undefined"){return I}va...
function C (line 1) | function C(I,H){while(!I.eol()){var G=I.next();if(G==="\\"){I.next()}if(...
function h (line 1) | function h(I,H){I.eatSpace();var G=I.next();if(G==="("||G==="["){return ...
function k (line 1) | function k(H,G){if(H.match(/^[^\]]*\]:/,true)){G.f=a;return s}return e(H...
function a (line 1) | function a(H,G){H.eatSpace();H.match(/^[^\s]+/,true);G.f=G.inline=q;retu...
function c (line 1) | function c(G){if(!c[G]){c[G]=new RegExp("^(?:[^\\\\\\"+G+"]|\\\\.)*(?:\\...
function v (line 1) | function v(H,I,G){G=G||q;return function(K,J){K.match(c(I));J.inline=J.f...
function d (line 1) | function d(a){if(a.items){return Ext.Array.map(a.items,d)}else{return a}}
function h (line 1) | function h(J){function G(O){var M=O.charCodeAt(0);if(M!==92){return M}va...
function g (line 1) | function g(C,G){function F(H){var I=H.nodeType;if(I==1){if(!y.test(H.cla...
function t (line 1) | function t(v,C,y,p){C&&(v={a:C,e:v},y(v),p.push.apply(p,v.g))}
function f (line 1) | function f(v){for(var C=void 0,y=v.firstChild;y;y=y.nextSibling){var p=y...
function A (line 1) | function A(y,E){function D(R){for(var K=R.e,J=[K,"pln"],Q=0,L=R.a.match(...
function u (line 1) | function u(v){var D=[],C=[];v.tripleQuotedStrings?D.push(["str",/^(?:'''...
function q (line 1) | function q(J,G,F){function I(M){var P=M.nodeType;if(P==1&&!K.test(M.clas...
function B (line 1) | function B(v,C){for(var y=C.length;--y>=0;){var p=C[y];w.hasOwnProperty(...
function s (line 1) | function s(p,v){if(!p||!w.hasOwnProperty(p)){p=/^\s*</.test(v)?"default-...
function o (line 1) | function o(ad){var aa=ad.h;try{var X=g(ad.c,ad.i),ac=X.a;ad.a=ac;ad.d=X....
function N (line 1) | function N(){for(var v=z.PR_SHOULD_USE_CONTINUATION?R.now()+250:Infinity...
FILE: docs/extjs/ext-all.js
function m (line 38) | function m(z,e){return(e<0)?Math.max(0,z.length+e):Math.min(z.length,e)}
function x (line 38) | function x(G,F,z,J){var K=J?J.length:0,B=G.length,H=m(G,F),E,I,A,e,C,D;i...
function i (line 38) | function i(B,e,A,z){if(z&&z.length){if(e<B.length){B.splice.apply(B,[e,A...
function b (line 38) | function b(A,e,z){return x(A,e,z)}
function r (line 38) | function r(A,e,z){A.splice(e,z);return A}
function l (line 38) | function l(C,e,A){var B=m(C,e),z=C.slice(e,m(C,B+A));if(arguments.length...
function h (line 38) | function h(e){return e.splice.apply(e,o.call(arguments,1))}
function e (line 38) | function e(B){var D,E,C;for(D=0,E=B.length;D<E;D++){C=B[D];if(Ext.isArra...
function b (line 38) | function b(d){var c=Array.prototype.slice.call(arguments,1);return d.rep...
function a (line 38) | function a(i){function h(){return this.constructor.apply(this,arguments)...
function a (line 38) | function a(){function i(){return this.constructor.apply(this,arguments)|...
function i (line 38) | function i(m,l){m.sum+=l;m.min=Math.min(m.min,l);m.max=Math.max(m.max,l)}
function e (line 38) | function e(o){var m=o?o:(b()-this.time),n=this,l=n.accum;++l.count;if(!-...
function a (line 38) | function a(){return{min:Number.MAX_VALUE,max:0,sum:0}}
function j (line 38) | function j(m,l){return function(){var o=m.enter(),n=l.apply(this,argumen...
function k (line 38) | function k(l){return Math.round(l*100)/100}
function g (line 38) | function g(n,m,l,p){var o={avg:0,min:p.min,max:p.max,sum:0};if(n){l=l||0...
function d (line 38) | function d(h,i,j,g){return function(){if(j.target===arguments[0]){h.appl...
function c (line 38) | function c(h,i,j,g){i.task=new Ext.util.DelayedTask();return function(){...
function a (line 38) | function a(h,i,j,g){return function(){var k=new Ext.util.DelayedTask();i...
function e (line 38) | function e(h,i,j,g){return function(){var k=i.ev;if(k.removeListener(i.f...
function c (line 38) | function c(m){var l=(this.methodEvents=this.methodEvents||{})[m],i,h,j,k...
function n (line 38) | function n(p){o.push(i+p)}
function b (line 38) | function b(i,h){var g=(i!="mousemove");return function(m,j){var l=j.getX...
function a (line 38) | function a(h,g){}
function a (line 38) | function a(d,g,e){return g+"-"+e.toLowerCase()}
function h (line 38) | function h(j,k,i){return function(){j.selectionStart=k;j.selectionEnd=i}}
function z (line 38) | function z(H,E,G,D){var F=D[this.name]||"";return t.test(F)?"transparent...
function x (line 38) | function x(J,G,I,F){var D=F.marginRight,E,H;if(D!="0px"){E=J.style;H=E.d...
function w (line 38) | function w(K,H,J,G){var D=G.marginRight,F,E,I;if(D!="0px"){F=K.style;E=q...
function child (line 38) | function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.n...
function next (line 38) | function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}
function prev (line 38) | function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}
function children (line 38) | function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;...
function byClassName (line 38) | function byClassName(nodeSet,cls){cls=unescapeCssSelector(cls);if(!cls){...
function attrValue (line 38) | function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){...
function getNodes (line 38) | function getNodes(ns,mode,tagName){var result=[],ri=-1,cs,i,ni,j,ci,cn,u...
function concat (line 38) | function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.leng...
function byTag (line 38) | function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagN...
function byId (line 38) | function byId(cs,id){id=unescapeCssSelector(id);if(cs.tagName||cs==docum...
function byAttribute (line 38) | function byAttribute(cs,attr,value,op,custom){var result=[],ri=-1,useGet...
function byPseudo (line 38) | function byPseudo(cs,name,value){value=unescapeCssSelector(value);return...
function nodupIEXml (line 38) | function nodupIEXml(cs){var d=++key,r,i,len,c;cs[0].setAttribute("_nodup...
function nodup (line 38) | function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1,...
function quickDiffIEXml (line 38) | function quickDiffIEXml(c1,c2){var d=++key,r=[],i,len;for(i=0,len=c1.len...
function quickDiff (line 38) | function quickDiff(c1,c2){var len1=c1.length,d=++key,r=[],i,len;if(!len1...
function quickId (line 38) | function quickId(ns,mode,root,id){if(ns==root){id=unescapeCssSelector(id...
function garbageCollect (line 38) | function garbageCollect(){if(!Ext.enableGarbageCollector){clearInterval(...
function fn (line 38) | function fn(e){e.stopPropagation();if(preventDefault){e.preventDefault()}}
function c (line 38) | function c(x,v,w,k){if(k[this.styleName]=="none"){return"0px"}return k[t...
function e (line 38) | function e(i,k,l,j){if(l&&d){if(j){j=[a[k]].concat(Ext.functionFactory("...
function fn (line 38) | function fn(m,name,format,args){if(format&&useFormat){args=args?","+args...
function g (line 38) | function g(q){return((a*q+l)*q+j)*q}
function c (line 38) | function c(q,s){var r=e(q,s);return((p*r+k)*r+h)*r}
function e (line 38) | function e(q,y){var w,v,t,r,u,s;for(t=q,s=0;s<8;s++){r=g(t)-q;if(Math.ab...
function d (line 38) | function d(i,h,j,g){i[g?g+j:j]=h[j]}
function c (line 38) | function c(h,g,i){delete h[i]}
function e (line 38) | function e(k,j,l,i){var g=i?i+l:l,h=k[g];if(h||k.hasOwnProperty(g)){a(j,...
function a (line 38) | function a(h,i,g){if(Ext.isDefined(g)){h[i]=g}else{delete h[i]}}
function b (line 38) | function b(h,m,l,i,j){if(m){if(Ext.isArray(i)){var k,g=i.length;for(k=0;...
function d (line 38) | function d(h,j,i){if(Ext.isArray(h)){h={xtype:"toolbar",items:h}}else{if...
function c (line 38) | function c(l){if(!g.isDestroyed){var k=g.el.getRegion().union(i.el.getRe...
function c (line 38) | function c(e){return function(g){d.fireEvent(e,g)}}
function g (line 38) | function g(u){var v=l[u];return(Ext.isArray(v)?v[m]:v)}
function c (line 38) | function c(t){var s=k.findIndex("position",t);return(s<0)?null:k.getAt(s)}
function a (line 38) | function a(r,q){if(!k.isExcluded(q)){if(r<0){m+=r}else{n+=r}}}
function p (line 38) | function p(r,q){if(!k.isExcluded(q)){if(r>l){l=r}if(r<b){b=r}}}
function a (line 38) | function a(i){if(i<0){i+=360}return i%360}
function g (line 38) | function g(i){var k=a(i[0]-c),j=a(i[1]-h);return Math.sqrt(k*k+j*j)}
function a (line 38) | function a(k,j){var i=k.toString(16);if(i.length>j){i=i.substring(i.leng...
function d (line 38) | function d(k,j){var i=Math.random()*(j-k+1);return Math.floor(i)+k}
function b (line 38) | function b(j){if(typeof(j)=="number"){var i=Math.floor(j/c);return{lo:Ma...
function d (line 38) | function d(g){return g[0]*g[0]+g[1]*g[1]}
function b (line 38) | function b(g){var h=Math.sqrt(d(g));g[0]/=h;g[1]/=h}
function a (line 38) | function a(s,t){k.push({tag:"input",type:"hidden",name:s,value:Ext.Strin...
function d (line 38) | function d(h){var i=Ext.layout.component.field.Field.tip,j;if(i&&i.isVis...
function a (line 38) | function a(h){d[e?"mon":"mun"](h,{validitychange:d.checkValidity,dirtych...
function i (line 38) | function i(e,l){var k=d.findField(e);if(k){k.markInvalid(l)}}
function e (line 38) | function e(i,k){var j=d.findField(i);if(j){j.setValue(k);if(d.trackReset...
function a (line 38) | function a(g){var h=g.isFieldLabelable,i=g.isFormField;if(h||i){if(h){c[...
function c (line 38) | function c(){b.add(e);j=true}
function c (line 38) | function c(){++g;b.remove(e)}
function e (line 38) | function e(){d.bulkChange=true;if(c.getCount()>0&&d.doDeselect(d.lastSel...
function a (line 38) | function a(n,i,m){return{itemId:n,cls:e+"btn-icon",iconCls:e+"edit-"+n,e...
function b (line 38) | function b(){for(var k=0,h=arguments.length,j;k<h;k++){j=arguments[k];d[...
function g (line 38) | function g(i){return"<li>"+i+"</li>"}
FILE: docs/resources/prettify/prettify.js
function S (line 2) | function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var...
function T (line 6) | function T(a,d){function g(a){var c=a.nodeType;if(c==1){if(!b.test(a.cla...
function H (line 7) | function H(a,d,g,b){d&&(a={a:d,e:a},g(a),b.push.apply(b,a.g))}
function U (line 7) | function U(a){for(var d=void 0,g=a.firstChild;g;g=g.nextSibling)var b=g....
function C (line 7) | function C(a,d){function g(a){for(var j=a.e,k=[j,"pln"],c=0,i=a.a.match(...
function v (line 9) | function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''...
function J (line 13) | function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.clas...
function p (line 15) | function p(a,d){for(var g=d.length;--g>=0;){var b=d[g];F.hasOwnProperty(...
function I (line 15) | function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*</.test(d)?"default-m...
function K (line 15) | function K(a){var d=a.h;try{var g=T(a.c,a.i),b=g.a;
function g (line 27) | function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity...
FILE: src/mainloop.js
function animate (line 576) | function animate(timestamp) {
Condensed preview — 23 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,006K chars).
[
{
"path": ".gitignore",
"chars": 185,
"preview": "# NPM\nnode_modules/\n\n# Windows\nDesktop.ini\n\n# JetBrains IDEs\n*.iml\n.idea/\n.webstorm/\n\n# OSX\n.DS_Store\n.AppleDouble\n.LSOv"
},
{
"path": ".jscs.json",
"chars": 2792,
"preview": "{\n \"disallowEmptyBlocks\": {\n \"allExcept\": [\"comments\"]\n },\n \"disallowImplicitTypeConversion\": [],\n \"d"
},
{
"path": ".jsduck.json",
"chars": 674,
"preview": "{\n \"--\": [\n \"src\"\n ],\n \"--output\": \"docs\",\n \"--title\": \"MainLoop.js Documentation\",\n \"--warnings\":"
},
{
"path": ".travis.yml",
"chars": 212,
"preview": "---\nlanguage: node_js\nsudo: false\nnode_js:\n - \"5\"\n\ninstall: npm install\n\nbefore_script:\n - npm install -g grunt-cli\n\ns"
},
{
"path": "CONTRIBUTING.md",
"chars": 1763,
"preview": "Thank you for your interest in contributing to this library!\n\n## Using the issue tracker\n\nThe issue tracker on GitHub is"
},
{
"path": "Gruntfile.js",
"chars": 2905,
"preview": "module.exports = function(grunt) {\n var banner = '/**\\n' +\n ' * mainloop.js <%= pkg.version %>-<%= grunt."
},
{
"path": "LICENSE.txt",
"chars": 1072,
"preview": "The MIT License\n\nCopyright (C) 2016 Isaac Sukin\n\nPermission is hereby granted, free of charge, to any person obtaining a"
},
{
"path": "README.md",
"chars": 5938,
"preview": "[](https://travis-ci.org/IceCreamYou/M"
},
{
"path": "bower.json",
"chars": 246,
"preview": "{\n \"name\": \"MainLoop.js\",\n \"version\": \"1.0.4\",\n \"main\": \"build/mainloop.min.js\",\n \"keywords\": [\n \"mai"
},
{
"path": "demo/index.html",
"chars": 7472,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n"
},
{
"path": "docs/app-0c945a27f43452df695771ddb60b3d14.js",
"chars": 224560,
"preview": "var CodeMirror=(function(){function u(aM,aJ){var b1={},bj=u.defaults;for(var az in bj){if(bj.hasOwnProperty(az)){b1[az]="
},
{
"path": "docs/data-2ac7dd15e8c9f3475a3d8a544da392e1.js",
"chars": 4451,
"preview": "Docs = {\"data\":{\"classes\":[{\"name\":\"MainLoop\",\"extends\":null,\"private\":null,\"icon\":\"icon-class\"}],\"guides\":[],\"videos\":["
},
{
"path": "docs/eg-iframe.html",
"chars": 783,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <meta http-equ"
},
{
"path": "docs/extjs/ext-all.js",
"chars": 1291919,
"preview": "/*\nExt JS 4.1 - JavaScript Library\nCopyright (c) 2006-2012, Sencha Inc.\nAll rights reserved.\nlicensing@sencha.com\n\nhttp:"
},
{
"path": "docs/index.html",
"chars": 2126,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <title>MainLoop.js Documentation</title>\n <meta http-equiv=\"Content-Type\" content=\"text"
},
{
"path": "docs/output/MainLoop.js",
"chars": 34973,
"preview": "Ext.data.JsonP.MainLoop({\"tagname\":\"class\",\"name\":\"MainLoop\",\"autodetected\":{},\"files\":[{\"filename\":\"mainloop.js\",\"href\""
},
{
"path": "docs/resources/css/app-4689d2a5522dcd3c9e9923ca59c33f27.css",
"chars": 288491,
"preview": "html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin"
},
{
"path": "docs/resources/prettify/prettify.css",
"chars": 675,
"preview": ".pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,"
},
{
"path": "docs/resources/prettify/prettify.js",
"chars": 14551,
"preview": "!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;\n(function(){function S(a){function d(e){var b=e.charCodeAt("
},
{
"path": "docs/source/mainloop.html",
"chars": 37778,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <title>The sourc"
},
{
"path": "docs/styles-3eba09980fa05ead185cb17d9c0deb0f.css",
"chars": 5655,
"preview": ".signature .chainable { background-color: #00aa00 }\n .signature .deprecated {\n background-color: #aa0000"
},
{
"path": "package.json",
"chars": 991,
"preview": "{\n \"name\": \"mainloop.js\",\n \"version\": \"1.0.4\",\n \"description\": \"A well-constructed JavaScript main loop useful "
},
{
"path": "src/mainloop.js",
"chars": 36149,
"preview": "/*\n * A main loop useful for games and other animated applications.\n */\n(function(root) {\n\n // The amount of time (in"
}
]
About this extraction
This page contains the full source code of the IceCreamYou/MainLoop.js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 23 files (1.9 MB), approximately 594.7k tokens, and a symbol index with 222 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.