├── .gitattributes ├── .yo-rc.json ├── .bowerrc ├── app ├── robots.txt ├── favicon.ico ├── apple-touch-icon.png ├── templates │ └── description.html ├── scripts │ ├── main.js │ └── render.js ├── lib │ ├── json.js │ ├── text.js │ ├── lettuce.js │ ├── jquery.tooltipster.min.js │ └── jquery-2.1.3.js ├── data │ └── data.json └── styles │ └── main.css ├── screenshot.jpg ├── .gitignore ├── bower.json ├── test ├── spec │ └── test.js └── index.html ├── index.html ├── .editorconfig ├── package.json ├── README.md └── gulpfile.babel.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-mocha": {} 3 | } -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /app/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | Disallow: 5 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/techstack/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/techstack/HEAD/screenshot.jpg -------------------------------------------------------------------------------- /app/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/techstack/HEAD/app/apple-touch-icon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .tmp 4 | .sass-cache 5 | bower_components 6 | test/bower_components 7 | .idea/ 8 | -------------------------------------------------------------------------------- /app/templates/description.html: -------------------------------------------------------------------------------- 1 |
2 |

{%=o.name%}

3 |

{%=o.description%}

4 |
5 | 6 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "techstack", 3 | "private": true, 4 | "dependencies": { 5 | "jquery": "~2.1.1", 6 | "modernizr": "~2.8.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/spec/test.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict'; 3 | 4 | describe('Give it some context', function () { 5 | describe('maybe a bit more context here', function () { 6 | it('should run here few assertions', function () { 7 | 8 | }); 9 | }); 10 | }); 11 | })(); 12 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Tech Stack 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # we recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | 23 | [{package,bower}.json] 24 | indent_style = space 25 | indent_size = 2 26 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mocha Spec Runner 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "engines": { 4 | "node": ">=0.12.0" 5 | }, 6 | "devDependencies": { 7 | "babel-core": "^5.5.6", 8 | "browser-sync": "^2.2.1", 9 | "del": "^1.1.1", 10 | "gulp": "^3.9.0", 11 | "gulp-autoprefixer": "^2.3.1", 12 | "gulp-cache": "^0.2.8", 13 | "gulp-eslint": "^0.13.2", 14 | "gulp-if": "^1.2.5", 15 | "gulp-imagemin": "^2.2.1", 16 | "gulp-load-plugins": "^0.10.0", 17 | "gulp-minify-css": "^1.1.1", 18 | "gulp-minify-html": "^1.0.0", 19 | "gulp-size": "^1.2.1", 20 | "gulp-sourcemaps": "^1.5.0", 21 | "gulp-uglify": "^1.1.0", 22 | "gulp-useref": "^1.1.1", 23 | "main-bower-files": "^2.5.0", 24 | "opn": "^1.0.1", 25 | "wiredep": "^2.2.2" 26 | }, 27 | "eslintConfig": { 28 | "env": { 29 | "node": true, 30 | "browser": true 31 | }, 32 | "rules": { 33 | "quotes": [ 34 | 2, 35 | "single" 36 | ] 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/scripts/main.js: -------------------------------------------------------------------------------- 1 | require.config({ 2 | baseUrl: 'app', 3 | paths: { 4 | jquery: 'lib/jquery-2.1.3', 5 | json: 'lib/json', 6 | d3: 'lib/d3.min', 7 | lettuce: 'lib/lettuce', 8 | text: 'lib/text', 9 | 'jquery.tooltipster': 'lib/jquery.tooltipster.min' 10 | }, 11 | 'shim': { 12 | 'jquery.tooltipster': { 13 | deps: ['jquery'] 14 | } 15 | } 16 | }); 17 | 18 | require(['scripts/render', 'json!data/data.json', 'jquery'], function (render, data, $) { 19 | function parse(data) { 20 | var results = []; 21 | for (var quadrant in data) { 22 | var convertFractions = function (trend) { 23 | return 1 - (trend - 1) / 5 24 | }; 25 | 26 | function entry(quadrant, position, direction) { 27 | var randArray = [0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95]; 28 | var angle = randArray[Math.floor(Math.random() * randArray.length)]; 29 | return { 30 | quadrant: quadrant, 31 | // position is within the total of horizons. 32 | position: position, 33 | // angles are fractions of pi/2 (ie of a quadrant) 34 | position_angle: angle, 35 | // the learning end point with the total of horizons. 36 | direction: direction, 37 | // angles are fractions of pi/2 (ie of a quadrant) 38 | direction_angle: angle 39 | }; 40 | } 41 | 42 | $.each(data[quadrant], function (index, skill) { 43 | results.push({ 44 | name: skill.name, 45 | important: skill.important, 46 | usage: skill.usage, 47 | description: skill.description, 48 | trend: entry(quadrant, convertFractions(skill.current), convertFractions(skill.future)) 49 | }); 50 | }) 51 | } 52 | return results; 53 | } 54 | 55 | render.renderPage('#radar', { 56 | horizons: ['discover', 'assess', 'learn', 'use'], 57 | quadrants: ['languages', 'frameworks', 'tools', 'others'], 58 | height: 768, 59 | width: 768, 60 | data: parse(data) 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 项目技术栈趋势图 2 | 3 | 在线预览: [http://phodal.github.io/techstack](http://phodal.github.io/techstack) 4 | 5 | 最后的效果如下图: 6 | 7 | ![Screenshot](screenshot.jpg) 8 | 9 | ## 文档 || 笔记 10 | 11 | 出于一些原因,我需要构建一个项目组相关的技术趋势图。首先也是想到了[ThoughtWorks 技术雷达](https://www.thoughtworks.com/cn/radar),然而我也发现了技术雷达只会发现一些新出现的技术,以及其对应的一些趋势。对于现有的技术栈的一些趋势不够明显,接着就只能去构建一个新的技术趋势图。 12 | 13 | 当然首选的框架也是D3.js,似乎会一些更好的工具,但是并不没有去尝试。 14 | 15 | ### Schema与原始代码 16 | 17 | 最开始的代码是基于[https://github.com/simonellistonball/techradar](https://github.com/simonellistonball/techradar)这个库的,但是这其中的数据都是写好的。而在找到这个库之前,我也定义好了我的数据应该有的样子: 18 | 19 | ```javascript 20 | { 21 | "name": "Java", 22 | "important": 5, 23 | "usage": 5, 24 | "current": 4, 25 | "future": 3, 26 | "description": "--------" 27 | } 28 | ``` 29 | 30 | 对就于每个技术栈都会有名字、重要程度、使用程度、当前级别、未来级别、描述的字段。毕竟技术是有其应该有的趋势的,如果仅仅只是在上面用一些图形来表示可能又不够。 31 | 32 | 接着,又按照不同的维度区分为language、others、tools、frameworks四个维度 33 | 34 | ```javascript 35 | { 36 | "language": [ 37 | { 38 | "name": "Java", 39 | "important": 5, 40 | "usage": 5, 41 | "current": 4, 42 | "future": 3, 43 | "description": "--------" 44 | } 45 | ], 46 | "tools": [ 47 | { 48 | "name": "Linux", 49 | "important": 3, 50 | "usage": 3, 51 | "current": 3, 52 | "future": 2, 53 | "description": "--------" 54 | } 55 | ], 56 | "others": [ 57 | { 58 | "name": "Agile", 59 | "important": 3, 60 | "usage": 5, 61 | "current": 3, 62 | "future": 3, 63 | "description": "--------" 64 | } 65 | ], 66 | "frameworks": [ 67 | { 68 | "name": "Node.js", 69 | "important": 3, 70 | "usage": 5, 71 | "current": 3, 72 | "future": 5, 73 | "description": "--------" 74 | } 75 | ] 76 | } 77 | ``` 78 | 79 | 而在上述的版本中,则有了我想要的箭头,尽管数据不合适,但是还是可以改的。 80 | 81 | ## 处理数据 82 | 83 | 然后,我们的主要精力就是集中在parse上面的数据中,取出每个数据,按照不同的维度去放置技术栈,并进行一些转换。 84 | 85 | ```javascript 86 | var results = []; 87 | for (var quadrant in data) { 88 | $.each(data[quadrant], function (index, skill) { 89 | results.push({ 90 | name: skill.name, 91 | important: skill.important, 92 | usage: skill.usage, 93 | description: skill.description, 94 | trend: entry(quadrant, convertFractions(skill.current), convertFractions(skill.future)) 95 | }); 96 | }) 97 | } 98 | ``` 99 | -------------------------------------------------------------------------------- /app/lib/json.js: -------------------------------------------------------------------------------- 1 | /** @license 2 | * RequireJS plugin for loading JSON files 3 | * - depends on Text plugin and it was HEAVILY "inspired" by it as well. 4 | * Author: Miller Medeiros 5 | * Version: 0.4.0 (2014/04/10) 6 | * Released under the MIT license 7 | */ 8 | define(['text'], function(text){ 9 | 10 | var CACHE_BUST_QUERY_PARAM = 'bust', 11 | CACHE_BUST_FLAG = '!bust', 12 | jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){ 13 | return eval('('+ val +')'); //quick and dirty 14 | }, 15 | buildMap = {}; 16 | 17 | function cacheBust(url){ 18 | url = url.replace(CACHE_BUST_FLAG, ''); 19 | url += (url.indexOf('?') < 0)? '?' : '&'; 20 | return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random()); 21 | } 22 | 23 | //API 24 | return { 25 | 26 | load : function(name, req, onLoad, config) { 27 | if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) { 28 | //avoid inlining cache busted JSON or if inlineJSON:false 29 | //and don't inline files marked as empty! 30 | onLoad(null); 31 | } else { 32 | text.get(req.toUrl(name), function(data){ 33 | var parsed; 34 | if (config.isBuild) { 35 | buildMap[name] = data; 36 | onLoad(data); 37 | } else { 38 | try { 39 | parsed = jsonParse(data); 40 | } catch (e) { 41 | onLoad.error(e); 42 | } 43 | onLoad(parsed); 44 | } 45 | }, 46 | onLoad.error, { 47 | accept: 'application/json' 48 | } 49 | ); 50 | } 51 | }, 52 | 53 | normalize : function (name, normalize) { 54 | // used normalize to avoid caching references to a "cache busted" request 55 | if (name.indexOf(CACHE_BUST_FLAG) !== -1) { 56 | name = cacheBust(name); 57 | } 58 | // resolve any relative paths 59 | return normalize(name); 60 | }, 61 | 62 | //write method based on RequireJS official text plugin by James Burke 63 | //https://github.com/jrburke/requirejs/blob/master/text.js 64 | write : function(pluginName, moduleName, write){ 65 | if(moduleName in buildMap){ 66 | var content = buildMap[moduleName]; 67 | write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n'); 68 | } 69 | } 70 | 71 | }; 72 | }); 73 | -------------------------------------------------------------------------------- /app/data/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": [ 3 | { 4 | "name": "Java", 5 | "important": 5, 6 | "usage": 5, 7 | "current": 4, 8 | "future": 3, 9 | "description": "--------" 10 | }, 11 | { 12 | "name": "JavaScript", 13 | "important": 5, 14 | "usage": 5, 15 | "current": 4, 16 | "future": 5, 17 | "description": "--------" 18 | }, 19 | { 20 | "name": "Scala", 21 | "important": 5, 22 | "usage": 5, 23 | "current": 1, 24 | "future": 3, 25 | "description": "--------" 26 | }, 27 | { 28 | "name": "Ruby", 29 | "important": 2, 30 | "usage": 2, 31 | "current": 3, 32 | "future": 3, 33 | "description": "--------" 34 | }, 35 | { 36 | "name": "Arduino", 37 | "important": 3, 38 | "usage": 3, 39 | "current": 2, 40 | "future": 3, 41 | "description": "--------" 42 | }, 43 | { 44 | "name": "ES6", 45 | "important": 2, 46 | "usage": 2, 47 | "current": 1, 48 | "future": 4, 49 | "description": "--------" 50 | } 51 | ], 52 | "tools": [ 53 | { 54 | "name": "Linux", 55 | "important": 3, 56 | "usage": 3, 57 | "current": 3, 58 | "future": 2, 59 | "description": "--------" 60 | }, 61 | { 62 | "name": "Docker", 63 | "important": 3, 64 | "usage": 1, 65 | "current": 2, 66 | "future": 2, 67 | "description": "--------" 68 | }, 69 | { 70 | "name": "Shell", 71 | "important": 2, 72 | "usage": 5, 73 | "current": 2, 74 | "future": 2, 75 | "description": "--------" 76 | }, 77 | { 78 | "name": "SSH", 79 | "important": 3, 80 | "usage": 2, 81 | "current": 2, 82 | "future": 2, 83 | "description": "--------" 84 | }, 85 | { 86 | "name": "Gradle", 87 | "important": 3, 88 | "usage": 2, 89 | "current": 2, 90 | "future": 2, 91 | "description": "--------" 92 | } 93 | ], 94 | "others": [ 95 | { 96 | "name": "Agile", 97 | "important": 3, 98 | "usage": 5, 99 | "current": 3, 100 | "future": 3, 101 | "description": "--------" 102 | } 103 | ], 104 | "frameworks": [ 105 | { 106 | "name": "Node.js", 107 | "important": 3, 108 | "usage": 5, 109 | "current": 3, 110 | "future": 5, 111 | "description": "--------" 112 | }, 113 | { 114 | "name": "Django", 115 | "important": 4, 116 | "usage": 4, 117 | "current": 4, 118 | "future": 3, 119 | "description": "--------" 120 | }, 121 | { 122 | "name": "React", 123 | "important": 3, 124 | "usage": 5, 125 | "current": 3, 126 | "future": 5, 127 | "description": "--------" 128 | }, 129 | { 130 | "name": "Express", 131 | "important": 2, 132 | "usage": 3, 133 | "current": 1, 134 | "future": 3, 135 | "description": "--------" 136 | } 137 | ] 138 | } 139 | -------------------------------------------------------------------------------- /gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | // generated on 2015-12-22 using generator-gulp-webapp 1.0.3 2 | import gulp from 'gulp'; 3 | import gulpLoadPlugins from 'gulp-load-plugins'; 4 | import browserSync from 'browser-sync'; 5 | import del from 'del'; 6 | import {stream as wiredep} from 'wiredep'; 7 | 8 | const $ = gulpLoadPlugins(); 9 | const reload = browserSync.reload; 10 | 11 | gulp.task('styles', () => { 12 | return gulp.src('app/styles/*.css') 13 | .pipe($.sourcemaps.init()) 14 | .pipe($.autoprefixer({browsers: ['last 1 version']})) 15 | .pipe($.sourcemaps.write()) 16 | .pipe(gulp.dest('.tmp/styles')) 17 | .pipe(reload({stream: true})); 18 | }); 19 | 20 | function lint(files, options) { 21 | return () => { 22 | return gulp.src(files) 23 | .pipe(reload({stream: true, once: true})) 24 | .pipe($.eslint(options)) 25 | .pipe($.eslint.format()) 26 | .pipe($.if(!browserSync.active, $.eslint.failAfterError())); 27 | }; 28 | } 29 | const testLintOptions = { 30 | env: { 31 | mocha: true 32 | } 33 | }; 34 | 35 | gulp.task('lint', lint('app/scripts/**/*.js')); 36 | gulp.task('lint:test', lint('test/spec/**/*.js', testLintOptions)); 37 | 38 | gulp.task('html', ['styles'], () => { 39 | const assets = $.useref.assets({searchPath: ['.tmp', 'app', '.']}); 40 | 41 | return gulp.src('app/*.html') 42 | .pipe(assets) 43 | .pipe($.if('*.js', $.uglify())) 44 | .pipe($.if('*.css', $.minifyCss({compatibility: '*'}))) 45 | .pipe(assets.restore()) 46 | .pipe($.useref()) 47 | .pipe($.if('*.html', $.minifyHtml({conditionals: true, loose: true}))) 48 | .pipe(gulp.dest('dist')); 49 | }); 50 | 51 | gulp.task('images', () => { 52 | return gulp.src('app/images/**/*') 53 | .pipe($.if($.if.isFile, $.cache($.imagemin({ 54 | progressive: true, 55 | interlaced: true, 56 | // don't remove IDs from SVGs, they are often used 57 | // as hooks for embedding and styling 58 | svgoPlugins: [{cleanupIDs: false}] 59 | })) 60 | .on('error', function (err) { 61 | console.log(err); 62 | this.end(); 63 | }))) 64 | .pipe(gulp.dest('dist/images')); 65 | }); 66 | 67 | gulp.task('fonts', () => { 68 | return gulp.src(require('main-bower-files')({ 69 | filter: '**/*.{eot,svg,ttf,woff,woff2}' 70 | }).concat('app/fonts/**/*')) 71 | .pipe(gulp.dest('.tmp/fonts')) 72 | .pipe(gulp.dest('dist/fonts')); 73 | }); 74 | 75 | gulp.task('extras', () => { 76 | return gulp.src([ 77 | 'app/*.*', 78 | '!app/*.html' 79 | ], { 80 | dot: true 81 | }).pipe(gulp.dest('dist')); 82 | }); 83 | 84 | gulp.task('clean', del.bind(null, ['.tmp', 'dist'])); 85 | 86 | gulp.task('serve', ['styles', 'fonts'], () => { 87 | browserSync({ 88 | notify: false, 89 | port: 9000, 90 | server: { 91 | baseDir: ['.tmp', 'app'], 92 | routes: { 93 | '/bower_components': 'bower_components' 94 | } 95 | } 96 | }); 97 | 98 | gulp.watch([ 99 | 'app/*.html', 100 | 'app/scripts/**/*.js', 101 | 'app/images/**/*', 102 | '.tmp/fonts/**/*' 103 | ]).on('change', reload); 104 | 105 | gulp.watch('app/styles/**/*.css', ['styles']); 106 | gulp.watch('app/fonts/**/*', ['fonts']); 107 | gulp.watch('bower.json', ['wiredep', 'fonts']); 108 | }); 109 | 110 | gulp.task('serve:dist', () => { 111 | browserSync({ 112 | notify: false, 113 | port: 9000, 114 | server: { 115 | baseDir: ['dist'] 116 | } 117 | }); 118 | }); 119 | 120 | gulp.task('serve:test', () => { 121 | browserSync({ 122 | notify: false, 123 | port: 9000, 124 | ui: false, 125 | server: { 126 | baseDir: 'test', 127 | routes: { 128 | '/bower_components': 'bower_components' 129 | } 130 | } 131 | }); 132 | 133 | gulp.watch('test/spec/**/*.js').on('change', reload); 134 | gulp.watch('test/spec/**/*.js', ['lint:test']); 135 | }); 136 | 137 | // inject bower components 138 | gulp.task('wiredep', () => { 139 | gulp.src('app/*.html') 140 | .pipe(wiredep({ 141 | ignorePath: /^(\.\.\/)*\.\./ 142 | })) 143 | .pipe(gulp.dest('app')); 144 | }); 145 | 146 | gulp.task('build', ['lint', 'html', 'images', 'fonts', 'extras'], () => { 147 | return gulp.src('dist/**/*').pipe($.size({title: 'build', gzip: true})); 148 | }); 149 | 150 | gulp.task('default', ['clean'], () => { 151 | gulp.start('build'); 152 | }); 153 | -------------------------------------------------------------------------------- /app/scripts/render.js: -------------------------------------------------------------------------------- 1 | define(['d3', 'lettuce', 'text!templates/description.html', 'jquery.tooltipster'], function (d3, Lettuce, description_template) { 2 | 'use strict'; 3 | // Copyright (c) 2014 @simonellistonball 4 | //https://github.com/simonellistonball/techradar 5 | //Apache License 6 | //Version 2.0, January 2004 7 | //http://www.apache.org/licenses/ 8 | // 9 | // TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 10 | function polar_to_cartesian(r, t) { 11 | var x = r * Math.cos(t); 12 | var y = r * Math.sin(t); 13 | return [x, y]; 14 | } 15 | 16 | function identity(i) { 17 | return i; 18 | } 19 | 20 | /** 21 | * Uses d3 to plot the radar 22 | */ 23 | function renderPage(id, data) { 24 | var width = data.width || 768, height = data.height || 768; 25 | var cx = width / 2, cy = height / 2; 26 | var horizonWidth = 0.95 * (width > height ? height : width) / 2; 27 | var quad_angle = 2 * Math.PI / data.quadrants.length; 28 | var color_scale = d3.scale.category10(); 29 | 30 | var svg = d3.select(id).append('svg') 31 | .attr("width", width) 32 | .attr("height", height); 33 | svg.append('marker') 34 | .attr('id', 'arrow') 35 | .attr('orient', "auto") 36 | .attr('markerWidth', '2') 37 | .attr('markerHeight', '4') 38 | .attr('refX', 0.1) 39 | .attr('refY', 2) 40 | .append('path').attr('d', 'M0,0 V4 L2,2 Z'); 41 | 42 | function process_radar_data(data) { 43 | var results = []; 44 | for (var i in data.data) { 45 | var entry = data.data[i]; 46 | var trend = entry.trend; 47 | 48 | var quadrant_delta = 0; 49 | 50 | // figure out which quadrant this is 51 | for (var j = 0, len = data.quadrants.length; j < len; j++) { 52 | if (data.quadrants[j] == trend.quadrant) { 53 | quadrant_delta = quad_angle * j; 54 | } 55 | } 56 | 57 | var theta = (trend.position_angle * quad_angle) + quadrant_delta, 58 | r = trend.position * horizonWidth, 59 | cart = polar_to_cartesian(r, theta); 60 | var blip = { 61 | id: i, 62 | name: entry.name, 63 | quadrant: trend.quadrant, 64 | important: entry.important, 65 | usage: entry.usage, 66 | description: entry.description, 67 | r: r, 68 | theta: theta, 69 | x: cart[0], 70 | y: cart[1] 71 | }; 72 | 73 | if (trend.direction) { 74 | var r2 = trend.direction * horizonWidth, 75 | theta2 = (trend.direction_angle * quad_angle) + quadrant_delta, 76 | vector = polar_to_cartesian(r2, theta2); 77 | 78 | blip.dx = vector[0] - cart[0]; 79 | blip.dy = vector[1] - cart[1]; 80 | } 81 | results.push(blip); 82 | } 83 | return results; 84 | } 85 | 86 | function add_quadrants(base) { 87 | var quadrants = base 88 | .append('g') 89 | .attr('class', 'quadrants'); 90 | 91 | function quadrant_class(d) { 92 | return 'quadrant quadarant-' + d.name.toLowerCase().replace(/ /, '-'); 93 | } 94 | 95 | quadrants.selectAll('line.quadrant') 96 | .data(data.quadrants, identity) 97 | .enter().append('line') 98 | .attr('x1', 0) 99 | .attr('y1', 0) 100 | .attr('x2', function (d, i) { 101 | return (Math.cos(quad_angle * i) * horizonWidth); 102 | }) 103 | .attr('y2', function (d, i) { 104 | return (Math.sin(quad_angle * i) * horizonWidth); 105 | }) 106 | //.attr('class', quadrant_class) 107 | .attr('stroke', function (d, i) { 108 | return color_scale(i); 109 | }); 110 | 111 | var arc_function = d3.svg.arc() 112 | .outerRadius(function (d, i) { 113 | return d.outerRadius * horizonWidth; 114 | }) 115 | .innerRadius(function (d, i) { 116 | return d.innerRadius * horizonWidth; 117 | }) 118 | .startAngle(function (d, i) { 119 | return d.quadrant * quad_angle + Math.PI / 2; 120 | }) 121 | .endAngle(function (d, i) { 122 | return (d.quadrant + 1) * quad_angle + Math.PI / 2; 123 | }); 124 | 125 | var quads = []; 126 | for (var i = 0, ilen = data.quadrants.length; i < ilen; i++) { 127 | for (var j = 0, jlen = data.horizons.length; j < jlen; j++) { 128 | quads.push({ 129 | outerRadius: (j + 1) / jlen, 130 | innerRadius: j / jlen, 131 | quadrant: i, 132 | horizon: j, 133 | name: data.quadrants[i] 134 | }); 135 | } 136 | } 137 | var text_angle = (360 / data.quadrants.length); 138 | 139 | quadrants.selectAll('text.quadrant') 140 | .data(quads.filter(function (d) { 141 | return d.horizon == 0; 142 | })) 143 | .enter() 144 | .append('text') 145 | .attr('class', 'quadrant') 146 | .attr('dx', horizonWidth / data.horizons.length) 147 | .attr('transform', function (d) { 148 | return 'rotate(' + (d.quadrant * text_angle + text_angle ) + ')' 149 | }) 150 | .text(function (d) { 151 | return d.name; 152 | }); 153 | 154 | quadrants.selectAll('path.quadrant') 155 | .data(quads) 156 | .enter() 157 | .append('path') 158 | .attr('d', arc_function) 159 | .attr('fill', function (d, i) { 160 | var rgb = d3.rgb(color_scale(d.quadrant)); 161 | return rgb.brighter(d.horizon / data.horizons.length * 3); 162 | }) 163 | .attr('class', quadrant_class); 164 | } 165 | 166 | function draw_radar() { 167 | var base = svg.append('g') 168 | .attr('transform', "translate(" + cx + "," + cy + ")"); 169 | 170 | add_quadrants(base); 171 | 172 | var blip_data = process_radar_data(data); 173 | blip_data.sort( 174 | function (a, b) { 175 | if (a.quadrant < b.quadrant) 176 | return -1; 177 | if (a.quadrant > b.quadrant) 178 | return 1; 179 | return 0; 180 | }); 181 | 182 | var blips = base.selectAll('.blip') 183 | .data(blip_data) 184 | .enter().append('g') 185 | .attr('class', 'blip') 186 | .attr('id', function (d) { 187 | return 'blip-' + d.id; 188 | }) 189 | .attr('transform', function (d) { 190 | return "translate(" + (d.x) + "," + (d.y) + ")"; 191 | }) 192 | .on('mouseout', function (d) { 193 | var lettuce = new Lettuce(); 194 | var data = { 195 | id: id, 196 | name: d.name, 197 | description: d.description 198 | }; 199 | 200 | var results = lettuce.Template.tmpl(description_template, data); 201 | 202 | $(this).tooltipster({ 203 | content: $(results), 204 | contentAsHTML: true, 205 | position: 'top', 206 | animation: 'grow', 207 | interactive: true 208 | }); 209 | $(this).find('rect').css('fill', '#ecf0f1'); 210 | d3.select(this).select("text.name").style({opacity: '1.0'}); 211 | }); 212 | 213 | blips.append('line') 214 | .attr('class', 'direction') 215 | .attr('x1', 0).attr('y1', 0) 216 | .attr('x2', function (d) { 217 | return d.dx; 218 | }) 219 | .attr('y2', function (d) { 220 | return d.dy; 221 | }); 222 | 223 | blips.append('circle') 224 | .style("fill", function (d) { 225 | var colorTypes = ['white', '#2ECC71', '#2980B9', '#3498DB', '#2C3E50']; 226 | return colorTypes[d.important - 1]; 227 | }) 228 | .attr('r', function (d) { 229 | var usageMap = [5, 7, 9, 11, 13]; 230 | return usageMap[d.usage - 1] + 'px'; 231 | }) 232 | ; 233 | 234 | blips.append("text") 235 | .attr("dy", "20px") 236 | .style("text-anchor", "middle") 237 | .attr('class', 'name') 238 | .text(function (d) { 239 | return d.name; 240 | }); 241 | } 242 | 243 | draw_radar(); 244 | } 245 | 246 | return { 247 | renderPage: renderPage 248 | }; 249 | }); 250 | -------------------------------------------------------------------------------- /app/styles/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #fafafa; 3 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 4 | color: #333; 5 | } 6 | 7 | #radar { 8 | width: 768px !important; 9 | margin: 0 auto; 10 | } 11 | 12 | svg, ul { 13 | float: left; 14 | } 15 | 16 | svg text.name { 17 | font-size: 12px; 18 | } 19 | 20 | svg line.quadrant { 21 | stroke-width: 2px; 22 | } 23 | 24 | svg circle.horizon { 25 | stroke: #999; 26 | stroke-width: 2px; 27 | stroke-opacity: 0; 28 | fill: none; 29 | } 30 | 31 | svg line.direction { 32 | stroke: black; 33 | stroke-width: 2px; 34 | marker-end: url(#arrow); 35 | opacity: 0.3; 36 | } 37 | 38 | svg #arrow { 39 | fill: black; 40 | } 41 | 42 | svg path.quadrant { 43 | fill-opacity: 0.6; 44 | } 45 | 46 | svg text.quadrant { 47 | font-weight: bold; 48 | color: white; 49 | opacity: 0.3; 50 | font-size: 28px; 51 | text-align: right; 52 | } 53 | 54 | 55 | /* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */ 56 | .tooltipster-default { 57 | border-radius: 5px; 58 | border: 2px solid #ecf0f1; 59 | background: #1abc9c; 60 | color: #fff; 61 | } 62 | 63 | /* Use this next selector to style things like font-size and line-height: */ 64 | .tooltipster-default .tooltipster-content { 65 | font-family: Arial, sans-serif; 66 | font-size: 14px; 67 | line-height: 16px; 68 | padding: 8px 10px; 69 | overflow: hidden; 70 | } 71 | 72 | /* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */ 73 | .tooltipster-default .tooltipster-arrow .tooltipster-arrow-border { 74 | /* border-color: ... !important; */ 75 | } 76 | 77 | 78 | /* If you're using the icon option, use this next selector to style them */ 79 | .tooltipster-icon { 80 | cursor: help; 81 | margin-left: 4px; 82 | } 83 | 84 | /* This is the base styling required to make all Tooltipsters work */ 85 | .tooltipster-base { 86 | padding: 0; 87 | font-size: 0; 88 | line-height: 0; 89 | position: absolute; 90 | left: 0; 91 | top: 0; 92 | z-index: 9999999; 93 | pointer-events: none; 94 | width: auto; 95 | overflow: visible; 96 | } 97 | .tooltipster-base .tooltipster-content { 98 | overflow: hidden; 99 | } 100 | 101 | 102 | /* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */ 103 | .tooltipster-arrow { 104 | display: block; 105 | text-align: center; 106 | width: 100%; 107 | height: 100%; 108 | position: absolute; 109 | top: 0; 110 | left: 0; 111 | z-index: -1; 112 | } 113 | .tooltipster-arrow span, .tooltipster-arrow-border { 114 | display: block; 115 | width: 0; 116 | height: 0; 117 | position: absolute; 118 | } 119 | .tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span { 120 | border-left: 8px solid transparent !important; 121 | border-right: 8px solid transparent !important; 122 | border-top: 8px solid; 123 | bottom: -7px; 124 | } 125 | .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border { 126 | border-left: 9px solid transparent !important; 127 | border-right: 9px solid transparent !important; 128 | border-top: 9px solid; 129 | bottom: -7px; 130 | } 131 | 132 | .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span { 133 | border-left: 8px solid transparent !important; 134 | border-right: 8px solid transparent !important; 135 | border-bottom: 8px solid; 136 | top: -7px; 137 | } 138 | .tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border { 139 | border-left: 9px solid transparent !important; 140 | border-right: 9px solid transparent !important; 141 | border-bottom: 9px solid; 142 | top: -7px; 143 | } 144 | .tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border { 145 | left: 0; 146 | right: 0; 147 | margin: 0 auto; 148 | } 149 | .tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span { 150 | left: 6px; 151 | } 152 | .tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border { 153 | left: 5px; 154 | } 155 | .tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span { 156 | right: 6px; 157 | } 158 | .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border { 159 | right: 5px; 160 | } 161 | .tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border { 162 | border-top: 8px solid transparent !important; 163 | border-bottom: 8px solid transparent !important; 164 | border-left: 8px solid; 165 | top: 50%; 166 | margin-top: -7px; 167 | right: -7px; 168 | } 169 | .tooltipster-arrow-left .tooltipster-arrow-border { 170 | border-top: 9px solid transparent !important; 171 | border-bottom: 9px solid transparent !important; 172 | border-left: 9px solid; 173 | margin-top: -8px; 174 | } 175 | .tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border { 176 | border-top: 8px solid transparent !important; 177 | border-bottom: 8px solid transparent !important; 178 | border-right: 8px solid; 179 | top: 50%; 180 | margin-top: -7px; 181 | left: -7px; 182 | } 183 | .tooltipster-arrow-right .tooltipster-arrow-border { 184 | border-top: 9px solid transparent !important; 185 | border-bottom: 9px solid transparent !important; 186 | border-right: 9px solid; 187 | margin-top: -8px; 188 | } 189 | 190 | 191 | /* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */ 192 | 193 | .tooltipster-fade { 194 | opacity: 0; 195 | -webkit-transition-property: opacity; 196 | -moz-transition-property: opacity; 197 | -o-transition-property: opacity; 198 | -ms-transition-property: opacity; 199 | transition-property: opacity; 200 | } 201 | .tooltipster-fade-show { 202 | opacity: 1; 203 | } 204 | 205 | .tooltipster-grow { 206 | -webkit-transform: scale(0,0); 207 | -moz-transform: scale(0,0); 208 | -o-transform: scale(0,0); 209 | -ms-transform: scale(0,0); 210 | transform: scale(0,0); 211 | -webkit-transition-property: -webkit-transform; 212 | -moz-transition-property: -moz-transform; 213 | -o-transition-property: -o-transform; 214 | -ms-transition-property: -ms-transform; 215 | transition-property: transform; 216 | -webkit-backface-visibility: hidden; 217 | } 218 | .tooltipster-grow-show { 219 | -webkit-transform: scale(1,1); 220 | -moz-transform: scale(1,1); 221 | -o-transform: scale(1,1); 222 | -ms-transform: scale(1,1); 223 | transform: scale(1,1); 224 | -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); 225 | -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 226 | -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 227 | -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 228 | -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 229 | transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 230 | } 231 | 232 | .tooltipster-swing { 233 | opacity: 0; 234 | -webkit-transform: rotateZ(4deg); 235 | -moz-transform: rotateZ(4deg); 236 | -o-transform: rotateZ(4deg); 237 | -ms-transform: rotateZ(4deg); 238 | transform: rotateZ(4deg); 239 | -webkit-transition-property: -webkit-transform, opacity; 240 | -moz-transition-property: -moz-transform; 241 | -o-transition-property: -o-transform; 242 | -ms-transition-property: -ms-transform; 243 | transition-property: transform; 244 | } 245 | .tooltipster-swing-show { 246 | opacity: 1; 247 | -webkit-transform: rotateZ(0deg); 248 | -moz-transform: rotateZ(0deg); 249 | -o-transform: rotateZ(0deg); 250 | -ms-transform: rotateZ(0deg); 251 | transform: rotateZ(0deg); 252 | -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1); 253 | -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); 254 | -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); 255 | -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); 256 | -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); 257 | transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); 258 | } 259 | 260 | .tooltipster-fall { 261 | top: 0; 262 | -webkit-transition-property: top; 263 | -moz-transition-property: top; 264 | -o-transition-property: top; 265 | -ms-transition-property: top; 266 | transition-property: top; 267 | -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); 268 | -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 269 | -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 270 | -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 271 | -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 272 | transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 273 | } 274 | .tooltipster-fall-show { 275 | } 276 | .tooltipster-fall.tooltipster-dying { 277 | -webkit-transition-property: all; 278 | -moz-transition-property: all; 279 | -o-transition-property: all; 280 | -ms-transition-property: all; 281 | transition-property: all; 282 | top: 0px !important; 283 | opacity: 0; 284 | } 285 | 286 | .tooltipster-slide { 287 | left: -40px; 288 | -webkit-transition-property: left; 289 | -moz-transition-property: left; 290 | -o-transition-property: left; 291 | -ms-transition-property: left; 292 | transition-property: left; 293 | -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); 294 | -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 295 | -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 296 | -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 297 | -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 298 | transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); 299 | } 300 | .tooltipster-slide.tooltipster-slide-show { 301 | } 302 | .tooltipster-slide.tooltipster-dying { 303 | -webkit-transition-property: all; 304 | -moz-transition-property: all; 305 | -o-transition-property: all; 306 | -ms-transition-property: all; 307 | transition-property: all; 308 | left: 0px !important; 309 | opacity: 0; 310 | } 311 | 312 | 313 | /* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */ 314 | .tooltipster-content-changing { 315 | opacity: 0.5; 316 | -webkit-transform: scale(1.1, 1.1); 317 | -moz-transform: scale(1.1, 1.1); 318 | -o-transform: scale(1.1, 1.1); 319 | -ms-transform: scale(1.1, 1.1); 320 | transform: scale(1.1, 1.1); 321 | } 322 | 323 | .tooltipster-shadow { 324 | border-radius: 5px; 325 | background: #fff; 326 | box-shadow: 0px 0px 14px rgba(0,0,0,0.3); 327 | color: #2c2c2c; 328 | } 329 | .tooltipster-shadow .tooltipster-content { 330 | font-family: 'Arial', sans-serif; 331 | font-size: 14px; 332 | line-height: 16px; 333 | padding: 8px 10px; 334 | } 335 | 336 | .tooltipster-base { 337 | width: 320px; 338 | } 339 | 340 | .tooltipster-content ul li { 341 | margin-left: -20px; 342 | } 343 | .tooltipster-content ul li { 344 | color: #ecf0f1; 345 | list-style: none; 346 | } 347 | 348 | .tooltipster-content ul li a{ 349 | color: #34495e; 350 | } 351 | 352 | .tooltipster-content ul li a:visited{ 353 | color: #34495e; 354 | } 355 | -------------------------------------------------------------------------------- /app/lib/text.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. 3 | * Available via the MIT or new BSD license. 4 | * see: http://github.com/requirejs/text for details 5 | */ 6 | /*jslint regexp: true */ 7 | /*global require: false, XMLHttpRequest: false, ActiveXObject: false, 8 | define: false, window: false, process: false, Packages: false, 9 | java: false, location: false */ 10 | 11 | define(['module'], function (module) { 12 | 'use strict'; 13 | 14 | var text, fs, 15 | progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], 16 | xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, 17 | bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, 18 | hasLocation = typeof location !== 'undefined' && location.href, 19 | defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), 20 | defaultHostName = hasLocation && location.hostname, 21 | defaultPort = hasLocation && (location.port || undefined), 22 | buildMap = [], 23 | masterConfig = (module.config && module.config()) || {}; 24 | 25 | text = { 26 | version: '2.0.5', 27 | 28 | strip: function (content) { 29 | //Strips declarations so that external SVG and XML 30 | //documents can be added to a document without worry. Also, if the string 31 | //is an HTML document, only the part inside the body tag is returned. 32 | if (content) { 33 | content = content.replace(xmlRegExp, ""); 34 | var matches = content.match(bodyRegExp); 35 | if (matches) { 36 | content = matches[1]; 37 | } 38 | } else { 39 | content = ""; 40 | } 41 | return content; 42 | }, 43 | 44 | jsEscape: function (content) { 45 | return content.replace(/(['\\])/g, '\\$1') 46 | .replace(/[\f]/g, "\\f") 47 | .replace(/[\b]/g, "\\b") 48 | .replace(/[\n]/g, "\\n") 49 | .replace(/[\t]/g, "\\t") 50 | .replace(/[\r]/g, "\\r") 51 | .replace(/[\u2028]/g, "\\u2028") 52 | .replace(/[\u2029]/g, "\\u2029"); 53 | }, 54 | 55 | createXhr: masterConfig.createXhr || function () { 56 | //Would love to dump the ActiveX crap in here. Need IE 6 to die first. 57 | var xhr, i, progId; 58 | if (typeof XMLHttpRequest !== "undefined") { 59 | return new XMLHttpRequest(); 60 | } else if (typeof ActiveXObject !== "undefined") { 61 | for (i = 0; i < 3; i += 1) { 62 | progId = progIds[i]; 63 | try { 64 | xhr = new ActiveXObject(progId); 65 | } catch (e) {} 66 | 67 | if (xhr) { 68 | progIds = [progId]; // so faster next time 69 | break; 70 | } 71 | } 72 | } 73 | 74 | return xhr; 75 | }, 76 | 77 | /** 78 | * Parses a resource name into its component parts. Resource names 79 | * look like: module/name.ext!strip, where the !strip part is 80 | * optional. 81 | * @param {String} name the resource name 82 | * @returns {Object} with properties "moduleName", "ext" and "strip" 83 | * where strip is a boolean. 84 | */ 85 | parseName: function (name) { 86 | var modName, ext, temp, 87 | strip = false, 88 | index = name.indexOf("."), 89 | isRelative = name.indexOf('./') === 0 || 90 | name.indexOf('../') === 0; 91 | 92 | if (index !== -1 && (!isRelative || index > 1)) { 93 | modName = name.substring(0, index); 94 | ext = name.substring(index + 1, name.length); 95 | } else { 96 | modName = name; 97 | } 98 | 99 | temp = ext || modName; 100 | index = temp.indexOf("!"); 101 | if (index !== -1) { 102 | //Pull off the strip arg. 103 | strip = temp.substring(index + 1) === "strip"; 104 | temp = temp.substring(0, index); 105 | if (ext) { 106 | ext = temp; 107 | } else { 108 | modName = temp; 109 | } 110 | } 111 | 112 | return { 113 | moduleName: modName, 114 | ext: ext, 115 | strip: strip 116 | }; 117 | }, 118 | 119 | xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, 120 | 121 | /** 122 | * Is an URL on another domain. Only works for browser use, returns 123 | * false in non-browser environments. Only used to know if an 124 | * optimized .js version of a text resource should be loaded 125 | * instead. 126 | * @param {String} url 127 | * @returns Boolean 128 | */ 129 | useXhr: function (url, protocol, hostname, port) { 130 | var uProtocol, uHostName, uPort, 131 | match = text.xdRegExp.exec(url); 132 | if (!match) { 133 | return true; 134 | } 135 | uProtocol = match[2]; 136 | uHostName = match[3]; 137 | 138 | uHostName = uHostName.split(':'); 139 | uPort = uHostName[1]; 140 | uHostName = uHostName[0]; 141 | 142 | return (!uProtocol || uProtocol === protocol) && 143 | (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && 144 | ((!uPort && !uHostName) || uPort === port); 145 | }, 146 | 147 | finishLoad: function (name, strip, content, onLoad) { 148 | content = strip ? text.strip(content) : content; 149 | if (masterConfig.isBuild) { 150 | buildMap[name] = content; 151 | } 152 | onLoad(content); 153 | }, 154 | 155 | load: function (name, req, onLoad, config) { 156 | //Name has format: some.module.filext!strip 157 | //The strip part is optional. 158 | //if strip is present, then that means only get the string contents 159 | //inside a body tag in an HTML string. For XML/SVG content it means 160 | //removing the declarations so the content can be inserted 161 | //into the current doc without problems. 162 | 163 | // Do not bother with the work if a build and text will 164 | // not be inlined. 165 | if (config.isBuild && !config.inlineText) { 166 | onLoad(); 167 | return; 168 | } 169 | 170 | masterConfig.isBuild = config.isBuild; 171 | 172 | var parsed = text.parseName(name), 173 | nonStripName = parsed.moduleName + 174 | (parsed.ext ? '.' + parsed.ext : ''), 175 | url = req.toUrl(nonStripName), 176 | useXhr = (masterConfig.useXhr) || 177 | text.useXhr; 178 | 179 | //Load the text. Use XHR if possible and in a browser. 180 | if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { 181 | text.get(url, function (content) { 182 | text.finishLoad(name, parsed.strip, content, onLoad); 183 | }, function (err) { 184 | if (onLoad.error) { 185 | onLoad.error(err); 186 | } 187 | }); 188 | } else { 189 | //Need to fetch the resource across domains. Assume 190 | //the resource has been optimized into a JS module. Fetch 191 | //by the module name + extension, but do not include the 192 | //!strip part to avoid file system issues. 193 | req([nonStripName], function (content) { 194 | text.finishLoad(parsed.moduleName + '.' + parsed.ext, 195 | parsed.strip, content, onLoad); 196 | }); 197 | } 198 | }, 199 | 200 | write: function (pluginName, moduleName, write, config) { 201 | if (buildMap.hasOwnProperty(moduleName)) { 202 | var content = text.jsEscape(buildMap[moduleName]); 203 | write.asModule(pluginName + "!" + moduleName, 204 | "define(function () { return '" + 205 | content + 206 | "';});\n"); 207 | } 208 | }, 209 | 210 | writeFile: function (pluginName, moduleName, req, write, config) { 211 | var parsed = text.parseName(moduleName), 212 | extPart = parsed.ext ? '.' + parsed.ext : '', 213 | nonStripName = parsed.moduleName + extPart, 214 | //Use a '.js' file name so that it indicates it is a 215 | //script that can be loaded across domains. 216 | fileName = req.toUrl(parsed.moduleName + extPart) + '.js'; 217 | 218 | //Leverage own load() method to load plugin value, but only 219 | //write out values that do not have the strip argument, 220 | //to avoid any potential issues with ! in file names. 221 | text.load(nonStripName, req, function (value) { 222 | //Use own write() method to construct full module value. 223 | //But need to create shell that translates writeFile's 224 | //write() to the right interface. 225 | var textWrite = function (contents) { 226 | return write(fileName, contents); 227 | }; 228 | textWrite.asModule = function (moduleName, contents) { 229 | return write.asModule(moduleName, fileName, contents); 230 | }; 231 | 232 | text.write(pluginName, nonStripName, textWrite, config); 233 | }, config); 234 | } 235 | }; 236 | 237 | if (masterConfig.env === 'node' || (!masterConfig.env && 238 | typeof process !== "undefined" && 239 | process.versions && 240 | !!process.versions.node)) { 241 | //Using special require.nodeRequire, something added by r.js. 242 | fs = require.nodeRequire('fs'); 243 | 244 | text.get = function (url, callback) { 245 | var file = fs.readFileSync(url, 'utf8'); 246 | //Remove BOM (Byte Mark Order) from utf8 files if it is there. 247 | if (file.indexOf('\uFEFF') === 0) { 248 | file = file.substring(1); 249 | } 250 | callback(file); 251 | }; 252 | } else if (masterConfig.env === 'xhr' || (!masterConfig.env && 253 | text.createXhr())) { 254 | text.get = function (url, callback, errback, headers) { 255 | var xhr = text.createXhr(), header; 256 | xhr.open('GET', url, true); 257 | 258 | //Allow plugins direct access to xhr headers 259 | if (headers) { 260 | for (header in headers) { 261 | if (headers.hasOwnProperty(header)) { 262 | xhr.setRequestHeader(header.toLowerCase(), headers[header]); 263 | } 264 | } 265 | } 266 | 267 | //Allow overrides specified in config 268 | if (masterConfig.onXhr) { 269 | masterConfig.onXhr(xhr, url); 270 | } 271 | 272 | xhr.onreadystatechange = function (evt) { 273 | var status, err; 274 | //Do not explicitly handle errors, those should be 275 | //visible via console output in the browser. 276 | if (xhr.readyState === 4) { 277 | status = xhr.status; 278 | if (status > 399 && status < 600) { 279 | //An http 4xx or 5xx error. Signal an error. 280 | err = new Error(url + ' HTTP status: ' + status); 281 | err.xhr = xhr; 282 | errback(err); 283 | } else { 284 | callback(xhr.responseText); 285 | } 286 | } 287 | }; 288 | xhr.send(null); 289 | }; 290 | } else if (masterConfig.env === 'rhino' || (!masterConfig.env && 291 | typeof Packages !== 'undefined' && typeof java !== 'undefined')) { 292 | //Why Java, why is this so awkward? 293 | text.get = function (url, callback) { 294 | var stringBuffer, line, 295 | encoding = "utf-8", 296 | file = new java.io.File(url), 297 | lineSeparator = java.lang.System.getProperty("line.separator"), 298 | input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), 299 | content = ''; 300 | try { 301 | stringBuffer = new java.lang.StringBuffer(); 302 | line = input.readLine(); 303 | 304 | // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 305 | // http://www.unicode.org/faq/utf_bom.html 306 | 307 | // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: 308 | // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 309 | if (line && line.length() && line.charAt(0) === 0xfeff) { 310 | // Eat the BOM, since we've already found the encoding on this file, 311 | // and we plan to concatenating this buffer with others; the BOM should 312 | // only appear at the top of a file. 313 | line = line.substring(1); 314 | } 315 | 316 | stringBuffer.append(line); 317 | 318 | while ((line = input.readLine()) !== null) { 319 | stringBuffer.append(lineSeparator); 320 | stringBuffer.append(line); 321 | } 322 | //Make sure we return a JavaScript string and not a Java string. 323 | content = String(stringBuffer.toString()); //String 324 | } finally { 325 | input.close(); 326 | } 327 | callback(content); 328 | }; 329 | } 330 | 331 | return text; 332 | }); 333 | -------------------------------------------------------------------------------- /app/lib/lettuce.js: -------------------------------------------------------------------------------- 1 | /*global define */ 2 | (function(global, factory) { 3 | "use strict"; 4 | if (typeof module === "object" && typeof module.exports === "object") { 5 | module.exports = global.document ? 6 | factory(global, true) : 7 | function(w) { 8 | if (!w.document) { 9 | throw new Error("jQuery requires a window with a document"); 10 | } 11 | return factory(w); 12 | }; 13 | } else { 14 | factory(global); 15 | } 16 | 17 | }(typeof window !== "undefined" ? window : this, function(window, noGlobal) { 18 | 19 | 'use strict'; 20 | 21 | 22 | var Lettuce = function() {}; 23 | 24 | Lettuce.VERSION = '0.2.2'; 25 | 26 | window.lettuce = Lettuce; 27 | 28 | 29 | /* (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 30 | * Underscore may be freely distributed under the MIT license. 31 | */ 32 | 33 | Lettuce.isObject = function (obj) { 34 | var type = typeof obj; 35 | return type === 'function' || type === 'object' && !!obj; 36 | }; 37 | 38 | Lettuce.isFunction = function(obj) { 39 | return typeof obj == 'function' || false; 40 | }; 41 | 42 | Lettuce.defaults = function(obj) { 43 | if (!Lettuce.isObject(obj)) { 44 | return obj; 45 | } 46 | 47 | for (var i = 1, length = arguments.length; i < length; i++) { 48 | var source = arguments[i]; 49 | for (var prop in source) { 50 | if (obj[prop] === void 0) { 51 | obj[prop] = source[prop]; 52 | } 53 | } 54 | } 55 | return obj; 56 | }; 57 | 58 | Lettuce.extend = function (obj) { 59 | if (!Lettuce.isObject(obj)) { 60 | return obj; 61 | } 62 | var source, prop; 63 | for (var i = 1, length = arguments.length; i < length; i++) { 64 | source = arguments[i]; 65 | for (prop in source) { 66 | if (hasOwnProperty.call(source, prop)) { 67 | obj[prop] = source[prop]; 68 | } 69 | } 70 | } 71 | return obj; 72 | }; 73 | 74 | 75 | /** 76 | * Lettuce Class 0.0.1 77 | * JavaScript Class built-in inheritance system 78 | *(c) 2015, Fengda Huang - http://www.phodal.com 79 | * 80 | * Copyright (c) 2011, 2012 Jeanine Adkisson. 81 | * MIT Licensed. 82 | * Inspired by https://github.com/munro/self, https://github.com/jneen/pjs 83 | */ 84 | 85 | Lettuce.prototype.Class = (function (prototype, ownProperty) { 86 | 87 | var lettuceClass = function Klass(_superclass, definition) { 88 | 89 | function Class() { 90 | var self = this instanceof Class ? this : new Basic(); 91 | self.init.apply(self, arguments); 92 | return self; 93 | } 94 | 95 | function Basic() { 96 | } 97 | 98 | Class.Basic = Basic; 99 | 100 | var _super = Basic[prototype] = _superclass[prototype]; 101 | var proto = Basic[prototype] = Class[prototype] = new Basic(); 102 | 103 | proto.constructor = Class; 104 | 105 | Class.extend = function (def) { 106 | return new Klass(Class, def); 107 | }; 108 | 109 | var open = (Class.open = function (def) { 110 | if (Lettuce.isFunction(def)) { 111 | def = def.call(Class, proto, _super, Class, _superclass); 112 | } 113 | 114 | if (Lettuce.isObject(def)) { 115 | for (var key in def) { 116 | if (ownProperty.call(def, key)) { 117 | proto[key] = def[key]; 118 | } 119 | } 120 | } 121 | 122 | if (!('init' in proto)) { 123 | proto.init = _superclass; 124 | } 125 | 126 | return Class; 127 | }); 128 | 129 | return (open)(definition); 130 | }; 131 | 132 | return lettuceClass; 133 | 134 | })('prototype', ({}).hasOwnProperty); 135 | 136 | 137 | var Parser = new Lettuce.prototype.Class({}); 138 | 139 | Parser.prototype.init = function (options) { 140 | this.options = options || {}; 141 | Lettuce.defaults(this.options, { 142 | first: 'first', 143 | regex: /.*Page/, 144 | last: 'last' 145 | }); 146 | }; 147 | 148 | Parser.prototype.run = function (methods) { 149 | var self = this; 150 | self.methods = methods; 151 | self.execute(self.options.first); 152 | for (var key in self.methods) { 153 | if (key !== self.options.last && key.match(self.options.regex)) { 154 | this.execute(key); 155 | } 156 | } 157 | 158 | self.execute(self.options.last); 159 | }; 160 | 161 | Parser.prototype.execute = function (methodName) { 162 | this.methods[methodName](); 163 | }; 164 | 165 | var parser = { 166 | Parser: Parser 167 | }; 168 | 169 | Lettuce.prototype = Lettuce.extend(Lettuce.prototype, parser); 170 | 171 | 172 | Lettuce.get = function (url, callback) { 173 | Lettuce.send(url, 'GET', callback); 174 | }; 175 | 176 | Lettuce.load = function (url, callback) { 177 | Lettuce.send(url, 'GET', callback); 178 | }; 179 | 180 | Lettuce.post = function (url, data, callback) { 181 | Lettuce.send(url, 'POST', callback, data); 182 | }; 183 | 184 | Lettuce.send = function (url, method, callback, data) { 185 | data = data || null; 186 | var request = new XMLHttpRequest(); 187 | if (callback instanceof Function) { 188 | request.onreadystatechange = function () { 189 | if (request.readyState === 4 && (request.status === 200 || request.status === 0)) { 190 | callback(request.responseText); 191 | } 192 | }; 193 | } 194 | request.open(method, url, true); 195 | if (data instanceof Object) { 196 | data = JSON.stringify(data); 197 | request.setRequestHeader('Content-Type', 'application/json'); 198 | } 199 | request.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 200 | request.send(data); 201 | }; 202 | 203 | 204 | var Event = { 205 | on: function(event, callback){ 206 | this._events = this._events || {}; 207 | this._events[event] = this._events[event] || []; 208 | this._events[event].push(callback); 209 | }, 210 | off: function(event, callback){ 211 | this._events = this._events || {}; 212 | if (event in this._events === false) { 213 | return; 214 | } 215 | this._events[event].splice(this._events[event].indexOf(callback), 1); 216 | }, 217 | trigger: function(event){ 218 | this._events = this._events || {}; 219 | if (event in this._events === false) { 220 | return; 221 | } 222 | for (var i = 0; i < this._events[event].length; i++) { 223 | this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1)); 224 | } 225 | } 226 | }; 227 | 228 | var event = { 229 | Event: Event 230 | }; 231 | 232 | 233 | Lettuce.prototype = Lettuce.extend(Lettuce.prototype, event); 234 | 235 | 236 | /* 237 | * JavaScript Templates 2.4.1 238 | * https://github.com/blueimp/JavaScript-Templates 239 | * 240 | * Copyright 2011, Sebastian Tschan 241 | * https://blueimp.net 242 | * 243 | * Licensed under the MIT license: 244 | * http://www.opensource.org/licenses/MIT 245 | * 246 | * Inspired by John Resig's JavaScript Micro-Templating: 247 | * http://ejohn.org/blog/javascript-micro-templating/ 248 | */ 249 | 250 | /*jslint evil: true, regexp: true, unparam: true */ 251 | 252 | var Template = { 253 | regexp: /([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g, 254 | encReg: /[<>&"'\x00]/g, 255 | encMap: { 256 | "<": "<", 257 | ">": ">", 258 | "&": "&", 259 | "\"": """, 260 | "'": "'" 261 | }, 262 | arg: "o", 263 | helper: ",print=function(s,e){_s+=e?(s==null?'':s):_e(s);}" + 264 | ",include=function(s,d){_s+=tmpl(s,d);}", 265 | 266 | tmpl: function (str, data){ 267 | var f = !/[^\w\-\.:]/.test(str) ? "" : this.compile(str); 268 | return f(data, this); 269 | }, 270 | 271 | compile: function (str) { 272 | var fn, variable; 273 | variable = this.arg + ',tmpl'; 274 | fn = "var _e=tmpl.encode" + this.helper + ",_s='" + str.replace(this.regexp, this.func) + "';"; 275 | fn = fn + "return _s;"; 276 | return new Function(variable, fn); 277 | }, 278 | 279 | encode: function (s) { 280 | /*jshint eqnull:true */ 281 | var encodeRegex = /[<>&"'\x00]/g, 282 | encodeMap = { 283 | "<": "<", 284 | ">": ">", 285 | "&": "&", 286 | "\"": """, 287 | "'": "'" 288 | }; 289 | return (s == null ? "" : "" + s).replace( 290 | encodeRegex, 291 | function (c) { 292 | return encodeMap[c] || ""; 293 | } 294 | ); 295 | }, 296 | 297 | func: function (s, p1, p2, p3, p4, p5) { 298 | var specialCharMAP = { 299 | "\n": "\\n", 300 | "\r": "\\r", 301 | "\t": "\\t", 302 | " ": " " 303 | }; 304 | 305 | if (p1) { // whitespace, quote and backspace in HTML context 306 | return specialCharMAP[p1] || "\\" + p1; 307 | } 308 | if (p2) { // interpolation: {%=prop%}, or unescaped: {%#prop%} 309 | if (p2 === "=") { 310 | return "'+_e(" + p3 + ")+'"; 311 | } 312 | return "'+(" + p3 + "==null?'':" + p3 + ")+'"; 313 | } 314 | if (p4) { // evaluation start tag: {% 315 | return "';"; 316 | } 317 | if (p5) { // evaluation end tag: %} 318 | return "_s+='"; 319 | } 320 | } 321 | }; 322 | 323 | var template = { 324 | Template: Template 325 | }; 326 | 327 | Lettuce.prototype = Lettuce.extend(Lettuce.prototype, template); 328 | 329 | 330 | /* 331 | * Copyright 2012-2013 (c) Pierre Duquesne 332 | * Licensed under the New BSD License. 333 | * https://github.com/stackp/promisejs 334 | */ 335 | 336 | function Promise() { 337 | this._callbacks = []; 338 | } 339 | 340 | Promise.prototype.then = function(func, context) { 341 | var p; 342 | if (this._isdone) { 343 | p = func.apply(context, this.result); 344 | } else { 345 | p = new Promise(); 346 | this._callbacks.push(function () { 347 | var res = func.apply(context, arguments); 348 | if (res && typeof res.then === 'function') { 349 | res.then(p.done, p); 350 | } 351 | }); 352 | } 353 | return p; 354 | }; 355 | 356 | Promise.prototype.done = function() { 357 | this.result = arguments; 358 | this._isdone = true; 359 | for (var i = 0; i < this._callbacks.length; i++) { 360 | this._callbacks[i].apply(null, arguments); 361 | } 362 | this._callbacks = []; 363 | }; 364 | 365 | var promise = { 366 | Promise: Promise 367 | }; 368 | 369 | Lettuce.prototype = Lettuce.extend(Lettuce.prototype, promise); 370 | 371 | 372 | var FX = { 373 | easing: { 374 | linear: function(progress) { 375 | return progress; 376 | }, 377 | quadratic: function(progress) { 378 | return Math.pow(progress, 2); 379 | }, 380 | swing: function(progress) { 381 | return 0.5 - Math.cos(progress * Math.PI) / 2; 382 | }, 383 | circ: function(progress) { 384 | return 1 - Math.sin(Math.acos(progress)); 385 | }, 386 | back: function(progress, x) { 387 | return Math.pow(progress, 2) * ((x + 1) * progress - x); 388 | }, 389 | bounce: function(progress) { 390 | for (var a = 0, b = 1; 1; a += b, b /= 2) { 391 | if (progress >= (7 - 4 * a) / 11) { 392 | return -Math.pow((11 - 6 * a - 11 * progress) / 4, 2) + Math.pow(b, 2); 393 | } 394 | } 395 | }, 396 | elastic: function(progress, x) { 397 | return Math.pow(2, 10 * (progress - 1)) * Math.cos(20 * Math.PI * x / 3 * progress); 398 | } 399 | }, 400 | animate: function(options) { 401 | var start = new Date(); 402 | var id = setInterval(function() { 403 | var timePassed = new Date() - start; 404 | var progress = timePassed / options.duration; 405 | if (progress > 1) { 406 | progress = 1; 407 | } 408 | options.progress = progress; 409 | var delta = options.delta(progress); 410 | options.step(delta); 411 | if (progress == 1) { 412 | clearInterval(id); 413 | options.complete(); 414 | } 415 | }, options.delay || 10); 416 | }, 417 | fadeOut: function(element, options) { 418 | var to = 1; 419 | this.animate({ 420 | duration: options.duration, 421 | delta: function(progress) { 422 | progress = this.progress; 423 | return FX.easing.swing(progress); 424 | }, 425 | complete: options.complete, 426 | step: function(delta) { 427 | element.style.opacity = to - delta; 428 | } 429 | }); 430 | }, 431 | fadeIn: function(element, options) { 432 | var to = 0; 433 | this.animate({ 434 | duration: options.duration, 435 | delta: function(progress) { 436 | progress = this.progress; 437 | return FX.easing.swing(progress); 438 | }, 439 | complete: options.complete, 440 | step: function(delta) { 441 | element.style.opacity = to + delta; 442 | } 443 | }); 444 | } 445 | }; 446 | 447 | var fx = { 448 | FX: FX 449 | }; 450 | 451 | Lettuce.prototype = Lettuce.extend(Lettuce.prototype, fx); 452 | 453 | 454 | /* 455 | *Inspired by http://krasimirtsonev.com/blog/article/A-modern-JavaScript-router-in-100-lines-history-api-pushState-hash-url 456 | * Backbone 457 | */ 458 | var Router = { 459 | routes: [], 460 | hashStrip: /^#*/, 461 | location: window.location, 462 | 463 | getFragment: function () { 464 | return (this.location).hash.replace(this.hashStrip, ''); 465 | }, 466 | 467 | add: function (regex, handler) { 468 | if (Lettuce.isFunction(regex)) { 469 | handler = regex; 470 | regex = ''; 471 | } 472 | this.routes.push({regex: regex, handler: handler}); 473 | return this; 474 | }, 475 | 476 | check: function (self) { 477 | var fragment = self.getFragment(); 478 | for (var i = 0; i < self.routes.length; i++) { 479 | var newFragment = "#" + fragment; 480 | var match = newFragment.match(self.routes[i].regex); 481 | if (match) { 482 | match.shift(); 483 | self.routes[i].handler.apply({}, match); 484 | } 485 | } 486 | }, 487 | 488 | load: function () { 489 | var self, checkUrl; 490 | self = this; 491 | 492 | checkUrl = function () { 493 | self.check(self); 494 | }; 495 | 496 | function addEventListener() { 497 | if (window.addEventListener) { 498 | window.addEventListener("hashchange", checkUrl, false); 499 | } 500 | else if (window.attachEvent) { 501 | window.attachEvent("onhashchange", checkUrl); 502 | } 503 | } 504 | 505 | addEventListener(); 506 | return this; 507 | }, 508 | 509 | navigate: function (path) { 510 | path = path ? path : ''; 511 | this.location.href.match(/#(.*)$/); 512 | this.location.href = this.location.href.replace(/#(.*)$/, '') + '#' + path; 513 | return this; 514 | } 515 | }; 516 | 517 | var router = { 518 | Router: Router 519 | }; 520 | 521 | Lettuce.prototype = Lettuce.extend(Lettuce.prototype, router); 522 | 523 | 524 | if (typeof define === "function" && define.amd) { 525 | define("lettuce", [], function () { 526 | return Lettuce; 527 | }); 528 | } 529 | var strundefined = typeof undefined; 530 | if (typeof noGlobal === strundefined) { 531 | window.Lettuce = Lettuce; 532 | } 533 | return Lettuce; 534 | })); 535 | 536 | -------------------------------------------------------------------------------- /app/lib/jquery.tooltipster.min.js: -------------------------------------------------------------------------------- 1 | /* Tooltipster v3.3.0 */;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('
');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}if(r.options.hideOnClick){r.$elProxy.on("click."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition();t.options.positionTrackerCallback.call(t,t.$el)}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;kT){T=L;if(k===0){S=T}}if(LN){N=L;if(k==1){x=N}}if(Li){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K='
'+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0]){t.$elProxy.remove()}t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=null;if(t.options.restoration==="previous"){r=t.$el.data("tooltipster-initialTitle")}else if(t.options.restoration==="current"){r=typeof t.Content==="string"?t.Content:e("
").append(t.Content).html()}if(r){t.$el.attr("title",r)}t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document); -------------------------------------------------------------------------------- /app/lib/jquery-2.1.3.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ 2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c) 3 | },removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("