path
stringlengths 5
304
| repo_name
stringlengths 6
79
| content
stringlengths 27
1.05M
|
|---|---|---|
ajax/libs/6to5/2.4.7/browser.js
|
yogeshsaroya/cdnjs
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.to5=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(root,mod){if(typeof exports=="object"&&typeof module=="object")return mod(exports);if(typeof define=="function"&&define.amd)return define(["exports"],mod);mod(root.acorn||(root.acorn={}))})(this,function(exports){"use strict";exports.version="0.11.1";var options,input,inputLen,sourceFile;exports.parse=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();var startPos=options.locations?[tokPos,curPosition()]:tokPos;initParserState();return parseTopLevel(options.program||startNodeAt(startPos))};var defaultOptions=exports.defaultOptions={playground:false,ecmaVersion:5,strictSemicolons:false,allowTrailingCommas:true,forbidReserved:false,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};exports.parseExpressionAt=function(inpt,pos,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState(pos);initParserState();return parseExpression()};var isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};function setOptions(opts){options={};for(var opt in defaultOptions)options[opt]=opts&&has(opts,opt)?opts[opt]:defaultOptions[opt];sourceFile=options.sourceFile||null;if(isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){tokens.push(token)}}if(isArray(options.onComment)){var comments=options.onComment;options.onComment=function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start:start,end:end};if(options.locations){comment.loc=new SourceLocation;comment.loc.start=startLoc;comment.loc.end=endLoc}if(options.ranges)comment.range=[start,end];comments.push(comment)}}if(options.strictMode){strict=true}if(options.ecmaVersion>=6){isKeyword=isEcma6Keyword}else{isKeyword=isEcma5AndLessKeyword}}var getLineInfo=exports.getLineInfo=function(input,offset){for(var line=1,cur=0;;){lineBreak.lastIndex=cur;var match=lineBreak.exec(input);if(match&&match.index<offset){++line;cur=match.index+match[0].length}else break}return{line:line,column:offset-cur}};function Token(){this.type=tokType;this.value=tokVal;this.start=tokStart;this.end=tokEnd;if(options.locations){this.loc=new SourceLocation;this.loc.end=tokEndLoc;this.startLoc=tokStartLoc;this.endLoc=tokEndLoc}if(options.ranges)this.range=[tokStart,tokEnd]}exports.Token=Token;exports.tokenize=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();skipSpace();function getToken(forceRegexp){lastEnd=tokEnd;readToken(forceRegexp);return new Token}getToken.jumpTo=function(pos,reAllowed){tokPos=pos;if(options.locations){tokCurLine=1;tokLineStart=lineBreak.lastIndex=0;var match;while((match=lineBreak.exec(input))&&match.index<pos){++tokCurLine;tokLineStart=match.index+match[0].length}}tokRegexpAllowed=reAllowed;skipSpace()};getToken.noRegexp=function(){tokRegexpAllowed=false};getToken.options=options;return getToken};var tokPos;var tokStart,tokEnd;var tokStartLoc,tokEndLoc;var tokType,tokVal;var tokRegexpAllowed;var tokCurLine,tokLineStart;var lastStart,lastEnd,lastEndLoc;var inFunction,inGenerator,inAsync,labels,strict,inXJSChild,inXJSTag,inType;var metParenL;var templates;function initParserState(){lastStart=lastEnd=tokPos;if(options.locations)lastEndLoc=new Position;inFunction=inGenerator=inAsync=strict=false;labels=[];skipSpace();readToken()}function raise(pos,message){var loc=getLineInfo(input,pos);message+=" ("+loc.line+":"+loc.column+")";var err=new SyntaxError(message);err.pos=pos;err.loc=loc;err.raisedAt=tokPos;throw err}var empty=[];var _num={type:"num"},_regexp={type:"regexp"},_string={type:"string"};var _name={type:"name"},_eof={type:"eof"};var _xjsName={type:"xjsName"},_xjsText={type:"xjsText"};var _break={keyword:"break"},_case={keyword:"case",beforeExpr:true},_catch={keyword:"catch"};var _continue={keyword:"continue"},_debugger={keyword:"debugger"},_default={keyword:"default"};var _do={keyword:"do",isLoop:true},_else={keyword:"else",beforeExpr:true};var _finally={keyword:"finally"},_for={keyword:"for",isLoop:true},_function={keyword:"function"};var _if={keyword:"if"},_return={keyword:"return",beforeExpr:true},_switch={keyword:"switch"};var _throw={keyword:"throw",beforeExpr:true},_try={keyword:"try"},_var={keyword:"var"};var _let={keyword:"let"},_const={keyword:"const"};var _while={keyword:"while",isLoop:true},_with={keyword:"with"},_new={keyword:"new",beforeExpr:true};var _this={keyword:"this"};var _class={keyword:"class"},_extends={keyword:"extends",beforeExpr:true};var _export={keyword:"export"},_import={keyword:"import"};var _yield={keyword:"yield",beforeExpr:true};var _null={keyword:"null",atomValue:null},_true={keyword:"true",atomValue:true};var _false={keyword:"false",atomValue:false};var _in={keyword:"in",binop:7,beforeExpr:true};var keywordTypes={"break":_break,"case":_case,"catch":_catch,"continue":_continue,"debugger":_debugger,"default":_default,"do":_do,"else":_else,"finally":_finally,"for":_for,"function":_function,"if":_if,"return":_return,"switch":_switch,"throw":_throw,"try":_try,"var":_var,let:_let,"const":_const,"while":_while,"with":_with,"null":_null,"true":_true,"false":_false,"new":_new,"in":_in,"instanceof":{keyword:"instanceof",binop:7,beforeExpr:true},"this":_this,"typeof":{keyword:"typeof",prefix:true,beforeExpr:true},"void":{keyword:"void",prefix:true,beforeExpr:true},"delete":{keyword:"delete",prefix:true,beforeExpr:true},"class":_class,"extends":_extends,"export":_export,"import":_import,"yield":_yield};var _bracketL={type:"[",beforeExpr:true},_bracketR={type:"]"},_braceL={type:"{",beforeExpr:true};var _braceR={type:"}"},_parenL={type:"(",beforeExpr:true},_parenR={type:")"};var _comma={type:",",beforeExpr:true},_semi={type:";",beforeExpr:true};var _colon={type:":",beforeExpr:true},_dot={type:"."},_question={type:"?",beforeExpr:true};var _arrow={type:"=>",beforeExpr:true},_bquote={type:"`"},_dollarBraceL={type:"${",beforeExpr:true};var _ltSlash={type:"</"};var _arrow={type:"=>",beforeExpr:true},_template={type:"template"},_templateContinued={type:"templateContinued"};var _ellipsis={type:"...",prefix:true,beforeExpr:true};var _paamayimNekudotayim={type:"::",beforeExpr:true};var _at={type:"@"};var _hash={type:"#"};var _slash={binop:10,beforeExpr:true},_eq={isAssign:true,beforeExpr:true};var _assign={isAssign:true,beforeExpr:true};var _incDec={postfix:true,prefix:true,isUpdate:true},_prefix={prefix:true,beforeExpr:true};var _logicalOR={binop:1,beforeExpr:true};var _logicalAND={binop:2,beforeExpr:true};var _bitwiseOR={binop:3,beforeExpr:true};var _bitwiseXOR={binop:4,beforeExpr:true};var _bitwiseAND={binop:5,beforeExpr:true};var _equality={binop:6,beforeExpr:true};var _relational={binop:7,beforeExpr:true};var _bitShift={binop:8,beforeExpr:true};var _plusMin={binop:9,prefix:true,beforeExpr:true};var _modulo={binop:10,beforeExpr:true};var _star={binop:10,beforeExpr:true};var _exponent={binop:10,beforeExpr:true};var _lt={binop:7,beforeExpr:true},_gt={binop:7,beforeExpr:true};exports.tokTypes={bracketL:_bracketL,bracketR:_bracketR,braceL:_braceL,braceR:_braceR,parenL:_parenL,parenR:_parenR,comma:_comma,semi:_semi,colon:_colon,dot:_dot,ellipsis:_ellipsis,question:_question,slash:_slash,eq:_eq,name:_name,eof:_eof,num:_num,regexp:_regexp,string:_string,arrow:_arrow,bquote:_bquote,dollarBraceL:_dollarBraceL,star:_star,assign:_assign,xjsName:_xjsName,xjsText:_xjsText,paamayimNekudotayim:_paamayimNekudotayim,exponent:_exponent,at:_at,hash:_hash,template:_template,templateContinued:_templateContinued};for(var kw in keywordTypes)exports.tokTypes["_"+kw]=keywordTypes[kw];function makePredicate(words){words=words.split(" ");var f="",cats=[];out:for(var i=0;i<words.length;++i){for(var j=0;j<cats.length;++j)if(cats[j][0].length==words[i].length){cats[j].push(words[i]);continue out}cats.push([words[i]])}function compareTo(arr){if(arr.length==1)return f+="return str === "+JSON.stringify(arr[0])+";";f+="switch(str){";for(var i=0;i<arr.length;++i)f+="case "+JSON.stringify(arr[i])+":";f+="return true}return false;"}if(cats.length>3){cats.sort(function(a,b){return b.length-a.length});f+="switch(str.length){";for(var i=0;i<cats.length;++i){var cat=cats[i];f+="case "+cat[0].length+":";compareTo(cat)}f+="}"}else{compareTo(words)}return new Function("str",f)}var isReservedWord3=makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile");var isReservedWord5=makePredicate("class enum extends super const export import");var isStrictReservedWord=makePredicate("implements interface let package private protected public static yield");var isStrictBadIdWord=makePredicate("eval arguments");var ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var isEcma5AndLessKeyword=makePredicate(ecma5AndLessKeywords);var ecma6AndLessKeywords=ecma5AndLessKeywords+" let const class extends export import yield";var isEcma6Keyword=makePredicate(ecma6AndLessKeywords);var isKeyword=isEcma5AndLessKeyword;var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var nonASCIIidentifierChars="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";var nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]");var nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");var decimalNumber=/^\d+$/;var hexNumber=/^[\da-fA-F]+$/;var newline=/[\n\r\u2028\u2029]/;function isNewLine(code){return code===10||code===13||code===8232||code==8233}var lineBreak=/\r\n|[\n\r\u2028\u2029]/g;var isIdentifierStart=exports.isIdentifierStart=function(code){if(code<65)return code===36;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code))};var isIdentifierChar=exports.isIdentifierChar=function(code){if(code<48)return code===36;if(code<58)return true;if(code<65)return false;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifier.test(String.fromCharCode(code))};function Position(line,col){this.line=line;this.column=col}Position.prototype.offset=function(n){return new Position(this.line,this.column+n)};function curPosition(){return new Position(tokCurLine,tokPos-tokLineStart)}function initTokenState(pos){if(pos){tokPos=pos;tokLineStart=Math.max(0,input.lastIndexOf("\n",pos));tokCurLine=input.slice(0,tokLineStart).split(newline).length}else{tokCurLine=1;tokPos=tokLineStart=0}tokRegexpAllowed=true;metParenL=0;inType=inXJSChild=inXJSTag=false;templates=[];if(tokPos===0&&options.allowHashBang&&input.slice(0,2)==="#!"){skipLineComment(2)}}function finishToken(type,val,shouldSkipSpace){tokEnd=tokPos;if(options.locations)tokEndLoc=curPosition();tokType=type;if(shouldSkipSpace!==false)skipSpace();tokVal=val;tokRegexpAllowed=type.beforeExpr;if(options.onToken){options.onToken(new Token)}}function skipBlockComment(){var startLoc=options.onComment&&options.locations&&curPosition();var start=tokPos,end=input.indexOf("*/",tokPos+=2);if(end===-1)raise(tokPos-2,"Unterminated comment");tokPos=end+2;if(options.locations){lineBreak.lastIndex=start;var match;while((match=lineBreak.exec(input))&&match.index<tokPos){++tokCurLine;tokLineStart=match.index+match[0].length}}if(options.onComment)options.onComment(true,input.slice(start+2,end),start,tokPos,startLoc,options.locations&&curPosition())}function skipLineComment(startSkip){var start=tokPos;var startLoc=options.onComment&&options.locations&&curPosition();var ch=input.charCodeAt(tokPos+=startSkip);while(tokPos<inputLen&&ch!==10&&ch!==13&&ch!==8232&&ch!==8233){++tokPos;ch=input.charCodeAt(tokPos)}if(options.onComment)options.onComment(false,input.slice(start+startSkip,tokPos),start,tokPos,startLoc,options.locations&&curPosition())}function skipSpace(){while(tokPos<inputLen){var ch=input.charCodeAt(tokPos);if(ch===32){++tokPos}else if(ch===13){++tokPos;var next=input.charCodeAt(tokPos);if(next===10){++tokPos}if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch===10||ch===8232||ch===8233){++tokPos;if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch>8&&ch<14){++tokPos}else if(ch===47){var next=input.charCodeAt(tokPos+1);if(next===42){skipBlockComment()}else if(next===47){skipLineComment(2)}else break}else if(ch===160){++tokPos}else if(ch>=5760&&nonASCIIwhitespace.test(String.fromCharCode(ch))){++tokPos}else{break}}}function readToken_dot(){var next=input.charCodeAt(tokPos+1);if(next>=48&&next<=57)return readNumber(true);var next2=input.charCodeAt(tokPos+2);if(options.playground&&next===63){tokPos+=2;return finishToken(_dotQuestion)}else if(options.ecmaVersion>=6&&next===46&&next2===46){tokPos+=3;return finishToken(_ellipsis)}else{++tokPos;return finishToken(_dot)}}function readToken_slash(){var next=input.charCodeAt(tokPos+1);if(tokRegexpAllowed){++tokPos;return readRegexp()}if(next===61)return finishOp(_assign,2);return finishOp(_slash,1)}function readToken_modulo(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_modulo,1)}function readToken_mult(){var type=_star;var width=1;var next=input.charCodeAt(tokPos+1);if(options.ecmaVersion>=7&&next===42){width++;next=input.charCodeAt(tokPos+2);type=_exponent}if(next===61){width++;type=_assign}return finishOp(type,width)}function readToken_pipe_amp(code){var next=input.charCodeAt(tokPos+1);if(next===code)return finishOp(code===124?_logicalOR:_logicalAND,2);if(next===61)return finishOp(_assign,2);return finishOp(code===124?_bitwiseOR:_bitwiseAND,1)}function readToken_caret(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_bitwiseXOR,1)}function readToken_plus_min(code){var next=input.charCodeAt(tokPos+1);if(next===code){if(next==45&&input.charCodeAt(tokPos+2)==62&&newline.test(input.slice(lastEnd,tokPos))){skipLineComment(3);skipSpace();return readToken()}return finishOp(_incDec,2)}if(next===61)return finishOp(_assign,2);return finishOp(_plusMin,1)}function readToken_lt_gt(code){var next=input.charCodeAt(tokPos+1);var size=1;if(!inType&&next===code){size=code===62&&input.charCodeAt(tokPos+2)===62?3:2;if(input.charCodeAt(tokPos+size)===61)return finishOp(_assign,size+1);return finishOp(_bitShift,size)}if(next==33&&code==60&&input.charCodeAt(tokPos+2)==45&&input.charCodeAt(tokPos+3)==45){skipLineComment(4);skipSpace();return readToken()}if(next===61){size=input.charCodeAt(tokPos+2)===61?3:2;return finishOp(_relational,size)}if(next===47){size=2;return finishOp(_ltSlash,size)}return code===60?finishOp(_lt,size):finishOp(_gt,size,!inXJSTag)}function readToken_eq_excl(code){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_equality,input.charCodeAt(tokPos+2)===61?3:2);if(code===61&&next===62&&options.ecmaVersion>=6){tokPos+=2;return finishToken(_arrow)}return finishOp(code===61?_eq:_prefix,1)}function getTemplateToken(code){if(tokType===_string){if(code===96){++tokPos;return finishToken(_bquote)}else if(code===36&&input.charCodeAt(tokPos+1)===123){tokPos+=2;return finishToken(_dollarBraceL)}}return readTmplString()}function getTokenFromCode(code){switch(code){case 46:return readToken_dot();case 40:++tokPos;return finishToken(_parenL);case 41:++tokPos;return finishToken(_parenR);case 59:++tokPos;return finishToken(_semi);case 44:++tokPos;return finishToken(_comma);case 91:++tokPos;return finishToken(_bracketL);case 93:++tokPos;return finishToken(_bracketR);case 123:++tokPos;if(templates.length)++templates[templates.length-1];return finishToken(_braceL);case 125:++tokPos;if(templates.length&&--templates[templates.length-1]===0)return readTemplateString(_templateContinued);else return finishToken(_braceR);case 63:++tokPos;return finishToken(_question);case 64:if(options.playground){++tokPos;return finishToken(_at)}case 35:if(options.playground){++tokPos;return finishToken(_hash)}case 58:++tokPos;if(options.ecmaVersion>=7){var next=input.charCodeAt(tokPos);if(next===58){++tokPos;return finishToken(_paamayimNekudotayim)}}return finishToken(_colon);case 96:if(options.ecmaVersion>=6){++tokPos;return readTemplateString(_template)}case 48:var next=input.charCodeAt(tokPos+1);if(next===120||next===88)return readRadixNumber(16);if(options.ecmaVersion>=6){if(next===111||next===79)return readRadixNumber(8);if(next===98||next===66)return readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(false);case 34:case 39:return inXJSTag?readXJSStringLiteral():readString(code);case 47:return readToken_slash();case 37:return readToken_modulo();case 42:return readToken_mult();case 124:case 38:return readToken_pipe_amp(code);case 94:return readToken_caret();case 43:case 45:return readToken_plus_min(code);case 60:case 62:return readToken_lt_gt(code);case 61:case 33:return readToken_eq_excl(code);case 126:return finishOp(_prefix,1)}return false}function readToken(forceRegexp){if(!forceRegexp)tokStart=tokPos;else tokPos=tokStart+1;if(options.locations)tokStartLoc=curPosition();if(forceRegexp)return readRegexp();if(tokPos>=inputLen)return finishToken(_eof);var code=input.charCodeAt(tokPos);if(inXJSChild&&tokType!==_braceL&&code!==60&&code!==123&&code!==125){return readXJSText(["<","{"])}if(isIdentifierStart(code)||code===92)return readWord();var tok=getTokenFromCode(code);if(tok===false){var ch=String.fromCharCode(code);if(ch==="\\"||nonASCIIidentifierStart.test(ch))return readWord();raise(tokPos,"Unexpected character '"+ch+"'")}return tok}function finishOp(type,size,shouldSkipSpace){var str=input.slice(tokPos,tokPos+size);tokPos+=size;finishToken(type,str,shouldSkipSpace)}var regexpUnicodeSupport=false;try{new RegExp("","u");regexpUnicodeSupport=true}catch(e){}function readRegexp(){var content="",escaped,inClass,start=tokPos;for(;;){if(tokPos>=inputLen)raise(start,"Unterminated regular expression");var ch=nextChar();if(newline.test(ch))raise(start,"Unterminated regular expression");if(!escaped){if(ch==="[")inClass=true;else if(ch==="]"&&inClass)inClass=false;else if(ch==="/"&&!inClass)break;escaped=ch==="\\"}else escaped=false;++tokPos}var content=input.slice(start,tokPos);++tokPos;var mods=readWord1();var tmp=content;if(mods){var validFlags=/^[gmsiy]*$/;if(options.ecmaVersion>=6)validFlags=/^[gmsiyu]*$/;if(!validFlags.test(mods))raise(start,"Invalid regular expression flag");if(mods.indexOf("u")>=0&&!regexpUnicodeSupport){tmp=tmp.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}}try{new RegExp(tmp)}catch(e){if(e instanceof SyntaxError)raise(start,"Error parsing regular expression: "+e.message);raise(e)}try{var value=new RegExp(content,mods)}catch(err){value=null}return finishToken(_regexp,{pattern:content,flags:mods,value:value})}function readInt(radix,len){var start=tokPos,total=0;for(var i=0,e=len==null?Infinity:len;i<e;++i){var code=input.charCodeAt(tokPos),val;if(code>=97)val=code-97+10;else if(code>=65)val=code-65+10;else if(code>=48&&code<=57)val=code-48;else val=Infinity;if(val>=radix)break;++tokPos;total=total*radix+val}if(tokPos===start||len!=null&&tokPos-start!==len)return null;return total}function readRadixNumber(radix){tokPos+=2;var val=readInt(radix);if(val==null)raise(tokStart+2,"Expected number in radix "+radix);if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");return finishToken(_num,val)}function readNumber(startsWithDot){var start=tokPos,isFloat=false,octal=input.charCodeAt(tokPos)===48;if(!startsWithDot&&readInt(10)===null)raise(start,"Invalid number");if(input.charCodeAt(tokPos)===46){++tokPos;readInt(10);isFloat=true}var next=input.charCodeAt(tokPos);if(next===69||next===101){next=input.charCodeAt(++tokPos);if(next===43||next===45)++tokPos;if(readInt(10)===null)raise(start,"Invalid number");isFloat=true}if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");var str=input.slice(start,tokPos),val;if(isFloat)val=parseFloat(str);else if(!octal||str.length===1)val=parseInt(str,10);else if(/[89]/.test(str)||strict)raise(start,"Invalid number");else val=parseInt(str,8);return finishToken(_num,val)}function readCodePoint(){var ch=input.charCodeAt(tokPos),code;if(ch===123){if(options.ecmaVersion<6)unexpected();++tokPos;code=readHexChar(input.indexOf("}",tokPos)-tokPos);++tokPos;if(code>1114111)unexpected()}else{code=readHexChar(4)}if(code<=65535){return String.fromCharCode(code)}var cu1=(code-65536>>10)+55296;var cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function readString(quote){++tokPos;var out="";for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated string constant");var ch=input.charCodeAt(tokPos);if(ch===quote){++tokPos;return finishToken(_string,out)}if(ch===92){out+=readEscapedChar()}else{++tokPos;if(newline.test(String.fromCharCode(ch))){raise(tokStart,"Unterminated string constant")}out+=String.fromCharCode(ch)}}}function readTemplateString(type){if(type==_templateContinued)templates.pop();var out="",start=tokPos;for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated template");var ch=input.charAt(tokPos);if(ch==="`"||ch==="$"&&input.charCodeAt(tokPos+1)===123){var raw=input.slice(start,tokPos);++tokPos;if(ch=="$"){++tokPos;templates.push(1)}return finishToken(type,{cooked:out,raw:raw})}if(ch==="\\"){out+=readEscapedChar()}else{++tokPos;if(newline.test(ch)){if(ch==="\r"&&input.charCodeAt(tokPos)===10){++tokPos;ch="\n"}if(options.locations){++tokCurLine;tokLineStart=tokPos}}out+=ch}}}function readEscapedChar(){var ch=input.charCodeAt(++tokPos);var octal=/^[0-7]+/.exec(input.slice(tokPos,tokPos+3));if(octal)octal=octal[0];while(octal&&parseInt(octal,8)>255)octal=octal.slice(0,-1);if(octal==="0")octal=null;++tokPos;if(octal){if(strict)raise(tokPos-2,"Octal literal in strict mode");tokPos+=octal.length-1;return String.fromCharCode(parseInt(octal,8))}else{switch(ch){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(readHexChar(2));case 117:return readCodePoint();case 116:return" ";case 98:return"\b";case 118:return"";case 102:return"\f";case 48:return"\x00";case 13:if(input.charCodeAt(tokPos)===10)++tokPos;case 10:if(options.locations){tokLineStart=tokPos;++tokCurLine}return"";default:return String.fromCharCode(ch)}}}var XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function readXJSEntity(){var str="",count=0,entity;var ch=nextChar();if(ch!=="&")raise(tokPos,"Entity must start with an ampersand");var startPos=++tokPos;while(tokPos<inputLen&&count++<10){ch=nextChar();tokPos++;if(ch===";"){if(str[0]==="#"){if(str[1]==="x"){str=str.substr(2);if(hexNumber.test(str)){entity=String.fromCharCode(parseInt(str,16))}}else{str=str.substr(1);if(decimalNumber.test(str)){entity=String.fromCharCode(parseInt(str,10))}}}else{entity=XHTMLEntities[str]}break}str+=ch}if(!entity){tokPos=startPos;return"&"}return entity}function readXJSText(stopChars){var str="";while(tokPos<inputLen){var ch=nextChar();if(stopChars.indexOf(ch)!==-1){break}if(ch==="&"){str+=readXJSEntity()}else{++tokPos;if(ch==="\r"&&nextChar()==="\n"){str+=ch;++tokPos;ch="\n"}if(ch==="\n"&&options.locations){tokLineStart=tokPos;++tokCurLine}str+=ch}}return finishToken(_xjsText,str)}function readXJSStringLiteral(){var quote=input.charCodeAt(tokPos);if(quote!==34&"e!==39){raise("String literal must starts with a quote")}++tokPos;readXJSText([String.fromCharCode(quote)]);if(quote!==input.charCodeAt(tokPos)){unexpected()}++tokPos;return finishToken(tokType,tokVal)}function readHexChar(len){var n=readInt(16,len);if(n===null)raise(tokStart,"Bad character escape sequence");return n}var containsEsc;function readWord1(){containsEsc=false;var word,first=true,start=tokPos;for(;;){var ch=input.charCodeAt(tokPos);if(isIdentifierChar(ch)||inXJSTag&&ch===45){if(containsEsc)word+=nextChar();++tokPos}else if(ch===92&&!inXJSTag){if(!containsEsc)word=input.slice(start,tokPos);containsEsc=true;if(input.charCodeAt(++tokPos)!=117)raise(tokPos,"Expecting Unicode escape sequence \\uXXXX");++tokPos;var esc=readHexChar(4);var escStr=String.fromCharCode(esc);if(!escStr)raise(tokPos-1,"Invalid Unicode escape");if(!(first?isIdentifierStart(esc):isIdentifierChar(esc)))raise(tokPos-4,"Invalid Unicode escape");word+=escStr}else{break}first=false}return containsEsc?word:input.slice(start,tokPos)}function readWord(){var word=readWord1();var type=inXJSTag?_xjsName:_name;if(!containsEsc&&isKeyword(word))type=keywordTypes[word];return finishToken(type,word)}function next(){lastStart=tokStart;lastEnd=tokEnd;lastEndLoc=tokEndLoc;readToken()}function setStrict(strct){strict=strct;tokPos=tokStart;if(options.locations){while(tokPos<tokLineStart){tokLineStart=input.lastIndexOf("\n",tokLineStart-2)+1;--tokCurLine}}skipSpace();readToken()}function Node(){this.type=null;this.start=tokStart;this.end=null}exports.Node=Node;function SourceLocation(){this.start=tokStartLoc;this.end=null;if(sourceFile!==null)this.source=sourceFile}function startNode(){var node=new Node;if(options.locations)node.loc=new SourceLocation;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[tokStart,0];return node}function storeCurrentPos(){return options.locations?[tokStart,tokStartLoc]:tokStart}function startNodeAt(pos){var node=new Node,start=pos;if(options.locations){node.loc=new SourceLocation;node.loc.start=start[1];start=pos[0]}node.start=start;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[start,0];return node}function finishNode(node,type){node.type=type;node.end=lastEnd;if(options.locations)node.loc.end=lastEndLoc;if(options.ranges)node.range[1]=lastEnd;return node}function finishNodeAt(node,type,pos){if(options.locations){node.loc.end=pos[1];pos=pos[0]}node.type=type;node.end=pos;if(options.ranges)node.range[1]=pos;return node}function isUseStrict(stmt){return options.ecmaVersion>=5&&stmt.type==="ExpressionStatement"&&stmt.expression.type==="Literal"&&stmt.expression.value==="use strict"}function eat(type){if(tokType===type){next();return true}else{return false}}function canInsertSemicolon(){return!options.strictSemicolons&&(tokType===_eof||tokType===_braceR||newline.test(input.slice(lastEnd,tokStart)))}function semicolon(){if(!eat(_semi)&&!canInsertSemicolon())unexpected()}function expect(type){eat(type)||unexpected()}function nextChar(){return input.charAt(tokPos)}function unexpected(pos){raise(pos!=null?pos:tokStart,"Unexpected token")}function has(obj,propName){return Object.prototype.hasOwnProperty.call(obj,propName)}function toAssignable(node,allowSpread,checkType){if(options.ecmaVersion>=6&&node){switch(node.type){case"Identifier":case"MemberExpression":break;case"ObjectExpression":node.type="ObjectPattern";for(var i=0;i<node.properties.length;i++){var prop=node.properties[i];if(prop.type==="Property"&&prop.kind!=="init")unexpected(prop.key.start);toAssignable(prop.value,false,checkType)}break;case"ArrayExpression":node.type="ArrayPattern";for(var i=0,lastI=node.elements.length-1;i<=lastI;i++){toAssignable(node.elements[i],i===lastI,checkType)
}break;case"SpreadElement":if(allowSpread){toAssignable(node.argument,false,checkType);checkSpreadAssign(node.argument)}else{unexpected(node.start)}break;default:if(checkType)unexpected(node.start)}}return node}function checkSpreadAssign(node){if(node.type!=="Identifier"&&node.type!=="ArrayPattern")unexpected(node.start)}function checkFunctionParam(param,nameHash){switch(param.type){case"Identifier":if(isStrictReservedWord(param.name)||isStrictBadIdWord(param.name))raise(param.start,"Defining '"+param.name+"' in strict mode");if(has(nameHash,param.name))raise(param.start,"Argument name clash in strict mode");nameHash[param.name]=true;break;case"ObjectPattern":for(var i=0;i<param.properties.length;i++)checkFunctionParam(param.properties[i].value,nameHash);break;case"ArrayPattern":for(var i=0;i<param.elements.length;i++){var elem=param.elements[i];if(elem)checkFunctionParam(elem,nameHash)}break}}function checkPropClash(prop,propHash){if(options.ecmaVersion>=6)return;var key=prop.key,name;switch(key.type){case"Identifier":name=key.name;break;case"Literal":name=String(key.value);break;default:return}var kind=prop.kind||"init",other;if(has(propHash,name)){other=propHash[name];var isGetSet=kind!=="init";if((strict||isGetSet)&&other[kind]||!(isGetSet^other.init))raise(key.start,"Redefinition of property")}else{other=propHash[name]={init:false,get:false,set:false}}other[kind]=true}function checkLVal(expr,isBinding){switch(expr.type){case"Identifier":if(strict&&(isStrictBadIdWord(expr.name)||isStrictReservedWord(expr.name)))raise(expr.start,(isBinding?"Binding ":"Assigning to ")+expr.name+" in strict mode");break;case"MemberExpression":if(isBinding)raise(expr.start,"Binding to member expression");break;case"ObjectPattern":for(var i=0;i<expr.properties.length;i++){var prop=expr.properties[i];if(prop.type==="Property")prop=prop.value;checkLVal(prop,isBinding)}break;case"ArrayPattern":for(var i=0;i<expr.elements.length;i++){var elem=expr.elements[i];if(elem)checkLVal(elem,isBinding)}break;case"SpreadProperty":case"SpreadElement":case"VirtualPropertyExpression":break;default:raise(expr.start,"Assigning to rvalue")}}function parseTopLevel(node){var first=true;if(!node.body)node.body=[];while(tokType!==_eof){var stmt=parseStatement(true);node.body.push(stmt);if(first&&isUseStrict(stmt))setStrict(true);first=false}lastStart=tokStart;lastEnd=tokEnd;lastEndLoc=tokEndLoc;return finishNode(node,"Program")}var loopLabel={kind:"loop"},switchLabel={kind:"switch"};function parseStatement(topLevel){if(tokType===_slash||tokType===_assign&&tokVal=="/=")readToken(true);var starttype=tokType,node=startNode(),start=storeCurrentPos();switch(starttype){case _break:case _continue:return parseBreakContinueStatement(node,starttype.keyword);case _debugger:return parseDebuggerStatement(node);case _do:return parseDoStatement(node);case _for:return parseForStatement(node);case _function:return parseFunctionStatement(node);case _class:return parseClass(node,true);case _if:return parseIfStatement(node);case _return:return parseReturnStatement(node);case _switch:return parseSwitchStatement(node);case _throw:return parseThrowStatement(node);case _try:return parseTryStatement(node);case _var:case _let:case _const:return parseVarStatement(node,starttype.keyword);case _while:return parseWhileStatement(node);case _with:return parseWithStatement(node);case _braceL:return parseBlock();case _semi:return parseEmptyStatement(node);case _export:case _import:if(!topLevel&&!options.allowImportExportEverywhere)raise(tokStart,"'import' and 'export' may only appear at the top level");return starttype===_import?parseImport(node):parseExport(node);default:if(options.ecmaVersion>=7&&tokType===_name&&tokVal==="async"){var id=parseIdent();if(tokType===_function){next();return parseFunction(node,true,true)}else{return parseSubscripts(id,start)}}var maybeName=tokVal,expr=parseExpression();if(starttype===_name&&expr.type==="Identifier"){if(eat(_colon)){return parseLabeledStatement(node,maybeName,expr)}if(options.ecmaVersion>=7&&expr.name==="private"&&tokType===_name){return parsePrivate(node)}else if(expr.name==="declare"){if(tokType===_class||tokType===_name||tokType===_function||tokType===_var){return parseDeclare(node)}}else if(tokType===_name){if(expr.name==="interface"){return parseInterface(node)}else if(expr.name==="type"){return parseTypeAlias(node)}}}return parseExpressionStatement(node,expr)}}function parseBreakContinueStatement(node,keyword){var isBreak=keyword=="break";next();if(eat(_semi)||canInsertSemicolon())node.label=null;else if(tokType!==_name)unexpected();else{node.label=parseIdent();semicolon()}for(var i=0;i<labels.length;++i){var lab=labels[i];if(node.label==null||lab.name===node.label.name){if(lab.kind!=null&&(isBreak||lab.kind==="loop"))break;if(node.label&&isBreak)break}}if(i===labels.length)raise(node.start,"Unsyntactic "+keyword);return finishNode(node,isBreak?"BreakStatement":"ContinueStatement")}function parseDebuggerStatement(node){next();semicolon();return finishNode(node,"DebuggerStatement")}function parseDoStatement(node){next();labels.push(loopLabel);node.body=parseStatement();labels.pop();expect(_while);node.test=parseParenExpression();if(options.ecmaVersion>=6)eat(_semi);else semicolon();return finishNode(node,"DoWhileStatement")}function parseForStatement(node){next();labels.push(loopLabel);expect(_parenL);if(tokType===_semi)return parseFor(node,null);if(tokType===_var||tokType===_let){var init=startNode(),varKind=tokType.keyword,isLet=tokType===_let;next();parseVar(init,true,varKind);finishNode(init,"VariableDeclaration");if((tokType===_in||options.ecmaVersion>=6&&tokType===_name&&tokVal==="of")&&init.declarations.length===1&&!(isLet&&init.declarations[0].init))return parseForIn(node,init);return parseFor(node,init)}var init=parseExpression(false,true);if(tokType===_in||options.ecmaVersion>=6&&tokType===_name&&tokVal==="of"){checkLVal(init);return parseForIn(node,init)}return parseFor(node,init)}function parseFunctionStatement(node){next();return parseFunction(node,true,false)}function parseIfStatement(node){next();node.test=parseParenExpression();node.consequent=parseStatement();node.alternate=eat(_else)?parseStatement():null;return finishNode(node,"IfStatement")}function parseReturnStatement(node){if(!inFunction&&!options.allowReturnOutsideFunction)raise(tokStart,"'return' outside of function");next();if(eat(_semi)||canInsertSemicolon())node.argument=null;else{node.argument=parseExpression();semicolon()}return finishNode(node,"ReturnStatement")}function parseSwitchStatement(node){next();node.discriminant=parseParenExpression();node.cases=[];expect(_braceL);labels.push(switchLabel);for(var cur,sawDefault;tokType!=_braceR;){if(tokType===_case||tokType===_default){var isCase=tokType===_case;if(cur)finishNode(cur,"SwitchCase");node.cases.push(cur=startNode());cur.consequent=[];next();if(isCase)cur.test=parseExpression();else{if(sawDefault)raise(lastStart,"Multiple default clauses");sawDefault=true;cur.test=null}expect(_colon)}else{if(!cur)unexpected();cur.consequent.push(parseStatement())}}if(cur)finishNode(cur,"SwitchCase");next();labels.pop();return finishNode(node,"SwitchStatement")}function parseThrowStatement(node){next();if(newline.test(input.slice(lastEnd,tokStart)))raise(lastEnd,"Illegal newline after throw");node.argument=parseExpression();semicolon();return finishNode(node,"ThrowStatement")}function parseTryStatement(node){next();node.block=parseBlock();node.handler=null;if(tokType===_catch){var clause=startNode();next();expect(_parenL);clause.param=parseIdent();if(strict&&isStrictBadIdWord(clause.param.name))raise(clause.param.start,"Binding "+clause.param.name+" in strict mode");expect(_parenR);clause.guard=null;clause.body=parseBlock();node.handler=finishNode(clause,"CatchClause")}node.guardedHandlers=empty;node.finalizer=eat(_finally)?parseBlock():null;if(!node.handler&&!node.finalizer)raise(node.start,"Missing catch or finally clause");return finishNode(node,"TryStatement")}function parseVarStatement(node,kind){next();parseVar(node,false,kind);semicolon();return finishNode(node,"VariableDeclaration")}function parseWhileStatement(node){next();node.test=parseParenExpression();labels.push(loopLabel);node.body=parseStatement();labels.pop();return finishNode(node,"WhileStatement")}function parseWithStatement(node){if(strict)raise(tokStart,"'with' in strict mode");next();node.object=parseParenExpression();node.body=parseStatement();return finishNode(node,"WithStatement")}function parseEmptyStatement(node){next();return finishNode(node,"EmptyStatement")}function parseLabeledStatement(node,maybeName,expr){for(var i=0;i<labels.length;++i)if(labels[i].name===maybeName)raise(expr.start,"Label '"+maybeName+"' is already declared");var kind=tokType.isLoop?"loop":tokType===_switch?"switch":null;labels.push({name:maybeName,kind:kind});node.body=parseStatement();labels.pop();node.label=expr;return finishNode(node,"LabeledStatement")}function parseExpressionStatement(node,expr){node.expression=expr;semicolon();return finishNode(node,"ExpressionStatement")}function parseParenExpression(){expect(_parenL);var val=parseExpression();expect(_parenR);return val}function parseBlock(allowStrict){var node=startNode(),first=true,oldStrict;node.body=[];expect(_braceL);while(!eat(_braceR)){var stmt=parseStatement();node.body.push(stmt);if(first&&allowStrict&&isUseStrict(stmt)){oldStrict=strict;setStrict(strict=true)}first=false}if(oldStrict===false)setStrict(false);return finishNode(node,"BlockStatement")}function parseFor(node,init){node.init=init;expect(_semi);node.test=tokType===_semi?null:parseExpression();expect(_semi);node.update=tokType===_parenR?null:parseExpression();expect(_parenR);node.body=parseStatement();labels.pop();return finishNode(node,"ForStatement")}function parseForIn(node,init){var type=tokType===_in?"ForInStatement":"ForOfStatement";next();node.left=init;node.right=parseExpression();expect(_parenR);node.body=parseStatement();labels.pop();return finishNode(node,type)}function parseVar(node,noIn,kind){node.declarations=[];node.kind=kind;for(;;){var decl=startNode();decl.id=options.ecmaVersion>=6?toAssignable(parseExprAtom()):parseIdent();checkLVal(decl.id,true);if(tokType===_colon){decl.id.typeAnnotation=parseTypeAnnotation();finishNode(decl.id,decl.id.type)}decl.init=eat(_eq)?parseExpression(true,noIn):kind===_const.keyword?unexpected():null;node.declarations.push(finishNode(decl,"VariableDeclarator"));if(!eat(_comma))break}return node}function parseExpression(noComma,noIn){var start=storeCurrentPos();var expr=parseMaybeAssign(noIn);if(!noComma&&tokType===_comma){var node=startNodeAt(start);node.expressions=[expr];while(eat(_comma))node.expressions.push(parseMaybeAssign(noIn));return finishNode(node,"SequenceExpression")}return expr}function parseMaybeAssign(noIn,noLess){var start=storeCurrentPos();var left=parseMaybeConditional(noIn,noLess);if(tokType.isAssign){var node=startNodeAt(start);node.operator=tokVal;node.left=tokType===_eq?toAssignable(left):left;checkLVal(left);next();node.right=parseMaybeAssign(noIn);return finishNode(node,"AssignmentExpression")}return left}function parseMaybeConditional(noIn,noLess){var start=storeCurrentPos();var expr=parseExprOps(noIn,noLess);if(eat(_question)){var node=startNodeAt(start);if(eat(_eq)){var left=node.left=toAssignable(expr);if(left.type!=="MemberExpression")raise(left.start,"You can only use member expressions in memoization assignment");node.right=parseMaybeAssign(noIn);node.operator="?=";return finishNode(node,"AssignmentExpression")}node.test=expr;node.consequent=parseExpression(true);expect(_colon);node.alternate=parseExpression(true,noIn);return finishNode(node,"ConditionalExpression")}return expr}function parseExprOps(noIn,noLess){var start=storeCurrentPos();return parseExprOp(parseMaybeUnary(),start,-1,noIn,noLess)}function parseExprOp(left,leftStart,minPrec,noIn,noLess){var prec=tokType.binop;if(prec!=null&&(!noIn||tokType!==_in)&&(!noLess||tokType!==_lt)){if(prec>minPrec){var node=startNodeAt(leftStart);node.left=left;node.operator=tokVal;var op=tokType;next();var start=storeCurrentPos();node.right=parseExprOp(parseMaybeUnary(),start,prec,noIn);finishNode(node,op===_logicalOR||op===_logicalAND?"LogicalExpression":"BinaryExpression");return parseExprOp(node,leftStart,minPrec,noIn)}}return left}function parseMaybeUnary(){if(tokType.prefix){var node=startNode(),update=tokType.isUpdate,nodeType;if(tokType===_ellipsis){nodeType="SpreadElement"}else{nodeType=update?"UpdateExpression":"UnaryExpression";node.operator=tokVal;node.prefix=true}tokRegexpAllowed=true;next();node.argument=parseMaybeUnary();if(update)checkLVal(node.argument);else if(strict&&node.operator==="delete"&&node.argument.type==="Identifier")raise(node.start,"Deleting local variable in strict mode");return finishNode(node,nodeType)}var start=storeCurrentPos();var expr=parseExprSubscripts();while(tokType.postfix&&!canInsertSemicolon()){var node=startNodeAt(start);node.operator=tokVal;node.prefix=false;node.argument=expr;checkLVal(expr);next();expr=finishNode(node,"UpdateExpression")}return expr}function parseExprSubscripts(){var start=storeCurrentPos();return parseSubscripts(parseExprAtom(),start)}function parseSubscripts(base,start,noCalls){if(options.playground&&eat(_hash)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);if(eat(_parenL)){node.arguments=parseExprList(_parenR,false)}else{node.arguments=[]}return parseSubscripts(finishNode(node,"BindMemberExpression"),start,noCalls)}else if(eat(_paamayimNekudotayim)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);return parseSubscripts(finishNode(node,"VirtualPropertyExpression"),start,noCalls)}else if(eat(_dot)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);node.computed=false;return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(eat(_bracketL)){var node=startNodeAt(start);node.object=base;node.property=parseExpression();node.computed=true;expect(_bracketR);return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(!noCalls&&eat(_parenL)){var node=startNodeAt(start);node.callee=base;node.arguments=parseExprList(_parenR,false);return parseSubscripts(finishNode(node,"CallExpression"),start,noCalls)}else if(tokType===_template){var node=startNodeAt(start);node.tag=base;node.quasi=parseTemplate();return parseSubscripts(finishNode(node,"TaggedTemplateExpression"),start,noCalls)}return base}function parseExprAtom(){switch(tokType){case _this:var node=startNode();next();return finishNode(node,"ThisExpression");case _at:var start=storeCurrentPos();var node=startNode();var thisNode=startNode();next();node.object=finishNode(thisNode,"ThisExpression");node.property=parseSubscripts(parseIdent(),start);node.computed=false;return finishNode(node,"MemberExpression");case _yield:if(inGenerator)return parseYield();case _name:var start=storeCurrentPos();var node=startNode();var id=parseIdent(tokType!==_name);if(options.ecmaVersion>=7){if(id.name==="async"){if(tokType===_parenL){next();var oldParenL=++metParenL;if(tokType!==_parenR){val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}else{exprList=[]}expect(_parenR);if(metParenL===oldParenL&&eat(_arrow)){return parseArrowExpression(node,exprList,true)}else{node.callee=id;node.arguments=exprList;return parseSubscripts(finishNode(node,"CallExpression"),start)}}else if(tokType===_name){id=parseIdent();if(eat(_arrow)){return parseArrowExpression(node,[id],true)}return id}if(tokType===_function){next();return parseFunction(node,false,true)}}else if(id.name==="await"){if(inAsync)return parseAwait(node)}}if(eat(_arrow)){return parseArrowExpression(node,[id])}return id;case _regexp:var node=startNode();node.regex={pattern:tokVal.pattern,flags:tokVal.flags};node.value=tokVal.value;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _num:case _string:case _xjsText:var node=startNode();node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _null:case _true:case _false:var node=startNode();node.value=tokType.atomValue;node.raw=tokType.keyword;next();return finishNode(node,"Literal");case _parenL:var start=storeCurrentPos();var val,exprList;next();if(options.ecmaVersion>=7&&tokType===_for){val=parseComprehension(startNodeAt(start),true)}else{var oldParenL=++metParenL;if(tokType!==_parenR){val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}else{exprList=[]}expect(_parenR);if(metParenL===oldParenL&&eat(_arrow)){val=parseArrowExpression(startNodeAt(start),exprList)}else{if(!val)unexpected(lastStart);if(options.ecmaVersion>=6){for(var i=0;i<exprList.length;i++){if(exprList[i].type==="SpreadElement")unexpected()}}if(options.preserveParens){var par=startNodeAt(start);par.expression=val;val=finishNode(par,"ParenthesizedExpression")}}}return val;case _bracketL:var node=startNode();next();if(options.ecmaVersion>=7&&tokType===_for){return parseComprehension(node,false)}node.elements=parseExprList(_bracketR,true,true);return finishNode(node,"ArrayExpression");case _braceL:return parseObj();case _function:var node=startNode();next();return parseFunction(node,false,false);case _class:return parseClass(startNode(),false);case _new:return parseNew();case _template:return parseTemplate();case _lt:return parseXJSElement();case _hash:return parseBindFunctionExpression();default:unexpected()}}function parseBindFunctionExpression(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL)){node.arguments=parseExprList(_parenR,false)}else{node.arguments=[]}return finishNode(node,"BindFunctionExpression")}function parseNew(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL))node.arguments=parseExprList(_parenR,false);else node.arguments=empty;return finishNode(node,"NewExpression")}function parseTemplateElement(){var elem=startNodeAt(options.locations?[tokStart+1,tokStartLoc.offset(1)]:tokStart+1);elem.value=tokVal;elem.tail=input.charCodeAt(tokEnd-1)!==123;next();var endOff=elem.tail?1:2;return finishNodeAt(elem,"TemplateElement",options.locations?[lastEnd-endOff,lastEndLoc.offset(-endOff)]:lastEnd-endOff)}function parseTemplate(){var node=startNode();node.expressions=[];var curElt=parseTemplateElement();node.quasis=[curElt];while(!curElt.tail){node.expressions.push(parseExpression());if(tokType!==_templateContinued)unexpected();node.quasis.push(curElt=parseTemplateElement())}return finishNode(node,"TemplateLiteral")}function parseObj(){var node=startNode(),first=true,propHash={};node.properties=[];next();while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var prop=startNode(),isGenerator=false,isAsync=false;if(options.ecmaVersion>=7&&tokType===_ellipsis){prop=parseMaybeUnary();prop.type="SpreadProperty";node.properties.push(prop);continue}if(options.ecmaVersion>=6){prop.method=false;prop.shorthand=false;isGenerator=eat(_star)}if(options.ecmaVersion>=7&&tokType===_name&&tokVal==="async"){var asyncId=parseIdent();if(tokType===_colon||tokType===_parenL){prop.key=asyncId}else{isAsync=true;parsePropertyName(prop)}}else{parsePropertyName(prop)}var typeParameters;if(tokType===_lt){typeParameters=parseTypeParameterDeclaration();if(tokType!==_parenL)unexpected()}if(eat(_colon)){prop.value=parseExpression(true);prop.kind="init"}else if(options.ecmaVersion>=6&&tokType===_parenL){prop.kind="init";prop.method=true;prop.value=parseMethod(isGenerator,isAsync)}else if(options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set"||options.playground&&prop.key.name==="memo")&&(tokType!=_comma&&tokType!=_braceR)){if(isGenerator||isAsync)unexpected();prop.kind=prop.key.name;parsePropertyName(prop);prop.value=parseMethod(false,false)}else if(options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"){prop.kind="init";prop.value=prop.key;prop.shorthand=true}else unexpected();prop.value.typeParameters=typeParameters;checkPropClash(prop,propHash);node.properties.push(finishNode(prop,"Property"))}return finishNode(node,"ObjectExpression")}function parsePropertyName(prop){if(options.ecmaVersion>=6){if(eat(_bracketL)){prop.computed=true;prop.key=parseExpression();expect(_bracketR);return}else{prop.computed=false}}prop.key=tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function initFunction(node,isAsync){node.id=null;node.params=[];if(options.ecmaVersion>=6){node.defaults=[];node.rest=null;node.generator=false}if(options.ecmaVersion>=7){node.async=isAsync}}function parseFunction(node,isStatement,isAsync,allowExpressionBody){initFunction(node,isAsync);if(options.ecmaVersion>=6){node.generator=eat(_star)}if(isStatement||tokType===_name){node.id=parseIdent()}if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}parseFunctionParams(node);parseFunctionBody(node,allowExpressionBody);return finishNode(node,isStatement?"FunctionDeclaration":"FunctionExpression")}function parseMethod(isGenerator,isAsync){var node=startNode();initFunction(node,isAsync);parseFunctionParams(node);var allowExpressionBody;if(options.ecmaVersion>=6){node.generator=isGenerator;allowExpressionBody=true}else{allowExpressionBody=false}parseFunctionBody(node,allowExpressionBody);return finishNode(node,"FunctionExpression")}function parseArrowExpression(node,params,isAsync){initFunction(node,isAsync);var defaults=node.defaults,hasDefaults=false;for(var i=0,lastI=params.length-1;i<=lastI;i++){var param=params[i];if(param.type==="AssignmentExpression"&¶m.operator==="="){hasDefaults=true;params[i]=param.left;defaults.push(param.right)}else{toAssignable(param,i===lastI,true);defaults.push(null);if(param.type==="SpreadElement"){params.length--;node.rest=param.argument;break}}}node.params=params;if(!hasDefaults)node.defaults=[];parseFunctionBody(node,true);return finishNode(node,"ArrowFunctionExpression")}function parseFunctionParams(node){var defaults=[],hasDefaults=false;expect(_parenL);for(;;){if(eat(_parenR)){break}else if(options.ecmaVersion>=6&&eat(_ellipsis)){node.rest=toAssignable(parseExprAtom(),false,true);checkSpreadAssign(node.rest);parseFunctionParam(node.rest);expect(_parenR);defaults.push(null);break}else{var param=options.ecmaVersion>=6?toAssignable(parseExprAtom(),false,true):parseIdent();parseFunctionParam(param);node.params.push(param);if(options.ecmaVersion>=6){if(eat(_eq)){hasDefaults=true;defaults.push(parseExpression(true))}else{defaults.push(null)}}if(!eat(_comma)){expect(_parenR);break}}}if(hasDefaults)node.defaults=defaults;if(tokType===_colon){node.returnType=parseTypeAnnotation()}}function parseFunctionParam(param){if(tokType===_colon){param.typeAnnotation=parseTypeAnnotation()}else if(eat(_question)){param.optional=true}finishNode(param,param.type)}function parseFunctionBody(node,allowExpression){var isExpression=allowExpression&&tokType!==_braceL;var oldInAsync=inAsync;inAsync=node.async;if(isExpression){node.body=parseExpression(true);node.expression=true}else{var oldInFunc=inFunction,oldInGen=inGenerator,oldLabels=labels;inFunction=true;inGenerator=node.generator;labels=[];node.body=parseBlock(true);node.expression=false;inFunction=oldInFunc;inGenerator=oldInGen;labels=oldLabels}inAsync=oldInAsync;if(strict||!isExpression&&node.body.body.length&&isUseStrict(node.body.body[0])){var nameHash={};if(node.id)checkFunctionParam(node.id,{});for(var i=0;i<node.params.length;i++)checkFunctionParam(node.params[i],nameHash);if(node.rest)checkFunctionParam(node.rest,nameHash)}}function parsePrivate(node){node.declarations=[];do{node.declarations.push(parseIdent())}while(eat(_comma));semicolon();return finishNode(node,"PrivateDeclaration")}function parseClass(node,isStatement){next();node.id=tokType===_name?parseIdent():isStatement?unexpected():null;if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}node.superClass=eat(_extends)?parseMaybeAssign(false,true):null;if(node.superClass)checkLVal(node.superClass);if(node.superClass&&tokType===_lt){node.superTypeParameters=parseTypeParameterInstantiation()}if(tokType===_name&&tokVal==="implements"){next();node.implements=parseClassImplements()}var classBody=startNode();classBody.body=[];expect(_braceL);while(!eat(_braceR)){var method=startNode();if(options.ecmaVersion>=7&&tokType===_name&&tokVal==="private"){next();classBody.body.push(parsePrivate(method));continue}if(tokType===_name&&tokVal==="static"){next();method["static"]=true}else{method["static"]=false}var isAsync=false;var isGenerator=eat(_star);if(options.ecmaVersion>=7&&!isGenerator&&tokType===_name&&tokVal==="async"){var asyncId=parseIdent();if(tokType===_colon||tokType===_parenL){method.key=asyncId}else{isAsync=true;parsePropertyName(method)}}else{parsePropertyName(method)}if(tokType!==_parenL&&!method.computed&&method.key.type==="Identifier"&&(method.key.name==="get"||method.key.name==="set"||options.playground&&method.key.name==="memo")){if(isGenerator||isAsync)unexpected();method.kind=method.key.name;parsePropertyName(method)}else{method.kind=""}if(tokType===_colon){if(isGenerator||isAsync)unexpected();method.typeAnnotation=parseTypeAnnotation();semicolon();classBody.body.push(finishNode(method,"ClassProperty"))}else{var typeParameters;if(tokType===_lt){typeParameters=parseTypeParameterDeclaration()}method.value=parseMethod(isGenerator,isAsync);method.value.typeParameters=typeParameters;classBody.body.push(finishNode(method,"MethodDefinition"));eat(_semi)}}node.body=finishNode(classBody,"ClassBody");return finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")}function parseClassImplements(){var implemented=[];do{var node=startNode();node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterInstantiation()}else{node.typeParameters=null}implemented.push(finishNode(node,"ClassImplements"))}while(eat(_comma));return implemented}function parseExprList(close,allowTrailingComma,allowEmpty){var elts=[],first=true;while(!eat(close)){if(!first){expect(_comma);if(allowTrailingComma&&options.allowTrailingCommas&&eat(close))break}else first=false;if(allowEmpty&&tokType===_comma)elts.push(null);else elts.push(parseExpression(true))}return elts}function parseIdent(liberal){var node=startNode();if(liberal&&options.forbidReserved=="everywhere")liberal=false;if(tokType===_name){if(!liberal&&(options.forbidReserved&&(options.ecmaVersion===3?isReservedWord3:isReservedWord5)(tokVal)||strict&&isStrictReservedWord(tokVal))&&input.slice(tokStart,tokEnd).indexOf("\\")==-1)raise(tokStart,"The keyword '"+tokVal+"' is reserved");node.name=tokVal}else if(liberal&&tokType.keyword){node.name=tokType.keyword}else{unexpected()}tokRegexpAllowed=false;next();return finishNode(node,"Identifier")}function parseExport(node){next();if(tokType===_var||tokType===_const||tokType===_let||tokType===_function||tokType===_class||tokType===_name&&tokVal==="async"){node.declaration=parseStatement();node["default"]=false;node.specifiers=null;node.source=null}else if(eat(_default)){var declar=node.declaration=parseExpression(true);if(declar.id){if(declar.type==="FunctionExpression"){declar.type="FunctionDeclaration"}else if(declar.type==="ClassExpression"){declar.type="ClassDeclaration"}}node["default"]=true;node.specifiers=null;node.source=null;semicolon()}else{var isBatch=tokType===_star;node.declaration=null;node["default"]=false;node.specifiers=parseExportSpecifiers();if(tokType===_name&&tokVal==="from"){next();node.source=tokType===_string?parseExprAtom():unexpected()}else{if(isBatch)unexpected();node.source=null}semicolon()}return finishNode(node,"ExportDeclaration")}function parseExportSpecifiers(){var nodes=[],first=true;if(tokType===_star){var node=startNode();next();nodes.push(finishNode(node,"ExportBatchSpecifier"))}else{expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(tokType===_default);if(tokType===_name&&tokVal==="as"){next();node.name=parseIdent(true)}else{node.name=null}nodes.push(finishNode(node,"ExportSpecifier"))}}return nodes}function parseImport(node){next();if(tokType===_string){node.specifiers=[];node.source=parseExprAtom()}else{node.specifiers=parseImportSpecifiers();if(tokType!==_name||tokVal!=="from")unexpected();next();node.source=tokType===_string?parseExprAtom():unexpected()}semicolon();return finishNode(node,"ImportDeclaration")}function parseImportSpecifiers(){var nodes=[],first=true;if(tokType===_name){var node=startNode();node.id=startNode();node.name=parseIdent();checkLVal(node.name,true);node.id.name="default";finishNode(node.id,"Identifier");nodes.push(finishNode(node,"ImportSpecifier"));if(!eat(_comma))return nodes}if(tokType===_star){var node=startNode();next();if(tokType!==_name||tokVal!=="as")unexpected();next();node.name=parseIdent();checkLVal(node.name,true);nodes.push(finishNode(node,"ImportBatchSpecifier"));return nodes}expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(true);if(tokType===_name&&tokVal==="as"){next();node.name=parseIdent()}else{node.name=null}checkLVal(node.name||node.id,true);node["default"]=false;nodes.push(finishNode(node,"ImportSpecifier"))}return nodes}function parseYield(){var node=startNode();next();if(eat(_semi)||canInsertSemicolon()){node.delegate=false;node.argument=null}else{node.delegate=eat(_star);node.argument=parseExpression(true)}return finishNode(node,"YieldExpression")}function parseAwait(node){if(eat(_semi)||canInsertSemicolon()){unexpected()}node.delegate=eat(_star);node.argument=parseExpression(true);return finishNode(node,"AwaitExpression")}function parseComprehension(node,isGenerator){node.blocks=[];while(tokType===_for){var block=startNode();next();expect(_parenL);block.left=toAssignable(parseExprAtom());checkLVal(block.left,true);if(tokType!==_name||tokVal!=="of")unexpected();next();block.of=true;block.right=parseExpression();expect(_parenR);node.blocks.push(finishNode(block,"ComprehensionBlock"))}node.filter=eat(_if)?parseParenExpression():null;node.body=parseExpression();expect(isGenerator?_parenR:_bracketR);node.generator=isGenerator;return finishNode(node,"ComprehensionExpression")}function getQualifiedXJSName(object){if(object.type==="XJSIdentifier"){return object.name}if(object.type==="XJSNamespacedName"){return object.namespace.name+":"+object.name.name}if(object.type==="XJSMemberExpression"){return getQualifiedXJSName(object.object)+"."+getQualifiedXJSName(object.property)}}function parseXJSIdentifier(){var node=startNode();if(tokType===_xjsName){node.name=tokVal}else if(tokType.keyword){node.name=tokType.keyword}else{unexpected()}tokRegexpAllowed=false;next();return finishNode(node,"XJSIdentifier")}function parseXJSNamespacedName(){var node=startNode();node.namespace=parseXJSIdentifier();expect(_colon);node.name=parseXJSIdentifier();return finishNode(node,"XJSNamespacedName")}function parseXJSMemberExpression(){var start=storeCurrentPos();var node=parseXJSIdentifier();while(eat(_dot)){var newNode=startNodeAt(start);newNode.object=node;newNode.property=parseXJSIdentifier();node=finishNode(newNode,"XJSMemberExpression")}return node}function parseXJSElementName(){switch(nextChar()){case":":return parseXJSNamespacedName();case".":return parseXJSMemberExpression();default:return parseXJSIdentifier()}}function parseXJSAttributeName(){if(nextChar()===":"){return parseXJSNamespacedName()}return parseXJSIdentifier()}function parseXJSAttributeValue(){switch(tokType){case _braceL:var node=parseXJSExpressionContainer();if(node.expression.type==="XJSEmptyExpression"){raise(node.start,"XJS attributes must only be assigned a non-empty "+"expression")
}return node;case _lt:return parseXJSElement();case _xjsText:return parseExprAtom();default:raise(tokStart,"XJS value should be either an expression or a quoted XJS text")}}function parseXJSEmptyExpression(){if(tokType!==_braceR){unexpected()}var tmp;tmp=tokStart;tokStart=lastEnd;lastEnd=tmp;tmp=tokStartLoc;tokStartLoc=lastEndLoc;lastEndLoc=tmp;return finishNode(startNode(),"XJSEmptyExpression")}function parseXJSExpressionContainer(){var node=startNode();var origInXJSTag=inXJSTag,origInXJSChild=inXJSChild;inXJSTag=false;inXJSChild=false;next();node.expression=tokType===_braceR?parseXJSEmptyExpression():parseExpression();inXJSTag=origInXJSTag;inXJSChild=origInXJSChild;if(inXJSChild){tokPos=tokEnd}expect(_braceR);return finishNode(node,"XJSExpressionContainer")}function parseXJSAttribute(){if(tokType===_braceL){var tokStart1=tokStart,tokStartLoc1=tokStartLoc;var origInXJSTag=inXJSTag;inXJSTag=false;next();if(tokType!==_ellipsis)unexpected();var node=parseMaybeUnary();inXJSTag=origInXJSTag;expect(_braceR);node.type="XJSSpreadAttribute";node.start=tokStart1;node.end=lastEnd;if(options.locations){node.loc.start=tokStartLoc1;node.loc.end=lastEndLoc}if(options.ranges){node.range=[tokStart1,lastEnd]}return node}var node=startNode();node.name=parseXJSAttributeName();if(tokType===_eq){next();node.value=parseXJSAttributeValue()}else{node.value=null}return finishNode(node,"XJSAttribute")}function parseXJSChild(){switch(tokType){case _braceL:return parseXJSExpressionContainer();case _xjsText:return parseExprAtom();default:return parseXJSElement()}}function parseXJSOpeningElement(){var node=startNode(),attributes=node.attributes=[];var origInXJSChild=inXJSChild;var origInXJSTag=inXJSTag;inXJSChild=false;inXJSTag=true;next();node.name=parseXJSElementName();while(tokType!==_eof&&tokType!==_slash&&tokType!==_gt){attributes.push(parseXJSAttribute())}inXJSTag=false;if(node.selfClosing=!!eat(_slash)){inXJSTag=origInXJSTag;inXJSChild=origInXJSChild}else{inXJSChild=true}expect(_gt);return finishNode(node,"XJSOpeningElement")}function parseXJSClosingElement(){var node=startNode();var origInXJSChild=inXJSChild;var origInXJSTag=inXJSTag;inXJSChild=false;inXJSTag=true;tokRegexpAllowed=false;expect(_ltSlash);node.name=parseXJSElementName();skipSpace();inXJSChild=origInXJSChild;inXJSTag=origInXJSTag;tokRegexpAllowed=false;if(inXJSChild){tokPos=tokEnd}expect(_gt);return finishNode(node,"XJSClosingElement")}function parseXJSElement(){var node=startNode();var children=[];var origInXJSChild=inXJSChild;var openingElement=parseXJSOpeningElement();var closingElement=null;if(!openingElement.selfClosing){while(tokType!==_eof&&tokType!==_ltSlash){inXJSChild=true;children.push(parseXJSChild())}inXJSChild=origInXJSChild;closingElement=parseXJSClosingElement();if(getQualifiedXJSName(closingElement.name)!==getQualifiedXJSName(openingElement.name)){raise(closingElement.start,"Expected corresponding XJS closing tag for '"+getQualifiedXJSName(openingElement.name)+"'")}}if(!origInXJSChild&&tokType===_lt){raise(tokStart,"Adjacent XJS elements must be wrapped in an enclosing tag")}node.openingElement=openingElement;node.closingElement=closingElement;node.children=children;return finishNode(node,"XJSElement")}function parseDeclareClass(node){next();parseInterfaceish(node,true);return finishNode(node,"DeclareClass")}function parseDeclareFunction(node){next();var id=node.id=parseIdent();var typeNode=startNode();var typeContainer=startNode();if(tokType===_lt){typeNode.typeParameters=parseTypeParameterDeclaration()}else{typeNode.typeParameters=null}expect(_parenL);var tmp=parseFunctionTypeParams();typeNode.params=tmp.params;typeNode.rest=tmp.rest;expect(_parenR);expect(_colon);typeNode.returnType=parseType();typeContainer.typeAnnotation=finishNode(typeNode,"FunctionTypeAnnotation");id.typeAnnotation=finishNode(typeContainer,"TypeAnnotation");finishNode(id,id.type);semicolon();return finishNode(node,"DeclareFunction")}function parseDeclare(node){if(tokType===_class){return parseDeclareClass(node)}else if(tokType===_function){return parseDeclareFunction(node)}else if(tokType===_var){return parseDeclareVariable(node)}else if(tokType===_name&&tokVal==="module"){return parseDeclareModule(node)}else{unexpected()}}function parseDeclareVariable(node){next();node.id=parseTypeAnnotatableIdentifier();semicolon();return finishNode(node,"DeclareVariable")}function parseDeclareModule(node){next();if(tokType===_string){node.id=parseExprAtom()}else{node.id=parseIdent()}var bodyNode=node.body=startNode();var body=bodyNode.body=[];expect(_braceL);while(tokType!==_braceR){var node2=startNode();next();body.push(parseDeclare(node2))}expect(_braceR);finishNode(bodyNode,"BlockStatement");return finishNode(node,"DeclareModule")}function parseInterfaceish(node,allowStatic){node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}else{node.typeParameters=null}node.extends=[];if(eat(_extends)){do{node.extends.push(parseInterfaceExtends())}while(eat(_comma))}node.body=parseObjectType(allowStatic)}function parseInterfaceExtends(){var node=startNode();node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterInstantiation()}else{node.typeParameters=null}return finishNode(node,"InterfaceExtends")}function parseInterface(node){parseInterfaceish(node,false);return finishNode(node,"InterfaceDeclaration")}function parseTypeAlias(node){node.id=parseIdent();if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}else{node.typeParameters=null}expect(_eq);node.right=parseType();semicolon();return finishNode(node,"TypeAlias")}function parseTypeParameterDeclaration(){var node=startNode();node.params=[];expect(_lt);while(tokType!==_gt){node.params.push(parseIdent());if(tokType!==_gt){expect(_comma)}}expect(_gt);return finishNode(node,"TypeParameterDeclaration")}function parseTypeParameterInstantiation(){var node=startNode(),oldInType=inType;node.params=[];inType=true;expect(_lt);while(tokType!==_gt){node.params.push(parseType());if(tokType!==_gt){expect(_comma)}}expect(_gt);inType=oldInType;return finishNode(node,"TypeParameterInstantiation")}function parseObjectPropertyKey(){return tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function parseObjectTypeIndexer(node,isStatic){node.static=isStatic;expect(_bracketL);node.id=parseObjectPropertyKey();expect(_colon);node.key=parseType();expect(_bracketR);expect(_colon);node.value=parseType();return finishNode(node,"ObjectTypeIndexer")}function parseObjectTypeMethodish(node){node.params=[];node.rest=null;node.typeParameters=null;if(tokType===_lt){node.typeParameters=parseTypeParameterDeclaration()}expect(_parenL);while(tokType===_name){node.params.push(parseFunctionTypeParam());if(tokType!==_parenR){expect(_comma)}}if(eat(_ellipsis)){node.rest=parseFunctionTypeParam()}expect(_parenR);expect(_colon);node.returnType=parseType();return finishNode(node,"FunctionTypeAnnotation")}function parseObjectTypeMethod(start,isStatic,key){var node=startNodeAt(start);node.value=parseObjectTypeMethodish(startNodeAt(start));node.static=isStatic;node.key=key;node.optional=false;return finishNode(node,"ObjectTypeProperty")}function parseObjectTypeCallProperty(node,isStatic){var valueNode=startNode();node.static=isStatic;node.value=parseObjectTypeMethodish(valueNode);return finishNode(node,"ObjectTypeCallProperty")}function parseObjectType(allowStatic){var nodeStart=startNode();var node;var optional=false;var property;var propertyKey;var propertyTypeAnnotation;var token;var isStatic;nodeStart.callProperties=[];nodeStart.properties=[];nodeStart.indexers=[];expect(_braceL);while(tokType!==_braceR){var start=storeCurrentPos();node=startNode();if(allowStatic&&tokType===_name&&tokVal==="static"){next();isStatic=true}if(tokType===_bracketL){nodeStart.indexers.push(parseObjectTypeIndexer(node,isStatic))}else if(tokType===_parenL||tokType===_lt){nodeStart.callProperties.push(parseObjectTypeCallProperty(node,allowStatic))}else{if(isStatic&&tokType===_colon){propertyKey=parseIdent()}else{propertyKey=parseObjectPropertyKey()}if(tokType===_lt||tokType===_parenL){nodeStart.properties.push(parseObjectTypeMethod(start,isStatic,propertyKey))}else{if(eat(_question)){optional=true}expect(_colon);node.key=propertyKey;node.value=parseType();node.optional=optional;node.static=isStatic;nodeStart.properties.push(finishNode(node,"ObjectTypeProperty"))}}if(!eat(_semi)&&tokType!==_braceR){unexpected()}}expect(_braceR);return finishNode(nodeStart,"ObjectTypeAnnotation")}function parseGenericType(start,id){var node=startNodeAt(start);node.typeParameters=null;node.id=id;while(eat(_dot)){var node2=startNodeAt(start);node2.qualification=node.id;node2.id=parseIdent();node.id=finishNode(node2,"QualifiedTypeIdentifier")}if(tokType===_lt){node.typeParameters=parseTypeParameterInstantiation()}return finishNode(node,"GenericTypeAnnotation")}function parseVoidType(){var node=startNode();expect(keywordTypes["void"]);return finishNode(node,"VoidTypeAnnotation")}function parseTypeofType(){var node=startNode();expect(keywordTypes["typeof"]);node.argument=parsePrimaryType();return finishNode(node,"TypeofTypeAnnotation")}function parseTupleType(){var node=startNode();node.types=[];expect(_bracketL);while(tokPos<inputLen&&tokType!==_bracketR){node.types.push(parseType());if(tokType===_bracketR)break;expect(_comma)}expect(_bracketR);return finishNode(node,"TupleTypeAnnotation")}function parseFunctionTypeParam(){var optional=false;var node=startNode();node.name=parseIdent();if(eat(_question)){optional=true}expect(_colon);node.optional=optional;node.typeAnnotation=parseType();return finishNode(node,"FunctionTypeParam")}function parseFunctionTypeParams(){var ret={params:[],rest:null};while(tokType===_name){ret.params.push(parseFunctionTypeParam());if(tokType!==_parenR){expect(_comma)}}if(eat(_ellipsis)){ret.rest=parseFunctionTypeParam()}return ret}function identToTypeAnnotation(start,node,id){switch(id.name){case"any":return finishNode(node,"AnyTypeAnnotation");case"bool":case"boolean":return finishNode(node,"BooleanTypeAnnotation");case"number":return finishNode(node,"NumberTypeAnnotation");case"string":return finishNode(node,"StringTypeAnnotation");default:return parseGenericType(start,id)}}function parsePrimaryType(){var typeIdentifier=null;var params=null;var returnType=null;var start=storeCurrentPos();var node=startNode();var rest=null;var tmp;var typeParameters;var token;var type;var isGroupedType=false;switch(tokType){case _name:return identToTypeAnnotation(start,node,parseIdent());case _braceL:return parseObjectType();case _bracketL:return parseTupleType();case _lt:node.typeParameters=parseTypeParameterDeclaration();expect(_parenL);tmp=parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;expect(_parenR);expect(_arrow);node.returnType=parseType();return finishNode(node,"FunctionTypeAnnotation");case _parenL:next();var tmpId;if(tokType!==_parenR&&tokType!==_ellipsis){if(tokType===_name){}else{isGroupedType=true}}if(isGroupedType){if(tmpId&&_parenR){type=tmpId}else{type=parseType();expect(_parenR)}if(eat(_arrow)){raise(node,"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType")}return type}tmp=parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;expect(_parenR);expect(_arrow);node.returnType=parseType();node.typeParameters=null;return finishNode(node,"FunctionTypeAnnotation");case _string:node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"StringLiteralTypeAnnotation");default:if(tokType.keyword){switch(tokType.keyword){case"void":return parseVoidType();case"typeof":return parseTypeofType()}}}unexpected()}function parsePostfixType(){var node=startNode();var type=node.elementType=parsePrimaryType();if(tokType===_bracketL){expect(_bracketL);expect(_bracketR);return finishNode(node,"ArrayTypeAnnotation")}return type}function parsePrefixType(){var node=startNode();if(eat(_question)){node.typeAnnotation=parsePrefixType();return finishNode(node,"NullableTypeAnnotation")}return parsePostfixType()}function parseIntersectionType(){var node=startNode();var type=parsePrefixType();node.types=[type];while(eat(_bitwiseAND)){node.types.push(parsePrefixType())}return node.types.length===1?type:finishNode(node,"IntersectionTypeAnnotation")}function parseUnionType(){var node=startNode();var type=parseIntersectionType();node.types=[type];while(eat(_bitwiseOR)){node.types.push(parseIntersectionType())}return node.types.length===1?type:finishNode(node,"UnionTypeAnnotation")}function parseType(){var oldInType=inType;inType=true;var type=parseUnionType();inType=oldInType;return type}function parseTypeAnnotation(){var node=startNode();expect(_colon);node.typeAnnotation=parseType();return finishNode(node,"TypeAnnotation")}function parseTypeAnnotatableIdentifier(requireTypeAnnotation,canBeOptionalParam){var node=startNode();var ident=parseIdent();var isOptionalParam=false;if(canBeOptionalParam&&eat(_question)){expect(_question);isOptionalParam=true}if(requireTypeAnnotation||tokType===_colon){ident.typeAnnotation=parseTypeAnnotation();finishNode(ident,ident.type)}if(isOptionalParam){ident.optional=true;finishNode(ident,ident.type)}return ident}})},{}],2:[function(require,module,exports){(function(global){var transform=module.exports=require("./transformation/transform");transform.transform=transform;transform.run=function(code,opts){opts=opts||{};opts.sourceMap="inline";return new Function(transform(code,opts).code)()};transform.load=function(url,callback,opts,hold){opts=opts||{};opts.filename=opts.filename||url;var xhr=global.ActiveXObject?new global.ActiveXObject("Microsoft.XMLHTTP"):new global.XMLHttpRequest;xhr.open("GET",url,true);if("overrideMimeType"in xhr)xhr.overrideMimeType("text/plain");xhr.onreadystatechange=function(){if(xhr.readyState!==4)return;var status=xhr.status;if(status===0||status===200){var param=[xhr.responseText,opts];if(!hold)transform.run.apply(transform,param);if(callback)callback(param)}else{throw new Error("Could not load "+url)}};xhr.send(null)};var runScripts=function(){var scripts=[];var types=["text/ecmascript-6","text/6to5","module"];var index=0;var exec=function(){var param=scripts[index];if(param instanceof Array){transform.run.apply(transform,param);index++;exec()}};var run=function(script,i){var opts={};if(script.src){transform.load(script.src,function(param){scripts[i]=param;exec()},opts,true)}else{opts.filename="embedded";scripts[i]=[script.innerHTML,opts]}};var _scripts=global.document.getElementsByTagName("script");for(var i=0;i<_scripts.length;++i){var _script=_scripts[i];if(types.indexOf(_script.type)>=0)scripts.push(_script)}for(i in scripts){run(scripts[i],i)}exec()};if(global.addEventListener){global.addEventListener("DOMContentLoaded",runScripts,false)}else if(global.attachEvent){global.attachEvent("onload",runScripts)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./transformation/transform":31}],3:[function(require,module,exports){module.exports=File;var SHEBANG_REGEX=/^\#\!.*/;var transform=require("./transformation/transform");var generate=require("./generation/generator");var Scope=require("./traverse/scope");var util=require("./util");var t=require("./types");var _=require("lodash");function File(opts){this.dynamicImports=[];this.opts=File.normaliseOptions(opts);this.transformers=this.getTransformers();this.uids={};this.ast={}}File.declarations=["inherits","prototype-properties","apply-constructor","tagged-template-literal","interop-require","to-array","sliced-to-array","object-without-properties","has-own","slice","define-property","async-to-generator"];File.excludeDeclarationsFromRuntime=["async-to-generator"];File.normaliseOptions=function(opts){opts=_.cloneDeep(opts||{});_.defaults(opts,{experimental:false,playground:false,whitespace:true,moduleIds:opts.amdModuleIds||false,blacklist:[],whitelist:[],sourceMap:false,optional:[],comments:true,filename:"unknown",modules:"common",runtime:false,code:true,ast:true});opts.filename=opts.filename.replace(/\\/g,"/");opts.blacklist=util.arrayify(opts.blacklist);opts.whitelist=util.arrayify(opts.whitelist);_.defaults(opts,{moduleRoot:opts.sourceRoot});_.defaults(opts,{sourceRoot:opts.moduleRoot});_.defaults(opts,{filenameRelative:opts.filename});_.defaults(opts,{sourceFileName:opts.filenameRelative,sourceMapName:opts.filenameRelative});if(opts.runtime===true){opts.runtime="to5Runtime"}if(opts.playground){opts.experimental=true}transform._ensureTransformerNames("blacklist",opts.blacklist);transform._ensureTransformerNames("whitelist",opts.whitelist);transform._ensureTransformerNames("optional",opts.optional);return opts};File.prototype.getTransformers=function(){var file=this;var transformers=[];_.each(transform.transformers,function(transformer){if(transformer.canRun(file)){transformers.push(transformer);if(transformer.manipulateOptions){transformer.manipulateOptions(file.opts,file)}}});return transformers};File.prototype.toArray=function(node,i){if(t.isArrayExpression(node)){return node}else if(t.isIdentifier(node)&&node.name==="arguments"){return t.callExpression(t.memberExpression(this.addDeclaration("slice"),t.identifier("call")),[node])}else{var declarationName="to-array";var args=[node];if(i){args.push(t.literal(i));declarationName="sliced-to-array"}return t.callExpression(this.addDeclaration(declarationName),args)}};File.prototype.getModuleFormatter=function(type){var ModuleFormatter=_.isFunction(type)?type:transform.moduleFormatters[type];if(!ModuleFormatter){var loc=util.resolve(type);if(loc)ModuleFormatter=require(loc)}if(!ModuleFormatter){throw new ReferenceError("Unknown module formatter type "+JSON.stringify(type))}return new ModuleFormatter(this)};File.prototype.parseShebang=function(code){var shebangMatch=code.match(SHEBANG_REGEX);if(shebangMatch){this.shebang=shebangMatch[0];code=code.replace(SHEBANG_REGEX,"")}return code};File.prototype.addImport=function(id,source){var specifiers=[t.importSpecifier(t.identifier("default"),id)];var declar=t.importDeclaration(specifiers,t.literal(source));declar._blockHoist=3;this.dynamicImports.push(declar)};File.prototype.addDeclaration=function(name){if(!_.contains(File.declarations,name)){throw new ReferenceError("unknown declaration "+name)}var program=this.ast.program;var declar=program._declarations&&program._declarations[name];if(declar)return declar.id;var ref;var runtimeNamespace=this.opts.runtime;if(runtimeNamespace&&!_.contains(File.excludeDeclarationsFromRuntime,name)){name=t.identifier(t.toIdentifier(name));return t.memberExpression(t.identifier(runtimeNamespace),name)}else{ref=util.template(name)}var uid=this.generateUidIdentifier(name);this.scope.push({key:name,id:uid,init:ref});return uid};File.prototype.errorWithNode=function(node,msg,Error){Error=Error||SyntaxError;var loc=node.loc.start;var err=new Error("Line "+loc.line+": "+msg);err.loc=loc;return err};File.prototype.addCode=function(code){code=(code||"")+"";this.code=code;return this.parseShebang(code)};File.prototype.parse=function(code){var self=this;code=this.addCode(code);return util.parse(this.opts,code,function(tree){self.transform(tree);return self.generate()})};File.prototype.transform=function(ast){var self=this;this.ast=ast;this.scope=new Scope(ast.program);this.moduleFormatter=this.getModuleFormatter(this.opts.modules);var astRun=function(key){_.each(self.transformers,function(transformer){transformer.astRun(self,key)})};astRun("enter");_.each(this.transformers,function(transformer){transformer.transform(self)});astRun("exit")};File.prototype.generate=function(){var opts=this.opts;var ast=this.ast;var result={code:"",map:null,ast:null};if(opts.ast)result.ast=ast;if(!opts.code)return result;var _result=generate(ast,opts,this.code);result.code=_result.code;result.map=_result.map;if(this.shebang){result.code=this.shebang+"\n"+result.code}if(opts.sourceMap==="inline"){result.code+="\n"+util.sourceMapToComment(result.map)}return result};File.prototype.generateUid=function(name,scope){name=t.toIdentifier(name);scope=scope||this.scope;var uid;do{uid=this._generateUid(name)}while(scope.has(uid));return uid};File.prototype.generateUidIdentifier=function(name,scope){return t.identifier(this.generateUid(name,scope))};File.prototype._generateUid=function(name){var uids=this.uids;var i=uids[name]||1;var id=name;if(i>1)id+=i;uids[name]=i+1;return"_"+id}},{"./generation/generator":5,"./transformation/transform":31,"./traverse/scope":73,"./types":76,"./util":78,lodash:126}],4:[function(require,module,exports){module.exports=Buffer;var util=require("../util");var _=require("lodash");function Buffer(position,format){this.position=position;this._indent=format.indent.base;this.format=format;this.buf=""}Buffer.prototype.get=function(){return util.trimRight(this.buf)};Buffer.prototype.getIndent=function(){if(this.format.compact){return""}else{return util.repeat(this._indent,this.format.indent.style)}};Buffer.prototype.indentSize=function(){return this.getIndent().length};Buffer.prototype.indent=function(){this._indent++};Buffer.prototype.dedent=function(){this._indent--};Buffer.prototype.semicolon=function(){this.push(";")};Buffer.prototype.ensureSemicolon=function(){if(!this.isLast(";"))this.semicolon()};Buffer.prototype.rightBrace=function(){this.newline(true);this.push("}")};Buffer.prototype.keyword=function(name){this.push(name);this.push(" ")};Buffer.prototype.space=function(){if(this.buf&&!this.isLast([" ","\n"])){this.push(" ")}};Buffer.prototype.removeLast=function(cha){if(!this.isLast(cha))return;this.buf=this.buf.slice(0,-1);this.position.unshift(cha)};Buffer.prototype.newline=function(i,removeLast){if(this.format.compact)return;if(_.isBoolean(i)){removeLast=i;i=null}if(_.isNumber(i)){if(this.endsWith("{\n"))i--;if(this.endsWith(util.repeat(i,"\n")))return;var self=this;_.times(i,function(){self.newline(null,removeLast)});return}if(removeLast&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this.buf=this.buf.replace(/\n +$/,"\n");this._push("\n")};Buffer.prototype.push=function(str,noIndent){if(this._indent&&!noIndent&&str!=="\n"){var indent=this.getIndent();str=str.replace(/\n/g,"\n"+indent);if(this.isLast("\n"))str=indent+str}this._push(str)};Buffer.prototype._push=function(str){this.position.push(str);this.buf+=str};Buffer.prototype.endsWith=function(str){return this.buf.slice(-str.length)===str};Buffer.prototype.isLast=function(cha,trimRight){var buf=this.buf;if(trimRight)buf=util.trimRight(buf);var chars=[].concat(cha);return _.contains(chars,_.last(buf))}},{"../util":78,lodash:126}],5:[function(require,module,exports){module.exports=function(ast,opts,code){var gen=new CodeGenerator(ast,opts,code);return gen.generate()};module.exports.CodeGenerator=CodeGenerator;var Whitespace=require("./whitespace");var SourceMap=require("./source-map");var Position=require("./position");var Buffer=require("./buffer");var util=require("../util");var n=require("./node");var t=require("../types");var _=require("lodash");function CodeGenerator(ast,opts,code){opts=opts||{};this.comments=ast.comments||[];this.tokens=ast.tokens||[];this.format=CodeGenerator.normaliseOptions(opts);this.ast=ast;this.whitespace=new Whitespace(this.tokens,this.comments);this.position=new Position;this.map=new SourceMap(this.position,opts,code);this.buffer=new Buffer(this.position,this.format)}_.each(Buffer.prototype,function(fn,key){CodeGenerator.prototype[key]=function(){return fn.apply(this.buffer,arguments)}});CodeGenerator.normaliseOptions=function(opts){return _.merge({parentheses:true,comments:opts.comments==null||opts.comments,compact:false,indent:{adjustMultilineComment:true,style:" ",base:0}},opts.format||{})};CodeGenerator.generators={templateLiterals:require("./generators/template-literals"),comprehensions:require("./generators/comprehensions"),expressions:require("./generators/expressions"),statements:require("./generators/statements"),playground:require("./generators/playground"),classes:require("./generators/classes"),methods:require("./generators/methods"),modules:require("./generators/modules"),types:require("./generators/types"),flow:require("./generators/flow"),base:require("./generators/base"),jsx:require("./generators/jsx")};_.each(CodeGenerator.generators,function(generator){_.extend(CodeGenerator.prototype,generator)});CodeGenerator.prototype.generate=function(){var ast=this.ast;this.print(ast);var comments=[];_.each(ast.comments,function(comment){if(!comment._displayed)comments.push(comment)});this._printComments(comments);return{map:this.map.get(),code:this.buffer.get()}};CodeGenerator.prototype.buildPrint=function(parent){var self=this;var print=function(node,opts){return self.print(node,parent,opts)};print.sequence=function(nodes,opts){opts=opts||{};opts.statement=true;return self.printJoin(print,nodes,opts)};print.join=function(nodes,opts){return self.printJoin(print,nodes,opts)};print.block=function(node){return self.printBlock(print,node)};print.indentOnComments=function(node){return self.printAndIndentOnComments(print,node)};return print};CodeGenerator.prototype.print=function(node,parent,opts){if(!node)return"";var self=this;opts=opts||{};var newline=function(leading){if(!opts.statement&&!n.isUserWhitespacable(node,parent)){return}var lines=0;if(node.start!=null){if(leading){lines=self.whitespace.getNewlinesBefore(node)}else{lines=self.whitespace.getNewlinesAfter(node)}}else{if(!leading)lines++;var needs=n.needsWhitespaceAfter;if(leading)needs=n.needsWhitespaceBefore;lines+=needs(node,parent);if(!self.buffer.get())lines=0}self.newline(lines)};if(this[node.type]){var needsCommentParens=t.isExpression(node)&&node.leadingComments&&node.leadingComments.length;var needsParens=needsCommentParens||n.needsParens(node,parent);if(needsParens)this.push("(");if(needsCommentParens)this.indent();this.printLeadingComments(node,parent);newline(true);if(opts.before)opts.before();this.map.mark(node,"start");this[node.type](node,this.buildPrint(node),parent);if(needsCommentParens){this.newline();this.dedent()}if(needsParens)this.push(")");this.map.mark(node,"end");if(opts.after)opts.after();newline(false);this.printTrailingComments(node,parent)}else{throw new ReferenceError("unknown node of type "+JSON.stringify(node.type)+" with constructor "+JSON.stringify(node&&node.constructor.name))}};CodeGenerator.prototype.printJoin=function(print,nodes,opts){if(!nodes||!nodes.length)return;opts=opts||{};var self=this;var len=nodes.length;if(opts.indent)self.indent();_.each(nodes,function(node,i){print(node,{statement:opts.statement,after:function(){if(opts.iterator){opts.iterator(node,i)}if(opts.separator&&i<len-1){self.push(opts.separator)}}})});if(opts.indent)self.dedent()};CodeGenerator.prototype.printAndIndentOnComments=function(print,node){var indent=!!node.leadingComments;if(indent)this.indent();print(node);if(indent)this.dedent()};CodeGenerator.prototype.printBlock=function(print,node){if(t.isEmptyStatement(node)){this.semicolon()}else{this.push(" ");print(node)}};CodeGenerator.prototype.generateComment=function(comment){var val=comment.value;if(comment.type==="Line"){val="//"+val}else{val="/*"+val+"*/"}return val};CodeGenerator.prototype.printTrailingComments=function(node,parent){this._printComments(this.getComments("trailingComments",node,parent))};CodeGenerator.prototype.printLeadingComments=function(node,parent){this._printComments(this.getComments("leadingComments",node,parent))};CodeGenerator.prototype.getComments=function(key,node,parent){if(t.isExpressionStatement(parent)){return[]}var comments=[];var nodes=[node];var self=this;if(t.isExpressionStatement(node)){nodes.push(node.argument)}_.each(nodes,function(node){comments=comments.concat(self._getComments(key,node))});return comments};CodeGenerator.prototype._getComments=function(key,node){return node&&node[key]||[]};CodeGenerator.prototype._printComments=function(comments){if(this.format.compact)return;if(!this.format.comments)return;if(!comments||!comments.length)return;var self=this;_.each(comments,function(comment){var skip=false;_.each(self.ast.comments,function(origComment){if(origComment.start===comment.start){if(origComment._displayed)skip=true;origComment._displayed=true;return false}});if(skip)return;self.newline(self.whitespace.getNewlinesBefore(comment));var column=self.position.column;var val=self.generateComment(comment);if(column&&!self.isLast(["\n"," ","[","{"])){self._push(" ");column++}if(comment.type==="Block"&&self.format.indent.adjustMultilineComment){var offset=comment.loc.start.column;if(offset){var newlineRegex=new RegExp("\\n\\s{1,"+offset+"}","g");val=val.replace(newlineRegex,"\n")}var indent=Math.max(self.indentSize(),column);val=val.replace(/\n/g,"\n"+util.repeat(indent))}if(column===0){val=self.getIndent()+val}self._push(val);self.newline(self.whitespace.getNewlinesAfter(comment))})}},{"../types":76,"../util":78,"./buffer":4,"./generators/base":6,"./generators/classes":7,"./generators/comprehensions":8,"./generators/expressions":9,"./generators/flow":10,"./generators/jsx":11,"./generators/methods":12,"./generators/modules":13,"./generators/playground":14,"./generators/statements":15,"./generators/template-literals":16,"./generators/types":17,"./node":18,"./position":21,"./source-map":22,"./whitespace":23,lodash:126}],6:[function(require,module,exports){exports.File=function(node,print){print(node.program)};exports.Program=function(node,print){print.sequence(node.body)};exports.BlockStatement=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();print.sequence(node.body,{indent:true});this.removeLast("\n");this.rightBrace()}}},{}],7:[function(require,module,exports){exports.ClassExpression=exports.ClassDeclaration=function(node,print){this.push("class");if(node.id){this.space();print(node.id)}if(node.superClass){this.push(" extends ");print(node.superClass)}this.space();print(node.body)};exports.ClassBody=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();this.indent();print.sequence(node.body);this.dedent();this.rightBrace()}};exports.MethodDefinition=function(node,print){if(node.static){this.push("static ")}this._method(node,print)}},{}],8:[function(require,module,exports){exports.ComprehensionBlock=function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" of ");print(node.right);this.push(")")};exports.ComprehensionExpression=function(node,print){this.push(node.generator?"(":"[");print.join(node.blocks,{separator:" "});this.space();if(node.filter){this.keyword("if");this.push("(");print(node.filter);this.push(")");this.space()}print(node.body);this.push(node.generator?")":"]")}},{}],9:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.UnaryExpression=function(node,print){var hasSpace=/[a-z]$/.test(node.operator);var arg=node.argument;if(t.isUpdateExpression(arg)||t.isUnaryExpression(arg)){hasSpace=true}if(t.isUnaryExpression(arg)&&arg.operator==="!"){hasSpace=false}this.push(node.operator);if(hasSpace)this.space();print(node.argument)};exports.UpdateExpression=function(node,print){if(node.prefix){this.push(node.operator);print(node.argument)}else{print(node.argument);this.push(node.operator)}};exports.ConditionalExpression=function(node,print){print(node.test);this.push(" ? ");print(node.consequent);this.push(" : ");print(node.alternate)};exports.NewExpression=function(node,print){this.push("new ");print(node.callee);if(node.arguments.length||this.format.parentheses){this.push("(");print.join(node.arguments,{separator:", "});this.push(")")}};exports.SequenceExpression=function(node,print){print.join(node.expressions,{separator:", "})
};exports.ThisExpression=function(){this.push("this")};exports.CallExpression=function(node,print){print(node.callee);this.push("(");print.join(node.arguments,{separator:", "});this.push(")")};var buildYieldAwait=function(keyword){return function(node,print){this.push(keyword);if(node.delegate)this.push("*");if(node.argument){this.space();print(node.argument)}}};exports.YieldExpression=buildYieldAwait("yield");exports.AwaitExpression=buildYieldAwait("await");exports.EmptyStatement=function(){this.semicolon()};exports.ExpressionStatement=function(node,print){print(node.expression);this.semicolon()};exports.BinaryExpression=exports.LogicalExpression=exports.AssignmentExpression=function(node,print){print(node.left);this.push(" "+node.operator+" ");print(node.right)};var SCIENTIFIC_NOTATION=/e/i;exports.MemberExpression=function(node,print){var obj=node.object;print(obj);if(!node.computed&&t.isMemberExpression(node.property)){throw new TypeError("Got a MemberExpression for MemberExpression property")}if(node.computed){this.push("[");print(node.property);this.push("]")}else{if(t.isLiteral(obj)&&util.isInteger(obj.value)&&!SCIENTIFIC_NOTATION.test(obj.value.toString())){this.push(".")}this.push(".");print(node.property)}}},{"../../types":76,"../../util":78}],10:[function(require,module,exports){exports.ClassProperty=function(){throw new Error("not implemented")}},{}],11:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.XJSAttribute=function(node,print){print(node.name);if(node.value){this.push("=");print(node.value)}};exports.XJSIdentifier=function(node){this.push(node.name)};exports.XJSNamespacedName=function(node,print){print(node.namespace);this.push(":");print(node.name)};exports.XJSMemberExpression=function(node,print){print(node.object);this.push(".");print(node.property)};exports.XJSSpreadAttribute=function(node,print){this.push("{...");print(node.argument);this.push("}")};exports.XJSExpressionContainer=function(node,print){this.push("{");print(node.expression);this.push("}")};exports.XJSElement=function(node,print){var self=this;var open=node.openingElement;print(open);if(open.selfClosing)return;this.indent();_.each(node.children,function(child){if(t.isLiteral(child)){self.push(child.value)}else{print(child)}});this.dedent();print(node.closingElement)};exports.XJSOpeningElement=function(node,print){this.push("<");print(node.name);if(node.attributes.length>0){this.space();print.join(node.attributes,{separator:" "})}this.push(node.selfClosing?" />":">")};exports.XJSClosingElement=function(node,print){this.push("</");print(node.name);this.push(">")};exports.XJSEmptyExpression=function(){}},{"../../types":76,lodash:126}],12:[function(require,module,exports){var t=require("../../types");exports._params=function(node,print){var self=this;this.push("(");print.join(node.params,{separator:", ",iterator:function(param,i){var def=node.defaults&&node.defaults[i];if(def){self.push(" = ");print(def)}}});if(node.rest){if(node.params.length){this.push(", ")}this.push("...");print(node.rest)}this.push(")")};exports._method=function(node,print){var value=node.value;var kind=node.kind;var key=node.key;if(!kind||kind==="init"){if(value.generator){this.push("*")}}else{this.push(kind+" ")}if(value.async)this.push("async ");if(node.computed){this.push("[");print(key);this.push("]")}else{print(key)}this._params(value,print);this.space();print(value.body)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,print){if(node.async)this.push("async ");this.push("function");if(node.generator)this.push("*");this.space();if(node.id)print(node.id);this._params(node,print);this.space();print(node.body)};exports.ArrowFunctionExpression=function(node,print){if(node.async)this.push("async ");if(node.params.length===1&&!node.defaults.length&&!node.rest&&t.isIdentifier(node.params[0])){print(node.params[0])}else{this._params(node,print)}this.push(" => ");print(node.body)}},{"../../types":76}],13:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.ImportSpecifier=function(node,print){if(node.id&&node.id.name==="default"){print(node.name)}else{return exports.ExportSpecifier.apply(this,arguments)}};exports.ExportSpecifier=function(node,print){print(node.id);if(node.name){this.push(" as ");print(node.name)}};exports.ExportBatchSpecifier=function(){this.push("*")};exports.ExportDeclaration=function(node,print){this.push("export ");var specifiers=node.specifiers;if(node.default){this.push("default ")}if(node.declaration){print(node.declaration);if(t.isStatement(node.declaration))return}else{if(specifiers.length===1&&t.isExportBatchSpecifier(specifiers[0])){print(specifiers[0])}else{this.push("{");if(specifiers.length){this.space();print.join(specifiers,{separator:", "});this.space()}this.push("}")}if(node.source){this.push(" from ");print(node.source)}}this.ensureSemicolon()};exports.ImportDeclaration=function(node,print){var self=this;this.push("import ");var specfiers=node.specifiers;if(specfiers&&specfiers.length){var foundImportSpecifier=false;_.each(node.specifiers,function(spec,i){if(+i>0){self.push(", ")}var isDefault=spec.id&&spec.id.name==="default";if(!isDefault&&spec.type!=="ImportBatchSpecifier"&&!foundImportSpecifier){foundImportSpecifier=true;self.push("{ ")}print(spec)});if(foundImportSpecifier){this.push(" }")}this.push(" from ")}print(node.source);this.semicolon()};exports.ImportBatchSpecifier=function(node,print){this.push("* as ");print(node.name)}},{"../../types":76,lodash:126}],14:[function(require,module,exports){var _=require("lodash");_.each(["BindMemberExpression","BindFunctionExpression"],function(type){exports[type]=function(){throw new ReferenceError("Trying to render non-standard playground node "+JSON.stringify(type))}})},{lodash:126}],15:[function(require,module,exports){var t=require("../../types");exports.WithStatement=function(node,print){this.keyword("with");this.push("(");print(node.object);this.push(")");print.block(node.body)};exports.IfStatement=function(node,print){this.keyword("if");this.push("(");print(node.test);this.push(") ");print.indentOnComments(node.consequent);if(node.alternate){if(this.isLast("}"))this.space();this.keyword("else");print.indentOnComments(node.alternate)}};exports.ForStatement=function(node,print){this.keyword("for");this.push("(");print(node.init);this.push(";");if(node.test){this.space();print(node.test)}this.push(";");if(node.update){this.space();print(node.update)}this.push(")");print.block(node.body)};exports.WhileStatement=function(node,print){this.keyword("while");this.push("(");print(node.test);this.push(")");print.block(node.body)};var buildForXStatement=function(op){return function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" "+op+" ");print(node.right);this.push(")");print.block(node.body)}};exports.ForInStatement=buildForXStatement("in");exports.ForOfStatement=buildForXStatement("of");exports.DoWhileStatement=function(node,print){this.keyword("do");print(node.body);this.space();this.keyword("while");this.push("(");print(node.test);this.push(");")};var buildLabelStatement=function(prefix,key){return function(node,print){this.push(prefix);var label=node[key||"label"];if(label){this.space();print(label)}this.semicolon()}};exports.ContinueStatement=buildLabelStatement("continue");exports.ReturnStatement=buildLabelStatement("return","argument");exports.BreakStatement=buildLabelStatement("break");exports.LabeledStatement=function(node,print){print(node.label);this.push(": ");print(node.body)};exports.TryStatement=function(node,print){this.keyword("try");print(node.block);this.space();print(node.handler);if(node.finalizer){this.space();this.push("finally ");print(node.finalizer)}};exports.CatchClause=function(node,print){this.keyword("catch");this.push("(");print(node.param);this.push(") ");print(node.body)};exports.ThrowStatement=function(node,print){this.push("throw ");print(node.argument);this.semicolon()};exports.SwitchStatement=function(node,print){this.keyword("switch");this.push("(");print(node.discriminant);this.push(") {");print.sequence(node.cases,{indent:true});this.push("}")};exports.SwitchCase=function(node,print){if(node.test){this.push("case ");print(node.test);this.push(":")}else{this.push("default:")}this.newline();print.sequence(node.consequent,{indent:true})};exports.DebuggerStatement=function(){this.push("debugger;")};exports.VariableDeclaration=function(node,print,parent){this.push(node.kind+" ");print.join(node.declarations,{separator:", "});if(!t.isFor(parent)){this.semicolon()}};exports.PrivateDeclaration=function(node,print){this.push("private ");print.join(node.declarations,{separator:", "});this.semicolon()};exports.VariableDeclarator=function(node,print){if(node.init){print(node.id);this.push(" = ");print(node.init)}else{print(node.id)}}},{"../../types":76}],16:[function(require,module,exports){var _=require("lodash");exports.TaggedTemplateExpression=function(node,print){print(node.tag);print(node.quasi)};exports.TemplateElement=function(node){this._push(node.value.raw)};exports.TemplateLiteral=function(node,print){this.push("`");var quasis=node.quasis;var self=this;var len=quasis.length;_.each(quasis,function(quasi,i){print(quasi);if(i+1<len){self.push("${ ");print(node.expressions[i]);self.push(" }")}});this._push("`")}},{lodash:126}],17:[function(require,module,exports){var _=require("lodash");exports.Identifier=function(node){this.push(node.name)};exports.SpreadElement=exports.SpreadProperty=function(node,print){this.push("...");print(node.argument)};exports.VirtualPropertyExpression=function(node,print){print(node.object);this.push("::");print(node.property)};exports.ObjectExpression=exports.ObjectPattern=function(node,print){var props=node.properties;if(props.length){this.push("{");this.space();print.join(props,{separator:", ",indent:true});this.space();this.push("}")}else{this.push("{}")}};exports.Property=function(node,print){if(node.method||node.kind==="get"||node.kind==="set"){this._method(node,print)}else{if(node.computed){this.push("[");print(node.key);this.push("]")}else{print(node.key);if(node.shorthand)return}this.push(": ");print(node.value)}};exports.ArrayExpression=exports.ArrayPattern=function(node,print){var elems=node.elements;var self=this;var len=elems.length;this.push("[");_.each(elems,function(elem,i){if(!elem){self.push(",")}else{if(i>0)self.push(" ");print(elem);if(i<len-1)self.push(",")}});this.push("]")};exports.Literal=function(node){var val=node.value;var type=typeof val;if(type==="string"){val=JSON.stringify(val);val=val.replace(/[\u000A\u000D\u2028\u2029]/g,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)});this.push(val)}else if(type==="boolean"||type==="number"){this.push(JSON.stringify(val))}else if(node.regex){this.push("/"+node.regex.pattern+"/"+node.regex.flags)}else if(val===null){this.push("null")}}},{lodash:126}],18:[function(require,module,exports){module.exports=Node;var whitespace=require("./whitespace");var parens=require("./parentheses");var t=require("../../types");var _=require("lodash");var find=function(obj,node,parent){var result;_.each(obj,function(fn,type){if(t["is"+type](node)){result=fn(node,parent);if(result!=null)return false}});return result};function Node(node,parent){this.parent=parent;this.node=node}Node.prototype.isUserWhitespacable=function(){return t.isUserWhitespacable(this.node)};Node.prototype.needsWhitespace=function(type){var parent=this.parent;var node=this.node;if(!node)return 0;if(t.isExpressionStatement(node)){node=node.expression}var lines=find(whitespace[type].nodes,node,parent);if(lines)return lines;_.each(find(whitespace[type].list,node,parent),function(expr){lines=Node.needsWhitespace(expr,node,type);if(lines)return false});return lines||0};Node.prototype.needsWhitespaceBefore=function(){return this.needsWhitespace("before")};Node.prototype.needsWhitespaceAfter=function(){return this.needsWhitespace("after")};Node.prototype.needsParens=function(){var parent=this.parent;var node=this.node;if(!parent)return false;if(t.isNewExpression(parent)&&parent.callee===node){return t.isCallExpression(node)||_.some(node,function(val){return t.isCallExpression(val)})}return find(parens,node,parent)};_.each(Node.prototype,function(fn,key){Node[key]=function(node,parent){var n=new Node(node,parent);var args=_.toArray(arguments).slice(2);return n[key].apply(n,args)}})},{"../../types":76,"./parentheses":19,"./whitespace":20,lodash:126}],19:[function(require,module,exports){var t=require("../../types");var _=require("lodash");var PRECEDENCE={};_.each([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]],function(tier,i){_.each(tier,function(op){PRECEDENCE[op]=i})});exports.Binary=function(node,parent){if(t.isCallExpression(parent)&&parent.callee===node){return true}if(t.isUnaryLike(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isBinary(parent)){var parentOp=parent.operator;var parentPos=PRECEDENCE[parentOp];var nodeOp=node.operator;var nodePos=PRECEDENCE[nodeOp];if(parentPos>nodePos){return true}if(parentPos===nodePos&&parent.right===node){return true}}};exports.BinaryExpression=function(node,parent){if(node.operator==="in"){if(t.isVariableDeclarator(parent)){return true}if(t.isFor(parent)){return true}}};exports.SequenceExpression=function(node,parent){if(t.isForStatement(parent)){return false}if(t.isExpressionStatement(parent)&&parent.expression===node){return false}return true};exports.YieldExpression=function(node,parent){return t.isBinary(parent)||t.isUnaryLike(parent)||t.isCallExpression(parent)||t.isMemberExpression(parent)||t.isNewExpression(parent)||t.isConditionalExpression(parent)||t.isYieldExpression(parent)};exports.ClassExpression=function(node,parent){return t.isExpressionStatement(parent)};exports.UnaryLike=function(node,parent){return t.isMemberExpression(parent)&&parent.object===node};exports.FunctionExpression=function(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}};exports.AssignmentExpression=exports.ConditionalExpression=function(node,parent){if(t.isUnaryLike(parent)){return true}if(t.isBinary(parent)){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}if(t.isConditionalExpression(parent)&&parent.test===node){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}},{"../../types":76,lodash:126}],20:[function(require,module,exports){var _=require("lodash");var t=require("../../types");exports.before={nodes:{Property:function(node,parent){if(parent.properties[0]===node){return 1}},SpreadProperty:function(node,parent){return exports.before.nodes.Property(node,parent)},SwitchCase:function(node,parent){if(parent.cases[0]===node){return 1}},CallExpression:function(node){if(t.isFunction(node.callee)){return 1}}}};exports.after={nodes:{AssignmentExpression:function(node){if(t.isFunction(node.right)){return 1}}},list:{VariableDeclaration:function(node){return _.map(node.declarations,"init")},ArrayExpression:function(node){return node.elements},ObjectExpression:function(node){return node.properties}}};_.each({Function:1,Class:1,For:1,ArrayExpression:{after:1},ObjectExpression:{after:1},SwitchStatement:1,IfStatement:{before:1},CallExpression:{after:1},Literal:{after:1}},function(amounts,type){if(_.isNumber(amounts))amounts={after:amounts,before:amounts};_.each(amounts,function(amount,key){exports[key].nodes[type]=function(){return amount}})})},{"../../types":76,lodash:126}],21:[function(require,module,exports){module.exports=Position;var _=require("lodash");function Position(){this.line=1;this.column=0}Position.prototype.push=function(str){var self=this;_.each(str,function(cha){if(cha==="\n"){self.line++;self.column=0}else{self.column++}})};Position.prototype.unshift=function(str){var self=this;_.each(str,function(cha){if(cha==="\n"){self.line--}else{self.column--}})}},{lodash:126}],22:[function(require,module,exports){module.exports=SourceMap;var sourceMap=require("source-map");var t=require("../types");function SourceMap(position,opts,code){this.position=position;this.opts=opts;if(opts.sourceMap){this.map=new sourceMap.SourceMapGenerator({file:opts.sourceMapName,sourceRoot:opts.sourceRoot});this.map.setSourceContent(opts.sourceFileName,code)}else{this.map=null}}SourceMap.prototype.get=function(){var map=this.map;if(map){return map.toJSON()}else{return map}};SourceMap.prototype.mark=function(node,type){var loc=node.loc;if(!loc)return;var map=this.map;if(!map)return;if(t.isProgram(node)||t.isFile(node))return;var position=this.position;var generated={line:position.line,column:position.column};var original=loc[type];if(generated.line===original.line&&generated.column===original.column)return;map.addMapping({source:this.opts.sourceFileName,generated:generated,original:original})}},{"../types":76,"source-map":168}],23:[function(require,module,exports){module.exports=Whitespace;var _=require("lodash");function Whitespace(tokens,comments){this.tokens=_.sortBy(tokens.concat(comments),"start");this.used=[]}Whitespace.prototype.getNewlinesBefore=function(node){var startToken;var endToken;var tokens=this.tokens;_.each(tokens,function(token,i){if(node.start===token.start){startToken=tokens[i-1];endToken=token;return false}});return this.getNewlinesBetween(startToken,endToken)};Whitespace.prototype.getNewlinesAfter=function(node){var startToken;var endToken;var tokens=this.tokens;_.each(tokens,function(token,i){if(node.end===token.end){startToken=token;endToken=tokens[i+1];return false}});if(endToken.type.type==="eof"){return 1}else{return this.getNewlinesBetween(startToken,endToken)}};Whitespace.prototype.getNewlinesBetween=function(startToken,endToken){var start=startToken?startToken.loc.end.line:1;var end=endToken.loc.start.line;var lines=0;for(var line=start;line<end;line++){if(!_.contains(this.used,line)){this.used.push(line);lines++}}return lines}},{lodash:126}],24:[function(require,module,exports){var t=require("./types");var _=require("lodash");var estraverse=require("estraverse");_.extend(estraverse.VisitorKeys,t.VISITOR_KEYS);var types=require("ast-types");var def=types.Type.def;var or=types.Type.or;def("ImportBatchSpecifier").bases("Specifier").build("name").field("name",def("Identifier"));def("VirtualPropertyExpression").bases("Expression").build("object","property").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression")));def("PrivateDeclaration").bases("Declaration").build("declarations").field("declarations",[def("Identifier")]);def("BindMemberExpression").bases("Expression").build("object","property","arguments").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("arguments",[def("Expression")]);def("BindFunctionExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);types.finalize()},{"./types":76,"ast-types":92,estraverse:120,lodash:126}],25:[function(require,module,exports){module.exports=DefaultFormatter;var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");function DefaultFormatter(file){this.file=file;this.localExports=this.getLocalExports();this.remapAssignments()}DefaultFormatter.prototype.getLocalExports=function(){var localExports={};traverse(this.file.ast,{enter:function(node){var declar=node&&node.declaration;if(t.isExportDeclaration(node)&&declar&&t.isStatement(declar)){_.extend(localExports,t.getIds(declar,true))}}});return localExports};DefaultFormatter.prototype.remapExportAssignment=function(node){return t.assignmentExpression("=",node.left,t.assignmentExpression(node.operator,t.memberExpression(t.identifier("exports"),node.left),node.right))};DefaultFormatter.prototype.remapAssignments=function(){var localExports=this.localExports;var self=this;var isLocalReference=function(node,scope){var name=node.name;return t.isIdentifier(node)&&localExports[name]&&localExports[name]===scope.get(name,true)};traverse(this.file.ast,{enter:function(node,parent,scope){if(t.isUpdateExpression(node)&&isLocalReference(node.argument,scope)){this.stop();var assign=t.assignmentExpression(node.operator[0]+"=",node.argument,t.literal(1));var remapped=self.remapExportAssignment(assign);if(t.isExpressionStatement(parent)||node.prefix){return remapped}var nodes=[];nodes.push(remapped);var operator;if(node.operator==="--"){operator="+"}else{operator="-"}nodes.push(t.binaryExpression(operator,node.argument,t.literal(1)));return t.sequenceExpression(nodes)}if(t.isAssignmentExpression(node)&&isLocalReference(node.left,scope)){this.stop();return self.remapExportAssignment(node)}}})};DefaultFormatter.prototype.getModuleName=function(){var opts=this.file.opts;var filenameRelative=opts.filenameRelative;var moduleName="";if(opts.moduleRoot){moduleName=opts.moduleRoot+"/"}if(!opts.filenameRelative){return moduleName+opts.filename.replace(/^\//,"")}if(opts.sourceRoot){var sourceRootRegEx=new RegExp("^"+opts.sourceRoot+"/?");filenameRelative=filenameRelative.replace(sourceRootRegEx,"")}filenameRelative=filenameRelative.replace(/\.(.*?)$/,"");moduleName+=filenameRelative;return moduleName};DefaultFormatter.prototype._pushStatement=function(ref,nodes){if(t.isClass(ref)||t.isFunction(ref)){if(ref.id){nodes.push(t.toStatement(ref));ref=ref.id}}return ref};DefaultFormatter.prototype._hoistExport=function(declar,assign,priority){if(t.isFunctionDeclaration(declar)){assign._blockHoist=priority||2}return assign};DefaultFormatter.prototype._exportSpecifier=function(getRef,specifier,node,nodes){var inherits=false;if(node.specifiers.length===1)inherits=node;if(node.source){if(t.isExportBatchSpecifier(specifier)){nodes.push(this._exportsWildcard(getRef(),node))}else{nodes.push(this._exportsAssign(t.getSpecifierName(specifier),t.memberExpression(getRef(),specifier.id),node))}}else{nodes.push(this._exportsAssign(t.getSpecifierName(specifier),specifier.id,node))}};DefaultFormatter.prototype._exportsWildcard=function(objectIdentifier){return util.template("exports-wildcard",{OBJECT:objectIdentifier},true)};DefaultFormatter.prototype._exportsAssign=function(id,init){return util.template("exports-assign",{VALUE:init,KEY:id},true)};DefaultFormatter.prototype.exportDeclaration=function(node,nodes){var declar=node.declaration;var id=declar.id;if(node.default){id=t.identifier("default")}var assign;if(t.isVariableDeclaration(declar)){for(var i in declar.declarations){var decl=declar.declarations[i];decl.init=this._exportsAssign(decl.id,decl.init,node).expression;var newDeclar=t.variableDeclaration(declar.kind,[decl]);if(i==="0")t.inherits(newDeclar,declar);nodes.push(newDeclar)}}else{var ref=declar;if(t.isFunctionDeclaration(declar)||t.isClassDeclaration(declar)){ref=declar.id;nodes.push(declar)}assign=this._exportsAssign(id,ref,node);nodes.push(assign);this._hoistExport(declar,assign)}}},{"../../traverse":72,"../../types":76,"../../util":78,lodash:126}],26:[function(require,module,exports){module.exports=AMDFormatter;var DefaultFormatter=require("./_default");var util=require("../../util");var t=require("../../types");var _=require("lodash");function AMDFormatter(){DefaultFormatter.apply(this,arguments);this.ids={}}util.inherits(AMDFormatter,DefaultFormatter);AMDFormatter.prototype.buildDependencyLiterals=function(){var names=[];for(var name in this.ids){names.push(t.literal(name))}return names};AMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[t.literal("exports")].concat(this.buildDependencyLiterals());names=t.arrayExpression(names);var params=_.values(this.ids);params.unshift(t.identifier("exports"));var container=t.functionExpression(null,params,t.blockStatement(body));var defineArgs=[names,container];var moduleName=this.getModuleName();if(moduleName)defineArgs.unshift(t.literal(moduleName));var call=t.callExpression(t.identifier("define"),defineArgs);program.body=[t.expressionStatement(call)]};AMDFormatter.prototype.getModuleName=function(){if(this.file.opts.moduleIds){return DefaultFormatter.prototype.getModuleName.apply(this,arguments)}else{return null}};AMDFormatter.prototype._push=function(node){var id=node.source.value;var ids=this.ids;if(ids[id]){return ids[id]}else{return this.ids[id]=this.file.generateUidIdentifier(id)}};AMDFormatter.prototype.importDeclaration=function(node){this._push(node)};AMDFormatter.prototype.importSpecifier=function(specifier,node,nodes){var key=t.getSpecifierName(specifier);var ref=this._push(node);if(t.isImportBatchSpecifier(specifier)){}else if(t.isSpecifierDefault(specifier)&&!this.noInteropRequire){ref=t.callExpression(this.file.addDeclaration("interop-require"),[ref])}else{ref=t.memberExpression(ref,specifier.id,false)}nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,ref)]))};AMDFormatter.prototype.exportSpecifier=function(specifier,node,nodes){var self=this;return this._exportSpecifier(function(){return self._push(node)},specifier,node,nodes)}},{"../../types":76,"../../util":78,"./_default":25,lodash:126}],27:[function(require,module,exports){module.exports=CommonJSFormatter;var DefaultFormatter=require("./_default");var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");function CommonJSFormatter(file){DefaultFormatter.apply(this,arguments);var hasNonDefaultExports=false;traverse(file.ast,{enter:function(node){if(t.isExportDeclaration(node)&&!node.default)hasNonDefaultExports=true}});this.hasNonDefaultExports=hasNonDefaultExports}util.inherits(CommonJSFormatter,DefaultFormatter);CommonJSFormatter.prototype.importSpecifier=function(specifier,node,nodes){var variableName=t.getSpecifierName(specifier);if(t.isSpecifierDefault(specifier)){nodes.push(t.variableDeclaration("var",[t.variableDeclarator(variableName,t.callExpression(this.file.addDeclaration("interop-require"),[util.template("require",{MODULE_NAME:node.source})]))]))}else{var templateName="require-assign";if(specifier.type!=="ImportBatchSpecifier")templateName+="-key";nodes.push(util.template(templateName,{VARIABLE_NAME:variableName,MODULE_NAME:node.source,KEY:specifier.id}))}};CommonJSFormatter.prototype.importDeclaration=function(node,nodes){nodes.push(util.template("require",{MODULE_NAME:node.source},true))};CommonJSFormatter.prototype.exportDeclaration=function(node,nodes){if(node.default){var declar=node.declaration;var assign;var templateName="exports-default-module";if(this.hasNonDefaultExports)templateName="exports-default-module-override";if(t.isFunction(declar)||!this.hasNonDefaultExports){assign=util.template(templateName,{VALUE:this._pushStatement(declar,nodes)},true);nodes.push(this._hoistExport(declar,assign,3));return}else{assign=util.template("common-export-default-assign",true);assign._blockHoist=0;nodes.push(assign)}}DefaultFormatter.prototype.exportDeclaration.apply(this,arguments)};CommonJSFormatter.prototype.exportSpecifier=function(specifier,node,nodes){this._exportSpecifier(function(){return t.callExpression(t.identifier("require"),[node.source])},specifier,node,nodes)}},{"../../traverse":72,"../../types":76,"../../util":78,"./_default":25}],28:[function(require,module,exports){module.exports=IgnoreFormatter;var t=require("../../types");function IgnoreFormatter(){}IgnoreFormatter.prototype.exportDeclaration=function(node,nodes){var declar=t.toStatement(node.declaration,true);if(declar)nodes.push(t.inherits(declar,node))};IgnoreFormatter.prototype.importDeclaration=IgnoreFormatter.prototype.importSpecifier=IgnoreFormatter.prototype.exportSpecifier=function(){}},{"../../types":76}],29:[function(require,module,exports){module.exports=SystemFormatter;var AMDFormatter=require("./amd");var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");function SystemFormatter(file){this.exportIdentifier=file.generateUidIdentifier("export");this.noInteropRequire=true;AMDFormatter.apply(this,arguments)}util.inherits(SystemFormatter,AMDFormatter);SystemFormatter.prototype._addImportSource=function(node,exportNode){node._importSource=exportNode.source&&exportNode.source.value;return node};SystemFormatter.prototype._exportsWildcard=function(objectIdentifier,node){var leftIdentifier=this.file.generateUidIdentifier("key");var valIdentifier=t.memberExpression(objectIdentifier,leftIdentifier,true);var left=t.variableDeclaration("var",[t.variableDeclarator(leftIdentifier)]);var right=objectIdentifier;var block=t.blockStatement([this.buildExportCall(leftIdentifier,valIdentifier)]);return this._addImportSource(t.forInStatement(left,right,block),node)};SystemFormatter.prototype._exportsAssign=function(id,init,node){var call=this.buildExportCall(t.literal(id.name),init,true);return this._addImportSource(call,node)};SystemFormatter.prototype.remapExportAssignment=function(node){return this.buildExportCall(t.literal(node.left.name),node)};SystemFormatter.prototype.buildExportCall=function(id,init,isStatement){var call=t.callExpression(this.exportIdentifier,[id,init]);if(isStatement){return t.expressionStatement(call)}else{return call}};SystemFormatter.prototype.importSpecifier=function(specifier,node,nodes){AMDFormatter.prototype.importSpecifier.apply(this,arguments);this._addImportSource(_.last(nodes),node)};SystemFormatter.prototype.buildRunnerSetters=function(block,hoistDeclarators){return t.arrayExpression(_.map(this.ids,function(uid,source){var nodes=[];traverse(block,{enter:function(node){if(node._importSource===source){if(t.isVariableDeclaration(node)){_.each(node.declarations,function(declar){hoistDeclarators.push(t.variableDeclarator(declar.id));nodes.push(t.expressionStatement(t.assignmentExpression("=",declar.id,declar.init)))})}else{nodes.push(node)}this.remove()}}});return t.functionExpression(null,[uid],t.blockStatement(nodes))}))};SystemFormatter.prototype.transform=function(ast){var program=ast.program;var hoistDeclarators=[];var moduleName=this.getModuleName();var moduleNameLiteral=t.literal(moduleName);var block=t.blockStatement(program.body);var runner=util.template("system",{MODULE_NAME:moduleNameLiteral,MODULE_DEPENDENCIES:t.arrayExpression(this.buildDependencyLiterals()),EXPORT_IDENTIFIER:this.exportIdentifier,SETTERS:this.buildRunnerSetters(block,hoistDeclarators),EXECUTE:t.functionExpression(null,[],block)},true);var handlerBody=runner.expression.arguments[2].body.body;if(!moduleName)runner.expression.arguments.shift();var returnStatement=handlerBody.pop();traverse(block,{enter:function(node,parent,scope){if(t.isFunction(node)){return this.stop()}if(t.isVariableDeclaration(node)){if(node.kind!=="var"&&!t.isProgram(parent)){return}var nodes=[];_.each(node.declarations,function(declar){hoistDeclarators.push(t.variableDeclarator(declar.id));if(declar.init){var assign=t.expressionStatement(t.assignmentExpression("=",declar.id,declar.init));nodes.push(assign)}});if(t.isFor(parent)){if(parent.left===node){return node.declarations[0].id}if(parent.init===node){return t.toSequenceExpression(nodes,scope)}}return nodes}}});if(hoistDeclarators.length){var hoistDeclar=t.variableDeclaration("var",hoistDeclarators);hoistDeclar._blockHoist=true;handlerBody.unshift(hoistDeclar)}traverse(block,{enter:function(node){if(t.isFunction(node))this.stop();if(t.isFunctionDeclaration(node)||node._blockHoist){handlerBody.push(node);this.remove()}}});handlerBody.push(returnStatement);program.body=[runner]}},{"../../traverse":72,"../../types":76,"../../util":78,"./amd":26,lodash:126}],30:[function(require,module,exports){module.exports=UMDFormatter;var AMDFormatter=require("./amd");var util=require("../../util");var t=require("../../types");
var _=require("lodash");function UMDFormatter(){AMDFormatter.apply(this,arguments)}util.inherits(UMDFormatter,AMDFormatter);UMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[];for(var name in this.ids){names.push(t.literal(name))}var ids=_.values(this.ids);var args=[t.identifier("exports")].concat(ids);var factory=t.functionExpression(null,args,t.blockStatement(body));var defineArgs=[t.arrayExpression([t.literal("exports")].concat(names))];var moduleName=this.getModuleName();if(moduleName)defineArgs.unshift(t.literal(moduleName));var runner=util.template("umd-runner-body",{AMD_ARGUMENTS:defineArgs,COMMON_ARGUMENTS:names.map(function(name){return t.callExpression(t.identifier("require"),[name])})});var call=t.callExpression(runner,[factory]);program.body=[t.expressionStatement(call)]}},{"../../types":76,"../../util":78,"./amd":26,lodash:126}],31:[function(require,module,exports){module.exports=transform;var Transformer=require("./transformer");var File=require("../file");var util=require("../util");var _=require("lodash");function transform(code,opts){var file=new File(opts);return file.parse(code)}transform.fromAst=function(ast,code,opts){ast=util.normaliseAst(ast);var file=new File(opts);file.addCode(code);file.transform(ast);return file.generate()};transform._ensureTransformerNames=function(type,keys){for(var i in keys){var key=keys[i];if(!_.has(transform.transformers,key)){throw new ReferenceError("unknown transformer "+key+" specified in "+type)}}};transform.transformers={};transform.moduleFormatters={common:require("./modules/common"),system:require("./modules/system"),ignore:require("./modules/ignore"),amd:require("./modules/amd"),umd:require("./modules/umd")};_.each({specBlockHoistFunctions:require("./transformers/spec-block-hoist-functions"),specNoForInOfAssignment:require("./transformers/spec-no-for-in-of-assignment"),specNoDuplicateProperties:require("./transformers/spec-no-duplicate-properties"),methodBinding:require("./transformers/playground-method-binding"),memoizationOperator:require("./transformers/playground-memoization-operator"),objectGetterMemoization:require("./transformers/playground-object-getter-memoization"),asyncToGenerator:require("./transformers/optional-async-to-generator"),bluebirdCoroutines:require("./transformers/optional-bluebird-coroutines"),react:require("./transformers/react"),modules:require("./transformers/es6-modules"),propertyNameShorthand:require("./transformers/es6-property-name-shorthand"),arrayComprehension:require("./transformers/es7-array-comprehension"),generatorComprehension:require("./transformers/es7-generator-comprehension"),arrowFunctions:require("./transformers/es6-arrow-functions"),classes:require("./transformers/es6-classes"),computedPropertyNames:require("./transformers/es6-computed-property-names"),objectSpread:require("./transformers/es7-object-spread"),exponentiationOperator:require("./transformers/es7-exponentiation-operator"),spread:require("./transformers/es6-spread"),templateLiterals:require("./transformers/es6-template-literals"),propertyMethodAssignment:require("./transformers/es5-property-method-assignment"),destructuring:require("./transformers/es6-destructuring"),defaultParameters:require("./transformers/es6-default-parameters"),forOf:require("./transformers/es6-for-of"),unicodeRegex:require("./transformers/es6-unicode-regex"),abstractReferences:require("./transformers/es7-abstract-references"),constants:require("./transformers/es6-constants"),letScoping:require("./transformers/es6-let-scoping"),_blockHoist:require("./transformers/_block-hoist"),generators:require("./transformers/es6-generators"),restParameters:require("./transformers/es6-rest-parameters"),_declarations:require("./transformers/_declarations"),_aliasFunctions:require("./transformers/_alias-functions"),_moduleFormatter:require("./transformers/_module-formatter"),useStrict:require("./transformers/use-strict"),coreAliasing:require("./transformers/optional-core-aliasing"),undefinedToVoid:require("./transformers/optional-undefined-to-void"),specPropertyLiterals:require("./transformers/spec-property-literals"),specMemberExpressionLiterals:require("./transformers/spec-member-expression-literals")},function(transformer,key){transform.transformers[key]=new Transformer(key,transformer)})},{"../file":3,"../util":78,"./modules/amd":26,"./modules/common":27,"./modules/ignore":28,"./modules/system":29,"./modules/umd":30,"./transformer":32,"./transformers/_alias-functions":33,"./transformers/_block-hoist":34,"./transformers/_declarations":35,"./transformers/_module-formatter":36,"./transformers/es5-property-method-assignment":37,"./transformers/es6-arrow-functions":38,"./transformers/es6-classes":39,"./transformers/es6-computed-property-names":40,"./transformers/es6-constants":41,"./transformers/es6-default-parameters":42,"./transformers/es6-destructuring":43,"./transformers/es6-for-of":44,"./transformers/es6-generators":45,"./transformers/es6-let-scoping":46,"./transformers/es6-modules":47,"./transformers/es6-property-name-shorthand":48,"./transformers/es6-rest-parameters":49,"./transformers/es6-spread":50,"./transformers/es6-template-literals":51,"./transformers/es6-unicode-regex":52,"./transformers/es7-abstract-references":53,"./transformers/es7-array-comprehension":54,"./transformers/es7-exponentiation-operator":55,"./transformers/es7-generator-comprehension":56,"./transformers/es7-object-spread":57,"./transformers/optional-async-to-generator":58,"./transformers/optional-bluebird-coroutines":59,"./transformers/optional-core-aliasing":60,"./transformers/optional-undefined-to-void":61,"./transformers/playground-memoization-operator":62,"./transformers/playground-method-binding":63,"./transformers/playground-object-getter-memoization":64,"./transformers/react":65,"./transformers/spec-block-hoist-functions":66,"./transformers/spec-member-expression-literals":67,"./transformers/spec-no-duplicate-properties":68,"./transformers/spec-no-for-in-of-assignment":69,"./transformers/spec-property-literals":70,"./transformers/use-strict":71,lodash:126}],32:[function(require,module,exports){module.exports=Transformer;var traverse=require("../traverse");var t=require("../types");var _=require("lodash");function Transformer(key,transformer,opts){this.manipulateOptions=transformer.manipulateOptions;this.experimental=!!transformer.experimental;this.transformer=Transformer.normalise(transformer);this.optional=!!transformer.optional;this.opts=opts||{};this.key=key}Transformer.normalise=function(transformer){if(_.isFunction(transformer)){transformer={ast:transformer}}_.each(transformer,function(fns,type){if(type[0]==="_")return;if(_.isFunction(fns))fns={enter:fns};if(!_.isObject(fns))return;transformer[type]=fns;var aliases=t.FLIPPED_ALIAS_KEYS[type];if(aliases){_.each(aliases,function(alias){transformer[alias]=fns})}});return transformer};Transformer.prototype.astRun=function(file,key){var transformer=this.transformer;var ast=file.ast;if(transformer.ast&&transformer.ast[key]){transformer.ast[key](ast,file)}};Transformer.prototype.transform=function(file){var transformer=this.transformer;var ast=file.ast;var build=function(exit){return function(node,parent,scope){var fns=transformer[node.type];if(!fns)return;var fn=fns.enter;if(exit)fn=fns.exit;if(!fn)return;return fn(node,parent,file,scope)}};this.astRun(file,"before");traverse(ast,{enter:build(),exit:build(true)});this.astRun(file,"after")};Transformer.prototype.canRun=function(file){var opts=file.opts;var key=this.key;if(key[0]==="_")return true;var blacklist=opts.blacklist;if(blacklist.length&&_.contains(blacklist,key))return false;var whitelist=opts.whitelist;if(whitelist.length&&!_.contains(whitelist,key))return false;if(this.optional&&!_.contains(opts.optional,key))return false;if(this.experimental&&!opts.experimental)return false;return true}},{"../traverse":72,"../types":76,lodash:126}],33:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");var go=function(getBody,node,file,scope){var argumentsId;var thisId;var getArgumentsId=function(){return argumentsId=argumentsId||file.generateUidIdentifier("arguments",scope)};var getThisId=function(){return thisId=thisId||file.generateUidIdentifier("this",scope)};traverse(node,{enter:function(node){if(!node._aliasFunction){if(t.isFunction(node)){return this.stop()}else{return}}traverse(node,{enter:function(node,parent){if(t.isFunction(node)&&!node._aliasFunction){return this.stop()}if(node._ignoreAliasFunctions)return this.stop();var getId;if(t.isIdentifier(node)&&node.name==="arguments"){getId=getArgumentsId}else if(t.isThisExpression(node)){getId=getThisId}else{return}if(t.isReferenced(node,parent))return getId()}});return this.stop()}});var body;var pushDeclaration=function(id,init){body=body||getBody();body.unshift(t.variableDeclaration("var",[t.variableDeclarator(id,init)]))};if(argumentsId){pushDeclaration(argumentsId,t.identifier("arguments"))}if(thisId){pushDeclaration(thisId,t.identifier("this"))}};exports.Program=function(node,parent,file,scope){go(function(){return node.body},node,file,scope)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,parent,file,scope){go(function(){t.ensureBlock(node);return node.body.body},node,file,scope)}},{"../../traverse":72,"../../types":76}],34:[function(require,module,exports){var _=require("lodash");exports.BlockStatement=exports.Program={exit:function(node){var hasChange=false;for(var i in node.body){var bodyNode=node.body[i];if(bodyNode&&bodyNode._blockHoist!=null)hasChange=true}if(!hasChange)return;var nodePriorities=_.groupBy(node.body,function(bodyNode){var priority=bodyNode._blockHoist;if(priority==null)priority=1;if(priority===true)priority=2;return priority});node.body=_.flatten(_.values(nodePriorities).reverse())}}},{lodash:126}],35:[function(require,module,exports){var t=require("../../types");exports.BlockStatement=exports.Program=function(node){var kinds={};var kind;for(var i in node._declarations){var declar=node._declarations[i];kind=declar.kind||"var";var declarNode=t.variableDeclarator(declar.id,declar.init);if(!declar.init){kinds[kind]=kinds[kind]||[];kinds[kind].push(declarNode)}else{node.body.unshift(t.variableDeclaration(kind,[declarNode]))}}for(kind in kinds){node.body.unshift(t.variableDeclaration(kind,kinds[kind]))}}},{"../../types":76}],36:[function(require,module,exports){var transform=require("../transform");exports.ast={exit:function(ast,file){if(!transform.transformers.modules.canRun(file))return;if(file.moduleFormatter.transform){file.moduleFormatter.transform(ast)}}}},{"../transform":31}],37:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.Property=function(node){if(node.method)node.method=false};exports.ObjectExpression=function(node,parent,file){var mutatorMap={};var hasAny=false;node.properties=node.properties.filter(function(prop){if(prop.kind==="get"||prop.kind==="set"){hasAny=true;util.pushMutatorMap(mutatorMap,prop.key,prop.kind,prop.value);return false}else{return true}});if(!hasAny)return;if(node.properties.length){var objId=t.getUid(parent,file);return util.template("object-define-properties-closure",{KEY:objId,OBJECT:node,CONTENT:util.template("object-define-properties",{OBJECT:objId,PROPS:util.buildDefineProperties(mutatorMap)})})}else{return util.template("object-define-properties",{OBJECT:node,PROPS:util.buildDefineProperties(mutatorMap)})}}},{"../../types":76,"../../util":78}],38:[function(require,module,exports){var t=require("../../types");exports.ArrowFunctionExpression=function(node){t.ensureBlock(node);node._aliasFunction="arrow";node.expression=false;node.type="FunctionExpression";return node}},{"../../types":76}],39:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");exports.ClassDeclaration=function(node,parent,file,scope){var closure=true;if(t.isProgram(parent)||t.isBlockStatement(parent)){closure=false}var factory=new Class(node,file,scope,closure);var newNode=factory.run();if(factory.closure){if(closure){scope.push({kind:"var",key:node.id.key,id:node.id});return t.assignmentExpression("=",node.id,newNode)}else{return t.variableDeclaration("let",[t.variableDeclarator(node.id,newNode)])}}else{return newNode}};exports.ClassExpression=function(node,parent,file,scope){return new Class(node,file,scope,true).run()};function Class(node,file,scope,closure){this.closure=closure;this.scope=scope;this.node=node;this.file=file;this.hasInstanceMutators=false;this.hasStaticMutators=false;this.instanceMutatorMap={};this.staticMutatorMap={};this.hasConstructor=false;this.className=node.id||file.generateUidIdentifier("class",scope);this.superName=node.superClass}Class.prototype.run=function(){var superName=this.superName;var className=this.className;var file=this.file;var body=this.body=[];var constructor=t.functionExpression(null,[],t.blockStatement([]));if(this.node.id)constructor.id=className;this.constructor=constructor;body.push(t.variableDeclaration("let",[t.variableDeclarator(className,constructor)]));if(superName){this.closure=true;var superRef=t.getUid(superName,this.file);body.unshift(t.variableDeclaration("var",[t.variableDeclarator(superRef,superName)]));superName=superRef;this.superName=superName;body.push(t.expressionStatement(t.callExpression(file.addDeclaration("inherits"),[className,superName])))}this.buildBody();t.inheritsComments(body[0],this.node);if(this.closure){if(body.length===1){return constructor}else{body.push(t.returnStatement(className));return t.callExpression(t.functionExpression(null,[],t.blockStatement(body)),[])}}else{return body}};Class.prototype.buildBody=function(){var constructor=this.constructor;var className=this.className;var superName=this.superName;var classBody=this.node.body.body;var body=this.body;var self=this;for(var i in classBody){var node=classBody[i];if(t.isMethodDefinition(node)){self.replaceInstanceSuperReferences(node);if(node.key.name==="constructor"){self.pushConstructor(node)}else{self.pushMethod(node)}}else if(t.isPrivateDeclaration(node)){self.closure=true;body.unshift(node)}}if(!this.hasConstructor&&superName&&!t.isFalsyExpression(superName)){constructor.body.body.push(util.template("class-super-constructor-call",{SUPER_NAME:superName},true))}var instanceProps;var staticProps;if(this.hasInstanceMutators){var protoId=util.template("prototype-identifier",{CLASS_NAME:className});instanceProps=util.buildDefineProperties(this.instanceMutatorMap,protoId)}if(this.hasStaticMutators){staticProps=util.buildDefineProperties(this.staticMutatorMap,className)}if(instanceProps||staticProps){staticProps=staticProps||t.literal(null);var args=[className,staticProps];if(instanceProps)args.push(instanceProps);body.push(t.expressionStatement(t.callExpression(this.file.addDeclaration("prototype-properties"),args)))}};Class.prototype.pushMethod=function(node){var methodName=node.key;var kind=node.kind;if(kind===""){var className=this.className;if(!node.static)className=t.memberExpression(className,t.identifier("prototype"));methodName=t.memberExpression(className,methodName,node.computed);var expr=t.expressionStatement(t.assignmentExpression("=",methodName,node.value));t.inheritsComments(expr,node);this.body.push(expr)}else{var mutatorMap=this.instanceMutatorMap;if(node.static){this.hasStaticMutators=true;mutatorMap=this.staticMutatorMap}else{this.hasInstanceMutators=true}util.pushMutatorMap(mutatorMap,methodName,kind,node)}};Class.prototype.superIdentifier=function(methodNode,id,parent){var methodName=methodNode.key;var superName=this.superName||t.identifier("Function");if(parent.property===id){return}else if(t.isCallExpression(parent,{callee:id})){parent.arguments.unshift(t.thisExpression());if(methodName.name==="constructor"){return t.memberExpression(superName,t.identifier("call"))}else{id=superName;if(!methodNode.static){id=t.memberExpression(id,t.identifier("prototype"))}id=t.memberExpression(id,methodName,methodNode.computed);return t.memberExpression(id,t.identifier("call"))}}else if(t.isMemberExpression(parent)&&!methodNode.static){return t.memberExpression(superName,t.identifier("prototype"))}else{return superName}};Class.prototype.replaceInstanceSuperReferences=function(methodNode){var method=methodNode.value;var self=this;traverse(method,{enter:function(node,parent){if(t.isIdentifier(node,{name:"super"})){return self.superIdentifier(methodNode,node,parent)}else if(t.isCallExpression(node)){var callee=node.callee;if(!t.isMemberExpression(callee))return;if(callee.object.name!=="super")return;t.appendToMemberExpression(callee,t.identifier("call"));node.arguments.unshift(t.thisExpression())}}})};Class.prototype.pushConstructor=function(method){if(method.kind!==""){throw this.file.errorWithNode(method,"illegal kind for constructor method")}var construct=this.constructor;var fn=method.value;this.hasConstructor=true;t.inherits(construct,fn);t.inheritsComments(construct,method);construct.defaults=fn.defaults;construct.params=fn.params;construct.body=fn.body;construct.rest=fn.rest}},{"../../traverse":72,"../../types":76,"../../util":78}],40:[function(require,module,exports){var t=require("../../types");exports.ObjectExpression=function(node,parent,file){var hasComputed=false;var prop;var key;var i;for(i in node.properties){hasComputed=t.isProperty(node.properties[i],{computed:true});if(hasComputed)break}if(!hasComputed)return;var objId=t.getUid(parent,file);var body=[];var container=t.functionExpression(null,[],t.blockStatement(body));container._aliasFunction=true;var props=node.properties;for(i in props){prop=props[i];key=prop.key;if(!prop.computed&&t.isIdentifier(key)){prop.key=t.literal(key.name)}}var initProps=[];var broken=false;for(i in props){prop=props[i];if(prop.computed){broken=true}if(!broken||t.isLiteral(prop.key,{value:"__proto__"})){initProps.push(prop);props[i]=null}}for(i in props){prop=props[i];if(!prop)continue;key=prop.key;var bodyNode;if(prop.computed&&t.isMemberExpression(key)&&t.isIdentifier(key.object,{name:"Symbol"})){bodyNode=t.assignmentExpression("=",t.memberExpression(objId,key,true),prop.value)}else{bodyNode=t.callExpression(file.addDeclaration("define-property"),[objId,key,prop.value])}body.push(t.expressionStatement(bodyNode))}if(body.length===1){var first=body[0].expression;if(t.isCallExpression(first)){first.arguments[0]=t.objectExpression([]);return first}}body.unshift(t.variableDeclaration("var",[t.variableDeclarator(objId,t.objectExpression(initProps))]));body.push(t.returnStatement(objId));return t.callExpression(container,[])}},{"../../types":76}],41:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");var _=require("lodash");exports.Program=exports.BlockStatement=exports.ForInStatement=exports.ForOfStatement=exports.ForStatement=function(node,parent,file){var hasConstants=false;var constants={};var check=function(parent,names,scope){for(var name in names){var nameNode=names[name];if(!_.has(constants,name))continue;if(parent&&t.isBlockStatement(parent)&&parent!==constants[name])continue;if(scope){var defined=scope.get(name);if(defined&&defined===nameNode)continue}throw file.errorWithNode(nameNode,name+" is read-only")}};var getIds=function(node){return t.getIds(node,true,["MemberExpression"])};_.each(node.body,function(child,parent){if(t.isExportDeclaration(child)){child=child.declaration}if(t.isVariableDeclaration(child,{kind:"const"})){for(var i in child.declarations){var declar=child.declarations[i];var ids=getIds(declar);for(var name in ids){var nameNode=ids[name];var names={};names[name]=nameNode;check(parent,names);constants[name]=parent;hasConstants=true}declar._ignoreConstant=true}child._ignoreConstant=true;child.kind="let"}});if(!hasConstants)return;traverse(node,{enter:function(child,parent,scope){if(child._ignoreConstant)return;if(t.isVariableDeclaration(child))return;if(t.isVariableDeclarator(child)||t.isDeclaration(child)||t.isAssignmentExpression(child)){check(parent,getIds(child),scope)}}})}},{"../../traverse":72,"../../types":76,lodash:126}],42:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");exports.Function=function(node,parent,file,scope){if(!node.defaults||!node.defaults.length)return;t.ensureBlock(node);var ids=node.params.map(function(param){return t.getIds(param)});var iife=false;var i;var def;for(i in node.defaults){def=node.defaults[i];if(!def)continue;var param=node.params[i];_.each(ids.slice(i),function(ids){var check=function(node,parent){if(!t.isIdentifier(node)||!t.isReferenced(node,parent))return;if(ids.indexOf(node.name)>=0){throw file.errorWithNode(node,"Temporal dead zone - accessing a variable before it's initialized")}if(scope.has(node.name)){iife=true}};check(def,node);traverse(def,{enter:check})});var has=scope.get(param.name);if(has&&node.params.indexOf(has)<0){iife=true}}var body=[];for(i in node.defaults){def=node.defaults[i];if(!def)continue;body.push(util.template("if-undefined-set-to",{VARIABLE:node.params[i],DEFAULT:def},true))}if(iife){var container=t.functionExpression(null,[],node.body,node.generator);container._aliasFunction=true;body.push(t.returnStatement(t.callExpression(container,[])));node.body=t.blockStatement(body)}else{node.body.body=body.concat(node.body.body)}node.defaults=[]}},{"../../traverse":72,"../../types":76,"../../util":78,lodash:126}],43:[function(require,module,exports){var t=require("../../types");var buildVariableAssign=function(opts,id,init){var op=opts.operator;if(t.isMemberExpression(id))op="=";if(op){return t.expressionStatement(t.assignmentExpression("=",id,init))}else{return t.variableDeclaration(opts.kind,[t.variableDeclarator(id,init)])}};var push=function(opts,nodes,elem,parentId){if(t.isObjectPattern(elem)){pushObjectPattern(opts,nodes,elem,parentId)}else if(t.isArrayPattern(elem)){pushArrayPattern(opts,nodes,elem,parentId)}else{nodes.push(buildVariableAssign(opts,elem,parentId))}};var pushObjectPattern=function(opts,nodes,pattern,parentId){for(var i in pattern.properties){var prop=pattern.properties[i];if(t.isSpreadProperty(prop)){var keys=[];for(var i2 in pattern.properties){var prop2=pattern.properties[i2];if(i2>=i)break;if(t.isSpreadProperty(prop2))continue;var key=prop2.key;if(t.isIdentifier(key)){key=t.literal(prop2.key.name)}keys.push(key)}keys=t.arrayExpression(keys);var value=t.callExpression(opts.file.addDeclaration("object-without-properties"),[parentId,keys]);nodes.push(buildVariableAssign(opts,prop.argument,value))}else{var pattern2=prop.value;var patternId2=t.memberExpression(parentId,prop.key,prop.computed);if(t.isPattern(pattern2)){push(opts,nodes,pattern2,patternId2)}else{nodes.push(buildVariableAssign(opts,pattern2,patternId2))}}}};var pushArrayPattern=function(opts,nodes,pattern,parentId){if(!pattern.elements)return;var i;var hasSpreadElement=false;for(i in pattern.elements){if(t.isSpreadElement(pattern.elements[i])){hasSpreadElement=true;break}}var toArray=opts.file.toArray(parentId,!hasSpreadElement&&pattern.elements.length);var _parentId=t.getUid(parentId,opts.file,opts.scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(_parentId,toArray)]));parentId=_parentId;for(i in pattern.elements){var elem=pattern.elements[i];if(!elem)continue;i=+i;var newPatternId;if(t.isSpreadElement(elem)){newPatternId=opts.file.toArray(parentId);if(i>0){newPatternId=t.callExpression(t.memberExpression(newPatternId,t.identifier("slice")),[t.literal(i)])}elem=elem.argument}else{newPatternId=t.memberExpression(parentId,t.literal(i),true)}push(opts,nodes,elem,newPatternId)}};var pushPattern=function(opts){var nodes=opts.nodes;var pattern=opts.pattern;var parentId=opts.id;var file=opts.file;var scope=opts.scope;if(!t.isMemberExpression(parentId)&&!t.isIdentifier(parentId)){var key=t.getUid(parentId,file,scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,parentId)]));parentId=key}push(opts,nodes,pattern,parentId)};exports.ForInStatement=exports.ForOfStatement=function(node,parent,file,scope){var declar=node.left;if(!t.isVariableDeclaration(declar))return;var pattern=declar.declarations[0].id;if(!t.isPattern(pattern))return;var key=file.generateUidIdentifier("ref",scope);node.left=t.variableDeclaration(declar.kind,[t.variableDeclarator(key,null)]);var nodes=[];push({kind:declar.kind,file:file,scope:scope},nodes,pattern,key);t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.Function=function(node,parent,file,scope){var nodes=[];var hasDestructuring=false;node.params=node.params.map(function(pattern){if(!t.isPattern(pattern))return pattern;hasDestructuring=true;var parentId=file.generateUidIdentifier("ref",scope);pushPattern({kind:"var",nodes:nodes,pattern:pattern,id:parentId,file:file,scope:scope});return parentId});if(!hasDestructuring)return;t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.ExpressionStatement=function(node,parent,file,scope){var expr=node.expression;if(expr.type!=="AssignmentExpression")return;if(!t.isPattern(expr.left))return;var nodes=[];var ref=file.generateUidIdentifier("ref",scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(ref,expr.right)]));push({operator:expr.operator,file:file,scope:scope},nodes,expr.left,ref);return nodes};exports.AssignmentExpression=function(node,parent,file,scope){if(parent.type==="ExpressionStatement")return;if(!t.isPattern(node.left))return;var tempName=file.generateUid("temp",scope);var ref=t.identifier(tempName);scope.push({key:tempName,id:ref});var nodes=[];nodes.push(t.assignmentExpression("=",ref,node.right));push({operator:node.operator,file:file,scope:scope},nodes,node.left,ref);nodes.push(ref);return t.toSequenceExpression(nodes,scope)};exports.VariableDeclaration=function(node,parent,file,scope){if(t.isForInStatement(parent)||t.isForOfStatement(parent))return;var nodes=[];var i;var declar;var hasPattern=false;for(i in node.declarations){declar=node.declarations[i];if(t.isPattern(declar.id)){hasPattern=true;break}}if(!hasPattern)return;for(i in node.declarations){declar=node.declarations[i];var patternId=declar.init;var pattern=declar.id;var opts={kind:node.kind,nodes:nodes,pattern:pattern,id:patternId,file:file,scope:scope};if(t.isPattern(pattern)&&patternId){pushPattern(opts)}else{nodes.push(buildVariableAssign(opts,declar.id,declar.init))}}if(!t.isProgram(parent)&&!t.isBlockStatement(parent)){declar=null;for(i in nodes){node=nodes[i];declar=declar||t.variableDeclaration(node.kind,[]);if(!t.isVariableDeclaration(node)&&declar.kind!==node.kind){throw file.errorWithNode(node,"Cannot use this node within the current parent")}declar.declarations=declar.declarations.concat(node.declarations)}return declar}return nodes}},{"../../types":76}],44:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.ForOfStatement=function(node,parent,file,scope){var left=node.left;var declar;var stepKey=file.generateUidIdentifier("step",scope);var stepValue=t.memberExpression(stepKey,t.identifier("value"));if(t.isIdentifier(left)){declar=t.expressionStatement(t.assignmentExpression("=",left,stepValue))}else if(t.isVariableDeclaration(left)){declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,stepValue)])}else{throw file.errorWithNode(left,"Unknown node type "+left.type+" in ForOfStatement")}var node2=util.template("for-of",{ITERATOR_KEY:file.generateUidIdentifier("iterator",scope),STEP_KEY:stepKey,OBJECT:node.right});t.inheritsComments(node2,node);t.ensureBlock(node);var block=node2.body;block.body.push(declar);block.body=block.body.concat(node.body.body);return node2}},{"../../types":76,"../../util":78}],45:[function(require,module,exports){exports.ast={before:require("regenerator").transform}},{regenerator:134}],46:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");var isLet=function(node,parent){if(!t.isVariableDeclaration(node))return false;if(node._let)return true;if(node.kind!=="let")return false;if(!t.isFor(parent)||t.isFor(parent)&&parent.left!==node){_.each(node.declarations,function(declar){declar.init=declar.init||t.identifier("undefined")})}node._let=true;node.kind="var";return true};var isVar=function(node,parent){return t.isVariableDeclaration(node,{kind:"var"})&&!isLet(node,parent)};var standardiseLets=function(declars){for(var i in declars){delete declars[i]._let}};exports.VariableDeclaration=function(node,parent){isLet(node,parent)};exports.Loop=function(node,parent,file,scope){var init=node.left||node.init;if(isLet(init,node)){t.ensureBlock(node);node.body._letDeclars=[init]}if(t.isLabeledStatement(parent)){node.label=parent.label}var letScoping=new LetScoping(node,node.body,parent,file,scope);letScoping.run();if(node.label&&!t.isLabeledStatement(parent)){return t.labeledStatement(node.label,node)}};exports.BlockStatement=function(block,parent,file,scope){if(!t.isLoop(parent)){var letScoping=new LetScoping(false,block,parent,file,scope);letScoping.run()}};function LetScoping(loopParent,block,parent,file,scope){this.loopParent=loopParent;this.parent=parent;this.scope=scope;this.block=block;this.file=file;this.letReferences={};this.body=[]}LetScoping.prototype.run=function(){var block=this.block;if(block._letDone)return;block._letDone=true;this.info=this.getInfo();this.remap();if(t.isFunction(this.parent))return this.noClosure();if(!this.info.keys.length)return this.noClosure();var referencesInClosure=this.getLetReferences();if(!referencesInClosure)return this.noClosure();this.has=this.checkLoop();this.hoistVarDeclarations();standardiseLets(this.info.declarators);var letReferences=_.values(this.letReferences);var fn=t.functionExpression(null,letReferences,t.blockStatement(block.body));fn._aliasFunction=true;block.body=this.body;var params=this.getParams(letReferences);var call=t.callExpression(fn,params);var ret=this.file.generateUidIdentifier("ret",this.scope);var hasYield=traverse.hasType(fn.body,"YieldExpression",t.FUNCTION_TYPES);if(hasYield){fn.generator=true;call=t.yieldExpression(call,true)}this.build(ret,call)};LetScoping.prototype.noClosure=function(){standardiseLets(this.info.declarators)};LetScoping.prototype.remap=function(){var replacements=this.info.duplicates;var block=this.block;if(!this.info.hasDuplicates)return;var replace=function(node,parent,scope){if(!t.isIdentifier(node))return;if(!t.isReferenced(node,parent))return;if(scope&&scope.hasOwn(node.name))return;node.name=replacements[node.name]||node.name};var traverseReplace=function(node,parent){replace(node,parent);traverse(node,{enter:replace})};var loopParent=this.loopParent;if(loopParent){traverseReplace(loopParent.right,loopParent);traverseReplace(loopParent.test,loopParent);traverseReplace(loopParent.update,loopParent)}traverse(block,{enter:replace})};LetScoping.prototype.getInfo=function(){var block=this.block;var scope=this.scope;var file=this.file;var opts={outsideKeys:[],declarators:block._letDeclars||[],duplicates:{},hasDuplicates:false,keys:[]};var duplicates=function(id,key){var has=scope.parentGet(key);if(has&&has!==id){opts.duplicates[key]=id.name=file.generateUid(key,scope);opts.hasDuplicates=true}};var i;var declar;for(i in opts.declarators){declar=opts.declarators[i];opts.declarators.push(declar);var keys=t.getIds(declar,true);_.each(keys,duplicates);keys=Object.keys(keys);opts.outsideKeys=opts.outsideKeys.concat(keys);opts.keys=opts.keys.concat(keys)}for(i in block.body){declar=block.body[i];if(!isLet(declar,block))continue;_.each(t.getIds(declar,true),function(id,key){duplicates(id,key);opts.keys.push(key)})}return opts};LetScoping.prototype.checkLoop=function(){var has={hasContinue:false,hasReturn:false,hasBreak:false};
traverse(this.block,{enter:function(node,parent){var replace;if(t.isFunction(node)||t.isLoop(node)){return this.stop()}if(node&&!node.label){if(t.isBreakStatement(node)){if(t.isSwitchCase(parent))return;has.hasBreak=true;replace=t.returnStatement(t.literal("break"))}else if(t.isContinueStatement(node)){has.hasContinue=true;replace=t.returnStatement(t.literal("continue"))}}if(t.isReturnStatement(node)){has.hasReturn=true;replace=t.returnStatement(t.objectExpression([t.property("init",t.identifier("v"),node.argument||t.identifier("undefined"))]))}if(replace)return t.inherits(replace,node)}});return has};LetScoping.prototype.hoistVarDeclarations=function(){var self=this;traverse(this.block,{enter:function(node,parent){if(t.isForStatement(node)){if(isVar(node.init,node)){node.init=t.sequenceExpression(self.pushDeclar(node.init))}}else if(t.isFor(node)){if(isVar(node.left,node)){node.left=node.left.declarations[0].id}}else if(isVar(node,parent)){return self.pushDeclar(node).map(t.expressionStatement)}else if(t.isFunction(node)){return this.stop()}}})};LetScoping.prototype.getParams=function(params){var info=this.info;params=_.cloneDeep(params);_.each(params,function(param){param.name=info.duplicates[param.name]||param.name});return params};LetScoping.prototype.getLetReferences=function(){var closurify=false;var self=this;traverse(this.block,{enter:function(node,parent,scope){if(t.isFunction(node)){traverse(node,{enter:function(node,parent){if(!t.isIdentifier(node))return;if(!t.isReferenced(node,parent))return;if(scope.hasOwn(node.name))return;closurify=true;if(!_.contains(self.info.outsideKeys,node.name))return;self.letReferences[node.name]=node}});return this.stop()}else if(t.isLoop(node)){return this.stop()}}});return closurify};LetScoping.prototype.pushDeclar=function(node){this.body.push(t.variableDeclaration(node.kind,node.declarations.map(function(declar){return t.variableDeclarator(declar.id)})));var replace=[];for(var i in node.declarations){var declar=node.declarations[i];if(!declar.init)continue;var expr=t.assignmentExpression("=",declar.id,declar.init);replace.push(t.inherits(expr,declar))}return replace};LetScoping.prototype.build=function(ret,call){var has=this.has;if(has.hasReturn||has.hasBreak||has.hasContinue){this.buildHas(ret,call)}else{this.body.push(t.expressionStatement(call))}};LetScoping.prototype.buildHas=function(ret,call){var body=this.body;body.push(t.variableDeclaration("var",[t.variableDeclarator(ret,call)]));var loopParent=this.loopParent;var retCheck;var has=this.has;var cases=[];if(has.hasReturn){retCheck=util.template("let-scoping-return",{RETURN:ret})}if(has.hasBreak||has.hasContinue){var label=loopParent.label=loopParent.label||this.file.generateUidIdentifier("loop",this.scope);if(has.hasBreak){cases.push(t.switchCase(t.literal("break"),[t.breakStatement(label)]))}if(has.hasContinue){cases.push(t.switchCase(t.literal("continue"),[t.continueStatement(label)]))}if(has.hasReturn){cases.push(t.switchCase(null,[retCheck]))}if(cases.length===1){var single=cases[0];body.push(t.ifStatement(t.binaryExpression("===",ret,single.test),single.consequent[0]))}else{body.push(t.switchStatement(ret,cases))}}else{if(has.hasReturn)body.push(retCheck)}}},{"../../traverse":72,"../../types":76,"../../util":78,lodash:126}],47:[function(require,module,exports){var t=require("../../types");exports.ast={before:function(ast,file){ast.program.body=file.dynamicImports.concat(ast.program.body)}};exports.ImportDeclaration=function(node,parent,file){var nodes=[];if(node.specifiers.length){for(var i in node.specifiers){file.moduleFormatter.importSpecifier(node.specifiers[i],node,nodes,parent)}}else{file.moduleFormatter.importDeclaration(node,nodes,parent)}if(nodes.length===1){nodes[0]._blockHoist=node._blockHoist}return nodes};exports.ExportDeclaration=function(node,parent,file){var nodes=[];if(node.declaration){if(t.isVariableDeclaration(node.declaration)){var declar=node.declaration.declarations[0];declar.init=declar.init||t.identifier("undefined")}file.moduleFormatter.exportDeclaration(node,nodes,parent)}else{for(var i in node.specifiers){file.moduleFormatter.exportSpecifier(node.specifiers[i],node,nodes,parent)}}return nodes}},{"../../types":76}],48:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.Property=function(node){if(!node.shorthand)return;node.shorthand=false;node.key=t.removeComments(_.clone(node.key))}},{"../../types":76,lodash:126}],49:[function(require,module,exports){var t=require("../../types");exports.Function=function(node,parent,file){if(!node.rest)return;var rest=node.rest;delete node.rest;t.ensureBlock(node);var call=file.toArray(t.identifier("arguments"));if(node.params.length){call.arguments.push(t.literal(node.params.length))}call._ignoreAliasFunctions=true;node.body.body.unshift(t.variableDeclaration("var",[t.variableDeclarator(rest,call)]))}},{"../../types":76}],50:[function(require,module,exports){var t=require("../../types");var getSpreadLiteral=function(spread,file){return file.toArray(spread.argument)};var hasSpread=function(nodes){for(var i in nodes){if(t.isSpreadElement(nodes[i])){return true}}return false};var build=function(props,file){var nodes=[];var _props=[];var push=function(){if(!_props.length)return;nodes.push(t.arrayExpression(_props));_props=[]};for(var i in props){var prop=props[i];if(t.isSpreadElement(prop)){push();nodes.push(getSpreadLiteral(prop,file))}else{_props.push(prop)}}push();return nodes};exports.ArrayExpression=function(node,parent,file){var elements=node.elements;if(!hasSpread(elements))return;var nodes=build(elements,file);var first=nodes.shift();if(!t.isArrayExpression(first)){nodes.unshift(first);first=t.arrayExpression([])}return t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)};exports.CallExpression=function(node,parent,file,scope){var args=node.arguments;if(!hasSpread(args))return;var contextLiteral=t.literal(null);node.arguments=[];var nodes;if(args.length===1&&args[0].argument.name==="arguments"){nodes=[args[0].argument]}else{nodes=build(args,file)}var first=nodes.shift();if(nodes.length){node.arguments.push(t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes))}else{node.arguments.push(first)}var callee=node.callee;var temp;if(t.isMemberExpression(callee)){contextLiteral=callee.object;if(t.isDynamic(contextLiteral)){temp=contextLiteral=scope.generateTemp(file);callee.object=t.assignmentExpression("=",temp,callee.object)}t.appendToMemberExpression(callee,t.identifier("apply"))}else{node.callee=t.memberExpression(node.callee,t.identifier("apply"))}node.arguments.unshift(contextLiteral)};exports.NewExpression=function(node,parent,file){var args=node.arguments;if(!hasSpread(args))return;var nodes=build(args,file);var first=nodes.shift();if(nodes.length){args=t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)}else{args=first}return t.callExpression(file.addDeclaration("apply-constructor"),[node.callee,args])}},{"../../types":76}],51:[function(require,module,exports){var t=require("../../types");var buildBinaryExpression=function(left,right){return t.binaryExpression("+",left,right)};exports.TaggedTemplateExpression=function(node,parent,file){var args=[];var quasi=node.quasi;var strings=[];var raw=[];for(var i in quasi.quasis){var elem=quasi.quasis[i];strings.push(t.literal(elem.value.cooked));raw.push(t.literal(elem.value.raw))}args.push(t.callExpression(file.addDeclaration("tagged-template-literal"),[t.arrayExpression(strings),t.arrayExpression(raw)]));args=args.concat(quasi.expressions);return t.callExpression(node.tag,args)};exports.TemplateLiteral=function(node){var nodes=[];var i;for(i in node.quasis){var elem=node.quasis[i];nodes.push(t.literal(elem.value.cooked));var expr=node.expressions.shift();if(expr)nodes.push(expr)}if(nodes.length>1){var last=nodes[nodes.length-1];if(t.isLiteral(last,{value:""}))nodes.pop();var root=buildBinaryExpression(nodes.shift(),nodes.shift());for(i in nodes){root=buildBinaryExpression(root,nodes[i])}return root}else{return nodes[0]}}},{"../../types":76}],52:[function(require,module,exports){var rewritePattern=require("regexpu/rewrite-pattern");var _=require("lodash");exports.Literal=function(node){var regex=node.regex;if(!regex)return;var flags=regex.flags.split("");if(regex.flags.indexOf("u")<0)return;_.pull(flags,"u");regex.pattern=rewritePattern(regex.pattern,regex.flags);regex.flags=flags.join("")}},{lodash:126,"regexpu/rewrite-pattern":167}],53:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.experimental=true;var container=function(parent,call,ret){if(t.isExpressionStatement(parent)){return call}else{var exprs=[];if(t.isSequenceExpression(call)){exprs=call.expressions}else{exprs.push(call)}exprs.push(ret);return t.sequenceExpression(exprs)}};exports.AssignmentExpression=function(node,parent,file,scope){var left=node.left;if(!t.isVirtualPropertyExpression(left))return;var value=node.right;var temp;if(!t.isExpressionStatement(parent)){if(t.isDynamic(value)){temp=value=scope.generateTemp(file)}}if(node.operator!=="="){value=t.binaryExpression(node.operator[0],util.template("abstract-expression-get",{PROPERTY:node.property,OBJECT:node.object}),value)}var call=util.template("abstract-expression-set",{PROPERTY:left.property,OBJECT:left.object,VALUE:value});if(temp){call=t.sequenceExpression([t.assignmentExpression("=",temp,node.right),call])}return container(parent,call,value)};exports.UnaryExpression=function(node,parent){var arg=node.argument;if(!t.isVirtualPropertyExpression(arg))return;if(node.operator!=="delete")return;var call=util.template("abstract-expression-delete",{PROPERTY:arg.property,OBJECT:arg.object});return container(parent,call,t.literal(true))};exports.CallExpression=function(node,parent,file,scope){var callee=node.callee;if(!t.isVirtualPropertyExpression(callee))return;var temp;if(t.isDynamic(callee.object)){temp=scope.generateTemp(file)}var call=util.template("abstract-expression-call",{PROPERTY:callee.property,OBJECT:temp||callee.object});call.arguments=call.arguments.concat(node.arguments);if(temp){return t.sequenceExpression([t.assignmentExpression("=",temp,callee.object),call])}else{return call}};exports.VirtualPropertyExpression=function(node){return util.template("abstract-expression-get",{PROPERTY:node.property,OBJECT:node.object})};exports.PrivateDeclaration=function(node){return t.variableDeclaration("const",node.declarations.map(function(id){return t.variableDeclarator(id,t.newExpression(t.identifier("WeakMap"),[]))}))}},{"../../types":76,"../../util":78}],54:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");exports.experimental=true;var build=function(node,parent,file,scope){var uid=t.getUid(parent,file,scope);var container=util.template("array-comprehension-container",{KEY:uid});container.callee._aliasFunction=true;var block=container.callee.body;var body=block.body;if(traverse.hasType(node,"YieldExpression",t.FUNCTION_TYPES)){container.callee.generator=true;container=t.yieldExpression(container,true)}var returnStatement=body.pop();body.push(exports._build(node,function(){return util.template("array-push",{STATEMENT:node.body,KEY:uid},true)}));body.push(returnStatement);return container};exports._build=function(node,buildBody){var self=node.blocks.shift();if(!self)return;var child=exports._build(node,buildBody);if(!child){child=buildBody();if(node.filter){child=t.ifStatement(node.filter,t.blockStatement([child]))}}return t.forOfStatement(t.variableDeclaration("var",[t.variableDeclarator(self.left)]),self.right,t.blockStatement([child]))};exports.ComprehensionExpression=function(node,parent,file,scope){if(node.generator)return;return build(node,parent,file,scope)}},{"../../traverse":72,"../../types":76,"../../util":78}],55:[function(require,module,exports){exports.experimental=true;var t=require("../../types");var pow=t.memberExpression(t.identifier("Math"),t.identifier("pow"));exports.AssignmentExpression=function(node){if(node.operator!=="**=")return;node.operator="=";node.right=t.callExpression(pow,[node.left,node.right])};exports.BinaryExpression=function(node){if(node.operator!=="**")return;return t.callExpression(pow,[node.left,node.right])}},{"../../types":76}],56:[function(require,module,exports){var arrayComprehension=require("./es7-array-comprehension");var t=require("../../types");exports.experimental=true;exports.ComprehensionExpression=function(node){if(!node.generator)return;var body=[];var container=t.functionExpression(null,[],t.blockStatement(body),true);container._aliasFunction=true;body.push(arrayComprehension._build(node,function(){return t.expressionStatement(t.yieldExpression(node.body))}));return t.callExpression(container,[])}},{"../../types":76,"./es7-array-comprehension":54}],57:[function(require,module,exports){var t=require("../../types");exports.experimental=true;exports.ObjectExpression=function(node){var hasSpread=false;var i;var prop;for(i in node.properties){prop=node.properties[i];if(t.isSpreadProperty(prop)){hasSpread=true;break}}if(!hasSpread)return;var args=[];var props=[];var push=function(){if(!props.length)return;args.push(t.objectExpression(props));props=[]};for(i in node.properties){prop=node.properties[i];if(t.isSpreadProperty(prop)){push();args.push(prop.argument)}else{props.push(prop)}}push();if(!t.isObjectExpression(args[0])){args.unshift(t.objectExpression([]))}return t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("assign")),args)}},{"../../types":76}],58:[function(require,module,exports){var bluebirdCoroutines=require("./optional-bluebird-coroutines");exports.optional=true;exports.manipulateOptions=bluebirdCoroutines.manipulateOptions;exports.Function=function(node,parent,file){if(!node.async||node.generator)return;return bluebirdCoroutines._Function(node,file.addDeclaration("async-to-generator"))}},{"./optional-bluebird-coroutines":59}],59:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");exports.manipulateOptions=function(opts){opts.experimental=true;opts.blacklist.push("generators")};exports.optional=true;exports._Function=function(node,callId){node.async=false;node.generator=true;traverse(node,{enter:function(node){if(t.isFunction(node))this.stop();if(t.isAwaitExpression(node)){node.type="YieldExpression"}}});var call=t.callExpression(callId,[node]);if(t.isFunctionDeclaration(node)){var declar=t.variableDeclaration("var",[t.variableDeclarator(node.id,call)]);declar._blockHoist=true;return declar}else{return call}};exports.Function=function(node,parent,file){if(!node.async||node.generator)return;var id=t.identifier("Bluebird");file.addImport(id,"bluebird");return exports._Function(node,t.memberExpression(id,t.identifier("coroutine")))}},{"../../traverse":72,"../../types":76}],60:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var core=require("core-js/library");var t=require("../../types");var _=require("lodash");var coreHas=function(node){return node.name!=="_"&&_.has(core,node.name)};exports.optional=true;exports.ast={enter:function(ast,file){file._coreId=file.generateUidIdentifier("core");file.addImport(file._coreId,"core-js/library")},exit:function(ast,file){traverse(ast,{enter:function(node,parent){var prop;if(t.isMemberExpression(node)&&t.isReferenced(node,parent)){var obj=node.object;prop=node.property;if(!t.isReferenced(obj,node))return;if(!node.computed&&coreHas(obj)&&_.has(core[obj.name],prop.name)){this.stop();return t.prependToMemberExpression(node,file._coreId)}}else if(t.isIdentifier(node)&&!t.isMemberExpression(parent)&&t.isReferenced(node,parent)&&coreHas(node)){return t.memberExpression(file._coreId,node)}else if(t.isCallExpression(node)){if(node.arguments.length)return;var callee=node.callee;if(!t.isMemberExpression(callee))return;if(!callee.computed)return;prop=callee.property;if(!t.isIdentifier(prop.object,{name:"Symbol"}))return;if(!t.isIdentifier(prop.property,{name:"iterator"}))return;return util.template("corejs-iterator",{CORE_ID:file._coreId,VALUE:callee.object})}}})}}},{"../../traverse":72,"../../types":76,"../../util":78,"core-js/library":119,lodash:126}],61:[function(require,module,exports){var t=require("../../types");exports.optional=true;exports.Identifier=function(node,parent){if(node.name==="undefined"&&t.isReferenced(node,parent)){return t.unaryExpression("void",t.literal(0),true)}}},{"../../types":76}],62:[function(require,module,exports){var t=require("../../types");var isMemo=function(node){var is=t.isAssignmentExpression(node)&&node.operator==="?=";if(is)t.assertMemberExpression(node.left);return is};var getPropRef=function(nodes,prop,file,scope){if(t.isIdentifier(prop)){return t.literal(prop.name)}else{var temp=t.getUid(prop,file,scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(temp,prop)]));return temp}};var getObjRef=function(nodes,obj,file,scope){if(t.isDynamic(obj)){var temp=t.getUid(obj,file,scope);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(temp,obj)]));return temp}else{return obj}};var buildHasOwn=function(obj,prop,file){return t.unaryExpression("!",t.callExpression(t.memberExpression(file.addDeclaration("has-own"),t.identifier("call")),[obj,prop]),true)};var buildAbsoluteRef=function(left,obj,prop){var computed=left.computed||t.isLiteral(prop);return t.memberExpression(obj,prop,computed)};var buildAssignment=function(expr,obj,prop){return t.assignmentExpression("=",buildAbsoluteRef(expr.left,obj,prop),expr.right)};exports.ExpressionStatement=function(node,parent,file,scope){var expr=node.expression;if(!isMemo(expr))return;var nodes=[];var left=expr.left;var obj=getObjRef(nodes,left.object,file,scope);var prop=getPropRef(nodes,left.property,file,scope);nodes.push(t.ifStatement(buildHasOwn(obj,prop,file),t.expressionStatement(buildAssignment(expr,obj,prop))));return nodes};exports.AssignmentExpression=function(node,parent,file,scope){if(t.isExpressionStatement(parent))return;if(!isMemo(node))return;var nodes=[];var left=node.left;var obj=getObjRef(nodes,left.object,file,scope);var prop=getPropRef(nodes,left.property,file,scope);nodes.push(t.logicalExpression("&&",buildHasOwn(obj,prop,file),buildAssignment(node,obj,prop)));nodes.push(buildAbsoluteRef(left,obj,prop));return t.toSequenceExpression(nodes,scope)}},{"../../types":76}],63:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.BindMemberExpression=function(node,parent,file,scope){var object=node.object;var prop=node.property;var temp;if(t.isDynamic(object)){temp=object=scope.generateTemp(file)}var call=t.callExpression(t.memberExpression(t.memberExpression(object,prop),t.identifier("bind")),[object].concat(node.arguments));if(temp){return t.sequenceExpression([t.assignmentExpression("=",temp,node.object),call])}else{return call}};exports.BindFunctionExpression=function(node,parent,file,scope){var buildCall=function(args){var param=file.generateUidIdentifier("val",scope);return t.functionExpression(null,[param],t.blockStatement([t.returnStatement(t.callExpression(t.memberExpression(param,node.callee),args))]))};if(_.find(node.arguments,t.isDynamic)){var temp=scope.generateTemp(file,"args");return t.sequenceExpression([t.assignmentExpression("=",temp,t.arrayExpression(node.arguments)),buildCall(node.arguments.map(function(node,i){return t.memberExpression(temp,t.literal(i),true)}))])}else{return buildCall(node.arguments)}}},{"../../types":76,lodash:126}],64:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");exports.Property=exports.MethodDefinition=function(node,parent,file){if(node.kind!=="memo")return;node.kind="get";var value=node.value;t.ensureBlock(value);var key=node.key;if(t.isIdentifier(key)&&!node.computed){key=t.literal(key.name)}traverse(value,{enter:function(node){if(t.isFunction(node))return;if(t.isReturnStatement(node)&&node.argument){node.argument=t.memberExpression(t.callExpression(file.addDeclaration("define-property"),[t.thisExpression(),key,node.argument]),key,true)}}})}},{"../../traverse":72,"../../types":76}],65:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");exports.XJSIdentifier=function(node){if(esutils.keyword.isIdentifierName(node.name)){node.type="Identifier"}else{return t.literal(node.name)}};exports.XJSNamespacedName=function(node,parent,file){throw file.errorWithNode(node,"Namespace tags are not supported. ReactJSX is not XML.")};exports.XJSMemberExpression={exit:function(node){node.computed=t.isLiteral(node.property);node.type="MemberExpression"}};exports.XJSExpressionContainer=function(node){return node.expression};exports.XJSAttribute={exit:function(node){var value=node.value||t.literal(true);return t.property("init",node.name,value)}};exports.XJSOpeningElement={exit:function(node){var tagExpr=node.name;var args=[];var tagName;if(t.isIdentifier(tagExpr)){tagName=tagExpr.name}else if(t.isLiteral(tagExpr)){tagName=tagExpr.value}if(tagName&&(/[a-z]/.exec(tagName[0])||tagName.indexOf("-")>=0)){args.push(t.literal(tagName))}else{args.push(tagExpr)}var props=node.attributes;if(props.length){var _props=[];var objs=[];var pushProps=function(){if(!_props.length)return;objs.push(t.objectExpression(_props));_props=[]};while(props.length){var prop=props.shift();if(t.isXJSSpreadAttribute(prop)){pushProps();objs.push(prop.argument)}else{_props.push(prop)}}pushProps();if(objs.length===1){props=objs[0]}else{if(!t.isObjectExpression(objs[0])){objs.unshift(t.objectExpression([]))}props=t.callExpression(t.memberExpression(t.identifier("React"),t.identifier("__spread")),objs)}}else{props=t.literal(null)}args.push(props);tagExpr=t.memberExpression(t.identifier("React"),t.identifier("createElement"));return t.callExpression(tagExpr,args)}};exports.XJSElement={exit:function(node){var callExpr=node.openingElement;var i;for(i in node.children){var child=node.children[i];if(t.isLiteral(child)){var lines=child.value.split(/\r\n|\n|\r/);for(i in lines){var line=lines[i];var isFirstLine=i==="0";var isLastLine=+i===lines.length-1;var trimmedLine=line.replace(/\t/g," ");if(!isFirstLine){trimmedLine=trimmedLine.replace(/^[ ]+/,"")}if(!isLastLine){trimmedLine=trimmedLine.replace(/[ ]+$/,"")}if(trimmedLine){callExpr.arguments.push(t.literal(trimmedLine))}}continue}else if(t.isXJSEmptyExpression(child)){continue}callExpr.arguments.push(child)}return t.inherits(callExpr,node)}};var addDisplayName=function(id,call){if(!call||!t.isCallExpression(call))return;var callee=call.callee;if(!t.isMemberExpression(callee))return;var obj=callee.object;if(!t.isIdentifier(obj,{name:"React"}))return;var prop=callee.property;if(!t.isIdentifier(prop,{name:"createClass"}))return;var args=call.arguments;if(args.length!==1)return;var first=args[0];if(!t.isObjectExpression(first))return;var props=first.properties;var safe=true;for(var i in props){prop=props[i];if(t.isIdentifier(prop.key,{name:"displayName"})){safe=false;break}}if(safe){props.unshift(t.property("init",t.identifier("displayName"),t.literal(id)))}};exports.AssignmentExpression=exports.Property=exports.VariableDeclarator=function(node){var left,right;if(t.isAssignmentExpression(node)){left=node.left;right=node.right}else if(t.isProperty(node)){left=node.key;right=node.value}else if(t.isVariableDeclarator(node)){left=node.id;right=node.init}if(t.isMemberExpression(left)){left=left.property}if(t.isIdentifier(left)){addDisplayName(left.name,right)}}},{"../../types":76,esutils:124}],66:[function(require,module,exports){var t=require("../../types");exports.BlockStatement=function(node,parent){if(t.isFunction(parent))return;node.body=node.body.map(function(node){if(t.isFunction(node)){node.type="FunctionExpression";var declar=t.variableDeclaration("let",[t.variableDeclarator(node.id,node)]);declar._blockHoist=true;return declar}else{return node}})}},{"../../types":76}],67:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");exports.MemberExpression=function(node){var prop=node.property;if(node.computed&&t.isLiteral(prop)&&t.isValidIdentifier(prop.value)){node.property=t.identifier(prop.value);node.computed=false}else if(!node.computed&&t.isIdentifier(prop)&&esutils.keyword.isKeywordES6(prop.name,true)){node.property=t.literal(prop.name);node.computed=true}}},{"../../types":76,esutils:124}],68:[function(require,module,exports){var t=require("../../types");exports.ObjectExpression=function(node,parent,file){var keys=[];for(var i in node.properties){var prop=node.properties[i];if(prop.computed||prop.kind!=="init")continue;var key=prop.key;if(t.isIdentifier(key)){key=key.name}else if(t.isLiteral(key)){key=key.value}else{continue}if(keys.indexOf(key)>=0){throw file.errorWithNode(prop.key,"Duplicate property key")}else{keys.push(key)}}}},{"../../types":76}],69:[function(require,module,exports){var t=require("../../types");exports.ForInStatement=exports.ForOfStatement=function(node,parent,file){var left=node.left;if(t.isVariableDeclaration(left)){var declar=left.declarations[0];if(declar.init)throw file.errorWithNode(declar,"No assignments allowed in for-in/of head")}}},{"../../types":76}],70:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");exports.Property=function(node){var key=node.key;if(t.isLiteral(key)&&t.isValidIdentifier(key.value)){node.key=t.identifier(key.value);node.computed=false}else if(!node.computed&&t.isIdentifier(key)&&esutils.keyword.isKeywordES6(key.name,true)){node.key=t.literal(key.name)}}},{"../../types":76,esutils:124}],71:[function(require,module,exports){var t=require("../../types");exports.ast={exit:function(ast){var body=ast.program.body;var first=body[0];var noStrict=!first||!t.isExpressionStatement(first)||!t.isLiteral(first.expression)||first.expression.value!=="use strict";if(noStrict){body.unshift(t.expressionStatement(t.literal("use strict")))}}}},{"../../types":76}],72:[function(require,module,exports){module.exports=traverse;var Scope=require("./scope");var t=require("../types");var _=require("lodash");function traverse(parent,opts,scope){if(!parent)return;if(_.isArray(parent)){_.each(parent,function(node){traverse(node,opts,scope)});return}var keys=t.VISITOR_KEYS[parent.type];if(!keys)return;opts=opts||{};for(var i in keys){var key=keys[i];var nodes=parent[key];if(!nodes)continue;var updated=false;var handle=function(obj,key){var node=obj[key];if(!node)return;if(opts.blacklist&&opts.blacklist.indexOf(node.type)>-1)return;var maybeReplace=function(result){if(result===false)return;if(result==null)return;var isArray=_.isArray(result);var inheritTo=result;if(isArray)inheritTo=result[0];if(inheritTo)t.inheritsComments(inheritTo,node);node=obj[key]=result;updated=true;if(isArray&&_.contains(t.STATEMENT_OR_BLOCK_KEYS,key)&&!t.isBlockStatement(obj)){t.ensureBlock(obj,key)}};var stopped=false;var removed=false;var context={stop:function(){stopped=true},remove:function(){this.stop();removed=true}};var ourScope=scope;if(t.isScope(node))ourScope=new Scope(node,scope);if(opts.enter){var result=opts.enter.call(context,node,parent,ourScope);maybeReplace(result);if(removed){obj[key]=null;updated=true}if(stopped)return}traverse(node,opts,ourScope);if(opts.exit){maybeReplace(opts.exit.call(context,node,parent,ourScope))}};if(_.isArray(nodes)){for(i in nodes){handle(nodes,i)}if(updated){parent[key]=_.flatten(parent[key]);if(key==="body"){parent[key]=_.compact(parent[key])}}}else{handle(parent,key)}}}traverse.removeProperties=function(tree){var clear=function(node){delete node._declarations;delete node.extendedRange;delete node._scopeInfo;delete node.tokens;delete node.range;delete node.start;delete node.end;delete node.loc;delete node.raw;clearComments(node.trailingComments);clearComments(node.leadingComments)};var clearComments=function(comments){_.each(comments,clear)};clear(tree);traverse(tree,{enter:clear});return tree};traverse.hasType=function(tree,type,blacklistTypes){blacklistTypes=[].concat(blacklistTypes||[]);var has=false;if(_.contains(blacklistTypes,tree.type))return false;if(tree.type===type)return true;traverse(tree,{blacklist:blacklistTypes,enter:function(node){if(node.type===type){has=true;this.stop()}}});return has}},{"../types":76,"./scope":73,lodash:126}],73:[function(require,module,exports){module.exports=Scope;var traverse=require("./index");var t=require("../types");var _=require("lodash");var FOR_KEYS=["left","init"];function Scope(block,parent){this.parent=parent;this.block=block;var info=this.getInfo();this.references=info.references;this.declarations=info.declarations}var vars=require("jshint/src/vars");Scope.defaultDeclarations=_.flatten([vars.newEcmaIdentifiers,vars.node,vars.ecmaIdentifiers,vars.reservedVars].map(_.keys));Scope.add=function(node,references){if(!node)return;_.defaults(references,t.getIds(node,true))};Scope.prototype.generateTemp=function(file,name){var id=file.generateUidIdentifier(name||"temp",this);this.push({key:id.name,id:id});return id};Scope.prototype.getInfo=function(){var block=this.block;if(block._scopeInfo)return block._scopeInfo;var info=block._scopeInfo={};var references=info.references={};var declarations=info.declarations={};var add=function(node,reference){Scope.add(node,references);if(!reference)Scope.add(node,declarations)};if(t.isFor(block)){_.each(FOR_KEYS,function(key){var node=block[key];if(t.isLet(node))add(node)});block=block.body}if(t.isBlockStatement(block)||t.isProgram(block)){_.each(block.body,function(node){if(t.isLet(node))add(node)})}if(t.isCatchClause(block)){add(block.param)}if(t.isProgram(block)||t.isFunction(block)){traverse(block,{enter:function(node,parent,scope){if(t.isFor(node)){_.each(FOR_KEYS,function(key){var declar=node[key];if(t.isVar(declar))add(declar)})}if(t.isFunction(node))return this.stop();if(block.id&&node===block.id)return;if(t.isIdentifier(node)&&t.isReferenced(node,parent)&&!scope.has(node.name)){add(node,true)}if(t.isDeclaration(node)&&!t.isLet(node)){add(node)}}},this)}if(t.isFunction(block)){add(block.rest);_.each(block.params,function(param){add(param)})}return info};Scope.prototype.push=function(opts){var block=this.block;if(t.isFor(block)||t.isCatchClause(block)||t.isFunction(block)){t.ensureBlock(block);block=block.body}if(t.isBlockStatement(block)||t.isProgram(block)){block._declarations=block._declarations||{};block._declarations[opts.key]={kind:opts.kind,id:opts.id,init:opts.init}}else{throw new TypeError("cannot add a declaration here in node type "+block.type)}};Scope.prototype.add=function(node){Scope.add(node,this.references)};Scope.prototype.get=function(id,decl){return id&&(this.getOwn(id,decl)||this.parentGet(id,decl))};Scope.prototype.getOwn=function(id,decl){var refs=this.references;if(decl)refs=this.declarations;return _.has(refs,id)&&refs[id]};Scope.prototype.parentGet=function(id,decl){return this.parent&&this.parent.get(id,decl)};Scope.prototype.has=function(id,decl){return id&&(this.hasOwn(id,decl)||this.parentHas(id,decl))||_.contains(Scope.defaultDeclarations,id)};Scope.prototype.hasOwn=function(id,decl){return!!this.getOwn(id,decl)};Scope.prototype.parentHas=function(id,decl){return this.parent&&this.parent.has(id,decl)}},{"../types":76,"./index":72,"jshint/src/vars":125,lodash:126}],74:[function(require,module,exports){module.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement","Loop","While"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement","Loop","While"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ExportDeclaration:["Statement","Declaration"],ImportDeclaration:["Statement","Declaration"],ArrowFunctionExpression:["Scope","Function","Expression"],FunctionDeclaration:["Statement","Declaration","Scope","Function"],FunctionExpression:["Scope","Function","Expression"],BlockStatement:["Statement","Scope"],Program:["Scope"],CatchClause:["Scope"],LogicalExpression:["Binary","Expression"],BinaryExpression:["Binary","Expression"],UnaryExpression:["UnaryLike","Expression"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Statement","Declaration","Class"],ClassExpression:["Class","Expression"],ForOfStatement:["Statement","For","Scope","Loop"],ForInStatement:["Statement","For","Scope","Loop"],ForStatement:["Statement","For","Scope","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],Property:["UserWhitespacable"],XJSElement:["UserWhitespacable","Expression"],ArrayExpression:["Expression"],AssignmentExpression:["Expression"],AwaitExpression:["Expression"],BindFunctionExpression:["Expression"],BindMemberExpression:["Expression"],CallExpression:["Expression"],ComprehensionExpression:["Expression"],ConditionalExpression:["Expression"],Identifier:["Expression"],Literal:["Expression"],MemberExpression:["Expression"],NewExpression:["Expression"],ObjectExpression:["Expression"],SequenceExpression:["Expression"],TaggedTemplateExpression:["Expression"],ThisExpression:["Expression"],UpdateExpression:["Expression"],VirtualPropertyExpression:["Expression"],XJSEmptyExpression:["Expression"],XJSMemberExpression:["Expression"],YieldExpression:["Expression"]}
},{}],75:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["operator","left","right"],BinaryExpression:["operator","left","right"],BlockStatement:["body"],CallExpression:["callee","arguments"],ConditionalExpression:["test","consequent","alternate"],ExpressionStatement:["expression"],File:["program","comments","tokens"],FunctionExpression:["id","params","body","generator"],Identifier:["name"],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],Literal:["value"],LogicalExpression:["operator","left","right"],MemberExpression:["object","property","computed"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],Program:["body"],Property:["kind","key","value","computed"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ThrowExpression:["argument"],UnaryExpression:["operator","argument","prefix"],VariableDeclaration:["kind","declarations"],VariableDeclarator:["id","init"],WithStatement:["object","body"],YieldExpression:["argument","delegate"]}},{}],76:[function(require,module,exports){var esutils=require("esutils");var _=require("lodash");var t=exports;var addAssert=function(type,is){t["assert"+type]=function(node,opts){opts=opts||{};if(!is(node,opts)){throw new Error("Expected type "+JSON.stringify(type)+" with option "+JSON.stringify(opts))}}};t.STATEMENT_OR_BLOCK_KEYS=["consequent","body"];t.VISITOR_KEYS=require("./visitor-keys");_.each(t.VISITOR_KEYS,function(keys,type){var is=t["is"+type]=function(node,opts){return node&&node.type===type&&t.shallowEqual(node,opts)};addAssert(type,is)});t.BUILDER_KEYS=_.defaults(require("./builder-keys"),t.VISITOR_KEYS);_.each(t.BUILDER_KEYS,function(keys,type){t[type[0].toLowerCase()+type.slice(1)]=function(){var args=arguments;var node={type:type};_.each(keys,function(key,i){node[key]=args[i]});return node}});t.ALIAS_KEYS=require("./alias-keys");t.FLIPPED_ALIAS_KEYS={};_.each(t.ALIAS_KEYS,function(aliases,type){_.each(aliases,function(alias){var types=t.FLIPPED_ALIAS_KEYS[alias]=t.FLIPPED_ALIAS_KEYS[alias]||[];types.push(type)})});_.each(t.FLIPPED_ALIAS_KEYS,function(types,type){t[type.toUpperCase()+"_TYPES"]=types;var is=t["is"+type]=function(node,opts){return node&&types.indexOf(node.type)>=0&&t.shallowEqual(node,opts)};addAssert(type,is)});t.isFalsyExpression=function(node){if(t.isLiteral(node)){return!node.value}else if(t.isIdentifier(node)){return node.name==="undefined"}return false};t.toSequenceExpression=function(nodes,scope){var exprs=[];_.each(nodes,function(node){if(t.isExpression(node)){exprs.push(node)}if(t.isExpressionStatement(node)){exprs.push(node.expression)}else if(t.isVariableDeclaration(node)){_.each(node.declarations,function(declar){scope.push({kind:node.kind,key:declar.id.name,id:declar.id});exprs.push(t.assignmentExpression("=",declar.id,declar.init))})}});return t.sequenceExpression(exprs)};t.shallowEqual=function(actual,expected){var same=true;if(expected){_.each(expected,function(val,key){if(actual[key]!==val){return same=false}})}return same};t.appendToMemberExpression=function(member,append,computed){member.object=t.memberExpression(member.object,member.property,member.computed);member.property=append;member.computed=!!computed;return member};t.prependToMemberExpression=function(member,append){member.object=t.memberExpression(append,member.object);return member};t.isDynamic=function(node){if(t.isExpressionStatement(node)){return t.isDynamic(node.expression)}else if(t.isIdentifier(node)||t.isLiteral(node)||t.isThisExpression(node)){return false}else if(t.isMemberExpression(node)){return t.isDynamic(node.object)||t.isDynamic(node.property)}else{return true}};t.isReferenced=function(node,parent){if(t.isProperty(parent)&&parent.key===node&&!parent.computed)return false;if(t.isVariableDeclarator(parent)&&parent.id===node)return false;var isMemberExpression=t.isMemberExpression(parent);var isComputedProperty=isMemberExpression&&parent.property===node&&parent.computed;var isObject=isMemberExpression&&parent.object===node;if(!isMemberExpression||isComputedProperty||isObject)return true;return false};t.isValidIdentifier=function(name){return _.isString(name)&&esutils.keyword.isIdentifierName(name)&&!esutils.keyword.isKeywordES6(name,true)};t.toIdentifier=function(name){if(t.isIdentifier(name))return name.name;name=name.replace(/[^a-zA-Z0-9$_]/g,"-");name=name.replace(/^[-0-9]+/,"");name=name.replace(/[-_\s]+(.)?/g,function(match,c){return c?c.toUpperCase():""});name=name.replace(/^\_/,"");return name||"_"};t.ensureBlock=function(node,key){key=key||"body";node[key]=t.toBlock(node[key],node)};t.toStatement=function(node,ignore){if(t.isStatement(node)){return node}var mustHaveId=false;var newType;if(t.isClass(node)){mustHaveId=true;newType="ClassDeclaration"}else if(t.isFunction(node)){mustHaveId=true;newType="FunctionDeclaration"}if(mustHaveId&&!node.id){newType=false}if(!newType){if(ignore){return false}else{throw new Error("cannot turn "+node.type+" to a statement")}}node.type=newType;return node};t.toBlock=function(node,parent){if(t.isBlockStatement(node)){return node}if(!_.isArray(node)){if(!t.isStatement(node)){if(t.isFunction(parent)){node=t.returnStatement(node)}else{node=t.expressionStatement(node)}}node=[node]}return t.blockStatement(node)};t.getUid=function(parent,file,scope){var node=parent;if(t.isAssignmentExpression(parent)){node=parent.left}else if(t.isVariableDeclarator(parent)){node=parent.id}var id="ref";if(t.isProperty(node)){node=node.key}if(t.isIdentifier(node)){id=node.name}else if(t.isLiteral(node)){id=node.value}else if(t.isMemberExpression(node)){var parts=[];var add=function(node){if(t.isMemberExpression(node)){add(node.object);add(node.property)}else if(t.isIdentifier(node)){parts.push(node.name)}else if(t.isLiteral(node)){parts.push(node.value)}};add(node);id=parts.join("$")}id=id.replace(/^_/,"");return file.generateUidIdentifier(id,scope)};t.getIds=function(node,map,ignoreTypes){ignoreTypes=ignoreTypes||[];var search=[].concat(node);var ids={};while(search.length){var id=search.shift();if(!id)continue;if(_.contains(ignoreTypes,id.type))continue;var nodeKey=t.getIds.nodes[id.type];var arrKeys=t.getIds.arrays[id.type];if(t.isIdentifier(id)){ids[id.name]=id}else if(nodeKey){if(id[nodeKey])search.push(id[nodeKey])}else if(arrKeys){for(var i in arrKeys){var key=arrKeys[i];search=search.concat(id[key]||[])}}}if(!map)ids=_.keys(ids);return ids};t.getIds.nodes={AssignmentExpression:"left",ImportSpecifier:"name",ExportSpecifier:"name",VariableDeclarator:"id",FunctionDeclaration:"id",ClassDeclaration:"id",MemeberExpression:"object",SpreadElement:"argument",Property:"value"};t.getIds.arrays={ExportDeclaration:["specifiers","declaration"],ImportDeclaration:["specifiers"],VariableDeclaration:["declarations"],ArrayPattern:["elements"],ObjectPattern:["properties"]};t.isLet=function(node){return t.isVariableDeclaration(node)&&(node.kind!=="var"||node._let)};t.isVar=function(node){return t.isVariableDeclaration(node,{kind:"var"})&&!node._let};t.COMMENT_KEYS=["leadingComments","trailingComments"];t.removeComments=function(child){_.each(t.COMMENT_KEYS,function(key){delete child[key]});return child};t.inheritsComments=function(child,parent){_.each(t.COMMENT_KEYS,function(key){child[key]=_.uniq(_.compact([].concat(child[key],parent[key])))});return child};t.inherits=function(child,parent){child.loc=parent.loc;child.end=parent.end;child.range=parent.range;child.start=parent.start;t.inheritsComments(child,parent);return child};t.getSpecifierName=function(specifier){return specifier.name||specifier.id};t.isSpecifierDefault=function(specifier){return t.isIdentifier(specifier.id)&&specifier.id.name==="default"}},{"./alias-keys":74,"./builder-keys":75,"./visitor-keys":77,esutils:124,lodash:126}],77:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AssignmentExpression:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BindFunctionExpression:["callee","arguments"],BindMemberExpression:["object","property","arguments"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ClassProperty:["key"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportBatchSpecifier:["id"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateDeclaration:["declarations"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],VirtualPropertyExpression:["object","property"],WhileStatement:["test","body"],WithStatement:["object","body"],XJSAttribute:["name","value"],XJSClosingElement:["name"],XJSElement:["openingElement","closingElement","children"],XJSEmptyExpression:[],XJSExpressionContainer:["expression"],XJSIdentifier:[],XJSMemberExpression:["object","property"],XJSNamespacedName:["namespace","name"],XJSOpeningElement:["name","attributes"],XJSSpreadAttribute:["argument"],YieldExpression:["argument"]}},{}],78:[function(require,module,exports){(function(Buffer,__dirname){require("./patch");var estraverse=require("estraverse");var traverse=require("./traverse");var acorn=require("acorn-6to5");var path=require("path");var util=require("util");var fs=require("fs");var t=require("./types");var _=require("lodash");exports.inherits=util.inherits;exports.canCompile=function(filename,altExts){var exts=altExts||[".js",".jsx",".es6"];var ext=path.extname(filename);return _.contains(exts,ext)};exports.isInteger=function(i){return _.isNumber(i)&&i%1===0};exports.resolve=function(loc){try{return require.resolve(loc)}catch(err){return null}};exports.trimRight=function(str){return str.replace(/[\n\s]+$/g,"")};exports.list=function(val){return val?val.split(","):[]};exports.regexify=function(val){if(!val)return new RegExp(/.^/);if(_.isArray(val))val=val.join("|");if(_.isString(val))return new RegExp(val);if(_.isRegExp(val))return val;throw new TypeError("illegal type for regexify")};exports.arrayify=function(val){if(!val)return[];if(_.isString(val))return exports.list(val);if(_.isArray(val))return val;throw new TypeError("illegal type for arrayify")};exports.isAbsolute=function(loc){if(!loc)return false;if(loc[0]==="/")return true;if(loc[1]===":"&&loc[2]==="\\")return true;return false};exports.sourceMapToComment=function(map){var json=JSON.stringify(map);var base64=new Buffer(json).toString("base64");return"//# sourceMappingURL=data:application/json;base64,"+base64};exports.pushMutatorMap=function(mutatorMap,key,kind,method){var alias;if(t.isIdentifier(key)){alias=key.name;if(method.computed)alias="computed:"+alias}else if(t.isLiteral(key)){alias=String(key.value)}else{alias=JSON.stringify(traverse.removeProperties(_.cloneDeep(key)))}var map;if(_.has(mutatorMap,alias)){map=mutatorMap[alias]}else{map={}}mutatorMap[alias]=map;map._key=key;if(method.computed){map._computed=true}map[kind]=method};exports.buildDefineProperties=function(mutatorMap){var objExpr=t.objectExpression([]);_.each(mutatorMap,function(map){var mapNode=t.objectExpression([]);var propNode=t.property("init",map._key,mapNode,map._computed);map.enumerable=t.literal(true);_.each(map,function(node,key){if(key[0]==="_")return;node=_.clone(node);var inheritNode=node;if(t.isMethodDefinition(node))node=node.value;var prop=t.property("init",t.identifier(key),node);t.inheritsComments(prop,inheritNode);t.removeComments(inheritNode);mapNode.properties.push(prop)});objExpr.properties.push(propNode)});return objExpr};exports.template=function(name,nodes,keepExpression){var template=exports.templates[name];if(!template)throw new ReferenceError("unknown template "+name);if(nodes===true){keepExpression=true;nodes=null}template=_.cloneDeep(template);if(!_.isEmpty(nodes)){traverse(template,{enter:function(node){if(t.isIdentifier(node)&&_.has(nodes,node.name)){return nodes[node.name]}}})}var node=template.body[0];if(!keepExpression&&t.isExpressionStatement(node)){node=node.expression}return node};exports.codeFrame=function(lines,lineNumber,colNumber){colNumber=Math.max(colNumber,0);lines=lines.split("\n");var start=Math.max(lineNumber-3,0);var end=Math.min(lines.length,lineNumber+3);var width=(end+"").length;if(!lineNumber&&!colNumber){start=0;end=lines.length}return"\n"+lines.slice(start,end).map(function(line,i){var curr=i+start+1;var gutter=curr===lineNumber?"> ":" ";var sep=curr+exports.repeat(width+1);gutter+=sep+"| ";var str=gutter+line;if(colNumber&&curr===lineNumber){str+="\n";str+=exports.repeat(gutter.length-2);str+="|"+exports.repeat(colNumber)+"^"}return str}).join("\n")};exports.repeat=function(width,cha){cha=cha||" ";return new Array(width+1).join(cha)};exports.normaliseAst=function(ast,comments,tokens){if(ast&&ast.type==="Program"){return t.file(ast,comments||[],tokens||[])}else{throw new Error("Not a valid ast?")}};exports.parse=function(opts,code,callback){try{var comments=[];var tokens=[];var ast=acorn.parse(code,{allowImportExportEverywhere:true,allowReturnOutsideFunction:true,ecmaVersion:opts.experimental?7:6,playground:opts.playground,strictMode:true,onComment:comments,locations:true,onToken:tokens,ranges:true});estraverse.attachComments(ast,comments,tokens);ast=exports.normaliseAst(ast,comments,tokens);if(callback){return callback(ast)}else{return ast}}catch(err){if(!err._6to5){err._6to5=true;var message=opts.filename+": "+err.message;var loc=err.loc;if(loc){var frame=exports.codeFrame(code,loc.line,loc.column);message+=frame}if(err.stack)err.stack=err.stack.replace(err.message,message);err.message=message}throw err}};exports.parseTemplate=function(loc,code){var ast=exports.parse({filename:loc},code).program;return traverse.removeProperties(ast)};var loadTemplates=function(){var templates={};var templatesLoc=__dirname+"/transformation/templates";if(!fs.existsSync(templatesLoc)){throw new Error("no templates directory - this is most likely the "+"result of a broken `npm publish`. Please report to "+"https://githut.com/6to5/6to5/issues")}_.each(fs.readdirSync(templatesLoc),function(name){if(name[0]===".")return;var key=path.basename(name,path.extname(name));var loc=templatesLoc+"/"+name;var code=fs.readFileSync(loc,"utf8");templates[key]=exports.parseTemplate(loc,code)});return templates};try{exports.templates=require("../../templates.json")}catch(err){if(err.code!=="MODULE_NOT_FOUND")throw err;exports.templates=loadTemplates()}}).call(this,require("buffer").Buffer,"/lib/6to5")},{"../../templates.json":178,"./patch":24,"./traverse":72,"./types":76,"acorn-6to5":1,buffer:95,estraverse:120,fs:93,lodash:126,path:102,util:118}],79:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var def=Type.def;var or=Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isNumber=builtin.number;var isBoolean=builtin.boolean;var isRegExp=builtin.RegExp;var shared=require("../lib/shared");var defaults=shared.defaults;var geq=shared.geq;def("Printable").field("loc",or(def("SourceLocation"),null),defaults["null"],true);def("Node").bases("Printable").field("type",isString);def("SourceLocation").build("start","end","source").field("start",def("Position")).field("end",def("Position")).field("source",or(isString,null),defaults["null"]);def("Position").build("line","column").field("line",geq(1)).field("column",geq(0));def("Program").bases("Node").build("body").field("body",[def("Statement")]).field("comments",or([or(def("Block"),def("Line"))],null),defaults["null"],true);def("Function").bases("Node").field("id",or(def("Identifier"),null),defaults["null"]).field("params",[def("Pattern")]).field("body",or(def("BlockStatement"),def("Expression")));def("Statement").bases("Node");def("EmptyStatement").bases("Statement").build();def("BlockStatement").bases("Statement").build("body").field("body",[def("Statement")]);def("ExpressionStatement").bases("Statement").build("expression").field("expression",def("Expression"));def("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Statement")).field("alternate",or(def("Statement"),null),defaults["null"]);def("LabeledStatement").bases("Statement").build("label","body").field("label",def("Identifier")).field("body",def("Statement"));def("BreakStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("ContinueStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("WithStatement").bases("Statement").build("object","body").field("object",def("Expression")).field("body",def("Statement"));def("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",def("Expression")).field("cases",[def("SwitchCase")]).field("lexical",isBoolean,defaults["false"]);def("ReturnStatement").bases("Statement").build("argument").field("argument",or(def("Expression"),null));def("ThrowStatement").bases("Statement").build("argument").field("argument",def("Expression"));def("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",def("BlockStatement")).field("handler",or(def("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[def("CatchClause")],function(){return this.handler?[this.handler]:[]},true).field("guardedHandlers",[def("CatchClause")],defaults.emptyArray).field("finalizer",or(def("BlockStatement"),null),defaults["null"]);def("CatchClause").bases("Node").build("param","guard","body").field("param",def("Pattern")).field("guard",or(def("Expression"),null),defaults["null"]).field("body",def("BlockStatement"));def("WhileStatement").bases("Statement").build("test","body").field("test",def("Expression")).field("body",def("Statement"));def("DoWhileStatement").bases("Statement").build("body","test").field("body",def("Statement")).field("test",def("Expression"));def("ForStatement").bases("Statement").build("init","test","update","body").field("init",or(def("VariableDeclaration"),def("Expression"),null)).field("test",or(def("Expression"),null)).field("update",or(def("Expression"),null)).field("body",def("Statement"));def("ForInStatement").bases("Statement").build("left","right","body","each").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement")).field("each",isBoolean);def("DebuggerStatement").bases("Statement").build();def("Declaration").bases("Statement");def("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",def("Identifier"));def("FunctionExpression").bases("Function","Expression").build("id","params","body");def("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",or("var","let","const")).field("declarations",[or(def("VariableDeclarator"),def("Identifier"))]);def("VariableDeclarator").bases("Node").build("id","init").field("id",def("Pattern")).field("init",or(def("Expression"),null));def("Expression").bases("Node","Pattern");def("ThisExpression").bases("Expression").build();def("ArrayExpression").bases("Expression").build("elements").field("elements",[or(def("Expression"),null)]);def("ObjectExpression").bases("Expression").build("properties").field("properties",[def("Property")]);def("Property").bases("Node").build("kind","key","value").field("kind",or("init","get","set")).field("key",or(def("Literal"),def("Identifier"))).field("value",def("Expression"));def("SequenceExpression").bases("Expression").build("expressions").field("expressions",[def("Expression")]);var UnaryOperator=or("-","+","!","~","typeof","void","delete");def("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",UnaryOperator).field("argument",def("Expression")).field("prefix",isBoolean,defaults["true"]);var BinaryOperator=or("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");def("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",BinaryOperator).field("left",def("Expression")).field("right",def("Expression"));var AssignmentOperator=or("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");def("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",AssignmentOperator).field("left",def("Pattern")).field("right",def("Expression"));var UpdateOperator=or("++","--");def("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",UpdateOperator).field("argument",def("Expression")).field("prefix",isBoolean);var LogicalOperator=or("||","&&");def("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",LogicalOperator).field("left",def("Expression")).field("right",def("Expression"));def("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Expression")).field("alternate",def("Expression"));def("NewExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("CallExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("MemberExpression").bases("Expression").build("object","property","computed").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("Pattern").bases("Node");def("ObjectPattern").bases("Pattern").build("properties").field("properties",[def("PropertyPattern")]);def("PropertyPattern").bases("Pattern").build("key","pattern").field("key",or(def("Literal"),def("Identifier"))).field("pattern",def("Pattern"));def("ArrayPattern").bases("Pattern").build("elements").field("elements",[or(def("Pattern"),null)]);def("SwitchCase").bases("Node").build("test","consequent").field("test",or(def("Expression"),null)).field("consequent",[def("Statement")]);def("Identifier").bases("Node","Expression","Pattern").build("name").field("name",isString);def("Literal").bases("Node","Expression").build("value").field("value",or(isString,isBoolean,null,isNumber,isRegExp));def("Block").bases("Printable").build("loc","value").field("value",isString);def("Line").bases("Printable").build("loc","value").field("value",isString)},{"../lib/shared":90,"../lib/types":91}],80:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;def("XMLDefaultDeclaration").bases("Declaration").field("namespace",def("Expression"));def("XMLAnyName").bases("Expression");def("XMLQualifiedIdentifier").bases("Expression").field("left",or(def("Identifier"),def("XMLAnyName"))).field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLAttributeSelector").bases("Expression").field("attribute",def("Expression"));def("XMLFilterExpression").bases("Expression").field("left",def("Expression")).field("right",def("Expression"));def("XMLElement").bases("XML","Expression").field("contents",[def("XML")]);def("XMLList").bases("XML","Expression").field("contents",[def("XML")]);def("XML").bases("Node");def("XMLEscape").bases("XML").field("expression",def("Expression"));def("XMLText").bases("XML").field("text",isString);def("XMLStartTag").bases("XML").field("contents",[def("XML")]);def("XMLEndTag").bases("XML").field("contents",[def("XML")]);def("XMLPointTag").bases("XML").field("contents",[def("XML")]);def("XMLName").bases("XML").field("contents",or(isString,[def("XML")]));def("XMLAttribute").bases("XML").field("value",isString);def("XMLCdata").bases("XML").field("contents",isString);def("XMLComment").bases("XML").field("contents",isString);def("XMLProcessingInstruction").bases("XML").field("target",isString).field("contents",or(isString,null))},{"../lib/types":91,"./core":79}],81:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var isObject=builtin.object;var isString=builtin.string;var defaults=require("../lib/shared").defaults;def("Function").field("generator",isBoolean,defaults["false"]).field("expression",isBoolean,defaults["false"]).field("defaults",[or(def("Expression"),null)],defaults.emptyArray).field("rest",or(def("Identifier"),null),defaults["null"]);def("FunctionDeclaration").build("id","params","body","generator","expression");def("FunctionExpression").build("id","params","body","generator","expression");def("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,defaults["null"]).field("generator",false);def("YieldExpression").bases("Expression").build("argument","delegate").field("argument",or(def("Expression"),null)).field("delegate",isBoolean,defaults["false"]);def("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionBlock").bases("Node").build("left","right","each").field("left",def("Pattern")).field("right",def("Expression")).field("each",isBoolean);def("ModuleSpecifier").bases("Literal").build("value").field("value",isString);def("Property").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("method",isBoolean,defaults["false"]).field("shorthand",isBoolean,defaults["false"]).field("computed",isBoolean,defaults["false"]);def("PropertyPattern").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",or("init","get","set","")).field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("value",def("Function")).field("computed",isBoolean,defaults["false"]);def("SpreadElement").bases("Node").build("argument").field("argument",def("Expression"));def("ArrayExpression").field("elements",[or(def("Expression"),def("SpreadElement"),null)]);def("NewExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("CallExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("SpreadElementPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));var ClassBodyElement=or(def("MethodDefinition"),def("VariableDeclarator"),def("ClassPropertyDefinition"),def("ClassProperty"));def("ClassProperty").bases("Declaration").build("key").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",ClassBodyElement);def("ClassBody").bases("Declaration").build("body").field("body",[ClassBodyElement]);def("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",def("Identifier")).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]);def("ClassExpression").bases("Expression").build("id","body","superClass").field("id",or(def("Identifier"),null),defaults["null"]).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]).field("implements",[def("ClassImplements")],defaults.emptyArray);def("ClassImplements").bases("Node").build("id").field("id",def("Identifier")).field("superClass",or(def("Expression"),null),defaults["null"]);def("Specifier").bases("Node");def("NamedSpecifier").bases("Specifier").field("id",def("Identifier")).field("name",or(def("Identifier"),null),defaults["null"]);def("ExportSpecifier").bases("NamedSpecifier").build("id","name");def("ExportBatchSpecifier").bases("Specifier").build();def("ImportSpecifier").bases("NamedSpecifier").build("id","name");def("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",isBoolean).field("declaration",or(def("Declaration"),def("Expression"),null)).field("specifiers",[or(def("ExportSpecifier"),def("ExportBatchSpecifier"))],defaults.emptyArray).field("source",or(def("ModuleSpecifier"),null),defaults["null"]);def("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[or(def("ImportSpecifier"),def("ImportNamespaceSpecifier"),def("ImportDefaultSpecifier"))],defaults.emptyArray).field("source",def("ModuleSpecifier"));def("TaggedTemplateExpression").bases("Expression").field("tag",def("Expression")).field("quasi",def("TemplateLiteral"));def("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[def("TemplateElement")]).field("expressions",[def("Expression")]);def("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:isString,raw:isString}).field("tail",isBoolean)},{"../lib/shared":90,"../lib/types":91,"./core":79}],82:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("Function").field("async",isBoolean,defaults["false"]);def("SpreadProperty").bases("Node").build("argument").field("argument",def("Expression"));def("ObjectExpression").field("properties",[or(def("Property"),def("SpreadProperty"))]);def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));def("ObjectPattern").field("properties",[or(def("PropertyPattern"),def("SpreadPropertyPattern"))]);def("AwaitExpression").bases("Expression").build("argument","all").field("argument",or(def("Expression"),null)).field("all",isBoolean,defaults["false"])
},{"../lib/shared":90,"../lib/types":91,"./core":79}],83:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("XJSAttribute").bases("Node").build("name","value").field("name",or(def("XJSIdentifier"),def("XJSNamespacedName"))).field("value",or(def("Literal"),def("XJSExpressionContainer"),null),defaults["null"]);def("XJSIdentifier").bases("Node").build("name").field("name",isString);def("XJSNamespacedName").bases("Node").build("namespace","name").field("namespace",def("XJSIdentifier")).field("name",def("XJSIdentifier"));def("XJSMemberExpression").bases("MemberExpression").build("object","property").field("object",or(def("XJSIdentifier"),def("XJSMemberExpression"))).field("property",def("XJSIdentifier")).field("computed",isBoolean,defaults.false);var XJSElementName=or(def("XJSIdentifier"),def("XJSNamespacedName"),def("XJSMemberExpression"));def("XJSSpreadAttribute").bases("Node").build("argument").field("argument",def("Expression"));var XJSAttributes=[or(def("XJSAttribute"),def("XJSSpreadAttribute"))];def("XJSExpressionContainer").bases("Expression").build("expression").field("expression",def("Expression"));def("XJSElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",def("XJSOpeningElement")).field("closingElement",or(def("XJSClosingElement"),null),defaults["null"]).field("children",[or(def("XJSElement"),def("XJSExpressionContainer"),def("XJSText"),def("Literal"))],defaults.emptyArray).field("name",XJSElementName,function(){return this.openingElement.name}).field("selfClosing",isBoolean,function(){return this.openingElement.selfClosing}).field("attributes",XJSAttributes,function(){return this.openingElement.attributes});def("XJSOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",XJSElementName).field("attributes",XJSAttributes,defaults.emptyArray).field("selfClosing",isBoolean,defaults["false"]);def("XJSClosingElement").bases("Node").build("name").field("name",XJSElementName);def("XJSText").bases("Literal").build("value").field("value",isString);def("XJSEmptyExpression").bases("Expression").build();def("Type").bases("Node");def("AnyTypeAnnotation").bases("Type");def("VoidTypeAnnotation").bases("Type");def("NumberTypeAnnotation").bases("Type");def("StringTypeAnnotation").bases("Type");def("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",isString).field("raw",isString);def("BooleanTypeAnnotation").bases("Type");def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",def("Type"));def("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",def("Type"));def("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[def("FunctionTypeParam")]).field("returnType",def("Type")).field("rest",or(def("FunctionTypeParam"),null)).field("typeParameters",or(def("TypeParameterDeclaration"),null));def("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",def("Identifier")).field("typeAnnotation",def("Type")).field("optional",isBoolean);def("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[def("ObjectTypeProperty")]).field("indexers",[def("ObjectTypeIndexer")],defaults.emptyArray).field("callProperties",[def("ObjectTypeCallProperty")],defaults.emptyArray);def("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",or(def("Literal"),def("Identifier"))).field("value",def("Type")).field("optional",isBoolean);def("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",def("Identifier")).field("key",def("Type")).field("value",def("Type"));def("ObjectTypeCallProperty").bases("Node").build("value").field("value",def("FunctionTypeAnnotation")).field("static",isBoolean,false);def("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("id",def("Identifier"));def("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("MemberTypeAnnotation").bases("Type").build("object","property").field("object",def("Identifier")).field("property",or(def("MemberTypeAnnotation"),def("GenericTypeAnnotation")));def("UnionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",def("Type"));def("Identifier").field("typeAnnotation",or(def("TypeAnnotation"),null),defaults["null"]);def("TypeParameterDeclaration").bases("Node").build("params").field("params",[def("Identifier")]);def("TypeParameterInstantiation").bases("Node").build("params").field("params",[def("Type")]);def("Function").field("returnType",or(def("TypeAnnotation"),null),defaults["null"]).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]);def("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",def("TypeAnnotation")).field("static",isBoolean,false);def("ClassImplements").field("typeParameters",or(def("TypeParameterInstantiation"),null),defaults["null"]);def("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]).field("body",def("ObjectTypeAnnotation")).field("extends",[def("InterfaceExtends")]);def("InterfaceExtends").bases("Node").build("id").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null)).field("right",def("Type"));def("TupleTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("DeclareVariable").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareFunction").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareClass").bases("InterfaceDeclaration").build("id");def("DeclareModule").bases("Statement").build("id","body").field("id",or(def("Identifier"),def("Literal"))).field("body",def("BlockStatement"))},{"../lib/shared":90,"../lib/types":91,"./core":79}],84:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var geq=require("../lib/shared").geq;def("ForOfStatement").bases("Statement").build("left","right","body").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement"));def("LetStatement").bases("Statement").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Statement"));def("LetExpression").bases("Expression").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Expression"));def("GraphExpression").bases("Expression").build("index","expression").field("index",geq(0)).field("expression",def("Literal"));def("GraphIndexExpression").bases("Expression").build("index").field("index",geq(0))},{"../lib/shared":90,"../lib/types":91,"./core":79}],85:[function(require,module,exports){var assert=require("assert");var types=require("../main");var getFieldNames=types.getFieldNames;var getFieldValue=types.getFieldValue;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isDate=types.builtInTypes.Date;var isRegExp=types.builtInTypes.RegExp;var hasOwn=Object.prototype.hasOwnProperty;function astNodesAreEquivalent(a,b,problemPath){if(isArray.check(problemPath)){problemPath.length=0}else{problemPath=null}return areEquivalent(a,b,problemPath)}astNodesAreEquivalent.assert=function(a,b){var problemPath=[];if(!astNodesAreEquivalent(a,b,problemPath)){if(problemPath.length===0){assert.strictEqual(a,b)}else{assert.ok(false,"Nodes differ in the following path: "+problemPath.map(subscriptForProperty).join(""))}}};function subscriptForProperty(property){if(/[_$a-z][_$a-z0-9]*/i.test(property)){return"."+property}return"["+JSON.stringify(property)+"]"}function areEquivalent(a,b,problemPath){if(a===b){return true}if(isArray.check(a)){return arraysAreEquivalent(a,b,problemPath)}if(isObject.check(a)){return objectsAreEquivalent(a,b,problemPath)}if(isDate.check(a)){return isDate.check(b)&&+a===+b}if(isRegExp.check(a)){return isRegExp.check(b)&&(a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.ignoreCase===b.ignoreCase)}return a==b}function arraysAreEquivalent(a,b,problemPath){isArray.assert(a);var aLength=a.length;if(!isArray.check(b)||b.length!==aLength){if(problemPath){problemPath.push("length")}return false}for(var i=0;i<aLength;++i){if(problemPath){problemPath.push(i)}if(i in a!==i in b){return false}if(!areEquivalent(a[i],b[i],problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),i)}}return true}function objectsAreEquivalent(a,b,problemPath){isObject.assert(a);if(!isObject.check(b)){return false}if(a.type!==b.type){if(problemPath){problemPath.push("type")}return false}var aNames=getFieldNames(a);var aNameCount=aNames.length;var bNames=getFieldNames(b);var bNameCount=bNames.length;if(aNameCount===bNameCount){for(var i=0;i<aNameCount;++i){var name=aNames[i];var aChild=getFieldValue(a,name);var bChild=getFieldValue(b,name);if(problemPath){problemPath.push(name)}if(!areEquivalent(aChild,bChild,problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),name)}}return true}if(!problemPath){return false}var seenNames=Object.create(null);for(i=0;i<aNameCount;++i){seenNames[aNames[i]]=true}for(i=0;i<bNameCount;++i){name=bNames[i];if(!hasOwn.call(seenNames,name)){problemPath.push(name);return false}delete seenNames[name]}for(name in seenNames){problemPath.push(name);break}return false}module.exports=astNodesAreEquivalent},{"../main":92,assert:94}],86:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var b=types.builders;var isNumber=types.builtInTypes.number;var isArray=types.builtInTypes.array;var Path=require("./path");var Scope=require("./scope");function NodePath(value,parentPath,name){assert.ok(this instanceof NodePath);Path.call(this,value,parentPath,name)}require("util").inherits(NodePath,Path);var NPp=NodePath.prototype;Object.defineProperties(NPp,{node:{get:function(){Object.defineProperty(this,"node",{configurable:true,value:this._computeNode()});return this.node}},parent:{get:function(){Object.defineProperty(this,"parent",{configurable:true,value:this._computeParent()});return this.parent}},scope:{get:function(){Object.defineProperty(this,"scope",{configurable:true,value:this._computeScope()});return this.scope}}});NPp.replace=function(){delete this.node;delete this.parent;delete this.scope;return Path.prototype.replace.apply(this,arguments)};NPp.prune=function(){var remainingNodePath=this.parent;this.replace();return cleanUpNodesAfterPrune(remainingNodePath)};NPp._computeNode=function(){var value=this.value;if(n.Node.check(value)){return value}var pp=this.parentPath;return pp&&pp.node||null};NPp._computeParent=function(){var value=this.value;var pp=this.parentPath;if(!n.Node.check(value)){while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}if(pp){pp=pp.parentPath}}while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}return pp||null};NPp._computeScope=function(){var value=this.value;var pp=this.parentPath;var scope=pp&&pp.scope;if(n.Node.check(value)&&Scope.isEstablishedBy(value)){scope=new Scope(this,scope)}return scope||null};NPp.getValueProperty=function(name){return types.getFieldValue(this.value,name)};NPp.needsParens=function(assumeExpressionContext){var pp=this.parentPath;if(!pp){return false}var node=this.value;if(!n.Expression.check(node)){return false}if(node.type==="Identifier"){return false}while(!n.Node.check(pp.value)){pp=pp.parentPath;if(!pp){return false}}var parent=pp.value;switch(node.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return parent.type==="MemberExpression"&&this.name==="object"&&parent.object===node;case"BinaryExpression":case"LogicalExpression":switch(parent.type){case"CallExpression":return this.name==="callee"&&parent.callee===node;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return true;case"MemberExpression":return this.name==="object"&&parent.object===node;case"BinaryExpression":case"LogicalExpression":var po=parent.operator;var pp=PRECEDENCE[po];var no=node.operator;var np=PRECEDENCE[no];if(pp>np){return true}if(pp===np&&this.name==="right"){assert.strictEqual(parent.right,node);return true}default:return false}case"SequenceExpression":switch(parent.type){case"ForStatement":return false;case"ExpressionStatement":return this.name!=="expression";default:return true}case"YieldExpression":switch(parent.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return true;default:return false}case"Literal":return parent.type==="MemberExpression"&&isNumber.check(node.value)&&this.name==="object"&&parent.object===node;case"AssignmentExpression":case"ConditionalExpression":switch(parent.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return true;case"CallExpression":return this.name==="callee"&&parent.callee===node;case"ConditionalExpression":return this.name==="test"&&parent.test===node;case"MemberExpression":return this.name==="object"&&parent.object===node;default:return false}default:if(parent.type==="NewExpression"&&this.name==="callee"&&parent.callee===node){return containsCallExpression(node)}}if(assumeExpressionContext!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function isBinary(node){return n.BinaryExpression.check(node)||n.LogicalExpression.check(node)}function isUnaryLike(node){return n.UnaryExpression.check(node)||n.SpreadElement&&n.SpreadElement.check(node)||n.SpreadProperty&&n.SpreadProperty.check(node)}var PRECEDENCE={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(tier,i){tier.forEach(function(op){PRECEDENCE[op]=i})});function containsCallExpression(node){if(n.CallExpression.check(node)){return true}if(isArray.check(node)){return node.some(containsCallExpression)}if(n.Node.check(node)){return types.someField(node,function(name,child){return containsCallExpression(child)})}return false}NPp.canBeFirstInStatement=function(){var node=this.node;return!n.FunctionExpression.check(node)&&!n.ObjectExpression.check(node)};NPp.firstInStatement=function(){return firstInStatement(this)};function firstInStatement(path){for(var node,parent;path.parent;path=path.parent){node=path.node;parent=path.parent.node;if(n.BlockStatement.check(parent)&&path.parent.name==="body"&&path.name===0){assert.strictEqual(parent.body[0],node);return true}if(n.ExpressionStatement.check(parent)&&path.name==="expression"){assert.strictEqual(parent.expression,node);return true}if(n.SequenceExpression.check(parent)&&path.parent.name==="expressions"&&path.name===0){assert.strictEqual(parent.expressions[0],node);continue}if(n.CallExpression.check(parent)&&path.name==="callee"){assert.strictEqual(parent.callee,node);continue}if(n.MemberExpression.check(parent)&&path.name==="object"){assert.strictEqual(parent.object,node);continue}if(n.ConditionalExpression.check(parent)&&path.name==="test"){assert.strictEqual(parent.test,node);continue}if(isBinary(parent)&&path.name==="left"){assert.strictEqual(parent.left,node);continue}if(n.UnaryExpression.check(parent)&&!parent.prefix&&path.name==="argument"){assert.strictEqual(parent.argument,node);continue}return false}return true}function cleanUpNodesAfterPrune(remainingNodePath){if(n.VariableDeclaration.check(remainingNodePath.node)){var declarations=remainingNodePath.get("declarations").value;if(!declarations||declarations.length===0){return remainingNodePath.prune()}}else if(n.ExpressionStatement.check(remainingNodePath.node)){if(!remainingNodePath.get("expression").value){return remainingNodePath.prune()}}else if(n.IfStatement.check(remainingNodePath.node)){cleanUpIfStatementAfterPrune(remainingNodePath)}return remainingNodePath}function cleanUpIfStatementAfterPrune(ifStatement){var testExpression=ifStatement.get("test").value;var alternate=ifStatement.get("alternate").value;var consequent=ifStatement.get("consequent").value;if(!consequent&&!alternate){var testExpressionStatement=b.expressionStatement(testExpression);ifStatement.replace(testExpressionStatement)}else if(!consequent&&alternate){var negatedTestExpression=b.unaryExpression("!",testExpression,true);if(n.UnaryExpression.check(testExpression)&&testExpression.operator==="!"){negatedTestExpression=testExpression.argument}ifStatement.get("test").replace(negatedTestExpression);ifStatement.get("consequent").replace(alternate);ifStatement.get("alternate").replace()}}module.exports=NodePath},{"./path":88,"./scope":89,"./types":91,assert:94,util:118}],87:[function(require,module,exports){var assert=require("assert");var types=require("./types");var NodePath=require("./node-path");var Node=types.namedTypes.Node;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isFunction=types.builtInTypes.function;var hasOwn=Object.prototype.hasOwnProperty;var undefined;function PathVisitor(){assert.ok(this instanceof PathVisitor);this._reusableContextStack=[];this._methodNameTable=computeMethodNameTable(this);this.Context=makeContextConstructor(this);this._visiting=false;this._changeReported=false}function computeMethodNameTable(visitor){var typeNames=Object.create(null);for(var methodName in visitor){if(/^visit[A-Z]/.test(methodName)){typeNames[methodName.slice("visit".length)]=true}}var supertypeTable=types.computeSupertypeLookupTable(typeNames);var methodNameTable=Object.create(null);var typeNames=Object.keys(supertypeTable);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];methodName="visit"+supertypeTable[typeName];if(isFunction.check(visitor[methodName])){methodNameTable[typeName]=methodName}}return methodNameTable}PathVisitor.fromMethodsObject=function fromMethodsObject(methods){if(methods instanceof PathVisitor){return methods}if(!isObject.check(methods)){return new PathVisitor}function Visitor(){assert.ok(this instanceof Visitor);PathVisitor.call(this)}var Vp=Visitor.prototype=Object.create(PVp);Vp.constructor=Visitor;extend(Vp,methods);extend(Visitor,PathVisitor);isFunction.assert(Visitor.fromMethodsObject);isFunction.assert(Visitor.visit);return new Visitor};function extend(target,source){for(var property in source){if(hasOwn.call(source,property)){target[property]=source[property]}}return target}PathVisitor.visit=function visit(node,methods){var visitor=PathVisitor.fromMethodsObject(methods);if(node instanceof NodePath){visitor.visit(node);return node.value}var rootPath=new NodePath({root:node});visitor.visit(rootPath.get("root"));return rootPath.value.root};var PVp=PathVisitor.prototype;var recursiveVisitWarning=["Recursively calling visitor.visit(path) resets visitor state.","Try this.visit(path) or this.traverse(path) instead."].join(" ");PVp.visit=function(path){assert.ok(!this._visiting,recursiveVisitWarning);this._visiting=true;this._changeReported=false;this.reset.apply(this,arguments);try{return this.visitWithoutReset(path)}finally{this._visiting=false}};PVp.reset=function(path){};PVp.visitWithoutReset=function(path){if(this instanceof this.Context){return this.visitor.visitWithoutReset(path)}assert.ok(path instanceof NodePath);var value=path.value;var methodName=Node.check(value)&&this._methodNameTable[value.type];if(methodName){var context=this.acquireContext(path);try{context.invokeVisitorMethod(methodName)}finally{this.releaseContext(context)}}else{visitChildren(path,this)}};function visitChildren(path,visitor){assert.ok(path instanceof NodePath);assert.ok(visitor instanceof PathVisitor);var value=path.value;if(isArray.check(value)){path.each(visitor.visitWithoutReset,visitor)}else if(!isObject.check(value)){}else{var childNames=types.getFieldNames(value);var childCount=childNames.length;var childPaths=[];for(var i=0;i<childCount;++i){var childName=childNames[i];if(!hasOwn.call(value,childName)){value[childName]=types.getFieldValue(value,childName)}childPaths.push(path.get(childName))}for(var i=0;i<childCount;++i){visitor.visitWithoutReset(childPaths[i])}}}PVp.acquireContext=function(path){if(this._reusableContextStack.length===0){return new this.Context(path)}return this._reusableContextStack.pop().reset(path)};PVp.releaseContext=function(context){assert.ok(context instanceof this.Context);this._reusableContextStack.push(context);context.currentPath=null};PVp.reportChanged=function(){this._changeReported=true};PVp.wasChangeReported=function(){return this._changeReported};function makeContextConstructor(visitor){function Context(path){assert.ok(this instanceof Context);assert.ok(this instanceof PathVisitor);assert.ok(path instanceof NodePath);Object.defineProperty(this,"visitor",{value:visitor,writable:false,enumerable:true,configurable:false});this.currentPath=path;this.needToCallTraverse=true;Object.seal(this)}assert.ok(visitor instanceof PathVisitor);var Cp=Context.prototype=Object.create(visitor);Cp.constructor=Context;extend(Cp,sharedContextProtoMethods);return Context}var sharedContextProtoMethods=Object.create(null);sharedContextProtoMethods.reset=function reset(path){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);this.currentPath=path;this.needToCallTraverse=true;return this};sharedContextProtoMethods.invokeVisitorMethod=function invokeVisitorMethod(methodName){assert.ok(this instanceof this.Context);assert.ok(this.currentPath instanceof NodePath);var result=this.visitor[methodName].call(this,this.currentPath);if(result===false){this.needToCallTraverse=false}else if(result!==undefined){this.currentPath=this.currentPath.replace(result)[0];if(this.needToCallTraverse){this.traverse(this.currentPath)}}assert.strictEqual(this.needToCallTraverse,false,"Must either call this.traverse or return false in "+methodName)};sharedContextProtoMethods.traverse=function traverse(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;visitChildren(path,PathVisitor.fromMethodsObject(newVisitor||this.visitor))};sharedContextProtoMethods.visit=function visit(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;PathVisitor.fromMethodsObject(newVisitor||this.visitor).visitWithoutReset(path)};sharedContextProtoMethods.reportChanged=function reportChanged(){this.visitor.reportChanged()};module.exports=PathVisitor},{"./node-path":86,"./types":91,assert:94}],88:[function(require,module,exports){var assert=require("assert");var Op=Object.prototype;var hasOwn=Op.hasOwnProperty;var types=require("./types");var isArray=types.builtInTypes.array;var isNumber=types.builtInTypes.number;var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;function Path(value,parentPath,name){assert.ok(this instanceof Path);if(parentPath){assert.ok(parentPath instanceof Path)}else{parentPath=null;name=null}this.value=value;this.parentPath=parentPath;this.name=name;this.__childCache=null}var Pp=Path.prototype;function getChildCache(path){return path.__childCache||(path.__childCache=Object.create(null))}function getChildPath(path,name){var cache=getChildCache(path);var actualChildValue=path.getValueProperty(name);var childPath=cache[name];if(!hasOwn.call(cache,name)||childPath.value!==actualChildValue){childPath=cache[name]=new path.constructor(actualChildValue,path,name)}return childPath}Pp.getValueProperty=function getValueProperty(name){return this.value[name]};Pp.get=function get(name){var path=this;var names=arguments;var count=names.length;for(var i=0;i<count;++i){path=getChildPath(path,names[i])}return path};Pp.each=function each(callback,context){var childPaths=[];var len=this.value.length;var i=0;for(var i=0;i<len;++i){if(hasOwn.call(this.value,i)){childPaths[i]=this.get(i)}}context=context||this;for(i=0;i<len;++i){if(hasOwn.call(childPaths,i)){callback.call(context,childPaths[i])}}};Pp.map=function map(callback,context){var result=[];this.each(function(childPath){result.push(callback.call(this,childPath))},context);return result};Pp.filter=function filter(callback,context){var result=[];this.each(function(childPath){if(callback.call(this,childPath)){result.push(childPath)}},context);return result};function emptyMoves(){}function getMoves(path,offset,start,end){isArray.assert(path.value);if(offset===0){return emptyMoves}var length=path.value.length;if(length<1){return emptyMoves}var argc=arguments.length;if(argc===2){start=0;end=length}else if(argc===3){start=Math.max(start,0);end=length}else{start=Math.max(start,0);end=Math.min(end,length)}isNumber.assert(start);isNumber.assert(end);var moves=Object.create(null);var cache=getChildCache(path);for(var i=start;i<end;++i){if(hasOwn.call(path.value,i)){var childPath=path.get(i);assert.strictEqual(childPath.name,i);var newIndex=i+offset;childPath.name=newIndex;moves[newIndex]=childPath;delete cache[i]}}delete cache.length;return function(){for(var newIndex in moves){var childPath=moves[newIndex];assert.strictEqual(childPath.name,+newIndex);cache[newIndex]=childPath;path.value[newIndex]=childPath.value}}}Pp.shift=function shift(){var move=getMoves(this,-1);var result=this.value.shift();move();return result};Pp.unshift=function unshift(node){var move=getMoves(this,arguments.length);var result=this.value.unshift.apply(this.value,arguments);move();return result};Pp.push=function push(node){isArray.assert(this.value);delete getChildCache(this).length;return this.value.push.apply(this.value,arguments)};Pp.pop=function pop(){isArray.assert(this.value);var cache=getChildCache(this);delete cache[this.value.length-1];delete cache.length;return this.value.pop()};Pp.insertAt=function insertAt(index,node){var argc=arguments.length;var move=getMoves(this,argc-1,index);if(move===emptyMoves){return this}index=Math.max(index,0);for(var i=1;i<argc;++i){this.value[index+i-1]=arguments[i]}move();return this};Pp.insertBefore=function insertBefore(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};Pp.insertAfter=function insertAfter(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name+1];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};function repairRelationshipWithParent(path){assert.ok(path instanceof Path);var pp=path.parentPath;if(!pp){return path}var parentValue=pp.value;var parentCache=getChildCache(pp);if(parentValue[path.name]===path.value){parentCache[path.name]=path}else if(isArray.check(parentValue)){var i=parentValue.indexOf(path.value);if(i>=0){parentCache[path.name=i]=path}}else{parentValue[path.name]=path.value;parentCache[path.name]=path}assert.strictEqual(parentValue[path.name],path.value);assert.strictEqual(path.parentPath.get(path.name),path);return path}Pp.replace=function replace(replacement){var results=[];var parentValue=this.parentPath.value;var parentCache=getChildCache(this.parentPath);var count=arguments.length;repairRelationshipWithParent(this);if(isArray.check(parentValue)){var originalLength=parentValue.length;var move=getMoves(this.parentPath,count-1,this.name+1);var spliceArgs=[this.name,1];for(var i=0;i<count;++i){spliceArgs.push(arguments[i])}var splicedOut=parentValue.splice.apply(parentValue,spliceArgs);assert.strictEqual(splicedOut[0],this.value);assert.strictEqual(parentValue.length,originalLength-1+count);move();if(count===0){delete this.value;delete parentCache[this.name];this.__childCache=null}else{assert.strictEqual(parentValue[this.name],replacement);if(this.value!==replacement){this.value=replacement;this.__childCache=null}for(i=0;i<count;++i){results.push(this.parentPath.get(this.name+i))}assert.strictEqual(results[0],this)}}else if(count===1){if(this.value!==replacement){this.__childCache=null}this.value=parentValue[this.name]=replacement;results.push(this)}else if(count===0){delete parentValue[this.name];delete this.value;this.__childCache=null}else{assert.ok(false,"Could not replace path")}return results};module.exports=Path},{"./types":91,assert:94}],89:[function(require,module,exports){var assert=require("assert");var types=require("./types");var Type=types.Type;var namedTypes=types.namedTypes;var Node=namedTypes.Node;var Expression=namedTypes.Expression;var isArray=types.builtInTypes.array;var hasOwn=Object.prototype.hasOwnProperty;var b=types.builders;function Scope(path,parentScope){assert.ok(this instanceof Scope);assert.ok(path instanceof require("./node-path"));ScopeType.assert(path.value);var depth;if(parentScope){assert.ok(parentScope instanceof Scope);depth=parentScope.depth+1}else{parentScope=null;depth=0}Object.defineProperties(this,{path:{value:path},node:{value:path.value},isGlobal:{value:!parentScope,enumerable:true},depth:{value:depth},parent:{value:parentScope},bindings:{value:{}}})}var scopeTypes=[namedTypes.Program,namedTypes.Function,namedTypes.CatchClause];var ScopeType=Type.or.apply(Type,scopeTypes);Scope.isEstablishedBy=function(node){return ScopeType.check(node)};var Sp=Scope.prototype;Sp.didScan=false;Sp.declares=function(name){this.scan();return hasOwn.call(this.bindings,name)};Sp.declareTemporary=function(prefix){if(prefix){assert.ok(/^[a-z$_]/i.test(prefix),prefix)}else{prefix="t$"}prefix+=this.depth.toString(36)+"$";this.scan();var index=0;while(this.declares(prefix+index)){++index}var name=prefix+index;return this.bindings[name]=types.builders.identifier(name)};Sp.injectTemporary=function(identifier,init){identifier||(identifier=this.declareTemporary());var bodyPath=this.path.get("body");if(namedTypes.BlockStatement.check(bodyPath.value)){bodyPath=bodyPath.get("body")}bodyPath.unshift(b.variableDeclaration("var",[b.variableDeclarator(identifier,init||null)]));return identifier};Sp.scan=function(force){if(force||!this.didScan){for(var name in this.bindings){delete this.bindings[name]}scanScope(this.path,this.bindings);this.didScan=true}};Sp.getBindings=function(){this.scan();return this.bindings};function scanScope(path,bindings){var node=path.value;ScopeType.assert(node);if(namedTypes.CatchClause.check(node)){addPattern(path.get("param"),bindings)}else{recursiveScanScope(path,bindings)}}function recursiveScanScope(path,bindings){var node=path.value;if(path.parent&&namedTypes.FunctionExpression.check(path.parent.node)&&path.parent.node.id){addPattern(path.parent.get("id"),bindings)}if(!node){}else if(isArray.check(node)){path.each(function(childPath){recursiveScanChild(childPath,bindings)})}else if(namedTypes.Function.check(node)){path.get("params").each(function(paramPath){addPattern(paramPath,bindings)});recursiveScanChild(path.get("body"),bindings)}else if(namedTypes.VariableDeclarator.check(node)){addPattern(path.get("id"),bindings);recursiveScanChild(path.get("init"),bindings)}else if(node.type==="ImportSpecifier"||node.type==="ImportNamespaceSpecifier"||node.type==="ImportDefaultSpecifier"){addPattern(node.name?path.get("name"):path.get("id"),bindings)
}else if(Node.check(node)&&!Expression.check(node)){types.eachField(node,function(name,child){var childPath=path.get(name);assert.strictEqual(childPath.value,child);recursiveScanChild(childPath,bindings)})}}function recursiveScanChild(path,bindings){var node=path.value;if(!node||Expression.check(node)){}else if(namedTypes.FunctionDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(namedTypes.ClassDeclaration&&namedTypes.ClassDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(ScopeType.check(node)){if(namedTypes.CatchClause.check(node)){var catchParamName=node.param.name;var hadBinding=hasOwn.call(bindings,catchParamName);recursiveScanScope(path.get("body"),bindings);if(!hadBinding){delete bindings[catchParamName]}}}else{recursiveScanScope(path,bindings)}}function addPattern(patternPath,bindings){var pattern=patternPath.value;namedTypes.Pattern.assert(pattern);if(namedTypes.Identifier.check(pattern)){if(hasOwn.call(bindings,pattern.name)){bindings[pattern.name].push(patternPath)}else{bindings[pattern.name]=[patternPath]}}else if(namedTypes.SpreadElement&&namedTypes.SpreadElement.check(pattern)){addPattern(patternPath.get("argument"),bindings)}}Sp.lookup=function(name){for(var scope=this;scope;scope=scope.parent)if(scope.declares(name))break;return scope};Sp.getGlobalScope=function(){var scope=this;while(!scope.isGlobal)scope=scope.parent;return scope};module.exports=Scope},{"./node-path":86,"./types":91,assert:94}],90:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var builtin=types.builtInTypes;var isNumber=builtin.number;exports.geq=function(than){return new Type(function(value){return isNumber.check(value)&&value>=than},isNumber+" >= "+than)};exports.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return false},"true":function(){return true},undefined:function(){}};var naiveIsPrimitive=Type.or(builtin.string,builtin.number,builtin.boolean,builtin.null,builtin.undefined);exports.isPrimitive=new Type(function(value){if(value===null)return true;var type=typeof value;return!(type==="object"||type==="function")},naiveIsPrimitive.toString())},{"../lib/types":91}],91:[function(require,module,exports){var assert=require("assert");var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;var each=Ap.forEach;var Op=Object.prototype;var objToStr=Op.toString;var funObjStr=objToStr.call(function(){});var strObjStr=objToStr.call("");var hasOwn=Op.hasOwnProperty;function Type(check,name){var self=this;assert.ok(self instanceof Type,self);assert.strictEqual(objToStr.call(check),funObjStr,check+" is not a function");var nameObjStr=objToStr.call(name);assert.ok(nameObjStr===funObjStr||nameObjStr===strObjStr,name+" is neither a function nor a string");Object.defineProperties(self,{name:{value:name},check:{value:function(value,deep){var result=check.call(self,value,deep);if(!result&&deep&&objToStr.call(deep)===funObjStr)deep(self,value);return result}}})}var Tp=Type.prototype;exports.Type=Type;Tp.assert=function(value,deep){if(!this.check(value,deep)){var str=shallowStringify(value);assert.ok(false,str+" does not match type "+this);return false}return true};function shallowStringify(value){if(isObject.check(value))return"{"+Object.keys(value).map(function(key){return key+": "+value[key]}).join(", ")+"}";if(isArray.check(value))return"["+value.map(shallowStringify).join(", ")+"]";return JSON.stringify(value)}Tp.toString=function(){var name=this.name;if(isString.check(name))return name;if(isFunction.check(name))return name.call(this)+"";return name+" type"};var builtInTypes={};exports.builtInTypes=builtInTypes;function defBuiltInType(example,name){var objStr=objToStr.call(example);Object.defineProperty(builtInTypes,name,{enumerable:true,value:new Type(function(value){return objToStr.call(value)===objStr},name)});return builtInTypes[name]}var isString=defBuiltInType("","string");var isFunction=defBuiltInType(function(){},"function");var isArray=defBuiltInType([],"array");var isObject=defBuiltInType({},"object");var isRegExp=defBuiltInType(/./,"RegExp");var isDate=defBuiltInType(new Date,"Date");var isNumber=defBuiltInType(3,"number");var isBoolean=defBuiltInType(true,"boolean");var isNull=defBuiltInType(null,"null");var isUndefined=defBuiltInType(void 0,"undefined");function toType(from,name){if(from instanceof Type)return from;if(from instanceof Def)return from.type;if(isArray.check(from))return Type.fromArray(from);if(isObject.check(from))return Type.fromObject(from);if(isFunction.check(from))return new Type(from,name);return new Type(function(value){return value===from},isUndefined.check(name)?function(){return from+""}:name)}Type.or=function(){var types=[];var len=arguments.length;for(var i=0;i<len;++i)types.push(toType(arguments[i]));return new Type(function(value,deep){for(var i=0;i<len;++i)if(types[i].check(value,deep))return true;return false},function(){return types.join(" | ")})};Type.fromArray=function(arr){assert.ok(isArray.check(arr));assert.strictEqual(arr.length,1,"only one element type is permitted for typed arrays");return toType(arr[0]).arrayOf()};Tp.arrayOf=function(){var elemType=this;return new Type(function(value,deep){return isArray.check(value)&&value.every(function(elem){return elemType.check(elem,deep)})},function(){return"["+elemType+"]"})};Type.fromObject=function(obj){var fields=Object.keys(obj).map(function(name){return new Field(name,obj[name])});return new Type(function(value,deep){return isObject.check(value)&&fields.every(function(field){return field.type.check(value[field.name],deep)})},function(){return"{ "+fields.join(", ")+" }"})};function Field(name,type,defaultFn,hidden){var self=this;assert.ok(self instanceof Field);isString.assert(name);type=toType(type);var properties={name:{value:name},type:{value:type},hidden:{value:!!hidden}};if(isFunction.check(defaultFn)){properties.defaultFn={value:defaultFn}}Object.defineProperties(self,properties)}var Fp=Field.prototype;Fp.toString=function(){return JSON.stringify(this.name)+": "+this.type};Fp.getValue=function(obj){var value=obj[this.name];if(!isUndefined.check(value))return value;if(this.defaultFn)value=this.defaultFn.call(obj);return value};Type.def=function(typeName){isString.assert(typeName);return hasOwn.call(defCache,typeName)?defCache[typeName]:defCache[typeName]=new Def(typeName)};var defCache=Object.create(null);function Def(typeName){var self=this;assert.ok(self instanceof Def);Object.defineProperties(self,{typeName:{value:typeName},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new Type(function(value,deep){return self.check(value,deep)},typeName)}})}Def.fromValue=function(value){if(value&&typeof value==="object"){var type=value.type;if(typeof type==="string"&&hasOwn.call(defCache,type)){var d=defCache[type];if(d.finalized){return d}}}return null};var Dp=Def.prototype;Dp.isSupertypeOf=function(that){if(that instanceof Def){assert.strictEqual(this.finalized,true);assert.strictEqual(that.finalized,true);return hasOwn.call(that.allSupertypes,this.typeName)}else{assert.ok(false,that+" is not a Def")}};exports.getSupertypeNames=function(typeName){assert.ok(hasOwn.call(defCache,typeName));var d=defCache[typeName];assert.strictEqual(d.finalized,true);return d.supertypeList.slice(1)};exports.computeSupertypeLookupTable=function(candidates){var table={};var typeNames=Object.keys(defCache);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];var d=defCache[typeName];assert.strictEqual(d.finalized,true);for(var j=0;j<d.supertypeList.length;++j){var superTypeName=d.supertypeList[j];if(hasOwn.call(candidates,superTypeName)){table[typeName]=superTypeName;break}}}return table};Dp.checkAllFields=function(value,deep){var allFields=this.allFields;assert.strictEqual(this.finalized,true);function checkFieldByName(name){var field=allFields[name];var type=field.type;var child=field.getValue(value);return type.check(child,deep)}return isObject.check(value)&&Object.keys(allFields).every(checkFieldByName)};Dp.check=function(value,deep){assert.strictEqual(this.finalized,true,"prematurely checking unfinalized type "+this.typeName);if(!isObject.check(value))return false;var vDef=Def.fromValue(value);if(!vDef){if(this.typeName==="SourceLocation"||this.typeName==="Position"){return this.checkAllFields(value,deep)}return false}if(deep&&vDef===this)return this.checkAllFields(value,deep);if(!this.isSupertypeOf(vDef))return false;if(!deep)return true;return vDef.checkAllFields(value,deep)&&this.checkAllFields(value,false)};Dp.bases=function(){var bases=this.baseNames;assert.strictEqual(this.finalized,false);each.call(arguments,function(baseName){isString.assert(baseName);if(bases.indexOf(baseName)<0)bases.push(baseName)});return this};Object.defineProperty(Dp,"buildable",{value:false});var builders={};exports.builders=builders;var nodePrototype={};exports.defineMethod=function(name,func){var old=nodePrototype[name];if(isUndefined.check(func)){delete nodePrototype[name]}else{isFunction.assert(func);Object.defineProperty(nodePrototype,name,{enumerable:true,configurable:true,value:func})}return old};Dp.build=function(){var self=this;Object.defineProperty(self,"buildParams",{value:slice.call(arguments),writable:false,enumerable:false,configurable:true});assert.strictEqual(self.finalized,false);isString.arrayOf().assert(self.buildParams);if(self.buildable){return self}self.field("type",self.typeName,function(){return self.typeName});Object.defineProperty(self,"buildable",{value:true});Object.defineProperty(builders,getBuilderName(self.typeName),{enumerable:true,value:function(){var args=arguments;var argc=args.length;var built=Object.create(nodePrototype);assert.ok(self.finalized,"attempting to instantiate unfinalized type "+self.typeName);function add(param,i){if(hasOwn.call(built,param))return;var all=self.allFields;assert.ok(hasOwn.call(all,param),param);var field=all[param];var type=field.type;var value;if(isNumber.check(i)&&i<argc){value=args[i]}else if(field.defaultFn){value=field.defaultFn.call(built)}else{var message="no value or default function given for field "+JSON.stringify(param)+" of "+self.typeName+"("+self.buildParams.map(function(name){return all[name]}).join(", ")+")";assert.ok(false,message)}if(!type.check(value)){assert.ok(false,shallowStringify(value)+" does not match field "+field+" of type "+self.typeName)}built[param]=value}self.buildParams.forEach(function(param,i){add(param,i)});Object.keys(self.allFields).forEach(function(param){add(param)});assert.strictEqual(built.type,self.typeName);return built}});return self};function getBuilderName(typeName){return typeName.replace(/^[A-Z]+/,function(upperCasePrefix){var len=upperCasePrefix.length;switch(len){case 0:return"";case 1:return upperCasePrefix.toLowerCase();default:return upperCasePrefix.slice(0,len-1).toLowerCase()+upperCasePrefix.charAt(len-1)}})}Dp.field=function(name,type,defaultFn,hidden){assert.strictEqual(this.finalized,false);this.ownFields[name]=new Field(name,type,defaultFn,hidden);return this};var namedTypes={};exports.namedTypes=namedTypes;function getFieldNames(object){var d=Def.fromValue(object);if(d){return d.fieldNames.slice(0)}if("type"in object){assert.ok(false,"did not recognize object of type "+JSON.stringify(object.type))}return Object.keys(object)}exports.getFieldNames=getFieldNames;function getFieldValue(object,fieldName){var d=Def.fromValue(object);if(d){var field=d.allFields[fieldName];if(field){return field.getValue(object)}}return object[fieldName]}exports.getFieldValue=getFieldValue;exports.eachField=function(object,callback,context){getFieldNames(object).forEach(function(name){callback.call(this,name,getFieldValue(object,name))},context)};exports.someField=function(object,callback,context){return getFieldNames(object).some(function(name){return callback.call(this,name,getFieldValue(object,name))},context)};Object.defineProperty(Dp,"finalized",{value:false});Dp.finalize=function(){if(!this.finalized){var allFields=this.allFields;var allSupertypes=this.allSupertypes;this.baseNames.forEach(function(name){var def=defCache[name];def.finalize();extend(allFields,def.allFields);extend(allSupertypes,def.allSupertypes)});extend(allFields,this.ownFields);allSupertypes[this.typeName]=this;this.fieldNames.length=0;for(var fieldName in allFields){if(hasOwn.call(allFields,fieldName)&&!allFields[fieldName].hidden){this.fieldNames.push(fieldName)}}Object.defineProperty(namedTypes,this.typeName,{enumerable:true,value:this.type});Object.defineProperty(this,"finalized",{value:true});populateSupertypeList(this.typeName,this.supertypeList)}};function populateSupertypeList(typeName,list){list.length=0;list.push(typeName);var lastSeen=Object.create(null);for(var pos=0;pos<list.length;++pos){typeName=list[pos];var d=defCache[typeName];assert.strictEqual(d.finalized,true);if(hasOwn.call(lastSeen,typeName)){delete list[lastSeen[typeName]]}lastSeen[typeName]=pos;list.push.apply(list,d.baseNames)}for(var to=0,from=to,len=list.length;from<len;++from){if(hasOwn.call(list,from)){list[to++]=list[from]}}list.length=to}function extend(into,from){Object.keys(from).forEach(function(name){into[name]=from[name]});return into}exports.finalize=function(){Object.keys(defCache).forEach(function(name){defCache[name].finalize()})}},{assert:94}],92:[function(require,module,exports){var types=require("./lib/types");require("./def/core");require("./def/es6");require("./def/es7");require("./def/mozilla");require("./def/e4x");require("./def/fb-harmony");types.finalize();exports.Type=types.Type;exports.builtInTypes=types.builtInTypes;exports.namedTypes=types.namedTypes;exports.builders=types.builders;exports.defineMethod=types.defineMethod;exports.getFieldNames=types.getFieldNames;exports.getFieldValue=types.getFieldValue;exports.eachField=types.eachField;exports.someField=types.someField;exports.getSupertypeNames=types.getSupertypeNames;exports.astNodesAreEquivalent=require("./lib/equiv");exports.finalize=types.finalize;exports.NodePath=require("./lib/node-path");exports.PathVisitor=require("./lib/path-visitor");exports.visit=exports.PathVisitor.visit},{"./def/core":79,"./def/e4x":80,"./def/es6":81,"./def/es7":82,"./def/fb-harmony":83,"./def/mozilla":84,"./lib/equiv":85,"./lib/node-path":86,"./lib/path-visitor":87,"./lib/types":91}],93:[function(require,module,exports){},{}],94:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":118}],95:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=Buffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){if(encoding==="base64")subject=base64clean(subject);length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(this.length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string),buf,offset,length,2);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function binarySlice(buf,start,end){return asciiSlice(buf,start,end)}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;if(Buffer.TYPED_ARRAY_SUPPORT){return Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;var newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}return newBuf}};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;
offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(!target_start)target_start=0;if(end===start)return;if(target.length===0||source.length===0)return;if(end<start)throw new TypeError("sourceEnd < sourceStart");if(target_start<0||target_start>=target.length)throw new TypeError("targetStart out of bounds");if(start<0||start>=source.length)throw new TypeError("sourceStart out of bounds");if(end<0||end>source.length)throw new TypeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new TypeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new TypeError("start out of bounds");if(end<0||end>this.length)throw new TypeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){var b=str.charCodeAt(i);if(b<=127){byteArray.push(b)}else{var start=i;if(b>=55296&&b<=57343)i++;var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%");for(var j=0;j<h.length;j++){byteArray.push(parseInt(h[j],16))}}}return byteArray}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length,unitSize){if(unitSize)length-=length%unitSize;for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":96,ieee754:97,"is-array":98}],96:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS)return 62;if(code===SLASH)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],97:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],98:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],99:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],100:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],101:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],102:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:103}],103:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],104:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":105}],105:[function(require,module,exports){(function(process){module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);forEach(objectKeys(Writable.prototype),function(method){if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]});function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}}).call(this,require("_process"))},{"./_stream_readable":107,"./_stream_writable":109,_process:103,"core-util-is":110,inherits:100}],106:[function(require,module,exports){module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":108,"core-util-is":110,inherits:100}],107:[function(require,module,exports){(function(process){module.exports=Readable;var isArray=require("isarray");var Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;if(!EE.listenerCount)EE.listenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream=require("stream");var util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream);function ReadableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!options.objectMode;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}function Readable(options){if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(typeof chunk==="string"&&!state.objectMode){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=new Buffer(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null||chunk===undefined){state.reading=false;if(!state.ended)onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc};var MAX_HWM=8388608;function roundUpToNextPowerOf2(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;var ret;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){ret=null;if(state.length>0&&state.decoder){ret=fromList(n,state);state.length-=ret.length}if(state.length===0)endReadable(this);return ret}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream)}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)process.nextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){if(readable!==src)return;cleanup()}function onend(){dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);function cleanup(){dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);if(!dest._writableState||dest._writableState.needDrain)ondrain()}function onerror(er){unpipe();dest.removeListener("error",onerror);if(EE.listenerCount(dest,"error")===0)dest.emit("error",er)}if(!dest._events||!dest._events.error)dest.on("error",onerror);else if(isArray(dest._events.error))dest._events.error.unshift(onerror);else dest._events.error=[onerror,dest._events.error];function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){this.on("readable",pipeOnReadable);state.flowing=true;process.nextTick(function(){flow(src)})}return dest};function pipeOnDrain(src){return function(){var dest=this;var state=src._readableState;state.awaitDrain--;if(state.awaitDrain===0)flow(src)}}function flow(src){var state=src._readableState;var chunk;state.awaitDrain=0;function write(dest,i,list){var written=dest.write(chunk);if(false===written){state.awaitDrain++}}while(state.pipesCount&&null!==(chunk=src.read())){if(state.pipesCount===1)write(state.pipes,0,null);else forEach(state.pipes,write);src.emit("data",chunk);if(state.awaitDrain>0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);
state.flowing=false;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"&&!this._readableState.flowing)emitDataEvents(this);if(ev==="readable"&&this.readable){var state=this._readableState;if(!state.readableListening){state.readableListening=true;state.emittedReadable=false;state.needReadable=true;if(!state.reading){this.read(0)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.resume=function(){emitDataEvents(this);this.read(0);this.emit("resume")};Readable.prototype.pause=function(){emitDataEvents(this,true);this.emit("pause")};function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing){throw new Error("Cannot switch to old mode now.")}var paused=startPaused||false;var readable=false;stream.readable=true;stream.pipe=Stream.prototype.pipe;stream.on=stream.addListener=Stream.prototype.on;stream.on("readable",function(){readable=true;var c;while(!paused&&null!==(c=stream.read()))stream.emit("data",c);if(c===null){readable=false;stream._readableState.needReadable=true}});stream.pause=function(){paused=true;this.emit("pause")};stream.resume=function(){paused=false;if(readable)process.nextTick(function(){stream.emit("readable")});else this.read(0);this.emit("resume")};stream.emit("readable")}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(typeof stream[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){var list=state.buffer;var length=state.length;var stringMode=!!state.decoder;var objectMode=!!state.objectMode;var ret;if(list.length===0)return null;if(length===0)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n);list[0]=buf.slice(n)}else if(n===list[0].length){ret=list.shift()}else{if(stringMode)ret="";else ret=new Buffer(n);var c=0;for(var i=0,l=list.length;i<l&&c<n;i++){var buf=list[0];var cpy=Math.min(n-c,buf.length);if(stringMode)ret+=buf.slice(0,cpy);else buf.copy(ret,c,0,cpy);if(cpy<buf.length)list[0]=buf.slice(cpy);else list.shift();c+=cpy}}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{_process:103,buffer:95,"core-util-is":110,events:99,inherits:100,isarray:101,stream:115,"string_decoder/":116}],108:[function(require,module,exports){module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);if(cb)cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);var ts=this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var rs=stream._readableState;var ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":105,"core-util-is":110,inherits:100}],109:[function(require,module,exports){(function(process){module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream);function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb}function WritableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.objectMode=!!options.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er);process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er);process.nextTick(function(){cb(er)});valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=function(){};if(state.ended)writeAfterEnd(this,state,cb);else if(validChunk(this,state,chunk,cb))ret=writeOrBuffer(this,state,chunk,encoding,cb);return ret};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing)state.buffer.push(new WriteReq(chunk,encoding,cb));else doWrite(stream,state,len,chunk,encoding,cb);return ret}function doWrite(stream,state,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){if(sync)process.nextTick(function(){cb(er)});else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);if(!finished&&!state.bufferProcessing&&state.buffer.length)clearBuffer(stream,state);if(sync){process.nextTick(function(){afterWrite(stream,state,finished,cb)})}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);cb();if(finished)finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true;for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c];var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,len,chunk,encoding,cb);if(state.writing){c++;break}}state.bufferProcessing=false;if(c<state.buffer.length)state.buffer=state.buffer.slice(c);else state.buffer.length=0}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(typeof chunk!=="undefined"&&chunk!==null)this.write(chunk,encoding);if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(stream,state){return state.ending&&state.length===0&&!state.finished&&!state.writing}function finishMaybe(stream,state){var need=needFinish(stream,state);if(need){state.finished=true;stream.emit("finish")}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)process.nextTick(cb);else stream.once("finish",cb)}state.ended=true}}).call(this,require("_process"))},{"./_stream_duplex":105,_process:103,buffer:95,"core-util-is":110,inherits:100,stream:115}],110:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("buffer").Buffer)},{buffer:95}],111:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":106}],112:[function(require,module,exports){var Stream=require("stream");exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=Stream;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":105,"./lib/_stream_passthrough.js":106,"./lib/_stream_readable.js":107,"./lib/_stream_transform.js":108,"./lib/_stream_writable.js":109,stream:115}],113:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":108}],114:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":109}],115:[function(require,module,exports){module.exports=Stream;var EE=require("events").EventEmitter;var inherits=require("inherits");inherits(Stream,EE);Stream.Readable=require("readable-stream/readable.js");Stream.Writable=require("readable-stream/writable.js");Stream.Duplex=require("readable-stream/duplex.js");Stream.Transform=require("readable-stream/transform.js");Stream.PassThrough=require("readable-stream/passthrough.js");Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause()}}}source.on("data",ondata);function ondrain(){if(source.readable&&source.resume){source.resume()}}dest.on("drain",ondrain);if(!dest._isStdio&&(!options||options.end!==false)){source.on("end",onend);source.on("close",onclose)}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end()}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==="function")dest.destroy()}function onerror(er){cleanup();if(EE.listenerCount(this,"error")===0){throw er}}source.on("error",onerror);dest.on("error",onerror);function cleanup(){source.removeListener("data",ondata);dest.removeListener("drain",ondrain);source.removeListener("end",onend);source.removeListener("close",onclose);source.removeListener("error",onerror);dest.removeListener("error",onerror);source.removeListener("end",cleanup);source.removeListener("close",cleanup);dest.removeListener("close",cleanup)}source.on("end",cleanup);source.on("close",cleanup);dest.on("close",cleanup);dest.emit("pipe",source);return dest}},{events:99,inherits:100,"readable-stream/duplex.js":104,"readable-stream/passthrough.js":111,"readable-stream/readable.js":112,"readable-stream/transform.js":113,"readable-stream/writable.js":114}],116:[function(require,module,exports){var Buffer=require("buffer").Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error("Unknown encoding: "+encoding)}}var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(encoding);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0};StringDecoder.prototype.write=function(buffer){var charStr="";while(this.charLength){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived<this.charLength){return""}buffer=buffer.slice(available,buffer.length);charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:95}],117:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],118:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":117,_process:103,inherits:100}],119:[function(require,module,exports){!function(returnThis,framework,undefined){"use strict";var global=returnThis(),OBJECT="Object",FUNCTION="Function",ARRAY="Array",STRING="String",NUMBER="Number",REGEXP="RegExp",DATE="Date",MAP="Map",SET="Set",WEAKMAP="WeakMap",WEAKSET="WeakSet",SYMBOL="Symbol",PROMISE="Promise",MATH="Math",ARGUMENTS="Arguments",PROTOTYPE="prototype",CONSTRUCTOR="constructor",TO_STRING="toString",TO_STRING_TAG=TO_STRING+"Tag",TO_LOCALE="toLocaleString",HAS_OWN="hasOwnProperty",FOR_EACH="forEach",ITERATOR="iterator",FF_ITERATOR="@@"+ITERATOR,PROCESS="process",CREATE_ELEMENT="createElement",Function=global[FUNCTION],Object=global[OBJECT],Array=global[ARRAY],String=global[STRING],Number=global[NUMBER],RegExp=global[REGEXP],Date=global[DATE],Map=global[MAP],Set=global[SET],WeakMap=global[WEAKMAP],WeakSet=global[WEAKSET],Symbol=global[SYMBOL],Math=global[MATH],TypeError=global.TypeError,setTimeout=global.setTimeout,setImmediate=global.setImmediate,clearImmediate=global.clearImmediate,process=global[PROCESS],nextTick=process&&process.nextTick,document=global.document,html=document&&document.documentElement,navigator=global.navigator,define=global.define,ArrayProto=Array[PROTOTYPE],ObjectProto=Object[PROTOTYPE],FunctionProto=Function[PROTOTYPE],Infinity=1/0,DOT=".";function isObject(it){return it!=null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}var isNative=ctx(/./.test,/\[native code\]\s*\}\s*$/,1);var buildIn={Undefined:1,Null:1,Array:1,String:1,Arguments:1,Function:1,Error:1,Boolean:1,Number:1,Date:1,RegExp:1},toString=ObjectProto[TO_STRING];function setToStringTag(it,tag,stat){if(it)has(it=stat?it:it[PROTOTYPE],SYMBOL_TAG)||hidden(it,SYMBOL_TAG,tag)}function cof(it){return it==undefined?it===undefined?"Undefined":"Null":toString.call(it).slice(8,-1)}function classof(it){var klass=cof(it),tag;return klass==OBJECT&&(tag=it[SYMBOL_TAG])?has(buildIn,tag)?"~"+tag:tag:klass}var call=FunctionProto.call,REFERENCE_GET;function part(){var length=arguments.length,args=Array(length),i=0,_=path._,holder=false;while(length>i)if((args[i]=arguments[i++])===_)holder=true;return partial(this,args,length,holder,_,false)}function partial(fn,argsPart,lengthPart,holder,_,bind,context){assertFunction(fn);return function(){var that=bind?context:this,length=arguments.length,i=0,j=0,args;if(!holder&&!length)return invoke(fn,argsPart,that);args=argsPart.slice();if(holder)for(;lengthPart>i;i++)if(args[i]===_)args[i]=arguments[j++];while(length>j)args.push(arguments[j++]);return invoke(fn,args,that)}}function ctx(fn,that,length){assertFunction(fn);if(~length&&that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}function invoke(fn,args,that){var un=that===undefined;switch(args.length|0){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}var create=Object.create,getPrototypeOf=Object.getPrototypeOf,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,getOwnDescriptor=Object.getOwnPropertyDescriptor,getKeys=Object.keys,getNames=Object.getOwnPropertyNames,getSymbols=Object.getOwnPropertySymbols,has=ctx(call,ObjectProto[HAS_OWN],2),ES5Object=Object;
function get(object,key){if(has(object,key))return object[key]}function ownKeys(it){return getSymbols?getNames(it).concat(getSymbols(it)):getNames(it)}var assign=Object.assign||function(target,source){var T=Object(assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=ES5Object(arguments[i++]),keys=getKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T};function keyOf(object,el){var O=ES5Object(object),keys=getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}function array(it){return String(it).split(",")}var push=ArrayProto.push,unshift=ArrayProto.unshift,slice=ArrayProto.slice,splice=ArrayProto.splice,indexOf=ArrayProto.indexOf,forEach=ArrayProto[FOR_EACH];function createArrayMethod(type){var isMap=type==1,isFilter=type==2,isSome=type==3,isEvery=type==4,isFindIndex=type==6,noholes=type==5||isFindIndex;return function(callbackfn,that){var O=Object(assertDefined(this)),self=ES5Object(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=isMap?Array(length):isFilter?[]:undefined,val,res;for(;length>index;index++)if(noholes||index in self){val=self[index];res=f(val,index,O);if(type){if(isMap)result[index]=res;else if(res)switch(type){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(isEvery)return false}}return isFindIndex?-1:isSome||isEvery?isEvery:result}}function createArrayContains(isContains){return function(el,fromIndex){var O=ES5Object(assertDefined(this)),length=toLength(O.length),index=toIndex(fromIndex,length);if(isContains&&el!=el){for(;length>index;index++)if(sameNaN(O[index]))return isContains||index}else for(;length>index;index++)if(isContains||index in O){if(O[index]===el)return isContains||index}return!isContains&&-1}}function turn(mapfn,target){assertFunction(mapfn);var memo=target==undefined?[]:Object(target),O=ES5Object(this),length=toLength(O.length),index=0;for(;length>index;index++){if(mapfn(memo,O[index],index,this)===false)break}return memo}function generic(A,B){return typeof A=="function"?A:B}var MAX_SAFE_INTEGER=9007199254740991,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min,random=Math.random,trunc=Math.trunc||function(it){return(it>0?floor:ceil)(it)};function sameNaN(number){return number!=number}function toInteger(it){return isNaN(it)?0:trunc(it)}function toLength(it){return it>0?min(toInteger(it),MAX_SAFE_INTEGER):0}function toIndex(index,length){var index=toInteger(index);return index<0?max(index+length,0):min(index,length)}function createReplacer(regExp,replace,isStatic){var replacer=isObject(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}function createPointAt(toString){return function(pos){var s=String(assertDefined(this)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return toString?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?toString?s.charAt(i):a:toString?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}var REDUCE_ERROR="Reduce of empty object with no initial value";function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1)}function assertDefined(it){if(it==undefined)throw TypeError("Function called on null or undefined");return it}function assertFunction(it){assert(isFunction(it),it," is not a function!");return it}function assertObject(it){assert(isObject(it),it," is not an object!");return it}function assertInstance(it,Constructor,name){assert(it instanceof Constructor,name,": use the 'new' operator!")}function descriptor(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return defineProperty(object,key,descriptor(bitmap,value))}:simpleSet}function uid(key){return SYMBOL+"("+key+")_"+(++sid+random())[TO_STRING](36)}function getWellKnownSymbol(name,setter){return Symbol&&Symbol[name]||(setter?Symbol:safeSymbol)(SYMBOL+DOT+name)}var DESC=!!function(){try{return defineProperty({},0,ObjectProto)}catch(e){}}(),sid=0,hidden=createDefiner(1),set=Symbol?simpleSet:hidden,safeSymbol=Symbol||uid;function assignHidden(target,src){for(var key in src)hidden(target,key,src[key]);return target}var SYMBOL_ITERATOR=getWellKnownSymbol(ITERATOR),SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG),SUPPORT_FF_ITER=FF_ITERATOR in ArrayProto,ITER=safeSymbol("iter"),KEY=1,VALUE=2,Iterators={},IteratorPrototype={},NATIVE_ITERATORS=SYMBOL_ITERATOR in ArrayProto,BUGGY_ITERATORS="keys"in ArrayProto&&!("next"in[].keys());setIterator(IteratorPrototype,returnThis);function setIterator(O,value){hidden(O,SYMBOL_ITERATOR,value);SUPPORT_FF_ITER&&hidden(O,FF_ITERATOR,value)}function createIterator(Constructor,NAME,next,proto){Constructor[PROTOTYPE]=create(proto||IteratorPrototype,{next:descriptor(1,next)});setToStringTag(Constructor,NAME+" Iterator")}function defineIterator(Constructor,NAME,value,DEFAULT){var proto=Constructor[PROTOTYPE],iter=get(proto,SYMBOL_ITERATOR)||get(proto,FF_ITERATOR)||DEFAULT&&get(proto,DEFAULT)||value;if(framework){setIterator(proto,iter);if(iter!==value){var iterProto=getPrototypeOf(iter.call(new Constructor));setToStringTag(iterProto,NAME+" Iterator",true);has(proto,FF_ITERATOR)&&setIterator(iterProto,returnThis)}}Iterators[NAME]=iter;Iterators[NAME+" Iterator"]=returnThis}function defineStdIterators(Base,NAME,Constructor,next,DEFAULT){function createIter(kind){return function(){return new Constructor(this,kind)}}createIterator(Constructor,NAME,next);defineIterator(Base,NAME,createIter(DEFAULT),DEFAULT==VALUE?"values":"entries");DEFAULT&&$define(PROTO+FORCED*BUGGY_ITERATORS,NAME,{entries:createIter(KEY+VALUE),keys:createIter(KEY),values:createIter(VALUE)})}function iterResult(done,value){return{value:value,done:!!done}}function isIterable(it){var O=Object(it);return SYMBOL_ITERATOR in O||has(Iterators,classof(O))}function getIterator(it){return assertObject((it[SYMBOL_ITERATOR]||Iterators[classof(it)]).call(it))}function stepCall(fn,value,entries){return entries?invoke(fn,value):fn(value)}function forOf(iterable,entries,fn,that){var iterator=getIterator(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done)if(stepCall(f,step.value,entries)===false)return}var NODE=cof(process)==PROCESS,core={},path=framework?global:core,old=global.core,FORCED=1,GLOBAL=2,STATIC=4,PROTO=8,BIND=16,WRAP=32;function $define(type,name,source){var key,own,out,exp,isGlobal=type&GLOBAL,target=isGlobal?global:type&STATIC?global[name]:(global[name]||ObjectProto)[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&FORCED)&&target&&key in target&&(!isFunction(target[key])||isNative(target[key]));out=(own?target:source)[key];if(type&BIND&&own)exp=ctx(out,global);else if(type&WRAP&&!framework&&target[key]==out){exp=function(param){return this instanceof out?new out(param):out(param)};exp[PROTOTYPE]=out[PROTOTYPE]}else exp=type&PROTO&&isFunction(out)?ctx(call,out):out;if(exports[key]!=out)hidden(exports,key,exp);if(framework&&target&&!own){if(isGlobal)target[key]=out;else delete target[key]&&hidden(target,key,out)}}}if(NODE)module.exports=core;if(isFunction(define)&&define.amd)define(function(){return core});if(!NODE||framework){core.noConflict=function(){global.core=old;return core};global.core=core}$define(GLOBAL+FORCED,{global:global});!function(TAG,SymbolRegistry,setter){if(!isNative(Symbol)){Symbol=function(description){assert(!(this instanceof Symbol),SYMBOL+" is not a "+CONSTRUCTOR);var tag=uid(description);setter&&defineProperty(ObjectProto,tag,{configurable:true,set:function(value){hidden(this,tag,value)}});return set(create(Symbol[PROTOTYPE]),TAG,tag)};hidden(Symbol[PROTOTYPE],TO_STRING,function(){return this[TAG]})}$define(GLOBAL+WRAP,{Symbol:Symbol});var symbolStatics={"for":function(key){return has(SymbolRegistry,key+="")?SymbolRegistry[key]:SymbolRegistry[key]=Symbol(key)},iterator:SYMBOL_ITERATOR,keyFor:part.call(keyOf,SymbolRegistry),toStringTag:SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG,true),pure:safeSymbol,set:set,useSetter:function(){setter=true},useSimple:function(){setter=false}};forEach.call(array("hasInstance,isConcatSpreadable,match,replace,search,"+"species,split,toPrimitive,unscopables"),function(it){symbolStatics[it]=getWellKnownSymbol(it)});$define(STATIC,SYMBOL,symbolStatics);setToStringTag(Symbol,SYMBOL);$define(GLOBAL,{Reflect:{ownKeys:ownKeys}})}(safeSymbol("tag"),{},true);!function(isFinite,tmp){var RangeError=global.RangeError,isInteger=Number.isInteger||function(it){return!isObject(it)&&isFinite(it)&&floor(it)===it},sign=Math.sign||function sign(it){return(it=+it)==0||it!=it?it:it<0?-1:1},pow=Math.pow,abs=Math.abs,exp=Math.exp,log=Math.log,sqrt=Math.sqrt,fcc=String.fromCharCode,at=createPointAt(true);var objectStatic={assign:assign,is:function(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}};"__proto__"in ObjectProto&&function(buggy,set){try{set=ctx(call,getOwnDescriptor(ObjectProto,"__proto__").set,2);set({},ArrayProto)}catch(e){buggy=true}objectStatic.setPrototypeOf=function(O,proto){assertObject(O);assert(proto===null||isObject(proto),proto,": can't set as prototype!");if(buggy)O.__proto__=proto;else set(O,proto);return O}}();$define(STATIC,OBJECT,objectStatic);function asinh(x){return!isFinite(x=+x)||x==0?x:x<0?-asinh(-x):log(x+sqrt(x*x+1))}$define(STATIC,NUMBER,{EPSILON:pow(2,-52),isFinite:function(it){return typeof it=="number"&&isFinite(it)},isInteger:isInteger,isNaN:sameNaN,isSafeInteger:function(number){return isInteger(number)&&abs(number)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER:MAX_SAFE_INTEGER,MIN_SAFE_INTEGER:-MAX_SAFE_INTEGER,parseFloat:parseFloat,parseInt:parseInt});$define(STATIC,MATH,{acosh:function(x){return x<1?NaN:log(x+sqrt(x*x-1))},asinh:asinh,atanh:function(x){return x==0?+x:log((1+ +x)/(1-x))/2},cbrt:function(x){return sign(x)*pow(abs(x),1/3)},clz32:function(x){return(x>>>=0)?32-x[TO_STRING](2).length:32},cosh:function(x){return(exp(x)+exp(-x))/2},expm1:function(x){return x==0?+x:x>-1e-6&&x<1e-6?+x+x*x/2:exp(x)-1},fround:function(x){return new Float32Array([x])[0]},hypot:function(value1,value2){var sum=0,length=arguments.length,value;while(length--){value=+arguments[length];if(value==Infinity||value==-Infinity)return Infinity;sum+=value*value}return sqrt(sum)},imul:function(x,y){var UInt16=65535,xl=UInt16&x,yl=UInt16&y;return 0|xl*yl+((UInt16&x>>>16)*yl+xl*(UInt16&y>>>16)<<16>>>0)},log1p:function(x){return x>-1e-8&&x<1e-8?x-x*x/2:log(1+ +x)},log10:function(x){return log(x)/Math.LN10},log2:function(x){return log(x)/Math.LN2},sign:sign,sinh:function(x){return x==0?+x:(exp(x)-exp(-x))/2},tanh:function(x){return isFinite(x)?x==0?+x:(exp(x)-exp(-x))/(exp(x)+exp(-x)):sign(x)},trunc:trunc});setToStringTag(Math,MATH,true);function assertNotRegExp(it){if(isObject(it)&&it instanceof RegExp)throw TypeError()}$define(STATIC,STRING,{fromCodePoint:function(){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fcc(code):fcc(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")},raw:function(callSite){var raw=ES5Object(assertDefined(callSite.raw)),len=toLength(raw.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(raw[i++]));if(i<sln)res.push(String(arguments[i]))}return res.join("")}});$define(PROTO,STRING,{codePointAt:createPointAt(false),endsWith:function(searchString,endPosition){assertNotRegExp(searchString);var len=this.length,end=endPosition===undefined?len:min(toLength(endPosition),len);searchString+="";return String(this).slice(end-searchString.length,end)===searchString},includes:function(searchString,position){return!!~String(assertDefined(this)).indexOf(searchString,position)},repeat:function(count){var str=String(assertDefined(this)),res="",n=toInteger(count);if(0>n||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res},startsWith:function(searchString,position){assertNotRegExp(searchString);var index=toLength(min(position,this.length));searchString+="";return String(this).slice(index,index+searchString.length)===searchString}});defineStdIterators(String,STRING,function(iterated){set(this,ITER,{o:String(iterated),i:0})},function(){var iter=this[ITER],O=iter.o,index=iter.i,point;if(index>=O.length)return iterResult(1);point=at.call(O,index);iter.i+=point.length;return iterResult(0,point)});$define(STATIC,ARRAY,{from:function(arrayLike,mapfn,that){var O=Object(assertDefined(arrayLike)),result=new(generic(this,Array)),mapping=mapfn!==undefined,f=mapping?ctx(mapfn,that,2):undefined,index=0,length;if(isIterable(O))for(var iter=getIterator(O),step;!(step=iter.next()).done;index++){result[index]=mapping?f(step.value,index):step.value}else for(length=toLength(O.length);length>index;index++){result[index]=mapping?f(O[index],index):O[index]}result.length=index;return result},of:function(){var index=0,length=arguments.length,result=new(generic(this,Array))(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}});$define(PROTO,ARRAY,{copyWithin:function(target,start,end){var O=Object(assertDefined(this)),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),fin=end===undefined?len:toIndex(end,len),count=min(fin-from,len-to),inc=1;if(from<to&&to<from+count){inc=-1;from=from+count-1;to=to+count-1}while(count-->0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O},fill:function(value,start,end){var O=Object(assertDefined(this)),length=toLength(O.length),index=toIndex(start,length),endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O},find:createArrayMethod(5),findIndex:createArrayMethod(6)});defineStdIterators(Array,ARRAY,function(iterated,kind){set(this,ITER,{o:ES5Object(iterated),i:0,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,index=iter.i++;if(!O||index>=O.length)return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,index);if(kind==VALUE)return iterResult(0,O[index]);return iterResult(0,[index,O[index]])},VALUE);Iterators[ARGUMENTS]=Iterators[ARRAY];setToStringTag(global.JSON,"JSON",true);if(framework){tmp[SYMBOL_TAG]=DOT;if(cof(tmp)!=DOT)hidden(ObjectProto,TO_STRING,function(){return"[object "+classof(this)+"]"});if(/./g.flags!="g")defineProperty(RegExp[PROTOTYPE],"flags",{configurable:true,get:createReplacer(/^.*\/(\w*)$/,"$1")})}}(isFinite,{});isFunction(setImmediate)&&isFunction(clearImmediate)||function(ONREADYSTATECHANGE){var postMessage=global.postMessage,addEventListener=global.addEventListener,MessageChannel=global.MessageChannel,counter=0,queue={},defer,channel,port;setImmediate=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearImmediate=function(id){delete queue[id]};function run(id){if(has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run(event.data)}if(NODE){defer=function(id){nextTick(part.call(run,id))}}else if(addEventListener&&isFunction(postMessage)&&!global.importScripts){defer=function(id){postMessage(id,"*")};addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(document&&ONREADYSTATECHANGE in document[CREATE_ELEMENT]("script")){defer=function(id){html.appendChild(document[CREATE_ELEMENT]("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run(id)}}}else{defer=function(id){setTimeout(part.call(run,id),0)}}}("onreadystatechange");$define(GLOBAL+BIND,{setImmediate:setImmediate,clearImmediate:clearImmediate});!function(Promise,test){isFunction(Promise)&&isFunction(Promise.resolve)&&Promise.resolve(test=new Promise(Function()))==test||function(asap,DEF){function isThenable(o){var then;if(isObject(o))then=o.then;return isFunction(then)?then:false}function notify(def){var chain=def.chain;chain.length&&asap(function(){var msg=def.msg,ok=def.state==1,i=0;while(chain.length>i)!function(react){var cb=ok?react.ok:react.fail,ret,then;try{if(cb){ret=cb===true?msg:cb(msg);if(ret===react.P){react.rej(TypeError(PROMISE+"-chain cycle"))}else if(then=isThenable(ret)){then.call(ret,react.res,react.rej)}else react.res(ret)}else react.rej(msg)}catch(err){react.rej(err)}}(chain[i++]);chain.length=0})}function resolve(msg){var def=this,then,wrapper;if(def.done)return;def.done=true;def=def.def||def;try{if(then=isThenable(msg)){wrapper={def:def,done:false};then.call(msg,ctx(resolve,wrapper,1),ctx(reject,wrapper,1))}else{def.msg=msg;def.state=1;notify(def)}}catch(err){reject.call(wrapper||{def:def,done:false},err)}}function reject(msg){var def=this;if(def.done)return;def.done=true;def=def.def||def;def.msg=msg;def.state=2;notify(def)}Promise=function(executor){assertFunction(executor);assertInstance(this,Promise,PROMISE);var def={chain:[],state:0,done:false,msg:undefined};hidden(this,DEF,def);try{executor(ctx(resolve,def,1),ctx(reject,def,1))}catch(err){reject.call(def,err)}};assignHidden(Promise[PROTOTYPE],{then:function(onFulfilled,onRejected){var react={ok:isFunction(onFulfilled)?onFulfilled:true,fail:isFunction(onRejected)?onRejected:false},P=react.P=new this[CONSTRUCTOR](function(resolve,reject){react.res=assertFunction(resolve);react.rej=assertFunction(reject)}),def=this[DEF];def.chain.push(react);def.state&¬ify(def);return P},"catch":function(onRejected){return this.then(undefined,onRejected)}});assignHidden(Promise,{all:function(iterable){var Promise=this,values=[];return new Promise(function(resolve,reject){forOf(iterable,false,push,values);var remaining=values.length,results=Array(remaining);if(remaining)forEach.call(values,function(promise,index){Promise.resolve(promise).then(function(value){results[index]=value;--remaining||resolve(results)},reject)});else resolve(results)})},race:function(iterable){var Promise=this;return new Promise(function(resolve,reject){forOf(iterable,false,function(promise){Promise.resolve(promise).then(resolve,reject)})})},reject:function(r){return new this(function(resolve,reject){reject(r)})},resolve:function(x){return isObject(x)&&getPrototypeOf(x)===this[PROTOTYPE]?x:new this(function(resolve,reject){resolve(x)})}})}(nextTick||setImmediate,safeSymbol("def"));setToStringTag(Promise,PROMISE);$define(GLOBAL+FORCED*!isNative(Promise),{Promise:Promise})}(global[PROMISE]);!function(){var UID=safeSymbol("uid"),DATA=safeSymbol("data"),WEAK=safeSymbol("weak"),LAST=safeSymbol("last"),FIRST=safeSymbol("first"),SIZE=DESC?safeSymbol("size"):"size",uid=0;function getCollection(C,NAME,methods,commonMethods,isMap,isWeak){var ADDER=isMap?"set":"add",proto=C&&C[PROTOTYPE],O={};function initFromIterable(that,iterable){if(iterable!=undefined)forOf(iterable,isMap,that[ADDER],that);return that}function fixSVZ(key,chain){var method=proto[key];framework&&hidden(proto,key,function(a,b){var result=method.call(this,a===0?0:a,b);return chain?this:result})}if(!isNative(C)||!(isWeak||!BUGGY_ITERATORS&&has(proto,"entries"))){C=isWeak?function(iterable){assertInstance(this,C,NAME);set(this,UID,uid++);initFromIterable(this,iterable)}:function(iterable){var that=this;assertInstance(that,C,NAME);set(that,DATA,create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);initFromIterable(that,iterable)};assignHidden(assignHidden(C[PROTOTYPE],methods),commonMethods);isWeak||defineProperty(C[PROTOTYPE],"size",{get:function(){return assertDefined(this[SIZE])}})}else{var Native=C,inst=new C,chain=inst[ADDER](isWeak?{}:-0,1),buggyZero;if(!NATIVE_ITERATORS||!C.length){C=function(iterable){assertInstance(this,C,NAME);return initFromIterable(new Native,iterable)};C[PROTOTYPE]=proto}isWeak||inst[FOR_EACH](function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixSVZ("delete");fixSVZ("has");isMap&&fixSVZ("get")}if(buggyZero||chain!==inst)fixSVZ(ADDER,true)}setToStringTag(C,NAME);O[NAME]=C;$define(GLOBAL+WRAP+FORCED*!isNative(C),O);isWeak||defineStdIterators(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!O||!(iter.l=entry=entry?entry.n:O[FIRST]))return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,entry.k);if(kind==VALUE)return iterResult(0,entry.v);return iterResult(0,[entry.k,entry.v])},isMap?KEY+VALUE:VALUE);return C}function fastKey(it,create){if(!isObject(it))return(typeof it=="string"?"S":"P")+it;if(!has(it,UID)){if(create)hidden(it,UID,++uid);else return""}return"O"+it[UID]}function def(that,key,value){var index=fastKey(key,true),data=that[DATA],last=that[LAST],entry;if(index in data)data[index].v=value;else{entry=data[index]={k:key,v:value,p:last};if(!that[FIRST])that[FIRST]=entry;if(last)last.n=entry;that[LAST]=entry;that[SIZE]++}return that}function del(that,index){var data=that[DATA],entry=data[index],next=entry.n,prev=entry.p;delete data[index];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}var collectionMethods={clear:function(){for(var index in this[DATA])del(this,index)},"delete":function(key){var index=fastKey(key),contains=index in this[DATA];if(contains)del(this,index);return contains},forEach:function(callbackfn,that){var f=ctx(callbackfn,that,3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function(key){return fastKey(key)in this[DATA]}};Map=getCollection(Map,MAP,{get:function(key){var entry=this[DATA][fastKey(key)];return entry&&entry.v},set:function(key,value){return def(this,key===0?0:key,value)}},collectionMethods,true);Set=getCollection(Set,SET,{add:function(value){return def(this,value=value===0?0:value,value)}},collectionMethods);function setWeak(that,key,value){has(assertObject(key),WEAK)||hidden(key,WEAK,{});key[WEAK][that[UID]]=value;return that}function hasWeak(key){return isObject(key)&&has(key,WEAK)&&has(key[WEAK],this[UID])}var weakMethods={"delete":function(key){return hasWeak.call(this,key)&&delete key[WEAK][this[UID]]},has:hasWeak};WeakMap=getCollection(WeakMap,WEAKMAP,{get:function(key){if(isObject(key)&&has(key,WEAK))return key[WEAK][this[UID]]},set:function(key,value){return setWeak(this,key,value)}},weakMethods,true,true);WeakSet=getCollection(WeakSet,WEAKSET,{add:function(value){return setWeak(this,value,true)}},weakMethods,false,true)}();!function(){$define(PROTO,ARRAY,{includes:createArrayContains(true)});$define(PROTO,STRING,{at:createPointAt(true)});function createObjectToArray(isEntries){return function(object){var O=ES5Object(object),keys=getKeys(object),length=keys.length,i=0,result=Array(length),key;if(isEntries)while(length>i)result[i]=[key=keys[i++],O[key]];else while(length>i)result[i]=O[keys[i++]];return result}}$define(STATIC,OBJECT,{values:createObjectToArray(false),entries:createObjectToArray(true)});$define(STATIC,REGEXP,{escape:createReplacer(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",true)})}();!function(REFERENCE){REFERENCE_GET=getWellKnownSymbol(REFERENCE+"Get",true);var REFERENCE_SET=getWellKnownSymbol(REFERENCE+SET,true),REFERENCE_DELETE=getWellKnownSymbol(REFERENCE+"Delete",true);$define(STATIC,SYMBOL,{referenceGet:REFERENCE_GET,referenceSet:REFERENCE_SET,referenceDelete:REFERENCE_DELETE});hidden(FunctionProto,REFERENCE_GET,returnThis);function setMapMethods(Constructor){if(Constructor){var MapProto=Constructor[PROTOTYPE];hidden(MapProto,REFERENCE_GET,MapProto.get);hidden(MapProto,REFERENCE_SET,MapProto.set);hidden(MapProto,REFERENCE_DELETE,MapProto["delete"])}}setMapMethods(Map);setMapMethods(WeakMap)}("reference");!function(DICT){function Dict(iterable){var dict=create(null);if(iterable!=undefined){if(isIterable(iterable)){for(var iter=getIterator(iterable),step,value;!(step=iter.next()).done;){value=step.value;dict[value[0]]=value[1]}}else assign(dict,iterable)}return dict}Dict[PROTOTYPE]=null;function DictIterator(iterated,kind){set(this,ITER,{o:ES5Object(iterated),a:getKeys(iterated),i:0,k:kind})}createIterator(DictIterator,DICT,function(){var iter=this[ITER],O=iter.o,keys=iter.a,kind=iter.k,key;while(true){if(iter.i>=keys.length)return iterResult(1);if(has(O,key=keys[iter.i++]))break}if(kind==KEY)return iterResult(0,key);if(kind==VALUE)return iterResult(0,O[key]);return iterResult(0,[key,O[key]])});function createDictIter(kind){return function(it){return new DictIterator(it,kind)}}function createDictMethod(type){var isMap=type==1,isEvery=type==4;return function(object,callbackfn,that){var f=ctx(callbackfn,that,3),O=ES5Object(object),result=isMap||type==7||type==2?new(generic(this,Dict)):undefined,key,val,res;for(key in O)if(has(O,key)){val=O[key];res=f(val,key,object);if(type){if(isMap)result[key]=res;else if(res)switch(type){case 2:result[key]=val;break;case 3:return true;case 5:return val;case 6:return key;case 7:result[res[0]]=res[1]}else if(isEvery)return false}}return type==3||isEvery?isEvery:result}}function createDictReduce(isTurn){return function(object,mapfn,init){assertFunction(mapfn);var O=ES5Object(object),keys=getKeys(O),length=keys.length,i=0,memo,key,result;if(isTurn)memo=init==undefined?new(generic(this,Dict)):Object(init);else if(arguments.length<3){assert(length,REDUCE_ERROR);memo=O[keys[i++]]}else memo=Object(init);while(length>i)if(has(O,key=keys[i++])){result=mapfn(memo,O[key],key,object);if(isTurn){if(result===false)break}else memo=result}return memo}}var findKey=createDictMethod(6);function includes(object,el){return(el==el?keyOf(object,el):findKey(object,sameNaN))!==undefined}var dictMethods={keys:createDictIter(KEY),values:createDictIter(VALUE),entries:createDictIter(KEY+VALUE),forEach:createDictMethod(0),map:createDictMethod(1),filter:createDictMethod(2),some:createDictMethod(3),every:createDictMethod(4),find:createDictMethod(5),findKey:findKey,mapPairs:createDictMethod(7),reduce:createDictReduce(false),turn:createDictReduce(true),keyOf:keyOf,includes:includes,has:has,get:get,set:createDefiner(0),isDict:function(it){return isObject(it)&&getPrototypeOf(it)===Dict[PROTOTYPE]}};if(REFERENCE_GET)for(var key in dictMethods)!function(fn){function method(){for(var args=[this],i=0;i<arguments.length;)args.push(arguments[i++]);return invoke(fn,args)}fn[REFERENCE_GET]=function(){return method}}(dictMethods[key]);$define(GLOBAL+FORCED,{Dict:assignHidden(Dict,dictMethods)})}("Dict");!function(ENTRIES,FN){function $for(iterable,entries){if(!(this instanceof $for))return new $for(iterable,entries);this[ITER]=getIterator(iterable);this[ENTRIES]=!!entries}createIterator($for,"Wrapper",function(){return this[ITER].next()});var $forProto=$for[PROTOTYPE];setIterator($forProto,function(){return this[ITER]});function createChainIterator(next){function Iter(I,fn,that){this[ITER]=getIterator(I);this[ENTRIES]=I[ENTRIES];this[FN]=ctx(fn,that,I[ENTRIES]?2:1)}createIterator(Iter,"Chain",next,$forProto);setIterator(Iter[PROTOTYPE],returnThis);return Iter}var MapIter=createChainIterator(function(){var step=this[ITER].next();return step.done?step:iterResult(0,stepCall(this[FN],step.value,this[ENTRIES]))});var FilterIter=createChainIterator(function(){for(;;){var step=this[ITER].next();if(step.done||stepCall(this[FN],step.value,this[ENTRIES]))return step}});assignHidden($forProto,{of:function(fn,that){forOf(this,this[ENTRIES],fn,that)},array:function(fn,that){var result=[];forOf(fn!=undefined?this.map(fn,that):this,false,push,result);return result},filter:function(fn,that){return new FilterIter(this,fn,that)},map:function(fn,that){return new MapIter(this,fn,that)}});$for.isIterable=isIterable;$for.getIterator=getIterator;$define(GLOBAL+FORCED,{$for:$for})}("entries",safeSymbol("fn"));!function(_,toLocaleString){core._=path._=path._||{};$define(PROTO+FORCED,FUNCTION,{part:part,by:function(that){var fn=this,_=path._,holder=false,length=arguments.length,isThat=that===_,i=+!isThat,indent=i,it,args;if(isThat){it=fn;fn=call}else it=that;if(length<2)return ctx(fn,it,-1);args=Array(length-indent);while(length>i)if((args[i-indent]=arguments[i++])===_)holder=true;return partial(fn,args,length,holder,_,true,it)},only:function(numberArguments,that){var fn=assertFunction(this),n=toLength(numberArguments),isThat=arguments.length>1;return function(){var length=min(n,arguments.length),args=Array(length),i=0;while(length>i)args[i]=arguments[i++];return invoke(fn,args,isThat?that:this)}}});function tie(key){var that=this,bound={};return hidden(that,_,function(key){if(key===undefined||!(key in that))return toLocaleString.call(that);return has(bound,key)?bound[key]:bound[key]=ctx(that[key],that,-1)})[_](key)}hidden(path._,TO_STRING,function(){return _});hidden(ObjectProto,_,tie);DESC||hidden(ArrayProto,_,tie)}(DESC?uid("tie"):TO_LOCALE,ObjectProto[TO_LOCALE]);!function(){function define(target,mixin){var keys=ownKeys(ES5Object(mixin)),length=keys.length,i=0,key;while(length>i)defineProperty(target,key=keys[i++],getOwnDescriptor(mixin,key));return target}$define(STATIC+FORCED,OBJECT,{isObject:isObject,classof:classof,define:define,make:function(proto,mixin){return define(create(proto),mixin)}})}();$define(PROTO+FORCED,ARRAY,{turn:turn});!function(){function setArrayStatics(keys,length){$define(STATIC,ARRAY,turn.call(array(keys),function(memo,key){if(key in ArrayProto)memo[key]=ctx(call,ArrayProto[key],length)},{}))}setArrayStatics("pop,reverse,shift,keys,values,entries",1);setArrayStatics("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3);setArrayStatics("join,slice,concat,push,splice,unshift,sort,lastIndexOf,"+"reduce,reduceRight,copyWithin,fill,turn")}();!function(){function NumberIterator(iterated){set(this,ITER,{l:toLength(iterated),i:0})}createIterator(NumberIterator,NUMBER,function(){var iter=this[ITER],i=iter.i++;return i<iter.l?iterResult(0,i):iterResult(1)});defineIterator(Number,NUMBER,function(){return new NumberIterator(this)});$define(PROTO+FORCED,NUMBER,{random:function(lim){var a=+this,b=lim==undefined?0:+lim,m=min(a,b);return random()*(max(a,b)-m)+m}});$define(PROTO+FORCED,NUMBER,turn.call(array("round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,"+"acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc"),function(memo,key){var fn=Math[key];if(fn)memo[key]=function(){var args=[+this],i=0;while(arguments.length>i)args.push(arguments[i++]);return invoke(fn,args)}},{}))}();!function(){var escapeHTMLDict={"&":"&","<":"<",">":">",'"':""","'":"'"},unescapeHTMLDict={},key;for(key in escapeHTMLDict)unescapeHTMLDict[escapeHTMLDict[key]]=key;$define(PROTO+FORCED,STRING,{escapeHTML:createReplacer(/[&<>"']/g,escapeHTMLDict),unescapeHTML:createReplacer(/&(?:amp|lt|gt|quot|apos);/g,unescapeHTMLDict)})}();!function(formatRegExp,flexioRegExp,locales,current,SECONDS,MINUTES,HOURS,MONTH,YEAR){function createFormat(prefix){return function(template,locale){var that=this,dict=locales[has(locales,locale)?locale:current];function get(unit){return that[prefix+unit]()}return String(template).replace(formatRegExp,function(part){switch(part){case"s":return get(SECONDS);case"ss":return lz(get(SECONDS));case"m":return get(MINUTES);case"mm":return lz(get(MINUTES));case"h":return get(HOURS);case"hh":return lz(get(HOURS));case"D":return get(DATE);case"DD":return lz(get(DATE));case"W":return dict[0][get("Day")];case"N":return get(MONTH)+1;case"NN":return lz(get(MONTH)+1);case"M":return dict[2][get(MONTH)];case"MM":return dict[1][get(MONTH)];case"Y":return get(YEAR);case"YY":return lz(get(YEAR)%100)}return part})}}function lz(num){return num>9?num:"0"+num
}function addLocale(lang,locale){function split(index){return turn.call(array(locale.months),function(memo,it){memo.push(it.replace(flexioRegExp,"$"+index))})}locales[lang]=[array(locale.weekdays),split(1),split(2)];return core}$define(PROTO+FORCED,DATE,{format:createFormat("get"),formatUTC:createFormat("getUTC")});addLocale(current,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"});addLocale("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,"+"Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"});core.locale=function(locale){return has(locales,locale)?current=locale:current};core.addLocale=addLocale}(/\b\w\w?\b/g,/:(.*)\|(.*)$/,{},"en","Seconds","Minutes","Hours","Month","FullYear")}(Function("return this"),false)},{}],120:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.estraverse={})}})(this,function(exports){"use strict";var Syntax,isArray,VisitorOption,VisitorKeys,objectCreate,objectKeys,BREAK,SKIP,REMOVE;function ignoreJSHintError(){}isArray=Array.isArray;if(!isArray){isArray=function isArray(array){return Object.prototype.toString.call(array)==="[object Array]"}}function deepCopy(obj){var ret={},key,val;for(key in obj){if(obj.hasOwnProperty(key)){val=obj[key];if(typeof val==="object"&&val!==null){ret[key]=deepCopy(val)}else{ret[key]=val}}}return ret}function shallowCopy(obj){var ret={},key;for(key in obj){if(obj.hasOwnProperty(key)){ret[key]=obj[key]}}return ret}ignoreJSHintError(shallowCopy);function upperBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){len=diff}else{i=current+1;len-=diff+1}}return i}function lowerBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){i=current+1;len-=diff+1}else{len=diff}}return i}ignoreJSHintError(lowerBound);objectCreate=Object.create||function(){function F(){}return function(o){F.prototype=o;return new F}}();objectKeys=Object.keys||function(o){var keys=[],key;for(key in o){keys.push(key)}return keys};function extend(to,from){objectKeys(from).forEach(function(key){to[key]=from[key]});return to}Syntax={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};VisitorKeys={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};BREAK={};SKIP={};REMOVE={};VisitorOption={Break:BREAK,Skip:SKIP,Remove:REMOVE};function Reference(parent,key){this.parent=parent;this.key=key}Reference.prototype.replace=function replace(node){this.parent[this.key]=node};Reference.prototype.remove=function remove(){if(isArray(this.parent)){this.parent.splice(this.key,1);return true}else{this.replace(null);return false}};function Element(node,path,wrap,ref){this.node=node;this.path=path;this.wrap=wrap;this.ref=ref}function Controller(){}Controller.prototype.path=function path(){var i,iz,j,jz,result,element;function addToPath(result,path){if(isArray(path)){for(j=0,jz=path.length;j<jz;++j){result.push(path[j])}}else{result.push(path)}}if(!this.__current.path){return null}result=[];for(i=2,iz=this.__leavelist.length;i<iz;++i){element=this.__leavelist[i];addToPath(result,element.path)}addToPath(result,this.__current.path);return result};Controller.prototype.type=function(){var node=this.current();return node.type||this.__current.wrap};Controller.prototype.parents=function parents(){var i,iz,result;result=[];for(i=1,iz=this.__leavelist.length;i<iz;++i){result.push(this.__leavelist[i].node)}return result};Controller.prototype.current=function current(){return this.__current.node};Controller.prototype.__execute=function __execute(callback,element){var previous,result;result=undefined;previous=this.__current;this.__current=element;this.__state=null;if(callback){result=callback.call(this,element.node,this.__leavelist[this.__leavelist.length-1].node)}this.__current=previous;return result};Controller.prototype.notify=function notify(flag){this.__state=flag};Controller.prototype.skip=function(){this.notify(SKIP)};Controller.prototype["break"]=function(){this.notify(BREAK)};Controller.prototype.remove=function(){this.notify(REMOVE)};Controller.prototype.__initialize=function(root,visitor){this.visitor=visitor;this.root=root;this.__worklist=[];this.__leavelist=[];this.__current=null;this.__state=null;this.__fallback=visitor.fallback==="iteration";this.__keys=VisitorKeys;if(visitor.keys){this.__keys=extend(objectCreate(this.__keys),visitor.keys)}};function isNode(node){if(node==null){return false}return typeof node==="object"&&typeof node.type==="string"}function isProperty(nodeType,key){return(nodeType===Syntax.ObjectExpression||nodeType===Syntax.ObjectPattern)&&"properties"===key}Controller.prototype.traverse=function traverse(root,visitor){var worklist,leavelist,element,node,nodeType,ret,key,current,current2,candidates,candidate,sentinel;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;worklist.push(new Element(root,null,null,null));leavelist.push(new Element(null,null,null,null));while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();ret=this.__execute(visitor.leave,element);if(this.__state===BREAK||ret===BREAK){return}continue}if(element.node){ret=this.__execute(visitor.enter,element);if(this.__state===BREAK||ret===BREAK){return}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||ret===SKIP){continue}node=element.node;nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",null)}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,null)}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,null))}}}}};Controller.prototype.replace=function replace(root,visitor){function removeElem(element){var i,key,nextElem,parent;if(element.ref.remove()){key=element.ref.key;parent=element.ref.parent;i=worklist.length;while(i--){nextElem=worklist[i];if(nextElem.ref&&nextElem.ref.parent===parent){if(nextElem.ref.key<key){break}--nextElem.ref.key}}}}var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;outer={root:root};element=new Element(root,null,null,new Reference(outer,"root"));worklist.push(element);leavelist.push(element);while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();target=this.__execute(visitor.leave,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target)}if(this.__state===REMOVE||target===REMOVE){removeElem(element)}if(this.__state===BREAK||target===BREAK){return outer.root}continue}target=this.__execute(visitor.enter,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target);element.node=target}if(this.__state===REMOVE||target===REMOVE){removeElem(element);element.node=null}if(this.__state===BREAK||target===BREAK){return outer.root}node=element.node;if(!node){continue}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||target===SKIP){continue}nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2))}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2))}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,new Reference(node,key)))}}}return outer.root};function traverse(root,visitor){var controller=new Controller;return controller.traverse(root,visitor)}function replace(root,visitor){var controller=new Controller;return controller.replace(root,visitor)}function extendCommentRange(comment,tokens){var target;target=upperBound(tokens,function search(token){return token.range[0]>comment.range[0]});comment.extendedRange=[comment.range[0],comment.range[1]];if(target!==tokens.length){comment.extendedRange[1]=tokens[target].range[0]}target-=1;if(target>=0){comment.extendedRange[0]=tokens[target].range[1]}return comment}function attachComments(tree,providedComments,tokens){var comments=[],comment,len,i,cursor;if(!tree.range){throw new Error("attachComments needs range information")}if(!tokens.length){if(providedComments.length){for(i=0,len=providedComments.length;i<len;i+=1){comment=deepCopy(providedComments[i]);comment.extendedRange=[0,tree.range[0]];comments.push(comment)}tree.leadingComments=comments}return tree}for(i=0,len=providedComments.length;i<len;i+=1){comments.push(extendCommentRange(deepCopy(providedComments[i]),tokens))}cursor=0;traverse(tree,{enter:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(comment.extendedRange[1]>node.range[0]){break}if(comment.extendedRange[1]===node.range[0]){if(!node.leadingComments){node.leadingComments=[]}node.leadingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});cursor=0;traverse(tree,{leave:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(node.range[1]<comment.extendedRange[0]){break}if(node.range[1]===comment.extendedRange[0]){if(!node.trailingComments){node.trailingComments=[]}node.trailingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});return tree}exports.version="1.8.0";exports.Syntax=Syntax;exports.traverse=traverse;exports.replace=replace;exports.attachComments=attachComments;exports.VisitorKeys=VisitorKeys;exports.VisitorOption=VisitorOption;exports.Controller=Controller})},{}],121:[function(require,module,exports){(function(){"use strict";function isExpression(node){if(node==null){return false}switch(node.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return true}return false}function isIterationStatement(node){if(node==null){return false}switch(node.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return true}return false}function isStatement(node){if(node==null){return false}switch(node.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return true}return false}function isSourceElement(node){return isStatement(node)||node!=null&&node.type==="FunctionDeclaration"}function trailingStatement(node){switch(node.type){case"IfStatement":if(node.alternate!=null){return node.alternate}return node.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return node.body}return null}function isProblematicIfStatement(node){var current;if(node.type!=="IfStatement"){return false}if(node.alternate==null){return false}current=node.consequent;do{if(current.type==="IfStatement"){if(current.alternate==null){return true}}current=trailingStatement(current)}while(current);return false}module.exports={isExpression:isExpression,isStatement:isStatement,isIterationStatement:isIterationStatement,isSourceElement:isSourceElement,isProblematicIfStatement:isProblematicIfStatement,trailingStatement:trailingStatement}})()},{}],122:[function(require,module,exports){(function(){"use strict";var Regex,NON_ASCII_WHITESPACES;Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return isDecimalDigit(ch)||97<=ch&&ch<=102||65<=ch&&ch<=70}function isOctalDigit(ch){return ch>=48&&ch<=55}NON_ASCII_WHITESPACES=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&NON_ASCII_WHITESPACES.indexOf(ch)>=0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch>=97&&ch<=122||ch>=65&&ch<=90||ch===36||ch===95||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch>=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57||ch===36||ch===95||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}module.exports={isDecimalDigit:isDecimalDigit,isHexDigit:isHexDigit,isOctalDigit:isOctalDigit,isWhiteSpace:isWhiteSpace,isLineTerminator:isLineTerminator,isIdentifierStart:isIdentifierStart,isIdentifierPart:isIdentifierPart}})()},{}],123:[function(require,module,exports){(function(){"use strict";var code=require("./code");function isStrictModeReservedWordES6(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false}}function isKeywordES5(id,strict){if(!strict&&id==="yield"){return false}return isKeywordES6(id,strict)}function isKeywordES6(id,strict){if(strict&&isStrictModeReservedWordES6(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="yield"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function isReservedWordES5(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES5(id,strict)}function isReservedWordES6(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES6(id,strict)}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isIdentifierName(id){var i,iz,ch;if(id.length===0){return false}ch=id.charCodeAt(0);if(!code.isIdentifierStart(ch)||ch===92){return false}for(i=1,iz=id.length;i<iz;++i){ch=id.charCodeAt(i);if(!code.isIdentifierPart(ch)||ch===92){return false}}return true}function isIdentifierES5(id,strict){return isIdentifierName(id)&&!isReservedWordES5(id,strict)}function isIdentifierES6(id,strict){return isIdentifierName(id)&&!isReservedWordES6(id,strict)}module.exports={isKeywordES5:isKeywordES5,isKeywordES6:isKeywordES6,isReservedWordES5:isReservedWordES5,isReservedWordES6:isReservedWordES6,isRestrictedWord:isRestrictedWord,isIdentifierName:isIdentifierName,isIdentifierES5:isIdentifierES5,isIdentifierES6:isIdentifierES6}})()},{"./code":122}],124:[function(require,module,exports){(function(){"use strict";exports.ast=require("./ast");exports.code=require("./code");exports.keyword=require("./keyword")})()},{"./ast":121,"./code":122,"./keyword":123}],125:[function(require,module,exports){"use strict";exports.reservedVars={arguments:false,NaN:false};exports.ecmaIdentifiers={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Map:false,Math:false,Number:false,Object:false,Proxy:false,Promise:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,Set:false,String:false,SyntaxError:false,TypeError:false,URIError:false,WeakMap:false,WeakSet:false};exports.newEcmaIdentifiers={Set:false,Map:false,WeakMap:false,WeakSet:false,Proxy:false,Promise:false,Reflect:false,Symbol:false,System:false};exports.browser={Audio:false,Blob:false,addEventListener:false,applicationCache:false,atob:false,blur:false,btoa:false,cancelAnimationFrame:false,CanvasGradient:false,CanvasPattern:false,CanvasRenderingContext2D:false,CSS:false,clearInterval:false,clearTimeout:false,close:false,closed:false,CustomEvent:false,DOMParser:false,defaultStatus:false,Document:false,document:false,Element:false,ElementTimeControl:false,Event:false,event:false,FileReader:false,FormData:false,focus:false,frames:false,getComputedStyle:false,HTMLElement:false,HTMLAnchorElement:false,HTMLBaseElement:false,HTMLBlockquoteElement:false,HTMLBodyElement:false,HTMLBRElement:false,HTMLButtonElement:false,HTMLCanvasElement:false,HTMLDirectoryElement:false,HTMLDivElement:false,HTMLDListElement:false,HTMLFieldSetElement:false,HTMLFontElement:false,HTMLFormElement:false,HTMLFrameElement:false,HTMLFrameSetElement:false,HTMLHeadElement:false,HTMLHeadingElement:false,HTMLHRElement:false,HTMLHtmlElement:false,HTMLIFrameElement:false,HTMLImageElement:false,HTMLInputElement:false,HTMLIsIndexElement:false,HTMLLabelElement:false,HTMLLayerElement:false,HTMLLegendElement:false,HTMLLIElement:false,HTMLLinkElement:false,HTMLMapElement:false,HTMLMenuElement:false,HTMLMetaElement:false,HTMLModElement:false,HTMLObjectElement:false,HTMLOListElement:false,HTMLOptGroupElement:false,HTMLOptionElement:false,HTMLParagraphElement:false,HTMLParamElement:false,HTMLPreElement:false,HTMLQuoteElement:false,HTMLScriptElement:false,HTMLSelectElement:false,HTMLStyleElement:false,HTMLTableCaptionElement:false,HTMLTableCellElement:false,HTMLTableColElement:false,HTMLTableElement:false,HTMLTableRowElement:false,HTMLTableSectionElement:false,HTMLTextAreaElement:false,HTMLTitleElement:false,HTMLUListElement:false,HTMLVideoElement:false,history:false,Image:false,Intl:false,length:false,localStorage:false,location:false,matchMedia:false,MessageChannel:false,MessageEvent:false,MessagePort:false,MouseEvent:false,moveBy:false,moveTo:false,MutationObserver:false,name:false,Node:false,NodeFilter:false,NodeList:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,openDatabase:false,opener:false,Option:false,parent:false,print:false,requestAnimationFrame:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,sessionStorage:false,setInterval:false,setTimeout:false,SharedWorker:false,status:false,SVGAElement:false,SVGAltGlyphDefElement:false,SVGAltGlyphElement:false,SVGAltGlyphItemElement:false,SVGAngle:false,SVGAnimateColorElement:false,SVGAnimateElement:false,SVGAnimateMotionElement:false,SVGAnimateTransformElement:false,SVGAnimatedAngle:false,SVGAnimatedBoolean:false,SVGAnimatedEnumeration:false,SVGAnimatedInteger:false,SVGAnimatedLength:false,SVGAnimatedLengthList:false,SVGAnimatedNumber:false,SVGAnimatedNumberList:false,SVGAnimatedPathData:false,SVGAnimatedPoints:false,SVGAnimatedPreserveAspectRatio:false,SVGAnimatedRect:false,SVGAnimatedString:false,SVGAnimatedTransformList:false,SVGAnimationElement:false,SVGCSSRule:false,SVGCircleElement:false,SVGClipPathElement:false,SVGColor:false,SVGColorProfileElement:false,SVGColorProfileRule:false,SVGComponentTransferFunctionElement:false,SVGCursorElement:false,SVGDefsElement:false,SVGDescElement:false,SVGDocument:false,SVGElement:false,SVGElementInstance:false,SVGElementInstanceList:false,SVGEllipseElement:false,SVGExternalResourcesRequired:false,SVGFEBlendElement:false,SVGFEColorMatrixElement:false,SVGFEComponentTransferElement:false,SVGFECompositeElement:false,SVGFEConvolveMatrixElement:false,SVGFEDiffuseLightingElement:false,SVGFEDisplacementMapElement:false,SVGFEDistantLightElement:false,SVGFEFloodElement:false,SVGFEFuncAElement:false,SVGFEFuncBElement:false,SVGFEFuncGElement:false,SVGFEFuncRElement:false,SVGFEGaussianBlurElement:false,SVGFEImageElement:false,SVGFEMergeElement:false,SVGFEMergeNodeElement:false,SVGFEMorphologyElement:false,SVGFEOffsetElement:false,SVGFEPointLightElement:false,SVGFESpecularLightingElement:false,SVGFESpotLightElement:false,SVGFETileElement:false,SVGFETurbulenceElement:false,SVGFilterElement:false,SVGFilterPrimitiveStandardAttributes:false,SVGFitToViewBox:false,SVGFontElement:false,SVGFontFaceElement:false,SVGFontFaceFormatElement:false,SVGFontFaceNameElement:false,SVGFontFaceSrcElement:false,SVGFontFaceUriElement:false,SVGForeignObjectElement:false,SVGGElement:false,SVGGlyphElement:false,SVGGlyphRefElement:false,SVGGradientElement:false,SVGHKernElement:false,SVGICCColor:false,SVGImageElement:false,SVGLangSpace:false,SVGLength:false,SVGLengthList:false,SVGLineElement:false,SVGLinearGradientElement:false,SVGLocatable:false,SVGMPathElement:false,SVGMarkerElement:false,SVGMaskElement:false,SVGMatrix:false,SVGMetadataElement:false,SVGMissingGlyphElement:false,SVGNumber:false,SVGNumberList:false,SVGPaint:false,SVGPathElement:false,SVGPathSeg:false,SVGPathSegArcAbs:false,SVGPathSegArcRel:false,SVGPathSegClosePath:false,SVGPathSegCurvetoCubicAbs:false,SVGPathSegCurvetoCubicRel:false,SVGPathSegCurvetoCubicSmoothAbs:false,SVGPathSegCurvetoCubicSmoothRel:false,SVGPathSegCurvetoQuadraticAbs:false,SVGPathSegCurvetoQuadraticRel:false,SVGPathSegCurvetoQuadraticSmoothAbs:false,SVGPathSegCurvetoQuadraticSmoothRel:false,SVGPathSegLinetoAbs:false,SVGPathSegLinetoHorizontalAbs:false,SVGPathSegLinetoHorizontalRel:false,SVGPathSegLinetoRel:false,SVGPathSegLinetoVerticalAbs:false,SVGPathSegLinetoVerticalRel:false,SVGPathSegList:false,SVGPathSegMovetoAbs:false,SVGPathSegMovetoRel:false,SVGPatternElement:false,SVGPoint:false,SVGPointList:false,SVGPolygonElement:false,SVGPolylineElement:false,SVGPreserveAspectRatio:false,SVGRadialGradientElement:false,SVGRect:false,SVGRectElement:false,SVGRenderingIntent:false,SVGSVGElement:false,SVGScriptElement:false,SVGSetElement:false,SVGStopElement:false,SVGStringList:false,SVGStylable:false,SVGStyleElement:false,SVGSwitchElement:false,SVGSymbolElement:false,SVGTRefElement:false,SVGTSpanElement:false,SVGTests:false,SVGTextContentElement:false,SVGTextElement:false,SVGTextPathElement:false,SVGTextPositioningElement:false,SVGTitleElement:false,SVGTransform:false,SVGTransformList:false,SVGTransformable:false,SVGURIReference:false,SVGUnitTypes:false,SVGUseElement:false,SVGVKernElement:false,SVGViewElement:false,SVGViewSpec:false,SVGZoomAndPan:false,TextDecoder:false,TextEncoder:false,TimeEvent:false,top:false,URL:false,WebGLActiveInfo:false,WebGLBuffer:false,WebGLContextEvent:false,WebGLFramebuffer:false,WebGLProgram:false,WebGLRenderbuffer:false,WebGLRenderingContext:false,WebGLShader:false,WebGLShaderPrecisionFormat:false,WebGLTexture:false,WebGLUniformLocation:false,WebSocket:false,window:false,Worker:false,XDomainRequest:false,XMLHttpRequest:false,XMLSerializer:false,XPathEvaluator:false,XPathException:false,XPathExpression:false,XPathNamespace:false,XPathNSResolver:false,XPathResult:false};exports.devel={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false};exports.worker={importScripts:true,postMessage:true,self:true,FileReaderSync:true};exports.nonstandard={escape:false,unescape:false};exports.couch={require:false,respond:false,getRow:false,emit:false,send:false,start:false,sum:false,log:false,exports:false,module:false,provides:false};exports.node={__filename:false,__dirname:false,GLOBAL:false,global:false,module:false,require:false,Buffer:true,console:true,exports:true,process:true,setTimeout:true,clearTimeout:true,setInterval:true,clearInterval:true,setImmediate:true,clearImmediate:true};exports.browserify={__filename:false,__dirname:false,global:false,module:false,require:false,Buffer:true,exports:true,process:true};exports.phantom={phantom:true,require:true,WebPage:true,console:true,exports:true};exports.qunit={asyncTest:false,deepEqual:false,equal:false,expect:false,module:false,notDeepEqual:false,notEqual:false,notPropEqual:false,notStrictEqual:false,ok:false,propEqual:false,QUnit:false,raises:false,start:false,stop:false,strictEqual:false,test:false,"throws":false};
exports.rhino={defineClass:false,deserialize:false,gc:false,help:false,importClass:false,importPackage:false,java:false,load:false,loadClass:false,Packages:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false};exports.shelljs={target:false,echo:false,exit:false,cd:false,pwd:false,ls:false,find:false,cp:false,rm:false,mv:false,mkdir:false,test:false,cat:false,sed:false,grep:false,which:false,dirs:false,pushd:false,popd:false,env:false,exec:false,chmod:false,config:false,error:false,tempdir:false};exports.typed={ArrayBuffer:false,ArrayBufferView:false,DataView:false,Float32Array:false,Float64Array:false,Int16Array:false,Int32Array:false,Int8Array:false,Uint16Array:false,Uint32Array:false,Uint8Array:false,Uint8ClampedArray:false};exports.wsh={ActiveXObject:true,Enumerator:true,GetObject:true,ScriptEngine:true,ScriptEngineBuildVersion:true,ScriptEngineMajorVersion:true,ScriptEngineMinorVersion:true,VBArray:true,WSH:true,WScript:true,XDomainRequest:true};exports.dojo={dojo:false,dijit:false,dojox:false,define:false,require:false};exports.jquery={$:false,jQuery:false};exports.mootools={$:false,$$:false,Asset:false,Browser:false,Chain:false,Class:false,Color:false,Cookie:false,Core:false,Document:false,DomReady:false,DOMEvent:false,DOMReady:false,Drag:false,Element:false,Elements:false,Event:false,Events:false,Fx:false,Group:false,Hash:false,HtmlTable:false,IFrame:false,IframeShim:false,InputValidator:false,instanceOf:false,Keyboard:false,Locale:false,Mask:false,MooTools:false,Native:false,Options:false,OverText:false,Request:false,Scroller:false,Slick:false,Slider:false,Sortables:false,Spinner:false,Swiff:false,Tips:false,Type:false,typeOf:false,URI:false,Window:false};exports.prototypejs={$:false,$$:false,$A:false,$F:false,$H:false,$R:false,$break:false,$continue:false,$w:false,Abstract:false,Ajax:false,Class:false,Enumerable:false,Element:false,Event:false,Field:false,Form:false,Hash:false,Insertion:false,ObjectRange:false,PeriodicalExecuter:false,Position:false,Prototype:false,Selector:false,Template:false,Toggle:false,Try:false,Autocompleter:false,Builder:false,Control:false,Draggable:false,Draggables:false,Droppables:false,Effect:false,Sortable:false,SortableObserver:false,Sound:false,Scriptaculous:false};exports.yui={YUI:false,Y:false,YUI_config:false};exports.mocha={describe:false,it:false,before:false,after:false,beforeEach:false,afterEach:false,suite:false,test:false,setup:false,teardown:false};exports.jasmine={jasmine:false,describe:false,it:false,xit:false,beforeEach:false,afterEach:false,setFixtures:false,loadFixtures:false,spyOn:false,expect:false,runs:false,waitsFor:false,waits:false}},{}],126:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;
callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],127:[function(require,module,exports){"use strict";var originalObject=Object;var originalDefProp=Object.defineProperty;var originalCreate=Object.create;function defProp(obj,name,value){if(originalDefProp)try{originalDefProp.call(originalObject,obj,name,{value:value})}catch(definePropertyIsBrokenInIE8){obj[name]=value}else{obj[name]=value}}function makeSafeToCall(fun){if(fun){defProp(fun,"call",fun.call);defProp(fun,"apply",fun.apply)}return fun}makeSafeToCall(originalDefProp);makeSafeToCall(originalCreate);var hasOwn=makeSafeToCall(Object.prototype.hasOwnProperty);var numToStr=makeSafeToCall(Number.prototype.toString);var strSlice=makeSafeToCall(String.prototype.slice);var cloner=function(){};function create(prototype){if(originalCreate){return originalCreate.call(originalObject,prototype)}cloner.prototype=prototype||null;return new cloner}var rand=Math.random;var uniqueKeys=create(null);function makeUniqueKey(){do var uniqueKey=internString(strSlice.call(numToStr.call(rand(),36),2));while(hasOwn.call(uniqueKeys,uniqueKey));return uniqueKeys[uniqueKey]=uniqueKey}function internString(str){var obj={};obj[str]=true;return Object.keys(obj)[0]}defProp(exports,"makeUniqueKey",makeUniqueKey);var originalGetOPNs=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function getOwnPropertyNames(object){for(var names=originalGetOPNs(object),src=0,dst=0,len=names.length;src<len;++src){if(!hasOwn.call(uniqueKeys,names[src])){if(src>dst){names[dst]=names[src]}++dst}}names.length=dst;return names};function defaultCreatorFn(object){return create(null)}function makeAccessor(secretCreatorFn){var brand=makeUniqueKey();var passkey=create(null);secretCreatorFn=secretCreatorFn||defaultCreatorFn;function register(object){var secret;function vault(key,forget){if(key===passkey){return forget?secret=null:secret||(secret=secretCreatorFn(object))}}defProp(object,brand,vault)}function accessor(object){if(!hasOwn.call(object,brand))register(object);return object[brand](passkey)}accessor.forget=function(object){if(hasOwn.call(object,brand))object[brand](passkey,true)};return accessor}defProp(exports,"makeAccessor",makeAccessor)},{}],128:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var isArray=types.builtInTypes.array;var b=types.builders;var n=types.namedTypes;var leap=require("./leap");var meta=require("./meta");var util=require("./util");var runtimeKeysMethod=util.runtimeProperty("keys");var hasOwn=Object.prototype.hasOwnProperty;function Emitter(contextId){assert.ok(this instanceof Emitter);n.Identifier.assert(contextId);Object.defineProperties(this,{contextId:{value:contextId},listing:{value:[]},marked:{value:[true]},finalLoc:{value:loc()},tryEntries:{value:[]}});Object.defineProperties(this,{leapManager:{value:new leap.LeapManager(this)}})}var Ep=Emitter.prototype;exports.Emitter=Emitter;function loc(){return b.literal(-1)}Ep.mark=function(loc){n.Literal.assert(loc);var index=this.listing.length;if(loc.value===-1){loc.value=index}else{assert.strictEqual(loc.value,index)}this.marked[index]=true;return loc};Ep.emit=function(node){if(n.Expression.check(node))node=b.expressionStatement(node);n.Statement.assert(node);this.listing.push(node)};Ep.emitAssign=function(lhs,rhs){this.emit(this.assign(lhs,rhs));return lhs};Ep.assign=function(lhs,rhs){return b.expressionStatement(b.assignmentExpression("=",lhs,rhs))};Ep.contextProperty=function(name,computed){return b.memberExpression(this.contextId,computed?b.literal(name):b.identifier(name),!!computed)};var volatileContextPropertyNames={prev:true,next:true,sent:true,rval:true};Ep.isVolatileContextProperty=function(expr){if(n.MemberExpression.check(expr)){if(expr.computed){return true}if(n.Identifier.check(expr.object)&&n.Identifier.check(expr.property)&&expr.object.name===this.contextId.name&&hasOwn.call(volatileContextPropertyNames,expr.property.name)){return true}}return false};Ep.stop=function(rval){if(rval){this.setReturnValue(rval)}this.jump(this.finalLoc)};Ep.setReturnValue=function(valuePath){n.Expression.assert(valuePath.value);this.emitAssign(this.contextProperty("rval"),this.explodeExpression(valuePath))};Ep.clearPendingException=function(tryLoc,assignee){n.Literal.assert(tryLoc);var catchCall=b.callExpression(this.contextProperty("catch",true),[tryLoc]);if(assignee){this.emitAssign(assignee,catchCall)}else{this.emit(catchCall)}};Ep.jump=function(toLoc){this.emitAssign(this.contextProperty("next"),toLoc);this.emit(b.breakStatement())};Ep.jumpIf=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);this.emit(b.ifStatement(test,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};Ep.jumpIfNot=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);var negatedTest;if(n.UnaryExpression.check(test)&&test.operator==="!"){negatedTest=test.argument}else{negatedTest=b.unaryExpression("!",test)}this.emit(b.ifStatement(negatedTest,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};var nextTempId=0;Ep.makeTempVar=function(){return this.contextProperty("t"+nextTempId++)};Ep.getContextFunction=function(id){return b.functionExpression(id||null,[this.contextId],b.blockStatement([this.getDispatchLoop()]),false,false)};Ep.getDispatchLoop=function(){var self=this;var cases=[];var current;var alreadyEnded=false;self.listing.forEach(function(stmt,i){if(self.marked.hasOwnProperty(i)){cases.push(b.switchCase(b.literal(i),current=[]));alreadyEnded=false}if(!alreadyEnded){current.push(stmt);if(isSwitchCaseEnder(stmt))alreadyEnded=true}});this.finalLoc.value=this.listing.length;cases.push(b.switchCase(this.finalLoc,[]),b.switchCase(b.literal("end"),[b.returnStatement(b.callExpression(this.contextProperty("stop"),[]))]));
return b.whileStatement(b.literal(1),b.switchStatement(b.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),cases))};function isSwitchCaseEnder(stmt){return n.BreakStatement.check(stmt)||n.ContinueStatement.check(stmt)||n.ReturnStatement.check(stmt)||n.ThrowStatement.check(stmt)}Ep.getTryEntryList=function(){if(this.tryEntries.length===0){return null}var lastLocValue=0;return b.arrayExpression(this.tryEntries.map(function(tryEntry){var thisLocValue=tryEntry.firstLoc.value;assert.ok(thisLocValue>=lastLocValue,"try entries out of order");lastLocValue=thisLocValue;var ce=tryEntry.catchEntry;var fe=tryEntry.finallyEntry;var triple=[tryEntry.firstLoc,ce?ce.firstLoc:null];if(fe){triple[2]=fe.firstLoc}return b.arrayExpression(triple)}))};Ep.explode=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var node=path.value;var self=this;n.Node.assert(node);if(n.Statement.check(node))return self.explodeStatement(path);if(n.Expression.check(node))return self.explodeExpression(path,ignoreResult);if(n.Declaration.check(node))throw getDeclError(node);switch(node.type){case"Program":return path.get("body").map(self.explodeStatement,self);case"VariableDeclarator":throw getDeclError(node);case"Property":case"SwitchCase":case"CatchClause":throw new Error(node.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(node.type))}};function getDeclError(node){return new Error("all declarations should have been transformed into "+"assignments before the Exploder began its work: "+JSON.stringify(node))}Ep.explodeStatement=function(path,labelId){assert.ok(path instanceof types.NodePath);var stmt=path.value;var self=this;n.Statement.assert(stmt);if(labelId){n.Identifier.assert(labelId)}else{labelId=null}if(n.BlockStatement.check(stmt)){return path.get("body").each(self.explodeStatement,self)}if(!meta.containsLeap(stmt)){self.emit(stmt);return}switch(stmt.type){case"ExpressionStatement":self.explodeExpression(path.get("expression"),true);break;case"LabeledStatement":self.explodeStatement(path.get("body"),stmt.label);break;case"WhileStatement":var before=loc();var after=loc();self.mark(before);self.jumpIfNot(self.explodeExpression(path.get("test")),after);self.leapManager.withEntry(new leap.LoopEntry(after,before,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(before);self.mark(after);break;case"DoWhileStatement":var first=loc();var test=loc();var after=loc();self.mark(first);self.leapManager.withEntry(new leap.LoopEntry(after,test,labelId),function(){self.explode(path.get("body"))});self.mark(test);self.jumpIf(self.explodeExpression(path.get("test")),first);self.mark(after);break;case"ForStatement":var head=loc();var update=loc();var after=loc();if(stmt.init){self.explode(path.get("init"),true)}self.mark(head);if(stmt.test){self.jumpIfNot(self.explodeExpression(path.get("test")),after)}else{}self.leapManager.withEntry(new leap.LoopEntry(after,update,labelId),function(){self.explodeStatement(path.get("body"))});self.mark(update);if(stmt.update){self.explode(path.get("update"),true)}self.jump(head);self.mark(after);break;case"ForInStatement":n.Identifier.assert(stmt.left);var head=loc();var after=loc();var keyIterNextFn=self.makeTempVar();self.emitAssign(keyIterNextFn,b.callExpression(runtimeKeysMethod,[self.explodeExpression(path.get("right"))]));self.mark(head);var keyInfoTmpVar=self.makeTempVar();self.jumpIf(b.memberExpression(b.assignmentExpression("=",keyInfoTmpVar,b.callExpression(keyIterNextFn,[])),b.identifier("done"),false),after);self.emitAssign(stmt.left,b.memberExpression(keyInfoTmpVar,b.identifier("value"),false));self.leapManager.withEntry(new leap.LoopEntry(after,head,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(head);self.mark(after);break;case"BreakStatement":self.emitAbruptCompletion({type:"break",target:self.leapManager.getBreakLoc(stmt.label)});break;case"ContinueStatement":self.emitAbruptCompletion({type:"continue",target:self.leapManager.getContinueLoc(stmt.label)});break;case"SwitchStatement":var disc=self.emitAssign(self.makeTempVar(),self.explodeExpression(path.get("discriminant")));var after=loc();var defaultLoc=loc();var condition=defaultLoc;var caseLocs=[];var cases=stmt.cases||[];for(var i=cases.length-1;i>=0;--i){var c=cases[i];n.SwitchCase.assert(c);if(c.test){condition=b.conditionalExpression(b.binaryExpression("===",disc,c.test),caseLocs[i]=loc(),condition)}else{caseLocs[i]=defaultLoc}}self.jump(self.explodeExpression(new types.NodePath(condition,path,"discriminant")));self.leapManager.withEntry(new leap.SwitchEntry(after),function(){path.get("cases").each(function(casePath){var c=casePath.value;var i=casePath.name;self.mark(caseLocs[i]);casePath.get("consequent").each(self.explodeStatement,self)})});self.mark(after);if(defaultLoc.value===-1){self.mark(defaultLoc);assert.strictEqual(after.value,defaultLoc.value)}break;case"IfStatement":var elseLoc=stmt.alternate&&loc();var after=loc();self.jumpIfNot(self.explodeExpression(path.get("test")),elseLoc||after);self.explodeStatement(path.get("consequent"));if(elseLoc){self.jump(after);self.mark(elseLoc);self.explodeStatement(path.get("alternate"))}self.mark(after);break;case"ReturnStatement":self.emitAbruptCompletion({type:"return",value:self.explodeExpression(path.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var after=loc();var handler=stmt.handler;if(!handler&&stmt.handlers){handler=stmt.handlers[0]||null}var catchLoc=handler&&loc();var catchEntry=catchLoc&&new leap.CatchEntry(catchLoc,handler.param);var finallyLoc=stmt.finalizer&&loc();var finallyEntry=finallyLoc&&new leap.FinallyEntry(finallyLoc);var tryEntry=new leap.TryEntry(self.getUnmarkedCurrentLoc(),catchEntry,finallyEntry);self.tryEntries.push(tryEntry);self.updateContextPrevLoc(tryEntry.firstLoc);self.leapManager.withEntry(tryEntry,function(){self.explodeStatement(path.get("block"));if(catchLoc){if(finallyLoc){self.jump(finallyLoc)}else{self.jump(after)}self.updateContextPrevLoc(self.mark(catchLoc));var bodyPath=path.get("handler","body");var safeParam=self.makeTempVar();self.clearPendingException(tryEntry.firstLoc,safeParam);var catchScope=bodyPath.scope;var catchParamName=handler.param.name;n.CatchClause.assert(catchScope.node);assert.strictEqual(catchScope.lookup(catchParamName),catchScope);types.visit(bodyPath,{visitIdentifier:function(path){if(util.isReference(path,catchParamName)&&path.scope.lookup(catchParamName)===catchScope){return safeParam}this.traverse(path)},visitFunction:function(path){if(path.scope.declares(catchParamName)){return false}this.traverse(path)}});self.leapManager.withEntry(catchEntry,function(){self.explodeStatement(bodyPath)})}if(finallyLoc){self.updateContextPrevLoc(self.mark(finallyLoc));self.leapManager.withEntry(finallyEntry,function(){self.explodeStatement(path.get("finalizer"))});self.emit(b.callExpression(self.contextProperty("finish"),[finallyEntry.firstLoc]))}});self.mark(after);break;case"ThrowStatement":self.emit(b.throwStatement(self.explodeExpression(path.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(stmt.type))}};Ep.emitAbruptCompletion=function(record){if(!isValidCompletion(record)){assert.ok(false,"invalid completion record: "+JSON.stringify(record))}assert.notStrictEqual(record.type,"normal","normal completions are not abrupt");var abruptArgs=[b.literal(record.type)];if(record.type==="break"||record.type==="continue"){n.Literal.assert(record.target);abruptArgs[1]=record.target}else if(record.type==="return"||record.type==="throw"){if(record.value){n.Expression.assert(record.value);abruptArgs[1]=record.value}}this.emit(b.returnStatement(b.callExpression(this.contextProperty("abrupt"),abruptArgs)))};function isValidCompletion(record){var type=record.type;if(type==="normal"){return!hasOwn.call(record,"target")}if(type==="break"||type==="continue"){return!hasOwn.call(record,"value")&&n.Literal.check(record.target)}if(type==="return"||type==="throw"){return hasOwn.call(record,"value")&&!hasOwn.call(record,"target")}return false}Ep.getUnmarkedCurrentLoc=function(){return b.literal(this.listing.length)};Ep.updateContextPrevLoc=function(loc){if(loc){n.Literal.assert(loc);if(loc.value===-1){loc.value=this.listing.length}else{assert.strictEqual(loc.value,this.listing.length)}}else{loc=this.getUnmarkedCurrentLoc()}this.emitAssign(this.contextProperty("prev"),loc)};Ep.explodeExpression=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var expr=path.value;if(expr){n.Expression.assert(expr)}else{return expr}var self=this;var result;function finish(expr){n.Expression.assert(expr);if(ignoreResult){self.emit(expr)}else{return expr}}if(!meta.containsLeap(expr)){return finish(expr)}var hasLeapingChildren=meta.containsLeap.onlyChildren(expr);function explodeViaTempVar(tempVar,childPath,ignoreChildResult){assert.ok(childPath instanceof types.NodePath);assert.ok(!ignoreChildResult||!tempVar,"Ignoring the result of a child expression but forcing it to "+"be assigned to a temporary variable?");var result=self.explodeExpression(childPath,ignoreChildResult);if(ignoreChildResult){}else if(tempVar||hasLeapingChildren&&(self.isVolatileContextProperty(result)||meta.hasSideEffects(result))){result=self.emitAssign(tempVar||self.makeTempVar(),result)}return result}switch(expr.type){case"MemberExpression":return finish(b.memberExpression(self.explodeExpression(path.get("object")),expr.computed?explodeViaTempVar(null,path.get("property")):expr.property,expr.computed));case"CallExpression":var oldCalleePath=path.get("callee");var newCallee=self.explodeExpression(oldCalleePath);if(!n.MemberExpression.check(oldCalleePath.node)&&n.MemberExpression.check(newCallee)){newCallee=b.sequenceExpression([b.literal(0),newCallee])}return finish(b.callExpression(newCallee,path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"NewExpression":return finish(b.newExpression(explodeViaTempVar(null,path.get("callee")),path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"ObjectExpression":return finish(b.objectExpression(path.get("properties").map(function(propPath){return b.property(propPath.value.kind,propPath.value.key,explodeViaTempVar(null,propPath.get("value")))})));case"ArrayExpression":return finish(b.arrayExpression(path.get("elements").map(function(elemPath){return explodeViaTempVar(null,elemPath)})));case"SequenceExpression":var lastIndex=expr.expressions.length-1;path.get("expressions").each(function(exprPath){if(exprPath.name===lastIndex){result=self.explodeExpression(exprPath,ignoreResult)}else{self.explodeExpression(exprPath,true)}});return result;case"LogicalExpression":var after=loc();if(!ignoreResult){result=self.makeTempVar()}var left=explodeViaTempVar(result,path.get("left"));if(expr.operator==="&&"){self.jumpIfNot(left,after)}else{assert.strictEqual(expr.operator,"||");self.jumpIf(left,after)}explodeViaTempVar(result,path.get("right"),ignoreResult);self.mark(after);return result;case"ConditionalExpression":var elseLoc=loc();var after=loc();var test=self.explodeExpression(path.get("test"));self.jumpIfNot(test,elseLoc);if(!ignoreResult){result=self.makeTempVar()}explodeViaTempVar(result,path.get("consequent"),ignoreResult);self.jump(after);self.mark(elseLoc);explodeViaTempVar(result,path.get("alternate"),ignoreResult);self.mark(after);return result;case"UnaryExpression":return finish(b.unaryExpression(expr.operator,self.explodeExpression(path.get("argument")),!!expr.prefix));case"BinaryExpression":return finish(b.binaryExpression(expr.operator,explodeViaTempVar(null,path.get("left")),explodeViaTempVar(null,path.get("right"))));case"AssignmentExpression":return finish(b.assignmentExpression(expr.operator,self.explodeExpression(path.get("left")),self.explodeExpression(path.get("right"))));case"UpdateExpression":return finish(b.updateExpression(expr.operator,self.explodeExpression(path.get("argument")),expr.prefix));case"YieldExpression":var after=loc();var arg=expr.argument&&self.explodeExpression(path.get("argument"));if(arg&&expr.delegate){var result=self.makeTempVar();self.emit(b.returnStatement(b.callExpression(self.contextProperty("delegateYield"),[arg,b.literal(result.property.name),after])));self.mark(after);return result}self.emitAssign(self.contextProperty("next"),after);self.emit(b.returnStatement(arg||null));self.mark(after);return self.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(expr.type))}}},{"./leap":130,"./meta":131,"./util":132,assert:94,recast:159}],129:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.hoist=function(funPath){assert.ok(funPath instanceof types.NodePath);n.Function.assert(funPath.value);var vars={};function varDeclToExpr(vdec,includeIdentifiers){n.VariableDeclaration.assert(vdec);var exprs=[];vdec.declarations.forEach(function(dec){vars[dec.id.name]=dec.id;if(dec.init){exprs.push(b.assignmentExpression("=",dec.id,dec.init))}else if(includeIdentifiers){exprs.push(dec.id)}});if(exprs.length===0)return null;if(exprs.length===1)return exprs[0];return b.sequenceExpression(exprs)}types.visit(funPath.get("body"),{visitVariableDeclaration:function(path){var expr=varDeclToExpr(path.value,false);if(expr===null){path.replace()}else{return b.expressionStatement(expr)}return false},visitForStatement:function(path){var init=path.value.init;if(n.VariableDeclaration.check(init)){path.get("init").replace(varDeclToExpr(init,false))}this.traverse(path)},visitForInStatement:function(path){var left=path.value.left;if(n.VariableDeclaration.check(left)){path.get("left").replace(varDeclToExpr(left,true))}this.traverse(path)},visitFunctionDeclaration:function(path){var node=path.value;vars[node.id.name]=node.id;var parentNode=path.parent.node;var assignment=b.expressionStatement(b.assignmentExpression("=",node.id,b.functionExpression(node.id,node.params,node.body,node.generator,node.expression)));if(n.BlockStatement.check(path.parent.node)){path.parent.get("body").unshift(assignment);path.replace()}else{path.replace(assignment)}return false},visitFunctionExpression:function(path){return false}});var paramNames={};funPath.get("params").each(function(paramPath){var param=paramPath.value;if(n.Identifier.check(param)){paramNames[param.name]=param}else{}});var declarations=[];Object.keys(vars).forEach(function(name){if(!hasOwn.call(paramNames,name)){declarations.push(b.variableDeclarator(vars[name],null))}});if(declarations.length===0){return null}return b.variableDeclaration("var",declarations)}},{assert:94,recast:159}],130:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var n=types.namedTypes;var b=types.builders;var inherits=require("util").inherits;var hasOwn=Object.prototype.hasOwnProperty;function Entry(){assert.ok(this instanceof Entry)}function FunctionEntry(returnLoc){Entry.call(this);n.Literal.assert(returnLoc);Object.defineProperties(this,{returnLoc:{value:returnLoc}})}inherits(FunctionEntry,Entry);exports.FunctionEntry=FunctionEntry;function LoopEntry(breakLoc,continueLoc,label){Entry.call(this);n.Literal.assert(breakLoc);n.Literal.assert(continueLoc);if(label){n.Identifier.assert(label)}else{label=null}Object.defineProperties(this,{breakLoc:{value:breakLoc},continueLoc:{value:continueLoc},label:{value:label}})}inherits(LoopEntry,Entry);exports.LoopEntry=LoopEntry;function SwitchEntry(breakLoc){Entry.call(this);n.Literal.assert(breakLoc);Object.defineProperties(this,{breakLoc:{value:breakLoc}})}inherits(SwitchEntry,Entry);exports.SwitchEntry=SwitchEntry;function TryEntry(firstLoc,catchEntry,finallyEntry){Entry.call(this);n.Literal.assert(firstLoc);if(catchEntry){assert.ok(catchEntry instanceof CatchEntry)}else{catchEntry=null}if(finallyEntry){assert.ok(finallyEntry instanceof FinallyEntry)}else{finallyEntry=null}assert.ok(catchEntry||finallyEntry);Object.defineProperties(this,{firstLoc:{value:firstLoc},catchEntry:{value:catchEntry},finallyEntry:{value:finallyEntry}})}inherits(TryEntry,Entry);exports.TryEntry=TryEntry;function CatchEntry(firstLoc,paramId){Entry.call(this);n.Literal.assert(firstLoc);n.Identifier.assert(paramId);Object.defineProperties(this,{firstLoc:{value:firstLoc},paramId:{value:paramId}})}inherits(CatchEntry,Entry);exports.CatchEntry=CatchEntry;function FinallyEntry(firstLoc){Entry.call(this);n.Literal.assert(firstLoc);Object.defineProperties(this,{firstLoc:{value:firstLoc}})}inherits(FinallyEntry,Entry);exports.FinallyEntry=FinallyEntry;function LeapManager(emitter){assert.ok(this instanceof LeapManager);var Emitter=require("./emit").Emitter;assert.ok(emitter instanceof Emitter);Object.defineProperties(this,{emitter:{value:emitter},entryStack:{value:[new FunctionEntry(emitter.finalLoc)]}})}var LMp=LeapManager.prototype;exports.LeapManager=LeapManager;LMp.withEntry=function(entry,callback){assert.ok(entry instanceof Entry);this.entryStack.push(entry);try{callback.call(this.emitter)}finally{var popped=this.entryStack.pop();assert.strictEqual(popped,entry)}};LMp._findLeapLocation=function(property,label){for(var i=this.entryStack.length-1;i>=0;--i){var entry=this.entryStack[i];var loc=entry[property];if(loc){if(label){if(entry.label&&entry.label.name===label.name){return loc}}else{return loc}}}return null};LMp.getBreakLoc=function(label){return this._findLeapLocation("breakLoc",label)};LMp.getContinueLoc=function(label){return this._findLeapLocation("continueLoc",label)}},{"./emit":128,assert:94,recast:159,util:118}],131:[function(require,module,exports){var assert=require("assert");var m=require("private").makeAccessor();var types=require("recast").types;var isArray=types.builtInTypes.array;var n=types.namedTypes;var hasOwn=Object.prototype.hasOwnProperty;function makePredicate(propertyName,knownTypes){function onlyChildren(node){n.Node.assert(node);var result=false;function check(child){if(result){}else if(isArray.check(child)){child.some(check)}else if(n.Node.check(child)){assert.strictEqual(result,false);result=predicate(child)}return result}types.eachField(node,function(name,child){check(child)});return result}function predicate(node){n.Node.assert(node);var meta=m(node);if(hasOwn.call(meta,propertyName))return meta[propertyName];if(hasOwn.call(opaqueTypes,node.type))return meta[propertyName]=false;if(hasOwn.call(knownTypes,node.type))return meta[propertyName]=true;return meta[propertyName]=onlyChildren(node)}predicate.onlyChildren=onlyChildren;return predicate}var opaqueTypes={FunctionExpression:true};var sideEffectTypes={CallExpression:true,ForInStatement:true,UnaryExpression:true,BinaryExpression:true,AssignmentExpression:true,UpdateExpression:true,NewExpression:true};var leapTypes={YieldExpression:true,BreakStatement:true,ContinueStatement:true,ReturnStatement:true,ThrowStatement:true};for(var type in leapTypes){if(hasOwn.call(leapTypes,type)){sideEffectTypes[type]=leapTypes[type]}}exports.hasSideEffects=makePredicate("hasSideEffects",sideEffectTypes);exports.containsLeap=makePredicate("containsLeap",leapTypes)},{assert:94,"private":127,recast:159}],132:[function(require,module,exports){var assert=require("assert");var types=require("recast").types;var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.defaults=function(obj){var len=arguments.length;var extension;for(var i=1;i<len;++i){if(extension=arguments[i]){for(var key in extension){if(hasOwn.call(extension,key)&&!hasOwn.call(obj,key)){obj[key]=extension[key]}}}}return obj};exports.runtimeProperty=function(name){return b.memberExpression(b.identifier("regeneratorRuntime"),b.identifier(name),false)};exports.isReference=function(path,name){var node=path.value;if(!n.Identifier.check(node)){return false}if(name&&node.name!==name){return false}var parent=path.parent.value;switch(parent.type){case"VariableDeclarator":return path.name==="init";case"MemberExpression":return path.name==="object"||parent.computed&&path.name==="property";case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":if(path.name==="id"){return false}if(parent.params===path.parentPath&&parent.params[path.name]===node){return false}return true;case"ClassDeclaration":case"ClassExpression":return path.name!=="id";case"CatchClause":return path.name!=="param";case"Property":case"MethodDefinition":return path.name!=="key";case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"LabeledStatement":return false;default:return true}}},{assert:94,recast:159}],133:[function(require,module,exports){var assert=require("assert");var fs=require("fs");var recast=require("recast");var types=recast.types;var n=types.namedTypes;var b=types.builders;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var NodePath=types.NodePath;var hoist=require("./hoist").hoist;var Emitter=require("./emit").Emitter;var runtimeProperty=require("./util").runtimeProperty;var runtimeWrapMethod=runtimeProperty("wrap");var runtimeMarkMethod=runtimeProperty("mark");var runtimeValuesMethod=runtimeProperty("values");var runtimeAsyncMethod=runtimeProperty("async");exports.transform=function transform(node,options){options=options||{};node=recast.visit(node,visitor);if(options.includeRuntime===true||options.includeRuntime==="if used"&&visitor.wasChangeReported()){injectRuntime(n.File.check(node)?node.program:node)}options.madeChanges=visitor.wasChangeReported();return node};function injectRuntime(program){n.Program.assert(program);var runtimePath=require("..").runtime.path;var runtime=fs.readFileSync(runtimePath,"utf8");var runtimeBody=recast.parse(runtime,{sourceFileName:runtimePath}).program.body;var body=program.body;body.unshift.apply(body,runtimeBody)}var visitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){this.traverse(path);var node=path.value;if(!node.generator&&!node.async){return}this.reportChanged();node.generator=false;if(node.expression){node.expression=false;node.body=b.blockStatement([b.returnStatement(node.body)])}if(node.async){awaitVisitor.visit(path.get("body"))}var outerFnId=node.id||(node.id=path.scope.parent.declareTemporary("callee$"));var innerFnId=b.identifier(node.id.name+"$");var contextId=path.scope.declareTemporary("context$");var argsId=path.scope.declareTemporary("args$");var shouldAliasArguments=renameArguments(path,argsId);var vars=hoist(path);if(shouldAliasArguments){vars=vars||b.variableDeclaration("var",[]);vars.declarations.push(b.variableDeclarator(argsId,b.identifier("arguments")))}var emitter=new Emitter(contextId);emitter.explode(path.get("body"));var outerBody=[];if(vars&&vars.declarations.length>0){outerBody.push(vars)}var wrapArgs=[emitter.getContextFunction(innerFnId),node.async?b.literal(null):outerFnId,b.thisExpression()];var tryEntryList=emitter.getTryEntryList();if(tryEntryList){wrapArgs.push(tryEntryList)}var wrapCall=b.callExpression(node.async?runtimeAsyncMethod:runtimeWrapMethod,wrapArgs);outerBody.push(b.returnStatement(wrapCall));node.body=b.blockStatement(outerBody);if(node.async){node.async=false;return}if(n.FunctionDeclaration.check(node)){var pp=path.parent;while(pp&&!(n.BlockStatement.check(pp.value)||n.Program.check(pp.value))){pp=pp.parent}if(!pp){return}path.replace();node.type="FunctionExpression";var varDecl=b.variableDeclaration("var",[b.variableDeclarator(node.id,b.callExpression(runtimeMarkMethod,[node]))]);if(node.comments){varDecl.comments=node.comments;node.comments=null}var bodyPath=pp.get("body");var bodyLen=bodyPath.value.length;for(var i=0;i<bodyLen;++i){var firstStmtPath=bodyPath.get(i);if(!shouldNotHoistAbove(firstStmtPath)){firstStmtPath.insertBefore(varDecl);return}}bodyPath.push(varDecl)}else{n.FunctionExpression.assert(node);return b.callExpression(runtimeMarkMethod,[node])}},visitForOfStatement:function(path){this.traverse(path);var node=path.value;var tempIterId=path.scope.declareTemporary("t$");var tempIterDecl=b.variableDeclarator(tempIterId,b.callExpression(runtimeValuesMethod,[node.right]));var tempInfoId=path.scope.declareTemporary("t$");var tempInfoDecl=b.variableDeclarator(tempInfoId,null);var init=node.left;var loopId;if(n.VariableDeclaration.check(init)){loopId=init.declarations[0].id;init.declarations.push(tempIterDecl,tempInfoDecl)}else{loopId=init;init=b.variableDeclaration("var",[tempIterDecl,tempInfoDecl])}n.Identifier.assert(loopId);var loopIdAssignExprStmt=b.expressionStatement(b.assignmentExpression("=",loopId,b.memberExpression(tempInfoId,b.identifier("value"),false)));if(n.BlockStatement.check(node.body)){node.body.body.unshift(loopIdAssignExprStmt)}else{node.body=b.blockStatement([loopIdAssignExprStmt,node.body])}return b.forStatement(init,b.unaryExpression("!",b.memberExpression(b.assignmentExpression("=",tempInfoId,b.callExpression(b.memberExpression(tempIterId,b.identifier("next"),false),[])),b.identifier("done"),false)),null,node.body)}});function shouldNotHoistAbove(stmtPath){var value=stmtPath.value;n.Statement.assert(value);if(n.ExpressionStatement.check(value)&&n.Literal.check(value.expression)&&value.expression.value==="use strict"){return true}if(n.VariableDeclaration.check(value)){for(var i=0;i<value.declarations.length;++i){var decl=value.declarations[i];if(n.CallExpression.check(decl.init)&&types.astNodesAreEquivalent(decl.init.callee,runtimeMarkMethod)){return true}}}return false}function renameArguments(funcPath,argsId){assert.ok(funcPath instanceof types.NodePath);var func=funcPath.value;var didReplaceArguments=false;var hasImplicitArguments=false;recast.visit(funcPath,{visitFunction:function(path){if(path.value===func){hasImplicitArguments=!path.scope.lookup("arguments");this.traverse(path)}else{return false}},visitIdentifier:function(path){if(path.value.name==="arguments"){var isMemberProperty=n.MemberExpression.check(path.parent.node)&&path.name==="property"&&!path.parent.node.computed;if(!isMemberProperty){path.replace(argsId);didReplaceArguments=true;return false}}this.traverse(path)}});return didReplaceArguments&&hasImplicitArguments}var awaitVisitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){return false},visitAwaitExpression:function(path){return b.yieldExpression(path.value.argument,false)}})},{"..":134,"./emit":128,"./hoist":129,"./util":132,assert:94,fs:93,recast:159}],134:[function(require,module,exports){(function(__dirname){var assert=require("assert");var path=require("path");var fs=require("fs");var through=require("through");var transform=require("./lib/visit").transform;var utils=require("./lib/util");var recast=require("recast");var types=recast.types;var genOrAsyncFunExp=/\bfunction\s*\*|\basync\b/;var blockBindingExp=/\b(let|const)\s+/;function exports(file,options){var data=[];return through(write,end);function write(buf){data.push(buf)}function end(){this.queue(compile(data.join(""),options).code);this.queue(null)}}module.exports=exports;function runtime(){require("./runtime")}exports.runtime=runtime;runtime.path=path.join(__dirname,"runtime.js");function compile(source,options){options=normalizeOptions(options);if(!genOrAsyncFunExp.test(source)){return{code:(options.includeRuntime===true?fs.readFileSync(runtime.path,"utf-8")+"\n":"")+source}}var recastOptions=getRecastOptions(options);var ast=recast.parse(source,recastOptions);var path=new types.NodePath(ast);var programPath=path.get("program");if(shouldVarify(source,options)){varifyAst(programPath.node)}transform(programPath,options);return recast.print(path,recastOptions)}function normalizeOptions(options){options=utils.defaults(options||{},{includeRuntime:false,supportBlockBinding:true});if(!options.esprima){options.esprima=require("esprima-fb")}assert.ok(/harmony/.test(options.esprima.version),"Bad esprima version: "+options.esprima.version);return options}function getRecastOptions(options){var recastOptions={range:true};function copy(name){if(name in options){recastOptions[name]=options[name]}}copy("esprima");copy("sourceFileName");copy("sourceMapName");copy("inputSourceMap");copy("sourceRoot");return recastOptions}function shouldVarify(source,options){var supportBlockBinding=!!options.supportBlockBinding;if(supportBlockBinding){if(!blockBindingExp.test(source)){supportBlockBinding=false}}return supportBlockBinding}function varify(source,options){var recastOptions=getRecastOptions(normalizeOptions(options));var ast=recast.parse(source,recastOptions);varifyAst(ast.program);return recast.print(ast,recastOptions).code}function varifyAst(ast){types.namedTypes.Program.assert(ast);var defsResult=require("defs")(ast,{ast:true,disallowUnknownReferences:false,disallowDuplicated:false,disallowVars:false,loopClosures:"iife"});if(defsResult.errors){throw new Error(defsResult.errors.join("\n"))}return ast}exports.varify=varify;exports.compile=compile;exports.transform=transform}).call(this,"/node_modules/regenerator")},{"./lib/util":132,"./lib/visit":133,"./runtime":161,assert:94,defs:135,"esprima-fb":149,fs:93,path:102,recast:159,through:160}],135:[function(require,module,exports){"use strict";var assert=require("assert");var is=require("simple-is");var fmt=require("simple-fmt");var stringmap=require("stringmap");var stringset=require("stringset");var alter=require("alter");var traverse=require("ast-traverse");var breakable=require("breakable");var Scope=require("./scope");var error=require("./error");var getline=error.getline;var options=require("./options");var Stats=require("./stats");var jshint_vars=require("./jshint_globals/vars.js");function isConstLet(kind){return is.someof(kind,["const","let"])}function isVarConstLet(kind){return is.someof(kind,["var","const","let"])}function isNonFunctionBlock(node){return node.type==="BlockStatement"&&is.noneof(node.$parent.type,["FunctionDeclaration","FunctionExpression"])}function isForWithConstLet(node){return node.type==="ForStatement"&&node.init&&node.init.type==="VariableDeclaration"&&isConstLet(node.init.kind)}function isForInOfWithConstLet(node){return isForInOf(node)&&node.left.type==="VariableDeclaration"&&isConstLet(node.left.kind)}function isForInOf(node){return is.someof(node.type,["ForInStatement","ForOfStatement"])}function isFunction(node){return is.someof(node.type,["FunctionDeclaration","FunctionExpression"])}function isLoop(node){return is.someof(node.type,["ForStatement","ForInStatement","ForOfStatement","WhileStatement","DoWhileStatement"])}function isReference(node){var parent=node.$parent;return node.$refToScope||node.type==="Identifier"&&!(parent.type==="VariableDeclarator"&&parent.id===node)&&!(parent.type==="MemberExpression"&&parent.computed===false&&parent.property===node)&&!(parent.type==="Property"&&parent.key===node)&&!(parent.type==="LabeledStatement"&&parent.label===node)&&!(parent.type==="CatchClause"&&parent.param===node)&&!(isFunction(parent)&&parent.id===node)&&!(isFunction(parent)&&is.someof(node,parent.params))&&true}function isLvalue(node){return isReference(node)&&(node.$parent.type==="AssignmentExpression"&&node.$parent.left===node||node.$parent.type==="UpdateExpression"&&node.$parent.argument===node)}function createScopes(node,parent){assert(!node.$scope);node.$parent=parent;node.$scope=node.$parent?node.$parent.$scope:null;if(node.type==="Program"){node.$scope=new Scope({kind:"hoist",node:node,parent:null})}else if(isFunction(node)){node.$scope=new Scope({kind:"hoist",node:node,parent:node.$parent.$scope});if(node.id){assert(node.id.type==="Identifier");if(node.type==="FunctionDeclaration"){node.$parent.$scope.add(node.id.name,"fun",node.id,null)}else if(node.type==="FunctionExpression"){node.$scope.add(node.id.name,"fun",node.id,null)}else{assert(false)}}node.params.forEach(function(param){node.$scope.add(param.name,"param",param,null)
})}else if(node.type==="VariableDeclaration"){assert(isVarConstLet(node.kind));node.declarations.forEach(function(declarator){assert(declarator.type==="VariableDeclarator");var name=declarator.id.name;if(options.disallowVars&&node.kind==="var"){error(getline(declarator),"var {0} is not allowed (use let or const)",name)}node.$scope.add(name,node.kind,declarator.id,declarator.range[1])})}else if(isForWithConstLet(node)||isForInOfWithConstLet(node)){node.$scope=new Scope({kind:"block",node:node,parent:node.$parent.$scope})}else if(isNonFunctionBlock(node)){node.$scope=new Scope({kind:"block",node:node,parent:node.$parent.$scope})}else if(node.type==="CatchClause"){var identifier=node.param;node.$scope=new Scope({kind:"catch-block",node:node,parent:node.$parent.$scope});node.$scope.add(identifier.name,"caught",identifier,null);node.$scope.closestHoistScope().markPropagates(identifier.name)}}function createTopScope(programScope,environments,globals){function inject(obj){for(var name in obj){var writeable=obj[name];var kind=writeable?"var":"const";if(topScope.hasOwn(name)){topScope.remove(name)}topScope.add(name,kind,{loc:{start:{line:-1}}},-1)}}var topScope=new Scope({kind:"hoist",node:{},parent:null});var complementary={undefined:false,Infinity:false,console:false};inject(complementary);inject(jshint_vars.reservedVars);inject(jshint_vars.ecmaIdentifiers);if(environments){environments.forEach(function(env){if(!jshint_vars[env]){error(-1,'environment "{0}" not found',env)}else{inject(jshint_vars[env])}})}if(globals){inject(globals)}programScope.parent=topScope;topScope.children.push(programScope);return topScope}function setupReferences(ast,allIdentifiers,opts){var analyze=is.own(opts,"analyze")?opts.analyze:true;function visit(node){if(!isReference(node)){return}allIdentifiers.add(node.name);var scope=node.$scope.lookup(node.name);if(analyze&&!scope&&options.disallowUnknownReferences){error(getline(node),"reference to unknown global variable {0}",node.name)}if(analyze&&scope&&is.someof(scope.getKind(node.name),["const","let"])){var allowedFromPos=scope.getFromPos(node.name);var referencedAtPos=node.range[0];assert(is.finitenumber(allowedFromPos));assert(is.finitenumber(referencedAtPos));if(referencedAtPos<allowedFromPos){if(!node.$scope.hasFunctionScopeBetween(scope)){error(getline(node),"{0} is referenced before its declaration",node.name)}}}node.$refToScope=scope}traverse(ast,{pre:visit})}function varify(ast,stats,allIdentifiers,changes){function unique(name){assert(allIdentifiers.has(name));for(var cnt=0;;cnt++){var genName=name+"$"+String(cnt);if(!allIdentifiers.has(genName)){return genName}}}function renameDeclarations(node){if(node.type==="VariableDeclaration"&&isConstLet(node.kind)){var hoistScope=node.$scope.closestHoistScope();var origScope=node.$scope;changes.push({start:node.range[0],end:node.range[0]+node.kind.length,str:"var"});node.declarations.forEach(function(declarator){assert(declarator.type==="VariableDeclarator");var name=declarator.id.name;stats.declarator(node.kind);var rename=origScope!==hoistScope&&(hoistScope.hasOwn(name)||hoistScope.doesPropagate(name));var newName=rename?unique(name):name;origScope.remove(name);hoistScope.add(newName,"var",declarator.id,declarator.range[1]);origScope.moves=origScope.moves||stringmap();origScope.moves.set(name,{name:newName,scope:hoistScope});allIdentifiers.add(newName);if(newName!==name){stats.rename(name,newName,getline(declarator));declarator.id.originalName=name;declarator.id.name=newName;changes.push({start:declarator.id.range[0],end:declarator.id.range[1],str:newName})}});node.kind="var"}}function renameReferences(node){if(!node.$refToScope){return}var move=node.$refToScope.moves&&node.$refToScope.moves.get(node.name);if(!move){return}node.$refToScope=move.scope;if(node.name!==move.name){node.originalName=node.name;node.name=move.name;if(node.alterop){var existingOp=null;for(var i=0;i<changes.length;i++){var op=changes[i];if(op.node===node){existingOp=op;break}}assert(existingOp);existingOp.str=move.name}else{changes.push({start:node.range[0],end:node.range[1],str:move.name})}}}traverse(ast,{pre:renameDeclarations});traverse(ast,{pre:renameReferences});ast.$scope.traverse({pre:function(scope){delete scope.moves}})}function detectLoopClosures(ast){traverse(ast,{pre:visit});function detectIifyBodyBlockers(body,node){return breakable(function(brk){traverse(body,{pre:function(n){if(isFunction(n)){return false}var err=true;var msg="loop-variable {0} is captured by a loop-closure that can't be transformed due to use of {1} at line {2}";if(n.type==="BreakStatement"){error(getline(node),msg,node.name,"break",getline(n))}else if(n.type==="ContinueStatement"){error(getline(node),msg,node.name,"continue",getline(n))}else if(n.type==="ReturnStatement"){error(getline(node),msg,node.name,"return",getline(n))}else if(n.type==="YieldExpression"){error(getline(node),msg,node.name,"yield",getline(n))}else if(n.type==="Identifier"&&n.name==="arguments"){error(getline(node),msg,node.name,"arguments",getline(n))}else if(n.type==="VariableDeclaration"&&n.kind==="var"){error(getline(node),msg,node.name,"var",getline(n))}else{err=false}if(err){brk(true)}}});return false})}function visit(node){var loopNode=null;if(isReference(node)&&node.$refToScope&&isConstLet(node.$refToScope.getKind(node.name))){for(var n=node.$refToScope.node;;){if(isFunction(n)){return}else if(isLoop(n)){loopNode=n;break}n=n.$parent;if(!n){return}}assert(isLoop(loopNode));var defScope=node.$refToScope;var generateIIFE=options.loopClosures==="iife";for(var s=node.$scope;s;s=s.parent){if(s===defScope){return}else if(isFunction(s.node)){if(!generateIIFE){var msg='loop-variable {0} is captured by a loop-closure. Tried "loopClosures": "iife" in defs-config.json?';return error(getline(node),msg,node.name)}if(loopNode.type==="ForStatement"&&defScope.node===loopNode){var declarationNode=defScope.getNode(node.name);return error(getline(declarationNode),"Not yet specced ES6 feature. {0} is declared in for-loop header and then captured in loop closure",declarationNode.name)}if(detectIifyBodyBlockers(loopNode.body,node)){return}loopNode.$iify=true}}}}}function transformLoopClosures(root,ops,options){function insertOp(pos,str,node){var op={start:pos,end:pos,str:str};if(node){op.node=node}ops.push(op)}traverse(root,{pre:function(node){if(!node.$iify){return}var hasBlock=node.body.type==="BlockStatement";var insertHead=hasBlock?node.body.range[0]+1:node.body.range[0];var insertFoot=hasBlock?node.body.range[1]-1:node.body.range[1];var forInName=isForInOf(node)&&node.left.declarations[0].id.name;var iifeHead=fmt("(function({0}){",forInName?forInName:"");var iifeTail=fmt("}).call(this{0});",forInName?", "+forInName:"");var iifeFragment=options.parse(iifeHead+iifeTail);var iifeExpressionStatement=iifeFragment.body[0];var iifeBlockStatement=iifeExpressionStatement.expression.callee.object.body;if(hasBlock){var forBlockStatement=node.body;var tmp=forBlockStatement.body;forBlockStatement.body=[iifeExpressionStatement];iifeBlockStatement.body=tmp}else{var tmp$0=node.body;node.body=iifeExpressionStatement;iifeBlockStatement.body[0]=tmp$0}insertOp(insertHead,iifeHead);if(forInName){insertOp(insertFoot,"}).call(this, ");var args=iifeExpressionStatement.expression.arguments;var iifeArgumentIdentifier=args[1];iifeArgumentIdentifier.alterop=true;insertOp(insertFoot,forInName,iifeArgumentIdentifier);insertOp(insertFoot,");")}else{insertOp(insertFoot,iifeTail)}}})}function detectConstAssignment(ast){traverse(ast,{pre:function(node){if(isLvalue(node)){var scope=node.$scope.lookup(node.name);if(scope&&scope.getKind(node.name)==="const"){error(getline(node),"can't assign to const variable {0}",node.name)}}}})}function detectConstantLets(ast){traverse(ast,{pre:function(node){if(isLvalue(node)){var scope=node.$scope.lookup(node.name);if(scope){scope.markWrite(node.name)}}}});ast.$scope.detectUnmodifiedLets()}function setupScopeAndReferences(root,opts){traverse(root,{pre:createScopes});var topScope=createTopScope(root.$scope,options.environments,options.globals);var allIdentifiers=stringset();topScope.traverse({pre:function(scope){allIdentifiers.addMany(scope.decls.keys())}});setupReferences(root,allIdentifiers,opts);return allIdentifiers}function cleanupTree(root){traverse(root,{pre:function(node){for(var prop in node){if(prop[0]==="$"){delete node[prop]}}}})}function run(src,config){for(var key in config){options[key]=config[key]}var parsed;if(is.object(src)){if(!options.ast){return{errors:["Can't produce string output when input is an AST. "+"Did you forget to set options.ast = true?"]}}parsed=src}else if(is.string(src)){try{parsed=options.parse(src,{loc:true,range:true})}catch(e){return{errors:[fmt("line {0} column {1}: Error during input file parsing\n{2}\n{3}",e.lineNumber,e.column,src.split("\n")[e.lineNumber-1],fmt.repeat(" ",e.column-1)+"^")]}}}else{return{errors:["Input was neither an AST object nor a string."]}}var ast=parsed;error.reset();var allIdentifiers=setupScopeAndReferences(ast,{});detectLoopClosures(ast);detectConstAssignment(ast);var changes=[];transformLoopClosures(ast,changes,options);if(error.errors.length>=1){return{errors:error.errors}}if(changes.length>0){cleanupTree(ast);allIdentifiers=setupScopeAndReferences(ast,{analyze:false})}assert(error.errors.length===0);var stats=new Stats;varify(ast,stats,allIdentifiers,changes);if(options.ast){cleanupTree(ast);return{stats:stats,ast:ast}}else{var transformedSrc=alter(src,changes);return{stats:stats,src:transformedSrc}}}module.exports=run},{"./error":136,"./jshint_globals/vars.js":137,"./options":138,"./scope":139,"./stats":140,alter:141,assert:94,"ast-traverse":143,breakable:144,"simple-fmt":145,"simple-is":146,stringmap:147,stringset:148}],136:[function(require,module,exports){"use strict";var fmt=require("simple-fmt");var assert=require("assert");function error(line,var_args){assert(arguments.length>=2);var msg=arguments.length===2?String(var_args):fmt.apply(fmt,Array.prototype.slice.call(arguments,1));error.errors.push(line===-1?msg:fmt("line {0}: {1}",line,msg))}error.reset=function(){error.errors=[]};error.getline=function(node){if(node&&node.loc&&node.loc.start){return node.loc.start.line}return-1};error.reset();module.exports=error},{assert:94,"simple-fmt":145}],137:[function(require,module,exports){"use strict";exports.reservedVars={arguments:false,NaN:false};exports.ecmaIdentifiers={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Math:false,Map:false,Number:false,Object:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,Set:false,String:false,SyntaxError:false,TypeError:false,URIError:false,WeakMap:false};exports.browser={ArrayBuffer:false,ArrayBufferView:false,Audio:false,Blob:false,addEventListener:false,applicationCache:false,atob:false,blur:false,btoa:false,clearInterval:false,clearTimeout:false,close:false,closed:false,DataView:false,DOMParser:false,defaultStatus:false,document:false,Element:false,event:false,FileReader:false,Float32Array:false,Float64Array:false,FormData:false,focus:false,frames:false,getComputedStyle:false,HTMLElement:false,HTMLAnchorElement:false,HTMLBaseElement:false,HTMLBlockquoteElement:false,HTMLBodyElement:false,HTMLBRElement:false,HTMLButtonElement:false,HTMLCanvasElement:false,HTMLDirectoryElement:false,HTMLDivElement:false,HTMLDListElement:false,HTMLFieldSetElement:false,HTMLFontElement:false,HTMLFormElement:false,HTMLFrameElement:false,HTMLFrameSetElement:false,HTMLHeadElement:false,HTMLHeadingElement:false,HTMLHRElement:false,HTMLHtmlElement:false,HTMLIFrameElement:false,HTMLImageElement:false,HTMLInputElement:false,HTMLIsIndexElement:false,HTMLLabelElement:false,HTMLLayerElement:false,HTMLLegendElement:false,HTMLLIElement:false,HTMLLinkElement:false,HTMLMapElement:false,HTMLMenuElement:false,HTMLMetaElement:false,HTMLModElement:false,HTMLObjectElement:false,HTMLOListElement:false,HTMLOptGroupElement:false,HTMLOptionElement:false,HTMLParagraphElement:false,HTMLParamElement:false,HTMLPreElement:false,HTMLQuoteElement:false,HTMLScriptElement:false,HTMLSelectElement:false,HTMLStyleElement:false,HTMLTableCaptionElement:false,HTMLTableCellElement:false,HTMLTableColElement:false,HTMLTableElement:false,HTMLTableRowElement:false,HTMLTableSectionElement:false,HTMLTextAreaElement:false,HTMLTitleElement:false,HTMLUListElement:false,HTMLVideoElement:false,history:false,Int16Array:false,Int32Array:false,Int8Array:false,Image:false,length:false,localStorage:false,location:false,MessageChannel:false,MessageEvent:false,MessagePort:false,moveBy:false,moveTo:false,MutationObserver:false,name:false,Node:false,NodeFilter:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,openDatabase:false,opener:false,Option:false,parent:false,print:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,sessionStorage:false,setInterval:false,setTimeout:false,SharedWorker:false,status:false,top:false,Uint16Array:false,Uint32Array:false,Uint8Array:false,Uint8ClampedArray:false,WebSocket:false,window:false,Worker:false,XMLHttpRequest:false,XMLSerializer:false,XPathEvaluator:false,XPathException:false,XPathExpression:false,XPathNamespace:false,XPathNSResolver:false,XPathResult:false};exports.devel={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false};exports.worker={importScripts:true,postMessage:true,self:true};exports.nonstandard={escape:false,unescape:false};exports.couch={require:false,respond:false,getRow:false,emit:false,send:false,start:false,sum:false,log:false,exports:false,module:false,provides:false};exports.node={__filename:false,__dirname:false,Buffer:false,DataView:false,console:false,exports:true,GLOBAL:false,global:false,module:false,process:false,require:false,setTimeout:false,clearTimeout:false,setInterval:false,clearInterval:false};exports.phantom={phantom:true,require:true,WebPage:true};exports.rhino={defineClass:false,deserialize:false,gc:false,help:false,importPackage:false,java:false,load:false,loadClass:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false};exports.wsh={ActiveXObject:true,Enumerator:true,GetObject:true,ScriptEngine:true,ScriptEngineBuildVersion:true,ScriptEngineMajorVersion:true,ScriptEngineMinorVersion:true,VBArray:true,WSH:true,WScript:true,XDomainRequest:true};exports.dojo={dojo:false,dijit:false,dojox:false,define:false,require:false};exports.jquery={$:false,jQuery:false};exports.mootools={$:false,$$:false,Asset:false,Browser:false,Chain:false,Class:false,Color:false,Cookie:false,Core:false,Document:false,DomReady:false,DOMEvent:false,DOMReady:false,Drag:false,Element:false,Elements:false,Event:false,Events:false,Fx:false,Group:false,Hash:false,HtmlTable:false,Iframe:false,IframeShim:false,InputValidator:false,instanceOf:false,Keyboard:false,Locale:false,Mask:false,MooTools:false,Native:false,Options:false,OverText:false,Request:false,Scroller:false,Slick:false,Slider:false,Sortables:false,Spinner:false,Swiff:false,Tips:false,Type:false,typeOf:false,URI:false,Window:false};exports.prototypejs={$:false,$$:false,$A:false,$F:false,$H:false,$R:false,$break:false,$continue:false,$w:false,Abstract:false,Ajax:false,Class:false,Enumerable:false,Element:false,Event:false,Field:false,Form:false,Hash:false,Insertion:false,ObjectRange:false,PeriodicalExecuter:false,Position:false,Prototype:false,Selector:false,Template:false,Toggle:false,Try:false,Autocompleter:false,Builder:false,Control:false,Draggable:false,Draggables:false,Droppables:false,Effect:false,Sortable:false,SortableObserver:false,Sound:false,Scriptaculous:false};exports.yui={YUI:false,Y:false,YUI_config:false}},{}],138:[function(require,module,exports){module.exports={disallowVars:false,disallowDuplicated:true,disallowUnknownReferences:true,parse:require("esprima-fb").parse}},{"esprima-fb":149}],139:[function(require,module,exports){"use strict";var assert=require("assert");var stringmap=require("stringmap");var stringset=require("stringset");var is=require("simple-is");var fmt=require("simple-fmt");var error=require("./error");var getline=error.getline;var options=require("./options");function Scope(args){assert(is.someof(args.kind,["hoist","block","catch-block"]));assert(is.object(args.node));assert(args.parent===null||is.object(args.parent));this.kind=args.kind;this.node=args.node;this.parent=args.parent;this.children=[];this.decls=stringmap();this.written=stringset();this.propagates=this.kind==="hoist"?stringset():null;if(this.parent){this.parent.children.push(this)}}Scope.prototype.print=function(indent){indent=indent||0;var scope=this;var names=this.decls.keys().map(function(name){return fmt("{0} [{1}]",name,scope.decls.get(name).kind)}).join(", ");var propagates=this.propagates?this.propagates.items().join(", "):"";console.log(fmt("{0}{1}: {2}. propagates: {3}",fmt.repeat(" ",indent),this.node.type,names,propagates));this.children.forEach(function(c){c.print(indent+2)})};Scope.prototype.add=function(name,kind,node,referableFromPos){assert(is.someof(kind,["fun","param","var","caught","const","let"]));function isConstLet(kind){return is.someof(kind,["const","let"])}var scope=this;if(is.someof(kind,["fun","param","var"])){while(scope.kind!=="hoist"){if(scope.decls.has(name)&&isConstLet(scope.decls.get(name).kind)){return error(getline(node),"{0} is already declared",name)}scope=scope.parent}}if(scope.decls.has(name)&&(options.disallowDuplicated||isConstLet(scope.decls.get(name).kind)||isConstLet(kind))){return error(getline(node),"{0} is already declared",name)}var declaration={kind:kind,node:node};if(referableFromPos){assert(is.someof(kind,["var","const","let"]));declaration.from=referableFromPos}scope.decls.set(name,declaration)};Scope.prototype.getKind=function(name){assert(is.string(name));var decl=this.decls.get(name);return decl?decl.kind:null};Scope.prototype.getNode=function(name){assert(is.string(name));var decl=this.decls.get(name);return decl?decl.node:null};Scope.prototype.getFromPos=function(name){assert(is.string(name));var decl=this.decls.get(name);return decl?decl.from:null};Scope.prototype.hasOwn=function(name){return this.decls.has(name)};Scope.prototype.remove=function(name){return this.decls.remove(name)};Scope.prototype.doesPropagate=function(name){return this.propagates.has(name)};Scope.prototype.markPropagates=function(name){this.propagates.add(name)};Scope.prototype.closestHoistScope=function(){var scope=this;while(scope.kind!=="hoist"){scope=scope.parent}return scope};Scope.prototype.hasFunctionScopeBetween=function(outer){function isFunction(node){return is.someof(node.type,["FunctionDeclaration","FunctionExpression"])}for(var scope=this;scope;scope=scope.parent){if(scope===outer){return false}if(isFunction(scope.node)){return true}}throw new Error("wasn't inner scope of outer")};Scope.prototype.lookup=function(name){for(var scope=this;scope;scope=scope.parent){if(scope.decls.has(name)){return scope}else if(scope.kind==="hoist"){scope.propagates.add(name)}}return null};Scope.prototype.markWrite=function(name){assert(is.string(name));this.written.add(name)};Scope.prototype.detectUnmodifiedLets=function(){var outmost=this;function detect(scope){if(scope!==outmost){scope.decls.keys().forEach(function(name){if(scope.getKind(name)==="let"&&!scope.written.has(name)){return error(getline(scope.getNode(name)),"{0} is declared as let but never modified so could be const",name)}})}scope.children.forEach(function(childScope){detect(childScope)})}detect(this)};Scope.prototype.traverse=function(options){options=options||{};var pre=options.pre;var post=options.post;function visit(scope){if(pre){pre(scope)}scope.children.forEach(function(childScope){visit(childScope)});if(post){post(scope)}}visit(this)};module.exports=Scope},{"./error":136,"./options":138,assert:94,"simple-fmt":145,"simple-is":146,stringmap:147,stringset:148}],140:[function(require,module,exports){var fmt=require("simple-fmt");var is=require("simple-is");var assert=require("assert");function Stats(){this.lets=0;this.consts=0;this.renames=[]}Stats.prototype.declarator=function(kind){assert(is.someof(kind,["const","let"]));if(kind==="const"){this.consts++}else{this.lets++}};Stats.prototype.rename=function(oldName,newName,line){this.renames.push({oldName:oldName,newName:newName,line:line})};Stats.prototype.toString=function(){var renames=this.renames.map(function(r){return r}).sort(function(a,b){return a.line-b.line});var renameStr=renames.map(function(rename){return fmt("\nline {0}: {1} => {2}",rename.line,rename.oldName,rename.newName)}).join("");var sum=this.consts+this.lets;var constlets=sum===0?"can't calculate const coverage (0 consts, 0 lets)":fmt("{0}% const coverage ({1} consts, {2} lets)",Math.floor(100*this.consts/sum),this.consts,this.lets);return constlets+renameStr+"\n"};module.exports=Stats},{assert:94,"simple-fmt":145,"simple-is":146}],141:[function(require,module,exports){var assert=require("assert");var stableSort=require("stable");function alter(str,fragments){"use strict";var isArray=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"};assert(typeof str==="string");assert(isArray(fragments));var sortedFragments=stableSort(fragments,function(a,b){return a.start-b.start});var outs=[];var pos=0;for(var i=0;i<sortedFragments.length;i++){var frag=sortedFragments[i];assert(pos<=frag.start);assert(frag.start<=frag.end);outs.push(str.slice(pos,frag.start));outs.push(frag.str);pos=frag.end}if(pos<str.length){outs.push(str.slice(pos))}return outs.join("")}if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=alter}},{assert:94,stable:142}],142:[function(require,module,exports){(function(){var stable=function(arr,comp){return exec(arr.slice(),comp)};stable.inplace=function(arr,comp){var result=exec(arr,comp);if(result!==arr){pass(result,null,arr.length,arr)}return arr};function exec(arr,comp){if(typeof comp!=="function"){comp=function(a,b){return String(a).localeCompare(b)}}var len=arr.length;if(len<=1){return arr}var buffer=new Array(len);for(var chk=1;chk<len;chk*=2){pass(arr,comp,chk,buffer);var tmp=arr;arr=buffer;buffer=tmp}return arr}var pass=function(arr,comp,chk,result){var len=arr.length;var i=0;var dbl=chk*2;var l,r,e;var li,ri;for(l=0;l<len;l+=dbl){r=l+chk;e=r+chk;if(r>len)r=len;if(e>len)e=len;li=l;ri=r;while(true){if(li<r&&ri<e){if(comp(arr[li],arr[ri])<=0){result[i++]=arr[li++]}else{result[i++]=arr[ri++]}}else if(li<r){result[i++]=arr[li++]}else if(ri<e){result[i++]=arr[ri++]}else{break}}}};if(typeof module!=="undefined"){module.exports=stable}else{window.stable=stable}})()},{}],143:[function(require,module,exports){function traverse(root,options){"use strict";options=options||{};var pre=options.pre;var post=options.post;var skipProperty=options.skipProperty;function visit(node,parent,prop,idx){if(!node||typeof node.type!=="string"){return}var res=undefined;if(pre){res=pre(node,parent,prop,idx)}if(res!==false){for(var prop in node){if(skipProperty?skipProperty(prop,node):prop[0]==="$"){continue}var child=node[prop];if(Array.isArray(child)){for(var i=0;i<child.length;i++){visit(child[i],node,prop,i)}}else{visit(child,node,prop)}}}if(post){post(node,parent,prop,idx)}}visit(root,null)}if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=traverse}},{}],144:[function(require,module,exports){var breakable=function(){"use strict";function Val(val,brk){this.val=val;this.brk=brk}function make_brk(){return function brk(val){throw new Val(val,brk)}}function breakable(fn){var brk=make_brk();try{return fn(brk)}catch(e){if(e instanceof Val&&e.brk===brk){return e.val}throw e}}return breakable}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=breakable}},{}],145:[function(require,module,exports){var fmt=function(){"use strict";function fmt(str,var_args){var args=Array.prototype.slice.call(arguments,1);return str.replace(/\{(\d+)\}/g,function(s,match){return match in args?args[match]:s})}function obj(str,obj){return str.replace(/\{([_$a-zA-Z0-9][_$a-zA-Z0-9]*)\}/g,function(s,match){return match in obj?obj[match]:s})}function repeat(str,n){return new Array(n+1).join(str)}fmt.fmt=fmt;fmt.obj=obj;fmt.repeat=repeat;return fmt}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=fmt}},{}],146:[function(require,module,exports){var is=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;var _undefined=void 0;return{nan:function(v){return v!==v},"boolean":function(v){return typeof v==="boolean"},number:function(v){return typeof v==="number"},string:function(v){return typeof v==="string"},fn:function(v){return typeof v==="function"},object:function(v){return v!==null&&typeof v==="object"},primitive:function(v){var t=typeof v;return v===null||v===_undefined||t==="boolean"||t==="number"||t==="string"},array:Array.isArray||function(v){return toString.call(v)==="[object Array]"},finitenumber:function(v){return typeof v==="number"&&isFinite(v)},someof:function(v,values){return values.indexOf(v)>=0},noneof:function(v,values){return values.indexOf(v)===-1},own:function(obj,prop){return hasOwnProperty.call(obj,prop)}}}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=is}},{}],147:[function(require,module,exports){var StringMap=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty;var create=function(){function hasOwnEnumerableProps(obj){for(var prop in obj){if(hasOwnProperty.call(obj,prop)){return true}}return false}function hasOwnPollutedProps(obj){return hasOwnProperty.call(obj,"__count__")||hasOwnProperty.call(obj,"__parent__")}var useObjectCreate=false;if(typeof Object.create==="function"){if(!hasOwnEnumerableProps(Object.create(null))){useObjectCreate=true}}if(useObjectCreate===false){if(hasOwnEnumerableProps({})){throw new Error("StringMap environment error 0, please file a bug at https://github.com/olov/stringmap/issues")}}var o=useObjectCreate?Object.create(null):{};var useProtoClear=false;if(hasOwnPollutedProps(o)){o.__proto__=null;if(hasOwnEnumerableProps(o)||hasOwnPollutedProps(o)){throw new Error("StringMap environment error 1, please file a bug at https://github.com/olov/stringmap/issues")}useProtoClear=true}return function(){var o=useObjectCreate?Object.create(null):{};if(useProtoClear){o.__proto__=null}return o}}();function stringmap(optional_object){if(!(this instanceof stringmap)){return new stringmap(optional_object)}this.obj=create();this.hasProto=false;this.proto=undefined;if(optional_object){this.setMany(optional_object)}}stringmap.prototype.has=function(key){if(typeof key!=="string"){throw new Error("StringMap expected string key")}return key==="__proto__"?this.hasProto:hasOwnProperty.call(this.obj,key)};stringmap.prototype.get=function(key){if(typeof key!=="string"){throw new Error("StringMap expected string key")}return key==="__proto__"?this.proto:hasOwnProperty.call(this.obj,key)?this.obj[key]:undefined};stringmap.prototype.set=function(key,value){if(typeof key!=="string"){throw new Error("StringMap expected string key")}if(key==="__proto__"){this.hasProto=true;this.proto=value}else{this.obj[key]=value}};stringmap.prototype.remove=function(key){if(typeof key!=="string"){throw new Error("StringMap expected string key")}var didExist=this.has(key);if(key==="__proto__"){this.hasProto=false;this.proto=undefined}else{delete this.obj[key]}return didExist};stringmap.prototype["delete"]=stringmap.prototype.remove;stringmap.prototype.isEmpty=function(){for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){return false}}return!this.hasProto};stringmap.prototype.size=function(){var len=0;for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){++len}}return this.hasProto?len+1:len};stringmap.prototype.keys=function(){var keys=[];for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){keys.push(key)}}if(this.hasProto){keys.push("__proto__")}return keys};stringmap.prototype.values=function(){var values=[];for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){values.push(this.obj[key])}}if(this.hasProto){values.push(this.proto)}return values};stringmap.prototype.items=function(){var items=[];for(var key in this.obj){if(hasOwnProperty.call(this.obj,key)){items.push([key,this.obj[key]])}}if(this.hasProto){items.push(["__proto__",this.proto])}return items};stringmap.prototype.setMany=function(object){if(object===null||typeof object!=="object"&&typeof object!=="function"){throw new Error("StringMap expected Object")}for(var key in object){if(hasOwnProperty.call(object,key)){this.set(key,object[key])}}return this};stringmap.prototype.merge=function(other){var keys=other.keys();for(var i=0;i<keys.length;i++){var key=keys[i];this.set(key,other.get(key))}return this};stringmap.prototype.map=function(fn){var keys=this.keys();for(var i=0;i<keys.length;i++){var key=keys[i];keys[i]=fn(this.get(key),key)}return keys};stringmap.prototype.forEach=function(fn){var keys=this.keys();for(var i=0;i<keys.length;i++){var key=keys[i];fn(this.get(key),key)}};stringmap.prototype.clone=function(){var other=stringmap();return other.merge(this)};stringmap.prototype.toString=function(){var self=this;return"{"+this.keys().map(function(key){return JSON.stringify(key)+":"+JSON.stringify(self.get(key))}).join(",")+"}"};return stringmap}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=StringMap}},{}],148:[function(require,module,exports){var StringSet=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty;var create=function(){function hasOwnEnumerableProps(obj){for(var prop in obj){if(hasOwnProperty.call(obj,prop)){return true}}return false}function hasOwnPollutedProps(obj){return hasOwnProperty.call(obj,"__count__")||hasOwnProperty.call(obj,"__parent__")}var useObjectCreate=false;if(typeof Object.create==="function"){if(!hasOwnEnumerableProps(Object.create(null))){useObjectCreate=true}}if(useObjectCreate===false){if(hasOwnEnumerableProps({})){throw new Error("StringSet environment error 0, please file a bug at https://github.com/olov/stringset/issues")}}var o=useObjectCreate?Object.create(null):{};var useProtoClear=false;if(hasOwnPollutedProps(o)){o.__proto__=null;if(hasOwnEnumerableProps(o)||hasOwnPollutedProps(o)){throw new Error("StringSet environment error 1, please file a bug at https://github.com/olov/stringset/issues")}useProtoClear=true}return function(){var o=useObjectCreate?Object.create(null):{};if(useProtoClear){o.__proto__=null}return o}}();function stringset(optional_array){if(!(this instanceof stringset)){return new stringset(optional_array)}this.obj=create();this.hasProto=false;if(optional_array){this.addMany(optional_array)}}stringset.prototype.has=function(item){if(typeof item!=="string"){throw new Error("StringSet expected string item")}return item==="__proto__"?this.hasProto:hasOwnProperty.call(this.obj,item)};stringset.prototype.add=function(item){if(typeof item!=="string"){throw new Error("StringSet expected string item")}if(item==="__proto__"){this.hasProto=true}else{this.obj[item]=true}};stringset.prototype.remove=function(item){if(typeof item!=="string"){throw new Error("StringSet expected string item")}var didExist=this.has(item);if(item==="__proto__"){this.hasProto=false}else{delete this.obj[item]}return didExist};stringset.prototype["delete"]=stringset.prototype.remove;stringset.prototype.isEmpty=function(){for(var item in this.obj){if(hasOwnProperty.call(this.obj,item)){return false}}return!this.hasProto};stringset.prototype.size=function(){var len=0;
for(var item in this.obj){if(hasOwnProperty.call(this.obj,item)){++len}}return this.hasProto?len+1:len};stringset.prototype.items=function(){var items=[];for(var item in this.obj){if(hasOwnProperty.call(this.obj,item)){items.push(item)}}if(this.hasProto){items.push("__proto__")}return items};stringset.prototype.addMany=function(items){if(!Array.isArray(items)){throw new Error("StringSet expected array")}for(var i=0;i<items.length;i++){this.add(items[i])}return this};stringset.prototype.merge=function(other){this.addMany(other.items());return this};stringset.prototype.clone=function(){var other=stringset();return other.merge(this)};stringset.prototype.toString=function(){return"{"+this.items().map(JSON.stringify).join(",")+"}"};return stringset}();if(typeof module!=="undefined"&&typeof module.exports!=="undefined"){module.exports=StringSet}},{}],149:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.esprima={})}})(this,function(exports){"use strict";var Token,TokenName,FnExprTokens,Syntax,PropertyKind,Messages,Regex,SyntaxTreeDelegate,XHTMLEntities,ClassPropertyType,source,strict,index,lineNumber,lineStart,length,delegate,lookahead,state,extra;Token={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10,XJSIdentifier:11,XJSText:12};TokenName={};TokenName[Token.BooleanLiteral]="Boolean";TokenName[Token.EOF]="<end>";TokenName[Token.Identifier]="Identifier";TokenName[Token.Keyword]="Keyword";TokenName[Token.NullLiteral]="Null";TokenName[Token.NumericLiteral]="Numeric";TokenName[Token.Punctuator]="Punctuator";TokenName[Token.StringLiteral]="String";TokenName[Token.XJSIdentifier]="XJSIdentifier";TokenName[Token.XJSText]="XJSText";TokenName[Token.RegularExpression]="RegularExpression";FnExprTokens=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];Syntax={AnyTypeAnnotation:"AnyTypeAnnotation",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrayTypeAnnotation:"ArrayTypeAnnotation",ArrowFunctionExpression:"ArrowFunctionExpression",AssignmentExpression:"AssignmentExpression",BinaryExpression:"BinaryExpression",BlockStatement:"BlockStatement",BooleanTypeAnnotation:"BooleanTypeAnnotation",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ClassImplements:"ClassImplements",ClassProperty:"ClassProperty",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DeclareClass:"DeclareClass",DeclareFunction:"DeclareFunction",DeclareModule:"DeclareModule",DeclareVariable:"DeclareVariable",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportDeclaration:"ExportDeclaration",ExportBatchSpecifier:"ExportBatchSpecifier",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",ForStatement:"ForStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",FunctionTypeAnnotation:"FunctionTypeAnnotation",FunctionTypeParam:"FunctionTypeParam",GenericTypeAnnotation:"GenericTypeAnnotation",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",InterfaceDeclaration:"InterfaceDeclaration",InterfaceExtends:"InterfaceExtends",IntersectionTypeAnnotation:"IntersectionTypeAnnotation",LabeledStatement:"LabeledStatement",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",NullableTypeAnnotation:"NullableTypeAnnotation",NumberTypeAnnotation:"NumberTypeAnnotation",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",ObjectTypeAnnotation:"ObjectTypeAnnotation",ObjectTypeCallProperty:"ObjectTypeCallProperty",ObjectTypeIndexer:"ObjectTypeIndexer",ObjectTypeProperty:"ObjectTypeProperty",Program:"Program",Property:"Property",QualifiedTypeIdentifier:"QualifiedTypeIdentifier",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SpreadProperty:"SpreadProperty",StringLiteralTypeAnnotation:"StringLiteralTypeAnnotation",StringTypeAnnotation:"StringTypeAnnotation",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TupleTypeAnnotation:"TupleTypeAnnotation",TryStatement:"TryStatement",TypeAlias:"TypeAlias",TypeAnnotation:"TypeAnnotation",TypeofTypeAnnotation:"TypeofTypeAnnotation",TypeParameterDeclaration:"TypeParameterDeclaration",TypeParameterInstantiation:"TypeParameterInstantiation",UnaryExpression:"UnaryExpression",UnionTypeAnnotation:"UnionTypeAnnotation",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",VoidTypeAnnotation:"VoidTypeAnnotation",WhileStatement:"WhileStatement",WithStatement:"WithStatement",XJSIdentifier:"XJSIdentifier",XJSNamespacedName:"XJSNamespacedName",XJSMemberExpression:"XJSMemberExpression",XJSEmptyExpression:"XJSEmptyExpression",XJSExpressionContainer:"XJSExpressionContainer",XJSElement:"XJSElement",XJSClosingElement:"XJSClosingElement",XJSOpeningElement:"XJSOpeningElement",XJSAttribute:"XJSAttribute",XJSSpreadAttribute:"XJSSpreadAttribute",XJSText:"XJSText",YieldExpression:"YieldExpression",AwaitExpression:"AwaitExpression"};PropertyKind={Data:1,Get:2,Set:4};ClassPropertyType={"static":"static",prototype:"prototype"};Messages={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInFormalsList:"Invalid left-hand side in formals list",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalDuplicateClassProperty:"Illegal duplicate property in class definition",IllegalReturn:"Illegal return statement",IllegalSpread:"Illegal spread element",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",ParameterAfterRestParameter:"Rest parameter must be final parameter of an argument list",DefaultRestParameter:"Rest parameter can not have a default value",ElementAfterSpreadElement:"Spread must be the final element of an element list",PropertyAfterSpreadProperty:"A rest property must be the final property of an object literal",ObjectPatternAsRestParameter:"Invalid rest parameter",ObjectPatternAsSpread:"Invalid spread argument",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingFromClause:"Missing from clause",NoAsAfterImportNamespace:"Missing as after import *",InvalidModuleSpecifier:"Invalid module specifier",NoUnintializedConst:"Const must be initialized",ComprehensionRequiresBlock:"Comprehension must have at least one block",ComprehensionError:"Comprehension Error",EachNotAllowed:"Each is not supported",InvalidXJSAttributeValue:"XJS value should be either an expression or a quoted XJS text",ExpectedXJSClosingTag:"Expected corresponding XJS closing tag for %0",AdjacentXJSElements:"Adjacent XJS elements must be wrapped in an enclosing tag",ConfusedAboutFunctionType:"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType"};Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),LeadingZeros:new RegExp("^0+(?!$)")};function assert(condition,message){if(!condition){throw new Error("ASSERT: "+message)}}function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return"0123456789abcdefABCDEF".indexOf(ch)>=0}function isOctalDigit(ch){return"01234567".indexOf(ch)>=0}function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&" ".indexOf(String.fromCharCode(ch))>0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function isFutureReservedWord(id){switch(id){case"class":case"enum":case"export":case"extends":case"import":case"super":return true;default:return false}}function isStrictModeReservedWord(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true;default:return false}}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isKeyword(id){if(strict&&isStrictModeReservedWord(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try"||id==="let";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function skipComment(){var ch,blockComment,lineComment;blockComment=false;lineComment=false;while(index<length){ch=source.charCodeAt(index);if(lineComment){++index;if(isLineTerminator(ch)){lineComment=false;if(ch===13&&source.charCodeAt(index)===10){++index}++lineNumber;lineStart=index}}else if(blockComment){if(isLineTerminator(ch)){if(ch===13){++index}if(ch!==13||source.charCodeAt(index)===10){++lineNumber;++index;lineStart=index;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}}else{ch=source.charCodeAt(index++);if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(ch===42){ch=source.charCodeAt(index);if(ch===47){++index;blockComment=false}}}}else if(ch===47){ch=source.charCodeAt(index+1);if(ch===47){index+=2;lineComment=true}else if(ch===42){index+=2;blockComment=true;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{break}}else if(isWhiteSpace(ch)){++index}else if(isLineTerminator(ch)){++index;if(ch===13&&source.charCodeAt(index)===10){++index}++lineNumber;lineStart=index}else{break}}}function scanHexEscape(prefix){var i,len,ch,code=0;len=prefix==="u"?4:2;for(i=0;i<len;++i){if(index<length&&isHexDigit(source[index])){ch=source[index++];code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}else{return""}}return String.fromCharCode(code)}function scanUnicodeCodePointEscape(){var ch,code,cu1,cu2;ch=source[index];code=0;if(ch==="}"){throwError({},Messages.UnexpectedToken,"ILLEGAL")}while(index<length){ch=source[index++];if(!isHexDigit(ch)){break}code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}if(code>1114111||ch!=="}"){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(code<=65535){return String.fromCharCode(code)}cu1=(code-65536>>10)+55296;cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function getEscapedIdentifier(){var ch,id;ch=source.charCodeAt(index++);id=String.fromCharCode(ch);if(ch===92){if(source.charCodeAt(index)!==117){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;ch=scanHexEscape("u");if(!ch||ch==="\\"||!isIdentifierStart(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}id=ch}while(index<length){ch=source.charCodeAt(index);if(!isIdentifierPart(ch)){break}++index;id+=String.fromCharCode(ch);if(ch===92){id=id.substr(0,id.length-1);if(source.charCodeAt(index)!==117){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;ch=scanHexEscape("u");if(!ch||ch==="\\"||!isIdentifierPart(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}id+=ch}}return id}function getIdentifier(){var start,ch;start=index++;while(index<length){ch=source.charCodeAt(index);if(ch===92){index=start;return getEscapedIdentifier()}if(isIdentifierPart(ch)){++index}else{break}}return source.slice(start,index)}function scanIdentifier(){var start,id,type;start=index;id=source.charCodeAt(index)===92?getEscapedIdentifier():getIdentifier();if(id.length===1){type=Token.Identifier}else if(isKeyword(id)){type=Token.Keyword}else if(id==="null"){type=Token.NullLiteral}else if(id==="true"||id==="false"){type=Token.BooleanLiteral}else{type=Token.Identifier}return{type:type,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanPunctuator(){var start=index,code=source.charCodeAt(index),code2,ch1=source[index],ch2,ch3,ch4;switch(code){case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:++index;if(extra.tokenize){if(code===40){extra.openParenToken=extra.tokens.length}else if(code===123){extra.openCurlyToken=extra.tokens.length}}return{type:Token.Punctuator,value:String.fromCharCode(code),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]};default:code2=source.charCodeAt(index+1);if(code2===61){switch(code){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:index+=2;return{type:Token.Punctuator,value:String.fromCharCode(code)+String.fromCharCode(code2),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]};case 33:case 61:index+=2;if(source.charCodeAt(index)===61){++index}return{type:Token.Punctuator,value:source.slice(start,index),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]};default:break}}break}ch2=source[index+1];ch3=source[index+2];ch4=source[index+3];if(ch1===">"&&ch2===">"&&ch3===">"){if(ch4==="="){index+=4;return{type:Token.Punctuator,value:">>>=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}}if(ch1===">"&&ch2===">"&&ch3===">"){index+=3;return{type:Token.Punctuator,value:">>>",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="<"&&ch2==="<"&&ch3==="="){index+=3;return{type:Token.Punctuator,value:"<<=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===">"&&ch2===">"&&ch3==="="){index+=3;return{type:Token.Punctuator,value:">>=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="."&&ch2==="."&&ch3==="."){index+=3;return{type:Token.Punctuator,value:"...",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===ch2&&"+-<>&|".indexOf(ch1)>=0&&!state.inType){index+=2;return{type:Token.Punctuator,value:ch1+ch2,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="="&&ch2===">"){index+=2;return{type:Token.Punctuator,value:"=>",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if("<>=!+-*%&|^/".indexOf(ch1)>=0){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="."){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}throwError({},Messages.UnexpectedToken,"ILLEGAL")}function scanHexLiteral(start){var number="";while(index<length){if(!isHexDigit(source[index])){break}number+=source[index++]}if(number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseInt("0x"+number,16),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanOctalLiteral(prefix,start){var number,octal;if(isOctalDigit(prefix)){octal=true;number="0"+source[index++]}else{octal=false;++index;number=""}while(index<length){if(!isOctalDigit(source[index])){break}number+=source[index++]}if(!octal&&number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(isIdentifierStart(source.charCodeAt(index))||isDecimalDigit(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseInt(number,8),octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanNumericLiteral(){var number,start,ch,octal;ch=source[index];assert(isDecimalDigit(ch.charCodeAt(0))||ch===".","Numeric literal must start with a decimal digit or a decimal point");start=index;number="";if(ch!=="."){number=source[index++];ch=source[index];if(number==="0"){if(ch==="x"||ch==="X"){++index;return scanHexLiteral(start)}if(ch==="b"||ch==="B"){++index;number="";while(index<length){ch=source[index];if(ch!=="0"&&ch!=="1"){break}number+=source[index++]}if(number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(index<length){ch=source.charCodeAt(index);if(isIdentifierStart(ch)||isDecimalDigit(ch)){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}return{type:Token.NumericLiteral,value:parseInt(number,2),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch==="o"||ch==="O"||isOctalDigit(ch)){return scanOctalLiteral(ch,start)}if(ch&&isDecimalDigit(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="."){number+=source[index++];while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="e"||ch==="E"){number+=source[index++];ch=source[index];if(ch==="+"||ch==="-"){number+=source[index++]}if(isDecimalDigit(source.charCodeAt(index))){while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}}else{throwError({},Messages.UnexpectedToken,"ILLEGAL")}}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseFloat(number),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanStringLiteral(){var str="",quote,start,ch,code,unescaped,restore,octal=false;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;while(index<length){ch=source[index++];if(ch===quote){quote="";break}else if(ch==="\\"){ch=source[index++];if(!ch||!isLineTerminator(ch.charCodeAt(0))){switch(ch){case"n":str+="\n";break;case"r":str+="\r";break;case"t":str+=" ";break;case"u":case"x":if(source[index]==="{"){++index;str+=scanUnicodeCodePointEscape()}else{restore=index;unescaped=scanHexEscape(ch);if(unescaped){str+=unescaped}else{index=restore;str+=ch}}break;case"b":str+="\b";break;case"f":str+="\f";break;case"v":str+="";break;default:if(isOctalDigit(ch)){code="01234567".indexOf(ch);if(code!==0){octal=true}if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+"01234567".indexOf(source[index++]);if("0123".indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+"01234567".indexOf(source[index++])}}str+=String.fromCharCode(code)}else{str+=ch}break}}else{++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index}}else if(isLineTerminator(ch.charCodeAt(0))){break}else{str+=ch}}if(quote!==""){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.StringLiteral,value:str,octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanTemplate(){var cooked="",ch,start,terminated,tail,restore,unescaped,code,octal;terminated=false;tail=false;start=index;++index;while(index<length){ch=source[index++];if(ch==="`"){tail=true;terminated=true;break}else if(ch==="$"){if(source[index]==="{"){++index;terminated=true;break}cooked+=ch}else if(ch==="\\"){ch=source[index++];if(!isLineTerminator(ch.charCodeAt(0))){switch(ch){case"n":cooked+="\n";break;case"r":cooked+="\r";break;case"t":cooked+=" ";break;case"u":case"x":if(source[index]==="{"){++index;cooked+=scanUnicodeCodePointEscape()}else{restore=index;unescaped=scanHexEscape(ch);if(unescaped){cooked+=unescaped}else{index=restore;cooked+=ch}}break;case"b":cooked+="\b";break;case"f":cooked+="\f";break;case"v":cooked+="";break;default:if(isOctalDigit(ch)){code="01234567".indexOf(ch);if(code!==0){octal=true}if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+"01234567".indexOf(source[index++]);if("0123".indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+"01234567".indexOf(source[index++])}}cooked+=String.fromCharCode(code)}else{cooked+=ch}break}}else{++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index}}else if(isLineTerminator(ch.charCodeAt(0))){++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index;cooked+="\n"}else{cooked+=ch}}if(!terminated){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.Template,value:{cooked:cooked,raw:source.slice(start+1,index-(tail?1:2))},tail:tail,octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanTemplateElement(option){var startsWith,template;lookahead=null;skipComment();startsWith=option.head?"`":"}";if(source[index]!==startsWith){throwError({},Messages.UnexpectedToken,"ILLEGAL")}template=scanTemplate();peek();return template}function scanRegExp(){var str,ch,start,pattern,flags,value,classMarker=false,restore,terminated=false,tmp;lookahead=null;skipComment();start=index;ch=source[index];assert(ch==="/","Regular expression literal must start with a slash");str=source[index++];while(index<length){ch=source[index++];str+=ch;if(classMarker){if(ch==="]"){classMarker=false}}else{if(ch==="\\"){ch=source[index++];if(isLineTerminator(ch.charCodeAt(0))){throwError({},Messages.UnterminatedRegExp)}str+=ch}else if(ch==="/"){terminated=true;break}else if(ch==="["){classMarker=true}else if(isLineTerminator(ch.charCodeAt(0))){throwError({},Messages.UnterminatedRegExp)}}}if(!terminated){throwError({},Messages.UnterminatedRegExp)}pattern=str.substr(1,str.length-2);flags="";while(index<length){ch=source[index];if(!isIdentifierPart(ch.charCodeAt(0))){break}++index;if(ch==="\\"&&index<length){ch=source[index];if(ch==="u"){++index;restore=index;ch=scanHexEscape("u");if(ch){flags+=ch;for(str+="\\u";restore<index;++restore){str+=source[restore]}}else{index=restore;flags+="u";str+="\\u"}}else{str+="\\"}}else{flags+=ch;str+=ch}}tmp=pattern;if(flags.indexOf("u")>=0){tmp=tmp.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{value=new RegExp(tmp)}catch(e){throwError({},Messages.InvalidRegExp)}try{value=new RegExp(pattern,flags)}catch(exception){value=null}peek();if(extra.tokenize){return{type:Token.RegularExpression,value:value,regex:{pattern:pattern,flags:flags},lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}return{literal:str,value:value,regex:{pattern:pattern,flags:flags},range:[start,index]}}function isIdentifierName(token){return token.type===Token.Identifier||token.type===Token.Keyword||token.type===Token.BooleanLiteral||token.type===Token.NullLiteral}function advanceSlash(){var prevToken,checkToken;prevToken=extra.tokens[extra.tokens.length-1];if(!prevToken){return scanRegExp()}if(prevToken.type==="Punctuator"){if(prevToken.value===")"){checkToken=extra.tokens[extra.openParenToken-1];if(checkToken&&checkToken.type==="Keyword"&&(checkToken.value==="if"||checkToken.value==="while"||checkToken.value==="for"||checkToken.value==="with")){return scanRegExp()}return scanPunctuator()}if(prevToken.value==="}"){if(extra.tokens[extra.openCurlyToken-3]&&extra.tokens[extra.openCurlyToken-3].type==="Keyword"){checkToken=extra.tokens[extra.openCurlyToken-4];if(!checkToken){return scanPunctuator()}}else if(extra.tokens[extra.openCurlyToken-4]&&extra.tokens[extra.openCurlyToken-4].type==="Keyword"){checkToken=extra.tokens[extra.openCurlyToken-5];if(!checkToken){return scanRegExp()}}else{return scanPunctuator()}if(FnExprTokens.indexOf(checkToken.value)>=0){return scanPunctuator()}return scanRegExp()}return scanRegExp()}if(prevToken.type==="Keyword"){return scanRegExp()}return scanPunctuator()}function advance(){var ch;if(!state.inXJSChild){skipComment()}if(index>=length){return{type:Token.EOF,lineNumber:lineNumber,lineStart:lineStart,range:[index,index]}}if(state.inXJSChild){return advanceXJSChild()}ch=source.charCodeAt(index);if(ch===40||ch===41||ch===58){return scanPunctuator()}if(ch===39||ch===34){if(state.inXJSTag){return scanXJSStringLiteral()}return scanStringLiteral()}if(state.inXJSTag&&isXJSIdentifierStart(ch)){return scanXJSIdentifier()}if(ch===96){return scanTemplate()}if(isIdentifierStart(ch)){return scanIdentifier()}if(ch===46){if(isDecimalDigit(source.charCodeAt(index+1))){return scanNumericLiteral()}return scanPunctuator()}if(isDecimalDigit(ch)){return scanNumericLiteral()}if(extra.tokenize&&ch===47){return advanceSlash()}return scanPunctuator()}function lex(){var token;token=lookahead;index=token.range[1];lineNumber=token.lineNumber;lineStart=token.lineStart;lookahead=advance();index=token.range[1];lineNumber=token.lineNumber;lineStart=token.lineStart;return token}function peek(){var pos,line,start;pos=index;line=lineNumber;start=lineStart;lookahead=advance();index=pos;lineNumber=line;lineStart=start}function lookahead2(){var adv,pos,line,start,result;adv=typeof extra.advance==="function"?extra.advance:advance;pos=index;line=lineNumber;start=lineStart;if(lookahead===null){lookahead=adv()}index=lookahead.range[1];lineNumber=lookahead.lineNumber;lineStart=lookahead.lineStart;result=adv();index=pos;lineNumber=line;lineStart=start;return result}function rewind(token){index=token.range[0];lineNumber=token.lineNumber;lineStart=token.lineStart;lookahead=token}function markerCreate(){if(!extra.loc&&!extra.range){return undefined}skipComment();return{offset:index,line:lineNumber,col:index-lineStart}}function markerCreatePreserveWhitespace(){if(!extra.loc&&!extra.range){return undefined}return{offset:index,line:lineNumber,col:index-lineStart}}function processComment(node){var lastChild,trailingComments,bottomRight=extra.bottomRightStack,last=bottomRight[bottomRight.length-1];if(node.type===Syntax.Program){if(node.body.length>0){return}}if(extra.trailingComments.length>0){if(extra.trailingComments[0].range[0]>=node.range[1]){trailingComments=extra.trailingComments;extra.trailingComments=[]}else{extra.trailingComments.length=0}}else{if(last&&last.trailingComments&&last.trailingComments[0].range[0]>=node.range[1]){trailingComments=last.trailingComments;delete last.trailingComments}}if(last){while(last&&last.range[0]>=node.range[0]){lastChild=last;last=bottomRight.pop()}}if(lastChild){if(lastChild.leadingComments&&lastChild.leadingComments[lastChild.leadingComments.length-1].range[1]<=node.range[0]){node.leadingComments=lastChild.leadingComments;delete lastChild.leadingComments}}else if(extra.leadingComments.length>0&&extra.leadingComments[extra.leadingComments.length-1].range[1]<=node.range[0]){node.leadingComments=extra.leadingComments;extra.leadingComments=[]}if(trailingComments){node.trailingComments=trailingComments}bottomRight.push(node)}function markerApply(marker,node){if(extra.range){node.range=[marker.offset,index]}if(extra.loc){node.loc={start:{line:marker.line,column:marker.col},end:{line:lineNumber,column:index-lineStart}};node=delegate.postProcess(node)}if(extra.attachComment){processComment(node)}return node}SyntaxTreeDelegate={name:"SyntaxTree",postProcess:function(node){return node},createArrayExpression:function(elements){return{type:Syntax.ArrayExpression,elements:elements}
},createAssignmentExpression:function(operator,left,right){return{type:Syntax.AssignmentExpression,operator:operator,left:left,right:right}},createBinaryExpression:function(operator,left,right){var type=operator==="||"||operator==="&&"?Syntax.LogicalExpression:Syntax.BinaryExpression;return{type:type,operator:operator,left:left,right:right}},createBlockStatement:function(body){return{type:Syntax.BlockStatement,body:body}},createBreakStatement:function(label){return{type:Syntax.BreakStatement,label:label}},createCallExpression:function(callee,args){return{type:Syntax.CallExpression,callee:callee,arguments:args}},createCatchClause:function(param,body){return{type:Syntax.CatchClause,param:param,body:body}},createConditionalExpression:function(test,consequent,alternate){return{type:Syntax.ConditionalExpression,test:test,consequent:consequent,alternate:alternate}},createContinueStatement:function(label){return{type:Syntax.ContinueStatement,label:label}},createDebuggerStatement:function(){return{type:Syntax.DebuggerStatement}},createDoWhileStatement:function(body,test){return{type:Syntax.DoWhileStatement,body:body,test:test}},createEmptyStatement:function(){return{type:Syntax.EmptyStatement}},createExpressionStatement:function(expression){return{type:Syntax.ExpressionStatement,expression:expression}},createForStatement:function(init,test,update,body){return{type:Syntax.ForStatement,init:init,test:test,update:update,body:body}},createForInStatement:function(left,right,body){return{type:Syntax.ForInStatement,left:left,right:right,body:body,each:false}},createForOfStatement:function(left,right,body){return{type:Syntax.ForOfStatement,left:left,right:right,body:body}},createFunctionDeclaration:function(id,params,defaults,body,rest,generator,expression,isAsync,returnType,typeParameters){var funDecl={type:Syntax.FunctionDeclaration,id:id,params:params,defaults:defaults,body:body,rest:rest,generator:generator,expression:expression,returnType:returnType,typeParameters:typeParameters};if(isAsync){funDecl.async=true}return funDecl},createFunctionExpression:function(id,params,defaults,body,rest,generator,expression,isAsync,returnType,typeParameters){var funExpr={type:Syntax.FunctionExpression,id:id,params:params,defaults:defaults,body:body,rest:rest,generator:generator,expression:expression,returnType:returnType,typeParameters:typeParameters};if(isAsync){funExpr.async=true}return funExpr},createIdentifier:function(name){return{type:Syntax.Identifier,name:name,typeAnnotation:undefined,optional:undefined}},createTypeAnnotation:function(typeAnnotation){return{type:Syntax.TypeAnnotation,typeAnnotation:typeAnnotation}},createFunctionTypeAnnotation:function(params,returnType,rest,typeParameters){return{type:Syntax.FunctionTypeAnnotation,params:params,returnType:returnType,rest:rest,typeParameters:typeParameters}},createFunctionTypeParam:function(name,typeAnnotation,optional){return{type:Syntax.FunctionTypeParam,name:name,typeAnnotation:typeAnnotation,optional:optional}},createNullableTypeAnnotation:function(typeAnnotation){return{type:Syntax.NullableTypeAnnotation,typeAnnotation:typeAnnotation}},createArrayTypeAnnotation:function(elementType){return{type:Syntax.ArrayTypeAnnotation,elementType:elementType}},createGenericTypeAnnotation:function(id,typeParameters){return{type:Syntax.GenericTypeAnnotation,id:id,typeParameters:typeParameters}},createQualifiedTypeIdentifier:function(qualification,id){return{type:Syntax.QualifiedTypeIdentifier,qualification:qualification,id:id}},createTypeParameterDeclaration:function(params){return{type:Syntax.TypeParameterDeclaration,params:params}},createTypeParameterInstantiation:function(params){return{type:Syntax.TypeParameterInstantiation,params:params}},createAnyTypeAnnotation:function(){return{type:Syntax.AnyTypeAnnotation}},createBooleanTypeAnnotation:function(){return{type:Syntax.BooleanTypeAnnotation}},createNumberTypeAnnotation:function(){return{type:Syntax.NumberTypeAnnotation}},createStringTypeAnnotation:function(){return{type:Syntax.StringTypeAnnotation}},createStringLiteralTypeAnnotation:function(token){return{type:Syntax.StringLiteralTypeAnnotation,value:token.value,raw:source.slice(token.range[0],token.range[1])}},createVoidTypeAnnotation:function(){return{type:Syntax.VoidTypeAnnotation}},createTypeofTypeAnnotation:function(argument){return{type:Syntax.TypeofTypeAnnotation,argument:argument}},createTupleTypeAnnotation:function(types){return{type:Syntax.TupleTypeAnnotation,types:types}},createObjectTypeAnnotation:function(properties,indexers,callProperties){return{type:Syntax.ObjectTypeAnnotation,properties:properties,indexers:indexers,callProperties:callProperties}},createObjectTypeIndexer:function(id,key,value,isStatic){return{type:Syntax.ObjectTypeIndexer,id:id,key:key,value:value,"static":isStatic}},createObjectTypeCallProperty:function(value,isStatic){return{type:Syntax.ObjectTypeCallProperty,value:value,"static":isStatic}},createObjectTypeProperty:function(key,value,optional,isStatic){return{type:Syntax.ObjectTypeProperty,key:key,value:value,optional:optional,"static":isStatic}},createUnionTypeAnnotation:function(types){return{type:Syntax.UnionTypeAnnotation,types:types}},createIntersectionTypeAnnotation:function(types){return{type:Syntax.IntersectionTypeAnnotation,types:types}},createTypeAlias:function(id,typeParameters,right){return{type:Syntax.TypeAlias,id:id,typeParameters:typeParameters,right:right}},createInterface:function(id,typeParameters,body,extended){return{type:Syntax.InterfaceDeclaration,id:id,typeParameters:typeParameters,body:body,"extends":extended}},createInterfaceExtends:function(id,typeParameters){return{type:Syntax.InterfaceExtends,id:id,typeParameters:typeParameters}},createDeclareFunction:function(id){return{type:Syntax.DeclareFunction,id:id}},createDeclareVariable:function(id){return{type:Syntax.DeclareVariable,id:id}},createDeclareModule:function(id,body){return{type:Syntax.DeclareModule,id:id,body:body}},createXJSAttribute:function(name,value){return{type:Syntax.XJSAttribute,name:name,value:value||null}},createXJSSpreadAttribute:function(argument){return{type:Syntax.XJSSpreadAttribute,argument:argument}},createXJSIdentifier:function(name){return{type:Syntax.XJSIdentifier,name:name}},createXJSNamespacedName:function(namespace,name){return{type:Syntax.XJSNamespacedName,namespace:namespace,name:name}},createXJSMemberExpression:function(object,property){return{type:Syntax.XJSMemberExpression,object:object,property:property}},createXJSElement:function(openingElement,closingElement,children){return{type:Syntax.XJSElement,openingElement:openingElement,closingElement:closingElement,children:children}},createXJSEmptyExpression:function(){return{type:Syntax.XJSEmptyExpression}},createXJSExpressionContainer:function(expression){return{type:Syntax.XJSExpressionContainer,expression:expression}},createXJSOpeningElement:function(name,attributes,selfClosing){return{type:Syntax.XJSOpeningElement,name:name,selfClosing:selfClosing,attributes:attributes}},createXJSClosingElement:function(name){return{type:Syntax.XJSClosingElement,name:name}},createIfStatement:function(test,consequent,alternate){return{type:Syntax.IfStatement,test:test,consequent:consequent,alternate:alternate}},createLabeledStatement:function(label,body){return{type:Syntax.LabeledStatement,label:label,body:body}},createLiteral:function(token){var object={type:Syntax.Literal,value:token.value,raw:source.slice(token.range[0],token.range[1])};if(token.regex){object.regex=token.regex}return object},createMemberExpression:function(accessor,object,property){return{type:Syntax.MemberExpression,computed:accessor==="[",object:object,property:property}},createNewExpression:function(callee,args){return{type:Syntax.NewExpression,callee:callee,arguments:args}},createObjectExpression:function(properties){return{type:Syntax.ObjectExpression,properties:properties}},createPostfixExpression:function(operator,argument){return{type:Syntax.UpdateExpression,operator:operator,argument:argument,prefix:false}},createProgram:function(body){return{type:Syntax.Program,body:body}},createProperty:function(kind,key,value,method,shorthand,computed){return{type:Syntax.Property,key:key,value:value,kind:kind,method:method,shorthand:shorthand,computed:computed}},createReturnStatement:function(argument){return{type:Syntax.ReturnStatement,argument:argument}},createSequenceExpression:function(expressions){return{type:Syntax.SequenceExpression,expressions:expressions}},createSwitchCase:function(test,consequent){return{type:Syntax.SwitchCase,test:test,consequent:consequent}},createSwitchStatement:function(discriminant,cases){return{type:Syntax.SwitchStatement,discriminant:discriminant,cases:cases}},createThisExpression:function(){return{type:Syntax.ThisExpression}},createThrowStatement:function(argument){return{type:Syntax.ThrowStatement,argument:argument}},createTryStatement:function(block,guardedHandlers,handlers,finalizer){return{type:Syntax.TryStatement,block:block,guardedHandlers:guardedHandlers,handlers:handlers,finalizer:finalizer}},createUnaryExpression:function(operator,argument){if(operator==="++"||operator==="--"){return{type:Syntax.UpdateExpression,operator:operator,argument:argument,prefix:true}}return{type:Syntax.UnaryExpression,operator:operator,argument:argument,prefix:true}},createVariableDeclaration:function(declarations,kind){return{type:Syntax.VariableDeclaration,declarations:declarations,kind:kind}},createVariableDeclarator:function(id,init){return{type:Syntax.VariableDeclarator,id:id,init:init}},createWhileStatement:function(test,body){return{type:Syntax.WhileStatement,test:test,body:body}},createWithStatement:function(object,body){return{type:Syntax.WithStatement,object:object,body:body}},createTemplateElement:function(value,tail){return{type:Syntax.TemplateElement,value:value,tail:tail}},createTemplateLiteral:function(quasis,expressions){return{type:Syntax.TemplateLiteral,quasis:quasis,expressions:expressions}},createSpreadElement:function(argument){return{type:Syntax.SpreadElement,argument:argument}},createSpreadProperty:function(argument){return{type:Syntax.SpreadProperty,argument:argument}},createTaggedTemplateExpression:function(tag,quasi){return{type:Syntax.TaggedTemplateExpression,tag:tag,quasi:quasi}},createArrowFunctionExpression:function(params,defaults,body,rest,expression,isAsync){var arrowExpr={type:Syntax.ArrowFunctionExpression,id:null,params:params,defaults:defaults,body:body,rest:rest,generator:false,expression:expression};if(isAsync){arrowExpr.async=true}return arrowExpr},createMethodDefinition:function(propertyType,kind,key,value){return{type:Syntax.MethodDefinition,key:key,value:value,kind:kind,"static":propertyType===ClassPropertyType.static}},createClassProperty:function(key,typeAnnotation,computed,isStatic){return{type:Syntax.ClassProperty,key:key,typeAnnotation:typeAnnotation,computed:computed,"static":isStatic}},createClassBody:function(body){return{type:Syntax.ClassBody,body:body}},createClassImplements:function(id,typeParameters){return{type:Syntax.ClassImplements,id:id,typeParameters:typeParameters}},createClassExpression:function(id,superClass,body,typeParameters,superTypeParameters,implemented){return{type:Syntax.ClassExpression,id:id,superClass:superClass,body:body,typeParameters:typeParameters,superTypeParameters:superTypeParameters,"implements":implemented}},createClassDeclaration:function(id,superClass,body,typeParameters,superTypeParameters,implemented){return{type:Syntax.ClassDeclaration,id:id,superClass:superClass,body:body,typeParameters:typeParameters,superTypeParameters:superTypeParameters,"implements":implemented}},createModuleSpecifier:function(token){return{type:Syntax.ModuleSpecifier,value:token.value,raw:source.slice(token.range[0],token.range[1])}},createExportSpecifier:function(id,name){return{type:Syntax.ExportSpecifier,id:id,name:name}},createExportBatchSpecifier:function(){return{type:Syntax.ExportBatchSpecifier}},createImportDefaultSpecifier:function(id){return{type:Syntax.ImportDefaultSpecifier,id:id}},createImportNamespaceSpecifier:function(id){return{type:Syntax.ImportNamespaceSpecifier,id:id}},createExportDeclaration:function(isDefault,declaration,specifiers,source){return{type:Syntax.ExportDeclaration,"default":!!isDefault,declaration:declaration,specifiers:specifiers,source:source}},createImportSpecifier:function(id,name){return{type:Syntax.ImportSpecifier,id:id,name:name}},createImportDeclaration:function(specifiers,source){return{type:Syntax.ImportDeclaration,specifiers:specifiers,source:source}},createYieldExpression:function(argument,delegate){return{type:Syntax.YieldExpression,argument:argument,delegate:delegate}},createAwaitExpression:function(argument){return{type:Syntax.AwaitExpression,argument:argument}},createComprehensionExpression:function(filter,blocks,body){return{type:Syntax.ComprehensionExpression,filter:filter,blocks:blocks,body:body}}};function peekLineTerminator(){var pos,line,start,found;pos=index;line=lineNumber;start=lineStart;skipComment();found=lineNumber!==line;index=pos;lineNumber=line;lineStart=start;return found}function throwError(token,messageFormat){var error,args=Array.prototype.slice.call(arguments,2),msg=messageFormat.replace(/%(\d)/g,function(whole,index){assert(index<args.length,"Message reference must be in range");return args[index]});if(typeof token.lineNumber==="number"){error=new Error("Line "+token.lineNumber+": "+msg);error.index=token.range[0];error.lineNumber=token.lineNumber;error.column=token.range[0]-lineStart+1}else{error=new Error("Line "+lineNumber+": "+msg);error.index=index;error.lineNumber=lineNumber;error.column=index-lineStart+1}error.description=msg;throw error}function throwErrorTolerant(){try{throwError.apply(null,arguments)}catch(e){if(extra.errors){extra.errors.push(e)}else{throw e}}}function throwUnexpected(token){if(token.type===Token.EOF){throwError(token,Messages.UnexpectedEOS)}if(token.type===Token.NumericLiteral){throwError(token,Messages.UnexpectedNumber)}if(token.type===Token.StringLiteral||token.type===Token.XJSText){throwError(token,Messages.UnexpectedString)}if(token.type===Token.Identifier){throwError(token,Messages.UnexpectedIdentifier)}if(token.type===Token.Keyword){if(isFutureReservedWord(token.value)){throwError(token,Messages.UnexpectedReserved)}else if(strict&&isStrictModeReservedWord(token.value)){throwErrorTolerant(token,Messages.StrictReservedWord);return}throwError(token,Messages.UnexpectedToken,token.value)}if(token.type===Token.Template){throwError(token,Messages.UnexpectedTemplate,token.value.raw)}throwError(token,Messages.UnexpectedToken,token.value)}function expect(value){var token=lex();if(token.type!==Token.Punctuator||token.value!==value){throwUnexpected(token)}}function expectKeyword(keyword,contextual){var token=lex();if(token.type!==(contextual?Token.Identifier:Token.Keyword)||token.value!==keyword){throwUnexpected(token)}}function expectContextualKeyword(keyword){return expectKeyword(keyword,true)}function match(value){return lookahead.type===Token.Punctuator&&lookahead.value===value}function matchKeyword(keyword,contextual){var expectedType=contextual?Token.Identifier:Token.Keyword;return lookahead.type===expectedType&&lookahead.value===keyword}function matchContextualKeyword(keyword){return matchKeyword(keyword,true)}function matchAssign(){var op;if(lookahead.type!==Token.Punctuator){return false}op=lookahead.value;return op==="="||op==="*="||op==="/="||op==="%="||op==="+="||op==="-="||op==="<<="||op===">>="||op===">>>="||op==="&="||op==="^="||op==="|="}function matchYield(){return state.yieldAllowed&&matchKeyword("yield",!strict)}function matchAsync(){var backtrackToken=lookahead,matches=false;if(matchContextualKeyword("async")){lex();matches=!peekLineTerminator();rewind(backtrackToken)}return matches}function matchAwait(){return state.awaitAllowed&&matchContextualKeyword("await")}function consumeSemicolon(){var line,oldIndex=index,oldLineNumber=lineNumber,oldLineStart=lineStart,oldLookahead=lookahead;if(source.charCodeAt(index)===59){lex();return}line=lineNumber;skipComment();if(lineNumber!==line){index=oldIndex;lineNumber=oldLineNumber;lineStart=oldLineStart;lookahead=oldLookahead;return}if(match(";")){lex();return}if(lookahead.type!==Token.EOF&&!match("}")){throwUnexpected(lookahead)}}function isLeftHandSide(expr){return expr.type===Syntax.Identifier||expr.type===Syntax.MemberExpression}function isAssignableLeftHandSide(expr){return isLeftHandSide(expr)||expr.type===Syntax.ObjectPattern||expr.type===Syntax.ArrayPattern}function parseArrayInitialiser(){var elements=[],blocks=[],filter=null,tmp,possiblecomprehension=true,body,marker=markerCreate();expect("[");while(!match("]")){if(lookahead.value==="for"&&lookahead.type===Token.Keyword){if(!possiblecomprehension){throwError({},Messages.ComprehensionError)}matchKeyword("for");tmp=parseForStatement({ignoreBody:true});tmp.of=tmp.type===Syntax.ForOfStatement;tmp.type=Syntax.ComprehensionBlock;if(tmp.left.kind){throwError({},Messages.ComprehensionError)}blocks.push(tmp)}else if(lookahead.value==="if"&&lookahead.type===Token.Keyword){if(!possiblecomprehension){throwError({},Messages.ComprehensionError)}expectKeyword("if");expect("(");filter=parseExpression();expect(")")}else if(lookahead.value===","&&lookahead.type===Token.Punctuator){possiblecomprehension=false;lex();elements.push(null)}else{tmp=parseSpreadOrAssignmentExpression();elements.push(tmp);if(tmp&&tmp.type===Syntax.SpreadElement){if(!match("]")){throwError({},Messages.ElementAfterSpreadElement)}}else if(!(match("]")||matchKeyword("for")||matchKeyword("if"))){expect(",");possiblecomprehension=false}}}expect("]");if(filter&&!blocks.length){throwError({},Messages.ComprehensionRequiresBlock)}if(blocks.length){if(elements.length!==1){throwError({},Messages.ComprehensionError)}return markerApply(marker,delegate.createComprehensionExpression(filter,blocks,elements[0]))}return markerApply(marker,delegate.createArrayExpression(elements))}function parsePropertyFunction(options){var previousStrict,previousYieldAllowed,previousAwaitAllowed,params,defaults,body,marker=markerCreate();previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=options.generator;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=options.async;params=options.params||[];defaults=options.defaults||[];body=parseConciseBody();if(options.name&&strict&&isRestrictedWord(params[0].name)){throwErrorTolerant(options.name,Messages.StrictParamName)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createFunctionExpression(null,params,defaults,body,options.rest||null,options.generator,body.type!==Syntax.BlockStatement,options.async,options.returnType,options.typeParameters))}function parsePropertyMethodFunction(options){var previousStrict,tmp,method;previousStrict=strict;strict=true;tmp=parseParams();if(tmp.stricted){throwErrorTolerant(tmp.stricted,tmp.message)}method=parsePropertyFunction({params:tmp.params,defaults:tmp.defaults,rest:tmp.rest,generator:options.generator,async:options.async,returnType:tmp.returnType,typeParameters:options.typeParameters});strict=previousStrict;return method}function parseObjectPropertyKey(){var marker=markerCreate(),token=lex(),propertyKey,result;if(token.type===Token.StringLiteral||token.type===Token.NumericLiteral){if(strict&&token.octal){throwErrorTolerant(token,Messages.StrictOctalLiteral)}return markerApply(marker,delegate.createLiteral(token))}if(token.type===Token.Punctuator&&token.value==="["){marker=markerCreate();propertyKey=parseAssignmentExpression();result=markerApply(marker,propertyKey);expect("]");return result}return markerApply(marker,delegate.createIdentifier(token.value))}function parseObjectProperty(){var token,key,id,value,param,expr,computed,marker=markerCreate(),returnType;token=lookahead;computed=token.value==="[";if(token.type===Token.Identifier||computed||matchAsync()){id=parseObjectPropertyKey();if(match(":")){lex();return markerApply(marker,delegate.createProperty("init",id,parseAssignmentExpression(),false,false,computed))}if(match("(")){return markerApply(marker,delegate.createProperty("init",id,parsePropertyMethodFunction({generator:false,async:false}),true,false,computed))}if(token.value==="get"){computed=lookahead.value==="[";key=parseObjectPropertyKey();expect("(");expect(")");if(match(":")){returnType=parseTypeAnnotation()}return markerApply(marker,delegate.createProperty("get",key,parsePropertyFunction({generator:false,async:false,returnType:returnType}),false,false,computed))}if(token.value==="set"){computed=lookahead.value==="[";key=parseObjectPropertyKey();expect("(");token=lookahead;param=[parseTypeAnnotatableIdentifier()];expect(")");if(match(":")){returnType=parseTypeAnnotation()}return markerApply(marker,delegate.createProperty("set",key,parsePropertyFunction({params:param,generator:false,async:false,name:token,returnType:returnType}),false,false,computed))}if(token.value==="async"){computed=lookahead.value==="[";key=parseObjectPropertyKey();return markerApply(marker,delegate.createProperty("init",key,parsePropertyMethodFunction({generator:false,async:true}),true,false,computed))}if(computed){throwUnexpected(lookahead)}return markerApply(marker,delegate.createProperty("init",id,id,false,true,false))}if(token.type===Token.EOF||token.type===Token.Punctuator){if(!match("*")){throwUnexpected(token)}lex();computed=lookahead.type===Token.Punctuator&&lookahead.value==="[";id=parseObjectPropertyKey();if(!match("(")){throwUnexpected(lex())}return markerApply(marker,delegate.createProperty("init",id,parsePropertyMethodFunction({generator:true}),true,false,computed))}key=parseObjectPropertyKey();if(match(":")){lex();return markerApply(marker,delegate.createProperty("init",key,parseAssignmentExpression(),false,false,false))}if(match("(")){return markerApply(marker,delegate.createProperty("init",key,parsePropertyMethodFunction({generator:false}),true,false,false))}throwUnexpected(lex())}function parseObjectSpreadProperty(){var marker=markerCreate();expect("...");return markerApply(marker,delegate.createSpreadProperty(parseAssignmentExpression()))}function parseObjectInitialiser(){var properties=[],property,name,key,kind,map={},toString=String,marker=markerCreate();expect("{");while(!match("}")){if(match("...")){property=parseObjectSpreadProperty()}else{property=parseObjectProperty();if(property.key.type===Syntax.Identifier){name=property.key.name}else{name=toString(property.key.value)}kind=property.kind==="init"?PropertyKind.Data:property.kind==="get"?PropertyKind.Get:PropertyKind.Set;key="$"+name;if(Object.prototype.hasOwnProperty.call(map,key)){if(map[key]===PropertyKind.Data){if(strict&&kind===PropertyKind.Data){throwErrorTolerant({},Messages.StrictDuplicateProperty)}else if(kind!==PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}}else{if(kind===PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}else if(map[key]&kind){throwErrorTolerant({},Messages.AccessorGetSet)}}map[key]|=kind}else{map[key]=kind}}properties.push(property);if(!match("}")){expect(",")}}expect("}");return markerApply(marker,delegate.createObjectExpression(properties))}function parseTemplateElement(option){var marker=markerCreate(),token=scanTemplateElement(option);if(strict&&token.octal){throwError(token,Messages.StrictOctalLiteral)}return markerApply(marker,delegate.createTemplateElement({raw:token.value.raw,cooked:token.value.cooked},token.tail))}function parseTemplateLiteral(){var quasi,quasis,expressions,marker=markerCreate();quasi=parseTemplateElement({head:true});quasis=[quasi];expressions=[];while(!quasi.tail){expressions.push(parseExpression());quasi=parseTemplateElement({head:false});quasis.push(quasi)}return markerApply(marker,delegate.createTemplateLiteral(quasis,expressions))}function parseGroupExpression(){var expr;expect("(");++state.parenthesizedCount;expr=parseExpression();expect(")");return expr}function matchAsyncFuncExprOrDecl(){var token;if(matchAsync()){token=lookahead2();if(token.type===Token.Keyword&&token.value==="function"){return true}}return false}function parsePrimaryExpression(){var marker,type,token,expr;type=lookahead.type;if(type===Token.Identifier){marker=markerCreate();return markerApply(marker,delegate.createIdentifier(lex().value))}if(type===Token.StringLiteral||type===Token.NumericLiteral){if(strict&&lookahead.octal){throwErrorTolerant(lookahead,Messages.StrictOctalLiteral)}marker=markerCreate();return markerApply(marker,delegate.createLiteral(lex()))}if(type===Token.Keyword){if(matchKeyword("this")){marker=markerCreate();lex();return markerApply(marker,delegate.createThisExpression())}if(matchKeyword("function")){return parseFunctionExpression()}if(matchKeyword("class")){return parseClassExpression()}if(matchKeyword("super")){marker=markerCreate();lex();return markerApply(marker,delegate.createIdentifier("super"))}}if(type===Token.BooleanLiteral){marker=markerCreate();token=lex();token.value=token.value==="true";return markerApply(marker,delegate.createLiteral(token))}if(type===Token.NullLiteral){marker=markerCreate();token=lex();token.value=null;return markerApply(marker,delegate.createLiteral(token))}if(match("[")){return parseArrayInitialiser()}if(match("{")){return parseObjectInitialiser()}if(match("(")){return parseGroupExpression()}if(match("/")||match("/=")){marker=markerCreate();return markerApply(marker,delegate.createLiteral(scanRegExp()))}if(type===Token.Template){return parseTemplateLiteral()}if(match("<")){return parseXJSElement()}throwUnexpected(lex())}function parseArguments(){var args=[],arg;expect("(");if(!match(")")){while(index<length){arg=parseSpreadOrAssignmentExpression();args.push(arg);if(match(")")){break}else if(arg.type===Syntax.SpreadElement){throwError({},Messages.ElementAfterSpreadElement)}expect(",")}}expect(")");return args}function parseSpreadOrAssignmentExpression(){if(match("...")){var marker=markerCreate();lex();return markerApply(marker,delegate.createSpreadElement(parseAssignmentExpression()))}return parseAssignmentExpression()}function parseNonComputedProperty(){var marker=markerCreate(),token=lex();if(!isIdentifierName(token)){throwUnexpected(token)}return markerApply(marker,delegate.createIdentifier(token.value))}function parseNonComputedMember(){expect(".");return parseNonComputedProperty()}function parseComputedMember(){var expr;expect("[");expr=parseExpression();expect("]");return expr}function parseNewExpression(){var callee,args,marker=markerCreate();expectKeyword("new");callee=parseLeftHandSideExpression();args=match("(")?parseArguments():[];return markerApply(marker,delegate.createNewExpression(callee,args))}function parseLeftHandSideExpressionAllowCall(){var expr,args,marker=markerCreate();expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")||match("(")||lookahead.type===Token.Template){if(match("(")){args=parseArguments();expr=markerApply(marker,delegate.createCallExpression(expr,args))}else if(match("[")){expr=markerApply(marker,delegate.createMemberExpression("[",expr,parseComputedMember()))}else if(match(".")){expr=markerApply(marker,delegate.createMemberExpression(".",expr,parseNonComputedMember()))}else{expr=markerApply(marker,delegate.createTaggedTemplateExpression(expr,parseTemplateLiteral()))}}return expr}function parseLeftHandSideExpression(){var expr,marker=markerCreate();expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")||lookahead.type===Token.Template){if(match("[")){expr=markerApply(marker,delegate.createMemberExpression("[",expr,parseComputedMember()))}else if(match(".")){expr=markerApply(marker,delegate.createMemberExpression(".",expr,parseNonComputedMember()))}else{expr=markerApply(marker,delegate.createTaggedTemplateExpression(expr,parseTemplateLiteral()))}}return expr}function parsePostfixExpression(){var marker=markerCreate(),expr=parseLeftHandSideExpressionAllowCall(),token;if(lookahead.type!==Token.Punctuator){return expr}if((match("++")||match("--"))&&!peekLineTerminator()){if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant({},Messages.StrictLHSPostfix)}if(!isLeftHandSide(expr)){throwError({},Messages.InvalidLHSInAssignment)}token=lex();expr=markerApply(marker,delegate.createPostfixExpression(token.value,expr))}return expr}function parseUnaryExpression(){var marker,token,expr;if(lookahead.type!==Token.Punctuator&&lookahead.type!==Token.Keyword){return parsePostfixExpression()}if(match("++")||match("--")){marker=markerCreate();token=lex();expr=parseUnaryExpression();if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant({},Messages.StrictLHSPrefix)}if(!isLeftHandSide(expr)){throwError({},Messages.InvalidLHSInAssignment)}return markerApply(marker,delegate.createUnaryExpression(token.value,expr))}if(match("+")||match("-")||match("~")||match("!")){marker=markerCreate();token=lex();expr=parseUnaryExpression();return markerApply(marker,delegate.createUnaryExpression(token.value,expr))}if(matchKeyword("delete")||matchKeyword("void")||matchKeyword("typeof")){marker=markerCreate();token=lex();expr=parseUnaryExpression();expr=markerApply(marker,delegate.createUnaryExpression(token.value,expr));if(strict&&expr.operator==="delete"&&expr.argument.type===Syntax.Identifier){throwErrorTolerant({},Messages.StrictDelete)}return expr}return parsePostfixExpression()}function binaryPrecedence(token,allowIn){var prec=0;if(token.type!==Token.Punctuator&&token.type!==Token.Keyword){return 0}switch(token.value){case"||":prec=1;break;case"&&":prec=2;break;case"|":prec=3;break;case"^":prec=4;break;case"&":prec=5;break;case"==":case"!=":case"===":case"!==":prec=6;break;case"<":case">":case"<=":case">=":case"instanceof":prec=7;break;case"in":prec=allowIn?7:0;break;case"<<":case">>":case">>>":prec=8;break;case"+":case"-":prec=9;break;case"*":case"/":case"%":prec=11;break;default:break}return prec}function parseBinaryExpression(){var expr,token,prec,previousAllowIn,stack,right,operator,left,i,marker,markers;previousAllowIn=state.allowIn;state.allowIn=true;marker=markerCreate();left=parseUnaryExpression();token=lookahead;prec=binaryPrecedence(token,previousAllowIn);if(prec===0){return left}token.prec=prec;lex();markers=[marker,markerCreate()];right=parseUnaryExpression();stack=[left,token,right];while((prec=binaryPrecedence(lookahead,previousAllowIn))>0){while(stack.length>2&&prec<=stack[stack.length-2].prec){right=stack.pop();operator=stack.pop().value;left=stack.pop();expr=delegate.createBinaryExpression(operator,left,right);markers.pop();marker=markers.pop();markerApply(marker,expr);stack.push(expr);markers.push(marker)}token=lex();token.prec=prec;stack.push(token);markers.push(markerCreate());expr=parseUnaryExpression();stack.push(expr)}state.allowIn=previousAllowIn;i=stack.length-1;expr=stack[i];markers.pop();while(i>1){expr=delegate.createBinaryExpression(stack[i-1].value,stack[i-2],expr);i-=2;marker=markers.pop();markerApply(marker,expr)}return expr}function parseConditionalExpression(){var expr,previousAllowIn,consequent,alternate,marker=markerCreate();expr=parseBinaryExpression();if(match("?")){lex();previousAllowIn=state.allowIn;state.allowIn=true;consequent=parseAssignmentExpression();state.allowIn=previousAllowIn;expect(":");alternate=parseAssignmentExpression();expr=markerApply(marker,delegate.createConditionalExpression(expr,consequent,alternate))}return expr}function reinterpretAsAssignmentBindingPattern(expr){var i,len,property,element;if(expr.type===Syntax.ObjectExpression){expr.type=Syntax.ObjectPattern;for(i=0,len=expr.properties.length;i<len;i+=1){property=expr.properties[i];if(property.type===Syntax.SpreadProperty){if(i<len-1){throwError({},Messages.PropertyAfterSpreadProperty)}reinterpretAsAssignmentBindingPattern(property.argument)
}else{if(property.kind!=="init"){throwError({},Messages.InvalidLHSInAssignment)}reinterpretAsAssignmentBindingPattern(property.value)}}}else if(expr.type===Syntax.ArrayExpression){expr.type=Syntax.ArrayPattern;for(i=0,len=expr.elements.length;i<len;i+=1){element=expr.elements[i];if(element){reinterpretAsAssignmentBindingPattern(element)}}}else if(expr.type===Syntax.Identifier){if(isRestrictedWord(expr.name)){throwError({},Messages.InvalidLHSInAssignment)}}else if(expr.type===Syntax.SpreadElement){reinterpretAsAssignmentBindingPattern(expr.argument);if(expr.argument.type===Syntax.ObjectPattern){throwError({},Messages.ObjectPatternAsSpread)}}else{if(expr.type!==Syntax.MemberExpression&&expr.type!==Syntax.CallExpression&&expr.type!==Syntax.NewExpression){throwError({},Messages.InvalidLHSInAssignment)}}}function reinterpretAsDestructuredParameter(options,expr){var i,len,property,element;if(expr.type===Syntax.ObjectExpression){expr.type=Syntax.ObjectPattern;for(i=0,len=expr.properties.length;i<len;i+=1){property=expr.properties[i];if(property.type===Syntax.SpreadProperty){if(i<len-1){throwError({},Messages.PropertyAfterSpreadProperty)}reinterpretAsDestructuredParameter(options,property.argument)}else{if(property.kind!=="init"){throwError({},Messages.InvalidLHSInFormalsList)}reinterpretAsDestructuredParameter(options,property.value)}}}else if(expr.type===Syntax.ArrayExpression){expr.type=Syntax.ArrayPattern;for(i=0,len=expr.elements.length;i<len;i+=1){element=expr.elements[i];if(element){reinterpretAsDestructuredParameter(options,element)}}}else if(expr.type===Syntax.Identifier){validateParam(options,expr,expr.name)}else{if(expr.type!==Syntax.MemberExpression){throwError({},Messages.InvalidLHSInFormalsList)}}}function reinterpretAsCoverFormalsList(expressions){var i,len,param,params,defaults,defaultCount,options,rest;params=[];defaults=[];defaultCount=0;rest=null;options={paramSet:{}};for(i=0,len=expressions.length;i<len;i+=1){param=expressions[i];if(param.type===Syntax.Identifier){params.push(param);defaults.push(null);validateParam(options,param,param.name)}else if(param.type===Syntax.ObjectExpression||param.type===Syntax.ArrayExpression){reinterpretAsDestructuredParameter(options,param);params.push(param);defaults.push(null)}else if(param.type===Syntax.SpreadElement){assert(i===len-1,"It is guaranteed that SpreadElement is last element by parseExpression");reinterpretAsDestructuredParameter(options,param.argument);rest=param.argument}else if(param.type===Syntax.AssignmentExpression){params.push(param.left);defaults.push(param.right);++defaultCount;validateParam(options,param.left,param.left.name)}else{return null}}if(options.message===Messages.StrictParamDupe){throwError(strict?options.stricted:options.firstRestricted,options.message)}if(defaultCount===0){defaults=[]}return{params:params,defaults:defaults,rest:rest,stricted:options.stricted,firstRestricted:options.firstRestricted,message:options.message}}function parseArrowFunctionExpression(options,marker){var previousStrict,previousYieldAllowed,previousAwaitAllowed,body;expect("=>");previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=false;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=!!options.async;body=parseConciseBody();if(strict&&options.firstRestricted){throwError(options.firstRestricted,options.message)}if(strict&&options.stricted){throwErrorTolerant(options.stricted,options.message)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createArrowFunctionExpression(options.params,options.defaults,body,options.rest,body.type!==Syntax.BlockStatement,!!options.async))}function parseAssignmentExpression(){var marker,expr,token,params,oldParenthesizedCount,backtrackToken=lookahead,possiblyAsync=false;if(matchYield()){return parseYieldExpression()}if(matchAwait()){return parseAwaitExpression()}oldParenthesizedCount=state.parenthesizedCount;marker=markerCreate();if(matchAsyncFuncExprOrDecl()){return parseFunctionExpression()}if(matchAsync()){possiblyAsync=true;lex()}if(match("(")){token=lookahead2();if(token.type===Token.Punctuator&&token.value===")"||token.value==="..."){params=parseParams();if(!match("=>")){throwUnexpected(lex())}params.async=possiblyAsync;return parseArrowFunctionExpression(params,marker)}}token=lookahead;if(possiblyAsync&&!match("(")&&token.type!==Token.Identifier){possiblyAsync=false;rewind(backtrackToken)}expr=parseConditionalExpression();if(match("=>")&&(state.parenthesizedCount===oldParenthesizedCount||state.parenthesizedCount===oldParenthesizedCount+1)){if(expr.type===Syntax.Identifier){params=reinterpretAsCoverFormalsList([expr])}else if(expr.type===Syntax.SequenceExpression){params=reinterpretAsCoverFormalsList(expr.expressions)}if(params){params.async=possiblyAsync;return parseArrowFunctionExpression(params,marker)}}if(possiblyAsync){possiblyAsync=false;rewind(backtrackToken);expr=parseConditionalExpression()}if(matchAssign()){if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant(token,Messages.StrictLHSAssignment)}if(match("=")&&(expr.type===Syntax.ObjectExpression||expr.type===Syntax.ArrayExpression)){reinterpretAsAssignmentBindingPattern(expr)}else if(!isLeftHandSide(expr)){throwError({},Messages.InvalidLHSInAssignment)}expr=markerApply(marker,delegate.createAssignmentExpression(lex().value,expr,parseAssignmentExpression()))}return expr}function parseExpression(){var marker,expr,expressions,sequence,coverFormalsList,spreadFound,oldParenthesizedCount;oldParenthesizedCount=state.parenthesizedCount;marker=markerCreate();expr=parseAssignmentExpression();expressions=[expr];if(match(",")){while(index<length){if(!match(",")){break}lex();expr=parseSpreadOrAssignmentExpression();expressions.push(expr);if(expr.type===Syntax.SpreadElement){spreadFound=true;if(!match(")")){throwError({},Messages.ElementAfterSpreadElement)}break}}sequence=markerApply(marker,delegate.createSequenceExpression(expressions))}if(match("=>")){if(state.parenthesizedCount===oldParenthesizedCount||state.parenthesizedCount===oldParenthesizedCount+1){expr=expr.type===Syntax.SequenceExpression?expr.expressions:expressions;coverFormalsList=reinterpretAsCoverFormalsList(expr);if(coverFormalsList){return parseArrowFunctionExpression(coverFormalsList,marker)}}throwUnexpected(lex())}if(spreadFound&&lookahead2().value!=="=>"){throwError({},Messages.IllegalSpread)}return sequence||expr}function parseStatementList(){var list=[],statement;while(index<length){if(match("}")){break}statement=parseSourceElement();if(typeof statement==="undefined"){break}list.push(statement)}return list}function parseBlock(){var block,marker=markerCreate();expect("{");block=parseStatementList();expect("}");return markerApply(marker,delegate.createBlockStatement(block))}function parseTypeParameterDeclaration(){var marker=markerCreate(),paramTypes=[];expect("<");while(!match(">")){paramTypes.push(parseVariableIdentifier());if(!match(">")){expect(",")}}expect(">");return markerApply(marker,delegate.createTypeParameterDeclaration(paramTypes))}function parseTypeParameterInstantiation(){var marker=markerCreate(),oldInType=state.inType,paramTypes=[];state.inType=true;expect("<");while(!match(">")){paramTypes.push(parseType());if(!match(">")){expect(",")}}expect(">");state.inType=oldInType;return markerApply(marker,delegate.createTypeParameterInstantiation(paramTypes))}function parseObjectTypeIndexer(marker,isStatic){var id,key,value;expect("[");id=parseObjectPropertyKey();expect(":");key=parseType();expect("]");expect(":");value=parseType();return markerApply(marker,delegate.createObjectTypeIndexer(id,key,value,isStatic))}function parseObjectTypeMethodish(marker){var params=[],rest=null,returnType,typeParameters=null;if(match("<")){typeParameters=parseTypeParameterDeclaration()}expect("(");while(lookahead.type===Token.Identifier){params.push(parseFunctionTypeParam());if(!match(")")){expect(",")}}if(match("...")){lex();rest=parseFunctionTypeParam()}expect(")");expect(":");returnType=parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters))}function parseObjectTypeMethod(marker,isStatic,key){var optional=false,value;value=parseObjectTypeMethodish(marker);return markerApply(marker,delegate.createObjectTypeProperty(key,value,optional,isStatic))}function parseObjectTypeCallProperty(marker,isStatic){var valueMarker=markerCreate();return markerApply(marker,delegate.createObjectTypeCallProperty(parseObjectTypeMethodish(valueMarker),isStatic))}function parseObjectType(allowStatic){var callProperties=[],indexers=[],marker,optional=false,properties=[],property,propertyKey,propertyTypeAnnotation,token,isStatic;expect("{");while(!match("}")){marker=markerCreate();if(allowStatic&&matchContextualKeyword("static")){token=lex();isStatic=true}if(match("[")){indexers.push(parseObjectTypeIndexer(marker,isStatic))}else if(match("(")||match("<")){callProperties.push(parseObjectTypeCallProperty(marker,allowStatic))}else{if(isStatic&&match(":")){propertyKey=markerApply(marker,delegate.createIdentifier(token));throwErrorTolerant(token,Messages.StrictReservedWord)}else{propertyKey=parseObjectPropertyKey()}if(match("<")||match("(")){properties.push(parseObjectTypeMethod(marker,isStatic,propertyKey))}else{if(match("?")){lex();optional=true}expect(":");propertyTypeAnnotation=parseType();properties.push(markerApply(marker,delegate.createObjectTypeProperty(propertyKey,propertyTypeAnnotation,optional,isStatic)))}}if(match(";")){lex()}else if(!match("}")){throwUnexpected(lookahead)}}expect("}");return delegate.createObjectTypeAnnotation(properties,indexers,callProperties)}function parseGenericType(){var marker=markerCreate(),returnType=null,typeParameters=null,typeIdentifier,typeIdentifierMarker=markerCreate;typeIdentifier=parseVariableIdentifier();while(match(".")){expect(".");typeIdentifier=markerApply(marker,delegate.createQualifiedTypeIdentifier(typeIdentifier,parseVariableIdentifier()))}if(match("<")){typeParameters=parseTypeParameterInstantiation()}return markerApply(marker,delegate.createGenericTypeAnnotation(typeIdentifier,typeParameters))}function parseVoidType(){var marker=markerCreate();expectKeyword("void");return markerApply(marker,delegate.createVoidTypeAnnotation())}function parseTypeofType(){var argument,marker=markerCreate();expectKeyword("typeof");argument=parsePrimaryType();return markerApply(marker,delegate.createTypeofTypeAnnotation(argument))}function parseTupleType(){var marker=markerCreate(),types=[];expect("[");while(index<length&&!match("]")){types.push(parseType());if(match("]")){break}expect(",")}expect("]");return markerApply(marker,delegate.createTupleTypeAnnotation(types))}function parseFunctionTypeParam(){var marker=markerCreate(),name,optional=false,typeAnnotation;name=parseVariableIdentifier();if(match("?")){lex();optional=true}expect(":");typeAnnotation=parseType();return markerApply(marker,delegate.createFunctionTypeParam(name,typeAnnotation,optional))}function parseFunctionTypeParams(){var ret={params:[],rest:null};while(lookahead.type===Token.Identifier){ret.params.push(parseFunctionTypeParam());if(!match(")")){expect(",")}}if(match("...")){lex();ret.rest=parseFunctionTypeParam()}return ret}function parsePrimaryType(){var typeIdentifier=null,params=null,returnType=null,marker=markerCreate(),rest=null,tmp,typeParameters,token,type,isGroupedType=false;switch(lookahead.type){case Token.Identifier:switch(lookahead.value){case"any":lex();return markerApply(marker,delegate.createAnyTypeAnnotation());case"bool":case"boolean":lex();return markerApply(marker,delegate.createBooleanTypeAnnotation());case"number":lex();return markerApply(marker,delegate.createNumberTypeAnnotation());case"string":lex();return markerApply(marker,delegate.createStringTypeAnnotation())}return markerApply(marker,parseGenericType());case Token.Punctuator:switch(lookahead.value){case"{":return markerApply(marker,parseObjectType());case"[":return parseTupleType();case"<":typeParameters=parseTypeParameterDeclaration();expect("(");tmp=parseFunctionTypeParams();params=tmp.params;rest=tmp.rest;expect(")");expect("=>");returnType=parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));case"(":lex();if(!match(")")&&!match("...")){if(lookahead.type===Token.Identifier){token=lookahead2();isGroupedType=token.value!=="?"&&token.value!==":"}else{isGroupedType=true}}if(isGroupedType){type=parseType();expect(")");if(match("=>")){throwError({},Messages.ConfusedAboutFunctionType)}return type}tmp=parseFunctionTypeParams();params=tmp.params;rest=tmp.rest;expect(")");expect("=>");returnType=parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,null))}break;case Token.Keyword:switch(lookahead.value){case"void":return markerApply(marker,parseVoidType());case"typeof":return markerApply(marker,parseTypeofType())}break;case Token.StringLiteral:token=lex();if(token.octal){throwError(token,Messages.StrictOctalLiteral)}return markerApply(marker,delegate.createStringLiteralTypeAnnotation(token))}throwUnexpected(lookahead)}function parsePostfixType(){var marker=markerCreate(),t=parsePrimaryType();if(match("[")){expect("[");expect("]");return markerApply(marker,delegate.createArrayTypeAnnotation(t))}return t}function parsePrefixType(){var marker=markerCreate();if(match("?")){lex();return markerApply(marker,delegate.createNullableTypeAnnotation(parsePrefixType()))}return parsePostfixType()}function parseIntersectionType(){var marker=markerCreate(),type,types;type=parsePrefixType();types=[type];while(match("&")){lex();types.push(parsePrefixType())}return types.length===1?type:markerApply(marker,delegate.createIntersectionTypeAnnotation(types))}function parseUnionType(){var marker=markerCreate(),type,types;type=parseIntersectionType();types=[type];while(match("|")){lex();types.push(parseIntersectionType())}return types.length===1?type:markerApply(marker,delegate.createUnionTypeAnnotation(types))}function parseType(){var oldInType=state.inType,type;state.inType=true;type=parseUnionType();state.inType=oldInType;return type}function parseTypeAnnotation(){var marker=markerCreate(),type;expect(":");type=parseType();return markerApply(marker,delegate.createTypeAnnotation(type))}function parseVariableIdentifier(){var marker=markerCreate(),token=lex();if(token.type!==Token.Identifier){throwUnexpected(token)}return markerApply(marker,delegate.createIdentifier(token.value))}function parseTypeAnnotatableIdentifier(requireTypeAnnotation,canBeOptionalParam){var marker=markerCreate(),ident=parseVariableIdentifier(),isOptionalParam=false;if(canBeOptionalParam&&match("?")){expect("?");isOptionalParam=true}if(requireTypeAnnotation||match(":")){ident.typeAnnotation=parseTypeAnnotation();ident=markerApply(marker,ident)}if(isOptionalParam){ident.optional=true;ident=markerApply(marker,ident)}return ident}function parseVariableDeclaration(kind){var id,marker=markerCreate(),init=null,typeAnnotationMarker=markerCreate();if(match("{")){id=parseObjectInitialiser();reinterpretAsAssignmentBindingPattern(id);if(match(":")){id.typeAnnotation=parseTypeAnnotation();markerApply(typeAnnotationMarker,id)}}else if(match("[")){id=parseArrayInitialiser();reinterpretAsAssignmentBindingPattern(id);if(match(":")){id.typeAnnotation=parseTypeAnnotation();markerApply(typeAnnotationMarker,id)}}else{id=state.allowKeyword?parseNonComputedProperty():parseTypeAnnotatableIdentifier();if(strict&&isRestrictedWord(id.name)){throwErrorTolerant({},Messages.StrictVarName)}}if(kind==="const"){if(!match("=")){throwError({},Messages.NoUnintializedConst)}expect("=");init=parseAssignmentExpression()}else if(match("=")){lex();init=parseAssignmentExpression()}return markerApply(marker,delegate.createVariableDeclarator(id,init))}function parseVariableDeclarationList(kind){var list=[];do{list.push(parseVariableDeclaration(kind));if(!match(",")){break}lex()}while(index<length);return list}function parseVariableStatement(){var declarations,marker=markerCreate();expectKeyword("var");declarations=parseVariableDeclarationList();consumeSemicolon();return markerApply(marker,delegate.createVariableDeclaration(declarations,"var"))}function parseConstLetDeclaration(kind){var declarations,marker=markerCreate();expectKeyword(kind);declarations=parseVariableDeclarationList(kind);consumeSemicolon();return markerApply(marker,delegate.createVariableDeclaration(declarations,kind))}function parseModuleSpecifier(){var marker=markerCreate(),specifier;if(lookahead.type!==Token.StringLiteral){throwError({},Messages.InvalidModuleSpecifier)}specifier=delegate.createModuleSpecifier(lookahead);lex();return markerApply(marker,specifier)}function parseExportBatchSpecifier(){var marker=markerCreate();expect("*");return markerApply(marker,delegate.createExportBatchSpecifier())}function parseExportSpecifier(){var id,name=null,marker=markerCreate(),from;if(matchKeyword("default")){lex();id=markerApply(marker,delegate.createIdentifier("default"))}else{id=parseVariableIdentifier()}if(matchContextualKeyword("as")){lex();name=parseNonComputedProperty()}return markerApply(marker,delegate.createExportSpecifier(id,name))}function parseExportDeclaration(){var backtrackToken,id,previousAllowKeyword,declaration=null,isExportFromIdentifier,src=null,specifiers=[],marker=markerCreate();expectKeyword("export");if(matchKeyword("default")){lex();if(matchKeyword("function")||matchKeyword("class")){backtrackToken=lookahead;lex();if(isIdentifierName(lookahead)){id=parseNonComputedProperty();rewind(backtrackToken);return markerApply(marker,delegate.createExportDeclaration(true,parseSourceElement(),[id],null))}rewind(backtrackToken);switch(lookahead.value){case"class":return markerApply(marker,delegate.createExportDeclaration(true,parseClassExpression(),[],null));case"function":return markerApply(marker,delegate.createExportDeclaration(true,parseFunctionExpression(),[],null))}}if(matchContextualKeyword("from")){throwError({},Messages.UnexpectedToken,lookahead.value)}if(match("{")){declaration=parseObjectInitialiser()}else if(match("[")){declaration=parseArrayInitialiser()}else{declaration=parseAssignmentExpression()}consumeSemicolon();return markerApply(marker,delegate.createExportDeclaration(true,declaration,[],null))}if(lookahead.type===Token.Keyword){switch(lookahead.value){case"let":case"const":case"var":case"class":case"function":return markerApply(marker,delegate.createExportDeclaration(false,parseSourceElement(),specifiers,null))}}if(match("*")){specifiers.push(parseExportBatchSpecifier());if(!matchContextualKeyword("from")){throwError({},lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value)}lex();src=parseModuleSpecifier();consumeSemicolon();return markerApply(marker,delegate.createExportDeclaration(false,null,specifiers,src))}expect("{");do{isExportFromIdentifier=isExportFromIdentifier||matchKeyword("default");specifiers.push(parseExportSpecifier())}while(match(",")&&lex());expect("}");if(matchContextualKeyword("from")){lex();src=parseModuleSpecifier();consumeSemicolon()}else if(isExportFromIdentifier){throwError({},lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value)}else{consumeSemicolon()}return markerApply(marker,delegate.createExportDeclaration(false,declaration,specifiers,src))}function parseImportSpecifier(){var id,name=null,marker=markerCreate();id=parseNonComputedProperty();if(matchContextualKeyword("as")){lex();name=parseVariableIdentifier()}return markerApply(marker,delegate.createImportSpecifier(id,name))}function parseNamedImports(){var specifiers=[];expect("{");do{specifiers.push(parseImportSpecifier())}while(match(",")&&lex());expect("}");return specifiers}function parseImportDefaultSpecifier(){var id,marker=markerCreate();id=parseNonComputedProperty();return markerApply(marker,delegate.createImportDefaultSpecifier(id))}function parseImportNamespaceSpecifier(){var id,marker=markerCreate();expect("*");if(!matchContextualKeyword("as")){throwError({},Messages.NoAsAfterImportNamespace)}lex();id=parseNonComputedProperty();return markerApply(marker,delegate.createImportNamespaceSpecifier(id))}function parseImportDeclaration(){var specifiers,src,marker=markerCreate();expectKeyword("import");specifiers=[];if(lookahead.type===Token.StringLiteral){src=parseModuleSpecifier();consumeSemicolon();return markerApply(marker,delegate.createImportDeclaration(specifiers,src))}if(!matchKeyword("default")&&isIdentifierName(lookahead)){specifiers.push(parseImportDefaultSpecifier());if(match(",")){lex()}}if(match("*")){specifiers.push(parseImportNamespaceSpecifier())}else if(match("{")){specifiers=specifiers.concat(parseNamedImports())}if(!matchContextualKeyword("from")){throwError({},lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value)}lex();src=parseModuleSpecifier();consumeSemicolon();return markerApply(marker,delegate.createImportDeclaration(specifiers,src))}function parseEmptyStatement(){var marker=markerCreate();expect(";");return markerApply(marker,delegate.createEmptyStatement())}function parseExpressionStatement(){var marker=markerCreate(),expr=parseExpression();consumeSemicolon();return markerApply(marker,delegate.createExpressionStatement(expr))}function parseIfStatement(){var test,consequent,alternate,marker=markerCreate();expectKeyword("if");expect("(");test=parseExpression();expect(")");consequent=parseStatement();if(matchKeyword("else")){lex();alternate=parseStatement()}else{alternate=null}return markerApply(marker,delegate.createIfStatement(test,consequent,alternate))}function parseDoWhileStatement(){var body,test,oldInIteration,marker=markerCreate();expectKeyword("do");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;expectKeyword("while");expect("(");test=parseExpression();expect(")");if(match(";")){lex()}return markerApply(marker,delegate.createDoWhileStatement(body,test))}function parseWhileStatement(){var test,body,oldInIteration,marker=markerCreate();expectKeyword("while");expect("(");test=parseExpression();expect(")");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;return markerApply(marker,delegate.createWhileStatement(test,body))}function parseForVariableDeclaration(){var marker=markerCreate(),token=lex(),declarations=parseVariableDeclarationList();return markerApply(marker,delegate.createVariableDeclaration(declarations,token.value))}function parseForStatement(opts){var init,test,update,left,right,body,operator,oldInIteration,marker=markerCreate();init=test=update=null;expectKeyword("for");if(matchContextualKeyword("each")){throwError({},Messages.EachNotAllowed)}expect("(");if(match(";")){lex()}else{if(matchKeyword("var")||matchKeyword("let")||matchKeyword("const")){state.allowIn=false;init=parseForVariableDeclaration();state.allowIn=true;if(init.declarations.length===1){if(matchKeyword("in")||matchContextualKeyword("of")){operator=lookahead;if(!((operator.value==="in"||init.kind!=="var")&&init.declarations[0].init)){lex();left=init;right=parseExpression();init=null}}}}else{state.allowIn=false;init=parseExpression();state.allowIn=true;if(matchContextualKeyword("of")){operator=lex();left=init;right=parseExpression();init=null}else if(matchKeyword("in")){if(!isAssignableLeftHandSide(init)){throwError({},Messages.InvalidLHSInForIn)}operator=lex();left=init;right=parseExpression();init=null}}if(typeof left==="undefined"){expect(";")}}if(typeof left==="undefined"){if(!match(";")){test=parseExpression()}expect(";");if(!match(")")){update=parseExpression()}}expect(")");oldInIteration=state.inIteration;state.inIteration=true;if(!(opts!==undefined&&opts.ignoreBody)){body=parseStatement()}state.inIteration=oldInIteration;if(typeof left==="undefined"){return markerApply(marker,delegate.createForStatement(init,test,update,body))}if(operator.value==="in"){return markerApply(marker,delegate.createForInStatement(left,right,body))}return markerApply(marker,delegate.createForOfStatement(left,right,body))}function parseContinueStatement(){var label=null,key,marker=markerCreate();expectKeyword("continue");if(source.charCodeAt(index)===59){lex();if(!state.inIteration){throwError({},Messages.IllegalContinue)}return markerApply(marker,delegate.createContinueStatement(null))}if(peekLineTerminator()){if(!state.inIteration){throwError({},Messages.IllegalContinue)}return markerApply(marker,delegate.createContinueStatement(null))}if(lookahead.type===Token.Identifier){label=parseVariableIdentifier();key="$"+label.name;if(!Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError({},Messages.UnknownLabel,label.name)}}consumeSemicolon();if(label===null&&!state.inIteration){throwError({},Messages.IllegalContinue)}return markerApply(marker,delegate.createContinueStatement(label))}function parseBreakStatement(){var label=null,key,marker=markerCreate();expectKeyword("break");if(source.charCodeAt(index)===59){lex();if(!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return markerApply(marker,delegate.createBreakStatement(null))}if(peekLineTerminator()){if(!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return markerApply(marker,delegate.createBreakStatement(null))}if(lookahead.type===Token.Identifier){label=parseVariableIdentifier();key="$"+label.name;if(!Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError({},Messages.UnknownLabel,label.name)}}consumeSemicolon();if(label===null&&!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return markerApply(marker,delegate.createBreakStatement(label))}function parseReturnStatement(){var argument=null,marker=markerCreate();expectKeyword("return");if(!state.inFunctionBody){throwErrorTolerant({},Messages.IllegalReturn)}if(source.charCodeAt(index)===32){if(isIdentifierStart(source.charCodeAt(index+1))){argument=parseExpression();consumeSemicolon();return markerApply(marker,delegate.createReturnStatement(argument))}}if(peekLineTerminator()){return markerApply(marker,delegate.createReturnStatement(null))}if(!match(";")){if(!match("}")&&lookahead.type!==Token.EOF){argument=parseExpression()}}consumeSemicolon();return markerApply(marker,delegate.createReturnStatement(argument))}function parseWithStatement(){var object,body,marker=markerCreate();if(strict){throwErrorTolerant({},Messages.StrictModeWith)}expectKeyword("with");expect("(");object=parseExpression();expect(")");body=parseStatement();return markerApply(marker,delegate.createWithStatement(object,body))}function parseSwitchCase(){var test,consequent=[],sourceElement,marker=markerCreate();if(matchKeyword("default")){lex();test=null}else{expectKeyword("case");test=parseExpression()}expect(":");while(index<length){if(match("}")||matchKeyword("default")||matchKeyword("case")){break}sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break}consequent.push(sourceElement)}return markerApply(marker,delegate.createSwitchCase(test,consequent))}function parseSwitchStatement(){var discriminant,cases,clause,oldInSwitch,defaultFound,marker=markerCreate();expectKeyword("switch");expect("(");discriminant=parseExpression();expect(")");expect("{");cases=[];if(match("}")){lex();return markerApply(marker,delegate.createSwitchStatement(discriminant,cases))}oldInSwitch=state.inSwitch;state.inSwitch=true;defaultFound=false;while(index<length){if(match("}")){break}clause=parseSwitchCase();if(clause.test===null){if(defaultFound){throwError({},Messages.MultipleDefaultsInSwitch)}defaultFound=true}cases.push(clause)}state.inSwitch=oldInSwitch;expect("}");return markerApply(marker,delegate.createSwitchStatement(discriminant,cases))}function parseThrowStatement(){var argument,marker=markerCreate();expectKeyword("throw");if(peekLineTerminator()){throwError({},Messages.NewlineAfterThrow)}argument=parseExpression();consumeSemicolon();return markerApply(marker,delegate.createThrowStatement(argument))}function parseCatchClause(){var param,body,marker=markerCreate();expectKeyword("catch");expect("(");if(match(")")){throwUnexpected(lookahead)}param=parseExpression();if(strict&¶m.type===Syntax.Identifier&&isRestrictedWord(param.name)){throwErrorTolerant({},Messages.StrictCatchVariable)}expect(")");body=parseBlock();return markerApply(marker,delegate.createCatchClause(param,body))}function parseTryStatement(){var block,handlers=[],finalizer=null,marker=markerCreate();expectKeyword("try");block=parseBlock();if(matchKeyword("catch")){handlers.push(parseCatchClause())}if(matchKeyword("finally")){lex();finalizer=parseBlock()}if(handlers.length===0&&!finalizer){throwError({},Messages.NoCatchOrFinally)}return markerApply(marker,delegate.createTryStatement(block,[],handlers,finalizer))}function parseDebuggerStatement(){var marker=markerCreate();expectKeyword("debugger");consumeSemicolon();return markerApply(marker,delegate.createDebuggerStatement())}function parseStatement(){var type=lookahead.type,marker,expr,labeledBody,key;if(type===Token.EOF){throwUnexpected(lookahead)}if(type===Token.Punctuator){switch(lookahead.value){case";":return parseEmptyStatement();case"{":return parseBlock();case"(":return parseExpressionStatement();default:break}}if(type===Token.Keyword){switch(lookahead.value){case"break":return parseBreakStatement();case"continue":return parseContinueStatement();case"debugger":return parseDebuggerStatement();case"do":return parseDoWhileStatement();case"for":return parseForStatement();case"function":return parseFunctionDeclaration();case"class":return parseClassDeclaration();case"if":return parseIfStatement();case"return":return parseReturnStatement();case"switch":return parseSwitchStatement();case"throw":return parseThrowStatement();case"try":return parseTryStatement();case"var":return parseVariableStatement();case"while":return parseWhileStatement();case"with":return parseWithStatement();default:break}}if(matchAsyncFuncExprOrDecl()){return parseFunctionDeclaration()}marker=markerCreate();expr=parseExpression();if(expr.type===Syntax.Identifier&&match(":")){lex();key="$"+expr.name;if(Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError({},Messages.Redeclaration,"Label",expr.name)}state.labelSet[key]=true;labeledBody=parseStatement();delete state.labelSet[key];return markerApply(marker,delegate.createLabeledStatement(expr,labeledBody))}consumeSemicolon();return markerApply(marker,delegate.createExpressionStatement(expr))}function parseConciseBody(){if(match("{")){return parseFunctionSourceElements()}return parseAssignmentExpression()}function parseFunctionSourceElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted,oldLabelSet,oldInIteration,oldInSwitch,oldInFunctionBody,oldParenthesizedCount,marker=markerCreate();expect("{");while(index<length){if(lookahead.type!==Token.StringLiteral){break}token=lookahead;sourceElement=parseSourceElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=source.slice(token.range[0]+1,token.range[1]-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}oldLabelSet=state.labelSet;oldInIteration=state.inIteration;oldInSwitch=state.inSwitch;oldInFunctionBody=state.inFunctionBody;oldParenthesizedCount=state.parenthesizedCount;state.labelSet={};state.inIteration=false;state.inSwitch=false;state.inFunctionBody=true;state.parenthesizedCount=0;while(index<length){if(match("}")){break}sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break}sourceElements.push(sourceElement)}expect("}");state.labelSet=oldLabelSet;state.inIteration=oldInIteration;state.inSwitch=oldInSwitch;
state.inFunctionBody=oldInFunctionBody;state.parenthesizedCount=oldParenthesizedCount;return markerApply(marker,delegate.createBlockStatement(sourceElements))}function validateParam(options,param,name){var key="$"+name;if(strict){if(isRestrictedWord(name)){options.stricted=param;options.message=Messages.StrictParamName}if(Object.prototype.hasOwnProperty.call(options.paramSet,key)){options.stricted=param;options.message=Messages.StrictParamDupe}}else if(!options.firstRestricted){if(isRestrictedWord(name)){options.firstRestricted=param;options.message=Messages.StrictParamName}else if(isStrictModeReservedWord(name)){options.firstRestricted=param;options.message=Messages.StrictReservedWord}else if(Object.prototype.hasOwnProperty.call(options.paramSet,key)){options.firstRestricted=param;options.message=Messages.StrictParamDupe}}options.paramSet[key]=true}function parseParam(options){var marker,token,rest,param,def;token=lookahead;if(token.value==="..."){token=lex();rest=true}if(match("[")){marker=markerCreate();param=parseArrayInitialiser();reinterpretAsDestructuredParameter(options,param);if(match(":")){param.typeAnnotation=parseTypeAnnotation();markerApply(marker,param)}}else if(match("{")){marker=markerCreate();if(rest){throwError({},Messages.ObjectPatternAsRestParameter)}param=parseObjectInitialiser();reinterpretAsDestructuredParameter(options,param);if(match(":")){param.typeAnnotation=parseTypeAnnotation();markerApply(marker,param)}}else{param=rest?parseTypeAnnotatableIdentifier(false,false):parseTypeAnnotatableIdentifier(false,true);validateParam(options,token,token.value)}if(match("=")){if(rest){throwErrorTolerant(lookahead,Messages.DefaultRestParameter)}lex();def=parseAssignmentExpression();++options.defaultCount}if(rest){if(!match(")")){throwError({},Messages.ParameterAfterRestParameter)}options.rest=param;return false}options.params.push(param);options.defaults.push(def);return!match(")")}function parseParams(firstRestricted){var options,marker=markerCreate();options={params:[],defaultCount:0,defaults:[],rest:null,firstRestricted:firstRestricted};expect("(");if(!match(")")){options.paramSet={};while(index<length){if(!parseParam(options)){break}expect(",")}}expect(")");if(options.defaultCount===0){options.defaults=[]}if(match(":")){options.returnType=parseTypeAnnotation()}return markerApply(marker,options)}function parseFunctionDeclaration(){var id,body,token,tmp,firstRestricted,message,generator,isAsync,previousStrict,previousYieldAllowed,previousAwaitAllowed,marker=markerCreate(),typeParameters;isAsync=false;if(matchAsync()){lex();isAsync=true}expectKeyword("function");generator=false;if(match("*")){lex();generator=true}token=lookahead;id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(strict){if(isRestrictedWord(token.value)){throwErrorTolerant(token,Messages.StrictFunctionName)}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}}tmp=parseParams(firstRestricted);firstRestricted=tmp.firstRestricted;if(tmp.message){message=tmp.message}previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=generator;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=isAsync;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwError(firstRestricted,message)}if(strict&&tmp.stricted){throwErrorTolerant(tmp.stricted,message)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createFunctionDeclaration(id,tmp.params,tmp.defaults,body,tmp.rest,generator,false,isAsync,tmp.returnType,typeParameters))}function parseFunctionExpression(){var token,id=null,firstRestricted,message,tmp,body,generator,isAsync,previousStrict,previousYieldAllowed,previousAwaitAllowed,marker=markerCreate(),typeParameters;isAsync=false;if(matchAsync()){lex();isAsync=true}expectKeyword("function");generator=false;if(match("*")){lex();generator=true}if(!match("(")){if(!match("<")){token=lookahead;id=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){throwErrorTolerant(token,Messages.StrictFunctionName)}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}}}if(match("<")){typeParameters=parseTypeParameterDeclaration()}}tmp=parseParams(firstRestricted);firstRestricted=tmp.firstRestricted;if(tmp.message){message=tmp.message}previousStrict=strict;previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=generator;previousAwaitAllowed=state.awaitAllowed;state.awaitAllowed=isAsync;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwError(firstRestricted,message)}if(strict&&tmp.stricted){throwErrorTolerant(tmp.stricted,message)}strict=previousStrict;state.yieldAllowed=previousYieldAllowed;state.awaitAllowed=previousAwaitAllowed;return markerApply(marker,delegate.createFunctionExpression(id,tmp.params,tmp.defaults,body,tmp.rest,generator,false,isAsync,tmp.returnType,typeParameters))}function parseYieldExpression(){var delegateFlag,expr,marker=markerCreate();expectKeyword("yield",!strict);delegateFlag=false;if(match("*")){lex();delegateFlag=true}expr=parseAssignmentExpression();return markerApply(marker,delegate.createYieldExpression(expr,delegateFlag))}function parseAwaitExpression(){var expr,marker=markerCreate();expectContextualKeyword("await");expr=parseAssignmentExpression();return markerApply(marker,delegate.createAwaitExpression(expr))}function parseMethodDefinition(existingPropNames,key,isStatic,generator,computed){var token,param,propType,isValidDuplicateProp=false,isAsync,typeParameters,tokenValue,returnType,annotationMarker;propType=isStatic?ClassPropertyType.static:ClassPropertyType.prototype;if(generator){return delegate.createMethodDefinition(propType,"",key,parsePropertyMethodFunction({generator:true}))}tokenValue=key.type==="Identifier"&&key.name;if(tokenValue==="get"&&!match("(")){key=parseObjectPropertyKey();if(existingPropNames[propType].hasOwnProperty(key.name)){isValidDuplicateProp=existingPropNames[propType][key.name].get===undefined&&existingPropNames[propType][key.name].data===undefined&&existingPropNames[propType][key.name].set!==undefined;if(!isValidDuplicateProp){throwError(key,Messages.IllegalDuplicateClassProperty)}}else{existingPropNames[propType][key.name]={}}existingPropNames[propType][key.name].get=true;expect("(");expect(")");if(match(":")){returnType=parseTypeAnnotation()}return delegate.createMethodDefinition(propType,"get",key,parsePropertyFunction({generator:false,returnType:returnType}))}if(tokenValue==="set"&&!match("(")){key=parseObjectPropertyKey();if(existingPropNames[propType].hasOwnProperty(key.name)){isValidDuplicateProp=existingPropNames[propType][key.name].set===undefined&&existingPropNames[propType][key.name].data===undefined&&existingPropNames[propType][key.name].get!==undefined;if(!isValidDuplicateProp){throwError(key,Messages.IllegalDuplicateClassProperty)}}else{existingPropNames[propType][key.name]={}}existingPropNames[propType][key.name].set=true;expect("(");token=lookahead;param=[parseTypeAnnotatableIdentifier()];expect(")");if(match(":")){returnType=parseTypeAnnotation()}return delegate.createMethodDefinition(propType,"set",key,parsePropertyFunction({params:param,generator:false,name:token,returnType:returnType}))}if(match("<")){typeParameters=parseTypeParameterDeclaration()}isAsync=tokenValue==="async"&&!match("(");if(isAsync){key=parseObjectPropertyKey()}if(existingPropNames[propType].hasOwnProperty(key.name)){throwError(key,Messages.IllegalDuplicateClassProperty)}else{existingPropNames[propType][key.name]={}}existingPropNames[propType][key.name].data=true;return delegate.createMethodDefinition(propType,"",key,parsePropertyMethodFunction({generator:false,async:isAsync,typeParameters:typeParameters}))}function parseClassProperty(existingPropNames,key,computed,isStatic){var typeAnnotation;typeAnnotation=parseTypeAnnotation();expect(";");return delegate.createClassProperty(key,typeAnnotation,computed,isStatic)}function parseClassElement(existingProps){var computed,generator=false,key,marker=markerCreate(),isStatic=false;if(match(";")){lex();return}if(lookahead.value==="static"){lex();isStatic=true}if(match("*")){lex();generator=true}computed=lookahead.value==="[";key=parseObjectPropertyKey();if(!generator&&lookahead.value===":"){return markerApply(marker,parseClassProperty(existingProps,key,computed,isStatic))}return markerApply(marker,parseMethodDefinition(existingProps,key,isStatic,generator,computed))}function parseClassBody(){var classElement,classElements=[],existingProps={},marker=markerCreate();existingProps[ClassPropertyType.static]={};existingProps[ClassPropertyType.prototype]={};expect("{");while(index<length){if(match("}")){break}classElement=parseClassElement(existingProps);if(typeof classElement!=="undefined"){classElements.push(classElement)}}expect("}");return markerApply(marker,delegate.createClassBody(classElements))}function parseClassImplements(){var id,implemented=[],marker,typeParameters;expectContextualKeyword("implements");while(index<length){marker=markerCreate();id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterInstantiation()}else{typeParameters=null}implemented.push(markerApply(marker,delegate.createClassImplements(id,typeParameters)));if(!match(",")){break}expect(",")}return implemented}function parseClassExpression(){var id,implemented,previousYieldAllowed,superClass=null,superTypeParameters,marker=markerCreate(),typeParameters;expectKeyword("class");if(!matchKeyword("extends")&&!matchContextualKeyword("implements")&&!match("{")){id=parseVariableIdentifier()}if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(matchKeyword("extends")){expectKeyword("extends");previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=false;superClass=parseLeftHandSideExpressionAllowCall();if(match("<")){superTypeParameters=parseTypeParameterInstantiation()}state.yieldAllowed=previousYieldAllowed}if(matchContextualKeyword("implements")){implemented=parseClassImplements()}return markerApply(marker,delegate.createClassExpression(id,superClass,parseClassBody(),typeParameters,superTypeParameters,implemented))}function parseClassDeclaration(){var id,implemented,previousYieldAllowed,superClass=null,superTypeParameters,marker=markerCreate(),typeParameters;expectKeyword("class");id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(matchKeyword("extends")){expectKeyword("extends");previousYieldAllowed=state.yieldAllowed;state.yieldAllowed=false;superClass=parseLeftHandSideExpressionAllowCall();if(match("<")){superTypeParameters=parseTypeParameterInstantiation()}state.yieldAllowed=previousYieldAllowed}if(matchContextualKeyword("implements")){implemented=parseClassImplements()}return markerApply(marker,delegate.createClassDeclaration(id,superClass,parseClassBody(),typeParameters,superTypeParameters,implemented))}function parseSourceElement(){var token;if(lookahead.type===Token.Keyword){switch(lookahead.value){case"const":case"let":return parseConstLetDeclaration(lookahead.value);case"function":return parseFunctionDeclaration();default:return parseStatement()}}if(matchContextualKeyword("type")&&lookahead2().type===Token.Identifier){return parseTypeAlias()}if(matchContextualKeyword("interface")&&lookahead2().type===Token.Identifier){return parseInterface()}if(matchContextualKeyword("declare")){token=lookahead2();if(token.type===Token.Keyword){switch(token.value){case"class":return parseDeclareClass();case"function":return parseDeclareFunction();case"var":return parseDeclareVariable()}}else if(token.type===Token.Identifier&&token.value==="module"){return parseDeclareModule()}}if(lookahead.type!==Token.EOF){return parseStatement()}}function parseProgramElement(){if(lookahead.type===Token.Keyword){switch(lookahead.value){case"export":return parseExportDeclaration();case"import":return parseImportDeclaration()}}return parseSourceElement()}function parseProgramElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted;while(index<length){token=lookahead;if(token.type!==Token.StringLiteral){break}sourceElement=parseProgramElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=source.slice(token.range[0]+1,token.range[1]-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}while(index<length){sourceElement=parseProgramElement();if(typeof sourceElement==="undefined"){break}sourceElements.push(sourceElement)}return sourceElements}function parseProgram(){var body,marker=markerCreate();strict=false;peek();body=parseProgramElements();return markerApply(marker,delegate.createProgram(body))}function addComment(type,value,start,end,loc){var comment;assert(typeof start==="number","Comment must have valid position");if(state.lastCommentStart>=start){return}state.lastCommentStart=start;comment={type:type,value:value};if(extra.range){comment.range=[start,end]}if(extra.loc){comment.loc=loc}extra.comments.push(comment);if(extra.attachComment){extra.leadingComments.push(comment);extra.trailingComments.push(comment)}}function scanComment(){var comment,ch,loc,start,blockComment,lineComment;comment="";blockComment=false;lineComment=false;while(index<length){ch=source[index];if(lineComment){ch=source[index++];if(isLineTerminator(ch.charCodeAt(0))){loc.end={line:lineNumber,column:index-lineStart-1};lineComment=false;addComment("Line",comment,start,index-1,loc);if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index;comment=""}else if(index>=length){lineComment=false;comment+=ch;loc.end={line:lineNumber,column:length-lineStart};addComment("Line",comment,start,length,loc)}else{comment+=ch}}else if(blockComment){if(isLineTerminator(ch.charCodeAt(0))){if(ch==="\r"){++index;comment+="\r"}if(ch!=="\r"||source[index]==="\n"){comment+=source[index];++lineNumber;++index;lineStart=index;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}}else{ch=source[index++];if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}comment+=ch;if(ch==="*"){ch=source[index];if(ch==="/"){comment=comment.substr(0,comment.length-1);blockComment=false;++index;loc.end={line:lineNumber,column:index-lineStart};addComment("Block",comment,start,index,loc);comment=""}}}}else if(ch==="/"){ch=source[index+1];if(ch==="/"){loc={start:{line:lineNumber,column:index-lineStart}};start=index;index+=2;lineComment=true;if(index>=length){loc.end={line:lineNumber,column:index-lineStart};lineComment=false;addComment("Line",comment,start,index,loc)}}else if(ch==="*"){start=index;index+=2;blockComment=true;loc={start:{line:lineNumber,column:index-lineStart-2}};if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{break}}else if(isWhiteSpace(ch.charCodeAt(0))){++index}else if(isLineTerminator(ch.charCodeAt(0))){++index;if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index}else{break}}}XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function getQualifiedXJSName(object){if(object.type===Syntax.XJSIdentifier){return object.name}if(object.type===Syntax.XJSNamespacedName){return object.namespace.name+":"+object.name.name}if(object.type===Syntax.XJSMemberExpression){return getQualifiedXJSName(object.object)+"."+getQualifiedXJSName(object.property)}}function isXJSIdentifierStart(ch){return ch!==92&&isIdentifierStart(ch)}function isXJSIdentifierPart(ch){return ch!==92&&(ch===45||isIdentifierPart(ch))}function scanXJSIdentifier(){var ch,start,value="";start=index;while(index<length){ch=source.charCodeAt(index);if(!isXJSIdentifierPart(ch)){break}value+=source[index++]}return{type:Token.XJSIdentifier,value:value,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanXJSEntity(){var ch,str="",start=index,count=0,code;ch=source[index];assert(ch==="&","Entity must start with an ampersand");index++;while(index<length&&count++<10){ch=source[index++];if(ch===";"){break}str+=ch}if(ch===";"){if(str[0]==="#"){if(str[1]==="x"){code=+("0"+str.substr(1))}else{code=+str.substr(1).replace(Regex.LeadingZeros,"")}if(!isNaN(code)){return String.fromCharCode(code)}}else if(XHTMLEntities[str]){return XHTMLEntities[str]}}index=start+1;return"&"}function scanXJSText(stopChars){var ch,str="",start;start=index;while(index<length){ch=source[index];if(stopChars.indexOf(ch)!==-1){break}if(ch==="&"){str+=scanXJSEntity()}else{index++;if(ch==="\r"&&source[index]==="\n"){str+=ch;ch=source[index];index++}if(isLineTerminator(ch.charCodeAt(0))){++lineNumber;lineStart=index}str+=ch}}return{type:Token.XJSText,value:str,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanXJSStringLiteral(){var innerToken,quote,start;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;innerToken=scanXJSText([quote]);if(quote!==source[index]){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;innerToken.range=[start,index];return innerToken}function advanceXJSChild(){var ch=source.charCodeAt(index);if(ch!==123&&ch!==60){return scanXJSText(["<","{"])}return scanPunctuator()}function parseXJSIdentifier(){var token,marker=markerCreate();if(lookahead.type!==Token.XJSIdentifier){throwUnexpected(lookahead)}token=lex();return markerApply(marker,delegate.createXJSIdentifier(token.value))}function parseXJSNamespacedName(){var namespace,name,marker=markerCreate();namespace=parseXJSIdentifier();expect(":");name=parseXJSIdentifier();return markerApply(marker,delegate.createXJSNamespacedName(namespace,name))}function parseXJSMemberExpression(){var marker=markerCreate(),expr=parseXJSIdentifier();while(match(".")){lex();expr=markerApply(marker,delegate.createXJSMemberExpression(expr,parseXJSIdentifier()))}return expr}function parseXJSElementName(){if(lookahead2().value===":"){return parseXJSNamespacedName()}if(lookahead2().value==="."){return parseXJSMemberExpression()}return parseXJSIdentifier()}function parseXJSAttributeName(){if(lookahead2().value===":"){return parseXJSNamespacedName()}return parseXJSIdentifier()}function parseXJSAttributeValue(){var value,marker;if(match("{")){value=parseXJSExpressionContainer();if(value.expression.type===Syntax.XJSEmptyExpression){throwError(value,"XJS attributes must only be assigned a non-empty "+"expression")}}else if(match("<")){value=parseXJSElement()}else if(lookahead.type===Token.XJSText){marker=markerCreate();value=markerApply(marker,delegate.createLiteral(lex()))}else{throwError({},Messages.InvalidXJSAttributeValue)}return value}function parseXJSEmptyExpression(){var marker=markerCreatePreserveWhitespace();while(source.charAt(index)!=="}"){index++}return markerApply(marker,delegate.createXJSEmptyExpression())}function parseXJSExpressionContainer(){var expression,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=false;expect("{");if(match("}")){expression=parseXJSEmptyExpression()}else{expression=parseExpression()}state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;expect("}");return markerApply(marker,delegate.createXJSExpressionContainer(expression))}function parseXJSSpreadAttribute(){var expression,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=false;expect("{");expect("...");expression=parseAssignmentExpression();state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;expect("}");return markerApply(marker,delegate.createXJSSpreadAttribute(expression))}function parseXJSAttribute(){var name,marker;if(match("{")){return parseXJSSpreadAttribute()}marker=markerCreate();name=parseXJSAttributeName();if(match("=")){lex();return markerApply(marker,delegate.createXJSAttribute(name,parseXJSAttributeValue()))}return markerApply(marker,delegate.createXJSAttribute(name))}function parseXJSChild(){var token,marker;if(match("{")){token=parseXJSExpressionContainer()}else if(lookahead.type===Token.XJSText){marker=markerCreatePreserveWhitespace();token=markerApply(marker,delegate.createLiteral(lex()))}else{token=parseXJSElement()}return token}function parseXJSClosingElement(){var name,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=true;expect("<");expect("/");name=parseXJSElementName();state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;expect(">");return markerApply(marker,delegate.createXJSClosingElement(name))}function parseXJSOpeningElement(){var name,attribute,attributes=[],selfClosing=false,origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;state.inXJSChild=false;state.inXJSTag=true;expect("<");name=parseXJSElementName();while(index<length&&lookahead.value!=="/"&&lookahead.value!==">"){attributes.push(parseXJSAttribute())}state.inXJSTag=origInXJSTag;if(lookahead.value==="/"){expect("/");state.inXJSChild=origInXJSChild;expect(">");selfClosing=true}else{state.inXJSChild=true;expect(">")}return markerApply(marker,delegate.createXJSOpeningElement(name,attributes,selfClosing))}function parseXJSElement(){var openingElement,closingElement=null,children=[],origInXJSChild,origInXJSTag,marker=markerCreate();origInXJSChild=state.inXJSChild;origInXJSTag=state.inXJSTag;openingElement=parseXJSOpeningElement();if(!openingElement.selfClosing){while(index<length){state.inXJSChild=false;if(lookahead.value==="<"&&lookahead2().value==="/"){break}state.inXJSChild=true;children.push(parseXJSChild())}state.inXJSChild=origInXJSChild;state.inXJSTag=origInXJSTag;closingElement=parseXJSClosingElement();if(getQualifiedXJSName(closingElement.name)!==getQualifiedXJSName(openingElement.name)){throwError({},Messages.ExpectedXJSClosingTag,getQualifiedXJSName(openingElement.name))}}if(!origInXJSChild&&match("<")){throwError(lookahead,Messages.AdjacentXJSElements)}return markerApply(marker,delegate.createXJSElement(openingElement,closingElement,children))}function parseTypeAlias(){var id,marker=markerCreate(),typeParameters=null,right;expectContextualKeyword("type");id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}expect("=");right=parseType();consumeSemicolon();return markerApply(marker,delegate.createTypeAlias(id,typeParameters,right))}function parseInterfaceExtends(){var marker=markerCreate(),id,typeParameters=null;id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterInstantiation()}return markerApply(marker,delegate.createInterfaceExtends(id,typeParameters))}function parseInterfaceish(marker,allowStatic){var body,bodyMarker,extended=[],id,typeParameters=null;id=parseVariableIdentifier();if(match("<")){typeParameters=parseTypeParameterDeclaration()}if(matchKeyword("extends")){expectKeyword("extends");while(index<length){extended.push(parseInterfaceExtends());if(!match(",")){break}expect(",")}}bodyMarker=markerCreate();body=markerApply(bodyMarker,parseObjectType(allowStatic));return markerApply(marker,delegate.createInterface(id,typeParameters,body,extended))}function parseInterface(){var body,bodyMarker,extended=[],id,marker=markerCreate(),typeParameters=null;expectContextualKeyword("interface");return parseInterfaceish(marker,false)}function parseDeclareClass(){var marker=markerCreate(),ret;expectContextualKeyword("declare");expectKeyword("class");ret=parseInterfaceish(marker,true);ret.type=Syntax.DeclareClass;return ret}function parseDeclareFunction(){var id,idMarker,marker=markerCreate(),params,returnType,rest,tmp,typeParameters=null,value,valueMarker;expectContextualKeyword("declare");expectKeyword("function");idMarker=markerCreate();id=parseVariableIdentifier();valueMarker=markerCreate();if(match("<")){typeParameters=parseTypeParameterDeclaration()}expect("(");tmp=parseFunctionTypeParams();params=tmp.params;rest=tmp.rest;expect(")");expect(":");returnType=parseType();value=markerApply(valueMarker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));id.typeAnnotation=markerApply(valueMarker,delegate.createTypeAnnotation(value));markerApply(idMarker,id);consumeSemicolon();return markerApply(marker,delegate.createDeclareFunction(id))}function parseDeclareVariable(){var id,marker=markerCreate();expectContextualKeyword("declare");expectKeyword("var");id=parseTypeAnnotatableIdentifier();consumeSemicolon();return markerApply(marker,delegate.createDeclareVariable(id))}function parseDeclareModule(){var body=[],bodyMarker,id,idMarker,marker=markerCreate(),token;expectContextualKeyword("declare");expectContextualKeyword("module");if(lookahead.type===Token.StringLiteral){if(strict&&lookahead.octal){throwErrorTolerant(lookahead,Messages.StrictOctalLiteral)}idMarker=markerCreate();id=markerApply(idMarker,delegate.createLiteral(lex()))}else{id=parseVariableIdentifier()}bodyMarker=markerCreate();expect("{");while(index<length&&!match("}")){token=lookahead2();switch(token.value){case"class":body.push(parseDeclareClass());break;case"function":body.push(parseDeclareFunction());break;case"var":body.push(parseDeclareVariable());break;default:throwUnexpected(lookahead)}}expect("}");return markerApply(marker,delegate.createDeclareModule(id,markerApply(bodyMarker,delegate.createBlockStatement(body))))}function collectToken(){var start,loc,token,range,value,entry;if(!state.inXJSChild){skipComment()}start=index;loc={start:{line:lineNumber,column:index-lineStart}};token=extra.advance();loc.end={line:lineNumber,column:index-lineStart};if(token.type!==Token.EOF){range=[token.range[0],token.range[1]];value=source.slice(token.range[0],token.range[1]);entry={type:TokenName[token.type],value:value,range:range,loc:loc};if(token.regex){entry.regex={pattern:token.regex.pattern,flags:token.regex.flags}}extra.tokens.push(entry)}return token}function collectRegex(){var pos,loc,regex,token;skipComment();pos=index;loc={start:{line:lineNumber,column:index-lineStart}};regex=extra.scanRegExp();loc.end={line:lineNumber,column:index-lineStart};if(!extra.tokenize){if(extra.tokens.length>0){token=extra.tokens[extra.tokens.length-1];if(token.range[0]===pos&&token.type==="Punctuator"){if(token.value==="/"||token.value==="/="){extra.tokens.pop()}}}extra.tokens.push({type:"RegularExpression",value:regex.literal,regex:regex.regex,range:[pos,index],loc:loc})}return regex}function filterTokenLocation(){var i,entry,token,tokens=[];for(i=0;i<extra.tokens.length;++i){entry=extra.tokens[i];token={type:entry.type,value:entry.value};if(entry.regex){token.regex={pattern:entry.regex.pattern,flags:entry.regex.flags}}if(extra.range){token.range=entry.range}if(extra.loc){token.loc=entry.loc}tokens.push(token)}extra.tokens=tokens}function patch(){if(extra.comments){extra.skipComment=skipComment;skipComment=scanComment}if(typeof extra.tokens!=="undefined"){extra.advance=advance;extra.scanRegExp=scanRegExp;advance=collectToken;scanRegExp=collectRegex}}function unpatch(){if(typeof extra.skipComment==="function"){skipComment=extra.skipComment}if(typeof extra.scanRegExp==="function"){advance=extra.advance;scanRegExp=extra.scanRegExp}}function extend(object,properties){var entry,result={};for(entry in object){if(object.hasOwnProperty(entry)){result[entry]=object[entry]}}for(entry in properties){if(properties.hasOwnProperty(entry)){result[entry]=properties[entry]}}return result}function tokenize(code,options){var toString,token,tokens;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}delegate=SyntaxTreeDelegate;source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;lookahead=null;state={allowKeyword:true,allowIn:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1};extra={};options=options||{};options.tokens=true;extra.tokens=[];extra.tokenize=true;extra.openParenToken=-1;extra.openCurlyToken=-1;extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;if(typeof options.comment==="boolean"&&options.comment){extra.comments=[]}if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}if(length>0){if(typeof source[0]==="undefined"){if(code instanceof String){source=code.valueOf()}}}patch();try{peek();if(lookahead.type===Token.EOF){return extra.tokens}token=lex();while(lookahead.type!==Token.EOF){try{token=lex()}catch(lexError){token=lookahead;if(extra.errors){extra.errors.push(lexError);break}else{throw lexError}}}filterTokenLocation();tokens=extra.tokens;if(typeof extra.comments!=="undefined"){tokens.comments=extra.comments}if(typeof extra.errors!=="undefined"){tokens.errors=extra.errors}}catch(e){throw e}finally{unpatch();extra={}}return tokens}function parse(code,options){var program,toString;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}delegate=SyntaxTreeDelegate;source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;lookahead=null;state={allowKeyword:false,allowIn:true,labelSet:{},parenthesizedCount:0,inFunctionBody:false,inIteration:false,inSwitch:false,inXJSChild:false,inXJSTag:false,inType:false,lastCommentStart:-1,yieldAllowed:false,awaitAllowed:false};
extra={};if(typeof options!=="undefined"){extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;extra.attachComment=typeof options.attachComment==="boolean"&&options.attachComment;if(extra.loc&&options.source!==null&&options.source!==undefined){delegate=extend(delegate,{postProcess:function(node){node.loc.source=toString(options.source);return node}})}if(typeof options.tokens==="boolean"&&options.tokens){extra.tokens=[]}if(typeof options.comment==="boolean"&&options.comment){extra.comments=[]}if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}if(extra.attachComment){extra.range=true;extra.comments=[];extra.bottomRightStack=[];extra.trailingComments=[];extra.leadingComments=[]}}if(length>0){if(typeof source[0]==="undefined"){if(code instanceof String){source=code.valueOf()}}}patch();try{program=parseProgram();if(typeof extra.comments!=="undefined"){program.comments=extra.comments}if(typeof extra.tokens!=="undefined"){filterTokenLocation();program.tokens=extra.tokens}if(typeof extra.errors!=="undefined"){program.errors=extra.errors}}catch(e){throw e}finally{unpatch();extra={}}return program}exports.version="8001.1001.0-dev-harmony-fb";exports.tokenize=tokenize;exports.parse=parse;exports.Syntax=function(){var name,types={};if(typeof Object.create==="function"){types=Object.create(null)}for(name in Syntax){if(Syntax.hasOwnProperty(name)){types[name]=Syntax[name]}}if(typeof Object.freeze==="function"){Object.freeze(types)}return types}()})},{}],150:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var linesModule=require("./lines");var fromString=linesModule.fromString;var Lines=linesModule.Lines;var concat=linesModule.concat;var comparePos=require("./util").comparePos;var childNodesCacheKey=require("private").makeUniqueKey();function getSortedChildNodes(node,resultArray){if(!node){return}if(resultArray){if(n.Node.check(node)&&n.SourceLocation.check(node.loc)){for(var i=resultArray.length-1;i>=0;--i){if(comparePos(resultArray[i].loc.end,node.loc.start)<=0){break}}resultArray.splice(i+1,0,node);return}}else if(node[childNodesCacheKey]){return node[childNodesCacheKey]}var names;if(isArray.check(node)){names=Object.keys(node)}else if(isObject.check(node)){names=types.getFieldNames(node)}else{return}if(!resultArray){Object.defineProperty(node,childNodesCacheKey,{value:resultArray=[],enumerable:false})}for(var i=0,nameCount=names.length;i<nameCount;++i){getSortedChildNodes(node[names[i]],resultArray)}return resultArray}function decorateComment(node,comment){var childNodes=getSortedChildNodes(node);var left=0,right=childNodes.length;while(left<right){var middle=left+right>>1;var child=childNodes[middle];if(comparePos(child.loc.start,comment.loc.start)<=0&&comparePos(comment.loc.end,child.loc.end)<=0){decorateComment(comment.enclosingNode=child,comment);return}if(comparePos(child.loc.end,comment.loc.start)<=0){var precedingNode=child;left=middle+1;continue}if(comparePos(comment.loc.end,child.loc.start)<=0){var followingNode=child;right=middle;continue}throw new Error("Comment location overlaps with node location")}if(precedingNode){comment.precedingNode=precedingNode}if(followingNode){comment.followingNode=followingNode}}exports.attach=function(comments,ast,lines){if(!isArray.check(comments)){return}var tiesToBreak=[];comments.forEach(function(comment){comment.loc.lines=lines;decorateComment(ast,comment);var pn=comment.precedingNode;var en=comment.enclosingNode;var fn=comment.followingNode;if(pn&&fn){var tieCount=tiesToBreak.length;if(tieCount>0){var lastTie=tiesToBreak[tieCount-1];assert.strictEqual(lastTie.precedingNode===comment.precedingNode,lastTie.followingNode===comment.followingNode);if(lastTie.followingNode!==comment.followingNode){breakTies(tiesToBreak,lines)}}tiesToBreak.push(comment)}else if(pn){breakTies(tiesToBreak,lines);Comments.forNode(pn).addTrailing(comment)}else if(fn){breakTies(tiesToBreak,lines);Comments.forNode(fn).addLeading(comment)}else if(en){breakTies(tiesToBreak,lines);Comments.forNode(en).addDangling(comment)}else{throw new Error("AST contains no nodes at all?")}});breakTies(tiesToBreak,lines)};function breakTies(tiesToBreak,lines){var tieCount=tiesToBreak.length;if(tieCount===0){return}var pn=tiesToBreak[0].precedingNode;var fn=tiesToBreak[0].followingNode;var gapEndPos=fn.loc.start;for(var indexOfFirstLeadingComment=tieCount;indexOfFirstLeadingComment>0;--indexOfFirstLeadingComment){var comment=tiesToBreak[indexOfFirstLeadingComment-1];assert.strictEqual(comment.precedingNode,pn);assert.strictEqual(comment.followingNode,fn);var gap=lines.sliceString(comment.loc.end,gapEndPos);if(/\S/.test(gap)){break}gapEndPos=comment.loc.start}while(indexOfFirstLeadingComment<=tieCount&&(comment=tiesToBreak[indexOfFirstLeadingComment])&&comment.type==="Line"&&comment.loc.start.column>fn.loc.start.column){++indexOfFirstLeadingComment}tiesToBreak.forEach(function(comment,i){if(i<indexOfFirstLeadingComment){Comments.forNode(pn).addTrailing(comment)}else{Comments.forNode(fn).addLeading(comment)}});tiesToBreak.length=0}function Comments(){assert.ok(this instanceof Comments);this.leading=[];this.dangling=[];this.trailing=[]}var Cp=Comments.prototype;Comments.forNode=function forNode(node){var comments=node.comments;if(!comments){Object.defineProperty(node,"comments",{value:comments=new Comments,enumerable:false})}return comments};Cp.forEach=function forEach(callback,context){this.leading.forEach(callback,context);this.trailing.forEach(callback,context)};Cp.addLeading=function addLeading(comment){this.leading.push(comment)};Cp.addDangling=function addDangling(comment){this.dangling.push(comment)};Cp.addTrailing=function addTrailing(comment){comment.trailing=true;if(comment.type==="Block"){this.trailing.push(comment)}else{this.leading.push(comment)}};function printLeadingComment(comment,options){var loc=comment.loc;var lines=loc&&loc.lines;var parts=[];if(comment.type==="Block"){parts.push("/*",fromString(comment.value,options),"*/")}else if(comment.type==="Line"){parts.push("//",fromString(comment.value,options))}else assert.fail(comment.type);if(comment.trailing){parts.push("\n")}else if(lines instanceof Lines){var trailingSpace=lines.slice(loc.end,lines.skipSpaces(loc.end));if(trailingSpace.length===1){parts.push(trailingSpace)}else{parts.push(new Array(trailingSpace.length).join("\n"))}}else{parts.push("\n")}return concat(parts).stripMargin(loc?loc.start.column:0)}function printTrailingComment(comment,options){var loc=comment.loc;var lines=loc&&loc.lines;var parts=[];if(lines instanceof Lines){var fromPos=lines.skipSpaces(loc.start,true)||lines.firstPos();var leadingSpace=lines.slice(fromPos,loc.start);if(leadingSpace.length===1){parts.push(leadingSpace)}else{parts.push(new Array(leadingSpace.length).join("\n"))}}if(comment.type==="Block"){parts.push("/*",fromString(comment.value,options),"*/")}else if(comment.type==="Line"){parts.push("//",fromString(comment.value,options),"\n")}else assert.fail(comment.type);return concat(parts).stripMargin(loc?loc.start.column:0,true)}exports.printComments=function(comments,innerLines,options){if(innerLines){assert.ok(innerLines instanceof Lines)}else{innerLines=fromString("")}if(!comments||!(comments.leading.length+comments.trailing.length)){return innerLines}var parts=[];comments.leading.forEach(function(comment){parts.push(printLeadingComment(comment,options))});parts.push(innerLines);comments.trailing.forEach(function(comment){assert.strictEqual(comment.type,"Block");parts.push(printTrailingComment(comment,options))});return concat(parts)}},{"./lines":151,"./types":157,"./util":158,assert:94,"private":127}],151:[function(require,module,exports){var assert=require("assert");var sourceMap=require("source-map");var normalizeOptions=require("./options").normalize;var secretKey=require("private").makeUniqueKey();var types=require("./types");var isString=types.builtInTypes.string;var comparePos=require("./util").comparePos;var Mapping=require("./mapping");function getSecret(lines){return lines[secretKey]}function Lines(infos,sourceFileName){assert.ok(this instanceof Lines);assert.ok(infos.length>0);if(sourceFileName){isString.assert(sourceFileName)}else{sourceFileName=null}Object.defineProperty(this,secretKey,{value:{infos:infos,mappings:[],name:sourceFileName,cachedSourceMap:null}});if(sourceFileName){getSecret(this).mappings.push(new Mapping(this,{start:this.firstPos(),end:this.lastPos()}))}}exports.Lines=Lines;var Lp=Lines.prototype;Object.defineProperties(Lp,{length:{get:function(){return getSecret(this).infos.length}},name:{get:function(){return getSecret(this).name}}});function copyLineInfo(info){return{line:info.line,indent:info.indent,sliceStart:info.sliceStart,sliceEnd:info.sliceEnd}}var fromStringCache={};var hasOwn=fromStringCache.hasOwnProperty;var maxCacheKeyLen=10;function countSpaces(spaces,tabWidth){var count=0;var len=spaces.length;for(var i=0;i<len;++i){var ch=spaces.charAt(i);if(ch===" "){count+=1}else if(ch===" "){assert.strictEqual(typeof tabWidth,"number");assert.ok(tabWidth>0);var next=Math.ceil(count/tabWidth)*tabWidth;if(next===count){count+=tabWidth}else{count=next}}else if(ch==="\r"){}else{assert.fail("unexpected whitespace character",ch)}}return count}exports.countSpaces=countSpaces;var leadingSpaceExp=/^\s*/;function fromString(string,options){if(string instanceof Lines)return string;string+="";var tabWidth=options&&options.tabWidth;var tabless=string.indexOf(" ")<0;var cacheable=!options&&tabless&&string.length<=maxCacheKeyLen;assert.ok(tabWidth||tabless,"No tab width specified but encountered tabs in string\n"+string);if(cacheable&&hasOwn.call(fromStringCache,string))return fromStringCache[string];var lines=new Lines(string.split("\n").map(function(line){var spaces=leadingSpaceExp.exec(line)[0];return{line:line,indent:countSpaces(spaces,tabWidth),sliceStart:spaces.length,sliceEnd:line.length}}),normalizeOptions(options).sourceFileName);if(cacheable)fromStringCache[string]=lines;return lines}exports.fromString=fromString;function isOnlyWhitespace(string){return!/\S/.test(string)}Lp.toString=function(options){return this.sliceString(this.firstPos(),this.lastPos(),options)};Lp.getSourceMap=function(sourceMapName,sourceRoot){if(!sourceMapName){return null}var targetLines=this;function updateJSON(json){json=json||{};isString.assert(sourceMapName);json.file=sourceMapName;if(sourceRoot){isString.assert(sourceRoot);json.sourceRoot=sourceRoot}return json}var secret=getSecret(targetLines);if(secret.cachedSourceMap){return updateJSON(secret.cachedSourceMap.toJSON())}var smg=new sourceMap.SourceMapGenerator(updateJSON());var sourcesToContents={};secret.mappings.forEach(function(mapping){var sourceCursor=mapping.sourceLines.skipSpaces(mapping.sourceLoc.start)||mapping.sourceLines.lastPos();var targetCursor=targetLines.skipSpaces(mapping.targetLoc.start)||targetLines.lastPos();while(comparePos(sourceCursor,mapping.sourceLoc.end)<0&&comparePos(targetCursor,mapping.targetLoc.end)<0){var sourceChar=mapping.sourceLines.charAt(sourceCursor);var targetChar=targetLines.charAt(targetCursor);assert.strictEqual(sourceChar,targetChar);var sourceName=mapping.sourceLines.name;smg.addMapping({source:sourceName,original:{line:sourceCursor.line,column:sourceCursor.column},generated:{line:targetCursor.line,column:targetCursor.column}});if(!hasOwn.call(sourcesToContents,sourceName)){var sourceContent=mapping.sourceLines.toString();smg.setSourceContent(sourceName,sourceContent);sourcesToContents[sourceName]=sourceContent}targetLines.nextPos(targetCursor,true);mapping.sourceLines.nextPos(sourceCursor,true)}});secret.cachedSourceMap=smg;return smg.toJSON()};Lp.bootstrapCharAt=function(pos){assert.strictEqual(typeof pos,"object");assert.strictEqual(typeof pos.line,"number");assert.strictEqual(typeof pos.column,"number");var line=pos.line,column=pos.column,strings=this.toString().split("\n"),string=strings[line-1];if(typeof string==="undefined")return"";if(column===string.length&&line<strings.length)return"\n";if(column>=string.length)return"";return string.charAt(column)};Lp.charAt=function(pos){assert.strictEqual(typeof pos,"object");assert.strictEqual(typeof pos.line,"number");assert.strictEqual(typeof pos.column,"number");var line=pos.line,column=pos.column,secret=getSecret(this),infos=secret.infos,info=infos[line-1],c=column;if(typeof info==="undefined"||c<0)return"";var indent=this.getIndentAt(line);if(c<indent)return" ";c+=info.sliceStart-indent;if(c===info.sliceEnd&&line<this.length)return"\n";if(c>=info.sliceEnd)return"";return info.line.charAt(c)};Lp.stripMargin=function(width,skipFirstLine){if(width===0)return this;assert.ok(width>0,"negative margin: "+width);if(skipFirstLine&&this.length===1)return this;var secret=getSecret(this);var lines=new Lines(secret.infos.map(function(info,i){if(info.line&&(i>0||!skipFirstLine)){info=copyLineInfo(info);info.indent=Math.max(0,info.indent-width)}return info}));if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){newMappings.push(mapping.indent(width,skipFirstLine,true))})}return lines};Lp.indent=function(by){if(by===0)return this;var secret=getSecret(this);var lines=new Lines(secret.infos.map(function(info){if(info.line){info=copyLineInfo(info);info.indent+=by}return info}));if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){newMappings.push(mapping.indent(by))})}return lines};Lp.indentTail=function(by){if(by===0)return this;if(this.length<2)return this;var secret=getSecret(this);var lines=new Lines(secret.infos.map(function(info,i){if(i>0&&info.line){info=copyLineInfo(info);info.indent+=by}return info}));if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){newMappings.push(mapping.indent(by,true))})}return lines};Lp.getIndentAt=function(line){assert.ok(line>=1,"no line "+line+" (line numbers start from 1)");var secret=getSecret(this),info=secret.infos[line-1];return Math.max(info.indent,0)};Lp.guessTabWidth=function(){var secret=getSecret(this);if(hasOwn.call(secret,"cachedTabWidth")){return secret.cachedTabWidth}var counts=[];var lastIndent=0;for(var line=1,last=this.length;line<=last;++line){var info=secret.infos[line-1];var sliced=info.line.slice(info.sliceStart,info.sliceEnd);if(isOnlyWhitespace(sliced)){continue}var diff=Math.abs(info.indent-lastIndent);counts[diff]=~~counts[diff]+1;lastIndent=info.indent}var maxCount=-1;var result=2;for(var tabWidth=1;tabWidth<counts.length;tabWidth+=1){if(hasOwn.call(counts,tabWidth)&&counts[tabWidth]>maxCount){maxCount=counts[tabWidth];result=tabWidth}}return secret.cachedTabWidth=result};Lp.isOnlyWhitespace=function(){return isOnlyWhitespace(this.toString())};Lp.isPrecededOnlyByWhitespace=function(pos){var secret=getSecret(this);var info=secret.infos[pos.line-1];var indent=Math.max(info.indent,0);var diff=pos.column-indent;if(diff<=0){return true}var start=info.sliceStart;var end=Math.min(start+diff,info.sliceEnd);var prefix=info.line.slice(start,end);return isOnlyWhitespace(prefix)};Lp.getLineLength=function(line){var secret=getSecret(this),info=secret.infos[line-1];return this.getIndentAt(line)+info.sliceEnd-info.sliceStart};Lp.nextPos=function(pos,skipSpaces){var l=Math.max(pos.line,0),c=Math.max(pos.column,0);if(c<this.getLineLength(l)){pos.column+=1;return skipSpaces?!!this.skipSpaces(pos,false,true):true}if(l<this.length){pos.line+=1;pos.column=0;return skipSpaces?!!this.skipSpaces(pos,false,true):true}return false};Lp.prevPos=function(pos,skipSpaces){var l=pos.line,c=pos.column;if(c<1){l-=1;if(l<1)return false;c=this.getLineLength(l)}else{c=Math.min(c-1,this.getLineLength(l))}pos.line=l;pos.column=c;return skipSpaces?!!this.skipSpaces(pos,true,true):true};Lp.firstPos=function(){return{line:1,column:0}};Lp.lastPos=function(){return{line:this.length,column:this.getLineLength(this.length)}};Lp.skipSpaces=function(pos,backward,modifyInPlace){if(pos){pos=modifyInPlace?pos:{line:pos.line,column:pos.column}}else if(backward){pos=this.lastPos()}else{pos=this.firstPos()}if(backward){while(this.prevPos(pos)){if(!isOnlyWhitespace(this.charAt(pos))&&this.nextPos(pos)){return pos}}return null}else{while(isOnlyWhitespace(this.charAt(pos))){if(!this.nextPos(pos)){return null}}return pos}};Lp.trimLeft=function(){var pos=this.skipSpaces(this.firstPos(),false,true);return pos?this.slice(pos):emptyLines};Lp.trimRight=function(){var pos=this.skipSpaces(this.lastPos(),true,true);return pos?this.slice(this.firstPos(),pos):emptyLines};Lp.trim=function(){var start=this.skipSpaces(this.firstPos(),false,true);if(start===null)return emptyLines;var end=this.skipSpaces(this.lastPos(),true,true);assert.notStrictEqual(end,null);return this.slice(start,end)};Lp.eachPos=function(callback,startPos,skipSpaces){var pos=this.firstPos();if(startPos){pos.line=startPos.line,pos.column=startPos.column}if(skipSpaces&&!this.skipSpaces(pos,false,true)){return}do callback.call(this,pos);while(this.nextPos(pos,skipSpaces))};Lp.bootstrapSlice=function(start,end){var strings=this.toString().split("\n").slice(start.line-1,end.line);strings.push(strings.pop().slice(0,end.column));strings[0]=strings[0].slice(start.column);return fromString(strings.join("\n"))};Lp.slice=function(start,end){if(!end){if(!start){return this}end=this.lastPos()}var secret=getSecret(this);var sliced=secret.infos.slice(start.line-1,end.line);if(start.line===end.line){sliced[0]=sliceInfo(sliced[0],start.column,end.column)}else{assert.ok(start.line<end.line);sliced[0]=sliceInfo(sliced[0],start.column);sliced.push(sliceInfo(sliced.pop(),0,end.column))}var lines=new Lines(sliced);if(secret.mappings.length>0){var newMappings=getSecret(lines).mappings;assert.strictEqual(newMappings.length,0);secret.mappings.forEach(function(mapping){var sliced=mapping.slice(this,start,end);if(sliced){newMappings.push(sliced)}},this)}return lines};function sliceInfo(info,startCol,endCol){var sliceStart=info.sliceStart;var sliceEnd=info.sliceEnd;var indent=Math.max(info.indent,0);var lineLength=indent+sliceEnd-sliceStart;if(typeof endCol==="undefined"){endCol=lineLength}startCol=Math.max(startCol,0);endCol=Math.min(endCol,lineLength);endCol=Math.max(endCol,startCol);if(endCol<indent){indent=endCol;sliceEnd=sliceStart}else{sliceEnd-=lineLength-endCol}lineLength=endCol;lineLength-=startCol;if(startCol<indent){indent-=startCol}else{startCol-=indent;indent=0;sliceStart+=startCol}assert.ok(indent>=0);assert.ok(sliceStart<=sliceEnd);assert.strictEqual(lineLength,indent+sliceEnd-sliceStart);if(info.indent===indent&&info.sliceStart===sliceStart&&info.sliceEnd===sliceEnd){return info}return{line:info.line,indent:indent,sliceStart:sliceStart,sliceEnd:sliceEnd}}Lp.bootstrapSliceString=function(start,end,options){return this.slice(start,end).toString(options)};Lp.sliceString=function(start,end,options){if(!end){if(!start){return this}end=this.lastPos()}options=normalizeOptions(options);var infos=getSecret(this).infos;var parts=[];var tabWidth=options.tabWidth;for(var line=start.line;line<=end.line;++line){var info=infos[line-1];if(line===start.line){if(line===end.line){info=sliceInfo(info,start.column,end.column)}else{info=sliceInfo(info,start.column)}}else if(line===end.line){info=sliceInfo(info,0,end.column)}var indent=Math.max(info.indent,0);var before=info.line.slice(0,info.sliceStart);if(options.reuseWhitespace&&isOnlyWhitespace(before)&&countSpaces(before,options.tabWidth)===indent){parts.push(info.line.slice(0,info.sliceEnd));continue}var tabs=0;var spaces=indent;if(options.useTabs){tabs=Math.floor(indent/tabWidth);spaces-=tabs*tabWidth}var result="";if(tabs>0){result+=new Array(tabs+1).join(" ")}if(spaces>0){result+=new Array(spaces+1).join(" ")}result+=info.line.slice(info.sliceStart,info.sliceEnd);parts.push(result)}return parts.join("\n")};Lp.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1};Lp.join=function(elements){var separator=this;var separatorSecret=getSecret(separator);var infos=[];var mappings=[];var prevInfo;function appendSecret(secret){if(secret===null)return;if(prevInfo){var info=secret.infos[0];var indent=new Array(info.indent+1).join(" ");var prevLine=infos.length;var prevColumn=Math.max(prevInfo.indent,0)+prevInfo.sliceEnd-prevInfo.sliceStart;prevInfo.line=prevInfo.line.slice(0,prevInfo.sliceEnd)+indent+info.line.slice(info.sliceStart,info.sliceEnd);prevInfo.sliceEnd=prevInfo.line.length;if(secret.mappings.length>0){secret.mappings.forEach(function(mapping){mappings.push(mapping.add(prevLine,prevColumn))})}}else if(secret.mappings.length>0){mappings.push.apply(mappings,secret.mappings)}secret.infos.forEach(function(info,i){if(!prevInfo||i>0){prevInfo=copyLineInfo(info);infos.push(prevInfo)}})}function appendWithSeparator(secret,i){if(i>0)appendSecret(separatorSecret);appendSecret(secret)}elements.map(function(elem){var lines=fromString(elem);if(lines.isEmpty())return null;return getSecret(lines)}).forEach(separator.isEmpty()?appendSecret:appendWithSeparator);if(infos.length<1)return emptyLines;var lines=new Lines(infos);getSecret(lines).mappings=mappings;return lines};exports.concat=function(elements){return emptyLines.join(elements)};Lp.concat=function(other){var args=arguments,list=[this];list.push.apply(list,args);assert.strictEqual(list.length,args.length+1);return emptyLines.join(list)};var emptyLines=fromString("")},{"./mapping":152,"./options":153,"./types":157,"./util":158,assert:94,"private":127,"source-map":168}],152:[function(require,module,exports){var assert=require("assert");var types=require("./types");var isString=types.builtInTypes.string;var isNumber=types.builtInTypes.number;var SourceLocation=types.namedTypes.SourceLocation;var Position=types.namedTypes.Position;var linesModule=require("./lines");var comparePos=require("./util").comparePos;function Mapping(sourceLines,sourceLoc,targetLoc){assert.ok(this instanceof Mapping);assert.ok(sourceLines instanceof linesModule.Lines);SourceLocation.assert(sourceLoc);if(targetLoc){assert.ok(isNumber.check(targetLoc.start.line)&&isNumber.check(targetLoc.start.column)&&isNumber.check(targetLoc.end.line)&&isNumber.check(targetLoc.end.column))}else{targetLoc=sourceLoc}Object.defineProperties(this,{sourceLines:{value:sourceLines},sourceLoc:{value:sourceLoc},targetLoc:{value:targetLoc}})}var Mp=Mapping.prototype;module.exports=Mapping;Mp.slice=function(lines,start,end){assert.ok(lines instanceof linesModule.Lines);Position.assert(start);if(end){Position.assert(end)}else{end=lines.lastPos()}var sourceLines=this.sourceLines;var sourceLoc=this.sourceLoc;var targetLoc=this.targetLoc;function skip(name){var sourceFromPos=sourceLoc[name];var targetFromPos=targetLoc[name];var targetToPos=start;if(name==="end"){targetToPos=end}else{assert.strictEqual(name,"start")}return skipChars(sourceLines,sourceFromPos,lines,targetFromPos,targetToPos)}if(comparePos(start,targetLoc.start)<=0){if(comparePos(targetLoc.end,end)<=0){targetLoc={start:subtractPos(targetLoc.start,start.line,start.column),end:subtractPos(targetLoc.end,start.line,start.column)}}else if(comparePos(end,targetLoc.start)<=0){return null}else{sourceLoc={start:sourceLoc.start,end:skip("end")};targetLoc={start:subtractPos(targetLoc.start,start.line,start.column),end:subtractPos(end,start.line,start.column)}}}else{if(comparePos(targetLoc.end,start)<=0){return null}if(comparePos(targetLoc.end,end)<=0){sourceLoc={start:skip("start"),end:sourceLoc.end};targetLoc={start:{line:1,column:0},end:subtractPos(targetLoc.end,start.line,start.column)}}else{sourceLoc={start:skip("start"),end:skip("end")};targetLoc={start:{line:1,column:0},end:subtractPos(end,start.line,start.column)}}}return new Mapping(this.sourceLines,sourceLoc,targetLoc)};Mp.add=function(line,column){return new Mapping(this.sourceLines,this.sourceLoc,{start:addPos(this.targetLoc.start,line,column),end:addPos(this.targetLoc.end,line,column)})};function addPos(toPos,line,column){return{line:toPos.line+line-1,column:toPos.line===1?toPos.column+column:toPos.column}}Mp.subtract=function(line,column){return new Mapping(this.sourceLines,this.sourceLoc,{start:subtractPos(this.targetLoc.start,line,column),end:subtractPos(this.targetLoc.end,line,column)})};function subtractPos(fromPos,line,column){return{line:fromPos.line-line+1,column:fromPos.line===line?fromPos.column-column:fromPos.column}}Mp.indent=function(by,skipFirstLine,noNegativeColumns){if(by===0){return this}var targetLoc=this.targetLoc;var startLine=targetLoc.start.line;var endLine=targetLoc.end.line;if(skipFirstLine&&startLine===1&&endLine===1){return this}targetLoc={start:targetLoc.start,end:targetLoc.end};if(!skipFirstLine||startLine>1){var startColumn=targetLoc.start.column+by;targetLoc.start={line:startLine,column:noNegativeColumns?Math.max(0,startColumn):startColumn}}if(!skipFirstLine||endLine>1){var endColumn=targetLoc.end.column+by;targetLoc.end={line:endLine,column:noNegativeColumns?Math.max(0,endColumn):endColumn}}return new Mapping(this.sourceLines,this.sourceLoc,targetLoc)};function skipChars(sourceLines,sourceFromPos,targetLines,targetFromPos,targetToPos){assert.ok(sourceLines instanceof linesModule.Lines);assert.ok(targetLines instanceof linesModule.Lines);Position.assert(sourceFromPos);Position.assert(targetFromPos);Position.assert(targetToPos);var targetComparison=comparePos(targetFromPos,targetToPos);if(targetComparison===0){return sourceFromPos}if(targetComparison<0){var sourceCursor=sourceLines.skipSpaces(sourceFromPos);var targetCursor=targetLines.skipSpaces(targetFromPos);var lineDiff=targetToPos.line-targetCursor.line;sourceCursor.line+=lineDiff;targetCursor.line+=lineDiff;if(lineDiff>0){sourceCursor.column=0;targetCursor.column=0}else{assert.strictEqual(lineDiff,0)}while(comparePos(targetCursor,targetToPos)<0&&targetLines.nextPos(targetCursor,true)){assert.ok(sourceLines.nextPos(sourceCursor,true));assert.strictEqual(sourceLines.charAt(sourceCursor),targetLines.charAt(targetCursor))}}else{var sourceCursor=sourceLines.skipSpaces(sourceFromPos,true);var targetCursor=targetLines.skipSpaces(targetFromPos,true);var lineDiff=targetToPos.line-targetCursor.line;sourceCursor.line+=lineDiff;targetCursor.line+=lineDiff;if(lineDiff<0){sourceCursor.column=sourceLines.getLineLength(sourceCursor.line);targetCursor.column=targetLines.getLineLength(targetCursor.line)}else{assert.strictEqual(lineDiff,0)}while(comparePos(targetToPos,targetCursor)<0&&targetLines.prevPos(targetCursor,true)){assert.ok(sourceLines.prevPos(sourceCursor,true));assert.strictEqual(sourceLines.charAt(sourceCursor),targetLines.charAt(targetCursor))}}return sourceCursor}},{"./lines":151,"./types":157,"./util":158,assert:94}],153:[function(require,module,exports){var defaults={esprima:require("esprima-fb"),tabWidth:4,useTabs:false,reuseWhitespace:true,wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:false,tolerant:true},hasOwn=defaults.hasOwnProperty;exports.normalize=function(options){options=options||defaults;function get(key){return hasOwn.call(options,key)?options[key]:defaults[key]}return{tabWidth:+get("tabWidth"),useTabs:!!get("useTabs"),reuseWhitespace:!!get("reuseWhitespace"),wrapColumn:Math.max(get("wrapColumn"),0),sourceFileName:get("sourceFileName"),sourceMapName:get("sourceMapName"),sourceRoot:get("sourceRoot"),inputSourceMap:get("inputSourceMap"),esprima:get("esprima"),range:get("range"),tolerant:get("tolerant")}}},{"esprima-fb":149}],154:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var b=types.builders;var isObject=types.builtInTypes.object;var isArray=types.builtInTypes.array;var isFunction=types.builtInTypes.function;var Patcher=require("./patcher").Patcher;var normalizeOptions=require("./options").normalize;var fromString=require("./lines").fromString;var attachComments=require("./comments").attach;exports.parse=function parse(source,options){options=normalizeOptions(options);var lines=fromString(source,options);var sourceWithoutTabs=lines.toString({tabWidth:options.tabWidth,reuseWhitespace:false,useTabs:false});var program=options.esprima.parse(sourceWithoutTabs,{loc:true,range:options.range,comment:true,tolerant:options.tolerant});var comments=program.comments;delete program.comments;var file=b.file(program);file.loc={lines:lines,indent:0,start:lines.firstPos(),end:lines.lastPos()};var copy=new TreeCopier(lines).copy(file);attachComments(comments,copy.program,lines);return copy};function TreeCopier(lines){assert.ok(this instanceof TreeCopier);this.lines=lines;this.indent=0}var TCp=TreeCopier.prototype;TCp.copy=function(node){if(isArray.check(node)){return node.map(this.copy,this)}if(!isObject.check(node)){return node}if(n.MethodDefinition&&n.MethodDefinition.check(node)||n.Property.check(node)&&(node.method||node.shorthand)){node.value.loc=null;if(n.FunctionExpression.check(node.value)){node.value.id=null}}var copy=Object.create(Object.getPrototypeOf(node),{original:{value:node,configurable:false,enumerable:false,writable:true}});var loc=node.loc;var oldIndent=this.indent;var newIndent=oldIndent;if(loc){if(loc.start.line<1){loc.start.line=1}if(loc.end.line<1){loc.end.line=1}if(this.lines.isPrecededOnlyByWhitespace(loc.start)){newIndent=this.indent=loc.start.column}loc.lines=this.lines;loc.indent=newIndent}var keys=Object.keys(node);var keyCount=keys.length;for(var i=0;i<keyCount;++i){var key=keys[i];if(key==="loc"){copy[key]=node[key]}else if(key==="comments"){}else{copy[key]=this.copy(node[key])}}this.indent=oldIndent;if(node.comments){Object.defineProperty(copy,"comments",{value:node.comments,enumerable:false})}return copy}},{"./comments":150,"./lines":151,"./options":153,"./patcher":155,"./types":157,assert:94}],155:[function(require,module,exports){var assert=require("assert");var linesModule=require("./lines");var types=require("./types");var getFieldValue=types.getFieldValue;var Node=types.namedTypes.Node;var Expression=types.namedTypes.Expression;var SourceLocation=types.namedTypes.SourceLocation;var util=require("./util");var comparePos=util.comparePos;var NodePath=types.NodePath;var isObject=types.builtInTypes.object;var isArray=types.builtInTypes.array;var isString=types.builtInTypes.string;function Patcher(lines){assert.ok(this instanceof Patcher);assert.ok(lines instanceof linesModule.Lines);var self=this,replacements=[];self.replace=function(loc,lines){if(isString.check(lines))lines=linesModule.fromString(lines);replacements.push({lines:lines,start:loc.start,end:loc.end})};self.get=function(loc){loc=loc||{start:{line:1,column:0},end:{line:lines.length,column:lines.getLineLength(lines.length)}};var sliceFrom=loc.start,toConcat=[];function pushSlice(from,to){assert.ok(comparePos(from,to)<=0);toConcat.push(lines.slice(from,to))}replacements.sort(function(a,b){return comparePos(a.start,b.start)}).forEach(function(rep){if(comparePos(sliceFrom,rep.start)>0){}else{pushSlice(sliceFrom,rep.start);toConcat.push(rep.lines);sliceFrom=rep.end}});pushSlice(sliceFrom,loc.end);return linesModule.concat(toConcat)}}exports.Patcher=Patcher;exports.getReprinter=function(path){assert.ok(path instanceof NodePath);var node=path.value;if(!Node.check(node))return;var orig=node.original;var origLoc=orig&&orig.loc;var lines=origLoc&&origLoc.lines;var reprints=[];if(!lines||!findReprints(path,reprints))return;return function(print){var patcher=new Patcher(lines);reprints.forEach(function(reprint){var old=reprint.oldPath.value;SourceLocation.assert(old.loc,true);patcher.replace(old.loc,print(reprint.newPath).indentTail(old.loc.indent))});return patcher.get(origLoc).indentTail(-orig.loc.indent)}};function findReprints(newPath,reprints){var newNode=newPath.value;
Node.assert(newNode);var oldNode=newNode.original;Node.assert(oldNode);assert.deepEqual(reprints,[]);if(newNode.type!==oldNode.type){return false}var oldPath=new NodePath(oldNode);var canReprint=findChildReprints(newPath,oldPath,reprints);if(!canReprint){reprints.length=0}return canReprint}function findAnyReprints(newPath,oldPath,reprints){var newNode=newPath.value;var oldNode=oldPath.value;if(newNode===oldNode)return true;if(isArray.check(newNode))return findArrayReprints(newPath,oldPath,reprints);if(isObject.check(newNode))return findObjectReprints(newPath,oldPath,reprints);return false}function findArrayReprints(newPath,oldPath,reprints){var newNode=newPath.value;var oldNode=oldPath.value;isArray.assert(newNode);var len=newNode.length;if(!(isArray.check(oldNode)&&oldNode.length===len))return false;for(var i=0;i<len;++i)if(!findAnyReprints(newPath.get(i),oldPath.get(i),reprints))return false;return true}function findObjectReprints(newPath,oldPath,reprints){var newNode=newPath.value;isObject.assert(newNode);if(newNode.original===null){return false}var oldNode=oldPath.value;if(!isObject.check(oldNode))return false;if(Node.check(newNode)){if(!Node.check(oldNode)){return false}if(!oldNode.loc){return false}if(newNode.type===oldNode.type){var childReprints=[];if(findChildReprints(newPath,oldPath,childReprints)){reprints.push.apply(reprints,childReprints)}else{reprints.push({newPath:newPath,oldPath:oldPath})}return true}if(Expression.check(newNode)&&Expression.check(oldNode)){reprints.push({newPath:newPath,oldPath:oldPath});return true}return false}return findChildReprints(newPath,oldPath,reprints)}var reusablePos={line:1,column:0};function hasOpeningParen(oldPath){var oldNode=oldPath.value;var loc=oldNode.loc;var lines=loc&&loc.lines;if(lines){var pos=reusablePos;pos.line=loc.start.line;pos.column=loc.start.column;while(lines.prevPos(pos)){var ch=lines.charAt(pos);if(ch==="("){var rootPath=oldPath;while(rootPath.parentPath)rootPath=rootPath.parentPath;return comparePos(rootPath.value.loc.start,pos)<=0}if(ch!==" "){return false}}}return false}function hasClosingParen(oldPath){var oldNode=oldPath.value;var loc=oldNode.loc;var lines=loc&&loc.lines;if(lines){var pos=reusablePos;pos.line=loc.end.line;pos.column=loc.end.column;do{var ch=lines.charAt(pos);if(ch===")"){var rootPath=oldPath;while(rootPath.parentPath)rootPath=rootPath.parentPath;return comparePos(pos,rootPath.value.loc.end)<=0}if(ch!==" "){return false}}while(lines.nextPos(pos))}return false}function hasParens(oldPath){return hasOpeningParen(oldPath)&&hasClosingParen(oldPath)}function findChildReprints(newPath,oldPath,reprints){var newNode=newPath.value;var oldNode=oldPath.value;isObject.assert(newNode);isObject.assert(oldNode);if(newNode.original===null){return false}if(!newPath.canBeFirstInStatement()&&newPath.firstInStatement()&&!hasOpeningParen(oldPath))return false;if(newPath.needsParens(true)&&!hasParens(oldPath)){return false}for(var k in util.getUnionOfKeys(newNode,oldNode)){if(k==="loc")continue;if(!findAnyReprints(newPath.get(k),oldPath.get(k),reprints))return false}return true}},{"./lines":151,"./types":157,"./util":158,assert:94}],156:[function(require,module,exports){var assert=require("assert");var sourceMap=require("source-map");var printComments=require("./comments").printComments;var linesModule=require("./lines");var fromString=linesModule.fromString;var concat=linesModule.concat;var normalizeOptions=require("./options").normalize;var getReprinter=require("./patcher").getReprinter;var types=require("./types");var namedTypes=types.namedTypes;var isString=types.builtInTypes.string;var isObject=types.builtInTypes.object;var NodePath=types.NodePath;var util=require("./util");function PrintResult(code,sourceMap){assert.ok(this instanceof PrintResult);isString.assert(code);this.code=code;if(sourceMap){isObject.assert(sourceMap);this.map=sourceMap}}var PRp=PrintResult.prototype;var warnedAboutToString=false;PRp.toString=function(){if(!warnedAboutToString){console.warn("Deprecation warning: recast.print now returns an object with "+"a .code property. You appear to be treating the object as a "+"string, which might still work but is strongly discouraged.");warnedAboutToString=true}return this.code};var emptyPrintResult=new PrintResult("");function Printer(originalOptions){assert.ok(this instanceof Printer);var explicitTabWidth=originalOptions&&originalOptions.tabWidth;var options=normalizeOptions(originalOptions);assert.notStrictEqual(options,originalOptions);options.sourceFileName=null;function printWithComments(path){assert.ok(path instanceof NodePath);return printComments(path.node.comments,print(path),options)}function print(path,includeComments){if(includeComments)return printWithComments(path);assert.ok(path instanceof NodePath);if(!explicitTabWidth){var oldTabWidth=options.tabWidth;var loc=path.node.loc;if(loc&&loc.lines&&loc.lines.guessTabWidth){options.tabWidth=loc.lines.guessTabWidth();var lines=maybeReprint(path);options.tabWidth=oldTabWidth;return lines}}return maybeReprint(path)}function maybeReprint(path){var reprinter=getReprinter(path);if(reprinter)return maybeAddParens(path,reprinter(maybeReprint));return printRootGenerically(path)}function printRootGenerically(path){return genericPrint(path,options,printWithComments)}function printGenerically(path){return genericPrint(path,options,printGenerically)}this.print=function(ast){if(!ast){return emptyPrintResult}var path=ast instanceof NodePath?ast:new NodePath(ast);var lines=print(path,true);return new PrintResult(lines.toString(options),util.composeSourceMaps(options.inputSourceMap,lines.getSourceMap(options.sourceMapName,options.sourceRoot)))};this.printGenerically=function(ast){if(!ast){return emptyPrintResult}var path=ast instanceof NodePath?ast:new NodePath(ast);var oldReuseWhitespace=options.reuseWhitespace;options.reuseWhitespace=false;var pr=new PrintResult(printGenerically(path).toString(options));options.reuseWhitespace=oldReuseWhitespace;return pr}}exports.Printer=Printer;function maybeAddParens(path,lines){return path.needsParens()?concat(["(",lines,")"]):lines}function genericPrint(path,options,printPath){assert.ok(path instanceof NodePath);return maybeAddParens(path,genericPrintNoParens(path,options,printPath))}function genericPrintNoParens(path,options,print){var n=path.value;if(!n){return fromString("")}if(typeof n==="string"){return fromString(n,options)}namedTypes.Node.assert(n);switch(n.type){case"File":path=path.get("program");n=path.node;namedTypes.Program.assert(n);case"Program":return maybeAddSemicolon(printStatementSequence(path.get("body"),options,print));case"EmptyStatement":return fromString("");case"ExpressionStatement":return concat([print(path.get("expression")),";"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return fromString(" ").join([print(path.get("left")),n.operator,print(path.get("right"))]);case"MemberExpression":var parts=[print(path.get("object"))];if(n.computed)parts.push("[",print(path.get("property")),"]");else parts.push(".",print(path.get("property")));return concat(parts);case"Path":return fromString(".").join(n.body);case"Identifier":return fromString(n.name,options);case"SpreadElement":case"SpreadElementPattern":case"SpreadProperty":case"SpreadPropertyPattern":return concat(["...",print(path.get("argument"))]);case"FunctionDeclaration":case"FunctionExpression":var parts=[];if(n.async)parts.push("async ");parts.push("function");if(n.generator)parts.push("*");if(n.id)parts.push(" ",print(path.get("id")));parts.push("(",printFunctionParams(path,options,print),") ",print(path.get("body")));return concat(parts);case"ArrowFunctionExpression":var parts=[];if(n.async)parts.push("async ");if(n.params.length===1){parts.push(print(path.get("params",0)))}else{parts.push("(",printFunctionParams(path,options,print),")")}parts.push(" => ",print(path.get("body")));return concat(parts);case"MethodDefinition":var parts=[];if(n.static){parts.push("static ")}parts.push(printMethod(n.kind,path.get("key"),path.get("value"),options,print));return concat(parts);case"YieldExpression":var parts=["yield"];if(n.delegate)parts.push("*");if(n.argument)parts.push(" ",print(path.get("argument")));return concat(parts);case"AwaitExpression":var parts=["await"];if(n.all)parts.push("*");if(n.argument)parts.push(" ",print(path.get("argument")));return concat(parts);case"ModuleDeclaration":var parts=["module",print(path.get("id"))];if(n.source){assert.ok(!n.body);parts.push("from",print(path.get("source")))}else{parts.push(print(path.get("body")))}return fromString(" ").join(parts);case"ImportSpecifier":case"ExportSpecifier":var parts=[print(path.get("id"))];if(n.name)parts.push(" as ",print(path.get("name")));return concat(parts);case"ExportBatchSpecifier":return fromString("*");case"ImportNamespaceSpecifier":return concat(["* as ",print(path.get("id"))]);case"ImportDefaultSpecifier":return print(path.get("id"));case"ExportDeclaration":var parts=["export"];if(n["default"]){parts.push(" default")}else if(n.specifiers&&n.specifiers.length>0){if(n.specifiers.length===1&&n.specifiers[0].type==="ExportBatchSpecifier"){parts.push(" *")}else{parts.push(" { ",fromString(", ").join(path.get("specifiers").map(print))," }")}if(n.source)parts.push(" from ",print(path.get("source")));parts.push(";");return concat(parts)}if(n.declaration){if(!namedTypes.Node.check(n.declaration)){console.log(JSON.stringify(n,null,2))}var decLines=print(path.get("declaration"));parts.push(" ",decLines);if(lastNonSpaceCharacter(decLines)!==";"){parts.push(";")}}return concat(parts);case"ImportDeclaration":var parts=["import "];if(n.specifiers&&n.specifiers.length>0){var foundImportSpecifier=false;path.get("specifiers").each(function(sp){if(sp.name>0){parts.push(", ")}if(namedTypes.ImportDefaultSpecifier.check(sp.value)||namedTypes.ImportNamespaceSpecifier.check(sp.value)){assert.strictEqual(foundImportSpecifier,false)}else{namedTypes.ImportSpecifier.assert(sp.value);if(!foundImportSpecifier){foundImportSpecifier=true;parts.push("{")}}parts.push(print(sp))});if(foundImportSpecifier){parts.push("}")}parts.push(" from ")}parts.push(print(path.get("source")),";");return concat(parts);case"BlockStatement":var naked=printStatementSequence(path.get("body"),options,print);if(naked.isEmpty())return fromString("{}");return concat(["{\n",naked.indent(options.tabWidth),"\n}"]);case"ReturnStatement":var parts=["return"];if(n.argument){var argLines=print(path.get("argument"));if(argLines.length>1&&namedTypes.XJSElement&&namedTypes.XJSElement.check(n.argument)){parts.push(" (\n",argLines.indent(options.tabWidth),"\n)")}else{parts.push(" ",argLines)}}parts.push(";");return concat(parts);case"CallExpression":return concat([print(path.get("callee")),printArgumentsList(path,options,print)]);case"ObjectExpression":case"ObjectPattern":var allowBreak=false,len=n.properties.length,parts=[len>0?"{\n":"{"];path.get("properties").map(function(childPath){var prop=childPath.value;var i=childPath.name;var lines=print(childPath).indent(options.tabWidth);var multiLine=lines.length>1;if(multiLine&&allowBreak){parts.push("\n")}parts.push(lines);if(i<len-1){parts.push(multiLine?",\n\n":",\n");allowBreak=!multiLine}});parts.push(len>0?"\n}":"}");return concat(parts);case"PropertyPattern":return concat([print(path.get("key")),": ",print(path.get("pattern"))]);case"Property":if(n.method||n.kind==="get"||n.kind==="set"){return printMethod(n.kind,path.get("key"),path.get("value"),options,print)}if(path.node.shorthand){return print(path.get("key"))}else{return concat([print(path.get("key")),": ",print(path.get("value"))])}case"ArrayExpression":case"ArrayPattern":var elems=n.elements,len=elems.length,parts=["["];path.get("elements").each(function(elemPath){var elem=elemPath.value;if(!elem){parts.push(",")}else{var i=elemPath.name;if(i>0)parts.push(" ");parts.push(print(elemPath));if(i<len-1)parts.push(",")}});parts.push("]");return concat(parts);case"SequenceExpression":return fromString(", ").join(path.get("expressions").map(print));case"ThisExpression":return fromString("this");case"Literal":if(typeof n.value!=="string")return fromString(n.value,options);case"ModuleSpecifier":return fromString(nodeStr(n),options);case"UnaryExpression":var parts=[n.operator];if(/[a-z]$/.test(n.operator))parts.push(" ");parts.push(print(path.get("argument")));return concat(parts);case"UpdateExpression":var parts=[print(path.get("argument")),n.operator];if(n.prefix)parts.reverse();return concat(parts);case"ConditionalExpression":return concat(["(",print(path.get("test"))," ? ",print(path.get("consequent"))," : ",print(path.get("alternate")),")"]);case"NewExpression":var parts=["new ",print(path.get("callee"))];var args=n.arguments;if(args){parts.push(printArgumentsList(path,options,print))}return concat(parts);case"VariableDeclaration":var parts=[n.kind," "];var maxLen=0;var printed=path.get("declarations").map(function(childPath){var lines=print(childPath);maxLen=Math.max(lines.length,maxLen);return lines});if(maxLen===1){parts.push(fromString(", ").join(printed))}else if(printed.length>1){parts.push(fromString(",\n").join(printed).indentTail(n.kind.length+1))}else{parts.push(printed[0])}var parentNode=path.parent&&path.parent.node;if(!namedTypes.ForStatement.check(parentNode)&&!namedTypes.ForInStatement.check(parentNode)&&!(namedTypes.ForOfStatement&&namedTypes.ForOfStatement.check(parentNode))){parts.push(";")}return concat(parts);case"VariableDeclarator":return n.init?fromString(" = ").join([print(path.get("id")),print(path.get("init"))]):print(path.get("id"));case"WithStatement":return concat(["with (",print(path.get("object")),") ",print(path.get("body"))]);case"IfStatement":var con=adjustClause(print(path.get("consequent")),options),parts=["if (",print(path.get("test")),")",con];if(n.alternate)parts.push(endsWithBrace(con)?" else":"\nelse",adjustClause(print(path.get("alternate")),options));return concat(parts);case"ForStatement":var init=print(path.get("init")),sep=init.length>1?";\n":"; ",forParen="for (",indented=fromString(sep).join([init,print(path.get("test")),print(path.get("update"))]).indentTail(forParen.length),head=concat([forParen,indented,")"]),clause=adjustClause(print(path.get("body")),options),parts=[head];if(head.length>1){parts.push("\n");clause=clause.trimLeft()}parts.push(clause);return concat(parts);case"WhileStatement":return concat(["while (",print(path.get("test")),")",adjustClause(print(path.get("body")),options)]);case"ForInStatement":return concat([n.each?"for each (":"for (",print(path.get("left"))," in ",print(path.get("right")),")",adjustClause(print(path.get("body")),options)]);case"ForOfStatement":return concat(["for (",print(path.get("left"))," of ",print(path.get("right")),")",adjustClause(print(path.get("body")),options)]);case"DoWhileStatement":var doBody=concat(["do",adjustClause(print(path.get("body")),options)]),parts=[doBody];if(endsWithBrace(doBody))parts.push(" while");else parts.push("\nwhile");parts.push(" (",print(path.get("test")),");");return concat(parts);case"BreakStatement":var parts=["break"];if(n.label)parts.push(" ",print(path.get("label")));parts.push(";");return concat(parts);case"ContinueStatement":var parts=["continue"];if(n.label)parts.push(" ",print(path.get("label")));parts.push(";");return concat(parts);case"LabeledStatement":return concat([print(path.get("label")),":\n",print(path.get("body"))]);case"TryStatement":var parts=["try ",print(path.get("block"))];path.get("handlers").each(function(handler){parts.push(" ",print(handler))});if(n.finalizer)parts.push(" finally ",print(path.get("finalizer")));return concat(parts);case"CatchClause":var parts=["catch (",print(path.get("param"))];if(n.guard)parts.push(" if ",print(path.get("guard")));parts.push(") ",print(path.get("body")));return concat(parts);case"ThrowStatement":return concat(["throw ",print(path.get("argument")),";"]);case"SwitchStatement":return concat(["switch (",print(path.get("discriminant")),") {\n",fromString("\n").join(path.get("cases").map(print)),"\n}"]);case"SwitchCase":var parts=[];if(n.test)parts.push("case ",print(path.get("test")),":");else parts.push("default:");if(n.consequent.length>0){parts.push("\n",printStatementSequence(path.get("consequent"),options,print).indent(options.tabWidth))}return concat(parts);case"DebuggerStatement":return fromString("debugger;");case"XJSAttribute":var parts=[print(path.get("name"))];if(n.value)parts.push("=",print(path.get("value")));return concat(parts);case"XJSIdentifier":return fromString(n.name,options);case"XJSNamespacedName":return fromString(":").join([print(path.get("namespace")),print(path.get("name"))]);case"XJSMemberExpression":return fromString(".").join([print(path.get("object")),print(path.get("property"))]);case"XJSSpreadAttribute":return concat(["{...",print(path.get("argument")),"}"]);case"XJSExpressionContainer":return concat(["{",print(path.get("expression")),"}"]);case"XJSElement":var openingLines=print(path.get("openingElement"));if(n.openingElement.selfClosing){assert.ok(!n.closingElement);return openingLines}var childLines=concat(path.get("children").map(function(childPath){var child=childPath.value;if(namedTypes.Literal.check(child)&&typeof child.value==="string"){if(/\S/.test(child.value)){return child.value.replace(/^\s+|\s+$/g,"")}else if(/\n/.test(child.value)){return"\n"}}return print(childPath)})).indentTail(options.tabWidth);var closingLines=print(path.get("closingElement"));return concat([openingLines,childLines,closingLines]);case"XJSOpeningElement":var parts=["<",print(path.get("name"))];var attrParts=[];path.get("attributes").each(function(attrPath){attrParts.push(" ",print(attrPath))});var attrLines=concat(attrParts);var needLineWrap=attrLines.length>1||attrLines.getLineLength(1)>options.wrapColumn;if(needLineWrap){attrParts.forEach(function(part,i){if(part===" "){assert.strictEqual(i%2,0);attrParts[i]="\n"}});attrLines=concat(attrParts).indentTail(options.tabWidth)}parts.push(attrLines,n.selfClosing?" />":">");return concat(parts);case"XJSClosingElement":return concat(["</",print(path.get("name")),">"]);case"XJSText":return fromString(n.value,options);case"XJSEmptyExpression":return fromString("");case"TypeAnnotatedIdentifier":var parts=[print(path.get("annotation"))," ",print(path.get("identifier"))];return concat(parts);case"ClassBody":if(n.body.length===0){return fromString("{}")}return concat(["{\n",printStatementSequence(path.get("body"),options,print).indent(options.tabWidth),"\n}"]);case"ClassPropertyDefinition":var parts=["static ",print(path.get("definition"))];if(!namedTypes.MethodDefinition.check(n.definition))parts.push(";");return concat(parts);case"ClassProperty":return concat([print(path.get("id")),";"]);case"ClassDeclaration":case"ClassExpression":var parts=["class"];if(n.id)parts.push(" ",print(path.get("id")));if(n.superClass)parts.push(" extends ",print(path.get("superClass")));parts.push(" ",print(path.get("body")));return concat(parts);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Block":case"Line":throw new Error("unprintable type: "+JSON.stringify(n.type));case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"TaggedTemplateExpression":case"TemplateElement":case"TemplateLiteral":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"AnyTypeAnnotation":case"BooleanTypeAnnotation":case"ClassImplements":case"DeclareClass":case"DeclareFunction":case"DeclareModule":case"DeclareVariable":case"FunctionTypeAnnotation":case"FunctionTypeParam":case"GenericTypeAnnotation":case"InterfaceDeclaration":case"InterfaceExtends":case"IntersectionTypeAnnotation":case"MemberTypeAnnotation":case"NullableTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"QualifiedTypeIdentifier":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"TupleTypeAnnotation":case"Type":case"TypeAlias":case"TypeAnnotation":case"TypeParameterDeclaration":case"TypeParameterInstantiation":case"TypeofTypeAnnotation":case"UnionTypeAnnotation":case"VoidTypeAnnotation":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:debugger;throw new Error("unknown type: "+JSON.stringify(n.type))}return p}function printStatementSequence(path,options,print){var inClassBody=path.parent&&namedTypes.ClassBody&&namedTypes.ClassBody.check(path.parent.node);var filtered=path.filter(function(stmtPath){var stmt=stmtPath.value;if(!stmt)return false;if(stmt.type==="EmptyStatement")return false;if(!inClassBody){namedTypes.Statement.assert(stmt)}return true});var prevTrailingSpace=null;var len=filtered.length;var parts=[];filtered.forEach(function(stmtPath,i){var printed=print(stmtPath);var stmt=stmtPath.value;var needSemicolon=true;var multiLine=printed.length>1;var notFirst=i>0;var notLast=i<len-1;var leadingSpace;var trailingSpace;if(inClassBody){var stmt=stmtPath.value;if(namedTypes.MethodDefinition.check(stmt)||namedTypes.ClassPropertyDefinition.check(stmt)&&namedTypes.MethodDefinition.check(stmt.definition)){needSemicolon=false}}if(needSemicolon){printed=maybeAddSemicolon(printed)}var trueLoc=options.reuseWhitespace&&getTrueLoc(stmt);var lines=trueLoc&&trueLoc.lines;if(notFirst){if(lines){var beforeStart=lines.skipSpaces(trueLoc.start,true);var beforeStartLine=beforeStart?beforeStart.line:1;var leadingGap=trueLoc.start.line-beforeStartLine;leadingSpace=Array(leadingGap+1).join("\n")}else{leadingSpace=multiLine?"\n\n":"\n"}}else{leadingSpace=""}if(notLast){if(lines){var afterEnd=lines.skipSpaces(trueLoc.end);var afterEndLine=afterEnd?afterEnd.line:lines.length;var trailingGap=afterEndLine-trueLoc.end.line;trailingSpace=Array(trailingGap+1).join("\n")}else{trailingSpace=multiLine?"\n\n":"\n"}}else{trailingSpace=""}parts.push(maxSpace(prevTrailingSpace,leadingSpace),printed);if(notLast){prevTrailingSpace=trailingSpace}else if(trailingSpace){parts.push(trailingSpace)}});return concat(parts)}function getTrueLoc(node){if(!node.loc){return null}if(!node.comments){return node.loc}var start=node.loc.start;var end=node.loc.end;node.comments.forEach(function(comment){if(comment.loc){if(util.comparePos(comment.loc.start,start)<0){start=comment.loc.start}if(util.comparePos(end,comment.loc.end)<0){end=comment.loc.end}}});return{lines:node.loc.lines,start:start,end:end}}function maxSpace(s1,s2){if(!s1&&!s2){return fromString("")}if(!s1){return fromString(s2)}if(!s2){return fromString(s1)}var spaceLines1=fromString(s1);var spaceLines2=fromString(s2);if(spaceLines2.length>spaceLines1.length){return spaceLines2}return spaceLines1}function printMethod(kind,keyPath,valuePath,options,print){var parts=[];var key=keyPath.value;var value=valuePath.value;namedTypes.FunctionExpression.assert(value);if(value.async){parts.push("async ")}if(!kind||kind==="init"){if(value.generator){parts.push("*")}}else{assert.ok(kind==="get"||kind==="set");parts.push(kind," ")}parts.push(print(keyPath),"(",printFunctionParams(valuePath,options,print),") ",print(valuePath.get("body")));return concat(parts)}function printArgumentsList(path,options,print){var printed=path.get("arguments").map(print);var joined=fromString(", ").join(printed);if(joined.getLineLength(1)>options.wrapColumn){joined=fromString(",\n").join(printed);return concat(["(\n",joined.indent(options.tabWidth),"\n)"])}return concat(["(",joined,")"])}function printFunctionParams(path,options,print){var fun=path.node;namedTypes.Function.assert(fun);var params=path.get("params");var defaults=path.get("defaults");var printed=params.map(defaults.value?function(param){var p=print(param);var d=defaults.get(param.name);return d.value?concat([p,"=",print(d)]):p}:print);if(fun.rest){printed.push(concat(["...",print(path.get("rest"))]))}var joined=fromString(", ").join(printed);if(joined.length>1||joined.getLineLength(1)>options.wrapColumn){joined=fromString(",\n").join(printed);return concat(["\n",joined.indent(options.tabWidth)])}return joined}function adjustClause(clause,options){if(clause.length>1)return concat([" ",clause]);return concat(["\n",maybeAddSemicolon(clause).indent(options.tabWidth)])}function lastNonSpaceCharacter(lines){var pos=lines.lastPos();do{var ch=lines.charAt(pos);if(/\S/.test(ch))return ch}while(lines.prevPos(pos))}function endsWithBrace(lines){return lastNonSpaceCharacter(lines)==="}"}function nodeStr(n){namedTypes.Literal.assert(n);isString.assert(n.value);return JSON.stringify(n.value)}function maybeAddSemicolon(lines){var eoc=lastNonSpaceCharacter(lines);if(!eoc||"\n};".indexOf(eoc)<0)return concat([lines,";"]);return lines}},{"./comments":150,"./lines":151,"./options":153,"./patcher":155,"./types":157,"./util":158,assert:94,"source-map":168}],157:[function(require,module,exports){var types=require("ast-types");var def=types.Type.def;def("File").bases("Node").build("program").field("program",def("Program"));types.finalize();module.exports=types},{"ast-types":92}],158:[function(require,module,exports){var assert=require("assert");var getFieldValue=require("./types").getFieldValue;var sourceMap=require("source-map");var SourceMapConsumer=sourceMap.SourceMapConsumer;var SourceMapGenerator=sourceMap.SourceMapGenerator;var hasOwn=Object.prototype.hasOwnProperty;function getUnionOfKeys(){var result={};var argc=arguments.length;for(var i=0;i<argc;++i){var keys=Object.keys(arguments[i]);var keyCount=keys.length;for(var j=0;j<keyCount;++j){result[keys[j]]=true}}return result}exports.getUnionOfKeys=getUnionOfKeys;function comparePos(pos1,pos2){return pos1.line-pos2.line||pos1.column-pos2.column}exports.comparePos=comparePos;exports.composeSourceMaps=function(formerMap,latterMap){if(formerMap){if(!latterMap){return formerMap}}else{return latterMap||null}var smcFormer=new SourceMapConsumer(formerMap);var smcLatter=new SourceMapConsumer(latterMap);var smg=new SourceMapGenerator({file:latterMap.file,sourceRoot:latterMap.sourceRoot});var sourcesToContents={};smcLatter.eachMapping(function(mapping){var origPos=smcFormer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});var sourceName=origPos.source;if(sourceName===null){return}smg.addMapping({source:sourceName,original:{line:origPos.line,column:origPos.column},generated:{line:mapping.generatedLine,column:mapping.generatedColumn},name:mapping.name});var sourceContent=smcFormer.sourceContentFor(sourceName);if(sourceContent&&!hasOwn.call(sourcesToContents,sourceName)){sourcesToContents[sourceName]=sourceContent;smg.setSourceContent(sourceName,sourceContent)}});return smg.toJSON()}},{"./types":157,assert:94,"source-map":168}],159:[function(require,module,exports){(function(process){var types=require("./lib/types");var parse=require("./lib/parser").parse;var Printer=require("./lib/printer").Printer;function print(node,options){return new Printer(options).print(node)}function prettyPrint(node,options){return new Printer(options).printGenerically(node)}function run(transformer,options){return runFile(process.argv[2],transformer,options)}function runFile(path,transformer,options){require("fs").readFile(path,"utf-8",function(err,code){if(err){console.error(err);return}runString(code,transformer,options)})}function defaultWriteback(output){process.stdout.write(output)}function runString(code,transformer,options){var writeback=options&&options.writeback||defaultWriteback;transformer(parse(code,options),function(node){writeback(print(node,options).code)})}Object.defineProperties(exports,{parse:{enumerable:true,value:parse},visit:{enumerable:true,value:types.visit},print:{enumerable:true,value:print},prettyPrint:{enumerable:false,value:prettyPrint},types:{enumerable:false,value:types},run:{enumerable:false,value:run}})}).call(this,require("_process"))},{"./lib/parser":154,"./lib/printer":156,"./lib/types":157,_process:103,fs:93}],160:[function(require,module,exports){(function(process){var Stream=require("stream");exports=module.exports=through;through.through=through;function through(write,end,opts){write=write||function(data){this.queue(data)};end=end||function(){this.queue(null)};var ended=false,destroyed=false,buffer=[],_ended=false;var stream=new Stream;stream.readable=stream.writable=true;stream.paused=false;stream.autoDestroy=!(opts&&opts.autoDestroy===false);stream.write=function(data){write.call(this,data);return!stream.paused};function drain(){while(buffer.length&&!stream.paused){var data=buffer.shift();if(null===data)return stream.emit("end");else stream.emit("data",data)}}stream.queue=stream.push=function(data){if(_ended)return stream;if(data==null)_ended=true;buffer.push(data);drain();return stream};stream.on("end",function(){stream.readable=false;if(!stream.writable&&stream.autoDestroy)process.nextTick(function(){stream.destroy()})});function _end(){stream.writable=false;end.call(stream);if(!stream.readable&&stream.autoDestroy)stream.destroy()}stream.end=function(data){if(ended)return;ended=true;if(arguments.length)stream.write(data);_end();return stream};stream.destroy=function(){if(destroyed)return;destroyed=true;ended=true;buffer.length=0;stream.writable=stream.readable=false;stream.emit("close");return stream};stream.pause=function(){if(stream.paused)return;stream.paused=true;return stream};stream.resume=function(){if(stream.paused){stream.paused=false;stream.emit("resume")}drain();if(!stream.paused)stream.emit("drain");return stream};return stream}}).call(this,require("_process"))},{_process:103,stream:115}],161:[function(require,module,exports){!function(){var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";if(typeof regeneratorRuntime==="object"){return}var runtime=regeneratorRuntime=typeof exports==="undefined"?{}:exports;function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])}runtime.wrap=wrap;var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype;GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName="GeneratorFunction";runtime.isGeneratorFunction=function(genFun){var ctor=typeof genFun==="function"&&genFun.constructor;return ctor?ctor===GeneratorFunction||(ctor.displayName||ctor.name)==="GeneratorFunction":false};runtime.mark=function(genFun){genFun.__proto__=GeneratorFunctionPrototype;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){try{var info=this(arg);var value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){return doneResult()
}while(true){var delegate=context.delegate;if(delegate){try{var info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;var info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod){return iteratorMethod.call(iterable)}if(typeof iterable.next==="function"){return iterable}if(!isNaN(iterable.length)){var i=-1;function next(){while(++i<iterable.length){if(hasOwn.call(iterable,i)){next.value=iterable[i];next.done=false;return next}}next.value=undefined;next.done=true;return next}return next.next=next}}return{next:doneResult}}runtime.values=values;function doneResult(){return{value:undefined,done:true}}Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}()},{}],162:[function(require,module,exports){var regenerate=require("regenerate");exports.REGULAR={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,65535),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)};exports.UNICODE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)};exports.UNICODE_IGNORE_CASE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:164}],163:[function(require,module,exports){module.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},{}],164:[function(require,module,exports){(function(global){(function(root){var freeExports=typeof exports=="object"&&exports;var freeModule=typeof module=="object"&&module&&module.exports==freeExports&&module;var freeGlobal=typeof global=="object"&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal){root=freeGlobal}var ERRORS={rangeOrder:"A range’s `stop` value must be greater than or equal "+"to the `start` value.",codePointRange:"Invalid code point value. Code points range from "+"U+000000 to U+10FFFF."};var HIGH_SURROGATE_MIN=55296;var HIGH_SURROGATE_MAX=56319;var LOW_SURROGATE_MIN=56320;var LOW_SURROGATE_MAX=57343;var regexNull=/\\x00([^0123456789]|$)/g;var object={};var hasOwnProperty=object.hasOwnProperty;var extend=function(destination,source){var key;for(key in source){if(hasOwnProperty.call(source,key)){destination[key]=source[key]}}return destination};var forEach=function(array,callback){var index=-1;var length=array.length;while(++index<length){callback(array[index],index)}};var toString=object.toString;var isArray=function(value){return toString.call(value)=="[object Array]"};var isNumber=function(value){return typeof value=="number"||toString.call(value)=="[object Number]"};var zeroes="0000";var pad=function(number,totalCharacters){var string=String(number);return string.length<totalCharacters?(zeroes+string).slice(-totalCharacters):string};var hex=function(number){return Number(number).toString(16).toUpperCase()};var slice=[].slice;var dataFromCodePoints=function(codePoints){var index=-1;var length=codePoints.length;var max=length-1;var result=[];var isStart=true;var tmp;var previous=0;while(++index<length){tmp=codePoints[index];if(isStart){result.push(tmp);previous=tmp;isStart=false}else{if(tmp==previous+1){if(index!=max){previous=tmp;continue}else{isStart=true;result.push(tmp+1)}}else{result.push(previous+1,tmp);previous=tmp}}}if(!isStart){result.push(tmp+1)}return result};var dataRemove=function(data,codePoint){var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){if(codePoint==start){if(end==start+1){data.splice(index,2);return data}else{data[index]=codePoint+1;return data}}else if(codePoint==end-1){data[index+1]=codePoint;return data}else{data.splice(index,2,start,codePoint,codePoint+1,end);return data}}index+=2}return data};var dataRemoveRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}var index=0;var start;var end;while(index<data.length){start=data[index];end=data[index+1]-1;if(start>rangeEnd){return data}if(rangeStart<=start&&rangeEnd>=end){data.splice(index,2);continue}if(rangeStart>=start&&rangeEnd<end){if(rangeStart==start){data[index]=rangeEnd+1;data[index+1]=end+1;return data}data.splice(index,2,start,rangeStart,rangeEnd+1,end+1);return data}if(rangeStart>=start&&rangeStart<=end){data[index+1]=rangeStart}else if(rangeEnd>=start&&rangeEnd<=end){data[index]=rangeEnd+1;return data}index+=2}return data};var dataAdd=function(data,codePoint){var index=0;var start;var end;var lastIndex=null;var length=data.length;if(codePoint<0||codePoint>1114111){throw RangeError(ERRORS.codePointRange)}while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return data}if(codePoint==start-1){data[index]=codePoint;return data}if(start>codePoint){data.splice(lastIndex!=null?lastIndex+2:0,0,codePoint,codePoint+1);return data}if(codePoint==end){if(codePoint+1==data[index+2]){data.splice(index,4,start,data[index+3]);return data}data[index+1]=codePoint+1;return data}lastIndex=index;index+=2}data.push(codePoint,codePoint+1);return data};var dataAddData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataAdd(data,start)}else{data=dataAddRange(data,start,end)}index+=2}return data};var dataRemoveData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataRemove(data,start)}else{data=dataRemoveRange(data,start,end)}index+=2}return data};var dataAddRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}if(rangeStart<0||rangeStart>1114111||rangeEnd<0||rangeEnd>1114111){throw RangeError(ERRORS.codePointRange)}var index=0;var start;var end;var added=false;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(added){if(start==rangeEnd+1){data.splice(index-1,2);return data}if(start>rangeEnd){return data}if(start>=rangeStart&&start<=rangeEnd){if(end>rangeStart&&end-1<=rangeEnd){data.splice(index,2);index-=2}else{data.splice(index-1,2);index-=2}}}else if(start==rangeEnd+1){data[index]=rangeStart;return data}else if(start>rangeEnd){data.splice(index,0,rangeStart,rangeEnd+1);return data}else if(rangeStart>=start&&rangeStart<end&&rangeEnd+1<=end){return data}else if(rangeStart>=start&&rangeStart<end||end==rangeStart){data[index+1]=rangeEnd+1;added=true}else if(rangeStart<=start&&rangeEnd+1>=end){data[index]=rangeStart;data[index+1]=rangeEnd+1;added=true}index+=2}if(!added){data.push(rangeStart,rangeEnd+1)}return data};var dataContains=function(data,codePoint){var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return true}index+=2}return false};var dataIntersection=function(data,codePoints){var index=0;var length=codePoints.length;var codePoint;var result=[];while(index<length){codePoint=codePoints[index];if(dataContains(data,codePoint)){result.push(codePoint)}++index}return dataFromCodePoints(result)};var dataIsEmpty=function(data){return!data.length};var dataIsSingleton=function(data){return data.length==2&&data[0]+1==data[1]};var dataToArray=function(data){var index=0;var start;var end;var result=[];var length=data.length;while(index<length){start=data[index];end=data[index+1];while(start<end){result.push(start);++start}index+=2}return result};var floor=Math.floor;var highSurrogate=function(codePoint){return parseInt(floor((codePoint-65536)/1024)+HIGH_SURROGATE_MIN,10)};var lowSurrogate=function(codePoint){return parseInt((codePoint-65536)%1024+LOW_SURROGATE_MIN,10)};var stringFromCharCode=String.fromCharCode;var codePointToString=function(codePoint){var string;if(codePoint==9){string="\\t"}else if(codePoint==10){string="\\n"}else if(codePoint==12){string="\\f"}else if(codePoint==13){string="\\r"}else if(codePoint==92){string="\\\\"}else if(codePoint==36||codePoint>=40&&codePoint<=43||codePoint==45||codePoint==46||codePoint==63||codePoint>=91&&codePoint<=94||codePoint>=123&&codePoint<=125){string="\\"+stringFromCharCode(codePoint)}else if(codePoint>=32&&codePoint<=126){string=stringFromCharCode(codePoint)}else if(codePoint<=255){string="\\x"+pad(hex(codePoint),2)}else{string="\\u"+pad(hex(codePoint),4)}return string};var symbolToCodePoint=function(symbol){var length=symbol.length;var first=symbol.charCodeAt(0);var second;if(first>=HIGH_SURROGATE_MIN&&first<=HIGH_SURROGATE_MAX&&length>1){second=symbol.charCodeAt(1);return(first-HIGH_SURROGATE_MIN)*1024+second-LOW_SURROGATE_MIN+65536}return first};var createBMPCharacterClasses=function(data){var result="";var index=0;var start;var end;var length=data.length;if(dataIsSingleton(data)){return codePointToString(data[0])}while(index<length){start=data[index];end=data[index+1]-1;if(start==end){result+=codePointToString(start)}else if(start+1==end){result+=codePointToString(start)+codePointToString(end)}else{result+=codePointToString(start)+"-"+codePointToString(end)}index+=2}return"["+result+"]"};var splitAtBMP=function(data){var loneHighSurrogates=[];var bmp=[];var astral=[];var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1]-1;if(start<=65535&&end<=65535){if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){if(end<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,end+1)}else{loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);bmp.push(HIGH_SURROGATE_MAX+1,end+1)}}else if(end>=HIGH_SURROGATE_MIN&&end<=HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN);loneHighSurrogates.push(HIGH_SURROGATE_MIN,end+1)}else if(start<HIGH_SURROGATE_MIN&&end>HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1,end+1);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1)}else{bmp.push(start,end+1)}}else if(start<=65535&&end>65535){if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);bmp.push(HIGH_SURROGATE_MAX+1,65535+1)}else if(start<HIGH_SURROGATE_MIN){bmp.push(start,HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1,65535+1);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1)}else{bmp.push(start,65535+1)}astral.push(65535+1,end+1)}else{astral.push(start,end+1)}index+=2}return{loneHighSurrogates:loneHighSurrogates,bmp:bmp,astral:astral}};var optimizeSurrogateMappings=function(surrogateMappings){var result=[];var tmpLow=[];var addLow=false;var mapping;var nextMapping;var highSurrogates;var lowSurrogates;var nextHighSurrogates;var nextLowSurrogates;var index=-1;var length=surrogateMappings.length;while(++index<length){mapping=surrogateMappings[index];nextMapping=surrogateMappings[index+1];if(!nextMapping){result.push(mapping);continue}highSurrogates=mapping[0];lowSurrogates=mapping[1];nextHighSurrogates=nextMapping[0];nextLowSurrogates=nextMapping[1];tmpLow=lowSurrogates;while(nextHighSurrogates&&highSurrogates[0]==nextHighSurrogates[0]&&highSurrogates[1]==nextHighSurrogates[1]){if(dataIsSingleton(nextLowSurrogates)){tmpLow=dataAdd(tmpLow,nextLowSurrogates[0])}else{tmpLow=dataAddRange(tmpLow,nextLowSurrogates[0],nextLowSurrogates[1]-1)}++index;mapping=surrogateMappings[index];highSurrogates=mapping[0];lowSurrogates=mapping[1];nextMapping=surrogateMappings[index+1];nextHighSurrogates=nextMapping&&nextMapping[0];nextLowSurrogates=nextMapping&&nextMapping[1];addLow=true}result.push([highSurrogates,addLow?tmpLow:lowSurrogates]);addLow=false}return optimizeByLowSurrogates(result)};var optimizeByLowSurrogates=function(surrogateMappings){if(surrogateMappings.length==1){return surrogateMappings}var index=-1;var innerIndex=-1;while(++index<surrogateMappings.length){var mapping=surrogateMappings[index];var lowSurrogates=mapping[1];var lowSurrogateStart=lowSurrogates[0];var lowSurrogateEnd=lowSurrogates[1];innerIndex=index;while(++innerIndex<surrogateMappings.length){var otherMapping=surrogateMappings[innerIndex];var otherLowSurrogates=otherMapping[1];var otherLowSurrogateStart=otherLowSurrogates[0];var otherLowSurrogateEnd=otherLowSurrogates[1];if(lowSurrogateStart==otherLowSurrogateStart&&lowSurrogateEnd==otherLowSurrogateEnd){if(dataIsSingleton(otherMapping[0])){mapping[0]=dataAdd(mapping[0],otherMapping[0][0])}else{mapping[0]=dataAddRange(mapping[0],otherMapping[0][0],otherMapping[0][1]-1)}surrogateMappings.splice(innerIndex,1);--innerIndex}}}return surrogateMappings};var surrogateSet=function(data){if(!data.length){return[]}var index=0;var start;var end;var startHigh;var startLow;var prevStartHigh=0;var prevEndHigh=0;var tmpLow=[];var endHigh;var endLow;var surrogateMappings=[];var length=data.length;var dataHigh=[];while(index<length){start=data[index];end=data[index+1]-1;startHigh=highSurrogate(start);startLow=lowSurrogate(start);endHigh=highSurrogate(end);endLow=lowSurrogate(end);var startsWithLowestLowSurrogate=startLow==LOW_SURROGATE_MIN;var endsWithHighestLowSurrogate=endLow==LOW_SURROGATE_MAX;var complete=false;if(startHigh==endHigh||startsWithLowestLowSurrogate&&endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh,endHigh+1],[startLow,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh,startHigh+1],[startLow,LOW_SURROGATE_MAX+1]])}if(!complete&&startHigh+1<endHigh){if(endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh+1,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh+1,endHigh],[LOW_SURROGATE_MIN,LOW_SURROGATE_MAX+1]])}}if(!complete){surrogateMappings.push([[endHigh,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]])}prevStartHigh=startHigh;prevEndHigh=endHigh;index+=2}return optimizeSurrogateMappings(surrogateMappings)};var createSurrogateCharacterClasses=function(surrogateMappings){var result=[];forEach(surrogateMappings,function(surrogateMapping){var highSurrogates=surrogateMapping[0];var lowSurrogates=surrogateMapping[1];result.push(createBMPCharacterClasses(highSurrogates)+createBMPCharacterClasses(lowSurrogates))});return result.join("|")};var createCharacterClassesFromData=function(data){var result=[];var parts=splitAtBMP(data);var loneHighSurrogates=parts.loneHighSurrogates;var bmp=parts.bmp;var astral=parts.astral;var hasAstral=!dataIsEmpty(parts.astral);var hasLoneSurrogates=!dataIsEmpty(loneHighSurrogates);var surrogateMappings=surrogateSet(astral);if(!hasAstral&&hasLoneSurrogates){bmp=dataAddData(bmp,loneHighSurrogates)}if(!dataIsEmpty(bmp)){result.push(createBMPCharacterClasses(bmp))}if(surrogateMappings.length){result.push(createSurrogateCharacterClasses(surrogateMappings))}if(hasAstral&&hasLoneSurrogates){result.push(createBMPCharacterClasses(loneHighSurrogates))}return result.join("|")};var regenerate=function(value){if(arguments.length>1){value=slice.call(arguments)}if(this instanceof regenerate){this.data=[];return value?this.add(value):this}return(new regenerate).add(value)};regenerate.version="1.0.1";var proto=regenerate.prototype;extend(proto,{add:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataAddData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.add(item)});return $this}$this.data=dataAdd($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},remove:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataRemoveData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.remove(item)});return $this}$this.data=dataRemove($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},addRange:function(start,end){var $this=this;$this.data=dataAddRange($this.data,isNumber(start)?start:symbolToCodePoint(start),isNumber(end)?end:symbolToCodePoint(end));return $this},removeRange:function(start,end){var $this=this;var startCodePoint=isNumber(start)?start:symbolToCodePoint(start);var endCodePoint=isNumber(end)?end:symbolToCodePoint(end);$this.data=dataRemoveRange($this.data,startCodePoint,endCodePoint);return $this},intersection:function(argument){var $this=this;var array=argument instanceof regenerate?dataToArray(argument.data):argument;$this.data=dataIntersection($this.data,array);return $this},contains:function(codePoint){return dataContains(this.data,isNumber(codePoint)?codePoint:symbolToCodePoint(codePoint))},clone:function(){var set=new regenerate;set.data=this.data.slice(0);return set},toString:function(){var result=createCharacterClassesFromData(this.data);return result.replace(regexNull,"\\0$1")},toRegExp:function(flags){return RegExp(this.toString(),flags||"")},valueOf:function(){return dataToArray(this.data)}});proto.toArray=proto.valueOf;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return regenerate})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=regenerate}else{freeExports.regenerate=regenerate}}else{root.regenerate=regenerate}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(require,module,exports){(function(global){(function(){"use strict";var objectTypes={"function":true,object:true};var root=objectTypes[typeof window]&&window||this;var oldRoot=root;var freeExports=objectTypes[typeof exports]&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)){root=freeGlobal}var stringFromCharCode=String.fromCharCode;var floor=Math.floor;function fromCodePoint(){var MAX_SIZE=16384;var codeUnits=[];var highSurrogate;var lowSurrogate;var index=-1;var length=arguments.length;if(!length){return""}var result="";while(++index<length){var codePoint=Number(arguments[index]);if(!isFinite(codePoint)||codePoint<0||codePoint>1114111||floor(codePoint)!=codePoint){throw RangeError("Invalid code point: "+codePoint)}if(codePoint<=65535){codeUnits.push(codePoint)}else{codePoint-=65536;highSurrogate=(codePoint>>10)+55296;lowSurrogate=codePoint%1024+56320;codeUnits.push(highSurrogate,lowSurrogate)}if(index+1==length||codeUnits.length>MAX_SIZE){result+=stringFromCharCode.apply(null,codeUnits);codeUnits.length=0}}return result}function assertType(type,expected){if(expected.indexOf("|")==-1){if(type==expected){return}throw Error("Invalid node type: "+type)}expected=assertType.hasOwnProperty(expected)?assertType[expected]:assertType[expected]=RegExp("^(?:"+expected+")$");if(expected.test(type)){return}throw Error("Invalid node type: "+type)}function generate(node){var type=node.type;if(generate.hasOwnProperty(type)&&typeof generate[type]=="function"){return generate[type](node)}throw Error("Invalid node type: "+type)}function generateAlternative(node){assertType(node.type,"alternative");var terms=node.body,length=terms?terms.length:0;if(length==1){return generateTerm(terms[0])}else{var i=-1,result="";while(++i<length){result+=generateTerm(terms[i])}return result}}function generateAnchor(node){assertType(node.type,"anchor");switch(node.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function generateAtom(node){assertType(node.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value");return generate(node)}function generateCharacterClass(node){assertType(node.type,"characterClass");var classRanges=node.body,length=classRanges?classRanges.length:0;var i=-1,result="[";if(node.negative){result+="^"}while(++i<length){result+=generateClassAtom(classRanges[i])}result+="]";return result}function generateCharacterClassEscape(node){assertType(node.type,"characterClassEscape");return"\\"+node.value}function generateCharacterClassRange(node){assertType(node.type,"characterClassRange");var min=node.min,max=node.max;if(min.type=="characterClassRange"||max.type=="characterClassRange"){throw Error("Invalid character class range")}return generateClassAtom(min)+"-"+generateClassAtom(max)}function generateClassAtom(node){assertType(node.type,"anchor|characterClassEscape|characterClassRange|dot|value");return generate(node)}function generateDisjunction(node){assertType(node.type,"disjunction");var body=node.body,length=body?body.length:0;if(length==0){throw Error("No body")}else if(length==1){return generate(body[0])}else{var i=-1,result="";while(++i<length){if(i!=0){result+="|"}result+=generate(body[i])}return result}}function generateDot(node){assertType(node.type,"dot");return"."}function generateGroup(node){assertType(node.type,"group");var result="(";switch(node.behavior){case"normal":break;case"ignore":result+="?:";break;case"lookahead":result+="?=";break;case"negativeLookahead":result+="?!";break;default:throw Error("Invalid behaviour: "+node.behaviour)}var body=node.body,length=body?body.length:0;if(length==1){result+=generate(body[0])}else{var i=-1;while(++i<length){result+=generate(body[i])}}result+=")";return result}function generateQuantifier(node){assertType(node.type,"quantifier");var quantifier="",min=node.min,max=node.max;switch(max){case undefined:case null:switch(min){case 0:quantifier="*";break;case 1:quantifier="+";break;default:quantifier="{"+min+",}";break}break;default:if(min==max){quantifier="{"+min+"}"}else if(min==0&&max==1){quantifier="?"}else{quantifier="{"+min+","+max+"}"}break}if(!node.greedy){quantifier+="?"}return generateAtom(node.body[0])+quantifier}function generateReference(node){assertType(node.type,"reference");return"\\"+node.matchIndex}function generateTerm(node){assertType(node.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value");return generate(node)}function generateValue(node){assertType(node.type,"value");var kind=node.kind,codePoint=node.codePoint;switch(kind){case"controlLetter":return"\\c"+fromCodePoint(codePoint+64);case"hexadecimalEscape":return"\\x"+("00"+codePoint.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+fromCodePoint(codePoint);case"null":return"\\"+codePoint;case"octal":return"\\"+codePoint.toString(8);case"singleEscape":switch(codePoint){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+codePoint)}case"symbol":return fromCodePoint(codePoint);case"unicodeEscape":return"\\u"+("0000"+codePoint.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+codePoint.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+kind)}}generate.alternative=generateAlternative;generate.anchor=generateAnchor;generate.characterClass=generateCharacterClass;generate.characterClassEscape=generateCharacterClassEscape;generate.characterClassRange=generateCharacterClassRange;generate.disjunction=generateDisjunction;generate.dot=generateDot;generate.group=generateGroup;generate.quantifier=generateQuantifier;generate.reference=generateReference;generate.value=generateValue;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return{generate:generate}})}else if(freeExports&&freeModule){freeExports.generate=generate}else{root.regjsgen={generate:generate}}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],166:[function(require,module,exports){(function(){function parse(str,flags){var hasUnicodeFlag=(flags||"").indexOf("u")!==-1;var pos=0;var closedCaptureCounter=0;function addRaw(node){node.raw=str.substring(node.range[0],node.range[1]);return node}function updateRawStart(node,start){node.range[0]=start;return addRaw(node)}function createAnchor(kind,rawLength){return addRaw({type:"anchor",kind:kind,range:[pos-rawLength,pos]})
}function createValue(kind,codePoint,from,to){return addRaw({type:"value",kind:kind,codePoint:codePoint,range:[from,to]})}function createEscaped(kind,codePoint,value,fromOffset){fromOffset=fromOffset||0;return createValue(kind,codePoint,pos-(value.length+fromOffset),pos)}function createCharacter(matches){var _char=matches[0];var first=_char.charCodeAt(0);if(hasUnicodeFlag){var second;if(_char.length===1&&first>=55296&&first<=56319){second=lookahead().charCodeAt(0);if(second>=56320&&second<=57343){pos++;return createValue("symbol",(first-55296)*1024+second-56320+65536,pos-2,pos)}}}return createValue("symbol",first,pos-1,pos)}function createDisjunction(alternatives,from,to){return addRaw({type:"disjunction",body:alternatives,range:[from,to]})}function createDot(){return addRaw({type:"dot",range:[pos-1,pos]})}function createCharacterClassEscape(value){return addRaw({type:"characterClassEscape",value:value,range:[pos-2,pos]})}function createReference(matchIndex){return addRaw({type:"reference",matchIndex:parseInt(matchIndex,10),range:[pos-1-matchIndex.length,pos]})}function createGroup(behavior,disjunction,from,to){return addRaw({type:"group",behavior:behavior,body:disjunction,range:[from,to]})}function createQuantifier(min,max,from,to){if(to==null){from=pos-1;to=pos}return addRaw({type:"quantifier",min:min,max:max,greedy:true,body:null,range:[from,to]})}function createAlternative(terms,from,to){return addRaw({type:"alternative",body:terms,range:[from,to]})}function createCharacterClass(classRanges,negative,from,to){return addRaw({type:"characterClass",body:classRanges,negative:negative,range:[from,to]})}function createClassRange(min,max,from,to){if(min.codePoint>max.codePoint){throw SyntaxError("invalid range in character class")}return addRaw({type:"characterClassRange",min:min,max:max,range:[from,to]})}function flattenBody(body){if(body.type==="alternative"){return body.body}else{return[body]}}function isEmpty(obj){return obj.type==="empty"}function incr(amount){amount=amount||1;var res=str.substring(pos,pos+amount);pos+=amount||1;return res}function skip(value){if(!match(value)){throw SyntaxError("character: "+value)}}function match(value){if(str.indexOf(value,pos)===pos){return incr(value.length)}}function lookahead(){return str[pos]}function current(value){return str.indexOf(value,pos)===pos}function next(value){return str[pos+1]===value}function matchReg(regExp){var subStr=str.substring(pos);var res=subStr.match(regExp);if(res){res.range=[];res.range[0]=pos;incr(res[0].length);res.range[1]=pos}return res}function parseDisjunction(){var res=[],from=pos;res.push(parseAlternative());while(match("|")){res.push(parseAlternative())}if(res.length===1){return res[0]}return createDisjunction(res,from,pos)}function parseAlternative(){var res=[],from=pos;var term;while(term=parseTerm()){res.push(term)}if(res.length===1){return res[0]}return createAlternative(res,from,pos)}function parseTerm(){if(pos>=str.length||current("|")||current(")")){return null}var anchor=parseAnchor();if(anchor){return anchor}var atom=parseAtom();if(!atom){throw SyntaxError("Expected atom")}var quantifier=parseQuantifier()||false;if(quantifier){quantifier.body=flattenBody(atom);updateRawStart(quantifier,atom.range[0]);return quantifier}return atom}function parseGroup(matchA,typeA,matchB,typeB){var type=null,from=pos;if(match(matchA)){type=typeA}else if(match(matchB)){type=typeB}else{return false}var body=parseDisjunction();if(!body){throw SyntaxError("Expected disjunction")}skip(")");var group=createGroup(type,flattenBody(body),from,pos);if(type=="normal"){closedCaptureCounter++}return group}function parseAnchor(){var res,from=pos;if(match("^")){return createAnchor("start",1)}else if(match("$")){return createAnchor("end",1)}else if(match("\\b")){return createAnchor("boundary",2)}else if(match("\\B")){return createAnchor("not-boundary",2)}else{return parseGroup("(?=","lookahead","(?!","negativeLookahead")}}function parseQuantifier(){var res;var quantifier;var min,max;if(match("*")){quantifier=createQuantifier(0)}else if(match("+")){quantifier=createQuantifier(1)}else if(match("?")){quantifier=createQuantifier(0,1)}else if(res=matchReg(/^\{([0-9]+)\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,min,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,undefined,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),([0-9]+)\}/)){min=parseInt(res[1],10);max=parseInt(res[2],10);if(min>max){throw SyntaxError("numbers out of order in {} quantifier")}quantifier=createQuantifier(min,max,res.range[0],res.range[1])}if(quantifier){if(match("?")){quantifier.greedy=false;quantifier.range[1]+=1}}return quantifier}function parseAtom(){var res;if(res=matchReg(/^[^^$\\.*+?(){[|]/)){return createCharacter(res)}else if(match(".")){return createDot()}else if(match("\\")){res=parseAtomEscape();if(!res){throw SyntaxError("atomEscape")}return res}else if(res=parseCharacterClass()){return res}else{return parseGroup("(?:","ignore","(","normal")}}function parseUnicodeSurrogatePairEscape(firstEscape){if(hasUnicodeFlag){var first,second;if(firstEscape.kind=="unicodeEscape"&&(first=firstEscape.codePoint)>=55296&&first<=56319&¤t("\\")&&next("u")){var prevPos=pos;pos++;var secondEscape=parseClassEscape();if(secondEscape.kind=="unicodeEscape"&&(second=secondEscape.codePoint)>=56320&&second<=57343){firstEscape.range[1]=secondEscape.range[1];firstEscape.codePoint=(first-55296)*1024+second-56320+65536;firstEscape.type="value";firstEscape.kind="unicodeCodePointEscape";addRaw(firstEscape)}else{pos=prevPos}}}return firstEscape}function parseClassEscape(){return parseAtomEscape(true)}function parseAtomEscape(insideCharacterClass){var res;res=parseDecimalEscape();if(res){return res}if(insideCharacterClass){if(match("b")){return createEscaped("singleEscape",8,"\\b")}else if(match("B")){throw SyntaxError("\\B not possible inside of CharacterClass")}}res=parseCharacterEscape();return res}function parseDecimalEscape(){var res,match;if(res=matchReg(/^(?!0)\d+/)){match=res[0];var refIdx=parseInt(res[0],10);if(refIdx<=closedCaptureCounter){return createReference(res[0])}else{incr(-res[0].length);if(res=matchReg(/^[0-7]{1,3}/)){return createEscaped("octal",parseInt(res[0],8),res[0],1)}else{res=createCharacter(matchReg(/^[89]/));return updateRawStart(res,res.range[0]-1)}}}else if(res=matchReg(/^[0-7]{1,3}/)){match=res[0];if(/^0{1,3}$/.test(match)){return createEscaped("null",0,"0",match.length+1)}else{return createEscaped("octal",parseInt(match,8),match,1)}}else if(res=matchReg(/^[dDsSwW]/)){return createCharacterClassEscape(res[0])}return false}function parseCharacterEscape(){var res;if(res=matchReg(/^[fnrtv]/)){var codePoint=0;switch(res[0]){case"t":codePoint=9;break;case"n":codePoint=10;break;case"v":codePoint=11;break;case"f":codePoint=12;break;case"r":codePoint=13;break}return createEscaped("singleEscape",codePoint,"\\"+res[0])}else if(res=matchReg(/^c([a-zA-Z])/)){return createEscaped("controlLetter",res[1].charCodeAt(0)%32,res[1],2)}else if(res=matchReg(/^x([0-9a-fA-F]{2})/)){return createEscaped("hexadecimalEscape",parseInt(res[1],16),res[1],2)}else if(res=matchReg(/^u([0-9a-fA-F]{4})/)){return parseUnicodeSurrogatePairEscape(createEscaped("unicodeEscape",parseInt(res[1],16),res[1],2))}else if(hasUnicodeFlag&&(res=matchReg(/^u\{([0-9a-fA-F]{1,})\}/))){return createEscaped("unicodeCodePointEscape",parseInt(res[1],16),res[1],4)}else{return parseIdentityEscape()}}function isIdentifierPart(ch){var NonAsciiIdentifierPart=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function parseIdentityEscape(){var ZWJ="";var ZWNJ="";var res;var tmp;if(!isIdentifierPart(lookahead())){tmp=incr();return createEscaped("identifier",tmp.charCodeAt(0),tmp,1)}if(match(ZWJ)){return createEscaped("identifier",8204,ZWJ)}else if(match(ZWNJ)){return createEscaped("identifier",8205,ZWNJ)}return null}function parseCharacterClass(){var res,from=pos;if(res=matchReg(/^\[\^/)){res=parseClassRanges();skip("]");return createCharacterClass(res,true,from,pos)}else if(match("[")){res=parseClassRanges();skip("]");return createCharacterClass(res,false,from,pos)}return null}function parseClassRanges(){var res;if(current("]")){return[]}else{res=parseNonemptyClassRanges();if(!res){throw SyntaxError("nonEmptyClassRanges")}return res}}function parseHelperClassRanges(atom){var from,to,res;if(current("-")&&!next("]")){skip("-");res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}to=pos;var classRanges=parseClassRanges();if(!classRanges){throw SyntaxError("classRanges")}from=atom.range[0];if(classRanges.type==="empty"){return[createClassRange(atom,res,from,to)]}return[createClassRange(atom,res,from,to)].concat(classRanges)}res=parseNonemptyClassRangesNoDash();if(!res){throw SyntaxError("nonEmptyClassRangesNoDash")}return[atom].concat(res)}function parseNonemptyClassRanges(){var atom=parseClassAtom();if(!atom){throw SyntaxError("classAtom")}if(current("]")){return[atom]}return parseHelperClassRanges(atom)}function parseNonemptyClassRangesNoDash(){var res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}if(current("]")){return res}return parseHelperClassRanges(res)}function parseClassAtom(){if(match("-")){return createCharacter("-")}else{return parseClassAtomNoDash()}}function parseClassAtomNoDash(){var res;if(res=matchReg(/^[^\\\]-]/)){return createCharacter(res[0])}else if(match("\\")){res=parseClassEscape();if(!res){throw SyntaxError("classEscape")}return parseUnicodeSurrogatePairEscape(res)}}str=String(str);if(str===""){str="(?:)"}var result=parseDisjunction();if(result.range[1]!==str.length){throw SyntaxError("Could not parse entire input - got stuck: "+str)}return result}var regjsparser={parse:parse};if(typeof module!=="undefined"&&module.exports){module.exports=regjsparser}else{window.regjsparser=regjsparser}})()},{}],167:[function(require,module,exports){var generate=require("regjsgen").generate;var parse=require("regjsparser").parse;var regenerate=require("regenerate");var iuMappings=require("./data/iu-mappings.json");var ESCAPE_SETS=require("./data/character-class-escape-sets.js");function getCharacterClassEscapeSet(character){if(unicode){if(ignoreCase){return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]}return ESCAPE_SETS.UNICODE[character]}return ESCAPE_SETS.REGULAR[character]}var object={};var hasOwnProperty=object.hasOwnProperty;function has(object,property){return hasOwnProperty.call(object,property)}var UNICODE_SET=regenerate().addRange(0,1114111);var BMP_SET=regenerate().addRange(0,65535);var DOT_SET_UNICODE=UNICODE_SET.clone().remove(10,13,8232,8233);var DOT_SET=DOT_SET_UNICODE.clone().intersection(BMP_SET);regenerate.prototype.iuAddRange=function(min,max){var $this=this;do{var folded=caseFold(min);if(folded){$this.add(folded)}}while(++min<=max);return $this};function assign(target,source){for(var key in source){target[key]=source[key]}}function update(item,pattern){var tree=parse(pattern,"");switch(tree.type){case"characterClass":case"group":case"value":break;default:tree=wrap(tree,pattern)}assign(item,tree)}function wrap(tree,pattern){return{type:"group",behavior:"ignore",body:[tree],raw:"(?:"+pattern+")"}}function caseFold(codePoint){return has(iuMappings,codePoint)?iuMappings[codePoint]:false}var ignoreCase=false;var unicode=false;function processCharacterClass(characterClassItem){var set=regenerate();var body=characterClassItem.body.forEach(function(item){switch(item.type){case"value":set.add(item.codePoint);if(ignoreCase&&unicode){var folded=caseFold(item.codePoint);if(folded){set.add(folded)}}break;case"characterClassRange":var min=item.min.codePoint;var max=item.max.codePoint;set.addRange(min,max);if(ignoreCase&&unicode){set.iuAddRange(min,max)}break;case"characterClassEscape":set.add(getCharacterClassEscapeSet(item.value));break;default:throw Error("Unknown term type: "+item.type)}});if(characterClassItem.negative){set=(unicode?UNICODE_SET:BMP_SET).clone().remove(set)}update(characterClassItem,set.toString());return characterClassItem}function processTerm(item){switch(item.type){case"dot":update(item,(unicode?DOT_SET_UNICODE:DOT_SET).toString());break;case"characterClass":item=processCharacterClass(item);break;case"characterClassEscape":update(item,getCharacterClassEscapeSet(item.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":item.body=item.body.map(processTerm);break;case"value":var codePoint=item.codePoint;var set=regenerate(codePoint);if(ignoreCase&&unicode){var folded=caseFold(codePoint);if(folded){set.add(folded)}}update(item,set.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+item.type)}return item}module.exports=function(pattern,flags){var tree=parse(pattern,flags);ignoreCase=flags?flags.indexOf("i")>-1:false;unicode=flags?flags.indexOf("u")>-1:false;assign(tree,processTerm(tree));return generate(tree)}},{"./data/character-class-escape-sets.js":162,"./data/iu-mappings.json":163,regenerate:164,regjsgen:165,regjsparser:166}],168:[function(require,module,exports){exports.SourceMapGenerator=require("./source-map/source-map-generator").SourceMapGenerator;exports.SourceMapConsumer=require("./source-map/source-map-consumer").SourceMapConsumer;exports.SourceNode=require("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":173,"./source-map/source-map-generator":174,"./source-map/source-node":175}],169:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");function ArraySet(){this._array=[];this._set={}}ArraySet.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet;for(var i=0,len=aArray.length;i<len;i++){set.add(aArray[i],aAllowDuplicates)}return set};ArraySet.prototype.add=function ArraySet_add(aStr,aAllowDuplicates){var isDuplicate=this.has(aStr);var idx=this._array.length;if(!isDuplicate||aAllowDuplicates){this._array.push(aStr)}if(!isDuplicate){this._set[util.toSetString(aStr)]=idx}};ArraySet.prototype.has=function ArraySet_has(aStr){return Object.prototype.hasOwnProperty.call(this._set,util.toSetString(aStr))};ArraySet.prototype.indexOf=function ArraySet_indexOf(aStr){if(this.has(aStr)){return this._set[util.toSetString(aStr)]}throw new Error('"'+aStr+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx<this._array.length){return this._array[aIdx]}throw new Error("No element indexed by "+aIdx)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};exports.ArraySet=ArraySet})},{"./util":176,amdefine:177}],170:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64=require("./base64");var VLQ_BASE_SHIFT=5;var VLQ_BASE=1<<VLQ_BASE_SHIFT;var VLQ_BASE_MASK=VLQ_BASE-1;var VLQ_CONTINUATION_BIT=VLQ_BASE;function toVLQSigned(aValue){return aValue<0?(-aValue<<1)+1:(aValue<<1)+0}function fromVLQSigned(aValue){var isNegative=(aValue&1)===1;var shifted=aValue>>1;return isNegative?-shifted:shifted}exports.encode=function base64VLQ_encode(aValue){var encoded="";var digit;var vlq=toVLQSigned(aValue);do{digit=vlq&VLQ_BASE_MASK;vlq>>>=VLQ_BASE_SHIFT;if(vlq>0){digit|=VLQ_CONTINUATION_BIT}encoded+=base64.encode(digit)}while(vlq>0);return encoded};exports.decode=function base64VLQ_decode(aStr,aOutParam){var i=0;var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do{if(i>=strLen){throw new Error("Expected more digits in base 64 VLQ value.")}digit=base64.decode(aStr.charAt(i++));continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<<shift);shift+=VLQ_BASE_SHIFT}while(continuation);aOutParam.value=fromVLQSigned(result);aOutParam.rest=aStr.slice(i)}})},{"./base64":171,amdefine:177}],171:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var charToIntMap={};var intToCharMap={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(ch,index){charToIntMap[ch]=index;intToCharMap[index]=ch});exports.encode=function base64_encode(aNumber){if(aNumber in intToCharMap){return intToCharMap[aNumber]}throw new TypeError("Must be between 0 and 63: "+aNumber)};exports.decode=function base64_decode(aChar){if(aChar in charToIntMap){return charToIntMap[aChar]}throw new TypeError("Not a valid base 64 digit: "+aChar)}})},{amdefine:177}],172:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){var mid=Math.floor((aHigh-aLow)/2)+aLow;var cmp=aCompare(aNeedle,aHaystack[mid],true);if(cmp===0){return aHaystack[mid]}else if(cmp>0){if(aHigh-mid>1){return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare)}return aHaystack[mid]}else{if(mid-aLow>1){return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare)}return aLow<0?null:aHaystack[aLow]}}exports.search=function search(aNeedle,aHaystack,aCompare){return aHaystack.length>0?recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare):null}})},{amdefine:177}],173:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");var binarySearch=require("./binary-search");var ArraySet=require("./array-set").ArraySet;var base64VLQ=require("./base64-vlq");function SourceMapConsumer(aSourceMap){var sourceMap=aSourceMap;if(typeof aSourceMap==="string"){sourceMap=JSON.parse(aSourceMap.replace(/^\)\]\}'/,""))}var version=util.getArg(sourceMap,"version");var sources=util.getArg(sourceMap,"sources");var names=util.getArg(sourceMap,"names",[]);var sourceRoot=util.getArg(sourceMap,"sourceRoot",null);var sourcesContent=util.getArg(sourceMap,"sourcesContent",null);var mappings=util.getArg(sourceMap,"mappings");var file=util.getArg(sourceMap,"file",null);if(version!=this._version){throw new Error("Unsupported version: "+version)}this._names=ArraySet.fromArray(names,true);this._sources=ArraySet.fromArray(sources,true);this.sourceRoot=sourceRoot;this.sourcesContent=sourcesContent;this._mappings=mappings;this.file=file}SourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(aSourceMap){var smc=Object.create(SourceMapConsumer.prototype);smc._names=ArraySet.fromArray(aSourceMap._names.toArray(),true);smc._sources=ArraySet.fromArray(aSourceMap._sources.toArray(),true);smc.sourceRoot=aSourceMap._sourceRoot;smc.sourcesContent=aSourceMap._generateSourcesContent(smc._sources.toArray(),smc.sourceRoot);smc.file=aSourceMap._file;smc.__generatedMappings=aSourceMap._mappings.slice().sort(util.compareByGeneratedPositions);smc.__originalMappings=aSourceMap._mappings.slice().sort(util.compareByOriginalPositions);return smc};SourceMapConsumer.prototype._version=3;Object.defineProperty(SourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map(function(s){return this.sourceRoot!=null?util.join(this.sourceRoot,s):s},this)}});SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._nextCharIsMappingSeparator=function SourceMapConsumer_nextCharIsMappingSeparator(aStr){var c=aStr.charAt(0);return c===";"||c===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(aStr,aSourceRoot){var generatedLine=1;var previousGeneratedColumn=0;var previousOriginalLine=0;var previousOriginalColumn=0;var previousSource=0;var previousName=0;var str=aStr;var temp={};var mapping;while(str.length>0){if(str.charAt(0)===";"){generatedLine++;str=str.slice(1);previousGeneratedColumn=0}else if(str.charAt(0)===","){str=str.slice(1)}else{mapping={};mapping.generatedLine=generatedLine;base64VLQ.decode(str,temp);mapping.generatedColumn=previousGeneratedColumn+temp.value;previousGeneratedColumn=mapping.generatedColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.source=this._sources.at(previousSource+temp.value);previousSource+=temp.value;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source, but no line and column")}base64VLQ.decode(str,temp);mapping.originalLine=previousOriginalLine+temp.value;previousOriginalLine=mapping.originalLine;mapping.originalLine+=1;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source and line, but no column")}base64VLQ.decode(str,temp);mapping.originalColumn=previousOriginalColumn+temp.value;previousOriginalColumn=mapping.originalColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.name=this._names.at(previousName+temp.value);previousName+=temp.value;str=temp.rest}}this.__generatedMappings.push(mapping);if(typeof mapping.originalLine==="number"){this.__originalMappings.push(mapping)}}}this.__generatedMappings.sort(util.compareByGeneratedPositions);this.__originalMappings.sort(util.compareByOriginalPositions)};SourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName,aColumnName,aComparator){if(aNeedle[aLineName]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+aNeedle[aLineName])}if(aNeedle[aColumnName]<0){throw new TypeError("Column must be greater than or equal to 0, got "+aNeedle[aColumnName])}return binarySearch.search(aNeedle,aMappings,aComparator)};SourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(aArgs){var needle={generatedLine:util.getArg(aArgs,"line"),generatedColumn:util.getArg(aArgs,"column")};var mapping=this._findMapping(needle,this._generatedMappings,"generatedLine","generatedColumn",util.compareByGeneratedPositions);if(mapping&&mapping.generatedLine===needle.generatedLine){var source=util.getArg(mapping,"source",null);if(source!=null&&this.sourceRoot!=null){source=util.join(this.sourceRoot,source)}return{source:source,line:util.getArg(mapping,"originalLine",null),column:util.getArg(mapping,"originalColumn",null),name:util.getArg(mapping,"name",null)}}return{source:null,line:null,column:null,name:null}};SourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(aSource){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){aSource=util.relative(this.sourceRoot,aSource)}if(this._sources.has(aSource)){return this.sourcesContent[this._sources.indexOf(aSource)]}var url;if(this.sourceRoot!=null&&(url=util.urlParse(this.sourceRoot))){var fileUriAbsPath=aSource.replace(/^file:\/\//,"");if(url.scheme=="file"&&this._sources.has(fileUriAbsPath)){return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]}if((!url.path||url.path=="/")&&this._sources.has("/"+aSource)){return this.sourcesContent[this._sources.indexOf("/"+aSource)]}}throw new Error('"'+aSource+'" is not in the SourceMap.')};SourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:util.getArg(aArgs,"column")};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var mapping=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(mapping){return{line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null)}}return{line:null,column:null}};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){var context=aContext||null;var order=aOrder||SourceMapConsumer.GENERATED_ORDER;var mappings;switch(order){case SourceMapConsumer.GENERATED_ORDER:mappings=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:mappings=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var sourceRoot=this.sourceRoot;mappings.map(function(mapping){var source=mapping.source;if(source!=null&&sourceRoot!=null){source=util.join(sourceRoot,source)}return{source:source,generatedLine:mapping.generatedLine,generatedColumn:mapping.generatedColumn,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:mapping.name}}).forEach(aCallback,context)};exports.SourceMapConsumer=SourceMapConsumer})},{"./array-set":169,"./base64-vlq":170,"./binary-search":172,"./util":176,amdefine:177}],174:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64VLQ=require("./base64-vlq");var util=require("./util");var ArraySet=require("./array-set").ArraySet;function SourceMapGenerator(aArgs){if(!aArgs){aArgs={}}this._file=util.getArg(aArgs,"file",null);this._sourceRoot=util.getArg(aArgs,"sourceRoot",null);this._sources=new ArraySet;this._names=new ArraySet;this._mappings=[];this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer){var sourceRoot=aSourceMapConsumer.sourceRoot;var generator=new SourceMapGenerator({file:aSourceMapConsumer.file,sourceRoot:sourceRoot});aSourceMapConsumer.eachMapping(function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}};if(mapping.source!=null){newMapping.source=mapping.source;if(sourceRoot!=null){newMapping.source=util.relative(sourceRoot,newMapping.source)}newMapping.original={line:mapping.originalLine,column:mapping.originalColumn};if(mapping.name!=null){newMapping.name=mapping.name}}generator.addMapping(newMapping)});aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){generator.setSourceContent(sourceFile,content)}});return generator};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated");var original=util.getArg(aArgs,"original",null);var source=util.getArg(aArgs,"source",null);var name=util.getArg(aArgs,"name",null);this._validateMapping(generated,original,source,name);if(source!=null&&!this._sources.has(source)){this._sources.add(source)}if(name!=null&&!this._names.has(name)){this._names.add(name)}this._mappings.push({generatedLine:generated.line,generatedColumn:generated.column,originalLine:original!=null&&original.line,originalColumn:original!=null&&original.column,source:source,name:name})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile;if(this._sourceRoot!=null){source=util.relative(this._sourceRoot,source)}if(aSourceContent!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile;if(aSourceFile==null){if(aSourceMapConsumer.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot;if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}var newSources=new ArraySet;var newNames=new ArraySet;this._mappings.forEach(function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});if(original.source!=null){mapping.source=original.source;if(aSourceMapPath!=null){mapping.source=util.join(aSourceMapPath,mapping.source)}if(sourceRoot!=null){mapping.source=util.relative(sourceRoot,mapping.source)}mapping.originalLine=original.line;mapping.originalColumn=original.column;if(original.name!=null){mapping.name=original.name}}}var source=mapping.source;if(source!=null&&!newSources.has(source)){newSources.add(source)}var name=mapping.name;if(name!=null&&!newNames.has(name)){newNames.add(name)}},this);this._sources=newSources;this._names=newNames;aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aSourceMapPath!=null){sourceFile=util.join(aSourceMapPath,sourceFile)}if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}this.setSourceContent(sourceFile,content)}},this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(aGenerated,aOriginal,aSource,aName){if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName){return}else if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0;var previousGeneratedLine=1;var previousOriginalColumn=0;var previousOriginalLine=0;var previousName=0;var previousSource=0;var result="";var mapping;this._mappings.sort(util.compareByGeneratedPositions);for(var i=0,len=this._mappings.length;i<len;i++){mapping=this._mappings[i];if(mapping.generatedLine!==previousGeneratedLine){previousGeneratedColumn=0;while(mapping.generatedLine!==previousGeneratedLine){result+=";";
previousGeneratedLine++}}else{if(i>0){if(!util.compareByGeneratedPositions(mapping,this._mappings[i-1])){continue}result+=","}}result+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn);previousGeneratedColumn=mapping.generatedColumn;if(mapping.source!=null){result+=base64VLQ.encode(this._sources.indexOf(mapping.source)-previousSource);previousSource=this._sources.indexOf(mapping.source);result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOriginalLine=mapping.originalLine-1;result+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn);previousOriginalColumn=mapping.originalColumn;if(mapping.name!=null){result+=base64VLQ.encode(this._names.indexOf(mapping.name)-previousName);previousName=this._names.indexOf(mapping.name)}}}return result};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map(function(source){if(!this._sourcesContents){return null}if(aSourceRoot!=null){source=util.relative(aSourceRoot,source)}var key=util.toSetString(source);return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null},this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)}return map};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this)};exports.SourceMapGenerator=SourceMapGenerator})},{"./array-set":169,"./base64-vlq":170,"./util":176,amdefine:177}],175:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var SourceMapGenerator=require("./source-map-generator").SourceMapGenerator;var util=require("./util");var REGEX_NEWLINE=/(\r?\n)/;var REGEX_CHARACTER=/\r\n|[\s\S]/g;function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;if(aChunks!=null)this.add(aChunks)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer,aRelativePath){var node=new SourceNode;var remainingLines=aGeneratedCode.split(REGEX_NEWLINE);var shiftNextLine=function(){var lineContents=remainingLines.shift();var newLine=remainingLines.shift()||"";return lineContents+newLine};var lastGeneratedLine=1,lastGeneratedColumn=0;var lastMapping=null;aSourceMapConsumer.eachMapping(function(mapping){if(lastMapping!==null){if(lastGeneratedLine<mapping.generatedLine){var code="";addMappingWithCode(lastMapping,shiftNextLine());lastGeneratedLine++;lastGeneratedColumn=0}else{var nextLine=remainingLines[0];var code=nextLine.substr(0,mapping.generatedColumn-lastGeneratedColumn);remainingLines[0]=nextLine.substr(mapping.generatedColumn-lastGeneratedColumn);lastGeneratedColumn=mapping.generatedColumn;addMappingWithCode(lastMapping,code);lastMapping=mapping;return}}while(lastGeneratedLine<mapping.generatedLine){node.add(shiftNextLine());lastGeneratedLine++}if(lastGeneratedColumn<mapping.generatedColumn){var nextLine=remainingLines[0];node.add(nextLine.substr(0,mapping.generatedColumn));remainingLines[0]=nextLine.substr(mapping.generatedColumn);lastGeneratedColumn=mapping.generatedColumn}lastMapping=mapping},this);if(remainingLines.length>0){if(lastMapping){addMappingWithCode(lastMapping,shiftNextLine())}node.add(remainingLines.join(""))}aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aRelativePath!=null){sourceFile=util.join(aRelativePath,sourceFile)}node.setSourceContent(sourceFile,content)}});return node;function addMappingWithCode(mapping,code){if(mapping===null||mapping.source===undefined){node.add(code)}else{var source=aRelativePath?util.join(aRelativePath,mapping.source):mapping.source;node.add(new SourceNode(mapping.originalLine,mapping.originalColumn,source,code,mapping.name))}}};SourceNode.prototype.add=function SourceNode_add(aChunk){if(Array.isArray(aChunk)){aChunk.forEach(function(chunk){this.add(chunk)},this)}else if(aChunk instanceof SourceNode||typeof aChunk==="string"){if(aChunk){this.children.push(aChunk)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.prepend=function SourceNode_prepend(aChunk){if(Array.isArray(aChunk)){for(var i=aChunk.length-1;i>=0;i--){this.prepend(aChunk[i])}}else if(aChunk instanceof SourceNode||typeof aChunk==="string"){this.children.unshift(aChunk)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.walk=function SourceNode_walk(aFn){var chunk;for(var i=0,len=this.children.length;i<len;i++){chunk=this.children[i];if(chunk instanceof SourceNode){chunk.walk(aFn)}else{if(chunk!==""){aFn(chunk,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};SourceNode.prototype.join=function SourceNode_join(aSep){var newChildren;var i;var len=this.children.length;if(len>0){newChildren=[];for(i=0;i<len-1;i++){newChildren.push(this.children[i]);newChildren.push(aSep)}newChildren.push(this.children[i]);this.children=newChildren}return this};SourceNode.prototype.replaceRight=function SourceNode_replaceRight(aPattern,aReplacement){var lastChild=this.children[this.children.length-1];if(lastChild instanceof SourceNode){lastChild.replaceRight(aPattern,aReplacement)}else if(typeof lastChild==="string"){this.children[this.children.length-1]=lastChild.replace(aPattern,aReplacement)}else{this.children.push("".replace(aPattern,aReplacement))}return this};SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(aSourceFile,aSourceContent){this.sourceContents[util.toSetString(aSourceFile)]=aSourceContent};SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(aFn){for(var i=0,len=this.children.length;i<len;i++){if(this.children[i]instanceof SourceNode){this.children[i].walkSourceContents(aFn)}}var sources=Object.keys(this.sourceContents);for(var i=0,len=sources.length;i<len;i++){aFn(util.fromSetString(sources[i]),this.sourceContents[sources[i]])}};SourceNode.prototype.toString=function SourceNode_toString(){var str="";this.walk(function(chunk){str+=chunk});return str};SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false}chunk.match(REGEX_CHARACTER).forEach(function(ch,idx,array){if(REGEX_NEWLINE.test(ch)){generated.line++;generated.column=0;if(idx+1===array.length){lastOriginalSource=null;sourceMappingActive=false}else if(sourceMappingActive){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}}else{generated.column+=ch.length}})});this.walkSourceContents(function(sourceFile,sourceContent){map.setSourceContent(sourceFile,sourceContent)});return{code:generated.code,map:map}};exports.SourceNode=SourceNode})},{"./source-map-generator":174,"./util":176,amdefine:177}],176:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName]}else if(arguments.length===3){return aDefaultValue}else{throw new Error('"'+aName+'" is a required argument.')}}exports.getArg=getArg;var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;var dataUrlRegexp=/^data:.+\,.+$/;function urlParse(aUrl){var match=aUrl.match(urlRegexp);if(!match){return null}return{scheme:match[1],auth:match[2],host:match[3],port:match[4],path:match[5]}}exports.urlParse=urlParse;function urlGenerate(aParsedUrl){var url="";if(aParsedUrl.scheme){url+=aParsedUrl.scheme+":"}url+="//";if(aParsedUrl.auth){url+=aParsedUrl.auth+"@"}if(aParsedUrl.host){url+=aParsedUrl.host}if(aParsedUrl.port){url+=":"+aParsedUrl.port}if(aParsedUrl.path){url+=aParsedUrl.path}return url}exports.urlGenerate=urlGenerate;function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath}path=url.path}var isAbsolute=path.charAt(0)==="/";var parts=path.split(/\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==="."){parts.splice(i,1)}else if(part===".."){up++}else if(up>0){if(part===""){parts.splice(i+1,up);up=0}else{parts.splice(i,2);up--}}}path=parts.join("/");if(path===""){path=isAbsolute?"/":"."}if(url){url.path=path;return urlGenerate(url)}return path}exports.normalize=normalize;function join(aRoot,aPath){if(aRoot===""){aRoot="."}if(aPath===""){aPath="."}var aPathUrl=urlParse(aPath);var aRootUrl=urlParse(aRoot);if(aRootUrl){aRoot=aRootUrl.path||"/"}if(aPathUrl&&!aPathUrl.scheme){if(aRootUrl){aPathUrl.scheme=aRootUrl.scheme}return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp)){return aPath}if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath;return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath);if(aRootUrl){aRootUrl.path=joined;return urlGenerate(aRootUrl)}return joined}exports.join=join;function relative(aRoot,aPath){if(aRoot===""){aRoot="."}aRoot=aRoot.replace(/\/$/,"");var url=urlParse(aRoot);if(aPath.charAt(0)=="/"&&url&&url.path=="/"){return aPath.slice(1)}return aPath.indexOf(aRoot+"/")===0?aPath.substr(aRoot.length+1):aPath}exports.relative=relative;function toSetString(aStr){return"$"+aStr}exports.toSetString=toSetString;function fromSetString(aStr){return aStr.substr(1)}exports.fromSetString=fromSetString;function strcmp(aStr1,aStr2){var s1=aStr1||"";var s2=aStr2||"";return(s1>s2)-(s1<s2)}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp;cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp||onlyCompareOriginal){return cmp}cmp=strcmp(mappingA.name,mappingB.name);if(cmp){return cmp}cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}return mappingA.generatedColumn-mappingB.generatedColumn}exports.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositions(mappingA,mappingB,onlyCompareGenerated){var cmp;cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp||onlyCompareGenerated){return cmp}cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp){return cmp}return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositions=compareByGeneratedPositions})},{amdefine:177}],177:[function(require,module,exports){(function(process,__filename){"use strict";function amdefine(module,requireFn){"use strict";var defineCache={},loaderCache={},alreadyCalled=false,path=require("path"),makeRequire,stringRequire;function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName){var baseParts;if(name&&name.charAt(0)==="."){if(baseName){baseParts=baseName.split("/");baseParts=baseParts.slice(0,baseParts.length-1);baseParts=baseParts.concat(name.split("/"));trimDots(baseParts);name=baseParts.join("/")}}return name}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(id){function load(value){loaderCache[id]=value}load.fromText=function(id,text){throw new Error("amdefine does not implement load.fromText")};return load}makeRequire=function(systemRequire,exports,module,relId){function amdRequire(deps,callback){if(typeof deps==="string"){return stringRequire(systemRequire,exports,module,deps,relId)}else{deps=deps.map(function(depName){return stringRequire(systemRequire,exports,module,depName,relId)});process.nextTick(function(){callback.apply(null,deps)})}}amdRequire.toUrl=function(filePath){if(filePath.indexOf(".")===0){return normalize(filePath,path.dirname(module.filename))}else{return filePath}};return amdRequire};requireFn=requireFn||function req(){return module.require.apply(module,arguments)};function runFactory(id,deps,factory){var r,e,m,result;if(id){e=loaderCache[id]={};m={id:id,uri:__filename,exports:e};r=makeRequire(requireFn,e,m,id)}else{if(alreadyCalled){throw new Error("amdefine with no module ID cannot be called more than once per file.")}alreadyCalled=true;e=module.exports;m=module;r=makeRequire(requireFn,e,m,module.id)}if(deps){deps=deps.map(function(depName){return r(depName)})}if(typeof factory==="function"){result=factory.apply(m.exports,deps)}else{result=factory}if(result!==undefined){m.exports=result;if(id){loaderCache[id]=m.exports}}}stringRequire=function(systemRequire,exports,module,id,relId){var index=id.indexOf("!"),originalId=id,prefix,plugin;if(index===-1){id=normalize(id,relId);if(id==="require"){return makeRequire(systemRequire,exports,module,relId)}else if(id==="exports"){return exports}else if(id==="module"){return module}else if(loaderCache.hasOwnProperty(id)){return loaderCache[id]}else if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}else{if(systemRequire){return systemRequire(originalId)}else{throw new Error("No module with ID: "+id)}}}else{prefix=id.substring(0,index);id=id.substring(index+1,id.length);plugin=stringRequire(systemRequire,exports,module,prefix,relId);if(plugin.normalize){id=plugin.normalize(id,makeNormalize(relId))}else{id=normalize(id,relId)}if(loaderCache[id]){return loaderCache[id]}else{plugin.load(id,makeRequire(systemRequire,exports,module,relId),makeLoad(id),{});return loaderCache[id]}}};function define(id,deps,factory){if(Array.isArray(id)){factory=deps;deps=id;id=undefined}else if(typeof id!=="string"){factory=id;id=deps=undefined}if(deps&&!Array.isArray(deps)){factory=deps;deps=undefined}if(!deps){deps=["require","exports","module"]}if(id){defineCache[id]=[id,deps,factory]}else{runFactory(id,deps,factory)}}define.require=function(id){if(loaderCache[id]){return loaderCache[id]}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}};define.amd={};return define}module.exports=amdefine}).call(this,require("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:103,path:102}],178:[function(require,module,exports){module.exports={"abstract-expression-call":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceGet"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"}]},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"abstract-expression-delete":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceDelete"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"abstract-expression-get":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceGet"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"abstract-expression-set":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"PROPERTY"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"referenceSet"},computed:false},computed:true},arguments:[{type:"Identifier",name:"OBJECT"},{type:"Identifier",name:"VALUE"}]}}]},"apply-constructor":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"Constructor"},{type:"Identifier",name:"args"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"instance"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"create"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"Constructor"},property:{type:"Identifier",name:"prototype"},computed:false}]}}],kind:"var"},{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"result"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Constructor"},property:{type:"Identifier",name:"apply"},computed:false},arguments:[{type:"Identifier",name:"instance"},{type:"Identifier",name:"args"}]}}],kind:"var"},{type:"ReturnStatement",argument:{type:"ConditionalExpression",test:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"Identifier",name:"result"},operator:"!=",right:{type:"Literal",value:null}},operator:"&&",right:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"result"}},operator:"==",right:{type:"Literal",value:"object"}},operator:"||",right:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"result"}},operator:"==",right:{type:"Literal",value:"function"}}}},consequent:{type:"Identifier",name:"result"},alternate:{type:"Identifier",name:"instance"}}}]},expression:false}}]},"array-comprehension-container":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"KEY"},init:{type:"ArrayExpression",elements:[]}}],kind:"var"},{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false},arguments:[]}}]},"array-comprehension-for-each":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"forEach"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[]},expression:false}]}}]},"array-from":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"from"},computed:false},arguments:[{type:"Identifier",name:"VALUE"}]}}]},"array-push":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"KEY"},property:{type:"Identifier",name:"push"},computed:false},arguments:[{type:"Identifier",name:"STATEMENT"}]}}]},"async-to-generator":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"fn"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"gen"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"fn"},property:{type:"Identifier",name:"apply"},computed:false},arguments:[{type:"ThisExpression"},{type:"Identifier",name:"arguments"}]}}],kind:"var"},{type:"ReturnStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Promise"},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"resolve"},{type:"Identifier",name:"reject"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"FunctionDeclaration",id:{type:"Identifier",name:"step"},params:[{type:"Identifier",name:"getNext"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"next"},init:null}],kind:"var"},{type:"TryStatement",block:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"next"},right:{type:"CallExpression",callee:{type:"Identifier",name:"getNext"},arguments:[]}}}]},handler:{type:"CatchClause",param:{type:"Identifier",name:"e"},guard:null,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"reject"},arguments:[{type:"Identifier",name:"e"}]}},{type:"ReturnStatement",argument:null}]}},guardedHandlers:[],finalizer:null},{type:"IfStatement",test:{type:"MemberExpression",object:{type:"Identifier",name:"next"},property:{type:"Identifier",name:"done"},computed:false},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"resolve"},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"next"},property:{type:"Identifier",name:"value"},computed:false}]}},{type:"ReturnStatement",argument:null}]},alternate:null},{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Promise"},property:{type:"Identifier",name:"resolve"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"next"},property:{type:"Identifier",name:"value"},computed:false}]},property:{type:"Identifier",name:"then"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"v"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"step"},arguments:[{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"gen"},property:{type:"Identifier",name:"next"},computed:false},arguments:[{type:"Identifier",name:"v"}]}}]},expression:false}]}}]},expression:false},{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"e"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"step"},arguments:[{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"gen"},property:{type:"Literal",value:"throw"},computed:true},arguments:[{type:"Identifier",name:"e"}]}}]},expression:false}]}}]},expression:false}]}}]},expression:false},{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"step"},arguments:[{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"gen"},property:{type:"Identifier",name:"next"},computed:false},arguments:[]}}]},expression:false}]}}]},expression:false}]}}]},expression:false}}]},expression:false}}]},call:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"CONTEXT"}]}}]},"class-super-constructor-call":{type:"Program",body:[{type:"IfStatement",test:{type:"Identifier",name:"SUPER_NAME"},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"SUPER_NAME"},property:{type:"Identifier",name:"apply"},computed:false},arguments:[{type:"ThisExpression"},{type:"Identifier",name:"arguments"}]}}]},alternate:null}]},"common-export-default-assign":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"module"},property:{type:"Identifier",name:"exports"},computed:false},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"assign"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Literal",value:"default"},computed:true},{type:"Identifier",name:"exports"}]}}}]},"corejs-iterator":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"CORE_ID"},property:{type:"Identifier",name:"$for"},computed:false},property:{type:"Identifier",name:"getIterator"},computed:false},arguments:[{type:"Identifier",name:"VALUE"}]}}]},"define-property":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"},{type:"Identifier",name:"key"},{type:"Identifier",name:"value"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperty"},computed:false},arguments:[{type:"Identifier",name:"obj"},{type:"Identifier",name:"key"},{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"value"},value:{type:"Identifier",name:"value"},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"enumerable"},value:{type:"Literal",value:true},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"configurable"},value:{type:"Literal",value:true},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"writable"},value:{type:"Literal",value:true},kind:"init"}]}]}}]},expression:false}}]},"exports-assign":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"KEY"},computed:false},right:{type:"Identifier",name:"VALUE"}}}]},"exports-default-module-override":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"exports"},right:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"module"},property:{type:"Identifier",name:"exports"},computed:false},right:{type:"Identifier",name:"VALUE"}}}}]},"exports-default-module":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"module"},property:{type:"Identifier",name:"exports"},computed:false},right:{type:"Identifier",name:"VALUE"}}}]},"exports-wildcard":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ForInStatement",left:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"i"},init:null}],kind:"var"},right:{type:"Identifier",name:"obj"},body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"i"},computed:true},right:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Identifier",name:"i"},computed:true}}}]}}]},expression:false},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"for-of":{type:"Program",body:[{type:"ForStatement",init:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"ITERATOR_KEY"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"iterator"},computed:false},computed:true},arguments:[]}},{type:"VariableDeclarator",id:{type:"Identifier",name:"STEP_KEY"},init:null}],kind:"var"},test:{type:"UnaryExpression",operator:"!",prefix:true,argument:{type:"MemberExpression",object:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"STEP_KEY"},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ITERATOR_KEY"},property:{type:"Identifier",name:"next"},computed:false},arguments:[]}},property:{type:"Identifier",name:"done"},computed:false}},update:null,body:{type:"BlockStatement",body:[]}}]},"has-own":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"hasOwnProperty"},computed:false}}]},"if-undefined-set-to":{type:"Program",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"Identifier",name:"VARIABLE"},operator:"===",right:{type:"Identifier",name:"undefined"}},consequent:{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"VARIABLE"},right:{type:"Identifier",name:"DEFAULT"}}},alternate:null}]},inherits:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"child"},{type:"Identifier",name:"parent"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"prototype"},computed:false},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"create"},computed:false},arguments:[{type:"LogicalExpression",left:{type:"Identifier",name:"parent"},operator:"&&",right:{type:"MemberExpression",object:{type:"Identifier",name:"parent"},property:{type:"Identifier",name:"prototype"},computed:false}},{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"constructor"},value:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"value"},value:{type:"Identifier",name:"child"},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"enumerable"},value:{type:"Literal",value:false},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"writable"},value:{type:"Literal",value:true},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"configurable"},value:{type:"Literal",value:true},kind:"init"}]},kind:"init"}]}]}}},{type:"IfStatement",test:{type:"Identifier",name:"parent"},consequent:{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"__proto__"},computed:false},right:{type:"Identifier",name:"parent"}}},alternate:null}]},expression:false}}]},"interop-require":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"LogicalExpression",left:{type:"Identifier",name:"obj"},operator:"&&",right:{type:"LogicalExpression",left:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Literal",value:"default"},computed:true},operator:"||",right:{type:"Identifier",name:"obj"}}}}]},expression:false}}]},"let-scoping-return":{type:"Program",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"RETURN"}},operator:"===",right:{type:"Literal",value:"object"}},consequent:{type:"ReturnStatement",argument:{type:"MemberExpression",object:{type:"Identifier",name:"RETURN"},property:{type:"Identifier",name:"v"},computed:false}},alternate:null}]},"object-define-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"OBJECT"},{type:"Identifier",name:"PROPS"}]}}]},"object-without-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"},{type:"Identifier",name:"keys"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"target"},init:{type:"ObjectExpression",properties:[]}}],kind:"var"},{type:"ForInStatement",left:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"i"},init:null}],kind:"var"},right:{type:"Identifier",name:"obj"},body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"keys"},property:{type:"Identifier",name:"indexOf"},computed:false},arguments:[{type:"Identifier",name:"i"}]},operator:">=",right:{type:"Literal",value:0}},consequent:{type:"ContinueStatement",label:null},alternate:null},{type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:true,argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"hasOwnProperty"},computed:false},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"obj"},{type:"Identifier",name:"i"}]}},consequent:{type:"ContinueStatement",label:null},alternate:null},{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"target"},property:{type:"Identifier",name:"i"},computed:true},right:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Identifier",name:"i"},computed:true}}}]}},{type:"ReturnStatement",argument:{type:"Identifier",name:"target"}}]},expression:false}}]},"prototype-identifier":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"Identifier",name:"CLASS_NAME"},property:{type:"Identifier",name:"prototype"},computed:false}}]},"prototype-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"child"},{type:"Identifier",name:"staticProps"},{type:"Identifier",name:"instanceProps"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"Identifier",name:"staticProps"},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"child"},{type:"Identifier",name:"staticProps"}]}},alternate:null},{type:"IfStatement",test:{type:"Identifier",name:"instanceProps"},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"prototype"},computed:false},{type:"Identifier",name:"instanceProps"}]}},alternate:null}]},expression:false}}]},"require-assign-key":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]},property:{type:"Identifier",name:"KEY"},computed:false}}],kind:"var"}]},"require-assign":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]}}],kind:"var"}]},require:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]}}]},"self-global":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"ConditionalExpression",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"global"}},operator:"===",right:{type:"Literal",value:"undefined"}},consequent:{type:"Identifier",name:"self"},alternate:{type:"Identifier",name:"global"}}}]},slice:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"slice"},computed:false}}]},"sliced-to-array":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"arr"},{type:"Identifier",name:"i"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"isArray"},computed:false},arguments:[{type:"Identifier",name:"arr"}]},consequent:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"arr"}}]},alternate:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_arr"},init:{type:"ArrayExpression",elements:[]}}],kind:"var"},{type:"ForStatement",init:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_iterator"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"arr"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"iterator"},computed:false},computed:true},arguments:[]}},{type:"VariableDeclarator",id:{type:"Identifier",name:"_step"},init:null}],kind:"var"},test:{type:"UnaryExpression",operator:"!",prefix:true,argument:{type:"MemberExpression",object:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"_step"},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"_iterator"},property:{type:"Identifier",name:"next"},computed:false},arguments:[]}},property:{type:"Identifier",name:"done"},computed:false}},update:null,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"_arr"},property:{type:"Identifier",name:"push"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"_step"},property:{type:"Identifier",name:"value"},computed:false}]}},{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"Identifier",name:"i"},operator:"&&",right:{type:"BinaryExpression",left:{type:"MemberExpression",object:{type:"Identifier",name:"_arr"},property:{type:"Identifier",name:"length"},computed:false},operator:"===",right:{type:"Identifier",name:"i"}}},consequent:{type:"BreakStatement",label:null},alternate:null}]}},{type:"ReturnStatement",argument:{type:"Identifier",name:"_arr"}}]}}]},expression:false}}]},system:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"System"},property:{type:"Identifier",name:"register"},computed:false},arguments:[{type:"Identifier",name:"MODULE_NAME"},{type:"Identifier",name:"MODULE_DEPENDENCIES"},{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"EXPORT_IDENTIFIER"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"setters"},value:{type:"Identifier",name:"SETTERS"},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"execute"},value:{type:"Identifier",name:"EXECUTE"},kind:"init"}]}}]},expression:false}]}}]},"tagged-template-literal":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"strings"},{type:"Identifier",name:"raw"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"freeze"},computed:false},arguments:[{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"strings"},{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"raw"},value:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"value"},value:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"freeze"},computed:false},arguments:[{type:"Identifier",name:"raw"}]},kind:"init"}]},kind:"init"}]}]}]}}]},expression:false}}]},"to-array":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"arr"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"ConditionalExpression",test:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"isArray"},computed:false},arguments:[{type:"Identifier",name:"arr"}]},consequent:{type:"Identifier",name:"arr"},alternate:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"from"},computed:false},arguments:[{type:"Identifier",name:"arr"}]}}}]},expression:false}}]},"umd-runner-body":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"factory"}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"define"}},operator:"===",right:{type:"Literal",value:"function"}},operator:"&&",right:{type:"MemberExpression",object:{type:"Identifier",name:"define"},property:{type:"Identifier",name:"amd"},computed:false}},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"define"},arguments:[{type:"Identifier",name:"AMD_ARGUMENTS"},{type:"Identifier",name:"factory"}]}}]},alternate:{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"exports"}},operator:"!==",right:{type:"Literal",value:"undefined"}},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"factory"},arguments:[{type:"Identifier",name:"exports"},{type:"Identifier",name:"COMMON_ARGUMENTS"}]}}]},alternate:null}}]},expression:false}}]}}
},{}]},{},[2])(2)});
|
actor-apps/app-web/src/app/components/sidebar/RecentSection.react.js
|
zwensoft/actor-platform
|
/*
* Copyright (C) 2015 Actor LLC. <https://actor.im>
*/
import _ from 'lodash';
import React from 'react';
import DialogActionCreators from 'actions/DialogActionCreators';
import CreateGroupActionCreators from 'actions/CreateGroupActionCreators';
import DialogStore from 'stores/DialogStore';
import CreateGroupStore from 'stores/CreateGroupStore';
import RecentSectionItem from './RecentSectionItem.react';
import CreateGroupModal from 'components/modals/CreateGroup.react';
const LoadDialogsScrollBottom = 100;
const getStateFromStore = () => {
return {
isCreateGroupModalOpen: CreateGroupStore.isModalOpen(),
dialogs: DialogStore.getAll()
};
};
class RecentSection extends React.Component {
constructor(props) {
super(props);
this.state = getStateFromStore();
DialogStore.addChangeListener(this.onChange);
CreateGroupStore.addChangeListener(this.onChange);
}
componentWillUnmount() {
DialogStore.removeChangeListener(this.onChange);
CreateGroupStore.removeChangeListener(this.onChange);
}
onChange = () => {
this.setState(getStateFromStore());
};
openCreateGroup = () => CreateGroupActionCreators.openModal();
onScroll = event => {
const { scrollHeight, scrollTop, clientHeight } = event.target;
if (scrollHeight - scrollTop - clientHeight <= LoadDialogsScrollBottom) {
DialogActionCreators.onDialogsEnd();
}
};
render() {
const { dialogs, isCreateGroupModalOpen } = this.state;
const dialogList = _.map(dialogs, (dialog, index) => {
return (
<RecentSectionItem dialog={dialog} key={index}/>
);
}, this);
const createGroupModal = isCreateGroupModalOpen ? <CreateGroupModal/> : null;
return (
<section className="sidebar__recent">
<ul className="sidebar__list sidebar__list--recent" onScroll={this.onScroll}>
{dialogList}
</ul>
<footer>
<button className="button button--rised button--wide" onClick={this.openCreateGroup}>Create group</button>
{createGroupModal}
</footer>
</section>
);
}
}
export default RecentSection;
|
ajax/libs/6to5/2.13.0/browser.js
|
iamJoeTaylor/cdnjs
|
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.to5=n()}}(function(){var define,module,exports;return function e(e,n,t){function r(l,u){if(!n[l]){if(!e[l]){var s=typeof require=="function"&&require;if(!u&&s)return s(l,!0);if(a)return a(l,!0);var o=new Error("Cannot find module '"+l+"'");throw o.code="MODULE_NOT_FOUND",o}var i=n[l]={exports:{}};e[l][0].call(i.exports,function(n){var t=e[l][1][n];return r(t?t:n)},i,i.exports,e,e,n,t)}return n[l].exports}var a=typeof require=="function"&&require;for(var l=0;l<t.length;l++)r(t[l]);return r}({1:[function(t,n,e){(function(r,t){if(typeof e=="object"&&typeof n=="object")return t(e);if(typeof define=="function"&&define.amd)return define(["exports"],t);t(r.acorn||(r.acorn={}))})(this,function(B){"use strict";B.version="0.11.1";var r,a,V,yt;B.parse=function(e,t){a=String(e);V=a.length;xt(t);ht();var l=r.locations?[n,mn()]:n;nr();return ua(r.program||S(l))};var cr=B.defaultOptions={playground:false,ecmaVersion:5,strictSemicolons:false,allowTrailingCommas:true,forbidReserved:false,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};B.parseExpressionAt=function(e,n,t){a=String(e);V=a.length;xt(t);ht(n);nr();return y()};var lr=function(e){return Object.prototype.toString.call(e)==="[object Array]"};function xt(n){r={};for(var e in cr)r[e]=n&&pt(n,e)?n[e]:cr[e];yt=r.sourceFile||null;if(lr(r.onToken)){var t=r.onToken;r.onToken=function(e){t.push(e)}}if(lr(r.onComment)){var l=r.onComment;r.onComment=function(a,i,n,t,s,o){var e={type:a?"Block":"Line",value:i,start:n,end:t};if(r.locations){e.loc=new rt;e.loc.start=s;e.loc.end=o}if(r.ranges)e.range=[n,t];l.push(e)}}if(r.strictMode){M=true}if(r.ecmaVersion>=6){at=El}else{at=Zt}}var Dl=B.getLineInfo=function(l,t){for(var r=1,n=0;;){En.lastIndex=n;var e=En.exec(l);if(e&&e.index<t){++r;n=e.index+e[0].length}else break}return{line:r,column:t-n}};function _t(){this.type=e;this.value=f;this.start=m;this.end=D;if(r.locations){this.loc=new rt;this.loc.end=Nn;this.startLoc=ln;this.endLoc=Nn}if(r.ranges)this.range=[m,D]}B.Token=_t;B.tokenize=function(t,l){a=String(t);V=a.length;xt(l);ht();sn();function e(e){T=D;un(e);return new _t}e.jumpTo=function(t,l){n=t;if(r.locations){U=1;P=En.lastIndex=0;var e;while((e=En.exec(a))&&e.index<t){++U;P=e.index+e[0].length}}$=l;sn()};e.noRegexp=function(){$=false};e.options=r;return e};var n;var m,D;var ln,Nn;var e,f;var $;var U,P;var jn,T,rn;var Gn,Rn,Xn,k,M,A,I,on;var Vn;var en;function nr(){jn=T=n;if(r.locations)rn=new Qn;Gn=Rn=Xn=M=false;k=[];sn();un()}function u(r,l){var t=Dl(a,r);l+=" ("+t.line+":"+t.column+")";var e=new SyntaxError(l);e.pos=r;e.loc=t;e.raisedAt=n;throw e}var mr=[];var yn={type:"num"},kt={type:"regexp"},J={type:"string"};var p={type:"name"},xn={type:"eof"};var bt={type:"xjsName"},Mn={type:"xjsText"};var hr={keyword:"break"},gt={keyword:"case",beforeExpr:true},zr={keyword:"catch"};var Yt={keyword:"continue"},Wr={keyword:"debugger"},Yn={keyword:"default"};var Gr={keyword:"do",isLoop:true},Vr={keyword:"else",beforeExpr:true};var Ur={keyword:"finally"},Fn={keyword:"for",isLoop:true},dn={keyword:"function"};var Tt={keyword:"if"},Nr={keyword:"return",beforeExpr:true},ct={keyword:"switch"};var jr={keyword:"throw",beforeExpr:true},Pr={keyword:"try"},kn={keyword:"var"};var An={keyword:"let"},zn={keyword:"const"};var ft={keyword:"while",isLoop:true},Tr={keyword:"with"},Ar={keyword:"new",beforeExpr:true};var Ir={keyword:"this"};var wn={keyword:"class"},Ct={keyword:"extends",beforeExpr:true};var _r={keyword:"export"},Lt={keyword:"import"};var wr={keyword:"yield",beforeExpr:true};var Er={keyword:"null",atomValue:null},br={keyword:"true",atomValue:true};var xr={keyword:"false",atomValue:false};var On={keyword:"in",binop:7,beforeExpr:true};var Jn={"break":hr,"case":gt,"catch":zr,"continue":Yt,"debugger":Wr,"default":Yn,"do":Gr,"else":Vr,"finally":Ur,"for":Fn,"function":dn,"if":Tt,"return":Nr,"switch":ct,"throw":jr,"try":Pr,"var":kn,let:An,"const":zn,"while":ft,"with":Tr,"null":Er,"true":br,"false":xr,"new":Ar,"in":On,"instanceof":{keyword:"instanceof",binop:7,beforeExpr:true},"this":Ir,"typeof":{keyword:"typeof",prefix:true,beforeExpr:true},"void":{keyword:"void",prefix:true,beforeExpr:true},"delete":{keyword:"delete",prefix:true,beforeExpr:true},"class":wn,"extends":Ct,"export":_r,"import":Lt,"yield":wr};var X={type:"[",beforeExpr:true},N={type:"]"},R={type:"{",beforeExpr:true};var b={type:"}"},v={type:"(",beforeExpr:true},h={type:")"};var x={type:",",beforeExpr:true},L={type:";",beforeExpr:true};var _={type:":",beforeExpr:true},qn={type:"."},Z={type:"?",beforeExpr:true};var Q={type:"=>",beforeExpr:true},dr={type:"`"},pr={type:"${",beforeExpr:true};var ot={type:"</"};var Q={type:"=>",beforeExpr:true},et={type:"template"},Zn={type:"templateContinued"};var K={type:"...",prefix:true,beforeExpr:true};var dt={type:"::",beforeExpr:true};var mt={type:"@"};var $n={type:"#"};var Bn={binop:10,beforeExpr:true},tn={isAssign:true,beforeExpr:true};var z={isAssign:true,beforeExpr:true};var wl={postfix:true,prefix:true,isUpdate:true},fr={prefix:true,beforeExpr:true};var sr={binop:1,beforeExpr:true};var ir={binop:2,beforeExpr:true};var ar={binop:3,beforeExpr:true};var Jl={binop:4,beforeExpr:true};var rr={binop:5,beforeExpr:true};var ia={binop:6,beforeExpr:true};var ul={binop:7,beforeExpr:true};var fl={binop:8,beforeExpr:true};var hl={binop:9,prefix:true,beforeExpr:true};var yl={binop:10,beforeExpr:true};var Y={binop:10,beforeExpr:true};var tr={binop:11,beforeExpr:true,rightAssociative:true};var w={binop:7,beforeExpr:true},H={binop:7,beforeExpr:true};B.tokTypes={bracketL:X,bracketR:N,braceL:R,braceR:b,parenL:v,parenR:h,comma:x,semi:L,colon:_,dot:qn,ellipsis:K,question:Z,slash:Bn,eq:tn,name:p,eof:xn,num:yn,regexp:kt,string:J,arrow:Q,bquote:dr,dollarBraceL:pr,star:Y,assign:z,xjsName:bt,xjsText:Mn,paamayimNekudotayim:dt,exponent:tr,at:mt,hash:$n,template:et,templateContinued:Zn};for(var er in Jn)B.tokTypes["_"+er]=Jn[er];var al=function Da(e){switch(e.length){case 6:switch(e){case"double":case"export":case"import":case"native":case"public":case"static":case"throws":return true}return false;case 4:switch(e){case"byte":case"char":case"enum":case"goto":case"long":return true}return false;case 5:switch(e){case"class":case"final":case"float":case"short":case"super":return true}return false;case 7:switch(e){case"boolean":case"extends":case"package":case"private":return true}return false;case 9:switch(e){case"interface":case"protected":case"transient":return true}return false;case 8:switch(e){case"abstract":case"volatile":return true}return false;case 10:return e==="implements";case 3:return e==="int";case 12:return e==="synchronized"}};var il=function Na(e){switch(e.length){case 5:switch(e){case"class":case"super":case"const":return true}return false;case 6:switch(e){case"export":case"import":return true}return false;case 4:return e==="enum";case 7:return e==="extends"}};var Mt=function Fa(e){switch(e.length){case 9:switch(e){case"interface":case"protected":return true}return false;case 7:switch(e){case"package":case"private":return true}return false;case 6:switch(e){case"public":case"static":return true}return false;case 10:return e==="implements";case 3:return e==="let";case 5:return e==="yield"}};var Ot=function Ba(e){switch(e){case"eval":case"arguments":return true}return false};var ml="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var Zt=function Ua(e){switch(e.length){case 4:switch(e){case"case":case"else":case"with":case"null":case"true":case"void":case"this":return true}return false;case 5:switch(e){case"break":case"catch":case"throw":case"while":case"false":return true}return false;case 3:switch(e){case"for":case"try":case"var":case"new":return true}return false;case 6:switch(e){case"return":case"switch":case"typeof":case"delete":return true}return false;case 8:switch(e){case"continue":case"debugger":case"function":return true}return false;case 2:switch(e){case"do":case"if":case"in":return true}return false;case 7:switch(e){case"default":case"finally":return true}return false;case 10:return e==="instanceof"}};var Oa=ml+" let const class extends export import yield";var El=function Va(e){switch(e.length){case 5:switch(e){case"break":case"catch":case"throw":case"while":case"false":case"const":case"class":case"yield":return true}return false;case 4:switch(e){case"case":case"else":case"with":case"null":case"true":case"void":case"this":return true}return false;case 6:switch(e){case"return":case"switch":case"typeof":case"delete":case"export":case"import":return true}return false;case 3:switch(e){case"for":case"try":case"var":case"new":case"let":return true}return false;case 8:switch(e){case"continue":case"debugger":case"function":return true}return false;case 7:switch(e){case"default":case"finally":case"extends":return true}return false;case 2:switch(e){case"do":case"if":case"in":return true}return false;case 10:return e==="instanceof"}};var at=Zt;var Ll=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var Qt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var ql="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";var Kt=new RegExp("["+Qt+"]");var Gl=new RegExp("["+Qt+ql+"]");var Wl=/^\d+$/;var zl=/^[\da-fA-F]+$/;var pn=/[\n\r\u2028\u2029]/;function Ma(e){return e===10||e===13||e===8232||e==8233}var En=/\r\n|[\n\r\u2028\u2029]/g;var Hn=B.isIdentifierStart=function(e){if(e<65)return e===36;if(e<91)return true;if(e<97)return e===95;if(e<123)return true;return e>=170&&Kt.test(String.fromCharCode(e))};var $t=B.isIdentifierChar=function(e){if(e<48)return e===36;if(e<58)return true;if(e<65)return false;if(e<91)return true;if(e<97)return e===95;if(e<123)return true;return e>=170&&Gl.test(String.fromCharCode(e))};function Qn(e,n){this.line=e;this.column=n}Qn.prototype.offset=function(e){return new Qn(this.line,this.column+e)};function mn(){return new Qn(U,n-P)}function ht(e){if(e){n=e;P=Math.max(0,a.lastIndexOf("\n",e));U=a.slice(0,P).split(pn).length}else{U=1;n=P=0}$=true;Vn=0;on=A=I=false;en=[];if(n===0&&r.allowHashBang&&a.slice(0,2)==="#!"){Wn(2)}}function g(t,l,a){D=n;if(r.locations)Nn=mn();e=t;if(a!==false)sn();f=l;$=t.beforeExpr;if(r.onToken){r.onToken(new _t)}}function vl(){var i=r.onComment&&r.locations&&mn();var t=n,l=a.indexOf("*/",n+=2);if(l===-1)u(n-2,"Unterminated comment");n=l+2;if(r.locations){En.lastIndex=t;var e;while((e=En.exec(a))&&e.index<n){++U;P=e.index+e[0].length}}if(r.onComment)r.onComment(true,a.slice(t+2,l),t,n,i,r.locations&&mn())}function Wn(t){var l=n;var i=r.onComment&&r.locations&&mn();var e=a.charCodeAt(n+=t);while(n<V&&e!==10&&e!==13&&e!==8232&&e!==8233){++n;e=a.charCodeAt(n)}if(r.onComment)r.onComment(false,a.slice(l+t,n),l,n,i,r.locations&&mn())}function sn(){while(n<V){var e=a.charCodeAt(n);if(e===32){++n}else if(e===13){++n;var t=a.charCodeAt(n);if(t===10){++n}if(r.locations){++U;P=n}}else if(e===10||e===8232||e===8233){++n;if(r.locations){++U;P=n}}else if(e>8&&e<14){++n}else if(e===47){var t=a.charCodeAt(n+1);if(t===42){vl()}else if(t===47){Wn(2)}else break}else if(e===160){++n}else if(e>=5760&&Ll.test(String.fromCharCode(e))){++n}else{break}}}function _l(){var e=a.charCodeAt(n+1);if(e>=48&&e<=57)return Gt(true);var t=a.charCodeAt(n+2);if(r.playground&&e===63){n+=2;return g(_dotQuestion)}else if(r.ecmaVersion>=6&&e===46&&t===46){n+=3;return g(K)}else{++n;return g(qn)}}function Sl(){var e=a.charCodeAt(n+1);if($){++n;return Wt()}if(e===61)return E(z,2);return E(Bn,1)}function kl(){var e=a.charCodeAt(n+1);if(e===61)return E(z,2);return E(yl,1)}function Il(){var e=Y;var t=1;var l=a.charCodeAt(n+1);if(r.ecmaVersion>=7&&l===42){t++;l=a.charCodeAt(n+2);e=tr}if(l===61){t++;e=z}return E(e,t)}function Rl(e){var t=a.charCodeAt(n+1);if(t===e){if(r.playground&&a.charCodeAt(n+2)===61)return E(z,3);return E(e===124?sr:ir,2)}if(t===61)return E(z,2);return E(e===124?ar:rr,1)}function Al(){var e=a.charCodeAt(n+1);if(e===61)return E(z,2);return E(Jl,1)}function Tl(t){var e=a.charCodeAt(n+1);if(e===t){if(e==45&&a.charCodeAt(n+2)==62&&pn.test(a.slice(T,n))){Wn(3);sn();return un()}return E(wl,2)}if(e===61)return E(z,2);return E(hl,1)}function La(t){var r=a.charCodeAt(n+1);var e=1;if(!on&&r===t){e=t===62&&a.charCodeAt(n+2)===62?3:2;if(a.charCodeAt(n+e)===61)return E(z,e+1);return E(fl,e)}if(r==33&&t==60&&a.charCodeAt(n+2)==45&&a.charCodeAt(n+3)==45){Wn(4);sn();return un()}if(r===61){e=a.charCodeAt(n+2)===61?3:2;return E(ul,e)}if(t===60&&r===47){e=2;return E(ot,e)}return t===60?E(w,e):E(H,e,!I)}function Pl(e){var t=a.charCodeAt(n+1);if(t===61)return E(ia,a.charCodeAt(n+2)===61?3:2);if(e===61&&t===62&&r.ecmaVersion>=6){n+=2;return g(Q)}return E(e===61?tn:fr,1)}function ja(t){if(e===J){if(t===96){++n;return g(dr)}else if(t===36&&a.charCodeAt(n+1)===123){n+=2;return g(pr)}}return readTmplString()}function Ol(t){switch(t){case 46:return _l();case 40:++n;return g(v);case 41:++n;return g(h);case 59:++n;return g(L);case 44:++n;return g(x);case 91:++n;return g(X);case 93:++n;return g(N);case 123:++n;if(en.length)++en[en.length-1];return g(R);case 125:++n;if(en.length&&--en[en.length-1]===0)return Jt(Zn);else return g(b);case 63:++n;return g(Z);case 64:if(r.playground){++n;return g(mt)}case 35:if(r.playground){++n;return g($n)}case 58:++n;if(r.ecmaVersion>=7){var e=a.charCodeAt(n);if(e===58){++n;return g(dt)}}return g(_);case 96:if(r.ecmaVersion>=6){++n;return Jt(et)}case 48:var e=a.charCodeAt(n+1);if(e===120||e===88)return It(16);if(r.ecmaVersion>=6){if(e===111||e===79)return It(8);if(e===98||e===66)return It(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Gt(false);case 34:case 39:return I?cl():ha(t);case 47:return Sl();case 37:return kl();case 42:return Il();case 124:case 38:return Rl(t);case 94:return Al();case 43:case 45:return Tl(t);case 60:case 62:return La(t);case 61:case 33:return Pl(t);case 126:return E(fr,1)}return false}function un(i){if(!i)m=n;else n=m+1;if(r.locations)ln=mn();if(i)return Wt();if(n>=V)return g(xn);var t=a.charCodeAt(n);if(A&&e!==R&&t!==60&&t!==123&&t!==125){return Xt(["<","{"])}if(Hn(t)||t===92)return Vt();var s=Ol(t);if(s===false){var l=String.fromCharCode(t);if(l==="\\"||Kt.test(l))return Vt();u(n,"Unexpected character '"+l+"'")}return s}function E(t,e,r){var l=a.slice(n,n+e);n+=e;g(t,l,r)}var zt=false;try{new RegExp("","u");zt=true}catch(Pa){}function Wt(){var s="",o,i,t=n;for(;;){if(n>=V)u(t,"Unterminated regular expression");var l=an();if(pn.test(l))u(t,"Unterminated regular expression");if(!o){if(l==="[")i=true;else if(l==="]"&&i)i=false;else if(l==="/"&&!i)break;o=l==="\\"}else o=false;++n}var s=a.slice(t,n);++n;var e=yr();var c=s;if(e){var p=/^[gmsiy]*$/;if(r.ecmaVersion>=6)p=/^[gmsiyu]*$/;if(!p.test(e))u(t,"Invalid regular expression flag");if(e.indexOf("u")>=0&&!zt){c=c.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}}try{new RegExp(c)}catch(f){if(f instanceof SyntaxError)u(t,"Error parsing regular expression: "+f.message);u(f)}try{var d=new RegExp(s,e)}catch(m){d=null}return g(kt,{pattern:s,flags:e,value:d})}function Cn(i,r){var s=n,l=0;for(var o=0,u=r==null?Infinity:r;o<u;++o){var e=a.charCodeAt(n),t;if(e>=97)t=e-97+10;else if(e>=65)t=e-65+10;else if(e>=48&&e<=57)t=e-48;else t=Infinity;if(t>=i)break;++n;l=l*i+t}if(n===s||r!=null&&n-s!==r)return null;return l}function It(e){n+=2;var t=Cn(e);if(t==null)u(m+2,"Expected number in radix "+e);if(Hn(a.charCodeAt(n)))u(n,"Identifier directly after number");return g(yn,t)}function Gt(s){var r=n,i=false,o=a.charCodeAt(n)===48;if(!s&&Cn(10)===null)u(r,"Invalid number");if(a.charCodeAt(n)===46){++n;Cn(10);i=true}var e=a.charCodeAt(n);if(e===69||e===101){e=a.charCodeAt(++n);if(e===43||e===45)++n;if(Cn(10)===null)u(r,"Invalid number");i=true}if(Hn(a.charCodeAt(n)))u(n,"Identifier directly after number");var t=a.slice(r,n),l;if(i)l=parseFloat(t);else if(!o||t.length===1)l=parseInt(t,10);else if(/[89]/.test(t)||M)u(r,"Invalid number");else l=parseInt(t,8);return g(yn,l)}function da(){var t=a.charCodeAt(n),e;if(t===123){if(r.ecmaVersion<6)c();++n;e=lt(a.indexOf("}",n)-n);++n;if(e>1114111)c()}else{e=lt(4)}if(e<=65535){return String.fromCharCode(e)}var l=(e-65536>>10)+55296;var i=(e-65536&1023)+56320;return String.fromCharCode(l,i)}function ha(r){++n;var t="";for(;;){if(n>=V)u(m,"Unterminated string constant");var e=a.charCodeAt(n);if(e===r){++n;return g(J,t)}if(e===92){t+=qt()}else{++n;if(pn.test(String.fromCharCode(e))){u(m,"Unterminated string constant")}t+=String.fromCharCode(e)}}}function Jt(l){if(l==Zn)en.pop();var t="",i=n;for(;;){if(n>=V)u(m,"Unterminated template");var e=a.charAt(n);if(e==="`"||e==="$"&&a.charCodeAt(n+1)===123){var s=a.slice(i,n);++n;if(e=="$"){++n;en.push(1)}return g(l,{cooked:t,raw:s})}if(e==="\\"){t+=qt()}else{++n;if(pn.test(e)){if(e==="\r"&&a.charCodeAt(n)===10){++n;e="\n"}if(r.locations){++U;P=n}}t+=e}}}function qt(){var t=a.charCodeAt(++n);var e=/^[0-7]+/.exec(a.slice(n,n+3));if(e)e=e[0];while(e&&parseInt(e,8)>255)e=e.slice(0,-1);if(e==="0")e=null;++n;if(e){if(M)u(n-2,"Octal literal in strict mode");n+=e.length-1;return String.fromCharCode(parseInt(e,8))}else{switch(t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(lt(2));case 117:return da();case 116:return" ";case 98:return"\b";case 118:return"";case 102:return"\f";case 48:return"\x00";case 13:if(a.charCodeAt(n)===10)++n;case 10:if(r.locations){P=n;++U}return"";default:return String.fromCharCode(t)}}}var sl={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function ol(){var e="",l=0,t;var r=an();if(r!=="&")u(n,"Entity must start with an ampersand");var a=++n;while(n<V&&l++<10){r=an();n++;if(r===";"){if(e[0]==="#"){if(e[1]==="x"){e=e.substr(2);if(zl.test(e)){t=String.fromCharCode(parseInt(e,16))}}else{e=e.substr(1);if(Wl.test(e)){t=String.fromCharCode(parseInt(e,10))}}}else{t=sl[e]}break}e+=r}if(!t){n=a;return"&"}return t}function Xt(l){var t="";while(n<V){var e=an();if(l.indexOf(e)!==-1){break}if(e==="&"){t+=ol()}else{++n;if(e==="\r"&&an()==="\n"){t+=e;++n;e="\n"}if(e==="\n"&&r.locations){P=n;++U}t+=e}}return g(Mn,t)}function cl(){var t=a.charCodeAt(n);if(t!==34&&t!==39){u("String literal must starts with a quote")}++n;Xt([String.fromCharCode(t)]);if(t!==a.charCodeAt(n)){c()}++n;return g(e,f)}function lt(n){var e=Cn(16,n);if(e===null)u(m,"Bad character escape sequence");return e}var bn;function yr(){bn=false;var e,l=true,i=n;for(;;){var t=a.charCodeAt(n);if($t(t)||I&&t===45){if(bn)e+=an();++n}else if(t===92&&!I){if(!bn)e=a.slice(i,n);bn=true;if(a.charCodeAt(++n)!=117)u(n,"Expecting Unicode escape sequence \\uXXXX");++n;var r=lt(4);var s=String.fromCharCode(r);if(!s)u(n-1,"Invalid Unicode escape");if(!(l?Hn(r):$t(r)))u(n-4,"Invalid Unicode escape");e+=s}else{break}l=false}return bn?e:a.slice(i,n)}function Vt(){var e=yr();var n=I?bt:p;if(!bn&&at(e))n=Jn[e];return g(n,e)}function s(){jn=m;T=D;rn=Nn;un()}function Dt(e){M=e;n=m;if(r.locations){while(n<P){P=a.lastIndexOf("\n",P-2)+1;--U}}sn();un()}function Nt(){this.type=null;this.start=m;this.end=null}B.Node=Nt;function rt(){this.start=ln;this.end=null;if(yt!==null)this.source=yt}function o(){var e=new Nt;if(r.locations)e.loc=new rt;if(r.directSourceFile)e.sourceFile=r.directSourceFile;if(r.ranges)e.range=[m,0];return e}function C(){return r.locations?[m,ln]:m}function S(t){var e=new Nt,n=t;if(r.locations){e.loc=new rt;e.loc.start=n[1];n=t[0]}e.start=n;if(r.directSourceFile)e.sourceFile=r.directSourceFile;if(r.ranges)e.range=[n,0];return e}function t(e,n){e.type=n;e.end=T;if(r.locations)e.loc.end=rn;if(r.ranges)e.range[1]=T;return e}function Cl(e,t,n){if(r.locations){e.loc.end=n[1];n=n[0]}e.type=t;e.end=n;if(r.ranges)e.range[1]=n;return e}function At(e){return r.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&e.expression.value==="use strict"}function i(n){if(e===n){s();return true}else{return false}}function cn(){return!r.strictSemicolons&&(e===xn||e===b||pn.test(a.slice(T,m)))}function j(){if(!i(L)&&!cn())c()}function l(e){i(e)||c()}function an(){return a.charAt(n)}function c(e){u(e!=null?e:m,"Unexpected token")}function pt(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function _n(e,i,t){if(r.ecmaVersion>=6&&e){switch(e.type){case"Identifier":case"MemberExpression":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=0;n<e.properties.length;n++){var l=e.properties[n];if(l.type==="Property"&&l.kind!=="init")c(l.key.start);_n(l.value,false,t)}break;case"ArrayExpression":e.type="ArrayPattern";for(var n=0,a=e.elements.length-1;n<=a;n++){_n(e.elements[n],n===a,t)}break;case"SpreadElement":if(i){_n(e.argument,false,t);jt(e.argument)}else{c(e.start)}break;case"AssignmentExpression":if(e.operator==="="){e.type="AssignmentPattern"}else{c(e.left.end)}break;default:if(t)c(e.start)}}return e}function vn(){if(r.ecmaVersion<6)return d();switch(e){case p:return d();case X:var a=o();s();var u=a.elements=[],f=true;while(!i(N)){f?f=false:l(x);if(e===K){var n=o();s();n.argument=vn();jt(n.argument);u.push(t(n,"SpreadElement"));l(N);break}u.push(e===x?null:Ft())}return t(a,"ArrayPattern");case R:return vr(true);default:c()}}function Ft(r,e){e=e||vn();if(!i(tn))return e;var n=r?S(r):o();n.operator="=";n.left=e;n.right=fn();return t(n,"AssignmentPattern")}function jt(e){if(e.type!=="Identifier"&&e.type!=="ArrayPattern")c(e.start)}function Tn(e,t){switch(e.type){case"Identifier":if(Mt(e.name)||Ot(e.name))u(e.start,"Defining '"+e.name+"' in strict mode");if(pt(t,e.name))u(e.start,"Argument name clash in strict mode");t[e.name]=true;break;case"ObjectPattern":for(var n=0;n<e.properties.length;n++)Tn(e.properties[n].value,t);break;case"ArrayPattern":for(var n=0;n<e.elements.length;n++){var r=e.elements[n];if(r)Tn(r,t)}break}}function ra(i,l){if(r.ecmaVersion>=6)return;var t=i.key,e;switch(t.type){case"Identifier":e=t.name;break;case"Literal":e=String(t.value);break;default:return}var a=i.kind||"init",n;if(pt(l,e)){n=l[e];var s=a!=="init";if((M||s)&&n[a]||!(s^n.init))u(t.start,"Redefinition of property")}else{n=l[e]={init:false,get:false,set:false}}n[a]=true}function W(e,t){switch(e.type){case"Identifier":if(M&&(Ot(e.name)||Mt(e.name)))u(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode");break;case"MemberExpression":if(t)u(e.start,"Binding to member expression");break;case"ObjectPattern":for(var n=0;n<e.properties.length;n++){var r=e.properties[n];if(r.type==="Property")r=r.value;W(r,t)}break;case"ArrayPattern":for(var n=0;n<e.elements.length;n++){var l=e.elements[n];if(l)W(l,t)}break;case"SpreadProperty":case"AssignmentPattern":case"SpreadElement":case"VirtualPropertyExpression":break;default:u(e.start,"Assigning to rvalue")}}function ua(n){var r=true;if(!n.body)n.body=[];while(e!==xn){var l=F(true);n.body.push(l);if(r&&At(l))Dt(true);r=false}jn=m;T=D;rn=Nn;return t(n,"Program")}var Rt={kind:"loop"},ma={kind:"switch"};function F(a){if(e===Bn||e===z&&f=="/=")un(true);var l=e,n=o(),c=C();switch(l){case hr:case Yt:return ya(n,l.keyword);case Wr:return ba(n);case Gr:return ka(n);case Fn:return Ia(n);case dn:return Ca(n);case wn:return Cr(n,true);case Tt:return Ta(n);case Nr:return Yr(n);case ct:return $r(n);case jr:return Kr(n);case Pr:return Qr(n);case kn:case An:case zn:return Zr(n,l.keyword);case ft:return el(n);case Tr:return nl(n);case R:return In();case L:return tl(n);case _r:case Lt:if(!a&&!r.allowImportExportEverywhere)u(m,"'import' and 'export' may only appear at the top level");return l===Lt?Bl(n):Nl(n);default:var s=f,t=y(false,false,true);if(t.type==="FunctionDeclaration")return t;if(l===p&&t.type==="Identifier"){if(i(_)){return rl(n,s,t)}if(r.ecmaVersion>=7&&t.name==="private"&&e===p){return Rr(n)}else if(t.name==="declare"){if(e===wn||e===p||e===dn||e===kn){return Fr(n)}}else if(e===p){if(t.name==="interface"){return fa(n)}else if(t.name==="type"){return pa(n)}}}return ll(n,t)}}function ya(n,o){var l=o=="break";s();if(i(L)||cn())n.label=null;else if(e!==p)c();else{n.label=d();j()}for(var r=0;r<k.length;++r){var a=k[r];if(n.label==null||a.name===n.label.name){if(a.kind!=null&&(l||a.kind==="loop"))break;if(n.label&&l)break}}if(r===k.length)u(n.start,"Unsyntactic "+o);return t(n,l?"BreakStatement":"ContinueStatement")}function ba(e){s();j();return t(e,"DebuggerStatement")}function ka(e){s();k.push(Rt);e.body=F();k.pop();l(ft);e.test=gn();if(r.ecmaVersion>=6)i(L);else j();return t(e,"DoWhileStatement")}function Ia(a){s();k.push(Rt);l(v);if(e===L)return wt(a,null);if(e===kn||e===An){var n=o(),i=e.keyword,u=e===An;s();ur(n,true,i);t(n,"VariableDeclaration");if((e===On||r.ecmaVersion>=6&&e===p&&f==="of")&&n.declarations.length===1&&!(u&&n.declarations[0].init))return or(a,n);return wt(a,n)}var n=y(false,true);if(e===On||r.ecmaVersion>=6&&e===p&&f==="of"){W(n);return or(a,n)}return wt(a,n)}function Ca(e){s();return Bt(e,true,false)}function Ta(e){s();e.test=gn();e.consequent=F();e.alternate=i(Vr)?F():null;return t(e,"IfStatement")}function Yr(e){if(!Gn&&!r.allowReturnOutsideFunction)u(m,"'return' outside of function");s();if(i(L)||cn())e.argument=null;else{e.argument=y();j()}return t(e,"ReturnStatement")}function $r(r){s();r.discriminant=gn();r.cases=[];l(R);k.push(ma);for(var n,a;e!=b;){if(e===gt||e===Yn){var i=e===gt;if(n)t(n,"SwitchCase");r.cases.push(n=o());n.consequent=[];s();if(i)n.test=y();else{if(a)u(jn,"Multiple default clauses");a=true;n.test=null}l(_)}else{if(!n)c();n.consequent.push(F())}}if(n)t(n,"SwitchCase");s();k.pop();return t(r,"SwitchStatement")}function Kr(e){s();if(pn.test(a.slice(T,m)))u(T,"Illegal newline after throw");e.argument=y();j();return t(e,"ThrowStatement")}function Qr(n){s();n.block=In();n.handler=null;if(e===zr){var r=o();s();l(v);r.param=d();if(M&&Ot(r.param.name))u(r.param.start,"Binding "+r.param.name+" in strict mode");l(h);r.guard=null;r.body=In();n.handler=t(r,"CatchClause")}n.guardedHandlers=mr;n.finalizer=i(Ur)?In():null;if(!n.handler&&!n.finalizer)u(n.start,"Missing catch or finally clause");return t(n,"TryStatement")}function Zr(e,n){s();ur(e,false,n);j();return t(e,"VariableDeclaration")}function el(e){s();e.test=gn();k.push(Rt);e.body=F();k.pop();return t(e,"WhileStatement")}function nl(e){if(M)u(m,"'with' in strict mode");s();e.object=gn();e.body=F();return t(e,"WithStatement")}function tl(e){s();return t(e,"EmptyStatement")}function rl(n,r,a){for(var l=0;l<k.length;++l)if(k[l].name===r)u(a.start,"Label '"+r+"' is already declared");var i=e.isLoop?"loop":e===ct?"switch":null;k.push({name:r,kind:i});n.body=F();k.pop();n.label=a;return t(n,"LabeledStatement")}function ll(e,n){e.expression=n;j();return t(e,"ExpressionStatement")}function gn(){l(v);var e=y();l(h);return e}function In(s){var e=o(),n=true,r;e.body=[];l(R);while(!i(b)){var a=F();e.body.push(a);if(n&&s&&At(a)){r=M;Dt(M=true)}n=false}if(r===false)Dt(false);return t(e,"BlockStatement")}function wt(n,r){n.init=r;l(L);n.test=e===L?null:y();l(L);n.update=e===h?null:y();l(h);n.body=F();k.pop();return t(n,"ForStatement")}function or(n,r){var a=e===On?"ForInStatement":"ForOfStatement";s();n.left=r;n.right=y();l(h);n.body=F();k.pop();return t(n,a)}function ur(r,a,l){r.declarations=[];r.kind=l;for(;;){var n=o();n.id=vn();W(n.id,true);if(e===_){n.id.typeAnnotation=Pn();t(n.id,n.id.type)}n.init=i(tn)?y(true,a):l===zn.keyword?c():null;r.declarations.push(t(n,"VariableDeclarator"));if(!i(x))break}return r}function y(a,r,s){var o=C();var l=fn(r,false,s);if(!a&&e===x){var n=S(o);n.expressions=[l];while(i(x))n.expressions.push(fn(r));return t(n,"SequenceExpression")}return l}function fn(l,a,i){var o=C();var n=pl(l,a,i);if(e.isAssign){var r=S(o);r.operator=f;r.left=e===tn?_n(n):n;W(n);s();r.right=fn(l);return t(r,"AssignmentExpression")}return n}function pl(n,o,c){var f=C();var a=dl(n,o,c);if(i(Z)){var e=S(f);if(r.playground&&i(tn)){var s=e.left=_n(a);if(s.type!=="MemberExpression")u(s.start,"You can only use member expressions in memoization assignment");
e.right=fn(n);e.operator="?=";return t(e,"AssignmentExpression")}e.test=a;e.consequent=y(true);l(_);e.alternate=y(true,n);return t(e,"ConditionalExpression")}return a}function dl(e,n,t){var r=C();return st(Ln(t),r,-1,e,n)}function st(i,o,u,l,c){var r=e.binop;if(r!=null&&(!l||e!==On)&&(!c||e!==w)){if(r>u){var n=S(o);n.left=i;n.operator=f;var a=e;s();var p=C();n.right=st(Ln(),p,a.rightAssociative?r-1:r,l);t(n,a===sr||a===ir?"LogicalExpression":"BinaryExpression");return st(n,o,u,l)}}return i}function Ln(i){if(e.prefix){var n=o(),a=e.isUpdate,l;if(e===K){l="SpreadElement"}else{l=a?"UpdateExpression":"UnaryExpression";n.operator=f;n.prefix=true}$=true;s();n.argument=Ln();if(a)W(n.argument);else if(M&&n.operator==="delete"&&n.argument.type==="Identifier")u(n.start,"Deleting local variable in strict mode");return t(n,l)}var c=C();var r=gl(i);while(e.postfix&&!cn()){var n=S(c);n.operator=f;n.prefix=false;n.argument=r;W(r);s();r=t(n,"UpdateExpression")}return r}function gl(e){var n=C();return G(q(e),n)}function G(s,a,o){if(r.playground&&i($n)){var n=S(a);n.object=s;n.property=d(true);if(i(v)){n.arguments=Un(h,false)}else{n.arguments=[]}return G(t(n,"BindMemberExpression"),a,o)}else if(i(dt)){var n=S(a);n.object=s;n.property=d(true);return G(t(n,"VirtualPropertyExpression"),a,o)}else if(i(qn)){var n=S(a);n.object=s;n.property=d(true);n.computed=false;return G(t(n,"MemberExpression"),a,o)}else if(i(X)){var n=S(a);n.object=s;n.property=y();n.computed=true;l(N);return G(t(n,"MemberExpression"),a,o)}else if(!o&&i(v)){var n=S(a);n.callee=s;n.arguments=Un(h,false);return G(t(n,"CallExpression"),a,o)}else if(e===et){var n=S(a);n.tag=s;n.quasi=Ut();return G(t(n,"TaggedTemplateExpression"),a,o)}return s}function q(I){switch(e){case Ir:var n=o();s();return t(n,"ThisExpression");case mt:var b=C();var n=o();var A=o();s();n.object=t(A,"ThisExpression");n.property=G(d(),b);n.computed=false;return t(n,"MemberExpression");case wr:if(Rn)return Vl();case p:var b=C();var n=o();var g=d(e!==p);if(r.ecmaVersion>=7){if(g.name==="async"){if(e===v){s();var _=++Vn;if(e!==h){u=y();x=u.type==="SequenceExpression"?u.expressions:[u]}else{x=[]}l(h);if(Vn===_&&i(Q)){return tt(n,x,true)}else{n.callee=g;n.arguments=x;return G(t(n,"CallExpression"),b)}}else if(e===p){g=d();if(i(Q)){return tt(n,[g],true)}return g}if(e===dn){if(cn())return g;s();return Bt(n,I,true)}}else if(g.name==="await"){if(Xn)return Xl(n)}}if(i(Q)){return tt(n,[g])}return g;case kt:var n=o();n.regex={pattern:f.pattern,flags:f.flags};n.value=f.value;n.raw=a.slice(m,D);s();return t(n,"Literal");case yn:case J:case Mn:var n=o();n.value=f;n.raw=a.slice(m,D);s();return t(n,"Literal");case Er:case br:case xr:var n=o();n.value=e.atomValue;n.raw=e.keyword;s();return t(n,"Literal");case v:var b=C();var u,x;s();if(r.ecmaVersion>=7&&e===Fn){u=Lr(S(b),true)}else{var _=++Vn;if(e!==h){u=y();x=u.type==="SequenceExpression"?u.expressions:[u]}else{x=[]}l(h);if(Vn===_&&i(Q)){u=tt(S(b),x)}else{if(!u)c(jn);if(r.ecmaVersion>=6){for(var E=0;E<x.length;E++){if(x[E].type==="SpreadElement")c()}}if(r.preserveParens){var k=S(b);k.expression=u;u=t(k,"ParenthesizedExpression")}}}return u;case X:var n=o();s();if(r.ecmaVersion>=7&&e===Fn){return Lr(n,false)}n.elements=Un(N,true,true);return t(n,"ArrayExpression");case R:return vr();case dn:var n=o();s();return Bt(n,false,false);case wn:return Cr(o(),false);case Ar:return bl();case et:return Ut();case w:return ut();case $n:return xl();default:c()}}function xl(){var e=o();s();var n=C();e.callee=G(q(),n,true);if(i(v)){e.arguments=Un(h,false)}else{e.arguments=[]}return t(e,"BindFunctionExpression")}function bl(){var e=o();s();var n=C();e.callee=G(q(),n,true);if(i(v))e.arguments=Un(h,false);else e.arguments=mr;return t(e,"NewExpression")}function gr(){var e=S(r.locations?[m+1,ln.offset(1)]:m+1);e.value=f;e.tail=a.charCodeAt(D-1)!==123;s();var n=e.tail?1:2;return Cl(e,"TemplateElement",r.locations?[T-n,rn.offset(-n)]:T-n)}function Ut(){var n=o();n.expressions=[];var r=gr();n.quasis=[r];while(!r.tail){n.expressions.push(y());if(e!==Zn)c();n.quasis.push(r=gr())}return t(n,"TemplateLiteral")}function vr(a){var u=o(),y=true,S={};u.properties=[];s();while(!i(b)){if(!y){l(x);if(r.allowTrailingCommas&&i(b))break}else y=false;var n=o(),m,h=false,g=false;if(r.ecmaVersion>=7&&e===K){n=Ln();n.type="SpreadProperty";u.properties.push(n);continue}if(r.ecmaVersion>=6){n.method=false;n.shorthand=false;if(a){m=C()}else{h=i(Y)}}if(r.ecmaVersion>=7&&e===p&&f==="async"){var k=d();if(e===_||e===v){n.key=k}else{g=true;hn(n)}}else{hn(n)}var E;if(e===w){E=nn();if(e!==v)c()}if(i(_)){n.value=a?Ft(m):fn();n.kind="init"}else if(r.ecmaVersion>=6&&e===v){if(a)c();n.kind="init";n.method=true;n.value=Pt(h,g)}else if(r.ecmaVersion>=5&&!n.computed&&n.key.type==="Identifier"&&(n.key.name==="get"||n.key.name==="set"||r.playground&&n.key.name==="memo")&&(e!=x&&e!=b)){if(h||g||a)c();n.kind=n.key.name;hn(n);n.value=Pt(false,false)}else if(r.ecmaVersion>=6&&!n.computed&&n.key.type==="Identifier"){n.kind="init";n.value=a?Ft(m,n.key):n.key;n.shorthand=true}else c();n.value.typeParameters=E;ra(n,S);u.properties.push(t(n,"Property"))}return t(u,a?"ObjectPattern":"ObjectExpression")}function hn(n){if(r.ecmaVersion>=6){if(i(X)){n.computed=true;n.key=y();l(N);return}else{n.computed=false}}n.key=e===yn||e===J?q():d(true)}function it(e,n){e.id=null;e.params=[];if(r.ecmaVersion>=6){e.defaults=[];e.rest=null;e.generator=false}if(r.ecmaVersion>=7){e.async=n}}function Bt(n,l,a,s){it(n,a);if(r.ecmaVersion>=6){n.generator=i(Y)}if(l||e===p){n.id=d()}if(e===w){n.typeParameters=nn()}Sr(n);Et(n,s);return t(n,l?"FunctionDeclaration":"FunctionExpression")}function Pt(l,a){var e=o();it(e,a);Sr(e);var n;if(r.ecmaVersion>=6){e.generator=l;n=true}else{n=false}Et(e,n);return t(e,"FunctionExpression")}function tt(e,r,o){it(e,o);var a=e.defaults,i=false;for(var l=0,s=r.length-1;l<=s;l++){var n=r[l];if(n.type==="AssignmentExpression"&&n.operator==="="){i=true;r[l]=n.left;a.push(n.right)}else{_n(n,l===s,true);a.push(null);if(n.type==="SpreadElement"){r.length--;e.rest=n.argument;break}}}e.params=r;if(!i)e.defaults=[];Et(e,true);return t(e,"ArrowFunctionExpression")}function Sr(n){var t=[],a=false;l(v);for(;;){if(i(h)){break}else if(r.ecmaVersion>=6&&i(K)){n.rest=vn();jt(n.rest);kr(n.rest);l(h);t.push(null);break}else{var s=vn();kr(s);n.params.push(s);if(r.ecmaVersion>=6){if(i(tn)){a=true;t.push(y(true))}else{t.push(null)}}if(!i(x)){l(h);break}}}if(a)n.defaults=t;if(e===_){n.returnType=Pn()}}function kr(n){if(i(Z)){n.optional=true}if(e===_){n.typeAnnotation=Pn()}t(n,n.type)}function Et(n,a){var r=a&&e!==R;var i=Xn;Xn=n.async;if(r){n.body=y(true);n.expression=true}else{var s=Gn,o=Rn,u=k;Gn=true;Rn=n.generator;k=[];n.body=In(true);n.expression=false;Gn=s;Rn=o;k=u}Xn=i;if(M||!r&&n.body.body.length&&At(n.body.body[0])){var l={};if(n.id)Tn(n.id,{});for(var t=0;t<n.params.length;t++)Tn(n.params[t],l);if(n.rest)Tn(n.rest,l)}}function Rr(e){e.declarations=[];do{e.declarations.push(d())}while(i(x));j();return t(e,"PrivateDeclaration")}function Cr(a,g){s();a.id=e===p?d():g?c():null;if(e===w){a.typeParameters=nn()}a.superClass=i(Ct)?fn(false,true):null;if(a.superClass&&e===w){a.superTypeParameters=Kn()}if(e===p&&f==="implements"){s();a.implements=Ml()}var u=o();u.body=[];l(R);while(!i(b)){while(i(L));if(e===b)continue;var n=o();if(r.ecmaVersion>=7&&e===p&&f==="private"){s();u.body.push(Rr(n));continue}if(e===p&&f==="static"){s();n["static"]=true}else{n["static"]=false}var m=false;var h=i(Y);if(r.ecmaVersion>=7&&!h&&e===p&&f==="async"){var x=d();if(e===_||e===v){n.key=x}else{m=true;hn(n)}}else{hn(n)}if(e!==v&&!n.computed&&n.key.type==="Identifier"&&(n.key.name==="get"||n.key.name==="set"||r.playground&&n.key.name==="memo")){if(h||m)c();n.kind=n.key.name;hn(n)}else{n.kind=""}if(e===_){if(h||m)c();n.typeAnnotation=Pn();j();u.body.push(t(n,"ClassProperty"))}else{var y;if(e===w){y=nn()}n.value=Pt(h,m);n.value.typeParameters=y;u.body.push(t(n,"MethodDefinition"))}}a.body=t(u,"ClassBody");return t(a,g?"ClassDeclaration":"ClassExpression")}function Ml(){var r=[];do{var n=o();n.id=d();if(e===w){n.typeParameters=Kn()}else{n.typeParameters=null}r.push(t(n,"ClassImplements"))}while(i(x));return r}function Un(t,s,o){var n=[],a=true;while(!i(t)){if(!a){l(x);if(s&&r.allowTrailingCommas&&i(t))break}else a=false;if(o&&e===x)n.push(null);else n.push(y(true))}return n}function d(n){var l=o();if(n&&r.forbidReserved=="everywhere")n=false;if(e===p){if(!n&&(r.forbidReserved&&(r.ecmaVersion===3?al:il)(f)||M&&Mt(f))&&a.slice(m,D).indexOf("\\")==-1)u(m,"The keyword '"+f+"' is reserved");l.name=f}else if(n&&e.keyword){l.name=e.keyword}else{c()}$=false;s();return t(l,"Identifier")}function Nl(n){s();if(e===kn||e===zn||e===An||e===dn||e===wn||e===p&&f==="async"){n.declaration=F();n["default"]=false;n.specifiers=null;n.source=null}else if(i(Yn)){var r=n.declaration=y(true);if(r.id){if(r.type==="FunctionExpression"){r.type="FunctionDeclaration"}else if(r.type==="ClassExpression"){r.type="ClassDeclaration"}}n["default"]=true;n.specifiers=null;n.source=null;j()}else{var l=e===Y;n.declaration=null;n["default"]=false;n.specifiers=Fl();if(e===p&&f==="from"){s();n.source=e===J?q():c()}else{if(l)c();n.source=null}j()}return t(n,"ExportDeclaration")}function Fl(){var a=[],u=true;if(e===Y){var n=o();s();a.push(t(n,"ExportBatchSpecifier"))}else{l(R);while(!i(b)){if(!u){l(x);if(r.allowTrailingCommas&&i(b))break}else u=false;var n=o();n.id=d(e===Yn);if(e===p&&f==="as"){s();n.name=d(true)}else{n.name=null}a.push(t(n,"ExportSpecifier"))}}return a}function Bl(n){s();if(e===J){n.specifiers=[];n.source=q()}else{n.specifiers=Ul();if(e!==p||f!=="from")c();s();n.source=e===J?q():c()}j();return t(n,"ImportDeclaration")}function Ul(){var a=[],u=true;if(e===p){var n=o();n.id=o();n.name=d();W(n.name,true);n.id.name="default";t(n.id,"Identifier");a.push(t(n,"ImportSpecifier"));if(!i(x))return a}if(e===Y){var n=o();s();if(e!==p||f!=="as")c();s();n.name=d();W(n.name,true);a.push(t(n,"ImportBatchSpecifier"));return a}l(R);while(!i(b)){if(!u){l(x);if(r.allowTrailingCommas&&i(b))break}else u=false;var n=o();n.id=d(true);if(e===p&&f==="as"){s();n.name=d()}else{n.name=null}W(n.name||n.id,true);n["default"]=false;a.push(t(n,"ImportSpecifier"))}return a}function Vl(){var e=o();s();if(i(L)||cn()){e.delegate=false;e.argument=null}else{e.delegate=i(Y);e.argument=y(true)}return t(e,"YieldExpression")}function Xl(e){if(i(L)||cn()){c()}e.delegate=i(Y);e.argument=y(true);return t(e,"AwaitExpression")}function Lr(n,a){n.blocks=[];while(e===Fn){var r=o();s();l(v);r.left=vn();W(r.left,true);if(e!==p||f!=="of")c();s();r.of=true;r.right=y();l(h);n.blocks.push(t(r,"ComprehensionBlock"))}n.filter=i(Tt)?gn():null;n.body=y();l(a?h:N);n.generator=a;return t(n,"ComprehensionExpression")}function Dn(e){if(e.type==="XJSIdentifier"){return e.name}if(e.type==="XJSNamespacedName"){return e.namespace.name+":"+e.name.name}if(e.type==="XJSMemberExpression"){return Dn(e.object)+"."+Dn(e.property)}}function Sn(){var n=o();if(e===bt){n.name=f}else if(e.keyword){n.name=e.keyword}else{c()}$=false;s();return t(n,"XJSIdentifier")}function Mr(){var e=o();e.namespace=Sn();l(_);e.name=Sn();return t(e,"XJSNamespacedName")}function Hl(){var r=C();var e=Sn();while(i(qn)){var n=S(r);n.object=e;n.property=Sn();e=t(n,"XJSMemberExpression")}return e}function Or(){switch(an()){case":":return Mr();case".":return Hl();default:return Sn()}}function Yl(){if(an()===":"){return Mr()}return Sn()}function $l(){switch(e){case R:var n=Dr();if(n.expression.type==="XJSEmptyExpression"){u(n.start,"XJS attributes must only be assigned a non-empty "+"expression")}return n;case w:return ut();case Mn:return q();default:u(m,"XJS value should be either an expression or a quoted XJS text")}}function Kl(){if(e!==b){c()}var n;n=m;m=T;T=n;n=ln;ln=rn;rn=n;return t(o(),"XJSEmptyExpression")}function Dr(){var r=o();var a=I,i=A;I=false;A=false;s();r.expression=e===b?Kl():y();I=a;A=i;if(A){n=D}l(b);return t(r,"XJSExpressionContainer")}function Zl(){if(e===R){var a=m,i=ln;var u=I;I=false;s();if(e!==K)c();var n=Ln();I=u;l(b);n.type="XJSSpreadAttribute";n.start=a;n.end=T;if(r.locations){n.loc.start=i;n.loc.end=rn}if(r.ranges){n.range=[a,T]}return n}var n=o();n.name=Yl();if(e===tn){s();n.value=$l()}else{n.value=null}return t(n,"XJSAttribute")}function ea(){switch(e){case R:return Dr();case Mn:return q();default:return ut()}}function na(){var n=o(),r=n.attributes=[];var a=A;var u=I;A=false;I=true;s();n.name=Or();while(e!==xn&&e!==Bn&&e!==H){r.push(Zl())}I=false;if(n.selfClosing=!!i(Bn)){I=u;A=a}else{A=true}l(H);return t(n,"XJSOpeningElement")}function ta(){var e=o();var r=A;var a=I;A=false;I=true;$=false;l(ot);e.name=Or();sn();A=r;I=a;$=false;if(A){n=D}l(H);return t(e,"XJSClosingElement")}function ut(){var n=o();var a=[];var i=A;var r=na();var l=null;if(!r.selfClosing){while(e!==xn&&e!==ot){A=true;a.push(ea())}A=i;l=ta();if(Dn(l.name)!==Dn(r.name)){u(l.start,"Expected corresponding XJS closing tag for '"+Dn(r.name)+"'")}}if(!i&&e===w){u(m,"Adjacent XJS elements must be wrapped in an enclosing tag")}n.openingElement=r;n.closingElement=l;n.children=a;return t(n,"XJSElement")}function la(e){s();Br(e,true);return t(e,"DeclareClass")}function aa(a){s();var r=a.id=d();var n=o();var i=o();if(e===w){n.typeParameters=nn()}else{n.typeParameters=null}l(v);var u=St();n.params=u.params;n.rest=u.rest;l(h);l(_);n.returnType=O();i.typeAnnotation=t(n,"FunctionTypeAnnotation");r.typeAnnotation=t(i,"TypeAnnotation");t(r,r.type);j();return t(a,"DeclareFunction")}function Fr(n){if(e===wn){return la(n)}else if(e===dn){return aa(n)}else if(e===kn){return sa(n)}else if(e===p&&f==="module"){return oa(n)}else{c()}}function sa(e){s();e.id=Ql();j();return t(e,"DeclareVariable")}function oa(n){s();if(e===J){n.id=q()}else{n.id=d()}var r=n.body=o();var a=r.body=[];l(R);while(e!==b){var i=o();s();a.push(Fr(i))}l(b);t(r,"BlockStatement");return t(n,"DeclareModule")}function Br(n,t){n.id=d();if(e===w){n.typeParameters=nn()}else{n.typeParameters=null}n.extends=[];if(i(Ct)){do{n.extends.push(ca())}while(i(x))}n.body=Jr(t)}function ca(){var n=o();n.id=d();if(e===w){n.typeParameters=Kn()}else{n.typeParameters=null}return t(n,"InterfaceExtends")}function fa(e){Br(e,false);return t(e,"InterfaceDeclaration")}function pa(n){n.id=d();if(e===w){n.typeParameters=nn()}else{n.typeParameters=null}l(tn);n.right=O();j();return t(n,"TypeAlias")}function nn(){var n=o();n.params=[];l(w);while(e!==H){n.params.push(d());if(e!==H){l(x)}}l(H);return t(n,"TypeParameterDeclaration")}function Kn(){var n=o(),r=on;n.params=[];on=true;l(w);while(e!==H){n.params.push(O());if(e!==H){l(x)}}l(H);on=r;return t(n,"TypeParameterInstantiation")}function Xr(){return e===yn||e===J?q():d(true)}function ga(e,n){e.static=n;l(X);e.id=Xr();l(_);e.key=O();l(N);l(_);e.value=O();return t(e,"ObjectTypeIndexer")}function qr(n){n.params=[];n.rest=null;n.typeParameters=null;if(e===w){n.typeParameters=nn()}l(v);while(e===p){n.params.push(nt());if(e!==h){l(x)}}if(i(K)){n.rest=nt()}l(h);l(_);n.returnType=O();return t(n,"FunctionTypeAnnotation")}function va(n,r,l){var e=S(n);e.value=qr(S(n));e.static=r;e.key=l;e.optional=false;return t(e,"ObjectTypeProperty")}function xa(e,n){var r=o();e.static=n;e.value=qr(r);return t(e,"ObjectTypeCallProperty")}function Jr(m){var n=o();var r;var h=false;var y;var u;var x;var E;var a;n.callProperties=[];n.properties=[];n.indexers=[];l(R);while(e!==b){var g=C();r=o();if(m&&e===p&&f==="static"){s();a=true}if(e===X){n.indexers.push(ga(r,a))}else if(e===v||e===w){n.callProperties.push(xa(r,m))}else{if(a&&e===_){u=d()}else{u=Xr()}if(e===w||e===v){n.properties.push(va(g,a,u))}else{if(i(Z)){h=true}l(_);r.key=u;r.value=O();r.optional=h;r.static=a;n.properties.push(t(r,"ObjectTypeProperty"))}}if(!i(L)&&e!==b){c()}}l(b);return t(n,"ObjectTypeAnnotation")}function Ea(l,a){var n=S(l);n.typeParameters=null;n.id=a;while(i(qn)){var r=S(l);r.qualification=n.id;r.id=d();n.id=t(r,"QualifiedTypeIdentifier")}if(e===w){n.typeParameters=Kn()}return t(n,"GenericTypeAnnotation")}function wa(){var e=o();l(Jn["void"]);return t(e,"VoidTypeAnnotation")}function _a(){var e=o();l(Jn["typeof"]);e.argument=Hr();return t(e,"TypeofTypeAnnotation")}function Sa(){var r=o();r.types=[];l(X);while(n<V&&e!==N){r.types.push(O());if(e===N)break;l(x)}l(N);return t(r,"TupleTypeAnnotation")}function nt(){var n=false;var e=o();e.name=d();if(i(Z)){n=true}l(_);e.optional=n;e.typeAnnotation=O();return t(e,"FunctionTypeParam")}function St(){var n={params:[],rest:null};while(e===p){n.params.push(nt());if(e!==h){l(x)}}if(i(K)){n.rest=nt()}return n}function Ra(r,e,n){switch(n.name){case"any":return t(e,"AnyTypeAnnotation");case"bool":case"boolean":return t(e,"BooleanTypeAnnotation");case"number":return t(e,"NumberTypeAnnotation");case"string":return t(e,"StringTypeAnnotation");default:return Ea(r,n)}}function Hr(){var A=null;var _=null;var I=null;var b=C();var n=o();var E=null;var r;var S;var k;var g;var x=false;switch(e){case p:return Ra(b,n,d());case R:return Jr();case X:return Sa();case w:n.typeParameters=nn();l(v);r=St();n.params=r.params;n.rest=r.rest;l(h);l(Q);n.returnType=O();return t(n,"FunctionTypeAnnotation");case v:s();var y;if(e!==h&&e!==K){if(e===p){}else{x=true}}if(x){if(y&&h){g=y}else{g=O();l(h)}if(i(Q)){u(n,"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType")}return g}r=St();n.params=r.params;n.rest=r.rest;l(h);l(Q);n.returnType=O();n.typeParameters=null;return t(n,"FunctionTypeAnnotation");case J:n.value=f;n.raw=a.slice(m,D);s();return t(n,"StringLiteralTypeAnnotation");default:if(e.keyword){switch(e.keyword){case"void":return wa();case"typeof":return _a()}}}c()}function Aa(){var n=o();var r=n.elementType=Hr();if(e===X){l(X);l(N);return t(n,"ArrayTypeAnnotation")}return r}function vt(){var e=o();if(i(Z)){e.typeAnnotation=vt();return t(e,"NullableTypeAnnotation")}return Aa()}function Ht(){var e=o();var n=vt();e.types=[n];while(i(rr)){e.types.push(vt())}return e.types.length===1?n:t(e,"IntersectionTypeAnnotation")}function jl(){var e=o();var n=Ht();e.types=[n];while(i(ar)){e.types.push(Ht())}return e.types.length===1?n:t(e,"UnionTypeAnnotation")}function O(){var e=on;on=true;var n=jl();on=e;return n}function Pn(){var e=o();l(_);e.typeAnnotation=O();return t(e,"TypeAnnotation")}function Ql(a,s){var u=o();var n=d();var r=false;if(s&&i(Z)){l(Z);r=true}if(a||e===_){n.typeAnnotation=Pn();t(n,n.type)}if(r){n.optional=true;t(n,n.type)}return n}})},{}],2:[function(e,n,t){(function(r){"use strict";var t=n.exports=e("./transformation/transform");t.version=e("../../package").version;t.transform=t;t.run=function(n,e){e=e||{};e.sourceMap="inline";return new Function(t(n,e).code)()};t.load=function(l,a,n,i){n=n||{};n.filename=n.filename||l;var e=r.ActiveXObject?new r.ActiveXObject("Microsoft.XMLHTTP"):new r.XMLHttpRequest;e.open("GET",l,true);if("overrideMimeType"in e)e.overrideMimeType("text/plain");e.onreadystatechange=function(){if(e.readyState!==4)return;var r=e.status;if(r===0||r===200){var s=[e.responseText,n];if(!i)t.run.apply(t,s);if(a)a(s)}else{throw new Error("Could not load "+l)}};e.send(null)};var l=function(){var e=[];var o=["text/ecmascript-6","text/6to5","module"];var a=0;var l=function(){var n=e[a];if(n instanceof Array){t.run.apply(t,n);a++;l()}};var u=function(n,a){var r={};if(n.src){t.load(n.src,function(n){e[a]=n;l()},r,true)}else{r.filename="embedded";e[a]=[n.innerHTML,r]}};var i=r.document.getElementsByTagName("script");for(var n=0;n<i.length;++n){var s=i[n];if(o.indexOf(s.type)>=0)e.push(s)}for(n in e){u(e[n],n)}l()};if(r.addEventListener){r.addEventListener("DOMContentLoaded",l,false)}else if(r.attachEvent){r.attachEvent("onload",l)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../../package":197,"./transformation/transform":44}],3:[function(a,o,c){"use strict";o.exports=e;var i=/^\#\!.*/;var l=a("./transformation/transform");var u=a("./generation/generator");var s=a("./traverse/scope");var r=a("./util");var t=a("./types");var n=a("lodash");function e(n){this.dynamicImports=[];this.dynamicImportIds={};this.opts=e.normaliseOptions(n);this.transformers=this.getTransformers();this.uids={};this.ast={}}e.helpers=["inherits","defaults","prototype-properties","apply-constructor","tagged-template-literal","tagged-template-literal-loose","interop-require","to-array","sliced-to-array","object-without-properties","has-own","slice","bind","define-property","async-to-generator","interop-require-wildcard","typeof","extends","get"];e.excludeHelpersFromRuntime=["async-to-generator","typeof","tagged-template-literal-loose"];e.normaliseOptions=function(e){e=n.cloneDeep(e||{});n.defaults(e,{keepModuleIdExtensions:false,includeRegenerator:false,experimental:false,reactCompat:false,playground:false,whitespace:true,moduleIds:e.amdModuleIds||false,blacklist:[],whitelist:[],sourceMap:false,optional:[],comments:true,filename:"unknown",modules:"common",runtime:false,loose:[],code:true,ast:true});e.filename=e.filename.replace(/\\/g,"/");e.blacklist=r.arrayify(e.blacklist);e.whitelist=r.arrayify(e.whitelist);e.optional=r.arrayify(e.optional);e.loose=r.arrayify(e.loose);if(n.contains(e.loose,"all")){e.loose=Object.keys(l.transformers)}n.each({fastForOf:"forOf",classesFastSuper:"classes"},function(r,t){if(n.contains(e.optional,t)){n.pull(e.optional,t);e.loose.push(r)}});n.defaults(e,{moduleRoot:e.sourceRoot});n.defaults(e,{sourceRoot:e.moduleRoot});n.defaults(e,{filenameRelative:e.filename});n.defaults(e,{sourceFileName:e.filenameRelative,sourceMapName:e.filenameRelative});if(e.runtime===true){e.runtime="to5Runtime"}if(e.playground){e.experimental=true}l._ensureTransformerNames("blacklist",e.blacklist);l._ensureTransformerNames("whitelist",e.whitelist);l._ensureTransformerNames("optional",e.optional);l._ensureTransformerNames("loose",e.loose);return e};e.prototype.isLoose=function(e){return n.contains(this.opts.loose,e)};e.prototype.getTransformers=function(){var e=this;var t=[];var r=[];n.each(l.transformers,function(n){if(n.canRun(e)){t.push(n);if(n.secondPass){r.push(n)}if(n.manipulateOptions){n.manipulateOptions(e.opts,e)}}});return t.concat(r)};e.prototype.toArray=function(e,n){if(t.isArrayExpression(e)){return e}else if(t.isIdentifier(e)&&e.name==="arguments"){return t.callExpression(t.memberExpression(this.addHelper("slice"),t.identifier("call")),[e])}else{var r="to-array";var l=[e];if(n){l.push(t.literal(n));r="sliced-to-array"}return t.callExpression(this.addHelper(r),l)}};e.prototype.getModuleFormatter=function(e){var t=n.isFunction(e)?e:l.moduleFormatters[e];if(!t){var i=r.resolve(e);if(i)t=a(i)}if(!t){throw new ReferenceError("Unknown module formatter type "+JSON.stringify(e))}return new t(this)};e.prototype.parseShebang=function(e){var n=e.match(i);if(n){this.shebang=n[0];e=e.replace(i,"")}return e};e.prototype.addImport=function(r,e){e=e||r;var n=this.dynamicImportIds[e];if(!n){n=this.dynamicImportIds[e]=this.generateUidIdentifier(e);var a=[t.importSpecifier(t.identifier("default"),n)];var l=t.importDeclaration(a,t.literal(r));l._blockHoist=3;this.dynamicImports.push(l)}return n};e.prototype.addHelper=function(l){if(!n.contains(e.helpers,l)){throw new ReferenceError("unknown declaration "+l)}var a=this.ast.program;var i=a._declarations&&a._declarations[l];if(i)return i.id;var s;var o=this.opts.runtime;if(o&&!n.contains(e.excludeHelpersFromRuntime,l)){l=t.identifier(t.toIdentifier(l));return t.memberExpression(t.identifier(o),l)}else{s=r.template(l)}var u=this.generateUidIdentifier(l);this.scope.push({key:l,id:u,init:s});return u};e.prototype.errorWithNode=function(r,l,e){e=e||SyntaxError;var n=r.loc.start;var t=new e("Line "+n.line+": "+l);t.loc=n;return t};e.prototype.addCode=function(e){e=(e||"")+"";this.code=e;return this.parseShebang(e)};e.prototype.parse=function(e){var n=this;e=this.addCode(e);return r.parse(this.opts,e,function(e){n.transform(e);return n.generate()})};e.prototype.transform=function(t){var e=this;this.ast=t;this.scope=new s(t.program);this.moduleFormatter=this.getModuleFormatter(this.opts.modules);var r=function(t){n.each(e.transformers,function(n){n.astRun(e,t)})};r("enter");n.each(this.transformers,function(n){n.transform(e)});r("exit")};e.prototype.generate=function(){var n=this.opts;var t=this.ast;var e={code:"",map:null,ast:null};if(n.ast)e.ast=t;if(!n.code)return e;var l=u(t,n,this.code);e.code=l.code;e.map=l.map;if(this.shebang){e.code=this.shebang+"\n"+e.code}if(n.sourceMap==="inline"){e.code+="\n"+r.sourceMapToComment(e.map)}return e};e.prototype.generateUid=function(e,n){e=t.toIdentifier(e).replace(/^_+/,"");n=n||this.scope;var r;do{r=this._generateUid(e)}while(n.has(r));return r};e.prototype.generateUidIdentifier=function(r,e){e=e||this.scope;var n=t.identifier(this.generateUid(r,e));e.add(n);return n};e.prototype._generateUid=function(e){var t=this.uids;var n=t[e]||1;var r=e;if(n>1)r+=n;t[e]=n+1;return"_"+r}},{"./generation/generator":5,"./transformation/transform":44,"./traverse/scope":89,"./types":92,"./util":94,lodash:142}],4:[function(r,l,a){"use strict";l.exports=e;var n=r("../util");var t=r("lodash");function e(n,e){this.position=n;this._indent=e.indent.base;this.format=e;this.buf=""}e.prototype.get=function(){return n.trimRight(this.buf)};e.prototype.getIndent=function(){if(this.format.compact){return""}else{return n.repeat(this._indent,this.format.indent.style)}};e.prototype.indentSize=function(){return this.getIndent().length};e.prototype.indent=function(){this._indent++};e.prototype.dedent=function(){this._indent--};e.prototype.semicolon=function(){this.push(";")};e.prototype.ensureSemicolon=function(){if(!this.isLast(";"))this.semicolon()};e.prototype.rightBrace=function(){this.newline(true);this.push("}")};e.prototype.keyword=function(e){this.push(e);this.push(" ")};e.prototype.space=function(){if(this.buf&&!this.isLast([" ","\n"])){this.push(" ")}};e.prototype.removeLast=function(e){if(!this.isLast(e))return;this.buf=this.buf.substr(0,this.buf.length-1);this.position.unshift(e)};e.prototype.newline=function(e,r){if(this.format.compact)return;r=r||false;if(t.isNumber(e)){if(this.endsWith("{\n"))e--;if(this.endsWith(n.repeat(e,"\n")))return;while(e--){this._newline(r)}return}if(t.isBoolean(e)){r=e}this._newline(r)};e.prototype._newline=function(e){if(e&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this._removeSpacesAfterLastNewline();this._push("\n")};e.prototype._removeSpacesAfterLastNewline=function(){var n=this.buf.lastIndexOf("\n");if(n===-1)return;var e=this.buf.length-1;while(e>n){if(this.buf[e]!==" "){break}e--}if(e===n){this.buf=this.buf.substring(0,e+1)}};e.prototype.push=function(e,t){if(this._indent&&!t&&e!=="\n"){var n=this.getIndent();e=e.replace(/\n/g,"\n"+n);if(this.isLast("\n"))e=n+e}this._push(e)};e.prototype._push=function(e){this.position.push(e);this.buf+=e};e.prototype.endsWith=function(e){var n=this.buf.length-e.length;return n>=0&&this.buf.lastIndexOf(e)===n};e.prototype.isLast=function(r,a){var e=this.buf;if(a)e=n.trimRight(e);var l=e[e.length-1];if(Array.isArray(r)){return t.contains(r,l)}else{return r===l}}},{"../util":94,lodash:142}],5:[function(e,a,f){"use strict";a.exports=function(e,t,r){var l=new n(e,t,r);return l.generate()};a.exports.CodeGenerator=n;var s=e("./whitespace");var o=e("./source-map");var u=e("./position");var i=e("./buffer");var c=e("../util");var r=e("./node");var l=e("../types");var t=e("lodash");function n(t,e,r){e=e||{};this.comments=t.comments||[];this.tokens=t.tokens||[];this.format=n.normaliseOptions(e);this.ast=t;this.whitespace=new s(this.tokens,this.comments);this.position=new u;this.map=new o(this.position,e,r);this.buffer=new i(this.position,this.format)}t.each(i.prototype,function(e,t){n.prototype[t]=function(){return e.apply(this.buffer,arguments)}});n.normaliseOptions=function(e){return t.merge({parentheses:true,comments:e.comments==null||e.comments,compact:false,indent:{adjustMultilineComment:true,style:" ",base:0}},e.format||{})};n.generators={templateLiterals:e("./generators/template-literals"),comprehensions:e("./generators/comprehensions"),expressions:e("./generators/expressions"),statements:e("./generators/statements"),playground:e("./generators/playground"),classes:e("./generators/classes"),methods:e("./generators/methods"),modules:e("./generators/modules"),types:e("./generators/types"),flow:e("./generators/flow"),base:e("./generators/base"),jsx:e("./generators/jsx")};t.each(n.generators,function(e){t.extend(n.prototype,e)});n.prototype.generate=function(){var e=this.ast;this.print(e);var n=[];t.each(e.comments,function(e){if(!e._displayed)n.push(e)});this._printComments(n);return{map:this.map.get(),code:this.buffer.get()}};n.prototype.buildPrint=function(t){var n=this;var e=function(e,r){return n.print(e,t,r)};e.sequence=function(r,t){t=t||{};t.statement=true;return n.printJoin(e,r,t)};e.join=function(t,r){return n.printJoin(e,t,r)};e.block=function(t){return n.printBlock(e,t)};e.indentOnComments=function(t){return n.printAndIndentOnComments(e,t)};return e};n.prototype.print=function(e,n,t){if(!e)return"";var l=this;t=t||{};var i=function(i){if(!t.statement&&!r.isUserWhitespacable(e,n)){return}var a=0;if(e.start!=null&&!e._ignoreUserWhitespace){if(i){a=l.whitespace.getNewlinesBefore(e)}else{a=l.whitespace.getNewlinesAfter(e)}}else{if(!i)a++;var s=r.needsWhitespaceAfter;if(i)s=r.needsWhitespaceBefore;a+=s(e,n);if(!l.buffer.get())a=0}l.newline(a)};if(this[e.type]){var a=r.needsParensNoLineTerminator(e,n);var s=a||r.needsParens(e,n);if(s)this.push("(");if(a)this.indent();this.printLeadingComments(e,n);i(true);if(t.before)t.before();this.map.mark(e,"start");this[e.type](e,this.buildPrint(e),n);if(a){this.newline();this.dedent()}if(s)this.push(")");this.map.mark(e,"end");if(t.after)t.after();i(false);this.printTrailingComments(e,n)}else{throw new ReferenceError("unknown node of type "+JSON.stringify(e.type)+" with constructor "+JSON.stringify(e&&e.constructor.name))}};n.prototype.printJoin=function(l,n,e){if(!n||!n.length)return;e=e||{};var r=this;var a=n.length;if(e.indent)r.indent();t.each(n,function(n,t){l(n,{statement:e.statement,after:function(){if(e.iterator){e.iterator(n,t)}if(e.separator&&t<a-1){r.push(e.separator)}}})});if(e.indent)r.dedent()};n.prototype.printAndIndentOnComments=function(t,e){var n=!!e.leadingComments;if(n)this.indent();t(e);if(n)this.dedent()};n.prototype.printBlock=function(n,e){if(l.isEmptyStatement(e)){this.semicolon()}else{this.push(" ");n(e)}};n.prototype.generateComment=function(n){var e=n.value;if(n.type==="Line"){e="//"+e}else{e="/*"+e+"*/"}return e};n.prototype.printTrailingComments=function(e,n){this._printComments(this.getComments("trailingComments",e,n))};n.prototype.printLeadingComments=function(e,n){this._printComments(this.getComments("leadingComments",e,n))};n.prototype.getComments=function(a,e,i){if(l.isExpressionStatement(i)){return[]}var n=[];var r=[e];var s=this;if(l.isExpressionStatement(e)){r.push(e.argument)}t.each(r,function(e){n=n.concat(s._getComments(a,e))});return n};n.prototype._getComments=function(n,e){return e&&e[n]||[]};n.prototype._printComments=function(n){if(this.format.compact)return;if(!this.format.comments)return;if(!n||!n.length)return;var e=this;t.each(n,function(r){var a=false;t.each(e.ast.comments,function(e){if(e.start===r.start){if(e._displayed)a=true;e._displayed=true;return false}});if(a)return;e.newline(e.whitespace.getNewlinesBefore(r));var l=e.position.column;var n=e.generateComment(r);if(l&&!e.isLast(["\n"," ","[","{"])){e._push(" ");l++}if(r.type==="Block"&&e.format.indent.adjustMultilineComment){var i=r.loc.start.column;if(i){var s=new RegExp("\\n\\s{1,"+i+"}","g");n=n.replace(s,"\n")}var o=Math.max(e.indentSize(),l);
n=n.replace(/\n/g,"\n"+c.repeat(o))}if(l===0){n=e.getIndent()+n}e._push(n);e.newline(e.whitespace.getNewlinesAfter(r))})}},{"../types":92,"../util":94,"./buffer":4,"./generators/base":6,"./generators/classes":7,"./generators/comprehensions":8,"./generators/expressions":9,"./generators/flow":10,"./generators/jsx":11,"./generators/methods":12,"./generators/modules":13,"./generators/playground":14,"./generators/statements":15,"./generators/template-literals":16,"./generators/types":17,"./node":18,"./position":21,"./source-map":22,"./whitespace":23,lodash:142}],6:[function(n,t,e){"use strict";e.File=function(e,n){n(e.program)};e.Program=function(e,n){n.sequence(e.body)};e.BlockStatement=function(e,n){if(e.body.length===0){this.push("{}")}else{this.push("{");this.newline();n.sequence(e.body,{indent:true});this.removeLast("\n");this.rightBrace()}}},{}],7:[function(n,t,e){"use strict";e.ClassExpression=e.ClassDeclaration=function(e,n){this.push("class");if(e.id){this.space();n(e.id)}if(e.superClass){this.push(" extends ");n(e.superClass)}this.space();n(e.body)};e.ClassBody=function(e,n){if(e.body.length===0){this.push("{}")}else{this.push("{");this.newline();this.indent();n.sequence(e.body);this.dedent();this.rightBrace()}};e.MethodDefinition=function(e,n){if(e.static){this.push("static ")}this._method(e,n)}},{}],8:[function(n,t,e){"use strict";e.ComprehensionBlock=function(e,n){this.keyword("for");this.push("(");n(e.left);this.push(" of ");n(e.right);this.push(")")};e.ComprehensionExpression=function(e,n){this.push(e.generator?"(":"[");n.join(e.blocks,{separator:" "});this.space();if(e.filter){this.keyword("if");this.push("(");n(e.filter);this.push(")");this.space()}n(e.body);this.push(e.generator?")":"]")}},{}],9:[function(t,s,e){"use strict";var l=t("../../util");var n=t("../../types");var a=t("lodash");e.UnaryExpression=function(e,l){var r=/[a-z]$/.test(e.operator);var t=e.argument;if(n.isUpdateExpression(t)||n.isUnaryExpression(t)){r=true}if(n.isUnaryExpression(t)&&t.operator==="!"){r=false}this.push(e.operator);if(r)this.space();l(e.argument)};e.UpdateExpression=function(e,n){if(e.prefix){this.push(e.operator);n(e.argument)}else{n(e.argument);this.push(e.operator)}};e.ConditionalExpression=function(e,n){n(e.test);this.push(" ? ");n(e.consequent);this.push(" : ");n(e.alternate)};e.NewExpression=function(e,n){this.push("new ");n(e.callee);if(e.arguments.length||this.format.parentheses){this.push("(");n.join(e.arguments,{separator:", "});this.push(")")}};e.SequenceExpression=function(e,n){n.join(e.expressions,{separator:", "})};e.ThisExpression=function(){this.push("this")};e.CallExpression=function(e,t){t(e.callee);this.push("(");var n=",";if(e._prettyCall){n+="\n";this.newline();this.indent()}else{n+=" "}t.join(e.arguments,{separator:n});if(e._prettyCall){this.newline();this.dedent()}this.push(")")};var r=function(e){return function(n,t){this.push(e);if(n.delegate)this.push("*");if(n.argument){this.space();t(n.argument)}}};e.YieldExpression=r("yield");e.AwaitExpression=r("await");e.EmptyStatement=function(){this.semicolon()};e.ExpressionStatement=function(e,n){n(e.expression);this.semicolon()};e.BinaryExpression=e.LogicalExpression=e.AssignmentPattern=e.AssignmentExpression=function(e,n){n(e.left);this.push(" "+e.operator+" ");n(e.right)};var i=/e/i;e.MemberExpression=function(e,r){var t=e.object;r(t);if(!e.computed&&n.isMemberExpression(e.property)){throw new TypeError("Got a MemberExpression for MemberExpression property")}var s=e.computed;if(n.isLiteral(e.property)&&a.isNumber(e.property.value)){s=true}if(s){this.push("[");r(e.property);this.push("]")}else{if(n.isLiteral(t)&&l.isInteger(t.value)&&!i.test(t.value.toString())){this.push(".")}this.push(".");r(e.property)}}},{"../../types":92,"../../util":94,lodash:142}],10:[function(n,t,e){"use strict";e.AnyTypeAnnotation=e.ArrayTypeAnnotation=e.BooleanTypeAnnotation=e.ClassProperty=e.DeclareClass=e.DeclareFunction=e.DeclareModule=e.DeclareVariable=e.FunctionTypeAnnotation=e.FunctionTypeParam=e.GenericTypeAnnotation=e.InterfaceExtends=e.InterfaceDeclaration=e.IntersectionTypeAnnotation=e.NullableTypeAnnotation=e.NumberTypeAnnotation=e.StringLiteralTypeAnnotation=e.StringTypeAnnotation=e.TupleTypeAnnotation=e.TypeofTypeAnnotation=e.TypeAlias=e.TypeAnnotation=e.TypeParameterDeclaration=e.TypeParameterInstantiation=e.ObjectTypeAnnotation=e.ObjectTypeCallProperty=e.ObjectTypeIndexer=e.ObjectTypeProperty=e.QualifiedTypeIdentifier=e.UnionTypeAnnotation=e.VoidTypeAnnotation=function(){}},{}],11:[function(n,l,e){"use strict";var t=n("../../types");var r=n("lodash");e.XJSAttribute=function(e,n){n(e.name);if(e.value){this.push("=");n(e.value)}};e.XJSIdentifier=function(e){this.push(e.name)};e.XJSNamespacedName=function(e,n){n(e.namespace);this.push(":");n(e.name)};e.XJSMemberExpression=function(e,n){n(e.object);this.push(".");n(e.property)};e.XJSSpreadAttribute=function(e,n){this.push("{...");n(e.argument);this.push("}")};e.XJSExpressionContainer=function(e,n){this.push("{");n(e.expression);this.push("}")};e.XJSElement=function(e,n){var a=this;var l=e.openingElement;n(l);if(l.selfClosing)return;this.indent();r.each(e.children,function(e){if(t.isLiteral(e)){a.push(e.value)}else{n(e)}});this.dedent();n(e.closingElement)};e.XJSOpeningElement=function(e,n){this.push("<");n(e.name);if(e.attributes.length>0){this.space();n.join(e.attributes,{separator:" "})}this.push(e.selfClosing?" />":">")};e.XJSClosingElement=function(e,n){this.push("</");n(e.name);this.push(">")};e.XJSEmptyExpression=function(){}},{"../../types":92,lodash:142}],12:[function(n,r,e){"use strict";var t=n("../../types");e._params=function(e,n){var t=this;this.push("(");n.join(e.params,{separator:", ",iterator:function(a,l){var r=e.defaults&&e.defaults[l];if(r){t.push(" = ");n(r)}}});if(e.rest){if(e.params.length){this.push(", ")}this.push("...");n(e.rest)}this.push(")")};e._method=function(e,n){var t=e.value;var r=e.kind;var l=e.key;if(!r||r==="init"){if(t.generator){this.push("*")}}else{this.push(r+" ")}if(t.async)this.push("async ");if(e.computed){this.push("[");n(l);this.push("]")}else{n(l)}this._params(t,n);this.space();n(t.body)};e.FunctionDeclaration=e.FunctionExpression=function(e,n){if(e.async)this.push("async ");this.push("function");if(e.generator)this.push("*");this.space();if(e.id)n(e.id);this._params(e,n);this.space();n(e.body)};e.ArrowFunctionExpression=function(e,n){if(e.async)this.push("async ");if(e.params.length===1&&!e.defaults.length&&!e.rest&&t.isIdentifier(e.params[0])){n(e.params[0])}else{this._params(e,n)}this.push(" => ");n(e.body)}},{"../../types":92}],13:[function(n,l,e){"use strict";var t=n("../../types");var r=n("lodash");e.ImportSpecifier=function(n,t){if(n.id&&n.id.name==="default"){t(n.name)}else{return e.ExportSpecifier.apply(this,arguments)}};e.ExportSpecifier=function(e,n){n(e.id);if(e.name){this.push(" as ");n(e.name)}};e.ExportBatchSpecifier=function(){this.push("*")};e.ExportDeclaration=function(e,r){this.push("export ");var n=e.specifiers;if(e.default){this.push("default ")}if(e.declaration){r(e.declaration);if(t.isStatement(e.declaration))return}else{if(n.length===1&&t.isExportBatchSpecifier(n[0])){r(n[0])}else{this.push("{");if(n.length){this.space();r.join(n,{separator:", "});this.space()}this.push("}")}if(e.source){this.push(" from ");r(e.source)}}this.ensureSemicolon()};e.ImportDeclaration=function(e,t){var l=this;this.push("import ");var a=e.specifiers;if(a&&a.length){var n=false;r.each(e.specifiers,function(e,r){if(+r>0){l.push(", ")}var a=e.id&&e.id.name==="default";if(!a&&e.type!=="ImportBatchSpecifier"&&!n){n=true;l.push("{ ")}t(e)});if(n){this.push(" }")}this.push(" from ")}t(e.source);this.semicolon()};e.ImportBatchSpecifier=function(e,n){this.push("* as ");n(e.name)}},{"../../types":92,lodash:142}],14:[function(e,r,n){"use strict";var t=e("lodash");t.each(["BindMemberExpression","BindFunctionExpression"],function(e){n[e]=function(){throw new ReferenceError("Trying to render non-standard playground node "+JSON.stringify(e))}})},{lodash:142}],15:[function(t,i,e){"use strict";var a=t("../../util");var r=t("../../types");e.WithStatement=function(e,n){this.keyword("with");this.push("(");n(e.object);this.push(")");n.block(e.body)};e.IfStatement=function(e,n){this.keyword("if");this.push("(");n(e.test);this.push(") ");n.indentOnComments(e.consequent);if(e.alternate){if(this.isLast("}"))this.space();this.keyword("else");n.indentOnComments(e.alternate)}};e.ForStatement=function(e,n){this.keyword("for");this.push("(");n(e.init);this.push(";");if(e.test){this.space();n(e.test)}this.push(";");if(e.update){this.space();n(e.update)}this.push(")");n.block(e.body)};e.WhileStatement=function(e,n){this.keyword("while");this.push("(");n(e.test);this.push(")");n.block(e.body)};var l=function(e){return function(n,t){this.keyword("for");this.push("(");t(n.left);this.push(" "+e+" ");t(n.right);this.push(")");t.block(n.body)}};e.ForInStatement=l("in");e.ForOfStatement=l("of");e.DoWhileStatement=function(e,n){this.keyword("do");n(e.body);this.space();this.keyword("while");this.push("(");n(e.test);this.push(");")};var n=function(e,n){return function(r,l){this.push(e);var t=r[n||"label"];if(t){this.space();l(t)}this.semicolon()}};e.ContinueStatement=n("continue");e.ReturnStatement=n("return","argument");e.BreakStatement=n("break");e.LabeledStatement=function(e,n){n(e.label);this.push(": ");n(e.body)};e.TryStatement=function(e,n){this.keyword("try");n(e.block);this.space();if(e.handlers){n(e.handlers[0])}else{n(e.handler)}if(e.finalizer){this.space();this.push("finally ");n(e.finalizer)}};e.CatchClause=function(e,n){this.keyword("catch");this.push("(");n(e.param);this.push(") ");n(e.body)};e.ThrowStatement=function(e,n){this.push("throw ");n(e.argument);this.semicolon()};e.SwitchStatement=function(e,n){this.keyword("switch");this.push("(");n(e.discriminant);this.push(") {");n.sequence(e.cases,{indent:true});this.push("}")};e.SwitchCase=function(e,n){if(e.test){this.push("case ");n(e.test);this.push(":")}else{this.push("default:")}this.newline();n.sequence(e.consequent,{indent:true})};e.DebuggerStatement=function(){this.push("debugger;")};e.VariableDeclaration=function(e,o,l){this.push(e.kind+" ");var i=0;var s=0;if(!r.isFor(l)){for(var n=0;n<e.declarations.length;n++){if(e.declarations[n].init){i++}else{s++}}}var t=",";if(i>s){t+="\n"+a.repeat(e.kind.length+1)}else{t+=" "}o.join(e.declarations,{separator:t});if(!r.isFor(l)){this.semicolon()}};e.PrivateDeclaration=function(e,n){this.push("private ");n.join(e.declarations,{separator:", "});this.semicolon()};e.VariableDeclarator=function(e,n){if(e.init){n(e.id);this.push(" = ");n(e.init)}else{n(e.id)}}},{"../../types":92,"../../util":94}],16:[function(n,r,e){"use strict";var t=n("lodash");e.TaggedTemplateExpression=function(e,n){n(e.tag);n(e.quasi)};e.TemplateElement=function(e){this._push(e.value.raw)};e.TemplateLiteral=function(e,n){this.push("`");var r=e.quasis;var l=this;var a=r.length;t.each(r,function(r,t){n(r);if(t+1<a){l.push("${ ");n(e.expressions[t]);l.push(" }")}});this._push("`")}},{lodash:142}],17:[function(n,r,e){"use strict";var t=n("lodash");e.Identifier=function(e){this.push(e.name)};e.SpreadElement=e.SpreadProperty=function(e,n){this.push("...");n(e.argument)};e.VirtualPropertyExpression=function(e,n){n(e.object);this.push("::");n(e.property)};e.ObjectExpression=e.ObjectPattern=function(n,t){var e=n.properties;if(e.length){this.push("{");this.space();t.join(e,{separator:", ",indent:true});this.space();this.push("}")}else{this.push("{}")}};e.Property=function(e,n){if(e.method||e.kind==="get"||e.kind==="set"){this._method(e,n)}else{if(e.computed){this.push("[");n(e.key);this.push("]")}else{n(e.key);if(e.shorthand)return}this.push(": ");n(e.value)}};e.ArrayExpression=e.ArrayPattern=function(r,l){var n=r.elements;var e=this;var a=n.length;this.push("[");t.each(n,function(n,t){if(!n){e.push(",")}else{if(t>0)e.push(" ");l(n);if(t<a-1)e.push(",")}});this.push("]")};e.Literal=function(n){var e=n.value;var t=typeof e;if(t==="string"){e=JSON.stringify(e);e=e.replace(/[\u000A\u000D\u2028\u2029]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)});this.push(e)}else if(t==="boolean"||t==="number"){this.push(JSON.stringify(e))}else if(n.regex){this.push("/"+n.regex.pattern+"/"+n.regex.flags)}else if(e===null){this.push("null")}}},{lodash:142}],18:[function(t,i,o){"use strict";i.exports=e;var a=t("./whitespace");var s=t("./parentheses");var n=t("../../types");var r=t("lodash");var l=function(e,l,s){if(!e)return;var t;var a=Object.keys(e);for(var r=0;r<a.length;r++){var i=a[r];if(n.is(i,l)){var o=e[i];t=o(l,s);if(t!=null)break}}return t};function e(e,n){this.parent=n;this.node=e}e.isUserWhitespacable=function(e){return n.isUserWhitespacable(e)};e.needsWhitespace=function(t,o,s){if(!t)return 0;if(n.isExpressionStatement(t)){t=t.expression}var i=l(a[s].nodes,t,o);if(i)return i;r.each(l(a[s].list,t,o),function(n){i=e.needsWhitespace(n,t,s);if(i)return false});return i||0};e.needsWhitespaceBefore=function(n,t){return e.needsWhitespace(n,t,"before")};e.needsWhitespaceAfter=function(n,t){return e.needsWhitespace(n,t,"after")};e.needsParens=function(e,t){if(!t)return false;if(n.isNewExpression(t)&&t.callee===e){if(n.isCallExpression(e))return true;var a=r.some(e,function(e){return n.isCallExpression(e)});if(a)return true}return l(s,e,t)};e.needsParensNoLineTerminator=function(t,e){if(!e)return false;if(!t.leadingComments||!t.leadingComments.length){return false}if(n.isYieldExpression(e)||n.isAwaitExpression(e)){return true}if(n.isContinueStatement(e)||n.isBreakStatement(e)||n.isReturnStatement(e)||n.isThrowStatement(e)){return true}return false};r.each(e,function(t,n){e.prototype[n]=function(){var t=new Array(arguments.length+2);t[0]=this.node;t[1]=this.parent;for(var r=0;r<t.length;r++){t[r+2]=arguments[r]}return e[n].apply(null,t)}})},{"../../types":92,"./parentheses":19,"./whitespace":20,lodash:142}],19:[function(r,a,n){"use strict";var e=r("../../types");var l=r("lodash");var t={};l.each([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],function(e,n){l.each(e,function(e){t[e]=n})});n.UpdateExpression=function(t,n){if(e.isMemberExpression(n)&&n.object===t){return true}};n.ObjectExpression=function(t,n){if(e.isExpressionStatement(n)){return true}if(e.isMemberExpression(n)&&n.object===t){return true}return false};n.Binary=function(r,n){if((e.isCallExpression(n)||e.isNewExpression(n))&&n.callee===r){return true}if(e.isUnaryLike(n)){return true}if(e.isMemberExpression(n)&&n.object===r){return true}if(e.isBinary(n)){var i=n.operator;var l=t[i];var s=r.operator;var a=t[s];if(l>a){return true}if(l===a&&n.right===r){return true}}};n.BinaryExpression=function(t,n){if(t.operator==="in"){if(e.isVariableDeclarator(n)){return true}if(e.isFor(n)){return true}}};n.SequenceExpression=function(t,n){if(e.isForStatement(n)){return false}if(e.isExpressionStatement(n)&&n.expression===t){return false}return true};n.YieldExpression=function(t,n){return e.isBinary(n)||e.isUnaryLike(n)||e.isCallExpression(n)||e.isMemberExpression(n)||e.isNewExpression(n)||e.isConditionalExpression(n)||e.isYieldExpression(n)};n.ClassExpression=function(t,n){return e.isExpressionStatement(n)};n.UnaryLike=function(t,n){return e.isMemberExpression(n)&&n.object===t};n.FunctionExpression=function(t,n){if(e.isExpressionStatement(n)){return true}if(e.isMemberExpression(n)&&n.object===t){return true}if(e.isCallExpression(n)&&n.callee===t){return true}};n.AssignmentExpression=n.ConditionalExpression=function(t,n){if(e.isUnaryLike(n)){return true}if(e.isBinary(n)){return true}if(e.isCallExpression(n)&&n.callee===t){return true}if(e.isConditionalExpression(n)&&n.test===t){return true}if(e.isMemberExpression(n)&&n.object===t){return true}return false}},{"../../types":92,lodash:142}],20:[function(r,l,n){"use strict";var e=r("lodash");var t=r("../../types");n.before={nodes:{Property:function(e,n){if(n.properties[0]===e){return 1}},SpreadProperty:function(e,t){return n.before.nodes.Property(e,t)},SwitchCase:function(e,n){if(n.cases[0]===e){return 1}},CallExpression:function(e){if(t.isFunction(e.callee)){return 1}}}};n.after={nodes:{AssignmentExpression:function(e){if(t.isFunction(e.right)){return 1}}},list:{VariableDeclaration:function(n){return e.map(n.declarations,"init")},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties}}};e.each({Function:1,Class:1,For:1,ArrayExpression:{after:1},ObjectExpression:{after:1},SwitchStatement:1,IfStatement:{before:1},CallExpression:{after:1},Literal:{after:1}},function(r,l){if(e.isNumber(r)){r={after:r,before:r}}e.each([l].concat(t.FLIPPED_ALIAS_KEYS[l]||[]),function(t){e.each(r,function(e,r){n[r].nodes[t]=function(){return e}})})})},{"../../types":92,lodash:142}],21:[function(t,n,r){"use strict";n.exports=e;function e(){this.line=1;this.column=0}e.prototype.push=function(n){for(var e=0;e<n.length;e++){if(n[e]==="\n"){this.line++;this.column=0}else{this.column++}}};e.prototype.unshift=function(n){for(var e=0;e<n.length;e++){if(n[e]==="\n"){this.line--}else{this.column--}}}},{}],22:[function(n,r,a){"use strict";r.exports=e;var l=n("source-map");var t=n("../types");function e(n,e,t){this.position=n;this.opts=e;if(e.sourceMap){this.map=new l.SourceMapGenerator({file:e.sourceMapName,sourceRoot:e.sourceRoot});this.map.setSourceContent(e.sourceFileName,t)}else{this.map=null}}e.prototype.get=function(){var e=this.map;if(e){return e.toJSON()}else{return e}};e.prototype.mark=function(e,s){var l=e.loc;if(!l)return;var a=this.map;if(!a)return;if(t.isProgram(e)||t.isFile(e))return;var i=this.position;var n={line:i.line,column:i.column};var r=l[s];if(n.line===r.line&&n.column===r.column)return;a.addMapping({source:this.opts.sourceFileName,generated:n,original:r})}},{"../types":92,"source-map":186}],23:[function(t,r,a){"use strict";r.exports=e;var l=t("lodash");function n(e,t,n){e+=t;if(e>=n)e-=n;return e}function e(e,n){this.tokens=l.sortBy(e.concat(n),"start");this.used={};this._lastFoundIndex=0}e.prototype.getNewlinesBefore=function(s){var a;var i;var e=this.tokens;var t;for(var r=0;r<e.length;r++){var l=n(r,this._lastFoundIndex,this.tokens.length);t=e[l];if(s.start===t.start){a=e[l-1];i=t;this._lastFoundIndex=l;break}}return this.getNewlinesBetween(a,i)};e.prototype.getNewlinesAfter=function(i){var s;var e;var t=this.tokens;var r;for(var l=0;l<t.length;l++){var a=n(l,this._lastFoundIndex,this.tokens.length);r=t[a];if(i.end===r.end){s=r;e=t[a+1];this._lastFoundIndex=a;break}}if(e.type.type==="eof"){return 1}else{var o=this.getNewlinesBetween(s,e);if(i.type==="Line"&&!o){return 1}else{return o}}};e.prototype.getNewlinesBetween=function(n,r){var l=n?n.loc.end.line:1;var a=r.loc.start.line;var t=0;for(var e=l;e<a;e++){if(typeof this.used[e]==="undefined"){this.used[e]=true;t++}}return t}},{lodash:142}],24:[function(n,s,o){"use strict";var l=n("./types");var a=n("lodash");var i=n("estraverse");a.extend(i.VisitorKeys,l.VISITOR_KEYS);var t=n("ast-types");var e=t.Type.def;var r=t.Type.or;e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression"));e("ImportBatchSpecifier").bases("Specifier").build("name").field("name",e("Identifier"));e("VirtualPropertyExpression").bases("Expression").build("object","property").field("object",e("Expression")).field("property",r(e("Identifier"),e("Expression")));e("PrivateDeclaration").bases("Declaration").build("declarations").field("declarations",[e("Identifier")]);e("BindMemberExpression").bases("Expression").build("object","property","arguments").field("object",e("Expression")).field("property",r(e("Identifier"),e("Expression"))).field("arguments",[e("Expression")]);e("BindFunctionExpression").bases("Expression").build("callee","arguments").field("callee",e("Expression")).field("arguments",[e("Expression")]);t.finalize()},{"./types":92,"ast-types":108,estraverse:136,lodash:142}],25:[function(require,module,exports){"use strict";module.exports=function toFastProperties(obj){function f(){}f.prototype=obj;return f;eval(obj)}},{}],26:[function(n,r,l){"use strict";var t=n("./explode-assignable-expression");var e=n("../../types");r.exports=function(r,n){var l=function(e){return e.operator===n.operator+"="};var a=function(n,t){return e.assignmentExpression("=",n,t)};r.ExpressionStatement=function(o,f,u,p,c){var r=o.expression;if(!l(r))return;var i=[];var s=t(r.left,i,c,u,true);i.push(e.expressionStatement(a(s.ref,n.build(s.uid,r.right))));return i};r.AssignmentExpression=function(a,o,i,c,u){if(e.isExpressionStatement(o))return;if(!l(a))return;var r=[];var s=t(a.left,r,u,i);r.push(n.build(s.uid,a.right));r.push(s.ref);return e.toSequenceExpression(r,i)};r.BinaryExpression=function(e){if(e.operator!==n.operator)return;return n.build(e.left,e.right)}}},{"../../types":92,"./explode-assignable-expression":29}],27:[function(n,t,r){"use strict";var e=n("../../types");t.exports=function l(t,l){var r=t.blocks.shift();if(!r)return;var n=l(t,l);if(!n){n=l();if(t.filter){n=e.ifStatement(t.filter,e.blockStatement([n]))}}return e.forOfStatement(e.variableDeclaration("let",[e.variableDeclarator(r.left)]),r.right,e.blockStatement([n]))}},{"../../types":92}],28:[function(n,r,l){"use strict";var t=n("./explode-assignable-expression");var e=n("../../types");r.exports=function(r,n){var l=function(n,t){return e.assignmentExpression("=",n,t)};r.ExpressionStatement=function(o,c,u,f,r){var a=o.expression;if(!n.is(a,r))return;var i=[];var s=t(a.left,i,r,u);i.push(e.ifStatement(n.build(s.uid,r),e.expressionStatement(l(s.ref,a.right))));return i};r.AssignmentExpression=function(a,u,o,c,i){if(e.isExpressionStatement(u))return;if(!n.is(a,i))return;var r=[];var s=t(a.left,r,i,o);r.push(e.logicalExpression("&&",n.build(s.uid,i),l(s.ref,a.right)));r.push(s.ref);return e.toSequenceExpression(r,o)}}},{"../../types":92,"./explode-assignable-expression":29}],29:[function(n,t,a){"use strict";var e=n("../../types");var r=function(n,l,a,i){var t;if(e.isIdentifier(n)){t=n}else if(e.isMemberExpression(n)){t=n.object}else{throw new Error("We can't explode this node type "+n.type)}var r=i.generateUidBasedOnNode(t,a);l.push(e.variableDeclaration("var",[e.variableDeclarator(r,t)]));return r};var l=function(t,a,i,s){var n=t.property;var r=e.toComputedKey(t,n);if(e.isLiteral(r))return r;var l=s.generateUidBasedOnNode(n,i);a.push(e.variableDeclaration("var",[e.variableDeclarator(l,n)]));return l};t.exports=function(n,s,o,u,f){var t;if(e.isIdentifier(n)&&f){t=n}else{t=r(n,s,o,u)}var a,i;if(e.isIdentifier(n)){a=n;i=t}else{var c=l(n,s,o,u);var p=n.computed||e.isLiteral(c);i=a=e.memberExpression(t,c,p)}return{uid:i,ref:a}}},{"../../types":92}],30:[function(n,i,t){"use strict";var r=n("../../traverse");var l=n("../../util");var e=n("../../types");var a={enter:function(t,r,l,a,n){if(!e.isIdentifier(t,{name:n.id}))return;if(!e.isReferenced(t,r))return;var i=l.get(n.id,true);if(i!==n.outerDeclar)return;n.selfReference=true;a.stop()}};t.property=function(n,o,s){var t=e.toComputedKey(n,n.key);if(!e.isLiteral(t))return n;var i=e.toIdentifier(t.value);t=e.identifier(i);var u={id:i,selfReference:false,outerDeclar:s.get(i,true)};r(n,a,s,u);if(u.selfReference){n.value=l.template("property-method-assignment-wrapper",{FUNCTION:n.value,FUNCTION_ID:t,FUNCTION_KEY:o.generateUidIdentifier(i,s),WRAPPER_KEY:o.generateUidIdentifier(i+"Wrapper",s)})}else{n.value.id=t}}},{"../../traverse":88,"../../types":92,"../../util":94}],31:[function(n,t,l){"use strict";var r=n("../../traverse");var e=n("../../types");t.exports=function(n,a){n.async=false;n.generator=true;r(n,{enter:function(n,r,l,t){if(e.isFunction(n))t.skip();if(e.isAwaitExpression(n)){n.type="YieldExpression"}}});var t=e.callExpression(a,[n]);if(e.isFunctionDeclaration(n)){var l=e.variableDeclaration("var",[e.variableDeclarator(n.id,t)]);l._blockHoist=true;return l}else{return t}}},{"../../traverse":88,"../../types":92}],32:[function(t,r,a){"use strict";r.exports=n;var l=t("../../traverse");var e=t("../../types");function n(e,n,t,r,l){this.topLevelThisReference=null;this.methodNode=e;this.className=n;this.superName=t;this.isLoose=r;this.file=l}n.prototype.superProperty=function(n,t,r,l){return e.callExpression(this.file.addHelper("get"),[e.callExpression(e.memberExpression(e.identifier("Object"),e.identifier("getPrototypeOf")),[t?this.className:e.memberExpression(this.className,e.identifier("prototype"))]),r?n:e.literal(n.name),l])};n.prototype.looseSuperProperty=function(t,n,r){var a=t.key;var l=this.superName||e.identifier("Function");if(r.property===n){return}else if(e.isCallExpression(r,{callee:n})){r.arguments.unshift(e.thisExpression());if(a.name==="constructor"){return e.memberExpression(l,e.identifier("call"))}else{n=l;if(!t.static){n=e.memberExpression(n,e.identifier("prototype"))}n=e.memberExpression(n,a,t.computed);return e.memberExpression(n,e.identifier("call"))}}else if(e.isMemberExpression(r)&&!t.static){return e.memberExpression(l,e.identifier("prototype"))}else{return l}};n.prototype.replace=function(){this.traverseLevel(this.methodNode.value,true)};n.prototype.traverseLevel=function(t,r){var n=this;l(t,{enter:function(t,i,o,l){if(e.isFunction(t)&&!e.isArrowFunctionExpression(t)){n.traverseLevel(t,false);return l.skip()}if(e.isProperty(t,{method:true})||e.isMethodDefinition(t)){return l.skip()}var s=function(){if(r){return e.thisExpression()}else{return n.getThisReference()}};var a=n.specHandle;if(n.isLoose)a=n.looseHandle;return a.call(n,s,t,i)}})};n.prototype.getThisReference=function(){if(this.topLevelThisReference){return this.topLevelThisReference}else{var n=this.topLevelThisReference=this.file.generateUidIdentifier("this");this.methodNode.body.body.unshift(e.variableDeclaration("var",[e.variableDeclarator(this.topLevelThisReference,e.thisExpression())]));return n}};n.prototype.looseHandle=function(r,n,l){if(e.isIdentifier(n,{name:"super"})){return this.looseSuperProperty(this.methodNode,n,l)}else if(e.isCallExpression(n)){var t=n.callee;if(!e.isMemberExpression(t))return;if(t.object.name!=="super")return;e.appendToMemberExpression(t,e.identifier("call"));n.arguments.unshift(r())}};n.prototype.specHandle=function(c,n,i){var s=this.methodNode;var r;var a;var t;if(e.isIdentifier(n,{name:"super"})){if(!(e.isMemberExpression(i)&&!i.computed&&i.property===n)){throw this.file.errorWithNode(n,"illegal use of bare super")}}else if(e.isCallExpression(n)){var l=n.callee;if(e.isIdentifier(l,{name:"super"})){r=s.key;a=s.computed;t=n.arguments}else{if(!e.isMemberExpression(l))return;if(l.object.name!=="super")return;r=l.property;a=l.computed;t=n.arguments}}else if(e.isMemberExpression(n)){if(!e.isIdentifier(n.object,{name:"super"}))return;r=n.property;a=n.computed}if(!r)return;var o=c();var u=this.superProperty(r,s.static,a,o);if(t){if(t.length===1&&e.isSpreadElement(t[0])){return e.callExpression(e.memberExpression(u,e.identifier("apply")),[o,t[0].argument])}else{return e.callExpression(e.memberExpression(u,e.identifier("call")),[o].concat(t))}}else{return u}}},{"../../traverse":88,"../../types":92}],33:[function(t,r,e){"use strict";var n=t("../../types");e.has=function(t){var e=t.body[0];return n.isExpressionStatement(e)&&n.isLiteral(e.expression,{value:"use strict"})};e.wrap=function(n,r){var t;if(e.has(n)){t=n.body.shift()}r();if(t){n.body.unshift(t)}}},{"../../types":92}],34:[function(t,a,c){"use strict";a.exports=n;var r=t("../../traverse");var i=t("../../util");var e=t("../../types");var l=t("lodash");function n(e){this.file=e;this.localExports=this.getLocalExports();this.localImports=this.getLocalImports();this.remapAssignments()}var s={enter:function(n,a,i,s,r){var t=n&&n.declaration;if(e.isExportDeclaration(n)&&t&&e.isStatement(t)){l.extend(r,e.getIds(t,true))}}};n.prototype.getLocalExports=function(){var e={};r(this.file.ast,s,null,e);return e};var o={enter:function(n,r,a,i,t){if(e.isImportDeclaration(n)){l.extend(t,e.getIds(n,true))}}};n.prototype.getLocalImports=function(){var e={};r(this.file.ast,o,null,e);return e};var u={enter:function(t,a,i,s,r){if(e.isAssignmentExpression(t)){var n=t.left;if(e.isMemberExpression(n)){while(n.object)n=n.object}r(n)}else if(e.isDeclaration(t)){l.each(e.getIds(t,true),r)}}};n.prototype.checkCollisions=function(){var n=this.localImports;var t=this.file;var a=function(t){return e.isIdentifier(t)&&l.has(n,t.name)&&n[t.name]!==t};var i=function(e){if(a(e)){throw t.errorWithNode(e,"Illegal assignment of module import")}};r(t.ast,u,null,i)};n.prototype.remapExportAssignment=function(n){return e.assignmentExpression("=",n.left,e.assignmentExpression(n.operator,e.memberExpression(e.identifier("exports"),n.left),n.right))};n.prototype.remapAssignments=function(){var n=this.localExports;var t=this;var l=function(r,l){var t=r.name;return e.isIdentifier(r)&&n[t]&&n[t]===l.get(t,true)};r(this.file.ast,{enter:function(n,u,a,i,s){if(e.isUpdateExpression(n)&&s(n.argument,a)){i.skip();var c=e.assignmentExpression(n.operator[0]+"=",n.argument,e.literal(1));var o=t.remapExportAssignment(c);if(e.isExpressionStatement(u)||n.prefix){return o}var r=[];r.push(o);var l;if(n.operator==="--"){l="+"}else{l="-"}r.push(e.binaryExpression(l,n.argument,e.literal(1)));return e.sequenceExpression(r)}if(e.isAssignmentExpression(n)&&s(n.left,a)){i.skip();return t.remapExportAssignment(n)}}},null,l)};n.prototype.getModuleName=function(){var e=this.file.opts;var t=e.filenameRelative;var n="";if(e.moduleRoot){n=e.moduleRoot+"/"}if(!e.filenameRelative){return n+e.filename.replace(/^\//,"")}if(e.sourceRoot){var r=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(r,"")}if(!e.keepModuleIdExtensions){t=t.replace(/\.(.*?)$/,"")}n+=t;n=n.replace(/\\/g,"/");return n};n.prototype._pushStatement=function(n,t){if(e.isClass(n)||e.isFunction(n)){if(n.id){t.push(e.toStatement(n));n=n.id}}return n};n.prototype._hoistExport=function(t,n,r){if(e.isFunctionDeclaration(t)){n._blockHoist=r||2}return n};n.prototype._exportSpecifier=function(r,n,t,l){var i=false;if(t.specifiers.length===1)i=t;if(t.source){if(e.isExportBatchSpecifier(n)){l.push(this._exportsWildcard(r(),t))}else{var a;if(e.isSpecifierDefault(n)&&!this.noInteropRequire){a=e.callExpression(this.file.addHelper("interop-require"),[r()])}else{a=e.memberExpression(r(),n.id)}l.push(this._exportsAssign(e.getSpecifierName(n),a,t))}}else{l.push(this._exportsAssign(e.getSpecifierName(n),n.id,t))}};n.prototype._exportsWildcard=function(n){return e.expressionStatement(e.callExpression(this.file.addHelper("defaults"),[e.identifier("exports"),e.callExpression(this.file.addHelper("interop-require-wildcard"),[n])]))};n.prototype._exportsAssign=function(e,n){return i.template("exports-assign",{VALUE:n,KEY:e},true)};n.prototype.exportDeclaration=function(t,a){var n=t.declaration;var s=n.id;if(t.default){s=e.identifier("default")}var i;if(e.isVariableDeclaration(n)){for(var r=0;r<n.declarations.length;r++){var l=n.declarations[r];l.init=this._exportsAssign(l.id,l.init,t).expression;var o=e.variableDeclaration(n.kind,[l]);if(r===0)e.inherits(o,n);a.push(o)}}else{var u=n;if(e.isFunctionDeclaration(n)||e.isClassDeclaration(n)){u=n.id;a.push(n)}i=this._exportsAssign(s,u,t);a.push(i);this._hoistExport(n,i)}}},{"../../traverse":88,"../../types":92,"../../util":94,lodash:142}],35:[function(e,n,r){"use strict";var t=e("../../util");n.exports=function(e){var n=function(){this.noInteropExport=true;e.apply(this,arguments)};t.inherits(n,e);return n}},{"../../util":94}],36:[function(e,n,t){"use strict";n.exports=e("./_strict")(e("./amd"))},{"./_strict":35,"./amd":37}],37:[function(t,a,o){"use strict";a.exports=n;var r=t("./_default");var l=t("./common");var i=t("../../util");var e=t("../../types");var s=t("lodash");function n(){l.apply(this,arguments);this.ids={}}i.inherits(n,r);n.prototype.buildDependencyLiterals=function(){var n=[];for(var t in this.ids){n.push(e.literal(t))}return n};n.prototype.transform=function(i){var r=i.program;
var o=r.body;var n=[e.literal("exports")];if(this.passModuleArg)n.push(e.literal("module"));n=n.concat(this.buildDependencyLiterals());n=e.arrayExpression(n);var t=s.values(this.ids);if(this.passModuleArg)t.unshift(e.identifier("module"));t.unshift(e.identifier("exports"));var u=e.functionExpression(null,t,e.blockStatement(o));var l=[n,u];var a=this.getModuleName();if(a)l.unshift(e.literal(a));var c=e.callExpression(e.identifier("define"),l);r.body=[e.expressionStatement(c)]};n.prototype.getModuleName=function(){if(this.file.opts.moduleIds){return r.prototype.getModuleName.apply(this,arguments)}else{return null}};n.prototype._push=function(t){var e=t.source.value;var n=this.ids;if(n[e]){return n[e]}else{return this.ids[e]=this.file.generateUidIdentifier(e)}};n.prototype.importDeclaration=function(e){this._push(e)};n.prototype.importSpecifier=function(t,r,l){var a=e.getSpecifierName(t);var n=this._push(r);if(e.isImportBatchSpecifier(t)){}else if(e.isSpecifierDefault(t)&&!this.noInteropRequire){n=e.callExpression(this.file.addHelper("interop-require"),[n])}else{n=e.memberExpression(n,t.id,false)}l.push(e.variableDeclaration("var",[e.variableDeclarator(a,n)]))};n.prototype.exportDeclaration=function(e){if(e.default&&!this.noInteropExport){this.passModuleArg=true}l.prototype.exportDeclaration.apply(this,arguments)};n.prototype.exportSpecifier=function(n,e,t){var r=this;return this._exportSpecifier(function(){return r._push(e)},n,e,t)}},{"../../types":92,"../../util":94,"./_default":34,"./common":39,lodash:142}],38:[function(e,n,t){"use strict";n.exports=e("./_strict")(e("./common"))},{"./_strict":35,"./common":39}],39:[function(r,a,s){"use strict";a.exports=t;var l=r("./_default");var i=r("../../traverse");var n=r("../../util");var e=r("../../types");function t(t){l.apply(this,arguments);var n=false;i(t.ast,{enter:function(t){if(e.isExportDeclaration(t)&&!t.default)n=true}});this.hasNonDefaultExports=n}n.inherits(t,l);t.prototype.importSpecifier=function(t,r,l){var a=e.getSpecifierName(t);if(e.isSpecifierDefault(t)){l.push(e.variableDeclaration("var",[e.variableDeclarator(a,e.callExpression(this.file.addHelper("interop-require"),[n.template("require",{MODULE_NAME:r.source})]))]))}else{if(t.type==="ImportBatchSpecifier"){l.push(e.variableDeclaration("var",[e.variableDeclarator(a,e.callExpression(this.file.addHelper("interop-require-wildcard"),[e.callExpression(e.identifier("require"),[r.source])]))]))}else{l.push(n.template("require-assign-key",{VARIABLE_NAME:a,MODULE_NAME:r.source,KEY:t.id}))}}};t.prototype.importDeclaration=function(e,t){t.push(n.template("require",{MODULE_NAME:e.source},true))};t.prototype.exportDeclaration=function(i,r){if(i.default&&!this.noInteropRequire&&!this.noInteropExport){var a=i.declaration;var t;var s="exports-default-module";if(this.hasNonDefaultExports)s="exports-default-module-override";if(e.isFunctionDeclaration(a)||!this.hasNonDefaultExports){t=n.template(s,{VALUE:this._pushStatement(a,r)},true);r.push(this._hoistExport(a,t,3));return}else{t=n.template("common-export-default-assign",{EXTENDS_HELPER:this.file.addHelper("extends")},true);t._blockHoist=0;r.push(t)}}l.prototype.exportDeclaration.apply(this,arguments)};t.prototype.exportSpecifier=function(t,n,r){this._exportSpecifier(function(){return e.callExpression(e.identifier("require"),[n.source])},t,n,r)}},{"../../traverse":88,"../../types":92,"../../util":94,"./_default":34}],40:[function(t,r,l){"use strict";r.exports=e;var n=t("../../types");function e(){}e.prototype.exportDeclaration=function(e,r){var t=n.toStatement(e.declaration,true);if(t)r.push(n.inherits(t,e))};e.prototype.importDeclaration=e.prototype.importSpecifier=e.prototype.exportSpecifier=function(){}},{"../../types":92}],41:[function(t,s,u){"use strict";s.exports=n;var l=t("./amd");var o=t("../helpers/use-strict");var a=t("../../traverse");var i=t("../../util");var e=t("../../types");var r=t("lodash");function n(e){this.exportIdentifier=e.generateUidIdentifier("export");this.noInteropRequire=true;l.apply(this,arguments)}i.inherits(n,l);n.prototype._addImportSource=function(e,n){e._importSource=n.source&&n.source.value;return e};n.prototype._exportsWildcard=function(t,r){var n=this.file.generateUidIdentifier("key");var l=e.memberExpression(t,n,true);var a=e.variableDeclaration("var",[e.variableDeclarator(n)]);var i=t;var s=e.blockStatement([e.expressionStatement(this.buildExportCall(n,l))]);return this._addImportSource(e.forInStatement(a,i,s),r)};n.prototype._exportsAssign=function(n,t,r){var l=this.buildExportCall(e.literal(n.name),t,true);return this._addImportSource(l,r)};n.prototype.remapExportAssignment=function(n){return this.buildExportCall(e.literal(n.left.name),n)};n.prototype.buildExportCall=function(t,r,l){var n=e.callExpression(this.exportIdentifier,[t,r]);if(l){return e.expressionStatement(n)}else{return n}};n.prototype.importSpecifier=function(t,e,n){l.prototype.importSpecifier.apply(this,arguments);this._addImportSource(r.last(n),e)};n.prototype.buildRunnerSetters=function(n,t){return e.arrayExpression(r.map(this.ids,function(i,s){var l={nodes:[],hoistDeclarators:t};a(n,{enter:function(n,a,i,l,t){if(n._importSource===s){if(e.isVariableDeclaration(n)){r.each(n.declarations,function(n){t.hoistDeclarators.push(e.variableDeclarator(n.id));t.nodes.push(e.expressionStatement(e.assignmentExpression("=",n.id,n.init)))})}else{t.nodes.push(n)}l.remove()}}},null,l);return e.functionExpression(null,[i],e.blockStatement(l.nodes))}))};n.prototype.transform=function(p){var u=p.program;var l=[];var c=this.getModuleName();var d=e.literal(c);var n=e.blockStatement(u.body);var s=i.template("system",{MODULE_NAME:d,MODULE_DEPENDENCIES:e.arrayExpression(this.buildDependencyLiterals()),EXPORT_IDENTIFIER:this.exportIdentifier,SETTERS:this.buildRunnerSetters(n,l),EXECUTE:e.functionExpression(null,[],n)},true);var t=s.expression.arguments[2].body.body;if(!c)s.expression.arguments.shift();var m=t.pop();a(n,{enter:function(n,t,a,i,s){if(e.isFunction(n)){return i.skip()}if(e.isVariableDeclaration(n)){if(n.kind!=="var"&&!e.isProgram(t)){return}var l=[];r.each(n.declarations,function(n){s.push(e.variableDeclarator(n.id));if(n.init){var t=e.expressionStatement(e.assignmentExpression("=",n.id,n.init));l.push(t)}});if(e.isFor(t)){if(t.left===n){return n.declarations[0].id}if(t.init===n){return e.toSequenceExpression(l,a)}}return l}}},null,l);if(l.length){var f=e.variableDeclaration("var",l);f._blockHoist=true;t.unshift(f)}a(n,{enter:function(n,l,a,t,r){if(e.isFunction(n))t.skip();if(e.isFunctionDeclaration(n)||n._blockHoist){r.push(n);t.remove()}}},null,t);t.push(m);if(o.has(n)){t.unshift(n.body.shift())}u.body=[s]}},{"../../traverse":88,"../../types":92,"../../util":94,"../helpers/use-strict":33,"./amd":37,lodash:142}],42:[function(e,n,t){"use strict";n.exports=e("./_strict")(e("./umd"))},{"./_strict":35,"./umd":43}],43:[function(n,a,s){"use strict";a.exports=r;var l=n("./amd");var t=n("../../util");var e=n("../../types");var i=n("lodash");function r(){l.apply(this,arguments)}t.inherits(r,l);r.prototype.transform=function(f){var s=f.program;var g=s.body;var a=[];for(var p in this.ids){a.push(e.literal(p))}var h=i.values(this.ids);var r=[e.identifier("exports")];if(this.passModuleArg)r.push(e.identifier("module"));r=r.concat(h);var c=e.functionExpression(null,r,e.blockStatement(g));var n=[e.literal("exports")];if(this.passModuleArg)n.push(e.literal("module"));n=n.concat(a);n=[e.arrayExpression(n)];var o=t.template("test-exports");var d=t.template("test-module");var m=this.passModuleArg?e.logicalExpression("&&",o,d):o;var l=[e.identifier("exports")];if(this.passModuleArg)l.push(e.identifier("module"));l=l.concat(a.map(function(n){return e.callExpression(e.identifier("require"),[n])}));var u=this.getModuleName();if(u)n.unshift(e.literal(u));var y=t.template("umd-runner-body",{AMD_ARGUMENTS:n,COMMON_TEST:m,COMMON_ARGUMENTS:l});var v=e.callExpression(y,[c]);s.body=[e.expressionStatement(v)]}},{"../../types":92,"../../util":94,"./amd":37,lodash:142}],44:[function(e,l,s){"use strict";l.exports=n;var a=e("./transformer");var t=e("../file");var i=e("../util");var r=e("lodash");function n(e,n){var r=new t(n);return r.parse(e)}n.fromAst=function(e,r,l){e=i.normaliseAst(e);var n=new t(l);n.addCode(r);n.transform(e);return n.generate()};n._ensureTransformerNames=function(a,t){for(var e=0;e<t.length;e++){var l=t[e];if(!r.has(n.transformers,l)){throw new ReferenceError("unknown transformer "+l+" specified in "+a)}}};n.transformers={};n.moduleFormatters={commonStrict:e("./modules/common-strict"),umdStrict:e("./modules/umd-strict"),amdStrict:e("./modules/amd-strict"),common:e("./modules/common"),system:e("./modules/system"),ignore:e("./modules/ignore"),amd:e("./modules/amd"),umd:e("./modules/umd")};r.each({specNoForInOfAssignment:e("./transformers/spec-no-for-in-of-assignment"),specSetters:e("./transformers/spec-setters"),specBlockScopedFunctions:e("./transformers/spec-block-scoped-functions"),malletOperator:e("./transformers/playground-mallet-operator"),methodBinding:e("./transformers/playground-method-binding"),memoizationOperator:e("./transformers/playground-memoization-operator"),objectGetterMemoization:e("./transformers/playground-object-getter-memoization"),asyncToGenerator:e("./transformers/optional-async-to-generator"),bluebirdCoroutines:e("./transformers/optional-bluebird-coroutines"),react:e("./transformers/react"),modules:e("./transformers/es6-modules"),propertyNameShorthand:e("./transformers/es6-property-name-shorthand"),arrayComprehension:e("./transformers/es7-array-comprehension"),generatorComprehension:e("./transformers/es7-generator-comprehension"),arrowFunctions:e("./transformers/es6-arrow-functions"),classes:e("./transformers/es6-classes"),objectSpread:e("./transformers/es7-object-spread"),exponentiationOperator:e("./transformers/es7-exponentiation-operator"),spread:e("./transformers/es6-spread"),templateLiterals:e("./transformers/es6-template-literals"),propertyMethodAssignment:e("./transformers/es6-property-method-assignment"),computedPropertyNames:e("./transformers/es6-computed-property-names"),destructuring:e("./transformers/es6-destructuring"),defaultParameters:e("./transformers/es6-default-parameters"),forOf:e("./transformers/es6-for-of"),unicodeRegex:e("./transformers/es6-unicode-regex"),abstractReferences:e("./transformers/es7-abstract-references"),constants:e("./transformers/es6-constants"),letScoping:e("./transformers/es6-let-scoping"),_blockHoist:e("./transformers/_block-hoist"),generators:e("./transformers/es6-generators"),restParameters:e("./transformers/es6-rest-parameters"),protoToAssign:e("./transformers/optional-proto-to-assign"),_declarations:e("./transformers/_declarations"),useStrict:e("./transformers/use-strict"),_aliasFunctions:e("./transformers/_alias-functions"),_moduleFormatter:e("./transformers/_module-formatter"),typeofSymbol:e("./transformers/optional-typeof-symbol"),coreAliasing:e("./transformers/optional-core-aliasing"),undefinedToVoid:e("./transformers/optional-undefined-to-void"),specPropertyLiterals:e("./transformers/spec-property-literals"),specMemberExpressionLiterals:e("./transformers/spec-member-expression-literals")},function(t,e){n.transformers[e]=new a(e,t)})},{"../file":3,"../util":94,"./modules/amd":37,"./modules/amd-strict":36,"./modules/common":39,"./modules/common-strict":38,"./modules/ignore":40,"./modules/system":41,"./modules/umd":43,"./modules/umd-strict":42,"./transformer":45,"./transformers/_alias-functions":46,"./transformers/_block-hoist":47,"./transformers/_declarations":48,"./transformers/_module-formatter":49,"./transformers/es6-arrow-functions":50,"./transformers/es6-classes":51,"./transformers/es6-computed-property-names":52,"./transformers/es6-constants":53,"./transformers/es6-default-parameters":54,"./transformers/es6-destructuring":55,"./transformers/es6-for-of":56,"./transformers/es6-generators":57,"./transformers/es6-let-scoping":58,"./transformers/es6-modules":59,"./transformers/es6-property-method-assignment":60,"./transformers/es6-property-name-shorthand":61,"./transformers/es6-rest-parameters":62,"./transformers/es6-spread":63,"./transformers/es6-template-literals":64,"./transformers/es6-unicode-regex":65,"./transformers/es7-abstract-references":66,"./transformers/es7-array-comprehension":67,"./transformers/es7-exponentiation-operator":68,"./transformers/es7-generator-comprehension":69,"./transformers/es7-object-spread":70,"./transformers/optional-async-to-generator":71,"./transformers/optional-bluebird-coroutines":72,"./transformers/optional-core-aliasing":73,"./transformers/optional-proto-to-assign":74,"./transformers/optional-typeof-symbol":75,"./transformers/optional-undefined-to-void":76,"./transformers/playground-mallet-operator":77,"./transformers/playground-memoization-operator":78,"./transformers/playground-method-binding":79,"./transformers/playground-object-getter-memoization":80,"./transformers/react":81,"./transformers/spec-block-scoped-functions":82,"./transformers/spec-member-expression-literals":83,"./transformers/spec-no-for-in-of-assignment":84,"./transformers/spec-property-literals":85,"./transformers/spec-setters":86,"./transformers/use-strict":87,lodash:142}],45:[function(t,i,c){"use strict";i.exports=n;var l=t("../traverse");var a=t("../types");var e=t("lodash");function r(){}function s(e,r,l,a,n){var t=n[1][e.type];if(!t)return;return t.enter(e,r,l,a,n[0])}function o(e,r,l,a,n){var t=n[1][e.type];if(!t)return;return t.exit(e,r,l,a,n[0])}var u={enter:s,exit:o};function n(n,e,t){this.manipulateOptions=e.manipulateOptions;this.experimental=!!e.experimental;this.secondPass=!!e.secondPass;this.transformer=this.normalise(e);this.optional=!!e.optional;this.opts=t||{};this.key=n}n.prototype.normalise=function(n){var t=this;if(e.isFunction(n)){n={ast:n}}e.each(n,function(l,i){if(i[0]==="_"){t[i]=l;return}if(e.isFunction(l))l={enter:l};if(!e.isObject(l))return;if(!l.enter)l.enter=r;if(!l.exit)l.exit=r;n[i]=l;var s=a.FLIPPED_ALIAS_KEYS[i];if(s){e.each(s,function(e){n[e]=l})}});return n};n.prototype.astRun=function(n,t){var e=this.transformer;if(e.ast&&e.ast[t]){e.ast[t](n.ast,n)}};n.prototype.transform=function(e){this.astRun(e,"before");l(e.ast,u,null,[e,this.transformer]);this.astRun(e,"after")};n.prototype.canRun=function(a){var n=a.opts;var t=this.key;if(t[0]==="_")return true;var r=n.blacklist;if(r.length&&e.contains(r,t))return false;var l=n.whitelist;if(l.length&&!e.contains(l,t))return false;if(this.optional&&!e.contains(n.optional,t))return false;if(this.experimental&&!n.experimental)return false;return true}},{"../traverse":88,"../types":92,lodash:142}],46:[function(t,s,n){"use strict";var r=t("../../traverse");var e=t("../../types");var a={enter:function(n,a,i,r,l){if(e.isFunction(n)&&!n._aliasFunction){return r.skip()}if(n._ignoreAliasFunctions)return r.skip();var t;if(e.isIdentifier(n)&&n.name==="arguments"){t=l.getArgumentsId}else if(e.isThisExpression(n)){t=l.getThisId}else{return}if(e.isReferenced(n,a))return t()}};var i={enter:function(n,i,s,t,l){if(!n._aliasFunction){if(e.isFunction(n)){return t.skip()}else{return}}r(n,a,null,l);return t.skip()}};var l=function(u,c,a,s){var n;var t;var f={getArgumentsId:function(){return n=n||a.generateUidIdentifier("arguments",s)},getThisId:function(){return t=t||a.generateUidIdentifier("this",s)}};r(c,i,null,f);var l;var o=function(n,t){l=l||u();l.unshift(e.variableDeclaration("var",[e.variableDeclarator(n,t)]))};if(n){o(n,e.identifier("arguments"))}if(t){o(t,e.thisExpression())}};n.Program=function(e,r,n,a,t){l(function(){return e.body},e,t,n)};n.FunctionDeclaration=n.FunctionExpression=function(n,a,t,i,r){l(function(){e.ensureBlock(n);return n.body.body},n,r,t)}},{"../../traverse":88,"../../types":92}],47:[function(n,l,t){"use strict";var r=n("../helpers/use-strict");var e=n("lodash");t.BlockStatement=t.Program={exit:function(n){var l=false;for(var t=0;t<n.body.length;t++){var a=n.body[t];if(a&&a._blockHoist!=null)l=true}if(!l)return;r.wrap(n,function(){var t=e.groupBy(n.body,function(n){var e=n._blockHoist;if(e==null)e=1;if(e===true)e=2;return e});n.body=e.flatten(e.values(t).reverse())})}}},{"../helpers/use-strict":33,lodash:142}],48:[function(t,l,e){"use strict";var r=t("../helpers/use-strict");var n=t("../../types");e.secondPass=true;e.BlockStatement=e.Program=function(t){if(!t._declarations)return;var l={};var e;r.wrap(t,function(){for(var i in t._declarations){var r=t._declarations[i];e=r.kind||"var";var a=n.variableDeclarator(r.id,r.init);if(!r.init){l[e]=l[e]||[];l[e].push(a)}else{t.body.unshift(n.variableDeclaration(e,[a]))}}for(e in l){t.body.unshift(n.variableDeclaration(e,l[e]))}});t._declarations=null}},{"../../types":92,"../helpers/use-strict":33}],49:[function(e,r,n){"use strict";var t=e("../transform");n.ast={exit:function(n,e){if(!t.transformers.modules.canRun(e))return;if(e.moduleFormatter.transform){e.moduleFormatter.transform(n)}}}},{"../transform":44}],50:[function(e,r,n){"use strict";var t=e("../../types");n.ArrowFunctionExpression=function(e){t.ensureBlock(e);e._aliasFunction="arrow";e.expression=false;e.type="FunctionExpression";return e}},{"../../types":92}],51:[function(t,s,l){"use strict";var a=t("../helpers/replace-supers");var i=t("../helpers/name-method");var r=t("../../util");var e=t("../../types");l.ClassDeclaration=function(e,l,t,a,r){return new n(e,r,t,true).run()};l.ClassExpression=function(r,t,l,i,a){if(!r.id){if(e.isProperty(t)&&t.value===r&&!t.computed&&e.isIdentifier(t.key)){r.id=t.key}if(e.isVariableDeclarator(t)&&e.isIdentifier(t.id)){r.id=t.id}}return new n(r,a,l,false).run()};function n(e,n,t,r){this.isStatement=r;this.scope=t;this.node=e;this.file=n;this.hasInstanceMutators=false;this.hasStaticMutators=false;this.instanceMutatorMap={};this.staticMutatorMap={};this.hasConstructor=false;this.className=e.id||n.generateUidIdentifier("class",t);this.superName=e.superClass;this.isLoose=n.isLoose("classes")}n.prototype.run=function(){var n=this.superName;var l=this.className;var o=this.file;var t=this.body=[];var r;if(this.node.id){r=e.functionDeclaration(l,[],e.blockStatement([]));t.push(r)}else{r=e.functionExpression(null,[],e.blockStatement([]));t.push(e.variableDeclaration("var",[e.variableDeclarator(l,r)]))}this.constructor=r;var i=[];var s=[];if(n){s.push(n);if(!e.isIdentifier(n)){var u=this.scope.generateUidBasedOnNode(n,this.file);n=u}i.push(n);this.superName=n;t.push(e.expressionStatement(e.callExpression(o.addHelper("inherits"),[l,n])))}this.buildBody();e.inheritsComments(t[0],this.node);var a;if(t.length===1){a=e.toExpression(r)}else{t.push(e.returnStatement(l));a=e.callExpression(e.functionExpression(null,i,e.blockStatement(t)),s)}if(this.isStatement){return e.variableDeclaration("let",[e.variableDeclarator(l,a)])}else{return a}};n.prototype.buildBody=function(){var m=this.constructor;var u=this.className;var c=this.superName;var p=this.node.body.body;var s=this.body;for(var i=0;i<p.length;i++){var n=p[i];if(e.isMethodDefinition(n)){var d=new a(n,this.className,this.superName,this.isLoose,this.file);d.replace();if(n.key.name==="constructor"){this.pushConstructor(n)}else{this.pushMethod(n)}}else if(e.isPrivateDeclaration(n)){this.closure=true;s.unshift(n)}}if(!this.hasConstructor&&c&&!e.isFalsyExpression(c)){var f="class-super-constructor-call";if(this.isLoose)f+="-loose";m.body.body.push(r.template(f,{CLASS_NAME:u,SUPER_NAME:this.superName},true))}var l;var t;if(this.hasInstanceMutators){l=r.buildDefineProperties(this.instanceMutatorMap)}if(this.hasStaticMutators){t=r.buildDefineProperties(this.staticMutatorMap)}if(l||t){t=t||e.literal(null);var o=[u,t];if(l)o.push(l);s.push(e.expressionStatement(e.callExpression(this.file.addHelper("prototype-properties"),o)))}};n.prototype.pushMethod=function(n){var t=n.key;var l=n.kind;if(l===""){i.property(n,this.file,this.scope);if(this.isLoose){var a=this.className;if(!n.static)a=e.memberExpression(a,e.identifier("prototype"));t=e.memberExpression(a,t,n.computed);var s=e.expressionStatement(e.assignmentExpression("=",t,n.value));e.inheritsComments(s,n);this.body.push(s);return}l="value"}var o=this.instanceMutatorMap;if(n.static){this.hasStaticMutators=true;o=this.staticMutatorMap}else{this.hasInstanceMutators=true}r.pushMutatorMap(o,t,l,n.computed,n)};n.prototype.pushConstructor=function(r){if(r.kind){throw this.file.errorWithNode(r,"illegal kind for constructor method")}var n=this.constructor;var t=r.value;this.hasConstructor=true;e.inherits(n,t);e.inheritsComments(n,r);n._ignoreUserWhitespace=true;n.defaults=t.defaults;n.params=t.params;n.body=t.body;n.rest=t.rest}},{"../../types":92,"../../util":94,"../helpers/name-method":30,"../helpers/replace-supers":32}],52:[function(n,a,t){"use strict";var e=n("../../types");t.ObjectExpression=function(a,d,m,h,s){var o=false;for(var t=0;t<a.properties.length;t++){o=e.isProperty(a.properties[t],{computed:true,kind:"init"});if(o)break}if(!o)return;var u=[];var i=m.generateUidBasedOnNode(d,s);var n=[];var c=e.functionExpression(null,[],e.blockStatement(n));c._aliasFunction=true;var f=l;if(s.isLoose("computedPropertyNames"))f=r;var p=f(a,n,i,u,s);if(p)return p;n.unshift(e.variableDeclaration("var",[e.variableDeclarator(i,e.objectExpression(u))]));n.push(e.returnStatement(i));return e.callExpression(c,[])};var r=function(r,l,a){for(var n=0;n<r.properties.length;n++){var t=r.properties[n];l.push(e.expressionStatement(e.assignmentExpression("=",e.memberExpression(a,t.key,t.computed),t.value)))}};var l=function(p,s,c,o,f){var l=p.properties;var n,r;for(var t=0;t<l.length;t++){n=l[t];if(n.kind!=="init")continue;r=n.key;if(!n.computed&&e.isIdentifier(r)){n.key=e.literal(r.name)}}var u=false;for(t=0;t<l.length;t++){n=l[t];if(n.computed){u=true}if(n.kind!=="init"||!u||e.isLiteral(e.toComputedKey(n,n.key),{value:"__proto__"})){o.push(n);l[t]=null}}for(t=0;t<l.length;t++){n=l[t];if(!n)continue;r=n.key;var a;if(n.computed&&e.isMemberExpression(r)&&e.isIdentifier(r.object,{name:"Symbol"})){a=e.assignmentExpression("=",e.memberExpression(c,r,true),n.value)}else{a=e.callExpression(f.addHelper("define-property"),[c,r,n.value])}s.push(e.expressionStatement(a))}if(s.length===1){var i=s[0].expression;if(e.isCallExpression(i)){i.arguments[0]=e.objectExpression(o);return i}}}},{"../../types":92}],53:[function(t,a,n){"use strict";var l=t("../../traverse");var e=t("../../types");var r=t("lodash");n.Program=n.BlockStatement=n.ForInStatement=n.ForOfStatement=n.ForStatement=function(t,c,f,p,o){var a=false;var n={};var i=function(l,a,i){for(var t in a){var s=a[t];if(!r.has(n,t))continue;if(l&&e.isBlockStatement(l)&&l!==n[t])continue;if(i){var u=i.get(t);if(u&&u===s)continue}throw o.errorWithNode(s,t+" is read-only")}};var s=function(n){return e.getIds(n,true,["MemberExpression"])};r.each(t.body,function(t,o){if(e.isExportDeclaration(t)){t=t.declaration}if(e.isVariableDeclaration(t,{kind:"const"})){for(var r=0;r<t.declarations.length;r++){var u=t.declarations[r];var c=s(u);for(var l in c){var p=c[l];var f={};f[l]=p;i(o,f);n[l]=o;a=true}u._ignoreConstant=true}t._ignoreConstant=true;t.kind="let"}});if(!a)return;var u={check:i,getIds:s};l(t,{enter:function(n,r,l,a,t){if(n._ignoreConstant)return;if(e.isVariableDeclaration(n))return;if(e.isVariableDeclarator(n)||e.isDeclaration(n)||e.isAssignmentExpression(n)){t.check(r,t.getIds(n),l)}}},null,u)}},{"../../traverse":88,"../../types":92,lodash:142}],54:[function(n,a,t){"use strict";var r=n("../../traverse");var l=n("../../util");var e=n("../../types");t.Function=function(n,b,u,x,y){if(!n.defaults||!n.defaults.length)return;e.ensureBlock(n);var g=n.params.map(function(n){return e.getIds(n)});var s=false;var a;var h=function(l){var t=function(n,t){if(!e.isIdentifier(n)||!e.isReferenced(n,t))return;if(l.indexOf(n.name)>=0){throw y.errorWithNode(n,"Temporal dead zone - accessing a variable before it's initialized")}if(u.has(n.name,true)){s=true}};t(a,n);r(a,{enter:t})};for(var t=0;t<n.defaults.length;t++){a=n.defaults[t];if(!a)continue;var v=n.params[t];var m=g.slice(t);for(var o=0;o<m.length;o++){h(m[o])}var p=u.get(v.name,true);if(p&&n.params.indexOf(p)<0){s=true}}var i=[];var f=e.identifier("arguments");f._ignoreAliasFunctions=true;var c=0;for(t=0;t<n.defaults.length;t++){a=n.defaults[t];if(!a){c=+t+1;continue}i.push(l.template("default-parameter",{VARIABLE_NAME:n.params[t],DEFAULT_VALUE:a,ARGUMENT_KEY:e.literal(+t),ARGUMENTS:f},true))}n.params=n.params.slice(0,c);if(s){var d=e.functionExpression(null,[],n.body,n.generator);d._aliasFunction=true;i.push(e.returnStatement(e.callExpression(d,[])));n.body=e.blockStatement(i)}else{n.body.body=i.concat(n.body.body)}n.defaults=[]}},{"../../traverse":88,"../../types":92,"../../util":94}],55:[function(a,u,n){"use strict";var e=a("../../types");var r=function(r,n,l){var t=r.operator;if(e.isMemberExpression(n))t="=";if(t){return e.expressionStatement(e.assignmentExpression(t,n,l))}else{return e.variableDeclaration(r.kind,[e.variableDeclarator(n,l)])}};var t=function(t,l,n,a){if(e.isObjectPattern(n)){s(t,l,n,a)}else if(e.isArrayPattern(n)){o(t,l,n,a)}else if(e.isAssignmentPattern(n)){i(t,l,n,a)}else{l.push(r(t,n,a))}};var i=function(n,l,a,i){var t=n.scope.generateUidBasedOnNode(i,n.file);l.push(e.variableDeclaration("var",[e.variableDeclarator(t,i)]));l.push(r(n,a.left,e.conditionalExpression(e.binaryExpression("===",t,e.identifier("undefined")),a.right,t)))};var s=function(o,u,a,d){for(var s=0;s<a.properties.length;s++){var n=a.properties[s];if(e.isSpreadProperty(n)){var l=[];for(var i=0;i<a.properties.length;i++){var c=a.properties[i];if(i>=s)break;if(e.isSpreadProperty(c))continue;var f=c.key;if(e.isIdentifier(f)){f=e.literal(c.key.name)}l.push(f)}l=e.arrayExpression(l);var h=e.callExpression(o.file.addHelper("object-without-properties"),[d,l]);u.push(r(o,n.argument,h))}else{if(e.isLiteral(n.key))n.computed=true;var p=n.value;var m=e.memberExpression(d,n.key,n.computed);if(e.isPattern(p)){t(o,u,p,m)}else{u.push(r(o,p,m))}}}};var o=function(l,o,r,a){if(!r.elements)return;var n;var u=false;for(n=0;n<r.elements.length;n++){if(e.isSpreadElement(r.elements[n])){u=true;break}}var f=l.file.toArray(a,!u&&r.elements.length);var c=l.scope.generateUidBasedOnNode(a,l.file);o.push(e.variableDeclaration("var",[e.variableDeclarator(c,f)]));a=c;for(n=0;n<r.elements.length;n++){var i=r.elements[n];if(!i)continue;n=+n;var s;if(e.isSpreadElement(i)){s=l.file.toArray(a);if(n>0){s=e.callExpression(e.memberExpression(s,e.identifier("slice")),[e.literal(n)])}i=i.argument}else{s=e.memberExpression(a,e.literal(n),true)}t(l,o,i,s)}};var l=function(r){var l=r.nodes;var i=r.pattern;var n=r.id;var s=r.file;var o=r.scope;if(!e.isArrayExpression(n)&&!e.isMemberExpression(n)&&!e.isIdentifier(n)){var a=o.generateUidBasedOnNode(n,s);l.push(e.variableDeclaration("var",[e.variableDeclarator(a,n)]));n=a}t(r,l,i,n)};n.ForInStatement=n.ForOfStatement=function(n,c,l,f,a){var r=n.left;if(!e.isVariableDeclaration(r))return;var i=r.declarations[0].id;if(!e.isPattern(i))return;var s=a.generateUidIdentifier("ref",l);n.left=e.variableDeclaration(r.kind,[e.variableDeclarator(s,null)]);var o=[];t({kind:r.kind,file:a,scope:l},o,i,s);e.ensureBlock(n);var u=n.body;u.body=o.concat(u.body)};n.Function=function(n,o,t,u,r){var a=[];var i=false;n.params=n.params.map(function(n){if(!e.isPattern(n))return n;i=true;var s=r.generateUidIdentifier("ref",t);l({kind:"var",nodes:a,pattern:n,id:s,file:r,scope:t});return s});if(!i)return;e.ensureBlock(n);var s=n.body;s.body=a.concat(s.body)};n.CatchClause=function(n,o,r,u,l){var a=n.param;if(!e.isPattern(a))return;var i=l.generateUidIdentifier("ref",r);n.param=i;var s=[];t({kind:"var",file:l,scope:r},s,a,i);n.body.body=s.concat(n.body.body)};n.ExpressionStatement=function(s,o,l,u,a){var n=s.expression;if(n.type!=="AssignmentExpression")return;if(!e.isPattern(n.left))return;var r=[];var i=a.generateUidIdentifier("ref",l);r.push(e.variableDeclaration("var",[e.variableDeclarator(i,n.right)]));t({operator:n.operator,file:a,scope:l},r,n.left,i);return r};n.AssignmentExpression=function(r,s,l,o,i){if(s.type==="ExpressionStatement")return;if(!e.isPattern(r.left))return;var n=i.generateUidIdentifier("temp",l);l.push({key:n.name,id:n});var a=[];a.push(e.assignmentExpression("=",n,r.right));t({operator:r.operator,file:i,scope:l},a,r.left,n);a.push(n);return e.toSequenceExpression(a,l)};n.VariableDeclaration=function(a,s,d,m,o){if(e.isForInStatement(s)||e.isForOfStatement(s))return;var i=[];var t;var n;var u=false;for(t=0;t<a.declarations.length;t++){n=a.declarations[t];if(e.isPattern(n.id)){u=true;break}}if(!u)return;for(t=0;t<a.declarations.length;t++){n=a.declarations[t];var c=n.init;var f=n.id;var p={kind:a.kind,nodes:i,pattern:f,id:c,file:o,scope:d};if(e.isPattern(f)&&c){l(p);if(+t!==a.declarations.length-1){e.inherits(i[i.length-1],n)}}else{i.push(e.inherits(r(p,n.id,n.init),n))}}if(!e.isProgram(s)&&!e.isBlockStatement(s)){n=null;for(t=0;t<i.length;t++){a=i[t];n=n||e.variableDeclaration(a.kind,[]);if(!e.isVariableDeclaration(a)&&n.kind!==a.kind){throw o.errorWithNode(a,"Cannot use this node within the current parent")}n.declarations=n.declarations.concat(a.declarations)}return n}return i}},{"../../types":92}],56:[function(n,i,r){"use strict";var t=n("../../util");var e=n("../../types");r.ForOfStatement=function(n,c,f,p,o){var u=a;if(o.isLoose("forOf"))u=l;var r=u(n,c,f,p,o);var i=r.declar;var s=r.loop;var t=s.body;e.inheritsComments(s,n);e.ensureBlock(n);if(i){if(r.shouldUnshift){t.body.unshift(i)}else{t.body.push(i)}}t.body=t.body.concat(n.body.body);return s};var l=function(i,u,a,c,r){var n=i.left;var s,l;if(e.isIdentifier(n)||e.isPattern(n)){l=n}else if(e.isVariableDeclaration(n)){l=n.declarations[0].id;s=e.variableDeclaration(n.kind,[e.variableDeclarator(l)])}else{throw r.errorWithNode(n,"Unknown node type "+n.type+" in ForOfStatement")}var o=t.template("for-of-loose",{LOOP_OBJECT:r.generateUidIdentifier("iterator",a),IS_ARRAY:r.generateUidIdentifier("isArray",a),OBJECT:i.right,INDEX:r.generateUidIdentifier("i",a),ID:l});return{shouldUnshift:true,declar:s,loop:o}};var a=function(a,c,i,f,r){var n=a.left;var l;var s=r.generateUidIdentifier("step",i);var o=e.memberExpression(s,e.identifier("value"));if(e.isIdentifier(n)||e.isPattern(n)){l=e.expressionStatement(e.assignmentExpression("=",n,o))}else if(e.isVariableDeclaration(n)){l=e.variableDeclaration(n.kind,[e.variableDeclarator(n.declarations[0].id,o)])}else{throw r.errorWithNode(n,"Unknown node type "+n.type+" in ForOfStatement")}var u=t.template("for-of",{ITERATOR_KEY:r.generateUidIdentifier("iterator",i),STEP_KEY:s,OBJECT:a.right});return{declar:l,loop:u}}},{"../../types":92,"../../util":94}],57:[function(e,r,n){"use strict";var t=e("regenerator");n.ast={before:function(e,n){t.transform(e,{includeRuntime:n.opts.includeRegenerator&&"if used"})}}},{regenerator:150}],58:[function(a,c,i){"use strict";var t=a("../../traverse");var o=a("../../util");var e=a("../../types");var r=a("lodash");var l=function(n,t){if(!e.isVariableDeclaration(n))return false;if(n._let)return true;if(n.kind!=="let")return false;if(!e.isFor(t)||e.isFor(t)&&t.left!==n){r.each(n.declarations,function(n){n.init=n.init||e.identifier("undefined")})}n._let=true;n.kind="var";return true};var s=function(n,t){return e.isVariableDeclaration(n,{kind:"var"})&&!l(n,t)};var u=function(n){for(var e=0;e<n.length;e++){delete n[e]._let}};i.VariableDeclaration=function(e,n){l(e,n)};i.Loop=function(t,r,i,u,s){var a=t.left||t.init;if(l(a,t)){e.ensureBlock(t);t.body._letDeclars=[a]}if(e.isLabeledStatement(r)){t.label=r.label}var o=new n(t,t.body,r,i,s);o.run();if(t.label&&!e.isLabeledStatement(r)){return e.labeledStatement(t.label,t)}};i.BlockStatement=function(r,t,l,s,a){if(!e.isLoop(t)){var i=new n(false,r,t,l,a);i.run()}};function n(e,n,t,r,l){this.loopParent=e;this.parent=t;this.scope=r;this.block=n;this.file=l;this.outsideLetReferences={};this.letReferences={};this.body=[]}n.prototype.run=function(){var n=this.block;if(n._letDone)return;n._letDone=true;
if(e.isFunction(this.parent))return;var t=this.getLetReferences();if(t){this.needsClosure()}else{this.remap()}};n.prototype.remap=function(){var u=this.letReferences;var r=this.scope;var f=this.file;var l={};for(var a in u){var i=u[a];if(r.parentHas(a)){var c=f.generateUidIdentifier(i.name,r).name;i.name=c;l[a]={node:i,uid:c}}}var s=function(n,l,a,r,i){if(!e.isIdentifier(n))return;if(!e.isReferenced(n,l))return;var t=i[n.name];if(!t)return;var s=a.get(n.name,true);if(s===t.node){n.name=t.uid}else{if(r)r.skip()}};var o=function(e,n){s(e,n,r,null,l);t(e,{enter:s},r,l)};var n=this.loopParent;if(n){o(n.right,n);o(n.test,n);o(n.update,n)}t(this.block,{enter:s},r,l)};n.prototype.needsClosure=function(){var a=this.block;this.has=this.checkLoop();this.hoistVarDeclarations();var i=r.values(this.outsideLetReferences);var n=e.functionExpression(null,i,e.blockStatement(a.body));n._aliasFunction=true;a.body=this.body;var l=e.callExpression(n,i);var s=this.file.generateUidIdentifier("ret",this.scope);var o=t.hasType(n.body,"YieldExpression",e.FUNCTION_TYPES);if(o){n.generator=true;l=e.yieldExpression(l,true)}this.build(s,l)};n.prototype.getLetReferences=function(){var s=this.block;var a=s._letDeclars||[];var i;for(var n=0;n<a.length;n++){i=a[n];r.extend(this.outsideLetReferences,e.getIds(i,true))}if(s.body){for(n=0;n<s.body.length;n++){i=s.body[n];if(l(i,s)){a=a.concat(i.declarations)}}}for(n=0;n<a.length;n++){i=a[n];var c=e.getIds(i,true);r.extend(this.letReferences,c)}u(a);var o={letReferences:this.letReferences,closurify:false};t(this.block,{enter:function(r,i,l,a,n){if(e.isFunction(r)){t(r,{enter:function(t,r){if(!e.isIdentifier(t))return;if(!e.isReferenced(t,r))return;if(l.hasOwn(t.name,true))return;if(!n.letReferences[t.name])return;n.closurify=true}},l,n);return a.skip()}}},this.scope,o);return o.closurify};n.prototype.checkLoop=function(){var n={hasContinue:false,hasReturn:false,hasBreak:false};t(this.block,{enter:function(t,l,i,a){var r;if(e.isFunction(t)||e.isLoop(t)){return a.skip()}if(t&&!t.label){if(e.isBreakStatement(t)){if(e.isSwitchCase(l))return;n.hasBreak=true;r=e.returnStatement(e.literal("break"))}else if(e.isContinueStatement(t)){n.hasContinue=true;r=e.returnStatement(e.literal("continue"))}}if(e.isReturnStatement(t)){n.hasReturn=true;r=e.returnStatement(e.objectExpression([e.property("init",e.identifier("v"),t.argument||e.identifier("undefined"))]))}if(r)return e.inherits(r,t)}},this.scope,n);return n};n.prototype.hoistVarDeclarations=function(){t(this.block,{enter:function(n,r,a,l,t){if(e.isForStatement(n)){if(s(n.init,n)){n.init=e.sequenceExpression(t.pushDeclar(n.init))}}else if(e.isFor(n)){if(s(n.left,n)){n.left=n.left.declarations[0].id}}else if(s(n,r)){return t.pushDeclar(n).map(e.expressionStatement)}else if(e.isFunction(n)){return l.skip()}}},this.scope,this)};n.prototype.pushDeclar=function(n){this.body.push(e.variableDeclaration(n.kind,n.declarations.map(function(n){return e.variableDeclarator(n.id)})));var l=[];for(var r=0;r<n.declarations.length;r++){var t=n.declarations[r];if(!t.init)continue;var a=e.assignmentExpression("=",t.id,t.init);l.push(e.inherits(a,t))}return l};n.prototype.build=function(r,t){var n=this.has;if(n.hasReturn||n.hasBreak||n.hasContinue){this.buildHas(r,t)}else{this.body.push(e.expressionStatement(t))}};n.prototype.buildHas=function(r,c){var l=this.body;l.push(e.variableDeclaration("var",[e.variableDeclarator(r,c)]));var i=this.loopParent;var a;var n=this.has;var t=[];if(n.hasReturn){a=o.template("let-scoping-return",{RETURN:r})}if(n.hasBreak||n.hasContinue){var s=i.label=i.label||this.file.generateUidIdentifier("loop",this.scope);if(n.hasBreak){t.push(e.switchCase(e.literal("break"),[e.breakStatement(s)]))}if(n.hasContinue){t.push(e.switchCase(e.literal("continue"),[e.continueStatement(s)]))}if(n.hasReturn){t.push(e.switchCase(null,[a]))}if(t.length===1){var u=t[0];l.push(e.ifStatement(e.binaryExpression("===",r,u.test),u.consequent[0]))}else{l.push(e.switchStatement(r,t))}}else{if(n.hasReturn)l.push(a)}}},{"../../traverse":88,"../../types":92,"../../util":94,lodash:142}],59:[function(t,r,e){"use strict";var n=t("../../types");e.ast={before:function(e,n){e.program.body=n.dynamicImports.concat(e.program.body)}};e.ImportDeclaration=function(e,r,a,i,l){var n=[];if(e.specifiers.length){for(var t=0;t<e.specifiers.length;t++){l.moduleFormatter.importSpecifier(e.specifiers[t],e,n,r)}}else{l.moduleFormatter.importDeclaration(e,n,r)}if(n.length===1){n[0]._blockHoist=e._blockHoist}return n};e.ExportDeclaration=function(e,l,s,o,a){var t=[];if(e.declaration){if(n.isVariableDeclaration(e.declaration)){var i=e.declaration.declarations[0];i.init=i.init||n.identifier("undefined")}a.moduleFormatter.exportDeclaration(e,t,l)}else{for(var r=0;r<e.specifiers.length;r++){a.moduleFormatter.exportSpecifier(e.specifiers[r],e,t,l)}}return t}},{"../../types":92}],60:[function(n,a,t){"use strict";var l=n("../helpers/name-method");var r=n("../../util");var e=n("../../types");t.Property=function(e,r,n,a,t){if(!e.method)return;e.method=false;l.property(e,t,n)};t.ObjectExpression=function(n){var t={};var l=false;n.properties=n.properties.filter(function(e){if(e.kind==="get"||e.kind==="set"){l=true;r.pushMutatorMap(t,e.key,e.kind,e.computed,e.value);return false}else{return true}});if(!l)return;return e.callExpression(e.memberExpression(e.identifier("Object"),e.identifier("defineProperties")),[n,r.buildDefineProperties(t)])}},{"../../types":92,"../../util":94,"../helpers/name-method":30}],61:[function(e,l,n){"use strict";var t=e("../../types");var r=e("lodash");n.Property=function(e){if(!e.shorthand)return;e.shorthand=false;e.key=t.removeComments(r.clone(e.key))}},{"../../types":92,lodash:142}],62:[function(n,l,t){"use strict";var r=n("../../util");var e=n("../../types");t.Function=function(n,f,d,p,i){if(!n.rest)return;var c=n.rest;n.rest=null;e.ensureBlock(n);var u=e.identifier("arguments");u._ignoreAliasFunctions=true;var l=e.literal(n.params.length);var a=i.generateUidIdentifier("key");var t=i.generateUidIdentifier("len");var s=a;var o=t;if(n.params.length){s=e.binaryExpression("-",a,l);o=e.conditionalExpression(e.binaryExpression(">",t,l),e.binaryExpression("-",t,l),e.literal(0))}n.body.body.unshift(r.template("rest",{ARGUMENTS:u,ARRAY_KEY:s,ARRAY_LEN:o,START:l,ARRAY:c,KEY:a,LEN:t}))}},{"../../types":92,"../../util":94}],63:[function(l,s,n){"use strict";var e=l("../../types");var a=l("lodash");var i=function(e,n){return n.toArray(e.argument)};var t=function(t){for(var n=0;n<t.length;n++){if(e.isSpreadElement(t[n])){return true}}return false};var r=function(a,o){var t=[];var n=[];var s=function(){if(!n.length)return;t.push(e.arrayExpression(n));n=[]};for(var r=0;r<a.length;r++){var l=a[r];if(e.isSpreadElement(l)){s();t.push(i(l,o))}else{n.push(l)}}s();return t};n.ArrayExpression=function(i,o,u,c,s){var a=i.elements;if(!t(a))return;var l=r(a,s);var n=l.shift();if(!e.isArrayExpression(n)){l.unshift(n);n=e.arrayExpression([])}return e.callExpression(e.memberExpression(n,e.identifier("concat")),l)};n.CallExpression=function(n,p,f,d,u){var a=n.arguments;if(!t(a))return;var s=e.identifier("undefined");n.arguments=[];var i;if(a.length===1&&a[0].argument.name==="arguments"){i=[a[0].argument]}else{i=r(a,u)}var c=i.shift();if(i.length){n.arguments.push(e.callExpression(e.memberExpression(c,e.identifier("concat")),i))}else{n.arguments.push(c)}var l=n.callee;if(e.isMemberExpression(l)){var o=f.generateTempBasedOnNode(l.object,u);if(o){l.object=e.assignmentExpression("=",o,l.object);s=o}else{s=l.object}e.appendToMemberExpression(l,e.identifier("apply"))}else{n.callee=e.memberExpression(n.callee,e.identifier("apply"))}n.arguments.unshift(s)};n.NewExpression=function(l,c,f,p,s){var n=l.arguments;if(!t(n))return;var o=e.isIdentifier(l.callee)&&a.contains(e.NATIVE_TYPE_NAMES,l.callee.name);var i=r(n,s);if(o){i.unshift(e.arrayExpression([e.literal(null)]))}var u=i.shift();if(i.length){n=e.callExpression(e.memberExpression(u,e.identifier("concat")),i)}else{n=u}if(o){return e.newExpression(e.callExpression(e.memberExpression(s.addHelper("bind"),e.identifier("apply")),[l.callee,n]),[])}else{return e.callExpression(s.addHelper("apply-constructor"),[l.callee,n])}}},{"../../types":92,lodash:142}],64:[function(r,l,n){"use strict";var e=r("../../types");var t=function(n,t){return e.binaryExpression("+",n,t)};n.TaggedTemplateExpression=function(s,c,p,f,o){var n=[];var l=s.quasi;var r=[];var t=[];for(var a=0;a<l.quasis.length;a++){var i=l.quasis[a];r.push(e.literal(i.value.cooked));t.push(e.literal(i.value.raw))}r=e.arrayExpression(r);t=e.arrayExpression(t);var u="tagged-template-literal";if(o.isLoose("templateLiterals"))u+="-loose";n.push(e.callExpression(o.addHelper(u),[r,t]));n=n.concat(l.expressions);return e.callExpression(s.tag,n)};n.TemplateLiteral=function(l){var n=[];var r;for(r=0;r<l.quasis.length;r++){var s=l.quasis[r];n.push(e.literal(s.value.cooked));var i=l.expressions.shift();if(i)n.push(i)}if(n.length>1){var o=n[n.length-1];if(e.isLiteral(o,{value:""}))n.pop();var a=t(n.shift(),n.shift());for(r=0;r<n.length;r++){a=t(a,n[r])}return a}else{return n[0]}}},{"../../types":92}],65:[function(e,l,n){"use strict";var t=e("regexpu/rewrite-pattern");var r=e("lodash");n.Literal=function(l){var e=l.regex;if(!e)return;var n=e.flags.split("");if(e.flags.indexOf("u")<0)return;r.pull(n,"u");e.pattern=t(e.pattern,e.flags);e.flags=n.join("")}},{lodash:142,"regexpu/rewrite-pattern":185}],66:[function(r,a,n){"use strict";var t=r("../../util");var e=r("../../types");n.experimental=true;var l=function(r,n,l){if(e.isExpressionStatement(r)){return n}else{var t=[];if(e.isSequenceExpression(n)){t=n.expressions}else{t.push(n)}t.push(l);return e.sequenceExpression(t)}};n.AssignmentExpression=function(n,o,u,f,c){var i=n.left;if(!e.isVirtualPropertyExpression(i))return;var r=n.right;var a;if(!e.isExpressionStatement(o)){a=u.generateTempBasedOnNode(n.right,c);if(a)r=a}if(n.operator!=="="){r=e.binaryExpression(n.operator[0],t.template("abstract-expression-get",{PROPERTY:n.property,OBJECT:n.object}),r)}var s=t.template("abstract-expression-set",{PROPERTY:i.property,OBJECT:i.object,VALUE:r});if(a){s=e.sequenceExpression([e.assignmentExpression("=",a,n.right),s])}return l(o,s,r)};n.UnaryExpression=function(r,a){var n=r.argument;if(!e.isVirtualPropertyExpression(n))return;if(r.operator!=="delete")return;var i=t.template("abstract-expression-delete",{PROPERTY:n.property,OBJECT:n.object});return l(a,i,e.literal(true))};n.CallExpression=function(a,o,i,u,s){var n=a.callee;if(!e.isVirtualPropertyExpression(n))return;var l=i.generateTempBasedOnNode(n.object,s);var r=t.template("abstract-expression-call",{PROPERTY:n.property,OBJECT:l||n.object});r.arguments=r.arguments.concat(a.arguments);if(l){return e.sequenceExpression([e.assignmentExpression("=",l,n.object),r])}else{return r}};n.VirtualPropertyExpression=function(e){return t.template("abstract-expression-get",{PROPERTY:e.property,OBJECT:e.object})};n.PrivateDeclaration=function(n){return e.variableDeclaration("const",n.declarations.map(function(n){return e.variableDeclarator(n,e.newExpression(e.identifier("WeakMap"),[]))}))}},{"../../types":92,"../../util":94}],67:[function(e,s,n){"use strict";var l=e("../helpers/build-comprehension");var a=e("../../traverse");var t=e("../../util");var r=e("../../types");n.experimental=true;var i=function(n,o,u,d,c){var s=u.generateUidBasedOnNode(o,c);var e=t.template("array-comprehension-container",{KEY:s});e.callee._aliasFunction=true;var f=e.callee.body;var i=f.body;if(a.hasType(n,"YieldExpression",r.FUNCTION_TYPES)){e.callee.generator=true;e=r.yieldExpression(e,true)}var p=i.pop();i.push(l(n,function(){return t.template("array-push",{STATEMENT:n.body,KEY:s},true)}));i.push(p);return e};n.ComprehensionExpression=function(e,n,t,r,l){if(e.generator)return;return i(e,n,t,r,l)}},{"../../traverse":88,"../../types":92,"../../util":94,"../helpers/build-comprehension":27}],68:[function(n,a,t){"use strict";t.experimental=true;var r=n("../helpers/build-binary-assignment-operator-transformer");var e=n("../../types");var l=e.memberExpression(e.identifier("Math"),e.identifier("pow"));r(t,{operator:"**",build:function(n,t){return e.callExpression(l,[n,t])}})},{"../../types":92,"../helpers/build-binary-assignment-operator-transformer":26}],69:[function(n,l,t){"use strict";var r=n("../helpers/build-comprehension");var e=n("../../types");t.experimental=true;t.ComprehensionExpression=function(n){if(!n.generator)return;var t=[];var l=e.functionExpression(null,[],e.blockStatement(t),true);l._aliasFunction=true;t.push(r(n,function(){return e.expressionStatement(e.yieldExpression(n.body))}));return e.callExpression(l,[])}},{"../../types":92,"../helpers/build-comprehension":27}],70:[function(t,r,n){"use strict";var e=t("../../types");n.experimental=true;n.ObjectExpression=function(l,u,f,c,o){var s=false;var n;var t;for(n=0;n<l.properties.length;n++){t=l.properties[n];if(e.isSpreadProperty(t)){s=true;break}}if(!s)return;var r=[];var a=[];var i=function(){if(!a.length)return;r.push(e.objectExpression(a));a=[]};for(n=0;n<l.properties.length;n++){t=l.properties[n];if(e.isSpreadProperty(t)){i();r.push(t.argument)}else{a.push(t)}}i();if(!e.isObjectExpression(r[0])){r.unshift(e.objectExpression([]))}return e.callExpression(o.addHelper("extends"),r)}},{"../../types":92}],71:[function(n,l,e){"use strict";var t=n("../helpers/remap-async-to-generator");var r=n("./optional-bluebird-coroutines");e.optional=true;e.manipulateOptions=r.manipulateOptions;e.Function=function(e,r,l,a,n){if(!e.async||e.generator)return;return t(e,n.addHelper("async-to-generator"))}},{"../helpers/remap-async-to-generator":31,"./optional-bluebird-coroutines":72}],72:[function(n,l,e){"use strict";var r=n("../helpers/remap-async-to-generator");var t=n("../../types");e.manipulateOptions=function(e){e.experimental=true;e.blacklist.push("generators")};e.optional=true;e.Function=function(e,l,a,i,n){if(!e.async||e.generator)return;return r(e,t.memberExpression(n.addImport("bluebird"),t.identifier("coroutine")))}},{"../../types":92,"../helpers/remap-async-to-generator":31}],73:[function(n,u,r){"use strict";var a=n("../../traverse");var i=n("../../util");var l=n("core-js/library");var e=n("../../types");var t=n("lodash");var s=function(e){return e.name!=="_"&&t.has(l,e.name)};var o=["Symbol","Promise","Map","WeakMap","Set","WeakSet"];r.optional=true;r.ast={enter:function(n,e){e._coreId=e.addImport("core-js/library","core")},exit:function(r,n){a(r,{enter:function(r,c,d,p){var a;if(e.isMemberExpression(r)&&e.isReferenced(r,c)){var f=r.object;a=r.property;if(!e.isReferenced(f,r))return;if(!r.computed&&s(f)&&t.has(l[f.name],a.name)){p.skip();return e.prependToMemberExpression(r,n._coreId)}}else if(e.isIdentifier(r)&&!e.isMemberExpression(c)&&e.isReferenced(r,c)&&t.contains(o,r.name)){return e.memberExpression(n._coreId,r)}else if(e.isCallExpression(r)){if(r.arguments.length)return;var u=r.callee;if(!e.isMemberExpression(u))return;if(!u.computed)return;a=u.property;if(!e.isIdentifier(a.object,{name:"Symbol"}))return;if(!e.isIdentifier(a.property,{name:"iterator"}))return;return i.template("corejs-iterator",{CORE_ID:n._coreId,VALUE:u.object})}}})}}},{"../../traverse":88,"../../types":92,"../../util":94,"core-js/library":135,lodash:142}],74:[function(t,s,n){"use strict";var e=t("../../types");var a=t("lodash");var i=function(n){return e.isLiteral(e.toComputedKey(n,n.key),{value:"__proto__"})};var r=function(t){var n=t.left;return e.isMemberExpression(n)&&e.isLiteral(e.toComputedKey(n,n.property),{value:"__proto__"})};var l=function(n,t,r){return e.expressionStatement(e.callExpression(r.addHelper("defaults"),[t,n.right]))};n.optional=true;n.secondPass=true;n.AssignmentExpression=function(n,s,o,c,i){if(e.isExpressionStatement(s))return;if(!r(n))return;var t=[];var u=n.left.object;var a=o.generateTempBasedOnNode(n.left.object,i);t.push(e.expressionStatement(e.assignmentExpression("=",a,u)));t.push(l(n,a,i));if(a)t.push(a);return e.toSequenceExpression(t)};n.ExpressionStatement=function(t,i,s,o,a){var n=t.expression;if(!e.isAssignmentExpression(n,{operator:"="}))return;if(r(n)){return l(n,n.left.object,a)}};n.ObjectExpression=function(n,u,c,f,o){var t;for(var r=0;r<n.properties.length;r++){var l=n.properties[r];if(i(l)){t=l.value;a.pull(n.properties,l)}}if(t){var s=[e.objectExpression([]),t];if(n.properties.length)s.push(n);return e.callExpression(o.addHelper("extends"),s)}}},{"../../types":92,lodash:142}],75:[function(t,r,n){"use strict";var e=t("../../types");n.optional=true;n.UnaryExpression=function(n,i,s,l,a){l.skip();if(n.operator==="typeof"){var t=e.callExpression(a.addHelper("typeof"),[n.argument]);if(e.isIdentifier(n.argument)){var r=e.literal("undefined");return e.conditionalExpression(e.binaryExpression("===",e.unaryExpression("typeof",n.argument),r),r,t)}else{return t}}}},{"../../types":92}],76:[function(t,r,n){"use strict";var e=t("../../types");n.optional=true;n.Identifier=function(n,t){if(n.name==="undefined"&&e.isReferenced(n,t)){return e.unaryExpression("void",e.literal(0),true)}}},{"../../types":92}],77:[function(n,l,t){"use strict";var r=n("../helpers/build-conditional-assignment-operator-transformer");var e=n("../../types");r(t,{is:function(n,r){var l=e.isAssignmentExpression(n)&&n.operator==="||=";if(l){var t=n.left;if(!e.isMemberExpression(t)&&!e.isIdentifier(t)){throw r.errorWithNode(t,"Expected type MemeberExpression or Identifier")}return true}},build:function(n){return e.unaryExpression("!",n,true)}})},{"../../types":92,"../helpers/build-conditional-assignment-operator-transformer":28}],78:[function(n,l,t){"use strict";var r=n("../helpers/build-conditional-assignment-operator-transformer");var e=n("../../types");r(t,{is:function(n){var t=e.isAssignmentExpression(n)&&n.operator==="?=";if(t)e.assertMemberExpression(n.left);return t},build:function(n,t){return e.unaryExpression("!",e.callExpression(e.memberExpression(t.addHelper("has-own"),e.identifier("call")),[n.object,n.property]),true)}})},{"../../types":92,"../helpers/build-conditional-assignment-operator-transformer":28}],79:[function(t,r,n){"use strict";var e=t("../../types");n.BindMemberExpression=function(n,o,a,u,i){var r=n.object;var s=n.property;var t=a.generateTempBasedOnNode(n.object,i);if(t)r=t;var l=e.callExpression(e.memberExpression(e.memberExpression(r,s),e.identifier("bind")),[r].concat(n.arguments));if(t){return e.sequenceExpression([e.assignmentExpression("=",t,n.object),l])}else{return l}};n.BindFunctionExpression=function(n,i,t,s,r){var a=function(a){var l=r.generateUidIdentifier("val",t);return e.functionExpression(null,[l],e.blockStatement([e.returnStatement(e.callExpression(e.memberExpression(l,n.callee),a))]))};var l=t.generateTemp(r,"args");return e.sequenceExpression([e.assignmentExpression("=",l,e.arrayExpression(n.arguments)),a(n.arguments.map(function(t,n){return e.memberExpression(l,e.literal(n),true)}))])}},{"../../types":92}],80:[function(n,l,t){"use strict";var r=n("../../traverse");var e=n("../../types");t.Property=t.MethodDefinition=function(n,i,s,o,a){if(n.kind!=="memo")return;n.kind="get";var l=n.value;e.ensureBlock(l);var t=n.key;if(e.isIdentifier(t)&&!n.computed){t=e.literal(t.name)}r(l,{enter:function(n){if(e.isFunction(n))return;if(e.isReturnStatement(n)&&n.argument){n.argument=e.memberExpression(e.callExpression(a.addHelper("define-property"),[e.thisExpression(),t,n.argument]),t,true)}}})}},{"../../traverse":88,"../../types":92}],81:[function(t,c,n){"use strict";var i=t("esutils");var e=t("../../types");var u=t("lodash");n.XJSIdentifier=function(n){if(i.keyword.isIdentifierName(n.name)){n.type="Identifier"}else{return e.literal(n.name)}};n.XJSNamespacedName=function(e,t,r,l,n){throw n.errorWithNode(e,"Namespace tags are not supported. ReactJSX is not XML.")};n.XJSMemberExpression={exit:function(n){n.computed=e.isLiteral(n.property);n.type="MemberExpression"}};n.XJSExpressionContainer=function(e){return e.expression};n.XJSAttribute={exit:function(n){var t=n.value||e.literal(true);return e.inherits(e.property("init",n.name,t),n)}};var r=function(e){return/^[a-z]|\-/.test(e)};n.XJSOpeningElement={exit:function(i,c,f,p,u){var o=u.opts.reactCompat;var n=i.name;var l=[];var t;if(e.isIdentifier(n)){t=n.name}else if(e.isLiteral(n)){t=n.value}if(!o){if(t&&r(t)){l.push(e.literal(t))}else{l.push(n)}}var a=i.attributes;if(a.length){a=s(a)}else{a=e.literal(null)}l.push(a);if(o){if(t&&r(t)){return e.callExpression(e.memberExpression(e.memberExpression(e.identifier("React"),e.identifier("DOM")),n,e.isLiteral(n)),l)}}else{n=e.memberExpression(e.identifier("React"),e.identifier("createElement"))}return e.callExpression(n,l)}};var s=function(t){var r=[];var n=[];var a=function(){if(!r.length)return;n.push(e.objectExpression(r));r=[]};while(t.length){var l=t.shift();if(e.isXJSSpreadAttribute(l)){a();n.push(l.argument)}else{r.push(l)}}a();if(n.length===1){t=n[0]}else{if(!e.isObjectExpression(n[0])){n.unshift(e.objectExpression([]))}t=e.callExpression(e.memberExpression(e.identifier("React"),e.identifier("__spread")),n)}return t};n.XJSElement={exit:function(r){var n=r.openingElement;for(var l=0;l<r.children.length;l++){var t=r.children[l];if(e.isLiteral(t)&&u.isString(t.value)){o(t,n.arguments);continue}else if(e.isXJSEmptyExpression(t)){continue}n.arguments.push(t)}if(n.arguments.length>=3){n._prettyCall=true}return e.inherits(n,r)}};var o=function(l,a){var r=l.value.split(/\r\n|\n|\r/);for(var t=0;t<r.length;t++){var i=r[t];var s=t===0;var o=t===r.length-1;var n=i.replace(/\t/g," ");if(!s){n=n.replace(/^[ ]+/,"")}if(!o){n=n.replace(/[ ]+$/,"")}if(n){a.push(e.literal(n))}}};var a=function(n){if(!n||!e.isCallExpression(n))return false;var t=n.callee;if(!e.isMemberExpression(t))return false;var l=t.object;if(!e.isIdentifier(l,{name:"React"}))return false;var a=t.property;if(!e.isIdentifier(a,{name:"createClass"}))return false;var r=n.arguments;if(r.length!==1)return false;var i=r[0];if(!e.isObjectExpression(i))return;return true};var l=function(i,r){if(!a(r))return;var n=r.arguments[0].properties;var l=true;for(var t=0;t<n.length;t++){var s=n[t];if(e.isIdentifier(s.key,{name:"displayName"})){l=false;break}}if(l){n.unshift(e.property("init",e.identifier("displayName"),e.literal(i)))}};n.AssignmentExpression=n.Property=n.VariableDeclarator=function(n){var t,r;if(e.isAssignmentExpression(n)){t=n.left;r=n.right}else if(e.isProperty(n)){t=n.key;r=n.value}else if(e.isVariableDeclarator(n)){t=n.id;r=n.init}if(e.isMemberExpression(t)){t=t.property}if(e.isIdentifier(t)){l(t.name,r)}}},{"../../types":92,esutils:140,lodash:142}],82:[function(n,r,t){"use strict";var e=n("../../types");t.FunctionDeclaration=function(n,t){if(e.isProgram(t)||e.isExportDeclaration(t)){return}var r=e.variableDeclaration("let",[e.variableDeclarator(n.id,e.toExpression(n))]);r._blockHoist=2;n.id=null;return r}},{"../../types":92}],83:[function(n,r,t){"use strict";var e=n("../../types");t.MemberExpression=function(n){var t=n.property;if(n.computed&&e.isLiteral(t)&&e.isValidIdentifier(t.value)){n.property=e.identifier(t.value);n.computed=false}else if(!n.computed&&e.isIdentifier(t)&&!e.isValidIdentifier(t.name)){n.property=e.literal(t.name);n.computed=true}}},{"../../types":92}],84:[function(n,r,e){"use strict";var t=n("../../types");e.ForInStatement=e.ForOfStatement=function(r,a,i,s,l){var e=r.left;if(t.isVariableDeclaration(e)){var n=e.declarations[0];if(n.init)throw l.errorWithNode(n,"No assignments allowed in for-in/of head")}}},{"../../types":92}],85:[function(n,r,t){"use strict";var e=n("../../types");t.Property=function(t){var n=t.key;if(e.isLiteral(n)&&e.isValidIdentifier(n.value)){t.key=e.identifier(n.value);t.computed=false}else if(!t.computed&&e.isIdentifier(n)&&!e.isValidIdentifier(n.name)){t.key=e.literal(n.name)}}},{"../../types":92}],86:[function(n,t,e){"use strict";e.MethodDefinition=e.Property=function(e,t,r,l,n){if(e.kind==="set"&&e.value.params.length!==1){throw n.errorWithNode(e.value,"Setters must have only one parameter")}}},{}],87:[function(e,l,t){"use strict";var r=e("../helpers/use-strict");var n=e("../../types");t.ast={exit:function(e){if(!r.has(e.program)){e.program.body.unshift(n.expressionStatement(n.literal("use strict")))}}}},{"../../types":92,"../helpers/use-strict":33}],88:[function(a,u,c){"use strict";u.exports=r;var o=a("./scope");var n=a("../types");var t=a("lodash");function i(){}function e(){this.shouldFlatten=false;this.shouldRemove=false;this.shouldSkip=false;this.shouldStop=false}e.prototype.flatten=function(){this.shouldFlatten=true};e.prototype.remove=function(){this.shouldRemove=true;this.shouldSkip=true};e.prototype.skip=function(){this.shouldSkip=true};e.prototype.stop=function(){this.shouldStop=true;this.shouldSkip=true};e.prototype.reset=function(){this.shouldRemove=false;this.shouldSkip=false;this.shouldStop=false};function s(r,l,s,e){var a=Array.isArray(e);var i=e;if(a)i=e[0];if(i)n.inheritsComments(i,s);r[l]=e;if(a&&t.contains(n.STATEMENT_OR_BLOCK_KEYS,l)&&!n.isBlockStatement(r)){n.ensureBlock(r,l)}if(a){return true}}e.prototype.enterNode=function(t,r,e,a,i,o,u){var n=a(e,i,o,this,u);var l=false;if(n){l=s(t,r,e,n);e=n;if(l){this.shouldFlatten=true}}if(this.shouldRemove){t[r]=null;this.shouldFlatten=true}return e};e.prototype.exitNode=function(r,l,e,a,i,o,u){var n=a(e,i,o,this,u);var t=false;if(n){t=s(r,l,e,n);e=n;if(t){this.shouldFlatten=true}}return e};e.prototype.visitNode=function(a,i,t,u,c,s){this.reset();var e=a[i];if(t.blacklist&&t.blacklist.indexOf(e.type)>-1)return;var r=u;if(n.isScope(e)){r=new o(e,u)}e=this.enterNode(a,i,e,t.enter,c,r,s);if(this.shouldSkip)return this.shouldStop;l(e,t,r,s);this.exitNode(a,i,e,t.exit,c,r,s);return this.shouldStop};e.prototype.visit=function(e,n,a,i,s){var r=e[n];if(!r)return;if(!Array.isArray(r)){return this.visitNode(e,n,a,i,e,s)}if(r.length===0){return}for(var l=0;l<r.length;l++){if(r[l]&&this.visitNode(r,l,a,i,e,s))return true}if(this.shouldFlatten){e[n]=t.flatten(e[n]);if(n==="body"){e[n]=t.compact(e[n])}}};function l(l,a,i,s){var t=n.VISITOR_KEYS[l.type];if(!t)return;var o=new e;for(var r=0;r<t.length;r++){if(o.visit(l,t[r],a,i,s)){return}}}function r(n,e,r,a){if(!n)return;if(!e)e={};if(!e.enter)e.enter=i;if(!e.exit)e.exit=i;if(Array.isArray(n)){for(var t=0;t<n.length;t++){l(n[t],e,r,a)}}else{l(n,e,r,a)}}r.removeProperties=function(e){var n=function(e){e._declarations=null;e.extendedRange=null;e._scopeInfo=null;e.tokens=null;e.range=null;e.start=null;e.end=null;e.loc=null;e.raw=null;l(e.trailingComments);l(e.leadingComments)};var l=function(e){t.each(e,n)};n(e);r(e,{enter:n});return e};r.hasType=function(n,l,e){e=[].concat(e||[]);if(t.contains(e,n.type))return false;if(n.type===l)return true;var a={has:false};r(n,{blacklist:e,enter:function(e,r,a,n,t){if(e.type===l){t.has=true;n.skip()}}},null,a);return a.has}},{"../types":92,"./scope":89,lodash:142}],89:[function(r,i,o){"use strict";i.exports=n;var s=r("./index");var e=r("../types");var t=r("lodash");var a=["left","init"];function n(n,t){this.parent=t;this.block=n;var e=this.getInfo();this.references=e.references;this.declarations=e.declarations}var l=r("jshint/src/vars");n.defaultDeclarations=t.flatten([l.newEcmaIdentifiers,l.node,l.ecmaIdentifiers,l.reservedVars].map(t.keys));n.add=function(n,r){if(!n)return;t.defaults(r,e.getIds(n,true))};n.prototype.generateTemp=function(n,t){var e=n.generateUidIdentifier(t||"temp",this);this.push({key:e.name,id:e});return e};n.prototype.generateUidBasedOnNode=function(t,i){var n=t;if(e.isAssignmentExpression(t)){n=t.left}else if(e.isVariableDeclarator(t)){n=t.id}else if(e.isProperty(n)){n=n.key}var l=[];var r=function(n){if(e.isMemberExpression(n)){r(n.object);r(n.property)}else if(e.isIdentifier(n)){l.push(n.name)}else if(e.isLiteral(n)){l.push(n.value)}else if(e.isCallExpression(n)){r(n.callee)}};r(n);var a=l.join("$");a=a.replace(/^_/,"")||"ref";return i.generateUidIdentifier(a,this)};n.prototype.generateTempBasedOnNode=function(n,r){if(e.isIdentifier(n)&&this.has(n.name,true)){return null}var t=this.generateUidBasedOnNode(n,r);this.push({key:t.name,id:t});return t};n.prototype.getInfo=function(){var r=this.block;if(r._scopeInfo)return r._scopeInfo;var i=r._scopeInfo={};var o=i.references={};var u=i.declarations={};var l=function(e,t){n.add(e,o);if(!t)n.add(e,u)};if(e.isFor(r)){t.each(a,function(t){var n=r[t];if(e.isBlockScoped(n))l(n)})}if(e.isBlockStatement(r)||e.isProgram(r)){t.each(r.body,function(n){if(e.isBlockScoped(n))l(n)})}if(e.isCatchClause(r)){l(r.param)}if(e.isComprehensionExpression(r)){l(r)}if(e.isProgram(r)||e.isFunction(r)){var c={blockId:r.id,add:l};s(r,{enter:function(n,i,s,o,r){if(e.isFor(n)){t.each(a,function(r){var t=n[r];if(e.isVar(t))l(t)})}if(e.isFunction(n))return o.skip();if(r.blockId&&n===r.blockId)return;if(e.isIdentifier(n)&&e.isReferenced(n,i)&&!s.has(n.name)){r.add(n,true)}if(e.isDeclaration(n)&&!e.isBlockScoped(n)){r.add(n)}}},this,c)}if(e.isFunction(r)){l(r.rest);t.each(r.params,function(e){l(e)})}return i};n.prototype.push=function(t){var n=this.block;if(e.isFor(n)||e.isCatchClause(n)||e.isFunction(n)){e.ensureBlock(n);n=n.body}if(e.isBlockStatement(n)||e.isProgram(n)){n._declarations=n._declarations||{};n._declarations[t.key]={kind:t.kind,id:t.id,init:t.init}}else{throw new TypeError("cannot add a declaration here in node type "+n.type)}};n.prototype.add=function(e){n.add(e,this.references)};n.prototype.get=function(e,n){return e&&(this.getOwn(e,n)||this.parentGet(e,n))};n.prototype.getOwn=function(n,r){var e=this.references;if(r)e=this.declarations;return t.has(e,n)&&e[n]};n.prototype.parentGet=function(e,n){return this.parent&&this.parent.get(e,n)};n.prototype.has=function(e,r){return e&&(this.hasOwn(e,r)||this.parentHas(e,r))||t.contains(n.defaultDeclarations,e)};n.prototype.hasOwn=function(e,n){return!!this.getOwn(e,n)};n.prototype.parentHas=function(e,n){return this.parent&&this.parent.has(e,n)}},{"../types":92,"./index":88,"jshint/src/vars":141,lodash:142}],90:[function(n,e,t){e.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement","Loop","While"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement","Loop","While"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ExportDeclaration:["Statement","Declaration"],ImportDeclaration:["Statement","Declaration"],PrivateDeclaration:["Statement","Declaration"],ArrowFunctionExpression:["Scope","Function","Expression"],FunctionDeclaration:["Statement","Declaration","Scope","Function"],FunctionExpression:["Scope","Function","Expression"],BlockStatement:["Statement","Scope"],Program:["Scope"],CatchClause:["Scope"],LogicalExpression:["Binary","Expression"],BinaryExpression:["Binary","Expression"],UnaryExpression:["UnaryLike","Expression"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Statement","Declaration","Class"],ClassExpression:["Class","Expression"],ForOfStatement:["Statement","For","Scope","Loop"],ForInStatement:["Statement","For","Scope","Loop"],ForStatement:["Statement","For","Scope","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],AssignmentPattern:["Pattern"],Property:["UserWhitespacable"],XJSElement:["UserWhitespacable","Expression"],ArrayExpression:["Expression"],AssignmentExpression:["Expression"],AwaitExpression:["Expression"],BindFunctionExpression:["Expression"],BindMemberExpression:["Expression"],CallExpression:["Expression"],ComprehensionExpression:["Expression","Scope"],ConditionalExpression:["Expression"],Identifier:["Expression"],Literal:["Expression"],MemberExpression:["Expression"],NewExpression:["Expression"],ObjectExpression:["Expression"],SequenceExpression:["Expression"],TaggedTemplateExpression:["Expression"],ThisExpression:["Expression"],UpdateExpression:["Expression"],VirtualPropertyExpression:["Expression"],XJSEmptyExpression:["Expression"],XJSMemberExpression:["Expression"],YieldExpression:["Expression"]}
},{}],91:[function(n,e,t){e.exports={ArrayExpression:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["operator","left","right"],BinaryExpression:["operator","left","right"],BlockStatement:["body"],CallExpression:["callee","arguments"],ConditionalExpression:["test","consequent","alternate"],ExpressionStatement:["expression"],File:["program","comments","tokens"],FunctionExpression:["id","params","body","generator"],FunctionDeclaration:["id","params","body","generator"],Identifier:["name"],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],Literal:["value"],LogicalExpression:["operator","left","right"],MemberExpression:["object","property","computed"],MethodDefinition:["key","value","computed","kind"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],Program:["body"],Property:["kind","key","value","computed"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ThrowExpression:["argument"],UnaryExpression:["operator","argument","prefix"],VariableDeclaration:["kind","declarations"],VariableDeclarator:["id","init"],WithStatement:["object","body"],YieldExpression:["argument","delegate"]}},{}],92:[function(t,s,r){"use strict";var l=t("../to-fast-properties");var a=t("esutils");var n=t("lodash");var e=r;e.NATIVE_TYPE_NAMES=["Array","Object","Number","Boolean","Date","Array","String"];function i(n,t){var r=e["is"+n]=function(r,l){return e.is(n,r,l,t)};e["assert"+n]=function(t,e){e=e||{};if(!r(t,e)){throw new Error("Expected type "+JSON.stringify(n)+" with option "+JSON.stringify(e))}}}e.STATEMENT_OR_BLOCK_KEYS=["consequent","body"];e.VISITOR_KEYS=t("./visitor-keys");e.ALIAS_KEYS=t("./alias-keys");e.FLIPPED_ALIAS_KEYS={};n.each(e.VISITOR_KEYS,function(n,e){i(e,true)});n.each(e.ALIAS_KEYS,function(t,r){n.each(t,function(n){var t=e.FLIPPED_ALIAS_KEYS[n]=e.FLIPPED_ALIAS_KEYS[n]||[];t.push(r)})});n.each(e.FLIPPED_ALIAS_KEYS,function(t,n){e[n.toUpperCase()+"_TYPES"]=t;i(n,false)});e.is=function(r,n,l,i){if(!n)return;var t=r===n.type;if(!t&&!i){var a=e.FLIPPED_ALIAS_KEYS[r];if(typeof a!=="undefined")t=a.indexOf(n.type)>-1}if(!t){return false}if(typeof l!=="undefined")return e.shallowEqual(n,l);return true};e.BUILDER_KEYS=n.defaults(t("./builder-keys"),e.VISITOR_KEYS);n.each(e.BUILDER_KEYS,function(r,t){e[t[0].toLowerCase()+t.slice(1)]=function(){var l=arguments;var e={type:t};n.each(r,function(n,t){e[n]=l[t]});return e}});e.toComputedKey=function(t,n){if(!t.computed){if(e.isIdentifier(n))n=e.literal(n.name)}return n};e.isFalsyExpression=function(n){if(e.isLiteral(n)){return!n.value}else if(e.isIdentifier(n)){return n.name==="undefined"}return false};e.toSequenceExpression=function(r,l){var t=[];n.each(r,function(r){if(e.isExpression(r)){t.push(r)}if(e.isExpressionStatement(r)){t.push(r.expression)}else if(e.isVariableDeclaration(r)){n.each(r.declarations,function(n){l.push({kind:r.kind,key:n.id.name,id:n.id});t.push(e.assignmentExpression("=",n.id,n.init))})}});if(t.length===1){return t[0]}else{return e.sequenceExpression(t)}};e.shallowEqual=function(l,t){var r=Object.keys(t);var e;for(var n=0;n<r.length;n++){e=r[n];if(l[e]!==t[e])return false}return true};e.appendToMemberExpression=function(n,t,r){n.object=e.memberExpression(n.object,n.property,n.computed);n.property=t;n.computed=!!r;return n};e.prependToMemberExpression=function(n,t){n.object=e.memberExpression(t,n.object);return n};e.isReferenced=function(r,t){if(e.isProperty(t)&&t.key===r&&!t.computed)return false;if(e.isFunction(t)){if(n.contains(t.params,r))return false;if(t.rest===r)return false}if(e.isMethodDefinition(t)&&t.key===r&&!t.computed){return false}if(e.isCatchClause(t)&&t.param===r)return false;if(e.isVariableDeclarator(t)&&t.id===r)return false;var l=e.isMemberExpression(t);var a=l&&t.property===r&&t.computed;var i=l&&t.object===r;if(!l||a||i)return true;return false};e.isValidIdentifier=function(e){return n.isString(e)&&a.keyword.isIdentifierName(e)&&!a.keyword.isReservedWordES6(e,true)};e.toIdentifier=function(n){if(e.isIdentifier(n))return n.name;n=n+"";n=n.replace(/[^a-zA-Z0-9$_]/g,"-");n=n.replace(/^[-0-9]+/,"");n=n.replace(/[-_\s]+(.)?/g,function(n,e){return e?e.toUpperCase():""});n=n.replace(/^\_/,"");if(!e.isValidIdentifier(n)){n="_"+n}return n||"_"};e.ensureBlock=function(t,n){n=n||"body";t[n]=e.toBlock(t[n],t)};e.toStatement=function(n,l){if(e.isStatement(n)){return n}var r=false;var t;if(e.isClass(n)){r=true;t="ClassDeclaration"}else if(e.isFunction(n)){r=true;t="FunctionDeclaration"}if(r&&!n.id){t=false}if(!t){if(l){return false}else{throw new Error("cannot turn "+n.type+" to a statement")}}n.type=t;return n};r.toExpression=function(n){if(e.isExpressionStatement(n)){n=n.expression}if(e.isClass(n)){n.type="ClassExpression"}else if(e.isFunction(n)){n.type="FunctionExpression"}if(e.isExpression(n)){return n}else{throw new Error("cannot turn "+n.type+" to an expression")}};e.toBlock=function(n,t){if(e.isBlockStatement(n)){return n}if(e.isEmptyStatement(n)){n=[]}if(!Array.isArray(n)){if(!e.isStatement(n)){if(e.isFunction(t)){n=e.returnStatement(n)}else{n=e.expressionStatement(n)}}n=[n]}return e.blockStatement(n)};e.getIds=function(c,f,s){s=s||[];var l=[].concat(c);var i={};while(l.length){var t=l.shift();if(!t)continue;if(n.contains(s,t.type))continue;var o=e.getIds.nodes[t.type];var u=e.getIds.arrays[t.type];var r,a;if(e.isIdentifier(t)){i[t.name]=t}else if(o){for(r=0;r<o.length;r++){a=o[r];if(t[a]){l.push(t[a]);break}}}else if(u){for(r=0;r<u.length;r++){a=u[r];l=l.concat(t[a]||[])}}}if(!f)i=n.keys(i);return i};e.getIds.nodes={AssignmentExpression:["left"],ImportBatchSpecifier:["name"],ImportSpecifier:["name","id"],ExportSpecifier:["name","id"],VariableDeclarator:["id"],FunctionDeclaration:["id"],ClassDeclaration:["id"],MemeberExpression:["object"],SpreadElement:["argument"],Property:["value"],ComprehensionBlock:["left"]};e.getIds.arrays={PrivateDeclaration:["declarations"],ComprehensionExpression:["blocks"],ExportDeclaration:["specifiers","declaration"],ImportDeclaration:["specifiers"],VariableDeclaration:["declarations"],ArrayPattern:["elements"],ObjectPattern:["properties"]};e.isLet=function(n){return e.isVariableDeclaration(n)&&(n.kind!=="var"||n._let)};e.isBlockScoped=function(n){return e.isFunctionDeclaration(n)||e.isLet(n)};e.isVar=function(n){return e.isVariableDeclaration(n,{kind:"var"})&&!n._let};e.COMMENT_KEYS=["leadingComments","trailingComments"];e.removeComments=function(t){n.each(e.COMMENT_KEYS,function(e){delete t[e]});return t};e.inheritsComments=function(t,r){n.each(e.COMMENT_KEYS,function(e){t[e]=n.uniq(n.compact([].concat(t[e],r[e])))});return t};e.inherits=function(n,t){n.range=t.range;n.start=t.start;n.loc=t.loc;n.end=t.end;e.inheritsComments(n,t);return n};e.getSpecifierName=function(e){return e.name||e.id};e.isSpecifierDefault=function(n){return e.isIdentifier(n.id)&&n.id.name==="default"};l(e);l(e.VISITOR_KEYS)},{"../to-fast-properties":25,"./alias-keys":90,"./builder-keys":91,"./visitor-keys":93,esutils:140,lodash:142}],93:[function(n,e,t){e.exports={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BindFunctionExpression:["callee","arguments"],BindMemberExpression:["object","property","arguments"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportBatchSpecifier:["id"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateDeclaration:["declarations"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],VirtualPropertyExpression:["object","property"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"],AnyTypeAnnotation:[],ArrayTypeAnnotation:[],BooleanTypeAnnotation:[],ClassProperty:["key"],DeclareClass:[],DeclareFunction:[],DeclareModule:[],DeclareVariable:[],FunctionTypeAnnotation:[],FunctionTypeParam:[],GenericTypeAnnotation:[],InterfaceExtends:[],InterfaceDeclaration:[],IntersectionTypeAnnotation:[],NullableTypeAnnotation:[],NumberTypeAnnotation:[],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],TupleTypeAnnotation:[],TypeofTypeAnnotation:[],TypeAlias:[],TypeAnnotation:[],TypeParameterDeclaration:[],TypeParameterInstantiation:[],ObjectTypeAnnotation:[],ObjectTypeCallProperty:[],ObjectTypeIndexer:[],ObjectTypeProperty:[],QualifiedTypeIdentifier:[],UnionTypeAnnotation:[],VoidTypeAnnotation:[],XJSAttribute:["name","value"],XJSClosingElement:["name"],XJSElement:["openingElement","closingElement","children"],XJSEmptyExpression:[],XJSExpressionContainer:["expression"],XJSIdentifier:[],XJSMemberExpression:["object","property"],XJSNamespacedName:["namespace","name"],XJSOpeningElement:["name","attributes"],XJSSpreadAttribute:["argument"]}},{}],94:[function(n,t,e){(function(u,o){"use strict";n("./patch");var f=n("estraverse");var l=n("./traverse");var c=n("acorn-6to5");var a=n("path");var m=n("util");var i=n("fs");var t=n("./types");var r=n("lodash");e.inherits=m.inherits;e.canCompile=function(n,t){var l=t||e.canCompile.EXTENSIONS;var i=a.extname(n);return r.contains(l,i)};e.canCompile.EXTENSIONS=[".js",".jsx",".es6",".es"];e.isInteger=function(e){return r.isNumber(e)&&e%1===0};e.resolve=function(e){try{return n.resolve(e)}catch(t){return null}};e.trimRight=function(e){return e.replace(/[\n\s]+$/g,"")};e.list=function(e){return e?e.split(","):[]};e.regexify=function(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e))e=e.join("|");if(r.isString(e))return new RegExp(e);if(r.isRegExp(e))return e;throw new TypeError("illegal type for regexify")};e.arrayify=function(n){if(!n)return[];if(r.isString(n))return e.list(n);if(Array.isArray(n))return n;throw new TypeError("illegal type for arrayify")};e.isAbsolute=function(e){if(!e)return false;if(e[0]==="/")return true;if(e[1]===":"&&e[2]==="\\")return true;return false};e.sourceMapToComment=function(e){var n=JSON.stringify(e);var t=new u(n).toString("base64");return"//# sourceMappingURL=data:application/json;base64,"+t};e.pushMutatorMap=function(i,n,o,s,u){var e;if(t.isIdentifier(n)){e=n.name;if(s)e="computed:"+e}else if(t.isLiteral(n)){e=String(n.value)}else{e=JSON.stringify(l.removeProperties(r.cloneDeep(n)))}var a;if(r.has(i,e)){a=i[e]}else{a={}}i[e]=a;a._key=n;if(s){a._computed=true}a[o]=u};e.buildDefineProperties=function(n){var e=t.objectExpression([]);r.each(n,function(n){var l=t.objectExpression([]);var a=t.property("init",n._key,l,n._computed);if(!n.get&&!n.set){n.writable=t.literal(true)}n.enumerable=t.literal(true);n.configurable=t.literal(true);r.each(n,function(e,n){if(n[0]==="_")return;e=r.clone(e);var a=e;if(t.isMethodDefinition(e))e=e.value;var i=t.property("init",t.identifier(n),e);t.inheritsComments(i,a);t.removeComments(a);l.properties.push(i)});e.properties.push(a)});return e};var p={enter:function(e,l,a,i,n){if(t.isIdentifier(e)&&r.has(n,e.name)){return n[e.name]}}};e.template=function(s,a,o){var n=e.templates[s];if(!n)throw new ReferenceError("unknown template "+s);if(a===true){o=true;a=null}n=r.cloneDeep(n);if(!r.isEmpty(a)){l(n,p,null,a)}var i=n.body[0];if(!o&&t.isExpressionStatement(i)){return i.expression}else{return i}};e.codeFrame=function(n,t,r){r=Math.max(r,0);n=n.split("\n");var l=Math.max(t-3,0);var a=Math.min(n.length,t+3);var i=(a+"").length;if(!t&&!r){l=0;a=n.length}return"\n"+n.slice(l,a).map(function(o,u){var a=u+l+1;var s=a===t?"> ":" ";var c=a+e.repeat(i+1);s+=c+"| ";var n=s+o;if(r&&a===t){n+="\n";n+=e.repeat(s.length-2);n+="|"+e.repeat(r)+"^"}return n}).join("\n")};e.repeat=function(r,e){e=e||" ";var n="";for(var t=0;t<r;t++){n+=e}return n};e.normaliseAst=function(e,n,r){if(e&&e.type==="Program"){return t.file(e,n||[],r||[])}else{throw new Error("Not a valid ast?")}};e.parse=function(r,o,u){try{var l=[];var a=[];var t=c.parse(o,{allowImportExportEverywhere:true,allowReturnOutsideFunction:true,ecmaVersion:r.experimental?7:6,playground:r.playground,strictMode:true,onComment:l,locations:true,onToken:a,ranges:true});f.attachComments(t,l,a);t=e.normaliseAst(t,l,a);if(u){return u(t)}else{return t}}catch(n){if(!n._6to5){n._6to5=true;var i=r.filename+": "+n.message;var s=n.loc;if(s){var p=e.codeFrame(o,s.line,s.column);i+=p}if(n.stack)n.stack=n.stack.replace(n.message,i);n.message=i}throw n}};e.parseTemplate=function(n,t){var r=e.parse({filename:n},t).program;return l.removeProperties(r)};var d=function(){var t={};var n=o+"/transformation/templates";if(!i.existsSync(n)){throw new Error("no templates directory - this is most likely the "+"result of a broken `npm publish`. Please report to "+"https://github.com/6to5/6to5/issues")}r.each(i.readdirSync(n),function(r){if(r[0]===".")return;var s=a.basename(r,a.extname(r));var l=n+"/"+r;var o=i.readFileSync(l,"utf8");t[s]=e.parseTemplate(l,o)});return t};try{e.templates=n("../../templates.json")}catch(s){if(s.code!=="MODULE_NOT_FOUND")throw s;e.templates=d()}}).call(this,n("buffer").Buffer,"/lib/6to5")},{"../../templates.json":198,"./patch":24,"./traverse":88,"./types":92,"acorn-6to5":1,buffer:111,estraverse:136,fs:109,lodash:142,path:118,util:134}],95:[function(u,v,x){var s=u("../lib/types");var o=s.Type;var e=o.def;var n=o.or;var a=s.builtInTypes;var l=a.string;var p=a.number;var r=a.boolean;var f=a.RegExp;var c=u("../lib/shared");var t=c.defaults;var i=c.geq;e("Printable").field("loc",n(e("SourceLocation"),null),t["null"],true);e("Node").bases("Printable").field("type",l);e("SourceLocation").build("start","end","source").field("start",e("Position")).field("end",e("Position")).field("source",n(l,null),t["null"]);e("Position").build("line","column").field("line",i(1)).field("column",i(0));e("Program").bases("Node").build("body").field("body",[e("Statement")]).field("comments",n([n(e("Block"),e("Line"))],null),t["null"],true);e("Function").bases("Node").field("id",n(e("Identifier"),null),t["null"]).field("params",[e("Pattern")]).field("body",n(e("BlockStatement"),e("Expression")));e("Statement").bases("Node");e("EmptyStatement").bases("Statement").build();e("BlockStatement").bases("Statement").build("body").field("body",[e("Statement")]);e("ExpressionStatement").bases("Statement").build("expression").field("expression",e("Expression"));e("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",e("Expression")).field("consequent",e("Statement")).field("alternate",n(e("Statement"),null),t["null"]);e("LabeledStatement").bases("Statement").build("label","body").field("label",e("Identifier")).field("body",e("Statement"));e("BreakStatement").bases("Statement").build("label").field("label",n(e("Identifier"),null),t["null"]);e("ContinueStatement").bases("Statement").build("label").field("label",n(e("Identifier"),null),t["null"]);e("WithStatement").bases("Statement").build("object","body").field("object",e("Expression")).field("body",e("Statement"));e("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",e("Expression")).field("cases",[e("SwitchCase")]).field("lexical",r,t["false"]);e("ReturnStatement").bases("Statement").build("argument").field("argument",n(e("Expression"),null));e("ThrowStatement").bases("Statement").build("argument").field("argument",e("Expression"));e("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",e("BlockStatement")).field("handler",n(e("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[e("CatchClause")],function(){return this.handler?[this.handler]:[]},true).field("guardedHandlers",[e("CatchClause")],t.emptyArray).field("finalizer",n(e("BlockStatement"),null),t["null"]);e("CatchClause").bases("Node").build("param","guard","body").field("param",e("Pattern")).field("guard",n(e("Expression"),null),t["null"]).field("body",e("BlockStatement"));e("WhileStatement").bases("Statement").build("test","body").field("test",e("Expression")).field("body",e("Statement"));e("DoWhileStatement").bases("Statement").build("body","test").field("body",e("Statement")).field("test",e("Expression"));e("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(e("VariableDeclaration"),e("Expression"),null)).field("test",n(e("Expression"),null)).field("update",n(e("Expression"),null)).field("body",e("Statement"));e("ForInStatement").bases("Statement").build("left","right","body","each").field("left",n(e("VariableDeclaration"),e("Expression"))).field("right",e("Expression")).field("body",e("Statement")).field("each",r);e("DebuggerStatement").bases("Statement").build();e("Declaration").bases("Statement");e("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",e("Identifier"));e("FunctionExpression").bases("Function","Expression").build("id","params","body");e("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[n(e("VariableDeclarator"),e("Identifier"))]);e("VariableDeclarator").bases("Node").build("id","init").field("id",e("Pattern")).field("init",n(e("Expression"),null));e("Expression").bases("Node","Pattern");e("ThisExpression").bases("Expression").build();e("ArrayExpression").bases("Expression").build("elements").field("elements",[n(e("Expression"),null)]);e("ObjectExpression").bases("Expression").build("properties").field("properties",[e("Property")]);e("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(e("Literal"),e("Identifier"))).field("value",e("Expression"));e("SequenceExpression").bases("Expression").build("expressions").field("expressions",[e("Expression")]);var d=n("-","+","!","~","typeof","void","delete");e("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",d).field("argument",e("Expression")).field("prefix",r,t["true"]);var m=n("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");e("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",e("Expression")).field("right",e("Expression"));var h=n("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");e("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",e("Pattern")).field("right",e("Expression"));var g=n("++","--");e("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",g).field("argument",e("Expression")).field("prefix",r);var y=n("||","&&");e("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",e("Expression")).field("right",e("Expression"));e("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",e("Expression")).field("consequent",e("Expression")).field("alternate",e("Expression"));e("NewExpression").bases("Expression").build("callee","arguments").field("callee",e("Expression")).field("arguments",[e("Expression")]);e("CallExpression").bases("Expression").build("callee","arguments").field("callee",e("Expression")).field("arguments",[e("Expression")]);e("MemberExpression").bases("Expression").build("object","property","computed").field("object",e("Expression")).field("property",n(e("Identifier"),e("Expression"))).field("computed",r);e("Pattern").bases("Node");e("ObjectPattern").bases("Pattern").build("properties").field("properties",[e("PropertyPattern")]);e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",n(e("Literal"),e("Identifier"))).field("pattern",e("Pattern"));e("ArrayPattern").bases("Pattern").build("elements").field("elements",[n(e("Pattern"),null)]);e("SwitchCase").bases("Node").build("test","consequent").field("test",n(e("Expression"),null)).field("consequent",[e("Statement")]);e("Identifier").bases("Node","Expression","Pattern").build("name").field("name",l);e("Literal").bases("Node","Expression").build("value").field("value",n(l,r,null,p,f));e("Block").bases("Printable").build("loc","value").field("value",l);e("Line").bases("Printable").build("loc","value").field("value",l)},{"../lib/shared":106,"../lib/types":107}],96:[function(l,s,o){l("./core");var r=l("../lib/types");var e=r.Type.def;var t=r.Type.or;var a=r.builtInTypes;var n=a.string;var i=a.boolean;e("XMLDefaultDeclaration").bases("Declaration").field("namespace",e("Expression"));e("XMLAnyName").bases("Expression");e("XMLQualifiedIdentifier").bases("Expression").field("left",t(e("Identifier"),e("XMLAnyName"))).field("right",t(e("Identifier"),e("Expression"))).field("computed",i);e("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",t(e("Identifier"),e("Expression"))).field("computed",i);e("XMLAttributeSelector").bases("Expression").field("attribute",e("Expression"));e("XMLFilterExpression").bases("Expression").field("left",e("Expression")).field("right",e("Expression"));e("XMLElement").bases("XML","Expression").field("contents",[e("XML")]);e("XMLList").bases("XML","Expression").field("contents",[e("XML")]);e("XML").bases("Node");e("XMLEscape").bases("XML").field("expression",e("Expression"));e("XMLText").bases("XML").field("text",n);e("XMLStartTag").bases("XML").field("contents",[e("XML")]);e("XMLEndTag").bases("XML").field("contents",[e("XML")]);e("XMLPointTag").bases("XML").field("contents",[e("XML")]);e("XMLName").bases("XML").field("contents",t(n,[e("XML")]));e("XMLAttribute").bases("XML").field("value",n);e("XMLCdata").bases("XML").field("contents",n);e("XMLComment").bases("XML").field("contents",n);e("XMLProcessingInstruction").bases("XML").field("target",n).field("contents",t(n,null))},{"../lib/types":107,"./core":95}],97:[function(s,c,f){s("./core");var a=s("../lib/types");var e=a.Type.def;var n=a.Type.or;var l=a.builtInTypes;var r=l.boolean;var u=l.object;var i=l.string;var t=s("../lib/shared").defaults;e("Function").field("generator",r,t["false"]).field("expression",r,t["false"]).field("defaults",[n(e("Expression"),null)],t.emptyArray).field("rest",n(e("Identifier"),null),t["null"]);e("FunctionDeclaration").build("id","params","body","generator","expression");e("FunctionExpression").build("id","params","body","generator","expression");e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,t["null"]).field("generator",false);e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",n(e("Expression"),null)).field("delegate",r,t["false"]);e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",n(e("Expression"),null));e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",n(e("Expression"),null));e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",r);e("ModuleSpecifier").bases("Literal").build("value").field("value",i);e("Property").field("key",n(e("Literal"),e("Identifier"),e("Expression"))).field("method",r,t["false"]).field("shorthand",r,t["false"]).field("computed",r,t["false"]);e("PropertyPattern").field("key",n(e("Literal"),e("Identifier"),e("Expression"))).field("computed",r,t["false"]);e("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",n("init","get","set","")).field("key",n(e("Literal"),e("Identifier"),e("Expression"))).field("value",e("Function")).field("computed",r,t["false"]);e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression"));e("ArrayExpression").field("elements",[n(e("Expression"),e("SpreadElement"),null)]);e("NewExpression").field("arguments",[n(e("Expression"),e("SpreadElement"))]);e("CallExpression").field("arguments",[n(e("Expression"),e("SpreadElement"))]);e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern"));var o=n(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"));e("ClassProperty").bases("Declaration").build("key").field("key",n(e("Literal"),e("Identifier"),e("Expression"))).field("computed",r,t["false"]);e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",o);e("ClassBody").bases("Declaration").build("body").field("body",[o]);e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",e("Identifier")).field("body",e("ClassBody")).field("superClass",n(e("Expression"),null),t["null"]);e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",n(e("Identifier"),null),t["null"]).field("body",e("ClassBody")).field("superClass",n(e("Expression"),null),t["null"]).field("implements",[e("ClassImplements")],t.emptyArray);e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",n(e("Expression"),null),t["null"]);e("Specifier").bases("Node");e("NamedSpecifier").bases("Specifier").field("id",e("Identifier")).field("name",n(e("Identifier"),null),t["null"]);e("ExportSpecifier").bases("NamedSpecifier").build("id","name");e("ExportBatchSpecifier").bases("Specifier").build();e("ImportSpecifier").bases("NamedSpecifier").build("id","name");e("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",e("Identifier"));e("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",e("Identifier"));e("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",r).field("declaration",n(e("Declaration"),e("Expression"),null)).field("specifiers",[n(e("ExportSpecifier"),e("ExportBatchSpecifier"))],t.emptyArray).field("source",n(e("ModuleSpecifier"),null),t["null"]);e("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[n(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],t.emptyArray).field("source",e("ModuleSpecifier"));e("TaggedTemplateExpression").bases("Expression").field("tag",e("Expression")).field("quasi",e("TemplateLiteral"));e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]);e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:i,raw:i}).field("tail",r)},{"../lib/shared":106,"../lib/types":107,"./core":95}],98:[function(n,s,o){n("./core");var t=n("../lib/types");var e=t.Type.def;var r=t.Type.or;var i=t.builtInTypes;var l=i.boolean;var a=n("../lib/shared").defaults;e("Function").field("async",l,a["false"]);e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression"));e("ObjectExpression").field("properties",[r(e("Property"),e("SpreadProperty"))]);e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern"));e("ObjectPattern").field("properties",[r(e("PropertyPattern"),e("SpreadPropertyPattern"))]);e("AwaitExpression").bases("Expression").build("argument","all").field("argument",r(e("Expression"),null)).field("all",l,a["false"])},{"../lib/shared":106,"../lib/types":107,"./core":95}],99:[function(a,c,f){a("./core");var s=a("../lib/types");var e=s.Type.def;var n=s.Type.or;var u=s.builtInTypes;var l=u.string;var r=u.boolean;var t=a("../lib/shared").defaults;e("XJSAttribute").bases("Node").build("name","value").field("name",n(e("XJSIdentifier"),e("XJSNamespacedName"))).field("value",n(e("Literal"),e("XJSExpressionContainer"),null),t["null"]);e("XJSIdentifier").bases("Node").build("name").field("name",l);e("XJSNamespacedName").bases("Node").build("namespace","name").field("namespace",e("XJSIdentifier")).field("name",e("XJSIdentifier"));e("XJSMemberExpression").bases("MemberExpression").build("object","property").field("object",n(e("XJSIdentifier"),e("XJSMemberExpression"))).field("property",e("XJSIdentifier")).field("computed",r,t.false);var i=n(e("XJSIdentifier"),e("XJSNamespacedName"),e("XJSMemberExpression"));e("XJSSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));var o=[n(e("XJSAttribute"),e("XJSSpreadAttribute"))];e("XJSExpressionContainer").bases("Expression").build("expression").field("expression",e("Expression"));e("XJSElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("XJSOpeningElement")).field("closingElement",n(e("XJSClosingElement"),null),t["null"]).field("children",[n(e("XJSElement"),e("XJSExpressionContainer"),e("XJSText"),e("Literal"))],t.emptyArray).field("name",i,function(){return this.openingElement.name}).field("selfClosing",r,function(){return this.openingElement.selfClosing}).field("attributes",o,function(){return this.openingElement.attributes});e("XJSOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",i).field("attributes",o,t.emptyArray).field("selfClosing",r,t["false"]);e("XJSClosingElement").bases("Node").build("name").field("name",i);e("XJSText").bases("Literal").build("value").field("value",l);e("XJSEmptyExpression").bases("Expression").build();e("Type").bases("Node");e("AnyTypeAnnotation").bases("Type");e("VoidTypeAnnotation").bases("Type");e("NumberTypeAnnotation").bases("Type");e("StringTypeAnnotation").bases("Type");e("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",l).field("raw",l);e("BooleanTypeAnnotation").bases("Type");e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("Type"));e("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",e("Type"));e("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("Type")).field("rest",n(e("FunctionTypeParam"),null)).field("typeParameters",n(e("TypeParameterDeclaration"),null));e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",e("Identifier")).field("typeAnnotation",e("Type")).field("optional",r);e("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[e("ObjectTypeProperty")]).field("indexers",[e("ObjectTypeIndexer")],t.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],t.emptyArray);
e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",n(e("Literal"),e("Identifier"))).field("value",e("Type")).field("optional",r);e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("Type")).field("value",e("Type"));e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",r,false);e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",n(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier"));e("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",n(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",n(e("TypeParameterInstantiation"),null));e("MemberTypeAnnotation").bases("Type").build("object","property").field("object",e("Identifier")).field("property",n(e("MemberTypeAnnotation"),e("GenericTypeAnnotation")));e("UnionTypeAnnotation").bases("Type").build("types").field("types",[e("Type")]);e("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[e("Type")]);e("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",e("Type"));e("Identifier").field("typeAnnotation",n(e("TypeAnnotation"),null),t["null"]);e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("Identifier")]);e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("Type")]);e("Function").field("returnType",n(e("TypeAnnotation"),null),t["null"]).field("typeParameters",n(e("TypeParameterDeclaration"),null),t["null"]);e("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",e("TypeAnnotation")).field("static",r,false);e("ClassImplements").field("typeParameters",n(e("TypeParameterInstantiation"),null),t["null"]);e("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",n(e("TypeParameterDeclaration"),null),t["null"]).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]);e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",n(e("TypeParameterInstantiation"),null));e("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",n(e("TypeParameterDeclaration"),null)).field("right",e("Type"));e("TupleTypeAnnotation").bases("Type").build("types").field("types",[e("Type")]);e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier"));e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier"));e("DeclareClass").bases("InterfaceDeclaration").build("id");e("DeclareModule").bases("Statement").build("id","body").field("id",n(e("Identifier"),e("Literal"))).field("body",e("BlockStatement"))},{"../lib/shared":106,"../lib/types":107,"./core":95}],100:[function(n,a,i){n("./core");var t=n("../lib/types");var e=t.Type.def;var l=t.Type.or;var r=n("../lib/shared").geq;e("ForOfStatement").bases("Statement").build("left","right","body").field("left",l(e("VariableDeclaration"),e("Expression"))).field("right",e("Expression")).field("body",e("Statement"));e("LetStatement").bases("Statement").build("head","body").field("head",[e("VariableDeclarator")]).field("body",e("Statement"));e("LetExpression").bases("Expression").build("head","body").field("head",[e("VariableDeclarator")]).field("body",e("Expression"));e("GraphExpression").bases("Expression").build("index","expression").field("index",r(0)).field("expression",e("Literal"));e("GraphIndexExpression").bases("Expression").build("index").field("index",r(0))},{"../lib/shared":106,"../lib/types":107,"./core":95}],101:[function(s,p,g){var n=s("assert");var e=s("../main");var o=e.getFieldNames;var i=e.getFieldValue;var t=e.builtInTypes.array;var r=e.builtInTypes.object;var u=e.builtInTypes.Date;var c=e.builtInTypes.RegExp;var f=Object.prototype.hasOwnProperty;function a(n,r,e){if(t.check(e)){e.length=0}else{e=null}return l(n,r,e)}a.assert=function(t,r){var e=[];if(!a(t,r,e)){if(e.length===0){n.strictEqual(t,r)}else{n.ok(false,"Nodes differ in the following path: "+e.map(d).join(""))}}};function d(e){if(/[_$a-z][_$a-z0-9]*/i.test(e)){return"."+e}return"["+JSON.stringify(e)+"]"}function l(e,n,l){if(e===n){return true}if(t.check(e)){return m(e,n,l)}if(r.check(e)){return h(e,n,l)}if(u.check(e)){return u.check(n)&&+e===+n}if(c.check(e)){return c.check(n)&&(e.source===n.source&&e.global===n.global&&e.multiline===n.multiline&&e.ignoreCase===n.ignoreCase)}return e==n}function m(a,i,r){t.assert(a);var s=a.length;if(!t.check(i)||i.length!==s){if(r){r.push("length")}return false}for(var e=0;e<s;++e){if(r){r.push(e)}if(e in a!==e in i){return false}if(!l(a[e],i[e],r)){return false}if(r){n.strictEqual(r.pop(),e)}}return true}function h(s,c,t){r.assert(s);if(!r.check(c)){return false}if(s.type!==c.type){if(t){t.push("type")}return false}var d=o(s);var p=d.length;var m=o(c);var h=m.length;if(p===h){for(var e=0;e<p;++e){var a=d[e];var g=i(s,a);var y=i(c,a);if(t){t.push(a)}if(!l(g,y,t)){return false}if(t){n.strictEqual(t.pop(),a)}}return true}if(!t){return false}var u=Object.create(null);for(e=0;e<p;++e){u[d[e]]=true}for(e=0;e<h;++e){a=m[e];if(!f.call(u,a)){t.push(a);return false}delete u[a]}for(a in u){t.push(a);break}return false}p.exports=a},{"../main":108,assert:110}],102:[function(l,f,x){var n=l("assert");var r=l("./types");var e=r.namedTypes;var c=r.builders;var m=r.builtInTypes.number;var p=r.builtInTypes.array;var o=l("./path");var u=l("./scope");function a(e,t,r){n.ok(this instanceof a);o.call(this,e,t,r)}l("util").inherits(a,o);var t=a.prototype;Object.defineProperties(t,{node:{get:function(){Object.defineProperty(this,"node",{configurable:true,value:this._computeNode()});return this.node}},parent:{get:function(){Object.defineProperty(this,"parent",{configurable:true,value:this._computeParent()});return this.parent}},scope:{get:function(){Object.defineProperty(this,"scope",{configurable:true,value:this._computeScope()});return this.scope}}});t.replace=function(){delete this.node;delete this.parent;delete this.scope;return o.prototype.replace.apply(this,arguments)};t.prune=function(){var e=this.parent;this.replace();return g(e)};t._computeNode=function(){var n=this.value;if(e.Node.check(n)){return n}var t=this.parentPath;return t&&t.node||null};t._computeParent=function(){var t=this.value;var n=this.parentPath;if(!e.Node.check(t)){while(n&&!e.Node.check(n.value)){n=n.parentPath}if(n){n=n.parentPath}}while(n&&!e.Node.check(n.value)){n=n.parentPath}return n||null};t._computeScope=function(){var t=this.value;var r=this.parentPath;var n=r&&r.scope;if(e.Node.check(t)&&u.isEstablishedBy(t)){n=new u(this,n)}return n||null};t.getValueProperty=function(e){return r.getFieldValue(this.value,e)};t.needsParens=function(o){var l=this.parentPath;if(!l){return false}var r=this.value;if(!e.Expression.check(r)){return false}if(r.type==="Identifier"){return false}while(!e.Node.check(l.value)){l=l.parentPath;if(!l){return false}}var t=l.value;switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return t.type==="MemberExpression"&&this.name==="object"&&t.object===r;case"BinaryExpression":case"LogicalExpression":switch(t.type){case"CallExpression":return this.name==="callee"&&t.callee===r;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return true;case"MemberExpression":return this.name==="object"&&t.object===r;case"BinaryExpression":case"LogicalExpression":var u=t.operator;var l=s[u];var c=r.operator;var a=s[c];if(l>a){return true}if(l===a&&this.name==="right"){n.strictEqual(t.right,r);return true}default:return false}case"SequenceExpression":switch(t.type){case"ForStatement":return false;case"ExpressionStatement":return this.name!=="expression";default:return true}case"YieldExpression":switch(t.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return true;default:return false}case"Literal":return t.type==="MemberExpression"&&m.check(r.value)&&this.name==="object"&&t.object===r;case"AssignmentExpression":case"ConditionalExpression":switch(t.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return true;case"CallExpression":return this.name==="callee"&&t.callee===r;case"ConditionalExpression":return this.name==="test"&&t.test===r;case"MemberExpression":return this.name==="object"&&t.object===r;default:return false}default:if(t.type==="NewExpression"&&this.name==="callee"&&t.callee===r){return i(r)}}if(o!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function d(n){return e.BinaryExpression.check(n)||e.LogicalExpression.check(n)}function v(n){return e.UnaryExpression.check(n)||e.SpreadElement&&e.SpreadElement.check(n)||e.SpreadProperty&&e.SpreadProperty.check(n)}var s={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,n){e.forEach(function(e){s[e]=n})});function i(n){if(e.CallExpression.check(n)){return true}if(p.check(n)){return n.some(i)}if(e.Node.check(n)){return r.someField(n,function(n,e){return i(e)})}return false}t.canBeFirstInStatement=function(){var n=this.node;return!e.FunctionExpression.check(n)&&!e.ObjectExpression.check(n)};t.firstInStatement=function(){return h(this)};function h(r){for(var l,t;r.parent;r=r.parent){l=r.node;t=r.parent.node;if(e.BlockStatement.check(t)&&r.parent.name==="body"&&r.name===0){n.strictEqual(t.body[0],l);return true}if(e.ExpressionStatement.check(t)&&r.name==="expression"){n.strictEqual(t.expression,l);return true}if(e.SequenceExpression.check(t)&&r.parent.name==="expressions"&&r.name===0){n.strictEqual(t.expressions[0],l);continue}if(e.CallExpression.check(t)&&r.name==="callee"){n.strictEqual(t.callee,l);continue}if(e.MemberExpression.check(t)&&r.name==="object"){n.strictEqual(t.object,l);continue}if(e.ConditionalExpression.check(t)&&r.name==="test"){n.strictEqual(t.test,l);continue}if(d(t)&&r.name==="left"){n.strictEqual(t.left,l);continue}if(e.UnaryExpression.check(t)&&!t.prefix&&r.name==="argument"){n.strictEqual(t.argument,l);continue}return false}return true}function g(n){if(e.VariableDeclaration.check(n.node)){var t=n.get("declarations").value;if(!t||t.length===0){return n.prune()}}else if(e.ExpressionStatement.check(n.node)){if(!n.get("expression").value){return n.prune()}}else if(e.IfStatement.check(n.node)){y(n)}return n}function y(n){var t=n.get("test").value;var r=n.get("alternate").value;var l=n.get("consequent").value;if(!l&&!r){var i=c.expressionStatement(t);n.replace(i)}else if(!l&&r){var a=c.unaryExpression("!",t,true);if(e.UnaryExpression.check(t)&&t.operator==="!"){a=t.argument}n.get("test").replace(a);n.get("consequent").replace(r);n.get("alternate").replace()}}f.exports=a},{"./path":104,"./scope":105,"./types":107,assert:110,util:134}],103:[function(s,m,x){var e=s("assert");var l=s("./types");var t=s("./node-path");var v=l.namedTypes.Node;var p=l.builtInTypes.array;var u=l.builtInTypes.object;var o=l.builtInTypes.function;var c=Object.prototype.hasOwnProperty;var g;function n(){e.ok(this instanceof n);this._reusableContextStack=[];this._methodNameTable=d(this);this.Context=y(this);this._visiting=false;this._changeReported=false}function d(r){var n=Object.create(null);for(var e in r){if(/^visit[A-Z]/.test(e)){n[e.slice("visit".length)]=true}}var a=l.computeSupertypeLookupTable(n);var i=Object.create(null);var n=Object.keys(a);var u=n.length;for(var t=0;t<u;++t){var s=n[t];e="visit"+a[s];if(o.check(r[e])){i[s]=e}}return i}n.fromMethodsObject=function b(l){if(l instanceof n){return l}if(!u.check(l)){return new n}function t(){e.ok(this instanceof t);n.call(this)}var a=t.prototype=Object.create(r);a.constructor=t;i(a,l);i(t,n);o.assert(t.fromMethodsObject);o.assert(t.visit);return new t};function i(t,e){for(var n in e){if(c.call(e,n)){t[n]=e[n]}}return t}n.visit=function E(e,t){return n.fromMethodsObject(t).visit(e)};var r=n.prototype;var h=["Recursively calling visitor.visit(path) resets visitor state.","Try this.visit(path) or this.traverse(path) instead."].join(" ");r.visit=function(){e.ok(!this._visiting,h);this._visiting=true;this._changeReported=false;var l=arguments.length;var n=new Array(l);for(var r=0;r<l;++r){n[r]=arguments[r]}if(!(n[0]instanceof t)){n[0]=new t({root:n[0]}).get("root")}this.reset.apply(this,n);try{return this.visitWithoutReset(n[0])}finally{this._visiting=false}};r.reset=function(e){};r.visitWithoutReset=function(n){if(this instanceof this.Context){return this.visitor.visitWithoutReset(n)}e.ok(n instanceof t);var r=n.value;var l=v.check(r)&&this._methodNameTable[r.type];if(l){var a=this.acquireContext(n);try{return a.invokeVisitorMethod(l)}finally{this.releaseContext(a)}}else{return f(n,this)}};function f(i,s){e.ok(i instanceof t);e.ok(s instanceof n);var r=i.value;if(p.check(r)){i.each(s.visitWithoutReset,s)}else if(!u.check(r)){}else{var f=l.getFieldNames(r);var d=f.length;var m=[];for(var a=0;a<d;++a){var o=f[a];if(!c.call(r,o)){r[o]=l.getFieldValue(r,o)}m.push(i.get(o))}for(var a=0;a<d;++a){s.visitWithoutReset(m[a])}}return i.value}r.acquireContext=function(e){if(this._reusableContextStack.length===0){return new this.Context(e)}return this._reusableContextStack.pop().reset(e)};r.releaseContext=function(n){e.ok(n instanceof this.Context);this._reusableContextStack.push(n);n.currentPath=null};r.reportChanged=function(){this._changeReported=true};r.wasChangeReported=function(){return this._changeReported};function y(l){function r(a){e.ok(this instanceof r);e.ok(this instanceof n);e.ok(a instanceof t);Object.defineProperty(this,"visitor",{value:l,writable:false,enumerable:true,configurable:false});this.currentPath=a;this.needToCallTraverse=true;Object.seal(this)}e.ok(l instanceof n);var s=r.prototype=Object.create(l);s.constructor=r;i(s,a);return r}var a=Object.create(null);a.reset=function w(n){e.ok(this instanceof this.Context);e.ok(n instanceof t);this.currentPath=n;this.needToCallTraverse=true;return this};a.invokeVisitorMethod=function _(r){e.ok(this instanceof this.Context);e.ok(this.currentPath instanceof t);var n=this.visitor[r].call(this,this.currentPath);if(n===false){this.needToCallTraverse=false}else if(n!==g){this.currentPath=this.currentPath.replace(n)[0];if(this.needToCallTraverse){this.traverse(this.currentPath)}}e.strictEqual(this.needToCallTraverse,false,"Must either call this.traverse or return false in "+r);var l=this.currentPath;return l&&l.value};a.traverse=function S(r,l){e.ok(this instanceof this.Context);e.ok(r instanceof t);e.ok(this.currentPath instanceof t);this.needToCallTraverse=false;return f(r,n.fromMethodsObject(l||this.visitor))};a.visit=function k(r,l){e.ok(this instanceof this.Context);e.ok(r instanceof t);e.ok(this.currentPath instanceof t);this.needToCallTraverse=false;return n.fromMethodsObject(l||this.visitor).visitWithoutReset(r)};a.reportChanged=function I(){this.visitor.reportChanged()};m.exports=n},{"./node-path":102,"./types":107,assert:110}],104:[function(c,p,v){var n=c("assert");var m=Object.prototype;var i=m.hasOwnProperty;var u=c("./types");var r=u.builtInTypes.array;var f=u.builtInTypes.number;var o=Array.prototype;var y=o.slice;var g=o.map;function l(r,e,t){n.ok(this instanceof l);if(e){n.ok(e instanceof l)}else{e=null;t=null}this.value=r;this.parentPath=e;this.name=t;this.__childCache=null}var e=l.prototype;function t(e){return e.__childCache||(e.__childCache=Object.create(null))}function d(n,e){var r=t(n);var a=n.getValueProperty(e);var l=r[e];if(!i.call(r,e)||l.value!==a){l=r[e]=new n.constructor(a,n,e)}return l}e.getValueProperty=function x(e){return this.value[e]};e.get=function b(l){var e=this;var t=arguments;var r=t.length;for(var n=0;n<r;++n){e=d(e,t[n])}return e};e.each=function E(l,n){var t=[];var r=this.value.length;var e=0;for(var e=0;e<r;++e){if(i.call(this.value,e)){t[e]=this.get(e)}}n=n||this;for(e=0;e<r;++e){if(i.call(t,e)){l.call(n,t[e])}}};e.map=function w(n,t){var e=[];this.each(function(t){e.push(n.call(this,t))},t);return e};e.filter=function _(n,t){var e=[];this.each(function(t){if(n.call(this,t)){e.push(t)}},t);return e};function s(){}function a(a,h,e,o){r.assert(a.value);if(h===0){return s}var u=a.value.length;if(u<1){return s}var g=arguments.length;if(g===2){e=0;o=u}else if(g===3){e=Math.max(e,0);o=u}else{e=Math.max(e,0);o=Math.min(o,u)}f.assert(e);f.assert(o);var c=Object.create(null);var p=t(a);for(var l=e;l<o;++l){if(i.call(a.value,l)){var d=a.get(l);n.strictEqual(d.name,l);var m=l+h;d.name=m;c[m]=d;delete p[l]}}delete p.length;return function(){for(var e in c){var t=c[e];n.strictEqual(t.name,+e);p[e]=t;a.value[e]=t.value}}}e.shift=function S(){var e=a(this,-1);var n=this.value.shift();e();return n};e.unshift=function k(t){var e=a(this,arguments.length);var n=this.value.unshift.apply(this.value,arguments);e();return n};e.push=function I(e){r.assert(this.value);delete t(this).length;return this.value.push.apply(this.value,arguments)};e.pop=function R(){r.assert(this.value);var e=t(this);delete e[this.value.length-1];delete e.length;return this.value.pop()};e.insertAt=function C(e,l){var t=arguments.length;var r=a(this,t-1,e);if(r===s){return this}e=Math.max(e,0);for(var n=1;n<t;++n){this.value[e+n-1]=arguments[n]}r();return this};e.insertBefore=function A(l){var n=this.parentPath;var r=arguments.length;var t=[this.name];for(var e=0;e<r;++e){t.push(arguments[e])}return n.insertAt.apply(n,t)};e.insertAfter=function T(l){var n=this.parentPath;var r=arguments.length;var t=[this.name+1];for(var e=0;e<r;++e){t.push(arguments[e])}return n.insertAt.apply(n,t)};function h(e){n.ok(e instanceof l);var i=e.parentPath;if(!i){return e}var a=i.value;var s=t(i);if(a[e.name]===e.value){s[e.name]=e}else if(r.check(a)){var o=a.indexOf(e.value);if(o>=0){s[e.name=o]=e}}else{a[e.name]=e.value;s[e.name]=e}n.strictEqual(a[e.name],e.value);n.strictEqual(e.parentPath.get(e.name),e);return e}e.replace=function L(s){var o=[];var e=this.parentPath.value;var p=t(this.parentPath);var l=arguments.length;h(this);if(r.check(e)){var c=e.length;var f=a(this.parentPath,l-1,this.name+1);var u=[this.name,1];for(var i=0;i<l;++i){u.push(arguments[i])}var d=e.splice.apply(e,u);n.strictEqual(d[0],this.value);n.strictEqual(e.length,c-1+l);f();if(l===0){delete this.value;delete p[this.name];this.__childCache=null}else{n.strictEqual(e[this.name],s);if(this.value!==s){this.value=s;this.__childCache=null}for(i=0;i<l;++i){o.push(this.parentPath.get(this.name+i))}n.strictEqual(o[0],this)}}else if(l===1){if(this.value!==s){this.__childCache=null}this.value=e[this.name]=s;o.push(this)}else if(l===0){delete e[this.name];delete this.value;this.__childCache=null}else{n.ok(false,"Could not replace path")}return o};p.exports=l},{"./types":107,assert:110}],105:[function(o,m,x){var l=o("assert");var r=o("./types");var d=r.Type;var e=r.namedTypes;var y=e.Node;var p=e.Expression;var h=r.builtInTypes.array;var c=Object.prototype.hasOwnProperty;var f=r.builders;function a(n,e){l.ok(this instanceof a);l.ok(n instanceof o("./node-path"));s.assert(n.value);var t;if(e){l.ok(e instanceof a);t=e.depth+1}else{e=null;t=0}Object.defineProperties(this,{path:{value:n},node:{value:n.value},isGlobal:{value:!e,enumerable:true},depth:{value:t},parent:{value:e},bindings:{value:{}}})}var g=[e.Program,e.Function,e.CatchClause];var s=d.or.apply(d,g);a.isEstablishedBy=function(e){return s.check(e)};var t=a.prototype;t.didScan=false;t.declares=function(e){this.scan();return c.call(this.bindings,e)};t.declareTemporary=function(e){if(e){l.ok(/^[a-z$_]/i.test(e),e)}else{e="t$"}e+=this.depth.toString(36)+"$";this.scan();var n=0;while(this.declares(e+n)){++n}var t=e+n;return this.bindings[t]=r.builders.identifier(t)};t.injectTemporary=function(n,r){n||(n=this.declareTemporary());var t=this.path.get("body");if(e.BlockStatement.check(t.value)){t=t.get("body")}t.unshift(f.variableDeclaration("var",[f.variableDeclarator(n,r||null)]));return n};t.scan=function(e){if(e||!this.didScan){for(var n in this.bindings){delete this.bindings[n]}v(this.path,this.bindings);this.didScan=true}};t.getBindings=function(){this.scan();return this.bindings};function v(t,r){var l=t.value;s.assert(l);if(e.CatchClause.check(l)){n(t.get("param"),r)}else{u(t,r)}}function u(t,s){var a=t.value;if(t.parent&&e.FunctionExpression.check(t.parent.node)&&t.parent.node.id){n(t.parent.get("id"),s)}if(!a){}else if(h.check(a)){t.each(function(e){i(e,s)})}else if(e.Function.check(a)){t.get("params").each(function(e){n(e,s)});i(t.get("body"),s)}else if(e.VariableDeclarator.check(a)){n(t.get("id"),s);i(t.get("init"),s)}else if(a.type==="ImportSpecifier"||a.type==="ImportNamespaceSpecifier"||a.type==="ImportDefaultSpecifier"){n(a.name?t.get("name"):t.get("id"),s)}else if(y.check(a)&&!p.check(a)){r.eachField(a,function(n,r){var e=t.get(n);l.strictEqual(e.value,r);i(e,s)})}}function i(l,r){var t=l.value;if(!t||p.check(t)){}else if(e.FunctionDeclaration.check(t)){n(l.get("id"),r)}else if(e.ClassDeclaration&&e.ClassDeclaration.check(t)){n(l.get("id"),r)}else if(s.check(t)){if(e.CatchClause.check(t)){var a=t.param.name;var i=c.call(r,a);u(l.get("body"),r);if(!i){delete r[a]}}}else{u(l,r)}}function n(r,l){var t=r.value;e.Pattern.assert(t);if(e.Identifier.check(t)){if(c.call(l,t.name)){l[t.name].push(r)}else{l[t.name]=[r]}}else if(e.SpreadElement&&e.SpreadElement.check(t)){n(r.get("argument"),l)}}t.lookup=function(n){for(var e=this;e;e=e.parent)if(e.declares(n))break;return e};t.getGlobalScope=function(){var e=this;while(!e.isGlobal)e=e.parent;return e};m.exports=a},{"./node-path":102,"./types":107,assert:110}],106:[function(a,s,n){var r=a("../lib/types");var t=r.Type;var e=r.builtInTypes;var l=e.number;n.geq=function(e){return new t(function(n){return l.check(n)&&n>=e},l+" >= "+e)};n.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return false},"true":function(){return true},undefined:function(){}};var i=t.or(e.string,e.number,e.boolean,e.null,e.undefined);n.isPrimitive=new t(function(e){if(e===null)return true;var n=typeof e;return!(n==="object"||n==="function")},i.toString())},{"../lib/types":107}],107:[function(T,N,r){var e=T("assert");var E=Array.prototype;var A=E.slice;var F=E.map;var O=E.forEach;var k=Object.prototype;var o=k.toString;var v=o.call(function(){});var P=o.call("");var l=k.hasOwnProperty;function n(r,l){var t=this;e.ok(t instanceof n,t);e.strictEqual(o.call(r),v,r+" is not a function");var a=o.call(l);e.ok(a===v||a===P,l+" is neither a function nor a string");Object.defineProperties(t,{name:{value:l},check:{value:function(n,e){var l=r.call(t,n,e);if(!l&&e&&o.call(e)===v)e(t,n);return l}}})}var w=n.prototype;r.Type=n;w.assert=function(n,t){if(!this.check(n,t)){var r=h(n);e.ok(false,r+" does not match type "+this);return false}return true};function h(e){if(u.check(e))return"{"+Object.keys(e).map(function(n){return n+": "+e[n]}).join(", ")+"}";if(p.check(e))return"["+e.map(h).join(", ")+"]";return JSON.stringify(e)}w.toString=function(){var e=this.name;if(c.check(e))return e;if(f.check(e))return e.call(this)+"";return e+" type"};var g={};r.builtInTypes=g;function a(t,e){var r=o.call(t);Object.defineProperty(g,e,{enumerable:true,value:new n(function(e){return o.call(e)===r},e)});return g[e]}var c=a("","string");var f=a(function(){},"function");var p=a([],"array");var u=a({},"object");var B=a(/./,"RegExp");var U=a(new Date,"Date");var L=a(3,"number");var V=a(true,"boolean");var D=a(null,"null");var S=a(void 0,"undefined");function _(e,t){if(e instanceof n)return e;if(e instanceof s)return e.type;if(p.check(e))return n.fromArray(e);if(u.check(e))return n.fromObject(e);if(f.check(e))return new n(e,t);return new n(function(n){return n===e},S.check(t)?function(){return e+""}:t)}n.or=function(){var e=[];var r=arguments.length;for(var t=0;t<r;++t)e.push(_(arguments[t]));return new n(function(t,l){for(var n=0;n<r;++n)if(e[n].check(t,l))return true;return false},function(){return e.join(" | ")})};n.fromArray=function(n){e.ok(p.check(n));e.strictEqual(n.length,1,"only one element type is permitted for typed arrays");return _(n[0]).arrayOf()};w.arrayOf=function(){var e=this;return new n(function(n,t){return p.check(n)&&n.every(function(n){return e.check(n,t)})},function(){return"["+e+"]"})};n.fromObject=function(e){var t=Object.keys(e).map(function(n){return new m(n,e[n])});return new n(function(e,n){return u.check(e)&&t.every(function(t){return t.type.check(e[t.name],n)})},function(){return"{ "+t.join(", ")+" }"})};function m(t,n,r,i){var l=this;e.ok(l instanceof m);c.assert(t);n=_(n);var a={name:{value:t},type:{value:n},hidden:{value:!!i}};if(f.check(r)){a.defaultFn={value:r}}Object.defineProperties(l,a)}var I=m.prototype;I.toString=function(){return JSON.stringify(this.name)+": "+this.type};I.getValue=function(n){var e=n[this.name];if(!S.check(e))return e;if(this.defaultFn)e=this.defaultFn.call(n);return e};n.def=function(e){c.assert(e);return l.call(t,e)?t[e]:t[e]=new s(e)};var t=Object.create(null);function s(r){var t=this;e.ok(t instanceof s);Object.defineProperties(t,{typeName:{value:r},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new n(function(e,n){return t.check(e,n)},r)}})}s.fromValue=function(e){if(e&&typeof e==="object"){var n=e.type;if(typeof n==="string"&&l.call(t,n)){var r=t[n];if(r.finalized){return r}}}return null};var i=s.prototype;i.isSupertypeOf=function(n){if(n instanceof s){e.strictEqual(this.finalized,true);e.strictEqual(n.finalized,true);return l.call(n.allSupertypes,this.typeName)}else{e.ok(false,n+" is not a Def")}};r.getSupertypeNames=function(n){e.ok(l.call(t,n));var r=t[n];e.strictEqual(r.finalized,true);return r.supertypeList.slice(1)};r.computeSupertypeLookupTable=function(c){var i={};var s=Object.keys(t);var f=s.length;for(var n=0;n<f;++n){var o=s[n];var r=t[o];e.strictEqual(r.finalized,true);for(var a=0;a<r.supertypeList.length;++a){var u=r.supertypeList[a];if(l.call(c,u)){i[o]=u;break}}}return i};i.checkAllFields=function(n,r){var t=this.allFields;e.strictEqual(this.finalized,true);function l(l){var e=t[l];var a=e.type;var i=e.getValue(n);return a.check(i,r)}return u.check(n)&&Object.keys(t).every(l)};i.check=function(n,t){e.strictEqual(this.finalized,true,"prematurely checking unfinalized type "+this.typeName);if(!u.check(n))return false;var r=s.fromValue(n);if(!r){if(this.typeName==="SourceLocation"||this.typeName==="Position"){return this.checkAllFields(n,t)}return false}if(t&&r===this)return this.checkAllFields(n,t);if(!this.isSupertypeOf(r))return false;if(!t)return true;return r.checkAllFields(n,t)&&this.checkAllFields(n,false)};i.bases=function(){var n=this.baseNames;e.strictEqual(this.finalized,false);O.call(arguments,function(e){c.assert(e);if(n.indexOf(e)<0)n.push(e)});return this};Object.defineProperty(i,"buildable",{value:false});var C={};r.builders=C;var d={};r.defineMethod=function(e,n){var t=d[e];if(S.check(n)){delete d[e]}else{f.assert(n);Object.defineProperty(d,e,{enumerable:true,configurable:true,value:n})}return t};i.build=function(){var n=this;Object.defineProperty(n,"buildParams",{value:A.call(arguments),writable:false,enumerable:false,configurable:true});e.strictEqual(n.finalized,false);c.arrayOf().assert(n.buildParams);if(n.buildable){return n}n.field("type",n.typeName,function(){return n.typeName});Object.defineProperty(n,"buildable",{value:true});Object.defineProperty(C,j(n.typeName),{enumerable:true,value:function(){var r=arguments;var i=r.length;var t=Object.create(d);e.ok(n.finalized,"attempting to instantiate unfinalized type "+n.typeName);function a(a,u){if(l.call(t,a))return;var c=n.allFields;e.ok(l.call(c,a),a);var o=c[a];var f=o.type;var s;if(L.check(u)&&u<i){s=r[u]}else if(o.defaultFn){s=o.defaultFn.call(t)}else{var p="no value or default function given for field "+JSON.stringify(a)+" of "+n.typeName+"("+n.buildParams.map(function(e){return c[e]}).join(", ")+")";e.ok(false,p)}if(!f.check(s)){e.ok(false,h(s)+" does not match field "+o+" of type "+n.typeName)}t[a]=s}n.buildParams.forEach(function(e,n){a(e,n)});Object.keys(n.allFields).forEach(function(e){a(e)});e.strictEqual(t.type,n.typeName);return t}});return n};function j(e){return e.replace(/^[A-Z]+/,function(e){var n=e.length;switch(n){case 0:return"";case 1:return e.toLowerCase();default:return e.slice(0,n-1).toLowerCase()+e.charAt(n-1)}})}i.field=function(n,t,r,l){e.strictEqual(this.finalized,false);this.ownFields[n]=new m(n,t,r,l);return this};var R={};r.namedTypes=R;function x(n){var t=s.fromValue(n);if(t){return t.fieldNames.slice(0)}if("type"in n){e.ok(false,"did not recognize object of type "+JSON.stringify(n.type))}return Object.keys(n)}r.getFieldNames=x;function y(e,n){var t=s.fromValue(e);if(t){var r=t.allFields[n];if(r){return r.getValue(e)}}return e[n]}r.getFieldValue=y;r.eachField=function(e,n,t){x(e).forEach(function(t){n.call(this,t,y(e,t))},t)};r.someField=function(e,n,t){return x(e).some(function(t){return n.call(this,t,y(e,t))},t)};Object.defineProperty(i,"finalized",{value:false});i.finalize=function(){if(!this.finalized){var e=this.allFields;var r=this.allSupertypes;this.baseNames.forEach(function(l){var n=t[l];n.finalize();b(e,n.allFields);b(r,n.allSupertypes)});b(e,this.ownFields);r[this.typeName]=this;this.fieldNames.length=0;for(var n in e){if(l.call(e,n)&&!e[n].hidden){this.fieldNames.push(n)}}Object.defineProperty(R,this.typeName,{enumerable:true,value:this.type});Object.defineProperty(this,"finalized",{value:true});M(this.typeName,this.supertypeList)}};function M(r,n){n.length=0;n.push(r);var s=Object.create(null);for(var a=0;a<n.length;++a){r=n[a];var u=t[r];e.strictEqual(u.finalized,true);if(l.call(s,r)){delete n[s[r]]}s[r]=a;n.push.apply(n,u.baseNames)}for(var o=0,i=o,c=n.length;i<c;++i){if(l.call(n,i)){n[o++]=n[i]}}n.length=o}function b(e,n){Object.keys(n).forEach(function(t){e[t]=n[t]});return e}r.finalize=function(){Object.keys(t).forEach(function(e){t[e].finalize()})}},{assert:110}],108:[function(t,r,e){var n=t("./lib/types");t("./def/core");t("./def/es6");t("./def/es7");t("./def/mozilla");t("./def/e4x");t("./def/fb-harmony");n.finalize();e.Type=n.Type;e.builtInTypes=n.builtInTypes;e.namedTypes=n.namedTypes;e.builders=n.builders;e.defineMethod=n.defineMethod;e.getFieldNames=n.getFieldNames;e.getFieldValue=n.getFieldValue;e.eachField=n.eachField;e.someField=n.someField;e.getSupertypeNames=n.getSupertypeNames;e.astNodesAreEquivalent=t("./lib/equiv");e.finalize=n.finalize;e.NodePath=t("./lib/node-path");e.PathVisitor=t("./lib/path-visitor");e.visit=e.PathVisitor.visit},{"./def/core":95,"./def/e4x":96,"./def/es6":97,"./def/es7":98,"./def/fb-harmony":99,"./def/mozilla":100,"./lib/equiv":101,"./lib/node-path":102,"./lib/path-visitor":103,"./lib/types":107}],109:[function(e,n,t){},{}],110:[function(h,p,y){var n=h("util/");var r=Array.prototype.slice;var d=Object.prototype.hasOwnProperty;var e=p.exports=o;e.AssertionError=function v(e){this.name="AssertionError";this.actual=e.actual;this.expected=e.expected;this.operator=e.operator;if(e.message){this.message=e.message;this.generatedMessage=false}else{this.message=g(this);this.generatedMessage=true}var r=e.stackStartFunction||t;if(Error.captureStackTrace){Error.captureStackTrace(this,r)}else{var l=new Error;if(l.stack){var n=l.stack;var i=r.name;var a=n.indexOf("\n"+i);if(a>=0){var s=n.indexOf("\n",a+1);n=n.substring(s+1)}this.stack=n}}};n.inherits(e.AssertionError,Error);function u(t,e){if(n.isUndefined(e)){return""+e}if(n.isNumber(e)&&!isFinite(e)){return e.toString()}if(n.isFunction(e)||n.isRegExp(e)){return e.toString()}return e
}function a(e,t){if(n.isString(e)){return e.length<t?e:e.slice(0,t)}else{return e}}function g(e){return a(JSON.stringify(e.actual,u),128)+" "+e.operator+" "+a(JSON.stringify(e.expected,u),128)}function t(n,t,r,l,a){throw new e.AssertionError({message:r,actual:n,expected:t,operator:l,stackStartFunction:a})}e.fail=t;function o(n,r){if(!n)t(n,true,r,"==",e.ok)}e.ok=o;e.equal=function x(n,r,l){if(n!=r)t(n,r,l,"==",e.equal)};e.notEqual=function b(n,r,l){if(n==r){t(n,r,l,"!=",e.notEqual)}};e.deepEqual=function E(n,r,a){if(!l(n,r)){t(n,r,a,"deepEqual",e.deepEqual)}};function l(e,t){if(e===t){return true}else if(n.isBuffer(e)&&n.isBuffer(t)){if(e.length!=t.length)return false;for(var r=0;r<e.length;r++){if(e[r]!==t[r])return false}return true}else if(n.isDate(e)&&n.isDate(t)){return e.getTime()===t.getTime()}else if(n.isRegExp(e)&&n.isRegExp(t)){return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase}else if(!n.isObject(e)&&!n.isObject(t)){return e==t}else{return m(e,t)}}function c(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function m(e,t){if(n.isNullOrUndefined(e)||n.isNullOrUndefined(t))return false;if(e.prototype!==t.prototype)return false;if(n.isPrimitive(e)||n.isPrimitive(t)){return e===t}var o=c(e),p=c(t);if(o&&!p||!o&&p)return false;if(o){e=r.call(e);t=r.call(t);return l(e,t)}var i=s(e),u=s(t),f,a;if(i.length!=u.length)return false;i.sort();u.sort();for(a=i.length-1;a>=0;a--){if(i[a]!=u[a])return false}for(a=i.length-1;a>=0;a--){f=i[a];if(!l(e[f],t[f]))return false}return true}e.notDeepEqual=function w(n,r,a){if(l(n,r)){t(n,r,a,"notDeepEqual",e.notDeepEqual)}};e.strictEqual=function _(n,r,l){if(n!==r){t(n,r,l,"===",e.strictEqual)}};e.notStrictEqual=function S(n,r,l){if(n===r){t(n,r,l,"!==",e.notStrictEqual)}};function f(n,e){if(!n||!e){return false}if(Object.prototype.toString.call(e)=="[object RegExp]"){return e.test(n)}else if(n instanceof e){return true}else if(e.call({},n)===true){return true}return false}function i(a,i,e,l){var r;if(n.isString(e)){l=e;e=null}try{i()}catch(s){r=s}l=(e&&e.name?" ("+e.name+").":".")+(l?" "+l:".");if(a&&!r){t(r,e,"Missing expected exception"+l)}if(!a&&f(r,e)){t(r,e,"Got unwanted exception"+l)}if(a&&r&&e&&!f(r,e)||!a&&r){throw r}}e.throws=function(e,n,t){i.apply(this,[true].concat(r.call(arguments)))};e.doesNotThrow=function(e,n){i.apply(this,[false].concat(r.call(arguments)))};e.ifError=function(e){if(e){throw e}};var s=Object.keys||function(e){var n=[];for(var t in e){if(d.call(e,t))n.push(t)}return n}},{"util/":134}],111:[function(c,U,i){var u=c("base64-js");var l=c("ieee754");var f=c("is-array");i.Buffer=e;i.SlowBuffer=d;i.INSPECT_MAX_BYTES=50;e.poolSize=8192;var v=1073741823;var L={};e.TYPED_ARRAY_SUPPORT=function(){try{var n=new ArrayBuffer(0);var e=new Uint8Array(n);e.foo=function(){return 42};return 42===e.foo()&&typeof e.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(t){return false}}();function e(n,i,s){if(!(this instanceof e))return new e(n,i,s);var a=typeof n;var r;if(a==="number")r=n>0?n>>>0:0;else if(a==="string"){r=e.byteLength(n,i)}else if(a==="object"&&n!==null){if(n.type==="Buffer"&&f(n.data))n=n.data;r=+n.length>0?Math.floor(+n.length):0}else throw new TypeError("must start with number, buffer, array or string");if(r>v)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+v.toString(16)+" bytes");var l;if(e.TYPED_ARRAY_SUPPORT){l=e._augment(new Uint8Array(r))}else{l=this;l.length=r;l._isBuffer=true}var t;if(e.TYPED_ARRAY_SUPPORT&&typeof n.byteLength==="number"){l._set(n)}else if(j(n)){if(e.isBuffer(n)){for(t=0;t<r;t++)l[t]=n.readUInt8(t)}else{for(t=0;t<r;t++)l[t]=(n[t]%256+256)%256}}else if(a==="string"){l.write(n,0,i)}else if(a==="number"&&!e.TYPED_ARRAY_SUPPORT&&!s){for(t=0;t<r;t++){l[t]=0}}if(r>0&&r<=e.poolSize)l.parent=L;return l}function d(n,t,r){if(!(this instanceof d))return new d(n,t,r);var l=new e(n,t,r);delete l.parent;return l}e.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};e.compare=function(t,r){if(!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError("Arguments must be Buffers");var l=t.length;var a=r.length;for(var n=0,i=Math.min(l,a);n<i&&t[n]===r[n];n++){}if(n!==i){l=t[n];a=r[n]}if(l<a)return-1;if(a<l)return 1;return 0};e.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};e.concat=function(n,r){if(!f(n))throw new TypeError("Usage: Buffer.concat(list[, length])");if(n.length===0){return new e(0)}else if(n.length===1){return n[0]}var t;if(r===undefined){r=0;for(t=0;t<n.length;t++){r+=n[t].length}}var l=new e(r);var a=0;for(t=0;t<n.length;t++){var i=n[t];i.copy(l,a);a+=i.length}return l};e.byteLength=function(e,t){var n;e=e+"";switch(t||"utf8"){case"ascii":case"binary":case"raw":n=e.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=e.length*2;break;case"hex":n=e.length>>>1;break;case"utf8":case"utf-8":n=p(e).length;break;case"base64":n=y(e).length;break;default:n=e.length}return n};e.prototype.length=undefined;e.prototype.parent=undefined;e.prototype.toString=function(t,n,e){var r=false;n=n>>>0;e=e===undefined||e===Infinity?this.length:e>>>0;if(!t)t="utf8";if(n<0)n=0;if(e>this.length)e=this.length;if(e<=n)return"";while(true){switch(t){case"hex":return B(this,n,e);case"utf8":case"utf-8":return k(this,n,e);case"ascii":return S(this,n,e);case"binary":return _(this,n,e);case"base64":return I(this,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,n,e);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();r=true}}};e.prototype.equals=function(n){if(!e.isBuffer(n))throw new TypeError("Argument must be a Buffer");return e.compare(this,n)===0};e.prototype.inspect=function(){var e="";var n=i.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,n).match(/.{2}/g).join(" ");if(this.length>n)e+=" ... "}return"<Buffer "+e+">"};e.prototype.compare=function(n){if(!e.isBuffer(n))throw new TypeError("Argument must be a Buffer");return e.compare(this,n)};e.prototype.get=function(e){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(e)};e.prototype.set=function(e,n){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(e,n)};function F(a,i,t,e){t=Number(t)||0;var r=a.length-t;if(!e){e=r}else{e=Number(e);if(e>r){e=r}}var l=i.length;if(l%2!==0)throw new Error("Invalid hex string");if(e>l/2){e=l/2}for(var n=0;n<e;n++){var s=parseInt(i.substr(n*2,2),16);if(isNaN(s))throw new Error("Invalid hex string");a[t+n]=s}return n}function O(e,t,n,r){var l=a(p(t,e.length-n),e,n,r);return l}function x(e,n,t,r){var l=a(D(n),e,t,r);return l}function A(e,n,t,r){return x(e,n,t,r)}function C(e,n,t,r){var l=a(y(n),e,t,r);return l}function R(e,t,n,r){var l=a(N(t,e.length-n),e,n,r,2);return l}e.prototype.write=function(l,n,e,t){if(isFinite(n)){if(!isFinite(e)){t=e;e=undefined}}else{var i=t;t=n;n=e;e=i}n=Number(n)||0;if(e<0||n<0||n>this.length)throw new RangeError("attempt to write outside buffer bounds");var a=this.length-n;if(!e){e=a}else{e=Number(e);if(e>a){e=a}}t=String(t||"utf8").toLowerCase();var r;switch(t){case"hex":r=F(this,l,n,e);break;case"utf8":case"utf-8":r=O(this,l,n,e);break;case"ascii":r=x(this,l,n,e);break;case"binary":r=A(this,l,n,e);break;case"base64":r=C(this,l,n,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=R(this,l,n,e);break;default:throw new TypeError("Unknown encoding: "+t)}return r};e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,n,t){if(n===0&&t===e.length){return u.fromByteArray(e)}else{return u.fromByteArray(e.slice(n,t))}}function k(n,a,r){var l="";var t="";r=Math.min(n.length,r);for(var e=a;e<r;e++){if(n[e]<=127){l+=b(t)+String.fromCharCode(n[e]);t=""}else{t+="%"+n[e].toString(16)}}return l+b(t)}function S(t,l,e){var r="";e=Math.min(t.length,e);for(var n=l;n<e;n++){r+=String.fromCharCode(t[n]&127)}return r}function _(t,l,e){var r="";e=Math.min(t.length,e);for(var n=l;n<e;n++){r+=String.fromCharCode(t[n])}return r}function B(r,n,e){var l=r.length;if(!n||n<0)n=0;if(!e||e<0||e>l)e=l;var a="";for(var t=n;t<e;t++){a+=M(r[t])}return a}function w(r,l,a){var n=r.slice(l,a);var t="";for(var e=0;e<n.length;e+=2){t+=String.fromCharCode(n[e]+n[e+1]*256)}return t}e.prototype.slice=function(n,t){var r=this.length;n=~~n;t=t===undefined?r:~~t;if(n<0){n+=r;if(n<0)n=0}else if(n>r){n=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(t<n)t=n;var l;if(e.TYPED_ARRAY_SUPPORT){l=e._augment(this.subarray(n,t))}else{var i=t-n;l=new e(i,undefined,true);for(var a=0;a<i;a++){l[a]=this[a+n]}}if(l.length)l.parent=this.parent||this;return l};function t(e,n,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+n>t)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUIntLE=function(e,n,i){e=e>>>0;n=n>>>0;if(!i)t(e,n,this.length);var r=this[e];var l=1;var a=0;while(++a<n&&(l*=256))r+=this[e+a]*l;return r};e.prototype.readUIntBE=function(n,e,a){n=n>>>0;e=e>>>0;if(!a)t(n,e,this.length);var r=this[n+--e];var l=1;while(e>0&&(l*=256))r+=this[n+--e]*l;return r};e.prototype.readUInt8=function(e,n){if(!n)t(e,1,this.length);return this[e]};e.prototype.readUInt16LE=function(e,n){if(!n)t(e,2,this.length);return this[e]|this[e+1]<<8};e.prototype.readUInt16BE=function(e,n){if(!n)t(e,2,this.length);return this[e]<<8|this[e+1]};e.prototype.readUInt32LE=function(e,n){if(!n)t(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};e.prototype.readUInt32BE=function(e,n){if(!n)t(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};e.prototype.readIntLE=function(e,n,i){e=e>>>0;n=n>>>0;if(!i)t(e,n,this.length);var r=this[e];var l=1;var a=0;while(++a<n&&(l*=256))r+=this[e+a]*l;l*=128;if(r>=l)r-=Math.pow(2,8*n);return r};e.prototype.readIntBE=function(e,n,i){e=e>>>0;n=n>>>0;if(!i)t(e,n,this.length);var a=n;var r=1;var l=this[e+--a];while(a>0&&(r*=256))l+=this[e+--a]*r;r*=128;if(l>=r)l-=Math.pow(2,8*n);return l};e.prototype.readInt8=function(e,n){if(!n)t(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};e.prototype.readInt16LE=function(e,r){if(!r)t(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};e.prototype.readInt16BE=function(e,r){if(!r)t(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};e.prototype.readInt32LE=function(e,n){if(!n)t(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};e.prototype.readInt32BE=function(e,n){if(!n)t(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};e.prototype.readFloatLE=function(e,n){if(!n)t(e,4,this.length);return l.read(this,e,true,23,4)};e.prototype.readFloatBE=function(e,n){if(!n)t(e,4,this.length);return l.read(this,e,false,23,4)};e.prototype.readDoubleLE=function(e,n){if(!n)t(e,8,this.length);return l.read(this,e,true,52,8)};e.prototype.readDoubleBE=function(e,n){if(!n)t(e,8,this.length);return l.read(this,e,false,52,8)};function r(n,t,r,l,a,i){if(!e.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");if(t>a||t<i)throw new RangeError("value is out of bounds");if(r+l>n.length)throw new RangeError("index out of range")}e.prototype.writeUIntLE=function(t,e,n,i){t=+t;e=e>>>0;n=n>>>0;if(!i)r(this,t,e,n,Math.pow(2,8*n),0);var l=1;var a=0;this[e]=t&255;while(++a<n&&(l*=256))this[e+a]=t/l>>>0&255;return e+n};e.prototype.writeUIntBE=function(t,e,n,i){t=+t;e=e>>>0;n=n>>>0;if(!i)r(this,t,e,n,Math.pow(2,8*n),0);var l=n-1;var a=1;this[e+l]=t&255;while(--l>=0&&(a*=256))this[e+l]=t/a>>>0&255;return e+n};e.prototype.writeUInt8=function(n,t,l){n=+n;t=t>>>0;if(!l)r(this,n,t,1,255,0);if(!e.TYPED_ARRAY_SUPPORT)n=Math.floor(n);this[t]=n;return t+1};function o(t,n,r,l){if(n<0)n=65535+n+1;for(var e=0,a=Math.min(t.length-r,2);e<a;e++){t[r+e]=(n&255<<8*(l?e:1-e))>>>(l?e:1-e)*8}}e.prototype.writeUInt16LE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,2,65535,0);if(e.TYPED_ARRAY_SUPPORT){this[n]=t;this[n+1]=t>>>8}else o(this,t,n,true);return n+2};e.prototype.writeUInt16BE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,2,65535,0);if(e.TYPED_ARRAY_SUPPORT){this[n]=t>>>8;this[n+1]=t}else o(this,t,n,false);return n+2};function s(t,n,r,l){if(n<0)n=4294967295+n+1;for(var e=0,a=Math.min(t.length-r,4);e<a;e++){t[r+e]=n>>>(l?e:3-e)*8&255}}e.prototype.writeUInt32LE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,4,4294967295,0);if(e.TYPED_ARRAY_SUPPORT){this[n+3]=t>>>24;this[n+2]=t>>>16;this[n+1]=t>>>8;this[n]=t}else s(this,t,n,true);return n+4};e.prototype.writeUInt32BE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,4,4294967295,0);if(e.TYPED_ARRAY_SUPPORT){this[n]=t>>>24;this[n+1]=t>>>16;this[n+2]=t>>>8;this[n+3]=t}else s(this,t,n,false);return n+4};e.prototype.writeIntLE=function(e,n,t,i){e=+e;n=n>>>0;if(!i){r(this,e,n,t,Math.pow(2,8*t-1)-1,-Math.pow(2,8*t-1))}var l=0;var a=1;var s=e<0?1:0;this[n]=e&255;while(++l<t&&(a*=256))this[n+l]=(e/a>>0)-s&255;return n+t};e.prototype.writeIntBE=function(e,n,t,i){e=+e;n=n>>>0;if(!i){r(this,e,n,t,Math.pow(2,8*t-1)-1,-Math.pow(2,8*t-1))}var l=t-1;var a=1;var s=e<0?1:0;this[n+l]=e&255;while(--l>=0&&(a*=256))this[n+l]=(e/a>>0)-s&255;return n+t};e.prototype.writeInt8=function(n,t,l){n=+n;t=t>>>0;if(!l)r(this,n,t,1,127,-128);if(!e.TYPED_ARRAY_SUPPORT)n=Math.floor(n);if(n<0)n=255+n+1;this[t]=n;return t+1};e.prototype.writeInt16LE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,2,32767,-32768);if(e.TYPED_ARRAY_SUPPORT){this[n]=t;this[n+1]=t>>>8}else o(this,t,n,true);return n+2};e.prototype.writeInt16BE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,2,32767,-32768);if(e.TYPED_ARRAY_SUPPORT){this[n]=t>>>8;this[n+1]=t}else o(this,t,n,false);return n+2};e.prototype.writeInt32LE=function(t,n,l){t=+t;n=n>>>0;if(!l)r(this,t,n,4,2147483647,-2147483648);if(e.TYPED_ARRAY_SUPPORT){this[n]=t;this[n+1]=t>>>8;this[n+2]=t>>>16;this[n+3]=t>>>24}else s(this,t,n,true);return n+4};e.prototype.writeInt32BE=function(n,t,l){n=+n;t=t>>>0;if(!l)r(this,n,t,4,2147483647,-2147483648);if(n<0)n=4294967295+n+1;if(e.TYPED_ARRAY_SUPPORT){this[t]=n>>>24;this[t+1]=n>>>16;this[t+2]=n>>>8;this[t+3]=n}else s(this,n,t,false);return t+4};function g(t,e,n,r,l,a){if(e>l||e<a)throw new RangeError("value is out of bounds");if(n+r>t.length)throw new RangeError("index out of range");if(n<0)throw new RangeError("index out of range")}function h(n,t,e,r,a){if(!a)g(n,t,e,4,3.4028234663852886e38,-3.4028234663852886e38);l.write(n,t,e,r,23,4);return e+4}e.prototype.writeFloatLE=function(e,n,t){return h(this,e,n,true,t)};e.prototype.writeFloatBE=function(e,n,t){return h(this,e,n,false,t)};function m(n,t,e,r,a){if(!a)g(n,t,e,8,1.7976931348623157e308,-1.7976931348623157e308);l.write(n,t,e,r,52,8);return e+8}e.prototype.writeDoubleLE=function(e,n,t){return m(this,e,n,true,t)};e.prototype.writeDoubleBE=function(e,n,t){return m(this,e,n,false,t)};e.prototype.copy=function(l,r,n,t){var s=this;if(!n)n=0;if(!t&&t!==0)t=this.length;if(r>=l.length)r=l.length;if(!r)r=0;if(t>0&&t<n)t=n;if(t===n)return 0;if(l.length===0||s.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=s.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");if(t>this.length)t=this.length;if(l.length-r<t-n)t=l.length-r+n;var a=t-n;if(a<1e3||!e.TYPED_ARRAY_SUPPORT){for(var i=0;i<a;i++){l[i+r]=this[i+n]}}else{l._set(this.subarray(n,n+a),r)}return a};e.prototype.fill=function(r,n,t){if(!r)r=0;if(!n)n=0;if(!t)t=this.length;if(t<n)throw new RangeError("end < start");if(t===n)return;if(this.length===0)return;if(n<0||n>=this.length)throw new RangeError("start out of bounds");if(t<0||t>this.length)throw new RangeError("end out of bounds");var e;if(typeof r==="number"){for(e=n;e<t;e++){this[e]=r}}else{var l=p(r.toString());var a=l.length;for(e=n;e<t;e++){this[e]=l[e%a]}}return this};e.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(e.TYPED_ARRAY_SUPPORT){return new e(this).buffer}else{var t=new Uint8Array(this.length);for(var n=0,r=t.length;n<r;n+=1){t[n]=this[n]}return t.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var n=e.prototype;e._augment=function(t){t.constructor=e;t._isBuffer=true;t._get=t.get;t._set=t.set;t.get=n.get;t.set=n.set;t.write=n.write;t.toString=n.toString;t.toLocaleString=n.toString;t.toJSON=n.toJSON;t.equals=n.equals;t.compare=n.compare;t.copy=n.copy;t.slice=n.slice;t.readUIntLE=n.readUIntLE;t.readUIntBE=n.readUIntBE;t.readUInt8=n.readUInt8;t.readUInt16LE=n.readUInt16LE;t.readUInt16BE=n.readUInt16BE;t.readUInt32LE=n.readUInt32LE;t.readUInt32BE=n.readUInt32BE;t.readIntLE=n.readIntLE;t.readIntBE=n.readIntBE;t.readInt8=n.readInt8;t.readInt16LE=n.readInt16LE;t.readInt16BE=n.readInt16BE;t.readInt32LE=n.readInt32LE;t.readInt32BE=n.readInt32BE;t.readFloatLE=n.readFloatLE;t.readFloatBE=n.readFloatBE;t.readDoubleLE=n.readDoubleLE;t.readDoubleBE=n.readDoubleBE;t.writeUInt8=n.writeUInt8;t.writeUIntLE=n.writeUIntLE;t.writeUIntBE=n.writeUIntBE;t.writeUInt16LE=n.writeUInt16LE;t.writeUInt16BE=n.writeUInt16BE;t.writeUInt32LE=n.writeUInt32LE;t.writeUInt32BE=n.writeUInt32BE;t.writeIntLE=n.writeIntLE;t.writeIntBE=n.writeIntBE;t.writeInt8=n.writeInt8;t.writeInt16LE=n.writeInt16LE;t.writeInt16BE=n.writeInt16BE;t.writeInt32LE=n.writeInt32LE;t.writeInt32BE=n.writeInt32BE;t.writeFloatLE=n.writeFloatLE;t.writeFloatBE=n.writeFloatBE;t.writeDoubleLE=n.writeDoubleLE;t.writeDoubleBE=n.writeDoubleBE;t.fill=n.fill;t.inspect=n.inspect;t.toArrayBuffer=n.toArrayBuffer;return t};var T=/[^+\/0-9A-z\-]/g;function E(e){e=P(e).replace(T,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function P(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function j(n){return f(n)||e.isBuffer(n)||n&&typeof n==="object"&&typeof n.length==="number"}function M(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function p(a,n){var e,i=a.length;var r=null;n=n||Infinity;var t=[];var l=0;for(;l<i;l++){e=a.charCodeAt(l);if(e>55295&&e<57344){if(r){if(e<56320){if((n-=3)>-1)t.push(239,191,189);r=e;continue}else{e=r-55296<<10|e-56320|65536;r=null}}else{if(e>56319){if((n-=3)>-1)t.push(239,191,189);continue}else if(l+1===i){if((n-=3)>-1)t.push(239,191,189);continue}else{r=e;continue}}}else if(r){if((n-=3)>-1)t.push(239,191,189);r=null}if(e<128){if((n-=1)<0)break;t.push(e)}else if(e<2048){if((n-=2)<0)break;t.push(e>>6|192,e&63|128)}else if(e<65536){if((n-=3)<0)break;t.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<2097152){if((n-=4)<0)break;t.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else{throw new Error("Invalid code point")}}return t}function D(n){var t=[];for(var e=0;e<n.length;e++){t.push(n.charCodeAt(e)&255)}return t}function N(r,i){var e,l,a;var n=[];for(var t=0;t<r.length;t++){if((i-=2)<0)break;e=r.charCodeAt(t);l=e>>8;a=e%256;n.push(a);n.push(l)}return n}function y(e){return u.toByteArray(E(e))}function a(t,r,l,n,a){if(a)n-=n%a;for(var e=0;e<n;e++){if(e+l>=r.length||e>=t.length)break;r[e+l]=t[e]}return e}function b(e){try{return decodeURIComponent(e)}catch(n){return String.fromCharCode(65533)}}},{"base64-js":112,ieee754:113,"is-array":114}],112:[function(t,r,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(a){"use strict";var s=typeof Uint8Array!=="undefined"?Uint8Array:Array;var c="+".charCodeAt(0);var i="/".charCodeAt(0);var t="0".charCodeAt(0);var l="a".charCodeAt(0);var r="A".charCodeAt(0);var o="-".charCodeAt(0);var u="_".charCodeAt(0);function e(n){var e=n.charCodeAt(0);if(e===c||e===o)return 62;if(e===i||e===u)return 63;if(e<t)return-1;if(e<t+10)return e-t+26+26;if(e<r+26)return e-r;if(e<l+26)return e-l+26}function f(n){var t,o,u,r,a,i;if(n.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var c=n.length;a="="===n.charAt(c-2)?2:"="===n.charAt(c-1)?1:0;i=new s(n.length*3/4-a);u=a>0?n.length-4:n.length;var f=0;function l(e){i[f++]=e}for(t=0,o=0;t<u;t+=4,o+=3){r=e(n.charAt(t))<<18|e(n.charAt(t+1))<<12|e(n.charAt(t+2))<<6|e(n.charAt(t+3));l((r&16711680)>>16);l((r&65280)>>8);l(r&255)}if(a===2){r=e(n.charAt(t))<<2|e(n.charAt(t+1))>>4;l(r&255)}else if(a===1){r=e(n.charAt(t))<<10|e(n.charAt(t+1))<<4|e(n.charAt(t+2))>>2;l(r>>8&255);l(r&255)}return i}function p(e){var a,i=e.length%3,t="",r,s;function l(e){return n.charAt(e)}function o(e){return l(e>>18&63)+l(e>>12&63)+l(e>>6&63)+l(e&63)}for(a=0,s=e.length-i;a<s;a+=3){r=(e[a]<<16)+(e[a+1]<<8)+e[a+2];t+=o(r)}switch(i){case 1:r=e[e.length-1];t+=l(r>>2);t+=l(r<<4&63);t+="==";break;case 2:r=(e[e.length-2]<<8)+e[e.length-1];t+=l(r>>10);t+=l(r>>4&63);t+=l(r<<2&63);t+="=";break}return t}a.toByteArray=f;a.fromByteArray=p})(typeof e==="undefined"?this.base64js={}:e)},{}],113:[function(n,t,e){e.read=function(o,s,p,a,f){var e,t,d=f*8-a-1,c=(1<<d)-1,u=c>>1,n=-7,r=p?f-1:0,i=p?-1:1,l=o[s+r];r+=i;e=l&(1<<-n)-1;l>>=-n;n+=d;for(;n>0;e=e*256+o[s+r],r+=i,n-=8);t=e&(1<<-n)-1;e>>=-n;n+=a;for(;n>0;t=t*256+o[s+r],r+=i,n-=8);if(e===0){e=1-u}else if(e===c){return t?NaN:(l?-1:1)*Infinity}else{t=t+Math.pow(2,a);e=e-u}return(l?-1:1)*t*Math.pow(2,e-a)};e.write=function(c,n,f,m,t,d){var e,r,l,s=d*8-t-1,o=(1<<s)-1,a=o>>1,p=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=m?0:d-1,u=m?1:-1,h=n<0||n===0&&1/n<0?1:0;n=Math.abs(n);if(isNaN(n)||n===Infinity){r=isNaN(n)?1:0;e=o}else{e=Math.floor(Math.log(n)/Math.LN2);if(n*(l=Math.pow(2,-e))<1){e--;l*=2}if(e+a>=1){n+=p/l}else{n+=p*Math.pow(2,1-a)}if(n*l>=2){e++;l/=2}if(e+a>=o){r=0;e=o}else if(e+a>=1){r=(n*l-1)*Math.pow(2,t);e=e+a}else{r=n*Math.pow(2,a-1)*Math.pow(2,t);e=0}}for(;t>=8;c[f+i]=r&255,i+=u,r/=256,t-=8);e=e<<t|r;s+=t;for(;s>0;c[f+i]=e&255,i+=u,e/=256,s-=8);c[f+i-u]|=h*128}},{}],114:[function(r,e,l){var n=Array.isArray;var t=Object.prototype.toString;e.exports=n||function(e){return!!e&&"[object Array]"==t.call(e)}},{}],115:[function(i,l,s){function e(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}l.exports=e;e.EventEmitter=e;e.prototype._events=undefined;e.prototype._maxListeners=undefined;e.defaultMaxListeners=10;e.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};e.prototype.emit=function(u){var s,l,a,i,e,o;if(!this._events)this._events={};if(u==="error"){if(!this._events.error||t(this._events.error)&&!this._events.error.length){s=arguments[1];if(s instanceof Error){throw s}throw TypeError('Uncaught, unspecified "error" event.')}}l=this._events[u];if(r(l))return false;if(n(l)){switch(arguments.length){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:a=arguments.length;i=new Array(a-1);for(e=1;e<a;e++)i[e-1]=arguments[e];l.apply(this,i)}}else if(t(l)){a=arguments.length;i=new Array(a-1);for(e=1;e<a;e++)i[e-1]=arguments[e];o=l.slice();a=o.length;for(e=0;e<a;e++)o[e].apply(this,i)}return true};e.prototype.addListener=function(l,a){var i;if(!n(a))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",l,n(a.listener)?a.listener:a);if(!this._events[l])this._events[l]=a;else if(t(this._events[l]))this._events[l].push(a);else this._events[l]=[this._events[l],a];if(t(this._events[l])&&!this._events[l].warned){var i;if(!r(this._maxListeners)){i=this._maxListeners}else{i=e.defaultMaxListeners}if(i&&i>0&&this._events[l].length>i){this._events[l].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[l].length);if(typeof console.trace==="function"){console.trace()}}}return this};e.prototype.on=e.prototype.addListener;e.prototype.once=function(r,e){if(!n(e))throw TypeError("listener must be a function");var l=false;function t(){this.removeListener(r,t);if(!l){l=true;e.apply(this,arguments)}}t.listener=e;this.on(r,t);return this};e.prototype.removeListener=function(l,r){var e,i,s,a;if(!n(r))throw TypeError("listener must be a function");if(!this._events||!this._events[l])return this;e=this._events[l];s=e.length;i=-1;if(e===r||n(e.listener)&&e.listener===r){delete this._events[l];if(this._events.removeListener)this.emit("removeListener",l,r)}else if(t(e)){for(a=s;a-->0;){if(e[a]===r||e[a].listener&&e[a].listener===r){i=a;break}}if(i<0)return this;if(e.length===1){e.length=0;delete this._events[l]}else{e.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",l,r)}return this};e.prototype.removeAllListeners=function(e){var r,t;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(r in this._events){if(r==="removeListener")continue;this.removeAllListeners(r)}this.removeAllListeners("removeListener");this._events={};return this}t=this._events[e];if(n(t)){this.removeListener(e,t)}else{while(t.length)this.removeListener(e,t[t.length-1])}delete this._events[e];return this};e.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};e.listenerCount=function(e,r){var t;if(!e._events||!e._events[r])t=0;else if(n(e._events[r]))t=1;else t=e._events[r].length;return t};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function t(e){return typeof e==="object"&&e!==null}function r(e){return e===void 0}},{}],116:[function(n,e,t){if(typeof Object.create==="function"){e.exports=function r(e,n){e.super_=n;e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function l(e,n){e.super_=n;var t=function(){};t.prototype=n.prototype;e.prototype=new t;e.prototype.constructor=e}}},{}],117:[function(n,e,t){e.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],118:[function(n,t,e){(function(l){function r(e,l){var t=0;for(var n=e.length-1;n>=0;n--){var r=e[n];if(r==="."){e.splice(n,1)}else if(r===".."){e.splice(n,1);t++}else if(t){e.splice(n,1);t--}}if(l){for(;t--;t){e.unshift("..")}}return e}var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return a.exec(e).slice(1)};e.resolve=function(){var e="",n=false;for(var a=arguments.length-1;a>=-1&&!n;a--){var i=a>=0?arguments[a]:l.cwd();if(typeof i!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!i){continue}e=i+"/"+e;n=i.charAt(0)==="/"}e=r(t(e.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+e||"."};e.normalize=function(n){var l=e.isAbsolute(n),a=i(n,-1)==="/";n=r(t(n.split("/"),function(e){return!!e}),!l).join("/");if(!n&&!l){n="."}if(n&&a){n+="/"}return(l?"/":"")+n};e.isAbsolute=function(e){return e.charAt(0)==="/"};e.join=function(){var n=Array.prototype.slice.call(arguments,0);return e.normalize(t(n,function(e,n){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};e.relative=function(r,l){r=e.resolve(r).substr(1);l=e.resolve(l).substr(1);function o(n){var e=0;for(;e<n.length;e++){if(n[e]!=="")break}var t=n.length-1;for(;t>=0;t--){if(n[t]!=="")break}if(e>t)return[];return n.slice(e,t-e+1)}var a=o(r.split("/"));var i=o(l.split("/"));var u=Math.min(a.length,i.length);var s=u;for(var n=0;n<u;n++){if(a[n]!==i[n]){s=n;break}}var t=[];for(var n=s;n<a.length;n++){t.push("..")}t=t.concat(i.slice(s));return t.join("/")};e.sep="/";e.delimiter=":";e.dirname=function(l){var t=n(l),r=t[0],e=t[1];if(!r&&!e){return"."}if(e){e=e.substr(0,e.length-1)}return r+e};e.basename=function(r,t){var e=n(r)[2];if(t&&e.substr(-1*t.length)===t){e=e.substr(0,e.length-t.length)}return e};e.extname=function(e){return n(e)[3]};function t(e,t){if(e.filter)return e.filter(t);var r=[];for(var n=0;n<e.length;n++){if(t(e[n],n,e))r.push(e[n])}return r}var i="ab".substr(-1)==="b"?function(e,n,t){return e.substr(n,t)}:function(n,e,t){if(e<0)e=n.length+e;return n.substr(e,t)}}).call(this,n("_process"))},{_process:119}],119:[function(i,l,s){var e=l.exports={};var t=[];var r=false;function a(){if(r){return}r=true;var n;var e=t.length;while(e){n=t;t=[];var l=-1;while(++l<e){n[l]()}e=t.length}r=false}e.nextTick=function(e){t.push(e);if(!r){setTimeout(a,0)}};e.title="browser";e.browser=true;e.env={};e.argv=[];e.version="";function n(){}e.on=n;e.addListener=n;e.once=n;e.off=n;e.removeListener=n;e.removeAllListeners=n;e.emit=n;e.binding=function(e){throw new Error("process.binding is not supported")};e.cwd=function(){return"/"};e.chdir=function(e){throw new Error("process.chdir is not supported")};e.umask=function(){return 0}},{}],120:[function(e,n,t){n.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":121}],121:[function(e,n,t){(function(i){n.exports=t;var s=Object.keys||function(n){var e=[];for(var t in n)e.push(t);return e};var l=e("core-util-is");l.inherits=e("inherits");var a=e("./_stream_readable");var r=e("./_stream_writable");l.inherits(t,a);u(s(r.prototype),function(e){if(!t.prototype[e])t.prototype[e]=r.prototype[e]});function t(e){if(!(this instanceof t))return new t(e);a.call(this,e);r.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",o)}function o(){if(this.allowHalfOpen||this._writableState.ended)return;i.nextTick(this.end.bind(this))}function u(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e)}}}).call(this,e("_process"))},{"./_stream_readable":123,"./_stream_writable":125,_process:119,"core-util-is":126,inherits:116}],122:[function(n,l,a){l.exports=e;var t=n("./_stream_transform");var r=n("core-util-is");r.inherits=n("inherits");r.inherits(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}e.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":124,"core-util-is":126,inherits:116}],123:[function(e,n,t){(function(r){n.exports=t;var S=e("isarray");var s=e("buffer").Buffer;t.ReadableState=x;var o=e("events").EventEmitter;if(!o.listenerCount)o.listenerCount=function(e,n){return e.listeners(n).length};var a=e("stream");var h=e("core-util-is");h.inherits=e("inherits");var l;h.inherits(t,a);function x(n,r){n=n||{};var t=n.highWaterMark;this.highWaterMark=t||t===0?t:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!n.objectMode;this.defaultEncoding=n.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(n.encoding){if(!l)l=e("string_decoder/").StringDecoder;this.decoder=new l(n.encoding);this.encoding=n.encoding}}function t(e){if(!(this instanceof t))return new t(e);this._readableState=new x(e,this);this.readable=true;a.call(this)}t.prototype.push=function(n,e){var t=this._readableState;if(typeof n==="string"&&!t.objectMode){e=e||t.defaultEncoding;if(e!==t.encoding){n=new s(n,e);e=""}}return g(this,t,n,e,false)};t.prototype.unshift=function(e){var n=this._readableState;return g(this,n,e,"",true)};function g(t,e,n,s,r){var l=A(e,n);if(l){t.emit("error",l)}else if(n===null||n===undefined){e.reading=false;if(!e.ended)k(t,e)}else if(e.objectMode||n&&n.length>0){if(e.ended&&!r){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&r){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else{if(e.decoder&&!r&&!s)n=e.decoder.write(n);
e.length+=e.objectMode?1:n.length;if(r){e.buffer.unshift(n)}else{e.reading=false;e.buffer.push(n)}if(e.needReadable)i(t);C(t,e)}}else if(!r){e.reading=false}return _(e)}function _(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}t.prototype.setEncoding=function(n){if(!l)l=e("string_decoder/").StringDecoder;this._readableState.decoder=new l(n);this._readableState.encoding=n};var b=8388608;function R(e){if(e>=b){e=b}else{e--;for(var n=1;n<32;n<<=1)e|=e>>n;e++}return e}function v(n,e){if(e.length===0&&e.ended)return 0;if(e.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(e.flowing&&e.buffer.length)return e.buffer[0].length;else return e.length}if(n<=0)return 0;if(n>e.highWaterMark)e.highWaterMark=R(n);if(n>e.length){if(!e.ended){e.needReadable=true;return 0}else return e.length}return n}t.prototype.read=function(n){var e=this._readableState;e.calledRead=true;var l=n;var t;if(typeof n!=="number"||n>0)e.emittedReadable=false;if(n===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended)){i(this);return null}n=v(n,e);if(n===0&&e.ended){t=null;if(e.length>0&&e.decoder){t=p(n,e);e.length-=t.length}if(e.length===0)d(this);return t}var r=e.needReadable;if(e.length-n<=e.highWaterMark)r=true;if(e.ended||e.reading)r=false;if(r){e.reading=true;e.sync=true;if(e.length===0)e.needReadable=true;this._read(e.highWaterMark);e.sync=false}if(r&&!e.reading)n=v(l,e);if(n>0)t=p(n,e);else t=null;if(t===null){e.needReadable=true;n=0}e.length-=n;if(e.length===0&&!e.ended)e.needReadable=true;if(e.ended&&!e.endEmitted&&e.length===0)d(this);return t};function A(t,e){var n=null;if(!s.isBuffer(e)&&"string"!==typeof e&&e!==null&&e!==undefined&&!t.objectMode){n=new TypeError("Invalid non-string/buffer chunk")}return n}function k(t,e){if(e.decoder&&!e.ended){var n=e.decoder.end();if(n&&n.length){e.buffer.push(n);e.length+=e.objectMode?1:n.length}}e.ended=true;if(e.length>0)i(t);else d(t)}function i(n){var e=n._readableState;e.needReadable=false;if(e.emittedReadable)return;e.emittedReadable=true;if(e.sync)r.nextTick(function(){m(n)});else m(n)}function m(e){e.emit("readable")}function C(n,e){if(!e.readingMore){e.readingMore=true;r.nextTick(function(){E(n,e)})}}function E(t,e){var n=e.length;while(!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark){t.read(0);if(n===e.length)break;else n=e.length}e.readingMore=false}t.prototype._read=function(e){this.emit("error",new Error("not implemented"))};t.prototype.pipe=function(e,d){var t=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1;var y=(!d||d.end!==false)&&e!==r.stdout&&e!==r.stderr;var h=y?g:u;if(n.endEmitted)r.nextTick(h);else t.once("end",h);e.on("unpipe",m);function m(e){if(e!==t)return;u()}function g(){e.end()}var p=w(t);e.on("drain",p);function u(){e.removeListener("close",i);e.removeListener("finish",a);e.removeListener("drain",p);e.removeListener("error",l);e.removeListener("unpipe",m);t.removeListener("end",g);t.removeListener("end",u);if(!e._writableState||e._writableState.needDrain)p()}function l(n){s();e.removeListener("error",l);if(o.listenerCount(e,"error")===0)e.emit("error",n)}if(!e._events||!e._events.error)e.on("error",l);else if(S(e._events.error))e._events.error.unshift(l);else e._events.error=[l,e._events.error];function i(){e.removeListener("finish",a);s()}e.once("close",i);function a(){e.removeListener("close",i);s()}e.once("finish",a);function s(){t.unpipe(e)}e.emit("pipe",t);if(!n.flowing){this.on("readable",c);n.flowing=true;r.nextTick(function(){f(t)})}return e};function w(e){return function(){var t=this;var n=e._readableState;n.awaitDrain--;if(n.awaitDrain===0)f(e)}}function f(n){var e=n._readableState;var t;e.awaitDrain=0;function r(n,l,a){var r=n.write(t);if(false===r){e.awaitDrain++}}while(e.pipesCount&&null!==(t=n.read())){if(e.pipesCount===1)r(e.pipes,0,null);else y(e.pipes,r);n.emit("data",t);if(e.awaitDrain>0)return}if(e.pipesCount===0){e.flowing=false;if(o.listenerCount(n,"data")>0)u(n);return}e.ranOut=true}function c(){if(this._readableState.ranOut){this._readableState.ranOut=false;f(this)}}t.prototype.unpipe=function(n){var e=this._readableState;if(e.pipesCount===0)return this;if(e.pipesCount===1){if(n&&n!==e.pipes)return this;if(!n)n=e.pipes;e.pipes=null;e.pipesCount=0;this.removeListener("readable",c);e.flowing=false;if(n)n.emit("unpipe",this);return this}if(!n){var r=e.pipes;var l=e.pipesCount;e.pipes=null;e.pipesCount=0;this.removeListener("readable",c);e.flowing=false;for(var t=0;t<l;t++)r[t].emit("unpipe",this);return this}var t=I(e.pipes,n);if(t===-1)return this;e.pipes.splice(t,1);e.pipesCount-=1;if(e.pipesCount===1)e.pipes=e.pipes[0];n.emit("unpipe",this);return this};t.prototype.on=function(n,t){var r=a.prototype.on.call(this,n,t);if(n==="data"&&!this._readableState.flowing)u(this);if(n==="readable"&&this.readable){var e=this._readableState;if(!e.readableListening){e.readableListening=true;e.emittedReadable=false;e.needReadable=true;if(!e.reading){this.read(0)}else if(e.length){i(this,e)}}}return r};t.prototype.addListener=t.prototype.on;t.prototype.resume=function(){u(this);this.read(0);this.emit("resume")};t.prototype.pause=function(){u(this,true);this.emit("pause")};function u(e,l){var i=e._readableState;if(i.flowing){throw new Error("Cannot switch to old mode now.")}var n=l||false;var t=false;e.readable=true;e.pipe=a.prototype.pipe;e.on=e.addListener=a.prototype.on;e.on("readable",function(){t=true;var r;while(!n&&null!==(r=e.read()))e.emit("data",r);if(r===null){t=false;e._readableState.needReadable=true}});e.pause=function(){n=true;this.emit("pause")};e.resume=function(){n=false;if(t)r.nextTick(function(){e.emit("readable")});else this.read(0);this.emit("resume")};e.emit("readable")}t.prototype.wrap=function(e){var n=this._readableState;var l=false;var t=this;e.on("end",function(){if(n.decoder&&!n.ended){var e=n.decoder.end();if(e&&e.length)t.push(e)}t.push(null)});e.on("data",function(r){if(n.decoder)r=n.decoder.write(r);if(n.objectMode&&(r===null||r===undefined))return;else if(!n.objectMode&&(!r||!r.length))return;var a=t.push(r);if(!a){l=true;e.pause()}});for(var r in e){if(typeof e[r]==="function"&&typeof this[r]==="undefined"){this[r]=function(n){return function(){return e[n].apply(e,arguments)}}(r)}}var a=["error","close","destroy","pause","resume"];y(a,function(n){e.on(n,t.emit.bind(t,n))});t._read=function(n){if(l){l=false;e.resume()}};return t};t._fromList=p;function p(t,a){var e=a.buffer;var o=a.length;var u=!!a.decoder;var f=!!a.objectMode;var n;if(e.length===0)return null;if(o===0)n=null;else if(f)n=e.shift();else if(!t||t>=o){if(u)n=e.join("");else n=s.concat(e,o);e.length=0}else{if(t<e[0].length){var r=e[0];n=r.slice(0,t);e[0]=r.slice(t)}else if(t===e[0].length){n=e.shift()}else{if(u)n="";else n=new s(t);var i=0;for(var c=0,p=e.length;c<p&&i<t;c++){var r=e[0];var l=Math.min(t-i,r.length);if(u)n+=r.slice(0,l);else r.copy(n,i,0,l);if(l<r.length)e[0]=r.slice(l);else e.shift();i+=l}}}return n}function d(n){var e=n._readableState;if(e.length>0)throw new Error("endReadable called on non-empty stream");if(!e.endEmitted&&e.calledRead){e.ended=true;r.nextTick(function(){if(!e.endEmitted&&e.length===0){e.endEmitted=true;n.readable=false;n.emit("end")}})}}function y(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e)}}function I(n,t){for(var e=0,r=n.length;e<r;e++){if(n[e]===t)return e}return-1}}).call(this,e("_process"))},{_process:119,buffer:111,"core-util-is":126,events:115,inherits:116,isarray:117,stream:131,"string_decoder/":132}],124:[function(n,a,o){a.exports=e;var t=n("./_stream_duplex");var r=n("core-util-is");r.inherits=n("inherits");r.inherits(e,t);function i(n,e){this.afterTransform=function(n,t){return s(e,n,t)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function s(e,a,r){var t=e._transformState;t.transforming=false;var l=t.writecb;if(!l)return e.emit("error",new Error("no writecb in Transform class"));t.writechunk=null;t.writecb=null;if(r!==null&&r!==undefined)e.push(r);if(l)l(a);var n=e._readableState;n.reading=false;if(n.needReadable||n.length<n.highWaterMark){e._read(n.highWaterMark)}}function e(n){if(!(this instanceof e))return new e(n);t.call(this,n);var a=this._transformState=new i(n,this);var r=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(e){l(r,e)});else l(r)})}e.prototype.push=function(e,n){this._transformState.needTransform=false;return t.prototype.push.call(this,e,n)};e.prototype._transform=function(e,n,t){throw new Error("not implemented")};e.prototype._write=function(t,r,l){var e=this._transformState;e.writecb=l;e.writechunk=t;e.writeencoding=r;if(!e.transforming){var n=this._readableState;if(e.needTransform||n.needReadable||n.length<n.highWaterMark)this._read(n.highWaterMark)}};e.prototype._read=function(n){var e=this._transformState;if(e.writechunk!==null&&e.writecb&&!e.transforming){e.transforming=true;this._transform(e.writechunk,e.writeencoding,e.afterTransform)}else{e.needTransform=true}};function l(e,n){if(n)return e.emit("error",n);var t=e._writableState;var l=e._readableState;var r=e._transformState;if(t.length)throw new Error("calling transform done when ws.length != 0");if(r.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}},{"./_stream_duplex":121,"core-util-is":126,inherits:116}],125:[function(e,n,t){(function(r){n.exports=t;var l=e("buffer").Buffer;t.WritableState=s;var a=e("core-util-is");a.inherits=e("inherits");var i=e("stream");a.inherits(t,i);function d(e,n,t){this.chunk=e;this.encoding=n;this.callback=t}function s(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||n===0?n:16*1024;this.objectMode=!!e.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var r=e.decodeStrings===false;this.decodeStrings=!r;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){g(t,e)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function t(n){var r=e("./_stream_duplex");if(!(this instanceof t)&&!(this instanceof r))return new t(n);this._writableState=new s(n,this);this.writable=true;i.call(this)}t.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function y(n,l,t){var e=new Error("write after end");n.emit("error",e);r.nextTick(function(){t(e)})}function b(a,i,e,s){var n=true;if(!l.isBuffer(e)&&"string"!==typeof e&&e!==null&&e!==undefined&&!i.objectMode){var t=new TypeError("Invalid non-string/buffer chunk");a.emit("error",t);r.nextTick(function(){s(t)});n=false}return n}t.prototype.write=function(r,e,n){var t=this._writableState;var a=false;if(typeof e==="function"){n=e;e=null}if(l.isBuffer(r))e="buffer";else if(!e)e=t.defaultEncoding;if(typeof n!=="function")n=function(){};if(t.ended)y(this,t,n);else if(b(this,t,r,n))a=w(this,t,r,e,n);return a};function E(n,e,t){if(!n.objectMode&&n.decodeStrings!==false&&typeof e==="string"){e=new l(e,t)}return e}function w(s,e,n,t,r){n=E(e,n,t);if(l.isBuffer(n))t="buffer";var a=e.objectMode?1:n.length;e.length+=a;var i=e.length<e.highWaterMark;if(!i)e.needDrain=true;if(e.writing)e.buffer.push(new d(n,t,r));else o(s,e,a,n,t,r);return i}function o(n,e,t,r,l,a){e.writelen=t;e.writecb=a;e.writing=true;e.sync=true;n._write(r,l,e.onwrite);e.sync=false}function m(n,a,l,e,t){if(l)r.nextTick(function(){t(e)});else t(e);n._writableState.errorEmitted=true;n.emit("error",e)}function h(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function g(n,a){var e=n._writableState;var i=e.sync;var t=e.writecb;h(e);if(a)m(n,e,i,a,t);else{var l=c(n,e);if(!l&&!e.bufferProcessing&&e.buffer.length)x(n,e);if(i){r.nextTick(function(){u(n,e,l,t)})}else{u(n,e,l,t)}}}function u(e,n,t,r){if(!t)v(e,n);r();if(t)f(e,n)}function v(n,e){if(e.length===0&&e.needDrain){e.needDrain=false;n.emit("drain")}}function x(l,e){e.bufferProcessing=true;for(var n=0;n<e.buffer.length;n++){var t=e.buffer[n];var r=t.chunk;var a=t.encoding;var i=t.callback;var s=e.objectMode?1:r.length;o(l,e,s,r,a,i);if(e.writing){n++;break}}e.bufferProcessing=false;if(n<e.buffer.length)e.buffer=e.buffer.slice(n);else e.buffer.length=0}t.prototype._write=function(n,t,e){e(new Error("not implemented"))};t.prototype.end=function(e,n,t){var r=this._writableState;if(typeof e==="function"){t=e;e=null;n=null}else if(typeof n==="function"){t=n;n=null}if(typeof e!=="undefined"&&e!==null)this.write(e,n);if(!r.ending&&!r.finished)p(this,r,t)};function c(n,e){return e.ending&&e.length===0&&!e.finished&&!e.writing}function f(e,n){var t=c(e,n);if(t){n.finished=true;e.emit("finish")}return t}function p(t,e,n){e.ending=true;f(t,e);if(n){if(e.finished)r.nextTick(n);else t.once("finish",n)}e.ended=true}}).call(this,e("_process"))},{"./_stream_duplex":121,_process:119,buffer:111,"core-util-is":126,inherits:116,stream:131}],126:[function(n,t,e){(function(f){function u(e){return Array.isArray(e)}e.isArray=u;function r(e){return typeof e==="boolean"}e.isBoolean=r;function l(e){return e===null}e.isNull=l;function a(e){return e==null}e.isNullOrUndefined=a;function i(e){return typeof e==="number"}e.isNumber=i;function s(e){return typeof e==="string"}e.isString=s;function o(e){return typeof e==="symbol"}e.isSymbol=o;function y(e){return e===void 0}e.isUndefined=y;function c(e){return n(e)&&t(e)==="[object RegExp]"}e.isRegExp=c;function n(e){return typeof e==="object"&&e!==null}e.isObject=n;function p(e){return n(e)&&t(e)==="[object Date]"}e.isDate=p;function d(e){return n(e)&&(t(e)==="[object Error]"||e instanceof Error)}e.isError=d;function m(e){return typeof e==="function"}e.isFunction=m;function h(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}e.isPrimitive=h;function g(e){return f.isBuffer(e)}e.isBuffer=g;function t(e){return Object.prototype.toString.call(e)}}).call(this,n("buffer").Buffer)},{buffer:111}],127:[function(e,n,t){n.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":122}],128:[function(n,t,e){var r=n("stream");e=t.exports=n("./lib/_stream_readable.js");e.Stream=r;e.Readable=e;e.Writable=n("./lib/_stream_writable.js");e.Duplex=n("./lib/_stream_duplex.js");e.Transform=n("./lib/_stream_transform.js");e.PassThrough=n("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":121,"./lib/_stream_passthrough.js":122,"./lib/_stream_readable.js":123,"./lib/_stream_transform.js":124,"./lib/_stream_writable.js":125,stream:131}],129:[function(e,n,t){n.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":124}],130:[function(e,n,t){n.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":125}],131:[function(n,r,a){r.exports=e;var t=n("events").EventEmitter;var l=n("inherits");l(e,t);e.Readable=n("readable-stream/readable.js");e.Writable=n("readable-stream/writable.js");e.Duplex=n("readable-stream/duplex.js");e.Transform=n("readable-stream/transform.js");e.PassThrough=n("readable-stream/passthrough.js");e.Stream=e;function e(){t.call(this)}e.prototype.pipe=function(n,i){var e=this;function s(t){if(n.writable){if(false===n.write(t)&&e.pause){e.pause()}}}e.on("data",s);function o(){if(e.readable&&e.resume){e.resume()}}n.on("drain",o);if(!n._isStdio&&(!i||i.end!==false)){e.on("end",u);e.on("close",c)}var l=false;function u(){if(l)return;l=true;n.end()}function c(){if(l)return;l=true;if(typeof n.destroy==="function")n.destroy()}function a(e){r();if(t.listenerCount(this,"error")===0){throw e}}e.on("error",a);n.on("error",a);function r(){e.removeListener("data",s);n.removeListener("drain",o);e.removeListener("end",u);e.removeListener("close",c);e.removeListener("error",a);n.removeListener("error",a);e.removeListener("end",r);e.removeListener("close",r);n.removeListener("close",r)}e.on("end",r);e.on("close",r);n.on("close",r);n.emit("pipe",e);return n}},{events:115,inherits:116,"readable-stream/duplex.js":120,"readable-stream/passthrough.js":127,"readable-stream/readable.js":128,"readable-stream/transform.js":129,"readable-stream/writable.js":130}],132:[function(t,u,r){var n=t("buffer").Buffer;var l=n.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!l(e)){throw new Error("Unknown encoding: "+e)}}var e=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=o;break;default:this.write=i;return}this.charBuffer=new n(6);this.charReceived=0;this.charLength=0};e.prototype.write=function(e){var n="";while(this.charLength){var a=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,a);this.charReceived+=a;if(this.charReceived<this.charLength){return""}e=e.slice(a,e.length);n=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var l=n.charCodeAt(n.length-1);if(l>=55296&&l<=56319){this.charLength+=this.surrogateSize;n="";continue}this.charReceived=this.charLength=0;if(e.length===0){return n}break}this.detectIncompleteChar(e);var t=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,t);t-=this.charReceived}n+=e.toString(this.encoding,0,t);var t=n.length-1;var l=n.charCodeAt(t);if(l>=55296&&l<=56319){var r=this.surrogateSize;this.charLength+=r;this.charReceived+=r;this.charBuffer.copy(this.charBuffer,r,0,r);e.copy(this.charBuffer,0,0,r);return n.substring(0,t)}return n};e.prototype.detectIncompleteChar=function(n){var e=n.length>=3?3:n.length;for(;e>0;e--){var t=n[n.length-e];if(e==1&&t>>5==6){this.charLength=2;break}if(e<=2&&t>>4==14){this.charLength=3;break}if(e<=3&&t>>3==30){this.charLength=4;break}}this.charReceived=e};e.prototype.end=function(e){var n="";if(e&&e.length)n=this.write(e);if(this.charReceived){var t=this.charReceived;var r=this.charBuffer;var l=this.encoding;n+=r.slice(0,t).toString(l)}return n};function i(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:111}],133:[function(n,e,t){e.exports=function r(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],134:[function(n,t,e){(function(a,L){var _=/%[sdj%]/g;e.format=function(i){if(!p(i)){var o=[];for(var e=0;e<arguments.length;e++){o.push(r(arguments[e]))}return o.join(" ")}var e=1;var n=arguments;var u=n.length;var a=String(i).replace(_,function(t){if(t==="%%")return"%";if(e>=u)return t;switch(t){case"%s":return String(n[e++]);case"%d":return Number(n[e++]);case"%j":try{return JSON.stringify(n[e++])}catch(r){return"[Circular]"}default:return t}});for(var t=n[e];e<u;t=n[++e]){if(s(t)||!l(t)){a+=" "+t}else{a+=" "+r(t)}}return a};e.deprecate=function(r,n){if(t(L.process)){return function(){return e.deprecate(r,n).apply(this,arguments)}}if(a.noDeprecation===true){return r}var l=false;function i(){if(!l){if(a.throwDeprecation){throw new Error(n)}else if(a.traceDeprecation){console.trace(n)}else{console.error(n)}l=true}return r.apply(this,arguments)}return i};var c={};var v;e.debuglog=function(n){if(t(v))v=a.env.NODE_DEBUG||"";n=n.toUpperCase();if(!c[n]){if(new RegExp("\\b"+n+"\\b","i").test(v)){var r=a.pid;c[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else{c[n]=function(){}}}return c[n]};function r(l,r){var n={seen:[],stylize:k};if(arguments.length>=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(g(r)){n.showHidden=r}else if(r){e._extend(n,r)}if(t(n.showHidden))n.showHidden=false;if(t(n.depth))n.depth=2;if(t(n.colors))n.colors=false;if(t(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=I;return f(n,l,n.depth)}e.inspect=r;r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function I(n,t){var e=r.styles[t];if(e){return"["+r.colors[e][0]+"m"+n+"["+r.colors[e][1]+"m"}else{return n}}function k(e,n){return e}function O(n){var e={};n.forEach(function(n,t){e[n]=true});return e}function f(t,n,a){if(t.customInspect&&n&&o(n.inspect)&&n.inspect!==e.inspect&&!(n.constructor&&n.constructor.prototype===n)){var s=n.inspect(a,t);if(!p(s)){s=f(t,s,a)}return s}var y=R(t,n);if(y){return y}var r=Object.keys(n);var v=O(r);if(t.showHidden){r=Object.getOwnPropertyNames(n)}if(i(n)&&(r.indexOf("message")>=0||r.indexOf("description")>=0)){return d(n)}if(r.length===0){if(o(n)){var b=n.name?": "+n.name:"";return t.stylize("[Function"+b+"]","special")}if(u(n)){return t.stylize(RegExp.prototype.toString.call(n),"regexp")}if(x(n)){return t.stylize(Date.prototype.toString.call(n),"date")}if(i(n)){return d(n)}}var l="",h=false,c=["{","}"];if(w(n)){h=true;c=["[","]"]}if(o(n)){var E=n.name?": "+n.name:"";l=" [Function"+E+"]"}if(u(n)){l=" "+RegExp.prototype.toString.call(n)}if(x(n)){l=" "+Date.prototype.toUTCString.call(n)}if(i(n)){l=" "+d(n)}if(r.length===0&&(!h||n.length==0)){return c[0]+l+c[1]}if(a<0){if(u(n)){return t.stylize(RegExp.prototype.toString.call(n),"regexp")}else{return t.stylize("[Object]","special")}}t.seen.push(n);var g;if(h){g=A(t,n,a,v,r)}else{g=r.map(function(e){return m(t,n,a,v,e,h)})}t.seen.pop();return P(g,l,c)}function R(n,e){if(t(e))return n.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(r,"string")}if(E(e))return n.stylize(""+e,"number");if(g(e))return n.stylize(""+e,"boolean");if(s(e))return n.stylize("null","null")}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function A(r,e,l,a,i){var n=[];for(var t=0,s=e.length;t<s;++t){if(b(e,String(t))){n.push(m(r,e,l,a,String(t),true))}else{n.push("")}}i.forEach(function(t){if(!t.match(/^\d+$/)){n.push(m(r,e,l,a,t,true))}});return n}function m(r,i,o,c,a,u){var e,n,l;l=Object.getOwnPropertyDescriptor(i,a)||{value:i[a]};if(l.get){if(l.set){n=r.stylize("[Getter/Setter]","special")}else{n=r.stylize("[Getter]","special")}}else{if(l.set){n=r.stylize("[Setter]","special")}}if(!b(c,a)){e="["+a+"]"}if(!n){if(r.seen.indexOf(l.value)<0){if(s(o)){n=f(r,l.value,null)}else{n=f(r,l.value,o-1)}if(n.indexOf("\n")>-1){if(u){n=n.split("\n").map(function(e){return" "+e}).join("\n").substr(2)}else{n="\n"+n.split("\n").map(function(e){return" "+e}).join("\n")}}}else{n=r.stylize("[Circular]","special")}}if(t(e)){if(u&&a.match(/^\d+$/)){return n}e=JSON.stringify(""+a);if(e.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){e=e.substr(1,e.length-2);e=r.stylize(e,"name")}else{e=e.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");e=r.stylize(e,"string")}}return e+": "+n}function P(n,t,e){var r=0;var l=n.reduce(function(n,e){r++;if(e.indexOf("\n")>=0)r++;return n+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(l>60){return e[0]+(t===""?"":t+"\n ")+" "+n.join(",\n ")+" "+e[1]}return e[0]+t+" "+n.join(", ")+" "+e[1]}function w(e){return Array.isArray(e)}e.isArray=w;function g(e){return typeof e==="boolean"}e.isBoolean=g;function s(e){return e===null}e.isNull=s;function C(e){return e==null}e.isNullOrUndefined=C;function E(e){return typeof e==="number"}e.isNumber=E;function p(e){return typeof e==="string"}e.isString=p;function S(e){return typeof e==="symbol"}e.isSymbol=S;function t(e){return e===void 0}e.isUndefined=t;function u(e){return l(e)&&y(e)==="[object RegExp]"}e.isRegExp=u;function l(e){return typeof e==="object"&&e!==null}e.isObject=l;function x(e){return l(e)&&y(e)==="[object Date]"}e.isDate=x;function i(e){return l(e)&&(y(e)==="[object Error]"||e instanceof Error)}e.isError=i;function o(e){return typeof e==="function"}e.isFunction=o;function T(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}e.isPrimitive=T;e.isBuffer=n("./support/isBuffer");function y(e){return Object.prototype.toString.call(e)}function h(e){return e<10?"0"+e.toString(10):e.toString(10)}var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var e=new Date;var n=[h(e.getHours()),h(e.getMinutes()),h(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],n].join(" ")}e.log=function(){console.log("%s - %s",M(),e.format.apply(e,arguments))};e.inherits=n("inherits");e._extend=function(n,e){if(!e||!l(e))return n;var t=Object.keys(e);var r=t.length;while(r--){n[t[r]]=e[t[r]]}return n};function b(e,n){return Object.prototype.hasOwnProperty.call(e,n)}}).call(this,n("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":133,_process:119,inherits:116}],135:[function(n,e,t){!function(n,M,r){"use strict";var O="Object",It="Function",N="Array",on="String",En="Number",xn="RegExp",Nn="Date",xt="Map",Vn="Set",ot="WeakMap",pt="WeakSet",j="Symbol",In="Promise",Gn="Math",Dt="Arguments",l="prototype",Hn="constructor",U="toString",ct=U+"Tag",bt="toLocaleString",Ft="hasOwnProperty",At="forEach",Mn="iterator",ln="@@"+Mn,jt="process",Pt="createElement",Lt=n[It],i=n[O],R=n[N],y=n[on],Tt=n[En],tn=n[xn],Zt=n[Nn],rt=n[xt],kt=n[Vn],nt=n[ot],_t=n[pt],x=n[j],d=n[Gn],Ln=n.TypeError,Ut=n.setTimeout,jn=n.setImmediate,Zn=n.clearImmediate,Qn=n[jt],mt=Qn&&Qn.nextTick,wn=n.document,dt=wn&&wn.documentElement,Qt=n.navigator,Bn=n.define,p=R[l],T=i[l],fn=Lt[l],$=1/0,hn=".";function f(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function v(e){return typeof e=="function"}var en=o(/./.test,/\[native code\]\s*\}\s*$/,1);var qt={Undefined:1,Null:1,Array:1,String:1,Arguments:1,Function:1,Error:1,Boolean:1,Number:1,Date:1,RegExp:1},Jt=T[U];function J(e,n,t){if(e&&!s(e=t?e:e[l],yn))a(e,yn,n)}function pn(e){return e==r?e===r?"Undefined":"Null":Jt.call(e).slice(8,-1)}function Sn(n){var t=pn(n),e;return t==O&&(e=n[yn])?s(qt,e)?"~"+e:e:t}var z=fn.call,it=fn.apply,Y;function Tn(){var e=arguments.length,t=R(e),n=0,r=gn._,l=false;while(e>n)if((t[n]=arguments[n++])===r)l=true;return at(this,t,e,l,r,false)}function at(e,n,r,t,l,a,i){P(e);return function(){var c=a?i:this,f=arguments.length,o=0,u=0,s;if(!t&&!f)return B(e,n,c);s=n.slice();if(t)for(;r>o;o++)if(s[o]===l)s[o]=arguments[u++];while(f>u)s.push(arguments[u++]);return B(e,s,c)}}function o(e,n,t){P(e);if(~t&&n===r)return e;switch(t){case 1:return function(t){return e.call(n,t)};case 2:return function(t,r){return e.call(n,t,r)};case 3:return function(t,r,l){return e.call(n,t,r,l)}}return function(){return e.apply(n,arguments)}}function B(n,e,t){var l=t===r;switch(e.length|0){case 0:return l?n():n.call(t);case 1:return l?n(e[0]):n.call(t,e[0]);case 2:return l?n(e[0],e[1]):n.call(t,e[0],e[1]);case 3:return l?n(e[0],e[1],e[2]):n.call(t,e[0],e[1],e[2]);case 4:return l?n(e[0],e[1],e[2],e[3]):n.call(t,e[0],e[1],e[2],e[3]);case 5:return l?n(e[0],e[1],e[2],e[3],e[4]):n.call(t,e[0],e[1],e[2],e[3],e[4])}return n.apply(t,e)}function zt(e,r){var n=W((arguments.length<3?e:P(arguments[2]))[l]),t=it.call(e,n,r);return f(t)?t:n}var W=i.create,nn=i.getPrototypeOf,_n=i.setPrototypeOf,E=i.defineProperty,Kt=i.defineProperties,G=i.getOwnPropertyDescriptor,mn=i.keys,qn=i.getOwnPropertyNames,ft=i.getOwnPropertySymbols,s=o(z,T[Ft],2),Fn=i;function k(e){return Fn(w(e))}function $t(e){return e}function bn(){return this}function On(e,n){if(s(e,n))return e[n]}function Xn(e){return ft?qn(e).concat(ft(e)):qn(e)}var Ct=i.assign||function(s,c){var e=i(w(s)),o=arguments.length,n=1;while(o>n){var t=Fn(arguments[n++]),r=mn(t),u=r.length,l=0,a;while(u>l)e[a=r[l++]]=t[a]}return e};function Un(l,a){var e=k(l),n=mn(e),i=n.length,t=0,r;while(i>t)if(e[r=n[t++]]===a)return r}function un(e){return y(e).split(",")}var Et=p.push,rr=p.unshift,tr=p.slice,nr=p.splice,er=p.indexOf,X=p[At];function st(e){var t=e==1,a=e==2,s=e==3,n=e==4,l=e==6,u=e==5||l;return function(y){var h=i(w(this)),v=arguments[1],p=Fn(h),x=o(y,v,3),g=S(p.length),c=0,d=t?R(g):a?[]:r,f,m;for(;g>c;c++)if(u||c in p){f=p[c];m=x(f,c,h);if(e){if(t)d[c]=m;else if(m)switch(e){case 3:return true;case 5:return f;case 6:return c;case 2:d.push(f)}else if(n)return false}}return l?-1:s||n?n:d}}function Bt(e){return function(r){var t=k(this),l=S(t.length),n=V(arguments[1],l);if(e&&r!=r){for(;l>n;n++)if(Jn(t[n]))return e||n}else for(;l>n;n++)if(e||n in t){if(t[n]===r)return e||n}return!e&&-1}}function Dn(e,n){return typeof e=="function"?e:n}var An=9007199254740991,Xt=d.ceil,yt=d.floor,vt=d.max,q=d.min,wt=d.random,St=d.trunc||function(e){return(e>0?yt:Xt)(e)};function Jn(e){return e!=e}function kn(e){return isNaN(e)?0:St(e)}function S(e){return e>0?q(kn(e),An):0}function V(e,n){var e=kn(e);return e<0?vt(e+n,0):q(e,n)}function Rn(n,e,t){var r=f(e)?function(n){return e[n]}:e;return function(e){return y(t?e:this).replace(n,r)}}function Wn(e){return function(s){var t=y(w(this)),n=kn(s),i=t.length,l,a;if(n<0||n>=i)return e?"":r;l=t.charCodeAt(n);return l<55296||l>56319||n+1===i||(a=t.charCodeAt(n+1))<56320||a>57343?e?t.charAt(n):l:e?t.slice(n,n+2):(l-55296<<10)+(a-56320)+65536}}var Gt="Reduce of empty object with no initial value";function H(t,e,n){if(!t)throw Ln(n?e+n:e)}function w(e){if(e==r)throw Ln("Function called on null or undefined");return e}function P(e){H(v(e),e," is not a function!");return e}function A(e){H(f(e),e," is not an object!");return e}function Cn(e,n,t){H(e instanceof n,t,": use the 'new' operator!")}function dn(e,n){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:n}}function ht(e,n,t){e[n]=t;return e}function gt(e){return K?function(n,t,r){return E(n,t,dn(e,r))}:ht}function Kn(e){return j+"("+e+")_"+(++Vt+wt())[U](36)}function F(e,n){return x&&x[e]||(n?x:_)(j+hn+e)}var K=!!function(){try{return E({},hn,T)}catch(e){}}(),Vt=0,a=gt(1),b=x?ht:a,_=x||Kn;function Q(e,n){for(var t in n)a(e,t,n[t]);return e}var Pn=F("unscopables"),tt=p[Pn]||{};var Z=F(Mn),yn=F(ct),Ht=ln in p,c=_("iter"),D=1,I=2,rn={},Mt={},Nt=Z in p,Ot="keys"in p&&!("next"in[].keys());cn(Mt,bn);function cn(e,n){a(e,Z,n);Ht&&a(e,ln,n)}function an(e,n,t,r){e[l]=W(r||Mt,{next:dn(1,t)});J(e,n+" Iterator")}function lt(r,t,a,i){var e=r[l],n=On(e,Z)||On(e,ln)||i&&On(e,i)||a;if(M){cn(e,n);if(n!==a){var o=nn(n.call(new r));J(o,t+" Iterator",true);s(e,ln)&&cn(o,bn)}}rn[t]=n;rn[t+" Iterator"]=bn;return n}function et(a,e,i,o,s,u){function r(e){return function(){return new i(this,e)}}an(i,e,o);var l=r(D+I),n=r(I);if(s==I)n=lt(a,e,n,"values");else l=lt(a,e,l,"entries");if(s){t(C+h*Ot,e,{entries:l,keys:u?n:r(D),values:n})}}function u(e,n){return{value:n,done:!!e}}function $n(r){var e=i(r),t=n[j],l=(t&&t[Mn]||ln)in e;return l||Z in e||s(rn,Sn(e))}function sn(e){var t=n[j],r=e[t&&t[Mn]||ln],l=r||e[Z]||rn[Sn(e)];return A(l.call(e))}function zn(e,n,t){return t?B(e,n):e(n)}function vn(t,e,r,l){var a=sn(t),i=o(r,l,e?2:1),n;while(!(n=a.next()).done)if(zn(i,n.value,e)===false)return}var Wt=pn(Qn)==jt,m={},gn=M?n:m,Yt=n.core,Rt,h=1,L=2,g=4,C=8,ut=16,Yn=32;function t(i,s,p){var t,c,e,u,f=i&L,r=f?n:i&g?n[s]:(n[s]||T)[l],d=f?m:m[s]||(m[s]={});if(f)p=s;for(t in p){c=!(i&h)&&r&&t in r&&(!v(r[t])||en(r[t]));e=(c?r:p)[t];if(i&ut&&c)u=o(e,n);else if(i&Yn&&!M&&r[t]==e){u=function(n){return this instanceof e?new e(n):e(n)};u[l]=e[l]}else u=i&C&&v(e)?o(z,e):e;if(d[t]!=e)a(d,t,u);if(M&&r&&!c){if(f)r[t]=e;
else delete r[t]&&a(r,t,e)}}}if(typeof e!="undefined"&&e.exports)e.exports=m;else if(v(Bn)&&Bn.amd)Bn(function(){return m});else Rt=true;if(Rt||M){m.noConflict=function(){n.core=Yt;return m};n.core=m}t(L+h,{global:n});!function(r,e,n){if(!en(x)){x=function(t){H(!(this instanceof x),j+" is not a "+Hn);var e=Kn(t);K&&n&&E(T,e,{configurable:true,set:function(n){a(this,e,n)}});return b(W(x[l]),r,e)};a(x[l],U,function(){return this[r]})}t(L+Yn,{Symbol:x});var i={"for":function(n){return s(e,n+="")?e[n]:e[n]=x(n)},iterator:Z,keyFor:Tn.call(Un,e),toStringTag:yn=F(ct,true),unscopables:Pn,pure:_,set:b,useSetter:function(){n=true},useSimple:function(){n=false}};X.call(un("hasInstance,isConcatSpreadable,match,replace,search,"+"species,split,toPrimitive"),function(e){i[e]=F(e)});t(g,j,i);J(x,j);t(L,{Reflect:{ownKeys:Xn}})}(_("tag"),{},true);!function(j,P,nn,_){var Z=n.RangeError,cn=Tt.isInteger||function(e){return!f(e)&&P(e)&&yt(e)===e},W=d.sign||function bn(e){return(e=+e)==0||e!=e?e:e<0?-1:1},F=d.pow,Q=d.abs,v=d.exp,x=d.log,B=d.sqrt,mn=y.fromCharCode,gn=Wn(true);var ln={assign:Ct,is:function(e,n){return e===n?e!==0||1/e===1/n:e!=e&&n!=n}};"__proto__"in T&&function(n,e){try{e=o(z,G(T,"__proto__").set,2);e({},p)}catch(t){n=true}ln.setPrototypeOf=_n=_n||function(r,t){A(r);H(t===null||f(t),t,": can't set as prototype!");if(n)r.__proto__=t;else e(r,t);return r}}();t(g,O,ln);function an(e){return!P(e=+e)||e==0?e:e<0?-an(-e):x(e+B(e*e+1))}t(g,En,{EPSILON:F(2,-52),isFinite:function(e){return typeof e=="number"&&P(e)},isInteger:cn,isNaN:Jn,isSafeInteger:function(e){return cn(e)&&Q(e)<=An},MAX_SAFE_INTEGER:An,MIN_SAFE_INTEGER:-An,parseFloat:parseFloat,parseInt:parseInt});t(g,Gn,{acosh:function(e){return(e=+e)<1?NaN:x(e+B(e*e-1))},asinh:an,atanh:function(e){return(e=+e)==0?e:x((1+e)/(1-e))/2},cbrt:function(e){return W(e=+e)*F(Q(e),1/3)},clz32:function(e){return(e>>>=0)?32-e[U](2).length:32},cosh:function(e){return(v(e=+e)+v(-e))/2},expm1:function(e){return(e=+e)==0?e:e>-1e-6&&e<1e-6?e+e*e/2:v(e)-1},fround:function(e){return new Float32Array([e])[0]},hypot:function(i,s){var r=0,n=arguments.length,l=n,a=R(n),t=-$,e;while(n--){e=a[n]=+arguments[n];if(e==$||e==-$)return $;if(e>t)t=e}t=e||1;while(l--)r+=F(a[l]/t,2);return t*B(r)},imul:function(a,i){var e=65535,n=+a,t=+i,r=e&n,l=e&t;return 0|r*l+((e&n>>>16)*l+r*(e&t>>>16)<<16>>>0)},log1p:function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:x(1+e)},log10:function(e){return x(e)/d.LN10},log2:function(e){return x(e)/d.LN2},sign:W,sinh:function(e){return(e=+e)==0?e:(v(e)-v(-e))/2},tanh:function(e){return P(e=+e)?e==0?e:(v(e)-v(-e))/(v(e)+v(-e)):W(e)},trunc:St});J(d,Gn,true);function Y(e){if(pn(e)==xn)throw Ln()}t(g,on,{fromCodePoint:function(l){var n=[],r=arguments.length,t=0,e;while(r>t){e=+arguments[t++];if(V(e,1114111)!==e)throw Z(e+" is not a valid code point");n.push(e<65536?mn(e):mn(((e-=65536)>>10)+55296,e%1024+56320))}return n.join("")},raw:function(r){var t=k(r.raw),l=S(t.length),a=arguments.length,n=[],e=0;while(l>e){n.push(y(t[e++]));if(e<a)n.push(y(arguments[e]))}return n.join("")}});t(C,on,{codePointAt:Wn(false),endsWith:function(e){Y(e);var n=y(w(this)),t=arguments[1],l=S(n.length),a=t===r?l:q(S(t),l);e+="";return n.slice(a-e.length,a)===e},includes:function(e){Y(e);return!!~y(w(this)).indexOf(e,arguments[1])},repeat:function(r){var n=y(w(this)),t="",e=kn(r);if(0>e||e==$)throw Z("Count can't be negative");for(;e>0;(e>>>=1)&&(n+=n))if(e&1)t+=n;return t},startsWith:function(e){Y(e);var n=y(w(this)),t=S(q(arguments[1],n.length));e+="";return n.slice(t,t+e.length)===e}});et(y,on,function(e){b(this,c,{o:y(e),i:0})},function(){var e=this[c],t=e.o,r=e.i,n;if(r>=t.length)return u(1);n=gn.call(t,r);e.i+=n.length;return u(0,n)});t(g,N,{from:function(d){var n=i(w(d)),t=new(Dn(this,R)),u=arguments[1],f=arguments[2],l=u!==r,s=l?o(u,f,2):r,e=0,c;if($n(n))for(var p=sn(n),a;!(a=p.next()).done;e++){t[e]=l?s(a.value,e):a.value}else for(c=S(n.length);c>e;e++){t[e]=l?s(n[e],e):n[e]}t.length=e;return t},of:function(){var e=0,n=arguments.length,t=new(Dn(this,R))(n);while(n>e)t[e]=arguments[e++];t.length=n;return t}});t(C,N,{copyWithin:function(u,c){var t=i(w(this)),l=S(t.length),e=V(u,l),n=V(c,l),o=arguments[2],f=o===r?l:V(o,l),a=q(f-n,l-e),s=1;if(n<e&&e<n+a){s=-1;n=n+a-1;e=e+a-1}while(a-->0){if(n in t)t[e]=t[n];else delete t[e];e+=s;n+=s}return t},fill:function(a){var e=i(w(this)),n=S(e.length),t=V(arguments[1],n),l=arguments[2],s=l===r?n:V(l,n);while(s>t)e[t++]=a;return e},find:st(5),findIndex:st(6)});et(R,N,function(e,n){b(this,c,{o:k(e),i:0,k:n})},function(){var n=this[c],t=n.o,l=n.k,e=n.i++;if(!t||e>=t.length)return n.o=r,u(1);if(l==D)return u(0,e);if(l==I)return u(0,t[e]);return u(0,[e,t[e]])},I);rn[Dt]=rn[N];J(n.JSON,"JSON",true);function e(r,n){var e=i[r],l=m[O][r],a=0,s={};if(!l||en(l)){s[r]=n==1?function(n){return f(n)?e(n):n}:n==2?function(n){return f(n)?e(n):true}:n==3?function(n){return f(n)?e(n):false}:n==4?function(n,t){return e(k(n),t)}:function(n){return e(k(n))};try{e(hn)}catch(o){a=1}t(g+h*a,O,s)}}e("freeze",1);e("seal",1);e("preventExtensions",1);e("isFrozen",2);e("isSealed",2);e("isExtensible",3);e("getOwnPropertyDescriptor",4);e("getPrototypeOf");e("keys");e("getOwnPropertyNames");if(M){nn[yn]=hn;if(pn(nn)!=hn)a(T,U,function(){return"[object "+Sn(this)+"]"});_ in fn||E(fn,_,{configurable:true,get:function(){var e=y(this).match(/^\s*function ([^ (]*)/),n=e?e[1]:"";s(this,_)||E(this,_,dn(5,n));return n},set:function(e){s(this,_)||E(this,_,dn(0,e))}});var vn=tn;var L=function wn(e,n){return new vn(pn(e)==xn&&n!==r?e.source:e,n)};if(K&&!function(){try{return tn(/a/g,"i")=="/a/i"}catch(e){}}()){X.call(qn(tn),function(e){e in L||E(L,e,{configurable:true,get:function(){return tn[e]},set:function(n){tn[e]=n}})});j[Hn]=L;L[l]=j;a(n,xn,L)}if(/./g.flags!="g")E(j,"flags",{configurable:true,get:Rn(/^.*\/(\w*)$/,"$1")});X.call(un("find,findIndex,fill,copyWithin,entries,keys,values"),function(e){tt[e]=true});Pn in p||a(p,Pn,tt)}}(tn[l],isFinite,{},"name");v(jn)&&v(Zn)||function(f){var p=n.postMessage,u=n.addEventListener,c=n.MessageChannel,l=0,t={},e,a,i;jn=function(n){var r=[],a=1;while(arguments.length>a)r.push(arguments[a++]);t[++l]=function(){B(v(n)?n:Lt(n),r)};e(l);return l};Zn=function(e){delete t[e]};function r(e){if(s(t,e)){var n=t[e];delete t[e];n()}}function d(e){r(e.data)}if(Wt){e=function(e){mt(Tn.call(r,e))}}else if(u&&v(p)&&!n.importScripts){e=function(e){p(e,"*")};u("message",d,false)}else if(v(c)){a=new c;i=a.port2;a.port1.onmessage=d;e=o(i.postMessage,i,1)}else if(wn&&f in wn[Pt]("script")){e=function(e){dt.appendChild(wn[Pt]("script"))[f]=function(){dt.removeChild(this);r(e)}}}else{e=function(e){Ut(Tn.call(r,e),0)}}}("onreadystatechange");t(L+ut,{setImmediate:jn,clearImmediate:Zn});!function(e,n){v(e)&&v(e.resolve)&&e.resolve(n=new e(function(){}))==n||function(c,i){function s(n){var e;if(f(n))e=n.then;return v(e)?e:false}function t(n){var e=n.chain;e.length&&c(function(){var t=n.msg,l=n.state==1,r=0;while(e.length>r)!function(e){var r=l?e.ok:e.fail,n,a;try{if(r){n=r===true?t:r(t);if(n===e.P){e.rej(Ln(In+"-chain cycle"))}else if(a=s(n)){a.call(n,e.res,e.rej)}else e.res(n)}else e.rej(t)}catch(i){e.rej(i)}}(e[r++]);e.length=0})}function u(l){var e=this,a,r;if(e.done)return;e.done=true;e=e.def||e;try{if(a=s(l)){r={def:e,done:false};a.call(l,o(u,r,1),o(n,r,1))}else{e.msg=l;e.state=1;t(e)}}catch(i){n.call(r||{def:e,done:false},i)}}function n(n){var e=this;if(e.done)return;e.done=true;e=e.def||e;e.msg=n;e.state=2;t(e)}e=function(l){P(l);Cn(this,e,In);var t={chain:[],state:0,done:false,msg:r};a(this,i,t);try{l(o(u,t,1),o(n,t,1))}catch(s){n.call(t,s)}};Q(e[l],{then:function(r,l){var e={ok:v(r)?r:true,fail:v(l)?l:false},a=e.P=new this[Hn](function(n,t){e.res=P(n);e.rej=P(t)}),n=this[i];n.chain.push(e);n.state&&t(n);return a},"catch":function(e){return this.then(r,e)}});Q(e,{all:function(t){var n=this,e=[];return new n(function(a,i){vn(t,false,Et,e);var r=e.length,l=R(r);if(r)X.call(e,function(e,t){n.resolve(e).then(function(e){l[t]=e;--r||a(l)},i)});else a(l)})},race:function(n){var e=this;return new e(function(t,r){vn(n,false,function(n){e.resolve(n).then(t,r)})})},reject:function(e){return new this(function(t,n){n(e)})},resolve:function(e){return f(e)&&nn(e)===this[l]?e:new this(function(n,t){n(e)})}})}(mt||jn,_("def"));J(e,In);t(L+h*!en(e),{Promise:e})}(n[In]);!function(){var e=_("uid"),p=_("data"),n=_("weak"),d=_("last"),i=_("first"),m=K?_("size"):"size",v=0;function y(n,o,T,A,g,f){var _=g?"set":"add",x=n&&n[l],C={};function S(e,n){if(n!=r)vn(n,g,e[_],e);return e}function y(e,n){var t=x[e];M&&a(x,e,function(e,r){var l=t.call(this,e===0?0:e,r);return n?this:l})}if(!en(n)||!(f||!Ot&&s(x,"entries"))){n=f?function(t){Cn(this,n,o);b(this,e,v++);S(this,t)}:function(t){var e=this;Cn(e,n,o);b(e,p,W(null));b(e,m,0);b(e,d,r);b(e,i,r);S(e,t)};Q(Q(n[l],T),A);f||E(n[l],"size",{get:function(){return w(this[m])}})}else{var P=n,k=new n,j=k[_](f?{}:-0,1),R;if(!Nt||!n.length){n=function(e){Cn(this,n,o);return S(new P,e)};n[l]=x}f||k[At](function(n,e){R=1/e===-$});if(R){y("delete");y("has");g&&y("get")}if(R||j!==k)y(_,true)}J(n,o);C[o]=n;t(L+Yn+h*!en(n),C);f||et(n,o,function(e,n){b(this,c,{o:e,k:n})},function(){var n=this[c],t=n.o,l=n.k,e=n.l;while(e&&e.r)e=e.p;if(!t||!(n.l=e=e?e.n:t[i]))return n.o=r,u(1);if(l==D)return u(0,e.k);if(l==I)return u(0,e.v);return u(0,[e.k,e.v])},g?D+I:I,!g);return n}function g(n,t){if(!f(n))return(typeof n=="string"?"S":"P")+n;if(!s(n,e)){if(t)a(n,e,++v);else return""}return"O"+n[e]}function x(e,a,s){var t=g(a,true),r=e[p],l=e[d],n;if(t in r)r[t].v=s;else{n=r[t]={k:a,v:s,p:l};if(!e[i])e[i]=n;if(l)l.n=n;e[d]=n;e[m]++}return e}function S(e,l){var a=e[p],n=a[l],t=n.n,r=n.p;delete a[l];n.r=true;if(r)r.n=t;if(t)t.p=r;if(e[i]==n)e[i]=t;if(e[d]==n)e[d]=r;e[m]--}var k={clear:function(){for(var e in this[p])S(this,e)},"delete":function(t){var e=g(t),n=e in this[p];if(n)S(this,e);return n},forEach:function(n){var t=o(n,arguments[1],3),e;while(e=e?e.n:this[i]){t(e.v,e.k,this);while(e&&e.r)e=e.p}},has:function(e){return g(e)in this[p]}};rt=y(rt,xt,{get:function(n){var e=this[p][g(n)];return e&&e.v},set:function(e,n){return x(this,e===0?0:e,n)}},k,true);kt=y(kt,Vn,{add:function(e){return x(this,e=e===0?0:e,e)}},k);function R(r,t,l){s(A(t),n)||a(t,n,{});t[n][r[e]]=l;return r}function C(t){return f(t)&&s(t,n)&&s(t[n],this[e])}var T={"delete":function(t){return C.call(this,t)&&delete t[n][this[e]]},has:C};nt=y(nt,ot,{get:function(t){if(f(t)&&s(t,n))return t[n][this[e]]},set:function(e,n){return R(this,e,n)}},T,true,true);_t=y(_t,pt,{add:function(e){return R(this,e,true)}},T,false,true)}();!function(){function e(e){var n=[],t;for(t in e)n.push(t);b(this,c,{o:e,a:n,i:0})}an(e,O,function(){var e=this[c],n=e.a,t;do{if(e.i>=n.length)return u(1)}while(!((t=n[e.i++])in e.o));return u(0,t)});function n(e){return function(n){A(n);try{return e.apply(r,arguments),true}catch(t){return false}}}function l(n,t){var a=arguments.length<3?n:arguments[2],e=G(A(n),t),i;if(e)return e.get?e.get.call(a):e.value;return f(i=nn(n))?l(i,t,a):r}function a(r,n,l){var t=arguments.length<4?r:arguments[3],e=G(A(r),n),i;if(e){if(e.writable===false)return false;if(e.set)return e.set.call(t,l),true}if(f(i=nn(r)))return a(i,n,l,t);e=G(t,n)||dn(0);e.value=l;return E(t,n,e),true}var s={apply:o(z,it,3),construct:zt,defineProperty:n(E),deleteProperty:function(e,n){var t=G(A(e),n);return t&&!t.configurable?false:delete e[n]},enumerate:function(n){return new e(A(n))},get:l,getOwnPropertyDescriptor:G,getPrototypeOf:nn,has:function(e,n){return n in e},isExtensible:i.isExtensible||function(e){return!!A(e)},ownKeys:Xn,preventExtensions:n(i.preventExtensions||$t),set:a};if(_n)s.setPrototypeOf=function(e,n){return _n(A(e),n),true};t(L,{Reflect:{}});t(g,"Reflect",s)}();!function(){t(C,N,{includes:Bt(true)});t(C,on,{at:Wn(true)});function e(e){return function(a){var i=k(a),t=mn(a),r=t.length,n=0,l=R(r),s;if(e)while(r>n)l[n]=[s=t[n++],i[s]];else while(r>n)l[n]=i[t[n++]];return l}}t(g,O,{values:e(false),entries:e(true)});t(g,xn,{escape:Rn(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",true)})}();!function(e){Y=F(e+"Get",true);var n=F(e+Vn,true),r=F(e+"Delete",true);t(g,j,{referenceGet:Y,referenceSet:n,referenceDelete:r});a(fn,Y,bn);function i(t){if(t){var e=t[l];a(e,Y,e.get);a(e,n,e.set);a(e,r,e["delete"])}}i(rt);i(nt)}("reference");!function(y){function n(e){var n=W(null);if(e!=r){if($n(e)){for(var a=sn(e),l,t;!(l=a.next()).done;){t=l.value;n[t[0]]=t[1]}}else Ct(n,e)}return n}n[l]=null;function d(e,n){b(this,c,{o:k(e),a:mn(e),i:0,k:n})}an(d,y,function(){var e=this[c],t=e.o,r=e.a,l=e.k,n;do{if(e.i>=r.length)return u(1)}while(!s(t,n=r[e.i++]));if(l==D)return u(0,n);if(l==I)return u(0,t[n]);return u(0,[n,t[n]])});function a(e){return function(n){return new d(n,e)}}function e(e){var l=e==1,t=e==4;return function(p,d,m){var h=o(d,m,3),f=k(p),u=l||e==7||e==2?new(Dn(this,n)):r,a,c,i;for(a in f)if(s(f,a)){c=f[a];i=h(c,a,p);if(e){if(l)u[a]=i;else if(i)switch(e){case 2:u[a]=c;break;case 3:return true;case 5:return c;case 6:return a;case 7:u[i[0]]=i[1]}else if(t)return false}}return e==3||t?t:u}}function m(e){return function(p,d,a){P(d);var l=k(p),o=mn(l),m=o.length,u=0,t,c,f;if(e)t=a==r?new(Dn(this,n)):i(a);else if(arguments.length<3){H(m,Gt);t=l[o[u++]]}else t=i(a);while(m>u)if(s(l,c=o[u++])){f=d(t,l[c],c,p);if(e){if(f===false)break}else t=f}return t}}var g=e(6);function v(n,e){return(e==e?Un(n,e):g(n,Jn))!==r}var p={keys:a(D),values:a(I),entries:a(D+I),forEach:e(0),map:e(1),filter:e(2),some:e(3),every:e(4),find:e(5),findKey:g,mapPairs:e(7),reduce:m(false),turn:m(true),keyOf:Un,includes:v,has:s,get:On,set:gt(0),isDict:function(e){return f(e)&&nn(e)===n[l]}};if(Y)for(var x in p)!function(e){function n(){for(var n=[this],t=0;t<arguments.length;)n.push(arguments[t++]);return B(e,n)}e[Y]=function(){return n}}(p[x]);t(L+h,{Dict:Q(n,p)})}("Dict");!function(e,a){function n(t,r){if(!(this instanceof n))return new n(t,r);this[c]=sn(t);this[e]=!!r}an(n,"Wrapper",function(){return this[c].next()});var i=n[l];cn(i,function(){return this[c]});function s(t){function n(n,t,r){this[c]=sn(n);this[e]=n[e];this[a]=o(t,r,n[e]?2:1)}an(n,"Chain",t,i);cn(n[l],bn);return n}var f=s(function(){var n=this[c].next();return n.done?n:u(0,zn(this[a],n.value,this[e]))});var p=s(function(){for(;;){var n=this[c].next();if(n.done||zn(this[a],n.value,this[e]))return n}});Q(i,{of:function(n,t){vn(this,this[e],n,t)},array:function(e,t){var n=[];vn(e!=r?this.map(e,t):this,false,Et,n);return n},filter:function(e,n){return new p(this,e,n)},map:function(e,n){return new f(this,e,n)}});n.isIterable=$n;n.getIterator=sn;t(L+h,{$for:n})}("entries",_("fn"));!function(e,l){m._=gn._=gn._||{};t(C+h,It,{part:Tn,by:function(i){var e=this,l=gn._,s=false,n=arguments.length,u=i===l,t=+!u,c=t,r,a;if(u){r=e;e=z}else r=i;if(n<2)return o(e,r,-1);a=R(n-c);while(n>t)if((a[t-c]=arguments[t++])===l)s=true;return at(e,a,n,s,l,true,r)},only:function(e,n){var t=P(this),r=S(e),l=arguments.length>1;return function(){var a=q(r,arguments.length),i=R(a),e=0;while(a>e)i[e]=arguments[e++];return B(t,i,l?n:this)}}});function n(i){var n=this,t={};return a(n,e,function(e){if(e===r||!(e in n))return l.call(n);return s(t,e)?t[e]:t[e]=o(n[e],n,-1)})[e](i)}a(gn._,U,function(){return e});a(T,e,n);K||a(p,e,n)}(K?Kn("tie"):bt,T[bt]);!function(){function e(e,n){var t=Xn(k(n)),a=t.length,r=0,l;while(a>r)E(e,l=t[r++],G(n,l));return e}t(g+h,O,{isObject:f,classof:Sn,define:e,make:function(n,t){return e(W(n),t)}})}();t(C+h,N,{turn:function(n,t){P(n);var l=t==r?[]:i(t),a=Fn(this),s=S(a.length),e=0;while(s>e)if(n(l,a[e],e++,this)===false)break;return l}});if(M)tt.turn=true;!function(n){function e(e,t){X.call(un(e),function(e){if(e in p)n[e]=o(z,p[e],t)})}e("pop,reverse,shift,keys,values,entries",1);e("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3);e("join,slice,concat,push,splice,unshift,sort,lastIndexOf,"+"reduce,reduceRight,copyWithin,fill,turn");t(g,N,n)}({});!function(e){function n(e){b(this,c,{l:S(e),i:0})}an(n,En,function(){var e=this[c],n=e.i++;return n<e.l?u(0,n):u(1)});lt(Tt,En,function(){return new n(this)});e.random=function(e){var n=+this,t=e==r?0:+e,l=q(n,t);return wt()*(vt(n,t)-l)+l};X.call(un("round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,"+"acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc"),function(n){var t=d[n];if(t)e[n]=function(){var e=[+this],n=0;while(arguments.length>n)e.push(arguments[n++]);return B(t,e)}});t(C+h,En,e)}({});!function(){var e={"&":"&","<":"<",">":">",'"':""","'":"'"},r={},n;for(n in e)r[e[n]]=n;t(C+h,on,{escapeHTML:Rn(/[&<>"']/g,e),unescapeHTML:Rn(/&(?:amp|lt|gt|quot|apos);/g,r)})}();!function(d,p,n,r,u,i,o,l,c){function f(t){return function(m,p){var h=this,f=n[s(n,p)?p:r];function a(e){return h[t+e]()}return y(m).replace(d,function(n){switch(n){case"s":return a(u);case"ss":return e(a(u));case"m":return a(i);case"mm":return e(a(i));case"h":return a(o);case"hh":return e(a(o));case"D":return a(Nn);case"DD":return e(a(Nn));case"W":return f[0][a("Day")];case"N":return a(l)+1;case"NN":return e(a(l)+1);case"M":return f[2][a(l)];case"MM":return f[1][a(l)];case"Y":return a(c);case"YY":return e(a(c)%100)}return n})}}function e(e){return e>9?e:"0"+e}function a(r,e){function t(t){var n=[];X.call(un(e.months),function(e){n.push(e.replace(p,"$"+t))});return n}n[r]=[un(e.weekdays),t(1),t(2)];return m}t(C+h,Nn,{format:f("get"),formatUTC:f("getUTC")});a(r,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"});a("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,"+"Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"});m.locale=function(e){return s(n,e)?r=e:r};m.addLocale=a}(/\b\w\w?\b/g,/:(.*)\|(.*)$/,{},"en","Seconds","Minutes","Hours","Month","FullYear")}(typeof self!="undefined"&&self.Math===Math?self:Function("return this")(),false)},{}],136:[function(n,t,e){(function(t,n){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],n)}else if(typeof e!=="undefined"){n(e)}else{n(t.estraverse={})}})(this,function r(t){"use strict";var c,i,s,d,g,u,n,r,l;function h(){}i=Array.isArray;if(!i){i=function k(e){return Object.prototype.toString.call(e)==="[object Array]"}}function m(t){var r={},e,n;for(e in t){if(t.hasOwnProperty(e)){n=t[e];if(typeof n==="object"&&n!==null){r[e]=m(n)}else{r[e]=n}}}return r}function v(n){var t={},e;for(e in n){if(n.hasOwnProperty(e)){t[e]=n[e]}}return t}h(v);function E(l,a){var n,e,t,r;e=l.length;t=0;while(e){n=e>>>1;r=t+n;if(a(l[r])){e=n}else{t=r+1;e-=n+1}}return t}function x(l,a){var n,e,t,r;e=l.length;t=0;while(e){n=e>>>1;r=t+n;if(a(l[r])){t=r+1;e-=n+1}else{e=n}}return t}h(x);g=Object.create||function(){function e(){}return function(n){e.prototype=n;return new e}}();u=Object.keys||function(t){var e=[],n;for(n in t){e.push(n)}return e};function b(e,n){u(n).forEach(function(t){e[t]=n[t]});return e}c={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};d={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};n={};r={};l={};s={Break:n,Skip:r,Remove:l};function o(e,n){this.parent=e;this.key=n}o.prototype.replace=function I(e){this.parent[this.key]=e};o.prototype.remove=function R(){if(i(this.parent)){this.parent.splice(this.key,1);return true}else{this.replace(null);return false}};function a(e,n,t,r){this.node=e;this.path=n;this.wrap=t;this.ref=r}function e(){}e.prototype.path=function C(){var e,r,n,l,t,a;function s(t,e){if(i(e)){for(n=0,l=e.length;n<l;++n){t.push(e[n])}}else{t.push(e)}}if(!this.__current.path){return null}t=[];for(e=2,r=this.__leavelist.length;e<r;++e){a=this.__leavelist[e];s(t,a.path)}s(t,this.__current.path);return t};e.prototype.type=function(){var e=this.current();return e.type||this.__current.wrap};e.prototype.parents=function A(){var e,t,n;n=[];for(e=1,t=this.__leavelist.length;e<t;++e){n.push(this.__leavelist[e].node)}return n};e.prototype.current=function T(){return this.__current.node};e.prototype.__execute=function L(n,t){var r,e;e=undefined;r=this.__current;this.__current=t;this.__state=null;if(n){e=n.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)}this.__current=r;return e};e.prototype.notify=function P(e){this.__state=e};e.prototype.skip=function(){this.notify(r)};e.prototype["break"]=function(){this.notify(n)};e.prototype.remove=function(){this.notify(l)};e.prototype.__initialize=function(n,e){this.visitor=e;this.root=n;this.__worklist=[];this.__leavelist=[];this.__current=null;this.__state=null;this.__fallback=e.fallback==="iteration";this.__keys=d;if(e.keys){this.__keys=b(g(this.__keys),e.keys)}};function f(e){if(e==null){return false}return typeof e==="object"&&typeof e.type==="string"}function y(e,n){return(e===c.ObjectExpression||e===c.ObjectPattern)&&"properties"===n}e.prototype.traverse=function j(b,x){var s,h,e,d,g,c,p,m,l,o,t,v;this.__initialize(b,x);v={};s=this.__worklist;h=this.__leavelist;s.push(new a(b,null,null,null));h.push(new a(null,null,null,null));while(s.length){e=s.pop();if(e===v){e=h.pop();c=this.__execute(x.leave,e);if(this.__state===n||c===n){return}continue}if(e.node){c=this.__execute(x.enter,e);if(this.__state===n||c===n){return}s.push(v);h.push(e);if(this.__state===r||c===r){continue}d=e.node;g=e.wrap||d.type;o=this.__keys[g];if(!o){if(this.__fallback){o=u(d)}else{throw new Error("Unknown node type "+g+".")}}m=o.length;while((m-=1)>=0){p=o[m];t=d[p];if(!t){continue}if(i(t)){l=t.length;while((l-=1)>=0){if(!t[l]){continue}if(y(g,o[m])){e=new a(t[l],[p,l],"Property",null)}else if(f(t[l])){e=new a(t[l],[p,l],null,null)}else{continue}s.push(e)}}else if(f(t)){s.push(new a(t,p,null,null))}}}}};e.prototype.replace=function M(E,w){function S(n){var t,r,e,l;if(n.ref.remove()){r=n.ref.key;l=n.ref.parent;t=p.length;while(t--){e=p[t];if(e.ref&&e.ref.parent===l){if(e.ref.key<r){break}--e.ref.key}}}}var p,b,m,v,t,e,x,c,d,s,_,g,h;this.__initialize(E,w);_={};p=this.__worklist;b=this.__leavelist;g={root:E};e=new a(E,null,null,new o(g,"root"));p.push(e);b.push(e);while(p.length){e=p.pop();if(e===_){e=b.pop();t=this.__execute(w.leave,e);if(t!==undefined&&t!==n&&t!==r&&t!==l){e.ref.replace(t)}if(this.__state===l||t===l){S(e)}if(this.__state===n||t===n){return g.root}continue}t=this.__execute(w.enter,e);if(t!==undefined&&t!==n&&t!==r&&t!==l){e.ref.replace(t);e.node=t}if(this.__state===l||t===l){S(e);e.node=null}if(this.__state===n||t===n){return g.root}m=e.node;if(!m){continue}p.push(_);b.push(e);if(this.__state===r||t===r){continue}v=e.wrap||m.type;d=this.__keys[v];if(!d){if(this.__fallback){d=u(m)}else{throw new Error("Unknown node type "+v+".")}}x=d.length;while((x-=1)>=0){h=d[x];s=m[h];if(!s){continue}if(i(s)){c=s.length;while((c-=1)>=0){if(!s[c]){continue}if(y(v,d[x])){e=new a(s[c],[h,c],"Property",new o(s,c))}else if(f(s[c])){e=new a(s[c],[h,c],null,new o(s,c))}else{continue}p.push(e)}}else if(f(s)){p.push(new a(s,h,null,new o(m,h)))}}}return g.root};function p(n,t){var r=new e;return r.traverse(n,t)}function w(n,t){var r=new e;return r.replace(n,t)}function _(e,t){var n;n=E(t,function r(n){return n.range[0]>e.range[0]});e.extendedRange=[e.range[0],e.range[1]];if(n!==t.length){e.extendedRange[1]=t[n].range[0]}n-=1;if(n>=0){e.extendedRange[0]=t[n].range[1]}return e}function S(r,l,o){var n=[],i,a,t,e;if(!r.range){throw new Error("attachComments needs range information")}if(!o.length){if(l.length){for(t=0,a=l.length;t<a;t+=1){i=m(l[t]);i.extendedRange=[0,r.range[0]];n.push(i)}r.leadingComments=n}return r}for(t=0,a=l.length;t<a;t+=1){n.push(_(m(l[t]),o))}e=0;p(r,{enter:function(t){var r;while(e<n.length){r=n[e];if(r.extendedRange[1]>t.range[0]){break}if(r.extendedRange[1]===t.range[0]){if(!t.leadingComments){t.leadingComments=[]}t.leadingComments.push(r);n.splice(e,1)}else{e+=1}}if(e===n.length){return s.Break}if(n[e].extendedRange[0]>t.range[1]){return s.Skip}}});e=0;p(r,{leave:function(t){var r;while(e<n.length){r=n[e];if(t.range[1]<r.extendedRange[0]){break}if(t.range[1]===r.extendedRange[0]){if(!t.trailingComments){t.trailingComments=[]}t.trailingComments.push(r);n.splice(e,1)}else{e+=1}}if(e===n.length){return s.Break}if(n[e].extendedRange[0]>t.range[1]){return s.Skip}}});return r}t.version="1.8.1-dev";t.Syntax=c;t.traverse=p;t.replace=w;t.attachComments=S;t.VisitorKeys=d;t.VisitorOption=s;t.Controller=e;t.cloneEnvironment=function(){return r({})};return t})},{}],137:[function(n,e,t){(function(){"use strict";function r(e){if(e==null){return false}switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return true}return false}function l(e){if(e==null){return false}switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return true}return false}function n(e){if(e==null){return false}switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return true}return false}function a(e){return n(e)||e!=null&&e.type==="FunctionDeclaration"}function t(e){switch(e.type){case"IfStatement":if(e.alternate!=null){return e.alternate}return e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function i(n){var e;if(n.type!=="IfStatement"){return false}if(n.alternate==null){return false}e=n.consequent;do{if(e.type==="IfStatement"){if(e.alternate==null){return true}}e=t(e)}while(e);return false}e.exports={isExpression:r,isStatement:n,isIterationStatement:l,isSourceElement:a,isProblematicIfStatement:i,trailingStatement:t}})()},{}],138:[function(n,e,t){(function(){"use strict";var n,t;n={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};
function r(e){return e>=48&&e<=57}function l(e){return r(e)||97<=e&&e<=102||65<=e&&e<=70}function a(e){return e>=48&&e<=55}t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function i(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&t.indexOf(e)>=0}function s(e){return e===10||e===13||e===8232||e===8233}function o(e){return e>=97&&e<=122||e>=65&&e<=90||e===36||e===95||e===92||e>=128&&n.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function u(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===36||e===95||e===92||e>=128&&n.NonAsciiIdentifierPart.test(String.fromCharCode(e))}e.exports={isDecimalDigit:r,isHexDigit:l,isOctalDigit:a,isWhiteSpace:i,isLineTerminator:s,isIdentifierStart:o,isIdentifierPart:u}})()},{}],139:[function(e,n,t){(function(){"use strict";var l=e("./code");function o(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false}}function a(e,n){if(!n&&e==="yield"){return false}return t(e,n)}function t(e,n){if(n&&o(e)){return true}switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="yield"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return false}}function i(e,n){return e==="null"||e==="true"||e==="false"||a(e,n)}function s(e,n){return e==="null"||e==="true"||e==="false"||t(e,n)}function u(e){return e==="eval"||e==="arguments"}function r(n){var t,r,e;if(n.length===0){return false}e=n.charCodeAt(0);if(!l.isIdentifierStart(e)||e===92){return false}for(t=1,r=n.length;t<r;++t){e=n.charCodeAt(t);if(!l.isIdentifierPart(e)||e===92){return false}}return true}function c(e,n){return r(e)&&!i(e,n)}function f(e,n){return r(e)&&!s(e,n)}n.exports={isKeywordES5:a,isKeywordES6:t,isReservedWordES5:i,isReservedWordES6:s,isRestrictedWord:u,isIdentifierName:r,isIdentifierES5:c,isIdentifierES6:f}})()},{"./code":138}],140:[function(e,t,n){(function(){"use strict";n.ast=e("./ast");n.code=e("./code");n.keyword=e("./keyword")})()},{"./ast":137,"./code":138,"./keyword":139}],141:[function(n,t,e){"use strict";e.reservedVars={arguments:false,NaN:false};e.ecmaIdentifiers={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Map:false,Math:false,Number:false,Object:false,Proxy:false,Promise:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,Set:false,String:false,SyntaxError:false,TypeError:false,URIError:false,WeakMap:false,WeakSet:false};e.newEcmaIdentifiers={Set:false,Map:false,WeakMap:false,WeakSet:false,Proxy:false,Promise:false,Reflect:false,Symbol:false,System:false};e.browser={Audio:false,Blob:false,addEventListener:false,applicationCache:false,atob:false,blur:false,btoa:false,cancelAnimationFrame:false,CanvasGradient:false,CanvasPattern:false,CanvasRenderingContext2D:false,CSS:false,clearInterval:false,clearTimeout:false,close:false,closed:false,CustomEvent:false,DOMParser:false,defaultStatus:false,Document:false,document:false,Element:false,ElementTimeControl:false,Event:false,event:false,FileReader:false,FormData:false,focus:false,frames:false,getComputedStyle:false,HTMLElement:false,HTMLAnchorElement:false,HTMLBaseElement:false,HTMLBlockquoteElement:false,HTMLBodyElement:false,HTMLBRElement:false,HTMLButtonElement:false,HTMLCanvasElement:false,HTMLDirectoryElement:false,HTMLDivElement:false,HTMLDListElement:false,HTMLFieldSetElement:false,HTMLFontElement:false,HTMLFormElement:false,HTMLFrameElement:false,HTMLFrameSetElement:false,HTMLHeadElement:false,HTMLHeadingElement:false,HTMLHRElement:false,HTMLHtmlElement:false,HTMLIFrameElement:false,HTMLImageElement:false,HTMLInputElement:false,HTMLIsIndexElement:false,HTMLLabelElement:false,HTMLLayerElement:false,HTMLLegendElement:false,HTMLLIElement:false,HTMLLinkElement:false,HTMLMapElement:false,HTMLMenuElement:false,HTMLMetaElement:false,HTMLModElement:false,HTMLObjectElement:false,HTMLOListElement:false,HTMLOptGroupElement:false,HTMLOptionElement:false,HTMLParagraphElement:false,HTMLParamElement:false,HTMLPreElement:false,HTMLQuoteElement:false,HTMLScriptElement:false,HTMLSelectElement:false,HTMLStyleElement:false,HTMLTableCaptionElement:false,HTMLTableCellElement:false,HTMLTableColElement:false,HTMLTableElement:false,HTMLTableRowElement:false,HTMLTableSectionElement:false,HTMLTextAreaElement:false,HTMLTitleElement:false,HTMLUListElement:false,HTMLVideoElement:false,history:false,Image:false,Intl:false,length:false,localStorage:false,location:false,matchMedia:false,MessageChannel:false,MessageEvent:false,MessagePort:false,MouseEvent:false,moveBy:false,moveTo:false,MutationObserver:false,name:false,Node:false,NodeFilter:false,NodeList:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,openDatabase:false,opener:false,Option:false,parent:false,print:false,requestAnimationFrame:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,sessionStorage:false,setInterval:false,setTimeout:false,SharedWorker:false,status:false,SVGAElement:false,SVGAltGlyphDefElement:false,SVGAltGlyphElement:false,SVGAltGlyphItemElement:false,SVGAngle:false,SVGAnimateColorElement:false,SVGAnimateElement:false,SVGAnimateMotionElement:false,SVGAnimateTransformElement:false,SVGAnimatedAngle:false,SVGAnimatedBoolean:false,SVGAnimatedEnumeration:false,SVGAnimatedInteger:false,SVGAnimatedLength:false,SVGAnimatedLengthList:false,SVGAnimatedNumber:false,SVGAnimatedNumberList:false,SVGAnimatedPathData:false,SVGAnimatedPoints:false,SVGAnimatedPreserveAspectRatio:false,SVGAnimatedRect:false,SVGAnimatedString:false,SVGAnimatedTransformList:false,SVGAnimationElement:false,SVGCSSRule:false,SVGCircleElement:false,SVGClipPathElement:false,SVGColor:false,SVGColorProfileElement:false,SVGColorProfileRule:false,SVGComponentTransferFunctionElement:false,SVGCursorElement:false,SVGDefsElement:false,SVGDescElement:false,SVGDocument:false,SVGElement:false,SVGElementInstance:false,SVGElementInstanceList:false,SVGEllipseElement:false,SVGExternalResourcesRequired:false,SVGFEBlendElement:false,SVGFEColorMatrixElement:false,SVGFEComponentTransferElement:false,SVGFECompositeElement:false,SVGFEConvolveMatrixElement:false,SVGFEDiffuseLightingElement:false,SVGFEDisplacementMapElement:false,SVGFEDistantLightElement:false,SVGFEFloodElement:false,SVGFEFuncAElement:false,SVGFEFuncBElement:false,SVGFEFuncGElement:false,SVGFEFuncRElement:false,SVGFEGaussianBlurElement:false,SVGFEImageElement:false,SVGFEMergeElement:false,SVGFEMergeNodeElement:false,SVGFEMorphologyElement:false,SVGFEOffsetElement:false,SVGFEPointLightElement:false,SVGFESpecularLightingElement:false,SVGFESpotLightElement:false,SVGFETileElement:false,SVGFETurbulenceElement:false,SVGFilterElement:false,SVGFilterPrimitiveStandardAttributes:false,SVGFitToViewBox:false,SVGFontElement:false,SVGFontFaceElement:false,SVGFontFaceFormatElement:false,SVGFontFaceNameElement:false,SVGFontFaceSrcElement:false,SVGFontFaceUriElement:false,SVGForeignObjectElement:false,SVGGElement:false,SVGGlyphElement:false,SVGGlyphRefElement:false,SVGGradientElement:false,SVGHKernElement:false,SVGICCColor:false,SVGImageElement:false,SVGLangSpace:false,SVGLength:false,SVGLengthList:false,SVGLineElement:false,SVGLinearGradientElement:false,SVGLocatable:false,SVGMPathElement:false,SVGMarkerElement:false,SVGMaskElement:false,SVGMatrix:false,SVGMetadataElement:false,SVGMissingGlyphElement:false,SVGNumber:false,SVGNumberList:false,SVGPaint:false,SVGPathElement:false,SVGPathSeg:false,SVGPathSegArcAbs:false,SVGPathSegArcRel:false,SVGPathSegClosePath:false,SVGPathSegCurvetoCubicAbs:false,SVGPathSegCurvetoCubicRel:false,SVGPathSegCurvetoCubicSmoothAbs:false,SVGPathSegCurvetoCubicSmoothRel:false,SVGPathSegCurvetoQuadraticAbs:false,SVGPathSegCurvetoQuadraticRel:false,SVGPathSegCurvetoQuadraticSmoothAbs:false,SVGPathSegCurvetoQuadraticSmoothRel:false,SVGPathSegLinetoAbs:false,SVGPathSegLinetoHorizontalAbs:false,SVGPathSegLinetoHorizontalRel:false,SVGPathSegLinetoRel:false,SVGPathSegLinetoVerticalAbs:false,SVGPathSegLinetoVerticalRel:false,SVGPathSegList:false,SVGPathSegMovetoAbs:false,SVGPathSegMovetoRel:false,SVGPatternElement:false,SVGPoint:false,SVGPointList:false,SVGPolygonElement:false,SVGPolylineElement:false,SVGPreserveAspectRatio:false,SVGRadialGradientElement:false,SVGRect:false,SVGRectElement:false,SVGRenderingIntent:false,SVGSVGElement:false,SVGScriptElement:false,SVGSetElement:false,SVGStopElement:false,SVGStringList:false,SVGStylable:false,SVGStyleElement:false,SVGSwitchElement:false,SVGSymbolElement:false,SVGTRefElement:false,SVGTSpanElement:false,SVGTests:false,SVGTextContentElement:false,SVGTextElement:false,SVGTextPathElement:false,SVGTextPositioningElement:false,SVGTitleElement:false,SVGTransform:false,SVGTransformList:false,SVGTransformable:false,SVGURIReference:false,SVGUnitTypes:false,SVGUseElement:false,SVGVKernElement:false,SVGViewElement:false,SVGViewSpec:false,SVGZoomAndPan:false,TextDecoder:false,TextEncoder:false,TimeEvent:false,top:false,URL:false,WebGLActiveInfo:false,WebGLBuffer:false,WebGLContextEvent:false,WebGLFramebuffer:false,WebGLProgram:false,WebGLRenderbuffer:false,WebGLRenderingContext:false,WebGLShader:false,WebGLShaderPrecisionFormat:false,WebGLTexture:false,WebGLUniformLocation:false,WebSocket:false,window:false,Worker:false,XDomainRequest:false,XMLHttpRequest:false,XMLSerializer:false,XPathEvaluator:false,XPathException:false,XPathExpression:false,XPathNamespace:false,XPathNSResolver:false,XPathResult:false};e.devel={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false};e.worker={importScripts:true,postMessage:true,self:true,FileReaderSync:true};e.nonstandard={escape:false,unescape:false};e.couch={require:false,respond:false,getRow:false,emit:false,send:false,start:false,sum:false,log:false,exports:false,module:false,provides:false};e.node={__filename:false,__dirname:false,GLOBAL:false,global:false,module:false,require:false,Buffer:true,console:true,exports:true,process:true,setTimeout:true,clearTimeout:true,setInterval:true,clearInterval:true,setImmediate:true,clearImmediate:true};e.browserify={__filename:false,__dirname:false,global:false,module:false,require:false,Buffer:true,exports:true,process:true};e.phantom={phantom:true,require:true,WebPage:true,console:true,exports:true};e.qunit={asyncTest:false,deepEqual:false,equal:false,expect:false,module:false,notDeepEqual:false,notEqual:false,notPropEqual:false,notStrictEqual:false,ok:false,propEqual:false,QUnit:false,raises:false,start:false,stop:false,strictEqual:false,test:false,"throws":false};e.rhino={defineClass:false,deserialize:false,gc:false,help:false,importClass:false,importPackage:false,java:false,load:false,loadClass:false,Packages:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false};e.shelljs={target:false,echo:false,exit:false,cd:false,pwd:false,ls:false,find:false,cp:false,rm:false,mv:false,mkdir:false,test:false,cat:false,sed:false,grep:false,which:false,dirs:false,pushd:false,popd:false,env:false,exec:false,chmod:false,config:false,error:false,tempdir:false};e.typed={ArrayBuffer:false,ArrayBufferView:false,DataView:false,Float32Array:false,Float64Array:false,Int16Array:false,Int32Array:false,Int8Array:false,Uint16Array:false,Uint32Array:false,Uint8Array:false,Uint8ClampedArray:false};e.wsh={ActiveXObject:true,Enumerator:true,GetObject:true,ScriptEngine:true,ScriptEngineBuildVersion:true,ScriptEngineMajorVersion:true,ScriptEngineMinorVersion:true,VBArray:true,WSH:true,WScript:true,XDomainRequest:true};e.dojo={dojo:false,dijit:false,dojox:false,define:false,require:false};e.jquery={$:false,jQuery:false};e.mootools={$:false,$$:false,Asset:false,Browser:false,Chain:false,Class:false,Color:false,Cookie:false,Core:false,Document:false,DomReady:false,DOMEvent:false,DOMReady:false,Drag:false,Element:false,Elements:false,Event:false,Events:false,Fx:false,Group:false,Hash:false,HtmlTable:false,IFrame:false,IframeShim:false,InputValidator:false,instanceOf:false,Keyboard:false,Locale:false,Mask:false,MooTools:false,Native:false,Options:false,OverText:false,Request:false,Scroller:false,Slick:false,Slider:false,Sortables:false,Spinner:false,Swiff:false,Tips:false,Type:false,typeOf:false,URI:false,Window:false};e.prototypejs={$:false,$$:false,$A:false,$F:false,$H:false,$R:false,$break:false,$continue:false,$w:false,Abstract:false,Ajax:false,Class:false,Enumerable:false,Element:false,Event:false,Field:false,Form:false,Hash:false,Insertion:false,ObjectRange:false,PeriodicalExecuter:false,Position:false,Prototype:false,Selector:false,Template:false,Toggle:false,Try:false,Autocompleter:false,Builder:false,Control:false,Draggable:false,Draggables:false,Droppables:false,Effect:false,Sortable:false,SortableObserver:false,Sound:false,Scriptaculous:false};e.yui={YUI:false,Y:false,YUI_config:false};e.mocha={describe:false,it:false,before:false,after:false,beforeEach:false,afterEach:false,suite:false,test:false,setup:false,teardown:false};e.jasmine={jasmine:false,describe:false,it:false,xit:false,beforeEach:false,afterEach:false,setFixtures:false,loadFixtures:false,spyOn:false,expect:false,runs:false,waitsFor:false,waits:false}},{}],142:[function(t,e,n){(function(t){(function(){var u;var A=[],P=[];var Q=0;var R=+new Date+"";var T=75;var U=40;var N=" \f "+"\n\r\u2028\u2029"+" ";var X=/\b__p \+= '';/g,nn=/\b(__p \+=) '' \+/g,en=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var K=/\w*$/;var $=/^\s*function[ \n\r\t]+\w/;var F=/<%=([\s\S]+?)%>/g;var tn=RegExp("^["+N+"]*0+(?=.$)");var _=/($^)/;var M=/\bthis\b/;var W=/['\n\r\t\u2028\u2029\\]/g;var J=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var q=0;var b="[object Arguments]",E="[object Array]",x="[object Boolean]",v="[object Date]",B="[object Function]",y="[object Number]",o="[object Object]",g="[object RegExp]",d="[object String]";var s={};s[B]=false;s[b]=s[E]=s[x]=s[v]=s[y]=s[o]=s[g]=s[d]=true;var k={leading:false,maxWait:0,trailing:false};var O={configurable:false,enumerable:false,value:null,writable:false};var l={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var V={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var f=l[typeof window]&&window||this;var w=l[typeof n]&&n&&!n.nodeType&&n;var I=l[typeof e]&&e&&!e.nodeType&&e;var z=I&&I.exports===w&&w;var p=l[typeof t]&&t;if(p&&(p.global===p||p.window===p)){f=p}function m(e,t,r){var n=(r||0)-1,l=e?e.length:0;while(++n<l){if(e[n]===t){return n}}return-1}function S(e,t){var n=typeof t;e=e.cache;if(n=="boolean"||t==null){return e[t]?0:-1}if(n!="number"&&n!="string"){n="object"}var r=n=="number"?t:R+t;e=(e=e[n])&&e[r];return n=="object"?e&&m(e,t)>-1?0:-1:e?0:-1}function G(n){var t=this.cache,e=typeof n;if(e=="boolean"||n==null){t[n]=true}else{if(e!="number"&&e!="string"){e="object"}var r=e=="number"?n:R+n,l=t[e]||(t[e]={});if(e=="object"){(l[r]||(l[r]=[])).push(n)}else{l[r]=true}}}function D(e){return e.charCodeAt(0)}function H(r,l){var a=r.criteria,i=l.criteria,t=-1,s=a.length;while(++t<s){var e=a[t],n=i[t];if(e!==n){if(e>n||typeof e=="undefined"){return 1}if(e<n||typeof n=="undefined"){return-1}}}return r.index-l.index}function L(e){var l=-1,r=e.length,a=e[0],i=e[r/2|0],s=e[r-1];if(a&&typeof a=="object"&&i&&typeof i=="object"&&s&&typeof s=="object"){return false}var n=j();n["false"]=n["null"]=n["true"]=n["undefined"]=false;var t=j();t.array=e;t.cache=n;t.push=G;while(++l<r){t.push(e[l])}return t}function Y(e){return"\\"+V[e]}function i(){return A.pop()||[]}function j(){return P.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function a(e){e.length=0;if(A.length<U){A.push(e)}}function h(e){var n=e.cache;if(n){h(n)}e.array=e.cache=e.criteria=e.object=e.number=e.string=e.value=null;if(P.length<U){P.push(e)}}function r(n,e,t){e||(e=0);if(typeof t=="undefined"){t=n?n.length:0}var r=-1,l=t-e||0,a=Array(l<0?0:l);while(++r<l){a[r]=n[e+r]}return a}function C(n){n=n?c.defaults(f.Object(),n,c.pick(f,J)):f;var z=n.Array,al=n.Boolean,Zn=n.Date,Nn=n.Function,Cn=n.Math,rl=n.Number,gn=n.Object,Rn=n.RegExp,un=n.String,sn=n.TypeError;var yn=[];var at=gn.prototype;var tl=n._;var A=at.toString;var el=Rn("^"+un(A).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var Zr=Cn.ceil,Pn=n.clearTimeout,Vr=Cn.floor,Dr=Nn.prototype.toString,hn=fn(hn=gn.getPrototypeOf)&&hn,P=at.hasOwnProperty,xn=yn.push,wn=n.setTimeout,ft=yn.splice,Mr=yn.unshift;var dt=function(){try{var n={},e=fn(e=gn.defineProperty)&&e,t=e(n,n,n)&&e}catch(r){}return t}();var Tn=fn(Tn=gn.create)&&Tn,Wn=fn(Wn=z.isArray)&&Wn,jr=n.isFinite,Tr=n.isNaN,jn=fn(jn=gn.keys)&&jn,rn=Cn.max,En=Cn.min,nt=n.parseInt,ut=Cn.random;var on={};on[E]=z;on[x]=al;on[v]=Zn;on[B]=Nn;on[o]=gn;on[y]=rl;on[g]=Rn;on[d]=un;function e(e){return e&&typeof e=="object"&&!w(e)&&P.call(e,"__wrapped__")?e:new dn(e)}function dn(e,n){this.__chain__=!!n;this.__wrapped__=e}dn.prototype=e.prototype;var kn=e.support={};kn.funcDecomp=!fn(n.WinRTError)&&M.test(C);kn.funcNames=typeof Nn.name=="string";e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:e}};function Cr(e){var n=e[0],l=e[2],a=e[4];function t(){if(l){var e=r(l);xn.apply(e,arguments)}if(this instanceof t){var i=vn(n.prototype),s=n.apply(i,e||arguments);return I(s)?s:i}return n.apply(a,e||arguments)}Hn(t,e);return t}function et(e,f,m,l,o){if(m){var n=m(e);if(typeof n!="undefined"){return n}}var E=I(e);if(E){var p=A.call(e);if(!s[p]){return e}var u=on[p];switch(p){case x:case v:return new u(+e);case y:case d:return new u(e);case g:n=u(e.source,K.exec(e));n.lastIndex=e.lastIndex;return n}}else{return e}var c=w(e);if(f){var b=!l;l||(l=i());o||(o=i());var h=l.length;while(h--){if(l[h]==e){return o[h]}}n=c?u(e.length):{}}else{n=c?r(e):Fn({},e)}if(c){if(P.call(e,"index")){n.index=e.index}if(P.call(e,"input")){n.input=e.input}}if(!f){return n}l.push(e);o.push(n);(c?U:t)(e,function(e,t){n[t]=et(e,f,m,l,o)});if(b){a(l);a(o)}return n}function vn(e,n){return I(e)?Tn(e):{}}if(!Tn){vn=function(){function e(){}return function(t){if(I(t)){e.prototype=t;var r=new e;e.prototype=null}return r||n.Object()}}()}function G(e,t,l){if(typeof e!="function"){return Gn}if(typeof t=="undefined"||!("prototype"in e)){return e}var n=e.__bindData__;if(typeof n=="undefined"){if(kn.funcNames){n=!e.name}n=n||!kn.funcDecomp;if(!n){var r=Dr.call(e);if(!kn.funcNames){n=!$.test(r)}if(!n){n=M.test(r);Hn(e,n)}}}if(n===false||n!==true&&n[1]&1){return e}switch(l){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,l){return e.call(t,n,r,l)};case 4:return function(n,r,l,a){return e.call(t,n,r,l,a)}}return yt(e,t)}function kt(e){var t=e[0],n=e[1],s=e[2],a=e[3],i=e[4],u=e[5];var c=n&1,f=n&2,o=n&4,p=n&8,d=t;function l(){var m=c?i:this;if(s){var e=r(s);xn.apply(e,arguments)}if(a||o){e||(e=r(arguments));if(a){xn.apply(e,a)}if(o&&e.length<u){n|=16&~32;return kt([t,p?n:n&~3,e,null,i,u])}}e||(e=arguments);if(f){t=m[d]}if(this instanceof l){m=vn(t.prototype);var h=t.apply(m,e);return I(h)?h:m}return t.apply(m,e)}Hn(l,e);return l}function bn(n,e){var l=-1,t=Ln(),a=n?n.length:0,r=a>=T&&t===m,i=[];if(r){var s=L(e);if(s){t=S;e=s}else{r=false}}while(++l<a){var o=n[l];if(t(e,o)<0){i.push(o)}}if(r){h(e)}return i}function cn(t,a,r,u){var l=(u||0)-1,c=t?t.length:0,n=[];while(++l<c){var e=t[l];if(e&&typeof e=="object"&&typeof e.length=="number"&&(w(e)||An(e))){if(!a){e=cn(e,a,r)}var i=-1,s=e.length,o=n.length;n.length+=s;while(++i<s){n[o++]=e[i]}}else if(!r){n.push(e)}}return n}function mn(e,n,h,c,t,s){if(h){var r=h(e,n);if(typeof r!="undefined"){return!!r}}if(e===n){return e!==0||1/e==1/n}var M=typeof e,j=typeof n;if(e===e&&!(e&&l[M])&&!(n&&l[j])){return false}if(e==null||n==null){return e===n}var m=A.call(e),S=A.call(n);if(m==b){m=o}if(S==b){S=o}if(m!=S){return false}switch(m){case x:case v:return+e==+n;case y:return e!=+e?n!=+n:e==0?1/e==1/n:e==+n;case g:case d:return e==un(n)}var R=m==E;if(!R){var I=P.call(e,"__wrapped__"),k=P.call(n,"__wrapped__");if(I||k){return mn(I?e.__wrapped__:e,k?n.__wrapped__:n,h,c,t,s)}if(m!=o){return false}var _=e.constructor,w=n.constructor;if(_!=w&&!(p(_)&&_ instanceof _&&p(w)&&w instanceof w)&&("constructor"in e&&"constructor"in n)){return false}}var L=!t;t||(t=i());s||(s=i());var f=t.length;while(f--){if(t[f]==e){return s[f]==n}}var u=0;r=true;t.push(e);s.push(n);if(R){f=e.length;u=n.length;r=u==f;if(r||c){while(u--){var C=f,T=n[u];if(c){while(C--){if(r=mn(e[C],T,h,c,t,s)){break}}}else if(!(r=mn(e[u],T,h,c,t,s))){break}}}}else{an(n,function(l,n,a){if(P.call(a,n)){u++;return r=P.call(e,n)&&mn(e[n],l,h,c,t,s)}});if(r&&!c){an(e,function(t,e,n){if(P.call(n,e)){return r=--u>-1}})}}t.pop();s.pop();if(L){a(t);a(s)}return r}function st(l,a,e,n,r){(w(a)?U:t)(a,function(a,u){var c,f,i=a,t=l[u];if(a&&((f=w(a))||tt(a))){var s=n.length;while(s--){if(c=n[s]==a){t=r[s];break}}if(!c){var o;if(e){i=e(t,a);if(o=typeof i!="undefined"){t=i}}if(!o){t=f?w(t)?t:[]:tt(t)?t:{}}n.push(a);r.push(t);if(!o){st(t,a,e,n,r)}}}else{if(e){i=e(t,a);if(typeof i=="undefined"){i=a}}if(typeof i!="undefined"){t=i}}l[u]=t})}function Qn(e,n){return e+Vr(ut()*(n-e+1))}function Kn(t,f,n){var r=-1,u=Ln(),p=t?t.length:0,c=[];var l=!f&&p>=T&&u===m,e=n||l?i():c;if(l){var d=L(e);u=S;e=d}while(++r<p){var s=t[r],o=n?n(s,r,t):s;if(f?!r||e[e.length-1]!==o:u(e,o)<0){if(n||l){e.push(o)}c.push(s)}}if(l){a(e.array);h(e)}else if(n){a(e)}return c}function $n(n){return function(r,l,u){var a={};l=e.createCallback(l,u,3);var i=-1,s=r?r.length:0;if(typeof s=="number"){while(++i<s){var o=r[i];n(a,o,l(o,i,r),r)}}else{t(r,function(e,r,t){n(a,e,l(e,r,t),t)})}return a}}function ln(t,n,l,a,o,u){var c=n&1,m=n&2,f=n&4,h=n&8,i=n&16,s=n&32;if(!m&&!p(t)){throw new sn}if(i&&!l.length){n&=~16;i=l=false}if(s&&!a.length){n&=~32;s=a=false}var e=t&&t.__bindData__;if(e&&e!==true){e=r(e);if(e[2]){e[2]=r(e[2])}if(e[3]){e[3]=r(e[3])}if(c&&!(e[1]&1)){e[4]=o}if(!c&&e[1]&1){n|=8}if(f&&!(e[1]&4)){e[5]=u}if(i){xn.apply(e[2]||(e[2]=[]),l)}if(s){Mr.apply(e[3]||(e[3]=[]),a)}e[1]|=n;return ln.apply(null,e)}var d=n==1||n===17?Cr:kt;return d([t,n,l,a,o,u])}function Rr(e){return Un[e]}function Ln(){var n=(n=e.indexOf)===bt?m:n;return n}function fn(e){return typeof e=="function"&&el.test(e)}var Hn=!dt?ot:function(e,n){O.value=n;dt(e,"__bindData__",O)};function xt(e){var n,t;if(!(e&&A.call(e)==o)||(n=e.constructor,p(n)&&!(n instanceof n))){return false}an(e,function(n,e){t=e});return typeof t=="undefined"||P.call(e,t)}function xr(e){return Ct[e]}function An(e){return e&&typeof e=="object"&&typeof e.length=="number"&&A.call(e)==b||false}var w=Wn||function(e){return e&&typeof e=="object"&&typeof e.length=="number"&&A.call(e)==E||false};var yr=function(r){var n,t=r,e=[];if(!t)return e;if(!l[typeof r])return e;for(n in t){if(P.call(t,n)){e.push(n)}}return e};var V=!jn?yr:function(e){if(!I(e)){return[]}return jn(e)};var Un={"&":"&","<":"<",">":">",'"':""","'":"'"};var Ct=vt(Un);var ur=Rn("("+V(Ct).join("|")+")","g"),sr=Rn("["+V(Un).join("")+"]","g");var Fn=function(c,d,f){var r,e=c,a=e;if(!e)return a;var t=arguments,o=0,n=typeof f=="number"?2:t.length;if(n>3&&typeof t[n-2]=="function"){var s=G(t[--n-1],t[n--],2)}else if(n>2&&typeof t[n-1]=="function"){s=t[--n]}while(++o<n){e=t[o];if(e&&l[typeof e]){var u=-1,i=l[typeof e]&&V(e),p=i?i.length:0;while(++u<p){r=i[u];a[r]=s?s(a[r],e[r]):e[r]}}}return a};function lr(r,e,n,t){if(typeof e!="boolean"&&e!=null){t=n;n=e;e=false}return et(r,e,typeof n=="function"&&G(n,t,1))}function rr(n,e,t){return et(n,true,typeof e=="function"&&G(e,t,1))}function tr(t,e){var n=vn(t);return e?Fn(n,e):n}var Xn=function(o,p,c){var n,e=o,t=e;if(!e)return t;var a=arguments,i=0,u=typeof c=="number"?2:a.length;while(++i<u){e=a[i];if(e&&l[typeof e]){var s=-1,r=l[typeof e]&&V(e),f=r?r.length:0;while(++s<f){n=r[s];if(typeof t[n]=="undefined")t[n]=e[n]}}}return t};function er(l,n,a){var r;n=e.createCallback(n,a,3);t(l,function(t,e,l){if(n(t,e,l)){r=e;return false}});return r}function Zt(r,n,l){var t;n=e.createCallback(n,l,3);ht(r,function(r,e,l){if(n(r,e,l)){t=e;return false}});return t}var an=function(a,e,i){var r,n=a,t=n;if(!n)return t;if(!l[typeof n])return t;e=e&&typeof i=="undefined"?e:G(e,i,3);for(r in n){if(e(n[r],r,a)===false)return t}return t};function Yt(n,t,l){var e=[];an(n,function(n,t){e.push(t,n)});var r=e.length;t=G(t,l,3);while(r--){if(t(e[r--],e[r],n)===false){break}}return n}var t=function(i,n,s){var r,e=i,t=e;if(!e)return t;if(!l[typeof e])return t;n=n&&typeof s=="undefined"?n:G(n,s,3);var o=-1,a=l[typeof e]&&V(e),u=a?a.length:0;while(++o<u){r=a[o];if(n(e[r],r,i)===false)return t}return t};function ht(e,n,a){var t=V(e),r=t.length;n=G(n,a,3);while(r--){var l=t[r];if(n(e[l],l,e)===false){break}}return e}function In(n){var e=[];an(n,function(n,t){if(p(n)){e.push(t)}});return e.sort()}function zt(e,n){return e?P.call(e,n):false}function vt(e){var n=-1,t=V(e),a=t.length,r={};while(++n<a){var l=t[n];r[e[l]]=l}return r}function Wt(e){return e===true||e===false||e&&typeof e=="object"&&A.call(e)==x||false}function Gt(e){return e&&typeof e=="object"&&A.call(e)==v||false}function Jt(e){return e&&e.nodeType===1||false}function Xt(e){var r=true;if(!e){return r}var n=A.call(e),l=e.length;if(n==E||n==d||n==b||n==o&&typeof l=="number"&&p(e.splice)){return!l}t(e,function(){return r=false});return r}function Ut(n,t,e,r){return mn(n,t,typeof e=="function"&&G(e,r,2))}function Pt(e){return jr(e)&&!Tr(parseFloat(e))}function p(e){return typeof e=="function"}function I(e){return!!(e&&l[typeof e])}function _r(e){return At(e)&&e!=+e}function Lt(e){return e===null}function At(e){return typeof e=="number"||e&&typeof e=="object"&&A.call(e)==y||false}var tt=!hn?xt:function(e){if(!(e&&A.call(e)==o)){return false}var t=e.valueOf,n=fn(t)&&(n=hn(t))&&hn(n);return n?e==n||hn(e)==n:xt(e)};function gl(e){return e&&typeof e=="object"&&A.call(e)==g||false}function _n(e){return typeof e=="string"||e&&typeof e=="object"&&A.call(e)==d||false}function jt(e){return typeof e=="undefined"}function Mt(l,n,a){var r={};n=e.createCallback(n,a,3);t(l,function(t,e,l){r[e]=n(t,e,l)});return r}function Ot(t){var n=arguments,e=2;if(!I(t)){return t}if(typeof n[2]!="number"){e=n.length}if(e>3&&typeof n[e-2]=="function"){var l=G(n[--e-1],n[e--],2)}else if(e>2&&typeof n[e-1]=="function"){l=n[--e]}var c=r(arguments,1,e),s=-1,o=i(),u=i();while(++s<e){st(t,c[s],l,o,u)}a(o);a(u);return t}function Dt(r,t,s){var l={};if(typeof t!="function"){var n=[];an(r,function(t,e){n.push(e)});n=bn(n,cn(arguments,true,false,1));var a=-1,o=n.length;while(++a<o){var i=n[a];l[i]=r[i]}}else{t=e.createCallback(t,s,3);an(r,function(e,n,r){if(!t(e,n,r)){l[n]=e}})}return l}function Nt(n){var e=-1,t=V(n),r=t.length,l=z(r);while(++e<r){var a=t[e];l[e]=[a,n[a]]}return l}function Ft(n,t,s){var r={};if(typeof t!="function"){var a=-1,i=cn(arguments,true,false,1),o=I(n)?i.length:0;while(++a<o){var l=i[a];if(l in n){r[l]=n[l]}}}else{t=e.createCallback(t,s,3);an(n,function(e,n,l){if(t(e,n,l)){r[n]=e}})}return r}function Bt(r,l,n,s){var a=w(r);if(n==null){if(a){n=[]}else{var i=r&&r.constructor,o=i&&i.prototype;n=vn(o)}}if(l){l=e.createCallback(l,s,4);(a?U:t)(r,function(e,t,r){return l(n,e,t,r)})}return n}function Mn(n){var e=-1,t=V(n),r=t.length,l=z(r);while(++e<r){l[e]=n[t[e]]}return l}function Vt(t){var e=arguments,n=-1,r=cn(e,true,false,1),l=e[2]&&e[2][e[1]]===t?1:r.length,a=z(l);while(++n<l){a[n]=t[r[n]]}return a}function wt(e,r,n){var s=-1,a=Ln(),i=e?e.length:0,l=false;n=(n<0?rn(0,i+n):n)||0;if(w(e)){l=a(e,r,n)>-1}else if(typeof i=="number"){l=(_n(e)?e.indexOf(r,n):a(e,r,n))>-1}else{t(e,function(e){if(++s>=n){return!(l=e===r)}})}return l}var qt=$n(function(e,t,n){P.call(e,n)?e[n]++:e[n]=1});function Et(n,r,s){var l=true;r=e.createCallback(r,s,3);var a=-1,i=n?n.length:0;if(typeof i=="number"){while(++a<i){if(!(l=!!r(n[a],a,n))){break}}}else{t(n,function(e,n,t){return l=!!r(e,n,t)})}return l}function Dn(n,r,o){var l=[];r=e.createCallback(r,o,3);var a=-1,i=n?n.length:0;if(typeof i=="number"){while(++a<i){var s=n[a];if(r(s,a,n)){l.push(s)}}}else{t(n,function(e,n,t){if(r(e,n,t)){l.push(e)}})}return l}function Yn(n,r,o){r=e.createCallback(r,o,3);var l=-1,a=n?n.length:0;if(typeof a=="number"){while(++l<a){var i=n[l];if(r(i,l,n)){return i}}}else{var s;t(n,function(e,n,t){if(r(e,n,t)){s=e;return false}});return s}}function Ht(r,n,l){var t;n=e.createCallback(n,l,3);On(r,function(e,r,l){if(n(e,r,l)){t=e;return false}});return t}function U(e,n,l){var r=-1,a=e?e.length:0;n=n&&typeof l=="undefined"?n:G(n,l,3);if(typeof a=="number"){while(++r<a){if(n(e[r],r,e)===false){break}}}else{t(e,n)}return e}function On(e,r,a){var n=e?e.length:0;r=r&&typeof a=="undefined"?r:G(r,a,3);if(typeof n=="number"){while(n--){if(r(e[n],n,e)===false){break}}}else{var l=V(e);n=l.length;t(e,function(a,e,t){e=l?l[--n]:--n;return r(t[e],e,t)})}return e}var $t=$n(function(e,t,n){(P.call(e,n)?e[n]:e[n]=[]).push(t)});var Kt=$n(function(e,n,t){e[t]=n});function Qt(e,n){var a=r(arguments,2),i=-1,s=typeof n=="function",t=e?e.length:0,l=z(typeof t=="number"?t:0);U(e,function(e){l[++i]=(s?n:e[n]).apply(e,a)});return l}function Sn(n,l,s){var r=-1,i=n?n.length:0;l=e.createCallback(l,s,3);if(typeof i=="number"){var a=z(i);while(++r<i){a[r]=l(n[r],r,n)}}else{a=[];t(n,function(e,n,t){a[++r]=l(e,n,t)})}return a}function ct(t,n,l){var a=-Infinity,r=a;if(typeof n!="function"&&l&&l[n]===t){n=null}if(n==null&&w(t)){var i=-1,o=t.length;while(++i<o){var s=t[i];if(s>r){r=s}}}else{n=n==null&&_n(t)?D:e.createCallback(n,l,3);U(t,function(e,l,i){var t=n(e,l,i);if(t>a){a=t;r=e}})}return r}function nr(t,n,l){var a=Infinity,r=a;if(typeof n!="function"&&l&&l[n]===t){n=null}if(n==null&&w(t)){var i=-1,o=t.length;while(++i<o){var s=t[i];if(s<r){r=s}}}else{n=n==null&&_n(t)?D:e.createCallback(n,l,3);U(t,function(e,l,i){var t=n(e,l,i);if(t<a){a=t;r=e}})}return r}var Vn=Sn;function zn(r,l,n,o){if(!r)return n;var i=arguments.length<3;l=e.createCallback(l,o,4);var a=-1,s=r.length;if(typeof s=="number"){if(i){n=r[++a]}while(++a<s){n=l(n,r[a],a,r)}}else{t(r,function(e,t,r){n=i?(i=false,e):l(n,e,t,r)})}return n}function it(l,n,t,a){var r=arguments.length<3;n=e.createCallback(n,a,4);On(l,function(e,l,a){t=r?(r=false,e):n(t,e,l,a)});return t}function ar(t,n,r){n=e.createCallback(n,r,3);return Dn(t,function(e,t,r){return!n(e,t,r)})}function ir(e,t,r){if(e&&typeof e.length!="number"){e=Mn(e)}if(t==null||r){return e?e[Qn(0,e.length-1)]:u}var n=lt(e);n.length=En(rn(0,t),n.length);return n}function lt(n){var t=-1,r=n?n.length:0,e=z(typeof r=="number"?r:0);U(n,function(r){var n=Qn(0,++t);e[t]=e[n];e[n]=r});return e}function or(e){var n=e?e.length:0;return typeof n=="number"?n:V(e).length}function rt(n,r,s){var l;r=e.createCallback(r,s,3);var a=-1,i=n?n.length:0;if(typeof i=="number"){while(++a<i){if(l=r(n[a],a,n)){break}}}else{t(n,function(e,n,t){return!(l=r(e,n,t))})}return!!l}function cr(l,r,c){var u=-1,s=w(r),n=l?l.length:0,t=z(typeof n=="number"?n:0);
if(!s){r=e.createCallback(r,c,3)}U(l,function(n,l,a){var e=t[++u]=j();if(s){e.criteria=Sn(r,function(e){return n[e]})}else{(e.criteria=i())[0]=r(n,l,a)}e.index=u;e.value=n});n=t.length;t.sort(H);while(n--){var o=t[n];t[n]=o.value;if(!s){a(o.criteria)}h(o)}return t}function fr(e){if(e&&typeof e.length=="number"){return r(e)}return Mn(e)}var pr=Dn;function dr(e){var n=-1,l=e?e.length:0,t=[];while(++n<l){var r=e[n];if(r){t.push(r)}}return t}function mr(e){return bn(e,cn(arguments,true,true,1))}function hr(n,r,l){var t=-1,a=n?n.length:0;r=e.createCallback(r,l,3);while(++t<a){if(r(n[t],t,n)){return t}}return-1}function gr(n,r,l){var t=n?n.length:0;r=e.createCallback(r,l,3);while(t--){if(r(n[t],t,n)){return t}}return-1}function Jn(n,t,i){var l=0,s=n?n.length:0;if(typeof t!="number"&&t!=null){var a=-1;t=e.createCallback(t,i,3);while(++a<s&&t(n[a],a,n)){l++}}else{l=t;if(l==null||i){return n?n[0]:u}}return r(n,0,En(rn(0,l),s))}function vr(n,e,t,r){if(typeof e!="boolean"&&e!=null){r=t;t=typeof e!="function"&&r&&r[e]===n?null:e;e=false}if(t!=null){n=Sn(n,t,r)}return cn(n,e)}function bt(n,t,e){if(typeof e=="number"){var l=n?n.length:0;e=e<0?rn(0,l+e):e||0}else if(e){var r=gt(n,t);return n[r]===t?r:-1}return m(n,t,e)}function br(t,n,s){var l=0,a=t?t.length:0;if(typeof n!="number"&&n!=null){var i=a;n=e.createCallback(n,s,3);while(i--&&n(t[i],i,t)){l++}}else{l=n==null||s?1:n||l}return r(t,0,En(rn(0,a-l),a))}function Er(){var s=[],t=-1,l=arguments.length,r=i(),u=Ln(),d=u===m,o=i();while(++t<l){var e=arguments[t];if(w(e)||An(e)){s.push(e);r.push(d&&e.length>=T&&L(t?s[t]:o))}}var c=s[0],f=-1,g=c?c.length:0,p=[];e:while(++f<g){var n=r[0];e=c[f];if((n?S(n,e):u(o,e))<0){t=l;(n||o).push(e);while(--t){n=r[t];if((n?S(n,e):u(s[t],e))<0){continue e}}p.push(e)}}while(l--){n=r[l];if(n){h(n)}}a(r);a(o);return p}function wr(n,t,s){var l=0,a=n?n.length:0;if(typeof t!="number"&&t!=null){var i=a;t=e.createCallback(t,s,3);while(i--&&t(n[i],i,n)){l++}}else{l=t;if(l==null||s){return n?n[a-1]:u}}return r(n,rn(0,a-l))}function Tt(t,r,n){var e=t?t.length:0;if(typeof n=="number"){e=(n<0?rn(0,e+n):En(n,e-1))+1}while(e--){if(t[e]===r){return e}}return-1}function Sr(e){var t=arguments,r=0,a=t.length,l=e?e.length:0;while(++r<a){var n=-1,i=t[r];while(++n<l){if(e[n]===i){ft.call(e,n--,1);l--}}}return e}function kr(e,t,n){e=+e||0;n=typeof n=="number"?n:+n||1;if(t==null){t=e;e=0}var r=-1,l=rn(0,Zr((t-e)/(n||1))),a=z(l);while(++r<l){a[r]=e;e+=n}return a}function Ir(n,r,s){var t=-1,l=n?n.length:0,a=[];r=e.createCallback(r,s,3);while(++t<l){var i=n[t];if(r(i,t,n)){a.push(i);ft.call(n,t--,1);l--}}return a}function Bn(t,n,i){if(typeof n!="number"&&n!=null){var l=0,a=-1,s=t?t.length:0;n=e.createCallback(n,i,3);while(++a<s&&n(t[a],a,t)){l++}}else{l=n==null||i?1:rn(0,n)}return r(t,l)}function gt(r,l,n,s){var t=0,a=r?r.length:t;n=n?e.createCallback(n,s,1):Gn;l=n(l);while(t<a){var i=t+a>>>1;n(r[i])<l?t=i+1:a=i}return t}function Ar(){return Kn(cn(arguments,true,true))}function St(l,n,t,r){if(typeof n!="boolean"&&n!=null){r=t;t=typeof n!="function"&&r&&r[n]===l?null:n;n=false}if(t!=null){t=e.createCallback(t,r,3)}return Kn(l,n,t)}function Lr(e){return bn(e,r(arguments,1))}function Pr(){var t=-1,r=arguments.length;while(++t<r){var e=arguments[t];if(w(e)||An(e)){var n=n?Kn(bn(n,e).concat(bn(e,n))):e}}return n||[]}function _t(){var e=arguments.length>1?arguments:arguments[0],n=-1,t=e?ct(Vn(e,"length")):0,r=z(t<0?0:t);while(++n<t){r[n]=Vn(e,n)}return r}function pt(e,n){var r=-1,a=e?e.length:0,l={};if(!n&&a&&!w(e[0])){n=[]}while(++r<a){var t=e[r];if(n){l[t]=n[r]}else if(t){l[t[0]]=t[1]}}return l}function Or(n,e){if(!p(e)){throw new sn}return function(){if(--n<1){return e.apply(this,arguments)}}}function yt(e,n){return arguments.length>2?ln(e,17,r(arguments,2),null,n):ln(e,1,null,null,n)}function Nr(e){var n=arguments.length>1?cn(arguments,true,false,1):In(e),t=-1,l=n.length;while(++t<l){var r=n[t];e[r]=ln(e[r],1,null,null,e)}return e}function Fr(e,n){return arguments.length>2?ln(n,19,r(arguments,2),null,e):ln(n,3,null,null,e)}function Br(){var e=arguments,n=e.length;while(n--){if(!p(e[n])){throw new sn}}return function(){var n=arguments,t=e.length;while(t--){n=[e[t].apply(this,n)]}return n[0]}}function Ur(n,e){e=typeof e=="number"?e:+e||n.length;return ln(n,4,null,null,null,e)}function mt(s,a,l){var t,n,o,i,r,e,m,f=0,d=false,c=true;if(!p(s)){throw new sn}a=rn(0,a)||0;if(l===true){var h=true;c=false}else if(I(l)){h=l.leading;d="maxWait"in l&&(rn(a,l.maxWait)||0);c="trailing"in l?l.trailing:c}var g=function(){var l=a-(pn()-i);if(l<=0){if(n){Pn(n)}var c=m;n=e=m=u;if(c){f=pn();o=s.apply(r,t);if(!e&&!n){t=r=null}}}else{e=wn(g,l)}};var y=function(){if(e){Pn(e)}n=e=m=u;if(c||d!==a){f=pn();o=s.apply(r,t);if(!e&&!n){t=r=null}}};return function(){t=arguments;i=pn();r=this;m=c&&(e||!h);if(d===false){var p=h&&!e}else{if(!n&&!h){f=i}var u=d-(i-f),l=u<=0;if(l){if(n){n=Pn(n)}f=i;o=s.apply(r,t)}else if(!n){n=wn(y,u)}}if(l&&e){e=Pn(e)}else if(!e&&a!==d){e=wn(g,a)}if(p){l=true;o=s.apply(r,t)}if(l&&!e&&!n){t=r=null}return o}}function Xr(e){if(!p(e)){throw new sn}var n=r(arguments,1);return wn(function(){e.apply(u,n)},1)}function qr(e,n){if(!p(e)){throw new sn}var t=r(arguments,2);return wn(function(){e.apply(u,t)},n)}function Jr(n,t){if(!p(n)){throw new sn}var e=function(){var r=e.cache,l=t?t.apply(this,arguments):R+arguments[0];return P.call(r,l)?r[l]:r[l]=n.apply(this,arguments)};e.cache={};return e}function Gr(e){var t,n;if(!p(e)){throw new sn}return function(){if(t){return n}t=true;n=e.apply(this,arguments);e=null;return n}}function Wr(e){return ln(e,16,r(arguments,1))}function Hr(e){return ln(e,32,null,r(arguments,1))}function zr(r,l,e){var n=true,t=true;if(!p(r)){throw new sn}if(e===false){n=false}else if(I(e)){n="leading"in e?e.leading:n;t="trailing"in e?e.trailing:t}k.leading=n;k.maxWait=l;k.trailing=t;return mt(r,l,k)}function Yr(e,n){return ln(n,16,[e])}function $r(e){return function(){return e}}function Kr(e,a,i){var r=typeof e;if(e==null||r=="function"){return G(e,a,i)}if(r!="object"){return It(e)}var t=V(e),l=t[0],n=e[l];if(t.length==1&&n===n&&!I(n)){return function(t){var e=t[l];return n===e&&(n!==0||1/n==1/e)}}return function(l){var n=t.length,r=false;while(n--){if(!(r=mn(l[t[n]],e[t[n]],null,true))){break}}return r}}function Qr(e){return e==null?"":un(e).replace(sr,Rr)}function Gn(e){return e}function qn(r,n,t){var a=true,i=n&&In(n);if(!n||!t&&!i.length){if(t==null){t=n}l=dn;n=r;r=e;i=In(n)}if(t===false){a=false}else if(I(t)&&"chain"in t){a=t.chain}var l=r,s=p(l);U(i,function(e){var t=r[e]=n[e];if(s){l.prototype[e]=function(){var n=this.__chain__,i=this.__wrapped__,s=[i];xn.apply(s,arguments);var e=t.apply(r,s);if(a||n){if(i===e&&I(e)){return this}e=new l(e);e.__chain__=n}return e}}})}function nl(){n._=tl;return this}function ot(){}var pn=fn(pn=Zn.now)&&pn||function(){return(new Zn).getTime()};var ll=nt(N+"08")==8?nt:function(e,n){return nt(_n(e)?e.replace(tn,""):e,n||0)};function It(e){return function(n){return n[e]}}function il(e,n,r){var a=e==null,t=n==null;if(r==null){if(typeof e=="boolean"&&t){r=e;e=1}else if(!t&&typeof n=="boolean"){r=n;t=true}}if(a&&t){n=1}e=+e||0;if(t){n=e;e=0}else{n=+n||0}if(r||e%1||n%1){var l=ut();return En(e+l*(n-e+parseFloat("1e-"+((l+"").length-1))),n)}return Qn(e,n)}function sl(e,n){if(e){var t=e[n];return p(t)?e[n]():t}}function ol(l,c,t){var o=e.templateSettings;l=un(l||"");t=Xn({},t,o);var p=Xn({},t.imports,o.imports),v=V(p),g=Mn(p);var i,m=0,f=t.interpolate||_,n="__p += '";var h=Rn((t.escape||_).source+"|"+f.source+"|"+(f===F?Z:_).source+"|"+(t.evaluate||_).source+"|$","g");l.replace(h,function(t,r,e,o,a,s){e||(e=o);n+=l.slice(m,s).replace(W,Y);if(r){n+="' +\n__e("+r+") +\n'"}if(a){i=true;n+="';\n"+a+";\n__p += '"}if(e){n+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"}m=s+t.length;return t});n+="';\n";var r=t.variable,s=r;if(!s){r="obj";n="with ("+r+") {\n"+n+"\n}\n"}n=(i?n.replace(X,""):n).replace(nn,"$1").replace(en,"$1;");n="function("+r+") {\n"+(s?"":r+" || ("+r+" = {});\n")+"var __t, __p = '', __e = _.escape"+(i?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+n+"return __p\n}";var y="\n/*\n//# sourceURL="+(t.sourceURL||"/lodash/template/source["+q++ +"]")+"\n*/";try{var a=Nn(v,"return "+n+y).apply(u,g)}catch(d){d.source=n;throw d}if(c){return a(c)}a.source=n;return a}function ul(e,n,l){e=(e=+e)>-1?e:0;var t=-1,r=z(e);n=G(n,l,1);while(++t<e){r[t]=n(t)}return r}function cl(e){return e==null?"":un(e).replace(ur,xr)}function fl(e){var n=++Q;return un(e==null?"":e)+n}function pl(e){e=new dn(e);e.__chain__=true;return e}function dl(e,n){n(e);return e}function ml(){this.__chain__=true;return this}function hl(){return un(this.__wrapped__)}function Rt(){return this.__wrapped__}e.after=Or;e.assign=Fn;e.at=Vt;e.bind=yt;e.bindAll=Nr;e.bindKey=Fr;e.chain=pl;e.compact=dr;e.compose=Br;e.constant=$r;e.countBy=qt;e.create=tr;e.createCallback=Kr;e.curry=Ur;e.debounce=mt;e.defaults=Xn;e.defer=Xr;e.delay=qr;e.difference=mr;e.filter=Dn;e.flatten=vr;e.forEach=U;e.forEachRight=On;e.forIn=an;e.forInRight=Yt;e.forOwn=t;e.forOwnRight=ht;e.functions=In;e.groupBy=$t;e.indexBy=Kt;e.initial=br;e.intersection=Er;e.invert=vt;e.invoke=Qt;e.keys=V;e.map=Sn;e.mapValues=Mt;e.max=ct;e.memoize=Jr;e.merge=Ot;e.min=nr;e.omit=Dt;e.once=Gr;e.pairs=Nt;e.partial=Wr;e.partialRight=Hr;e.pick=Ft;e.pluck=Vn;e.property=It;e.pull=Sr;e.range=kr;e.reject=ar;e.remove=Ir;e.rest=Bn;e.shuffle=lt;e.sortBy=cr;e.tap=dl;e.throttle=zr;e.times=ul;e.toArray=fr;e.transform=Bt;e.union=Ar;e.uniq=St;e.values=Mn;e.where=pr;e.without=Lr;e.wrap=Yr;e.xor=Pr;e.zip=_t;e.zipObject=pt;e.collect=Sn;e.drop=Bn;e.each=U;e.eachRight=On;e.extend=Fn;e.methods=In;e.object=pt;e.select=Dn;e.tail=Bn;e.unique=St;e.unzip=_t;qn(e);e.clone=lr;e.cloneDeep=rr;e.contains=wt;e.escape=Qr;e.every=Et;e.find=Yn;e.findIndex=hr;e.findKey=er;e.findLast=Ht;e.findLastIndex=gr;e.findLastKey=Zt;e.has=zt;e.identity=Gn;e.indexOf=bt;e.isArguments=An;e.isArray=w;e.isBoolean=Wt;e.isDate=Gt;e.isElement=Jt;e.isEmpty=Xt;e.isEqual=Ut;e.isFinite=Pt;e.isFunction=p;e.isNaN=_r;e.isNull=Lt;e.isNumber=At;e.isObject=I;e.isPlainObject=tt;e.isRegExp=gl;e.isString=_n;e.isUndefined=jt;e.lastIndexOf=Tt;e.mixin=qn;e.noConflict=nl;e.noop=ot;e.now=pn;e.parseInt=ll;e.random=il;e.reduce=zn;e.reduceRight=it;e.result=sl;e.runInContext=C;e.size=or;e.some=rt;e.sortedIndex=gt;e.template=ol;e.unescape=cl;e.uniqueId=fl;e.all=Et;e.any=rt;e.detect=Yn;e.findWhere=Yn;e.foldl=zn;e.foldr=it;e.include=wt;e.inject=zn;qn(function(){var n={};t(e,function(r,t){if(!e.prototype[t]){n[t]=r}});return n}(),false);e.first=Jn;e.last=wr;e.sample=ir;e.take=Jn;e.head=Jn;t(e,function(t,n){var r=n!=="sample";if(!e.prototype[n]){e.prototype[n]=function(e,n){var l=this.__chain__,a=t(this.__wrapped__,e,n);return!l&&(e==null||n&&!(r&&typeof e=="function"))?a:new dn(a,l)}}});e.VERSION="2.4.1";e.prototype.chain=ml;e.prototype.toString=hl;e.prototype.value=Rt;e.prototype.valueOf=Rt;U(["join","pop","shift"],function(n){var t=yn[n];e.prototype[n]=function(){var e=this.__chain__,n=t.apply(this.__wrapped__,arguments);return e?new dn(n,e):n}});U(["push","reverse","sort","unshift"],function(n){var t=yn[n];e.prototype[n]=function(){t.apply(this.__wrapped__,arguments);return this}});U(["concat","slice","splice"],function(n){var t=yn[n];e.prototype[n]=function(){return new dn(t.apply(this.__wrapped__,arguments),this.__chain__)}});return e}var c=C();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){f._=c;define(function(){return c})}else if(w&&I){if(z){(I.exports=c)._=c}else{w._=c}}else{f._=c}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],143:[function(x,v,c){"use strict";var s=Object;var r=Object.defineProperty;var l=Object.create;function n(e,n,t){if(r)try{r.call(s,e,n,{value:t})}catch(l){e[n]=t}else{e[n]=t}}function e(e){if(e){n(e,"call",e.call);n(e,"apply",e.apply)}return e}e(r);e(l);var t=e(Object.prototype.hasOwnProperty);var p=e(Number.prototype.toString);var f=e(String.prototype.slice);var o=function(){};function a(e){if(l){return l.call(s,e)}o.prototype=e||null;return new o}var d=Math.random;var i=a(null);function u(){do var e=g(f.call(p.call(d(),36),2));while(t.call(i,e));return i[e]=e}function g(n){var e={};e[n]=true;return Object.keys(e)[0]}n(c,"makeUniqueKey",u);var y=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function b(l){for(var e=y(l),n=0,r=0,a=e.length;n<a;++n){if(!t.call(i,e[n])){if(n>r){e[r]=e[n]}++r}}e.length=r;return e};function m(e){return a(null)}function h(r){var e=u();var l=a(null);r=r||m;function s(a){var t;function i(e,n){if(e===l){return n?t=null:t||(t=r(a))}}n(a,e,i)}function i(n){if(!t.call(n,e))s(n);return n[e](l)}i.forget=function(n){if(t.call(n,e))n[e](l,true)};return i}n(c,"makeAccessor",h)},{}],144:[function(s,x,y){var l=s("assert");var i=s("recast").types;var b=i.builtInTypes.array;var e=i.builders;var n=i.namedTypes;var a=s("./leap");var u=s("./meta");var f=s("./util");var d=f.runtimeProperty("keys");var o=Object.prototype.hasOwnProperty;function c(e){l.ok(this instanceof c);n.Identifier.assert(e);Object.defineProperties(this,{contextId:{value:e},listing:{value:[]},marked:{value:[true]},finalLoc:{value:t()},tryEntries:{value:[]}});Object.defineProperties(this,{leapManager:{value:new a.LeapManager(this)}})}var r=c.prototype;y.Emitter=c;function t(){return e.literal(-1)}r.mark=function(e){n.Literal.assert(e);var t=this.listing.length;if(e.value===-1){e.value=t}else{l.strictEqual(e.value,t)}this.marked[t]=true;return e};r.emit=function(t){if(n.Expression.check(t))t=e.expressionStatement(t);n.Statement.assert(t);this.listing.push(t)};r.emitAssign=function(e,n){this.emit(this.assign(e,n));return e};r.assign=function(n,t){return e.expressionStatement(e.assignmentExpression("=",n,t))};r.contextProperty=function(n,t){return e.memberExpression(this.contextId,t?e.literal(n):e.identifier(n),!!t)};var m={prev:true,next:true,sent:true,rval:true};r.isVolatileContextProperty=function(e){if(n.MemberExpression.check(e)){if(e.computed){return true}if(n.Identifier.check(e.object)&&n.Identifier.check(e.property)&&e.object.name===this.contextId.name&&o.call(m,e.property.name)){return true}}return false};r.stop=function(e){if(e){this.setReturnValue(e)}this.jump(this.finalLoc)};r.setReturnValue=function(e){n.Expression.assert(e.value);this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))};r.clearPendingException=function(t,r){n.Literal.assert(t);var l=e.callExpression(this.contextProperty("catch",true),[t]);if(r){this.emitAssign(r,l)}else{this.emit(l)}};r.jump=function(n){this.emitAssign(this.contextProperty("next"),n);this.emit(e.breakStatement())};r.jumpIf=function(t,r){n.Expression.assert(t);n.Literal.assert(r);this.emit(e.ifStatement(t,e.blockStatement([this.assign(this.contextProperty("next"),r),e.breakStatement()])))};r.jumpIfNot=function(t,l){n.Expression.assert(t);n.Literal.assert(l);var r;if(n.UnaryExpression.check(t)&&t.operator==="!"){r=t.argument}else{r=e.unaryExpression("!",t)}this.emit(e.ifStatement(r,e.blockStatement([this.assign(this.contextProperty("next"),l),e.breakStatement()])))};var h=0;r.makeTempVar=function(){return this.contextProperty("t"+h++)};r.getContextFunction=function(n){return e.functionExpression(n||null,[this.contextId],e.blockStatement([this.getDispatchLoop()]),false,false)};r.getDispatchLoop=function(){var r=this;var n=[];var l;var t=false;r.listing.forEach(function(a,i){if(r.marked.hasOwnProperty(i)){n.push(e.switchCase(e.literal(i),l=[]));t=false}if(!t){l.push(a);if(g(a))t=true}});this.finalLoc.value=this.listing.length;n.push(e.switchCase(this.finalLoc,[]),e.switchCase(e.literal("end"),[e.returnStatement(e.callExpression(this.contextProperty("stop"),[]))]));return e.whileStatement(e.literal(1),e.switchStatement(e.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),n))};function g(e){return n.BreakStatement.check(e)||n.ContinueStatement.check(e)||n.ReturnStatement.check(e)||n.ThrowStatement.check(e)}r.getTryEntryList=function(){if(this.tryEntries.length===0){return null}var n=0;return e.arrayExpression(this.tryEntries.map(function(t){var r=t.firstLoc.value;l.ok(r>=n,"try entries out of order");n=r;var a=t.catchEntry;var i=t.finallyEntry;var s=[t.firstLoc,a?a.firstLoc:null];if(i){s[2]=i.firstLoc}return e.arrayExpression(s)}))};r.explode=function(t,a){l.ok(t instanceof i.NodePath);var e=t.value;var r=this;n.Node.assert(e);if(n.Statement.check(e))return r.explodeStatement(t);if(n.Expression.check(e))return r.explodeExpression(t,a);if(n.Declaration.check(e))throw p(e);switch(e.type){case"Program":return t.get("body").map(r.explodeStatement,r);case"VariableDeclarator":throw p(e);case"Property":case"SwitchCase":case"CatchClause":throw new Error(e.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(e.type))}};function p(e){return new Error("all declarations should have been transformed into "+"assignments before the Exploder began its work: "+JSON.stringify(e))}r.explodeStatement=function(s,p){l.ok(s instanceof i.NodePath);var o=s.value;var r=this;n.Statement.assert(o);if(p){n.Identifier.assert(p)}else{p=null}if(n.BlockStatement.check(o)){return s.get("body").each(r.explodeStatement,r)}if(!u.containsLeap(o)){r.emit(o);return}switch(o.type){case"ExpressionStatement":r.explodeExpression(s.get("expression"),true);break;case"LabeledStatement":var c=t();r.leapManager.withEntry(new a.LabeledEntry(c,o.label),function(){r.explodeStatement(s.get("body"),o.label)});r.mark(c);break;case"WhileStatement":var w=t();var c=t();r.mark(w);r.jumpIfNot(r.explodeExpression(s.get("test")),c);r.leapManager.withEntry(new a.LoopEntry(c,w,p),function(){r.explodeStatement(s.get("body"))});r.jump(w);r.mark(c);break;case"DoWhileStatement":var A=t();var C=t();var c=t();r.mark(A);r.leapManager.withEntry(new a.LoopEntry(c,C,p),function(){r.explode(s.get("body"))});r.mark(C);r.jumpIf(r.explodeExpression(s.get("test")),A);r.mark(c);break;case"ForStatement":var y=t();var P=t();var c=t();if(o.init){r.explode(s.get("init"),true)}r.mark(y);if(o.test){r.jumpIfNot(r.explodeExpression(s.get("test")),c)}else{}r.leapManager.withEntry(new a.LoopEntry(c,P,p),function(){r.explodeStatement(s.get("body"))});r.mark(P);if(o.update){r.explode(s.get("update"),true)}r.jump(y);r.mark(c);break;case"ForInStatement":n.Identifier.assert(o.left);var y=t();var c=t();var j=r.makeTempVar();r.emitAssign(j,e.callExpression(d,[r.explodeExpression(s.get("right"))]));r.mark(y);var R=r.makeTempVar();r.jumpIf(e.memberExpression(e.assignmentExpression("=",R,e.callExpression(j,[])),e.identifier("done"),false),c);r.emitAssign(o.left,e.memberExpression(R,e.identifier("value"),false));r.leapManager.withEntry(new a.LoopEntry(c,y,p),function(){r.explodeStatement(s.get("body"))});r.jump(y);r.mark(c);break;case"BreakStatement":r.emitAbruptCompletion({type:"break",target:r.leapManager.getBreakLoc(o.label)});break;case"ContinueStatement":r.emitAbruptCompletion({type:"continue",target:r.leapManager.getContinueLoc(o.label)});break;case"SwitchStatement":var M=r.emitAssign(r.makeTempVar(),r.explodeExpression(s.get("discriminant")));var c=t();var v=t();var _=v;var S=[];var T=o.cases||[];for(var g=T.length-1;g>=0;--g){var k=T[g];n.SwitchCase.assert(k);if(k.test){_=e.conditionalExpression(e.binaryExpression("===",M,k.test),S[g]=t(),_)}else{S[g]=v}}r.jump(r.explodeExpression(new i.NodePath(_,s,"discriminant")));r.leapManager.withEntry(new a.SwitchEntry(c),function(){s.get("cases").each(function(e){var t=e.value;var n=e.name;r.mark(S[n]);e.get("consequent").each(r.explodeStatement,r)})});r.mark(c);if(v.value===-1){r.mark(v);l.strictEqual(c.value,v.value)}break;case"IfStatement":var I=o.alternate&&t();var c=t();r.jumpIfNot(r.explodeExpression(s.get("test")),I||c);r.explodeStatement(s.get("consequent"));if(I){r.jump(c);r.mark(I);r.explodeStatement(s.get("alternate"))}r.mark(c);break;case"ReturnStatement":r.emitAbruptCompletion({type:"return",value:r.explodeExpression(s.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var c=t();var h=o.handler;if(!h&&o.handlers){h=o.handlers[0]||null}var b=h&&t();var L=b&&new a.CatchEntry(b,h.param);var m=o.finalizer&&t();var E=m&&new a.FinallyEntry(m);var x=new a.TryEntry(r.getUnmarkedCurrentLoc(),L,E);r.tryEntries.push(x);r.updateContextPrevLoc(x.firstLoc);r.leapManager.withEntry(x,function(){r.explodeStatement(s.get("block"));if(b){if(m){r.jump(m)}else{r.jump(c)}r.updateContextPrevLoc(r.mark(b));var o=s.get("handler","body");var u=r.makeTempVar();r.clearPendingException(x.firstLoc,u);var t=o.scope;var a=h.param.name;n.CatchClause.assert(t.node);l.strictEqual(t.lookup(a),t);i.visit(o,{visitIdentifier:function(e){if(f.isReference(e,a)&&e.scope.lookup(a)===t){return u}this.traverse(e)},visitFunction:function(e){if(e.scope.declares(a)){return false}this.traverse(e)}});r.leapManager.withEntry(L,function(){r.explodeStatement(o)})}if(m){r.updateContextPrevLoc(r.mark(m));r.leapManager.withEntry(E,function(){r.explodeStatement(s.get("finalizer"))});r.emit(e.callExpression(r.contextProperty("finish"),[E.firstLoc]))}});r.mark(c);break;case"ThrowStatement":r.emit(e.throwStatement(r.explodeExpression(s.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(o.type))}};r.emitAbruptCompletion=function(t){if(!v(t)){l.ok(false,"invalid completion record: "+JSON.stringify(t))}l.notStrictEqual(t.type,"normal","normal completions are not abrupt");var r=[e.literal(t.type)];if(t.type==="break"||t.type==="continue"){n.Literal.assert(t.target);r[1]=t.target}else if(t.type==="return"||t.type==="throw"){if(t.value){n.Expression.assert(t.value);r[1]=t.value}}this.emit(e.returnStatement(e.callExpression(this.contextProperty("abrupt"),r)))};function v(e){var t=e.type;if(t==="normal"){return!o.call(e,"target")}if(t==="break"||t==="continue"){return!o.call(e,"value")&&n.Literal.check(e.target)}if(t==="return"||t==="throw"){return o.call(e,"value")&&!o.call(e,"target")}return false}r.getUnmarkedCurrentLoc=function(){return e.literal(this.listing.length)};r.updateContextPrevLoc=function(e){if(e){n.Literal.assert(e);if(e.value===-1){e.value=this.listing.length}else{l.strictEqual(e.value,this.listing.length)}}else{e=this.getUnmarkedCurrentLoc()}this.emitAssign(this.contextProperty("prev"),e)};r.explodeExpression=function(a,d){l.ok(a instanceof i.NodePath);var s=a.value;if(s){n.Expression.assert(s)}else{return s}var r=this;var o;function f(e){n.Expression.assert(e);if(d){r.emit(e)}else{return e}}if(!u.containsLeap(s)){return f(s)}var b=u.containsLeap.onlyChildren(s);function c(n,a,t){l.ok(a instanceof i.NodePath);l.ok(!t||!n,"Ignoring the result of a child expression but forcing it to "+"be assigned to a temporary variable?");var e=r.explodeExpression(a,t);if(t){}else if(n||b&&(r.isVolatileContextProperty(e)||u.hasSideEffects(e))){e=r.emitAssign(n||r.makeTempVar(),e)}return e}switch(s.type){case"MemberExpression":return f(e.memberExpression(r.explodeExpression(a.get("object")),s.computed?c(null,a.get("property")):s.property,s.computed));case"CallExpression":var v=a.get("callee");var m=r.explodeExpression(v);if(!n.MemberExpression.check(v.node)&&n.MemberExpression.check(m)){m=e.sequenceExpression([e.literal(0),m])}return f(e.callExpression(m,a.get("arguments").map(function(e){return c(null,e)})));case"NewExpression":return f(e.newExpression(c(null,a.get("callee")),a.get("arguments").map(function(e){return c(null,e)})));case"ObjectExpression":return f(e.objectExpression(a.get("properties").map(function(n){return e.property(n.value.kind,n.value.key,c(null,n.get("value")))})));case"ArrayExpression":return f(e.arrayExpression(a.get("elements").map(function(e){return c(null,e)})));case"SequenceExpression":var x=s.expressions.length-1;a.get("expressions").each(function(e){if(e.name===x){o=r.explodeExpression(e,d)}else{r.explodeExpression(e,true)}});return o;case"LogicalExpression":var p=t();if(!d){o=r.makeTempVar()}var g=c(o,a.get("left"));if(s.operator==="&&"){r.jumpIfNot(g,p)}else{l.strictEqual(s.operator,"||");r.jumpIf(g,p)}c(o,a.get("right"),d);r.mark(p);return o;case"ConditionalExpression":var y=t();var p=t();var E=r.explodeExpression(a.get("test"));r.jumpIfNot(E,y);if(!d){o=r.makeTempVar()}c(o,a.get("consequent"),d);r.jump(p);r.mark(y);c(o,a.get("alternate"),d);r.mark(p);return o;case"UnaryExpression":return f(e.unaryExpression(s.operator,r.explodeExpression(a.get("argument")),!!s.prefix));case"BinaryExpression":return f(e.binaryExpression(s.operator,c(null,a.get("left")),c(null,a.get("right"))));case"AssignmentExpression":return f(e.assignmentExpression(s.operator,r.explodeExpression(a.get("left")),r.explodeExpression(a.get("right"))));case"UpdateExpression":return f(e.updateExpression(s.operator,r.explodeExpression(a.get("argument")),s.prefix));case"YieldExpression":var p=t();var h=s.argument&&r.explodeExpression(a.get("argument"));if(h&&s.delegate){var o=r.makeTempVar();r.emit(e.returnStatement(e.callExpression(r.contextProperty("delegateYield"),[h,e.literal(o.property.name),p])));r.mark(p);return o}r.emitAssign(r.contextProperty("next"),p);r.emit(e.returnStatement(h||null));r.mark(p);return r.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(s.type))}}},{"./leap":146,"./meta":147,"./util":148,assert:110,recast:177}],145:[function(r,s,l){var a=r("assert");var t=r("recast").types;var n=t.namedTypes;var e=t.builders;var i=Object.prototype.hasOwnProperty;l.hoist=function(r){a.ok(r instanceof t.NodePath);n.Function.assert(r.value);var l={};function s(r,a){n.VariableDeclaration.assert(r);var t=[];r.declarations.forEach(function(n){l[n.id.name]=n.id;if(n.init){t.push(e.assignmentExpression("=",n.id,n.init))}else if(a){t.push(n.id)}});if(t.length===0)return null;if(t.length===1)return t[0];return e.sequenceExpression(t)}t.visit(r.get("body"),{visitVariableDeclaration:function(n){var t=s(n.value,false);if(t===null){n.replace()}else{return e.expressionStatement(t)}return false},visitForStatement:function(e){var t=e.value.init;if(n.VariableDeclaration.check(t)){e.get("init").replace(s(t,false))}this.traverse(e)},visitForInStatement:function(e){var t=e.value.left;if(n.VariableDeclaration.check(t)){e.get("left").replace(s(t,true))}this.traverse(e)},visitFunctionDeclaration:function(r){var t=r.value;l[t.id.name]=t.id;var i=r.parent.node;var a=e.expressionStatement(e.assignmentExpression("=",t.id,e.functionExpression(t.id,t.params,t.body,t.generator,t.expression)));if(n.BlockStatement.check(r.parent.node)){r.parent.get("body").unshift(a);r.replace()}else{r.replace(a)}return false},visitFunctionExpression:function(e){return false}});var u={};r.get("params").each(function(t){var e=t.value;if(n.Identifier.check(e)){u[e.name]=e}else{}});var o=[];Object.keys(l).forEach(function(n){if(!i.call(u,n)){o.push(e.variableDeclarator(l[n],null))}});if(o.length===0){return null}return e.variableDeclaration("var",o)}},{assert:110,recast:177}],146:[function(a,g,t){var r=a("assert");var p=a("recast").types;var n=p.namedTypes;var v=p.builders;var l=a("util").inherits;var y=Object.prototype.hasOwnProperty;function e(){r.ok(this instanceof e)}function u(t){e.call(this);n.Literal.assert(t);this.returnLoc=t}l(u,e);t.FunctionEntry=u;function h(r,l,t){e.call(this);n.Literal.assert(r);n.Literal.assert(l);if(t){n.Identifier.assert(t)}else{t=null}this.breakLoc=r;this.continueLoc=l;this.label=t}l(h,e);t.LoopEntry=h;function m(t){e.call(this);n.Literal.assert(t);this.breakLoc=t}l(m,e);t.SwitchEntry=m;function d(a,t,l){e.call(this);n.Literal.assert(a);if(t){r.ok(t instanceof c)}else{t=null}if(l){r.ok(l instanceof f)}else{l=null}r.ok(t||l);this.firstLoc=a;this.catchEntry=t;this.finallyEntry=l}l(d,e);t.TryEntry=d;function c(t,r){e.call(this);n.Literal.assert(t);n.Identifier.assert(r);this.firstLoc=t;this.paramId=r}l(c,e);t.CatchEntry=c;function f(t){e.call(this);n.Literal.assert(t);this.firstLoc=t}l(f,e);t.FinallyEntry=f;function o(t,r){e.call(this);n.Literal.assert(t);n.Identifier.assert(r);this.breakLoc=t;this.label=r}l(o,e);t.LabeledEntry=o;function s(e){r.ok(this instanceof s);var n=a("./emit").Emitter;r.ok(e instanceof n);this.emitter=e;this.entryStack=[new u(e.finalLoc)]}var i=s.prototype;t.LeapManager=s;i.withEntry=function(n,t){r.ok(n instanceof e);this.entryStack.push(n);try{t.call(this.emitter)}finally{var l=this.entryStack.pop();r.strictEqual(l,n)}};i._findLeapLocation=function(l,r){for(var n=this.entryStack.length-1;n>=0;--n){var e=this.entryStack[n];var t=e[l];if(t){if(r){if(e.label&&e.label.name===r.name){return t}}else if(e instanceof o){}else{return t}}}return null};i.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)};i.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},{"./emit":144,assert:110,recast:177,util:134}],147:[function(r,d,o){var f=r("assert");var u=r("private").makeAccessor();var l=r("recast").types;var c=l.builtInTypes.array;var t=l.namedTypes;var n=Object.prototype.hasOwnProperty;function i(e,i){function a(n){t.Node.assert(n);var e=false;function a(n){if(e){}else if(c.check(n)){n.some(a)}else if(t.Node.check(n)){f.strictEqual(e,false);e=r(n)}return e}l.eachField(n,function(n,e){a(e)});return e}function r(r){t.Node.assert(r);var l=u(r);if(n.call(l,e))return l[e];if(n.call(p,r.type))return l[e]=false;if(n.call(i,r.type))return l[e]=true;return l[e]=a(r)}r.onlyChildren=a;return r}var p={FunctionExpression:true};var s={CallExpression:true,ForInStatement:true,UnaryExpression:true,BinaryExpression:true,AssignmentExpression:true,UpdateExpression:true,NewExpression:true};var e={YieldExpression:true,BreakStatement:true,ContinueStatement:true,ReturnStatement:true,ThrowStatement:true};for(var a in e){if(n.call(e,a)){s[a]=e[a]}}o.hasSideEffects=i("hasSideEffects",s);o.containsLeap=i("containsLeap",e)},{assert:110,"private":143,recast:177}],148:[function(t,i,e){var s=t("assert");var r=t("recast").types;var a=r.namedTypes;var n=r.builders;var l=Object.prototype.hasOwnProperty;e.defaults=function(t){var a=arguments.length;var e;for(var r=1;r<a;++r){if(e=arguments[r]){for(var n in e){if(l.call(e,n)&&!l.call(t,n)){t[n]=e[n]}}}}return t};e.runtimeProperty=function(e){return n.memberExpression(n.identifier("regeneratorRuntime"),n.identifier(e),false)};e.isReference=function(e,r){var t=e.value;if(!a.Identifier.check(t)){return false}if(r&&t.name!==r){return false}var n=e.parent.value;switch(n.type){case"VariableDeclarator":return e.name==="init";case"MemberExpression":return e.name==="object"||n.computed&&e.name==="property";case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":if(e.name==="id"){return false}if(n.params===e.parentPath&&n.params[e.name]===t){return false}return true;case"ClassDeclaration":case"ClassExpression":return e.name!=="id";case"CatchClause":return e.name!=="param";case"Property":case"MethodDefinition":return e.name!=="key";case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"LabeledStatement":return false;default:return true}}},{assert:110,recast:177}],149:[function(r,E,p){var m=r("assert");var g=r("fs");var a=r("recast");var t=a.types;var n=t.namedTypes;var e=t.builders;var _=t.builtInTypes.array;var w=t.builtInTypes.object;var o=t.NodePath;var b=r("./hoist").hoist;var d=r("./emit").Emitter;var l=r("./util").runtimeProperty;var h=l("wrap");var s=l("mark");var y=l("values");var v=l("async");p.transform=function S(e,t){t=t||{};var r=e instanceof o?e:new o(e);i.visit(r,t);e=r.value;if(t.includeRuntime===true||t.includeRuntime==="if used"&&i.wasChangeReported()){x(n.File.check(e)?e.program:e)}t.madeChanges=i.wasChangeReported();return e};function x(e){n.Program.assert(e);var t=r("..").runtime.path;var i=g.readFileSync(t,"utf8");var s=a.parse(i,{sourceFileName:t}).program.body;var l=e.body;l.unshift.apply(l,s)
}var i=t.PathVisitor.fromMethodsObject({reset:function(n,e){this.options=e},visitFunction:function(r){this.traverse(r);var t=r.value;var i=t.async&&!this.options.disableAsync;if(!t.generator&&!i){return}this.reportChanged();t.generator=false;if(t.expression){t.expression=false;t.body=e.blockStatement([e.returnStatement(t.body)])}if(i){f.visit(r.get("body"))}var A=t.id||(t.id=r.scope.parent.declareTemporary("callee$"));var R=e.identifier(t.id.name+"$");var I=r.scope.declareTemporary("context$");var w=r.scope.declareTemporary("args$");var S=u(r,w);var a=b(r);if(S){a=a||e.variableDeclaration("var",[]);a.declarations.push(e.variableDeclarator(w,e.identifier("arguments")))}var y=new d(I);y.explode(r.get("body"));var p=[];if(a&&a.declarations.length>0){p.push(a)}var x=[y.getContextFunction(R),i?e.literal(null):A,e.thisExpression()];var E=y.getTryEntryList();if(E){x.push(E)}var k=e.callExpression(i?v:h,x);p.push(e.returnStatement(k));t.body=e.blockStatement(p);if(i){t.async=false;return}if(n.FunctionDeclaration.check(t)){var l=r.parent;while(l&&!(n.BlockStatement.check(l.value)||n.Program.check(l.value))){l=l.parent}if(!l){return}r.replace();t.type="FunctionExpression";var o=e.variableDeclaration("var",[e.variableDeclarator(t.id,e.callExpression(s,[t]))]);if(t.comments){o.comments=t.comments;t.comments=null}var g=l.get("body");var C=g.value.length;for(var m=0;m<C;++m){var _=g.get(m);if(!c(_)){_.insertBefore(o);return}}g.push(o)}else{n.FunctionExpression.assert(t);return e.callExpression(s,[t])}},visitForOfStatement:function(l){this.traverse(l);var t=l.value;var s=l.scope.declareTemporary("t$");var o=e.variableDeclarator(s,e.callExpression(y,[t.right]));var i=l.scope.declareTemporary("t$");var u=e.variableDeclarator(i,null);var r=t.left;var a;if(n.VariableDeclaration.check(r)){a=r.declarations[0].id;r.declarations.push(o,u)}else{a=r;r=e.variableDeclaration("var",[o,u])}n.Identifier.assert(a);var c=e.expressionStatement(e.assignmentExpression("=",a,e.memberExpression(i,e.identifier("value"),false)));if(n.BlockStatement.check(t.body)){t.body.body.unshift(c)}else{t.body=e.blockStatement([c,t.body])}return e.forStatement(r,e.unaryExpression("!",e.memberExpression(e.assignmentExpression("=",i,e.callExpression(e.memberExpression(s,e.identifier("next"),false),[])),e.identifier("done"),false)),null,t.body)}});function c(a){var e=a.value;n.Statement.assert(e);if(n.ExpressionStatement.check(e)&&n.Literal.check(e.expression)&&e.expression.value==="use strict"){return true}if(n.VariableDeclaration.check(e)){for(var r=0;r<e.declarations.length;++r){var l=e.declarations[r];if(n.CallExpression.check(l.init)&&t.astNodesAreEquivalent(l.init.callee,s)){return true}}}return false}function u(e,i){m.ok(e instanceof t.NodePath);var s=e.value;var r=false;var l=false;a.visit(e,{visitFunction:function(e){if(e.value===s){l=!e.scope.lookup("arguments");this.traverse(e)}else{return false}},visitIdentifier:function(e){if(e.value.name==="arguments"){var t=n.MemberExpression.check(e.parent.node)&&e.name==="property"&&!e.parent.node.computed;if(!t){e.replace(i);r=true;return false}}this.traverse(e)}});return r&&l}var f=t.PathVisitor.fromMethodsObject({visitFunction:function(e){return false},visitAwaitExpression:function(n){return e.yieldExpression(n.value.argument,false)}})},{"..":150,"./emit":144,"./hoist":145,"./util":148,assert:110,fs:109,recast:177}],150:[function(e,n,t){(function(m){var f=e("assert");var g=e("path");var y=e("fs");var d=e("through");var i=e("./lib/visit").transform;var h=e("./lib/util");var t=e("recast");var s=t.types;var b=/\bfunction\s*\*|\basync\b/;var p=/\b(let|const)\s+/;function r(l,n){var e=[];return d(t,r);function t(n){e.push(n)}function r(){this.queue(o(e.join(""),n).code);this.queue(null)}}n.exports=r;function l(){e("./runtime")}r.runtime=l;l.path=g.join(m,"runtime.js");function o(n,e){e=u(e);if(!b.test(n)){return{code:(e.includeRuntime===true?y.readFileSync(l.path,"utf-8")+"\n":"")+n}}var r=c(e);var p=t.parse(n,r);var o=new s.NodePath(p);var f=o.get("program");if(v(n,e)){a(f.node)}i(f,e);return t.print(o,r)}function u(n){n=h.defaults(n||{},{includeRuntime:false,supportBlockBinding:true});if(!n.esprima){n.esprima=e("esprima-fb")}f.ok(/harmony/.test(n.esprima.version),"Bad esprima version: "+n.esprima.version);return n}function c(n){var t={range:true};function e(e){if(e in n){t[e]=n[e]}}e("esprima");e("sourceFileName");e("sourceMapName");e("inputSourceMap");e("sourceRoot");return t}function v(n,t){var e=!!t.supportBlockBinding;if(e){if(!p.test(n)){e=false}}return e}function x(r,l){var e=c(u(l));var n=t.parse(r,e);a(n.program);return t.print(n,e).code}function a(n){s.namedTypes.Program.assert(n);var t=e("defs")(n,{ast:true,disallowUnknownReferences:false,disallowDuplicated:false,disallowVars:false,loopClosures:"iife"});if(t.errors){throw new Error(t.errors.join("\n"))}return n}r.varify=x;r.compile=o;r.transform=i}).call(this,"/node_modules/regenerator")},{"./lib/util":148,"./lib/visit":149,"./runtime":179,assert:110,defs:151,"esprima-fb":166,fs:109,path:118,recast:177,through:178}],151:[function(t,x,N){"use strict";var l=t("assert");var r=t("simple-is");var f=t("simple-fmt");var M=t("stringmap");var w=t("stringset");var _=t("alter");var a=t("ast-traverse");var I=t("breakable");var s=t("./scope");var n=t("./error");var e=n.getline;var i=t("./options");var k=t("./stats");var u=t("./jshint_globals/vars.js");function c(e){return r.someof(e,["const","let"])}function v(e){return r.someof(e,["var","const","let"])}function O(e){return e.type==="BlockStatement"&&r.noneof(e.$parent.type,["FunctionDeclaration","FunctionExpression"])}function b(e){return e.type==="ForStatement"&&e.init&&e.init.type==="VariableDeclaration"&&c(e.init.kind)}function E(e){return y(e)&&e.left.type==="VariableDeclaration"&&c(e.left.kind)}function y(e){return r.someof(e.type,["ForInStatement","ForOfStatement"])}function o(e){return r.someof(e.type,["FunctionDeclaration","FunctionExpression"])}function m(e){return r.someof(e.type,["ForStatement","ForInStatement","ForOfStatement","WhileStatement","DoWhileStatement"])}function p(n){var e=n.$parent;return n.$refToScope||n.type==="Identifier"&&!(e.type==="VariableDeclarator"&&e.id===n)&&!(e.type==="MemberExpression"&&e.computed===false&&e.property===n)&&!(e.type==="Property"&&e.key===n)&&!(e.type==="LabeledStatement"&&e.label===n)&&!(e.type==="CatchClause"&&e.param===n)&&!(o(e)&&e.id===n)&&!(o(e)&&r.someof(n,e.params))&&true}function g(e){return p(e)&&(e.$parent.type==="AssignmentExpression"&&e.$parent.left===e||e.$parent.type==="UpdateExpression"&&e.$parent.argument===e)}function R(t,a){l(!t.$scope);t.$parent=a;t.$scope=t.$parent?t.$parent.$scope:null;if(t.type==="Program"){t.$scope=new s({kind:"hoist",node:t,parent:null})}else if(o(t)){t.$scope=new s({kind:"hoist",node:t,parent:t.$parent.$scope});if(t.id){l(t.id.type==="Identifier");if(t.type==="FunctionDeclaration"){t.$parent.$scope.add(t.id.name,"fun",t.id,null)}else if(t.type==="FunctionExpression"){t.$scope.add(t.id.name,"fun",t.id,null)}else{l(false)}}t.params.forEach(function(e){t.$scope.add(e.name,"param",e,null)})}else if(t.type==="VariableDeclaration"){l(v(t.kind));t.declarations.forEach(function(r){l(r.type==="VariableDeclarator");var a=r.id.name;if(i.disallowVars&&t.kind==="var"){n(e(r),"var {0} is not allowed (use let or const)",a)}t.$scope.add(a,t.kind,r.id,r.range[1])})}else if(b(t)||E(t)){t.$scope=new s({kind:"block",node:t,parent:t.$parent.$scope})}else if(O(t)){t.$scope=new s({kind:"block",node:t,parent:t.$parent.$scope})}else if(t.type==="CatchClause"){var r=t.param;t.$scope=new s({kind:"catch-block",node:t,parent:t.$parent.$scope});t.$scope.add(r.name,"caught",r,null);t.$scope.closestHoistScope().markPropagates(r.name)}}function C(r,l,a){function t(t){for(var n in t){var r=t[n];var l=r?"var":"const";if(e.hasOwn(n)){e.remove(n)}e.add(n,l,{loc:{start:{line:-1}}},-1)}}var e=new s({kind:"hoist",node:{},parent:null});var i={undefined:false,Infinity:false,console:false};t(i);t(u.reservedVars);t(u.ecmaIdentifiers);if(l){l.forEach(function(e){if(!u[e]){n(-1,'environment "{0}" not found',e)}else{t(u[e])}})}if(a){t(a)}r.parent=e;e.children.push(r);return e}function A(o,u,t){var s=r.own(t,"analyze")?t.analyze:true;function c(t){if(!p(t)){return}u.add(t.name);var a=t.$scope.lookup(t.name);if(s&&!a&&i.disallowUnknownReferences){n(e(t),"reference to unknown global variable {0}",t.name)}if(s&&a&&r.someof(a.getKind(t.name),["const","let"])){var o=a.getFromPos(t.name);var c=t.range[0];l(r.finitenumber(o));l(r.finitenumber(c));if(c<o){if(!t.$scope.hasFunctionScopeBetween(a)){n(e(t),"{0} is referenced before its declaration",t.name)}}}t.$refToScope=a}a(o,{pre:c})}function T(t,i,r,n){function s(e){l(r.has(e));for(var n=0;;n++){var t=e+"$"+String(n);if(!r.has(t)){return t}}}function o(t){if(t.type==="VariableDeclaration"&&c(t.kind)){var a=t.$scope.closestHoistScope();var o=t.$scope;n.push({start:t.range[0],end:t.range[0]+t.kind.length,str:"var"});t.declarations.forEach(function(u){l(u.type==="VariableDeclarator");var c=u.id.name;i.declarator(t.kind);var p=o!==a&&(a.hasOwn(c)||a.doesPropagate(c));var f=p?s(c):c;o.remove(c);a.add(f,"var",u.id,u.range[1]);o.moves=o.moves||M();o.moves.set(c,{name:f,scope:a});r.add(f);if(f!==c){i.rename(c,f,e(u));u.id.originalName=c;u.id.name=f;n.push({start:u.id.range[0],end:u.id.range[1],str:f})}});t.kind="var"}}function u(e){if(!e.$refToScope){return}var t=e.$refToScope.moves&&e.$refToScope.moves.get(e.name);if(!t){return}e.$refToScope=t.scope;if(e.name!==t.name){e.originalName=e.name;e.name=t.name;if(e.alterop){var r=null;for(var a=0;a<n.length;a++){var i=n[a];if(i.node===e){r=i;break}}l(r);r.str=t.name}else{n.push({start:e.range[0],end:e.range[1],str:t.name})}}}a(t,{pre:o});a(t,{pre:u});t.$scope.traverse({pre:function(e){delete e.moves}})}function L(t){a(t,{pre:s});function r(r,t){return I(function(l){a(r,{pre:function(r){if(o(r)){return false}var i=true;var a="loop-variable {0} is captured by a loop-closure that can't be transformed due to use of {1} at line {2}";if(r.type==="BreakStatement"){n(e(t),a,t.name,"break",e(r))}else if(r.type==="ContinueStatement"){n(e(t),a,t.name,"continue",e(r))}else if(r.type==="ReturnStatement"){n(e(t),a,t.name,"return",e(r))}else if(r.type==="YieldExpression"){n(e(t),a,t.name,"yield",e(r))}else if(r.type==="Identifier"&&r.name==="arguments"){n(e(t),a,t.name,"arguments",e(r))}else if(r.type==="VariableDeclaration"&&r.kind==="var"){n(e(t),a,t.name,"var",e(r))}else{i=false}if(i){l(true)}}});return false})}function s(t){var a=null;if(p(t)&&t.$refToScope&&c(t.$refToScope.getKind(t.name))){for(var s=t.$refToScope.node;;){if(o(s)){return}else if(m(s)){a=s;break}s=s.$parent;if(!s){return}}l(m(a));var f=t.$refToScope;var h=i.loopClosures==="iife";for(var u=t.$scope;u;u=u.parent){if(u===f){return}else if(o(u.node)){if(!h){var g='loop-variable {0} is captured by a loop-closure. Tried "loopClosures": "iife" in defs-config.json?';return n(e(t),g,t.name)}if(a.type==="ForStatement"&&f.node===a){var d=f.getNode(t.name);return n(e(d),"Not yet specced ES6 feature. {0} is declared in for-loop header and then captured in loop closure",d.name)}if(r(a.body,t)){return}a.$iify=true}}}}}function P(n,t,r){function e(e,l,n){var r={start:e,end:e,str:l};if(n){r.node=n}t.push(r)}a(n,{pre:function(n){if(!n.$iify){return}var i=n.body.type==="BlockStatement";var d=i?n.body.range[0]+1:n.body.range[0];var l=i?n.body.range[1]-1:n.body.range[1];var t=y(n)&&n.left.declarations[0].id.name;var s=f("(function({0}){",t?t:"");var o=f("}).call(this{0});",t?", "+t:"");var v=r.parse(s+o);var a=v.body[0];var p=a.expression.callee.object.body;if(i){var c=n.body;var m=c.body;c.body=[a];p.body=m}else{var h=n.body;n.body=a;p.body[0]=h}e(d,s);if(t){e(l,"}).call(this, ");var g=a.expression.arguments;var u=g[1];u.alterop=true;e(l,t,u);e(l,");")}else{e(l,o)}}})}function j(t){a(t,{pre:function(t){if(g(t)){var r=t.$scope.lookup(t.name);if(r&&r.getKind(t.name)==="const"){n(e(t),"can't assign to const variable {0}",t.name)}}}})}function D(e){a(e,{pre:function(e){if(g(e)){var n=e.$scope.lookup(e.name);if(n){n.markWrite(e.name)}}}});e.$scope.detectUnmodifiedLets()}function h(e,t){a(e,{pre:R});var r=C(e.$scope,i.environments,i.globals);var n=w();r.traverse({pre:function(e){n.addMany(e.decls.keys())}});A(e,n,t);return n}function d(e){a(e,{pre:function(e){for(var n in e){if(n[0]==="$"){delete e[n]}}}})}function S(t,c){for(var p in c){i[p]=c[p]}var o;if(r.object(t)){if(!i.ast){return{errors:["Can't produce string output when input is an AST. "+"Did you forget to set options.ast = true?"]}}o=t}else if(r.string(t)){try{o=i.parse(t,{loc:true,range:true})}catch(a){return{errors:[f("line {0} column {1}: Error during input file parsing\n{2}\n{3}",a.lineNumber,a.column,t.split("\n")[a.lineNumber-1],f.repeat(" ",a.column-1)+"^")]}}}else{return{errors:["Input was neither an AST object nor a string."]}}var e=o;n.reset();var m=h(e,{});L(e);j(e);var s=[];P(e,s,i);if(n.errors.length>=1){return{errors:n.errors}}if(s.length>0){d(e);m=h(e,{analyze:false})}l(n.errors.length===0);var u=new k;T(e,u,m,s);if(i.ast){d(e);return{stats:u,ast:e}}else{var g=_(t,s);return{stats:u,src:g}}}x.exports=S},{"./error":152,"./jshint_globals/vars.js":153,"./options":154,"./scope":155,"./stats":156,alter:157,assert:110,"ast-traverse":159,breakable:160,"simple-fmt":162,"simple-is":163,stringmap:164,stringset:165}],152:[function(t,r,a){"use strict";var n=t("simple-fmt");var l=t("assert");function e(t,a){l(arguments.length>=2);var r=arguments.length===2?String(a):n.apply(n,Array.prototype.slice.call(arguments,1));e.errors.push(t===-1?r:n("line {0}: {1}",t,r))}e.reset=function(){e.errors=[]};e.getline=function(e){if(e&&e.loc&&e.loc.start){return e.loc.start.line}return-1};e.reset();r.exports=e},{assert:110,"simple-fmt":162}],153:[function(n,t,e){"use strict";e.reservedVars={arguments:false,NaN:false};e.ecmaIdentifiers={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Math:false,Map:false,Number:false,Object:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,Set:false,String:false,SyntaxError:false,TypeError:false,URIError:false,WeakMap:false};e.browser={ArrayBuffer:false,ArrayBufferView:false,Audio:false,Blob:false,addEventListener:false,applicationCache:false,atob:false,blur:false,btoa:false,clearInterval:false,clearTimeout:false,close:false,closed:false,DataView:false,DOMParser:false,defaultStatus:false,document:false,Element:false,event:false,FileReader:false,Float32Array:false,Float64Array:false,FormData:false,focus:false,frames:false,getComputedStyle:false,HTMLElement:false,HTMLAnchorElement:false,HTMLBaseElement:false,HTMLBlockquoteElement:false,HTMLBodyElement:false,HTMLBRElement:false,HTMLButtonElement:false,HTMLCanvasElement:false,HTMLDirectoryElement:false,HTMLDivElement:false,HTMLDListElement:false,HTMLFieldSetElement:false,HTMLFontElement:false,HTMLFormElement:false,HTMLFrameElement:false,HTMLFrameSetElement:false,HTMLHeadElement:false,HTMLHeadingElement:false,HTMLHRElement:false,HTMLHtmlElement:false,HTMLIFrameElement:false,HTMLImageElement:false,HTMLInputElement:false,HTMLIsIndexElement:false,HTMLLabelElement:false,HTMLLayerElement:false,HTMLLegendElement:false,HTMLLIElement:false,HTMLLinkElement:false,HTMLMapElement:false,HTMLMenuElement:false,HTMLMetaElement:false,HTMLModElement:false,HTMLObjectElement:false,HTMLOListElement:false,HTMLOptGroupElement:false,HTMLOptionElement:false,HTMLParagraphElement:false,HTMLParamElement:false,HTMLPreElement:false,HTMLQuoteElement:false,HTMLScriptElement:false,HTMLSelectElement:false,HTMLStyleElement:false,HTMLTableCaptionElement:false,HTMLTableCellElement:false,HTMLTableColElement:false,HTMLTableElement:false,HTMLTableRowElement:false,HTMLTableSectionElement:false,HTMLTextAreaElement:false,HTMLTitleElement:false,HTMLUListElement:false,HTMLVideoElement:false,history:false,Int16Array:false,Int32Array:false,Int8Array:false,Image:false,length:false,localStorage:false,location:false,MessageChannel:false,MessageEvent:false,MessagePort:false,moveBy:false,moveTo:false,MutationObserver:false,name:false,Node:false,NodeFilter:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,openDatabase:false,opener:false,Option:false,parent:false,print:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,sessionStorage:false,setInterval:false,setTimeout:false,SharedWorker:false,status:false,top:false,Uint16Array:false,Uint32Array:false,Uint8Array:false,Uint8ClampedArray:false,WebSocket:false,window:false,Worker:false,XMLHttpRequest:false,XMLSerializer:false,XPathEvaluator:false,XPathException:false,XPathExpression:false,XPathNamespace:false,XPathNSResolver:false,XPathResult:false};e.devel={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false};e.worker={importScripts:true,postMessage:true,self:true};e.nonstandard={escape:false,unescape:false};e.couch={require:false,respond:false,getRow:false,emit:false,send:false,start:false,sum:false,log:false,exports:false,module:false,provides:false};e.node={__filename:false,__dirname:false,Buffer:false,DataView:false,console:false,exports:true,GLOBAL:false,global:false,module:false,process:false,require:false,setTimeout:false,clearTimeout:false,setInterval:false,clearInterval:false};e.phantom={phantom:true,require:true,WebPage:true};e.rhino={defineClass:false,deserialize:false,gc:false,help:false,importPackage:false,java:false,load:false,loadClass:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false};e.wsh={ActiveXObject:true,Enumerator:true,GetObject:true,ScriptEngine:true,ScriptEngineBuildVersion:true,ScriptEngineMajorVersion:true,ScriptEngineMinorVersion:true,VBArray:true,WSH:true,WScript:true,XDomainRequest:true};e.dojo={dojo:false,dijit:false,dojox:false,define:false,require:false};e.jquery={$:false,jQuery:false};e.mootools={$:false,$$:false,Asset:false,Browser:false,Chain:false,Class:false,Color:false,Cookie:false,Core:false,Document:false,DomReady:false,DOMEvent:false,DOMReady:false,Drag:false,Element:false,Elements:false,Event:false,Events:false,Fx:false,Group:false,Hash:false,HtmlTable:false,Iframe:false,IframeShim:false,InputValidator:false,instanceOf:false,Keyboard:false,Locale:false,Mask:false,MooTools:false,Native:false,Options:false,OverText:false,Request:false,Scroller:false,Slick:false,Slider:false,Sortables:false,Spinner:false,Swiff:false,Tips:false,Type:false,typeOf:false,URI:false,Window:false};e.prototypejs={$:false,$$:false,$A:false,$F:false,$H:false,$R:false,$break:false,$continue:false,$w:false,Abstract:false,Ajax:false,Class:false,Enumerable:false,Element:false,Event:false,Field:false,Form:false,Hash:false,Insertion:false,ObjectRange:false,PeriodicalExecuter:false,Position:false,Prototype:false,Selector:false,Template:false,Toggle:false,Try:false,Autocompleter:false,Builder:false,Control:false,Draggable:false,Draggables:false,Droppables:false,Effect:false,Sortable:false,SortableObserver:false,Sound:false,Scriptaculous:false};e.yui={YUI:false,Y:false,YUI_config:false}},{}],154:[function(e,n,t){n.exports={disallowVars:false,disallowDuplicated:true,disallowUnknownReferences:true,parse:e("esprima-fb").parse}},{"esprima-fb":161}],155:[function(r,u,f){"use strict";var t=r("assert");var o=r("stringmap");var s=r("stringset");var n=r("simple-is");var a=r("simple-fmt");var l=r("./error");var i=l.getline;var c=r("./options");function e(e){t(n.someof(e.kind,["hoist","block","catch-block"]));t(n.object(e.node));t(e.parent===null||n.object(e.parent));this.kind=e.kind;this.node=e.node;this.parent=e.parent;this.children=[];this.decls=o();this.written=s();this.propagates=this.kind==="hoist"?s():null;if(this.parent){this.parent.children.push(this)}}e.prototype.print=function(e){e=e||0;var n=this;var t=this.decls.keys().map(function(e){return a("{0} [{1}]",e,n.decls.get(e).kind)}).join(", ");var r=this.propagates?this.propagates.items().join(", "):"";console.log(a("{0}{1}: {2}. propagates: {3}",a.repeat(" ",e),this.node.type,t,r));this.children.forEach(function(n){n.print(e+2)})};e.prototype.add=function(r,a,s,u){t(n.someof(a,["fun","param","var","caught","const","let"]));function o(e){return n.someof(e,["const","let"])}var e=this;if(n.someof(a,["fun","param","var"])){while(e.kind!=="hoist"){if(e.decls.has(r)&&o(e.decls.get(r).kind)){return l(i(s),"{0} is already declared",r)}e=e.parent}}if(e.decls.has(r)&&(c.disallowDuplicated||o(e.decls.get(r).kind)||o(a))){return l(i(s),"{0} is already declared",r)}var f={kind:a,node:s};if(u){t(n.someof(a,["var","const","let"]));f.from=u}e.decls.set(r,f)};e.prototype.getKind=function(e){t(n.string(e));var r=this.decls.get(e);return r?r.kind:null};e.prototype.getNode=function(e){t(n.string(e));var r=this.decls.get(e);return r?r.node:null};e.prototype.getFromPos=function(e){t(n.string(e));var r=this.decls.get(e);return r?r.from:null};e.prototype.hasOwn=function(e){return this.decls.has(e)};e.prototype.remove=function(e){return this.decls.remove(e)};e.prototype.doesPropagate=function(e){return this.propagates.has(e)};e.prototype.markPropagates=function(e){this.propagates.add(e)};e.prototype.closestHoistScope=function(){var e=this;while(e.kind!=="hoist"){e=e.parent}return e};e.prototype.hasFunctionScopeBetween=function(t){function r(e){return n.someof(e.type,["FunctionDeclaration","FunctionExpression"])}for(var e=this;e;e=e.parent){if(e===t){return false}if(r(e.node)){return true}}throw new Error("wasn't inner scope of outer")};e.prototype.lookup=function(n){for(var e=this;e;e=e.parent){if(e.decls.has(n)){return e}else if(e.kind==="hoist"){e.propagates.add(n)}}return null};e.prototype.markWrite=function(e){t(n.string(e));this.written.add(e)};e.prototype.detectUnmodifiedLets=function(){var n=this;function e(t){if(t!==n){t.decls.keys().forEach(function(e){if(t.getKind(e)==="let"&&!t.written.has(e)){return l(i(t.getNode(e)),"{0} is declared as let but never modified so could be const",e)}})}t.children.forEach(function(n){e(n)})}e(this)};e.prototype.traverse=function(e){e=e||{};var n=e.pre;var t=e.post;function r(e){if(n){n(e)}e.children.forEach(function(e){r(e)});if(t){t(e)}}r(this)};u.exports=e},{"./error":152,"./options":154,assert:110,"simple-fmt":162,"simple-is":163,stringmap:164,stringset:165}],156:[function(n,r,i){var t=n("simple-fmt");var l=n("simple-is");var a=n("assert");function e(){this.lets=0;this.consts=0;this.renames=[]}e.prototype.declarator=function(e){a(l.someof(e,["const","let"]));if(e==="const"){this.consts++}else{this.lets++}};e.prototype.rename=function(e,n,t){this.renames.push({oldName:e,newName:n,line:t})};e.prototype.toString=function(){var n=this.renames.map(function(e){return e}).sort(function(e,n){return e.line-n.line});var r=n.map(function(e){return t("\nline {0}: {1} => {2}",e.line,e.oldName,e.newName)}).join("");var e=this.consts+this.lets;var l=e===0?"can't calculate const coverage (0 consts, 0 lets)":t("{0}% const coverage ({1} consts, {2} lets)",Math.floor(100*this.consts/e),this.consts,this.lets);return l+r+"\n"};r.exports=e},{assert:110,"simple-fmt":162,"simple-is":163}],157:[function(t,n,a){var e=t("assert");var r=t("stable");function l(l,s){"use strict";var u=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};e(typeof l==="string");e(u(s));var o=r(s,function(e,n){return e.start-n.start});var a=[];var t=0;for(var i=0;i<o.length;i++){var n=o[i];e(t<=n.start);e(n.start<=n.end);a.push(l.slice(t,n.start));a.push(n.str);t=n.end}if(t<l.length){a.push(l.slice(t))}return a.join("")}if(typeof n!=="undefined"&&typeof n.exports!=="undefined"){n.exports=l}},{assert:110,stable:158}],158:[function(n,e,t){(function(){var n=function(e,n){return t(e.slice(),n)};n.inplace=function(e,l){var n=t(e,l);if(n!==e){r(n,null,e.length,e)}return e};function t(e,n){if(typeof n!=="function"){n=function(e,n){return String(e).localeCompare(n)}}var t=e.length;if(t<=1){return e}var l=new Array(t);for(var a=1;a<t;a*=2){r(e,n,a,l);var i=e;e=l;l=i}return e}var r=function(e,c,u,o){var l=e.length;var s=0;var f=u*2;var a,n,i;var t,r;for(a=0;a<l;a+=f){n=a+u;i=n+u;if(n>l)n=l;if(i>l)i=l;t=a;r=n;while(true){if(t<n&&r<i){if(c(e[t],e[r])<=0){o[s++]=e[t++]}else{o[s++]=e[r++]}}else if(t<n){o[s++]=e[t++]}else if(r<i){o[s++]=e[r++]}else{break}}}};if(typeof e!=="undefined"){e.exports=n}else{window.stable=n}})()},{}],159:[function(t,e,r){function n(a,e){"use strict";e=e||{};var t=e.pre;var r=e.post;var l=e.skipProperty;function n(e,o,a,u){if(!e||typeof e.type!=="string"){return}var c=undefined;if(t){c=t(e,o,a,u)}if(c!==false){for(var a in e){if(l?l(a,e):a[0]==="$"){continue}var i=e[a];if(Array.isArray(i)){for(var s=0;s<i.length;s++){n(i[s],e,a,s)}}else{n(i,e,a)}}}if(r){r(e,o,a,u)}}n(a,null)}if(typeof e!=="undefined"&&typeof e.exports!=="undefined"){e.exports=n}},{}],160:[function(t,e,r){var n=function(){"use strict";function e(e,n){this.val=e;this.brk=n}function n(){return function n(t){throw new e(t,n)}}function t(l){var r=n();try{return l(r)}catch(t){if(t instanceof e&&t.brk===r){return t.val}throw t}}return t}();if(typeof e!=="undefined"&&typeof e.exports!=="undefined"){e.exports=n}},{}],161:[function(n,t,e){(function(t,n){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],n)}else if(typeof e!=="undefined"){n(e)}else{n(t.esprima={})}})(this,function(En){"use strict";var u,C,Gn,l,J,i,_n,Fn,Nn,$,s,v,e,h,g,y,t,c,a,p;u={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10,XJSIdentifier:11,XJSText:12};C={};C[u.BooleanLiteral]="Boolean";C[u.EOF]="<end>";C[u.Identifier]="Identifier";C[u.Keyword]="Keyword";C[u.NullLiteral]="Null";C[u.NumericLiteral]="Numeric";C[u.Punctuator]="Punctuator";C[u.StringLiteral]="String";C[u.XJSIdentifier]="XJSIdentifier";C[u.XJSText]="XJSText";C[u.RegularExpression]="RegularExpression";Gn=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];l={AnyTypeAnnotation:"AnyTypeAnnotation",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrayTypeAnnotation:"ArrayTypeAnnotation",ArrowFunctionExpression:"ArrowFunctionExpression",AssignmentExpression:"AssignmentExpression",BinaryExpression:"BinaryExpression",BlockStatement:"BlockStatement",BooleanTypeAnnotation:"BooleanTypeAnnotation",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ClassImplements:"ClassImplements",ClassProperty:"ClassProperty",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DeclareClass:"DeclareClass",DeclareFunction:"DeclareFunction",DeclareModule:"DeclareModule",DeclareVariable:"DeclareVariable",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportDeclaration:"ExportDeclaration",ExportBatchSpecifier:"ExportBatchSpecifier",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",ForStatement:"ForStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",FunctionTypeAnnotation:"FunctionTypeAnnotation",FunctionTypeParam:"FunctionTypeParam",GenericTypeAnnotation:"GenericTypeAnnotation",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",InterfaceDeclaration:"InterfaceDeclaration",InterfaceExtends:"InterfaceExtends",IntersectionTypeAnnotation:"IntersectionTypeAnnotation",LabeledStatement:"LabeledStatement",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",NullableTypeAnnotation:"NullableTypeAnnotation",NumberTypeAnnotation:"NumberTypeAnnotation",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",ObjectTypeAnnotation:"ObjectTypeAnnotation",ObjectTypeCallProperty:"ObjectTypeCallProperty",ObjectTypeIndexer:"ObjectTypeIndexer",ObjectTypeProperty:"ObjectTypeProperty",Program:"Program",Property:"Property",QualifiedTypeIdentifier:"QualifiedTypeIdentifier",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SpreadProperty:"SpreadProperty",StringLiteralTypeAnnotation:"StringLiteralTypeAnnotation",StringTypeAnnotation:"StringTypeAnnotation",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TupleTypeAnnotation:"TupleTypeAnnotation",TryStatement:"TryStatement",TypeAlias:"TypeAlias",TypeAnnotation:"TypeAnnotation",TypeofTypeAnnotation:"TypeofTypeAnnotation",TypeParameterDeclaration:"TypeParameterDeclaration",TypeParameterInstantiation:"TypeParameterInstantiation",UnaryExpression:"UnaryExpression",UnionTypeAnnotation:"UnionTypeAnnotation",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",VoidTypeAnnotation:"VoidTypeAnnotation",WhileStatement:"WhileStatement",WithStatement:"WithStatement",XJSIdentifier:"XJSIdentifier",XJSNamespacedName:"XJSNamespacedName",XJSMemberExpression:"XJSMemberExpression",XJSEmptyExpression:"XJSEmptyExpression",XJSExpressionContainer:"XJSExpressionContainer",XJSElement:"XJSElement",XJSClosingElement:"XJSClosingElement",XJSOpeningElement:"XJSOpeningElement",XJSAttribute:"XJSAttribute",XJSSpreadAttribute:"XJSSpreadAttribute",XJSText:"XJSText",YieldExpression:"YieldExpression",AwaitExpression:"AwaitExpression"};J={Data:1,Get:2,Set:4};$={"static":"static",prototype:"prototype"};i={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInFormalsList:"Invalid left-hand side in formals list",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalDuplicateClassProperty:"Illegal duplicate property in class definition",IllegalReturn:"Illegal return statement",IllegalSpread:"Illegal spread element",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",ParameterAfterRestParameter:"Rest parameter must be final parameter of an argument list",DefaultRestParameter:"Rest parameter can not have a default value",ElementAfterSpreadElement:"Spread must be the final element of an element list",PropertyAfterSpreadProperty:"A rest property must be the final property of an object literal",ObjectPatternAsRestParameter:"Invalid rest parameter",ObjectPatternAsSpread:"Invalid spread argument",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingFromClause:"Missing from clause",NoAsAfterImportNamespace:"Missing as after import *",InvalidModuleSpecifier:"Invalid module specifier",NoUnintializedConst:"Const must be initialized",ComprehensionRequiresBlock:"Comprehension must have at least one block",ComprehensionError:"Comprehension Error",EachNotAllowed:"Each is not supported",InvalidXJSAttributeValue:"XJS value should be either an expression or a quoted XJS text",ExpectedXJSClosingTag:"Expected corresponding XJS closing tag for %0",AdjacentXJSElements:"Adjacent XJS elements must be wrapped in an enclosing tag",ConfusedAboutFunctionType:"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType"};
_n={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),LeadingZeros:new RegExp("^0+(?!$)")};function G(e,n){if(!e){throw new Error("ASSERT: "+n)}}function D(e){return e>=48&&e<=57}function Dn(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function U(e){return"01234567".indexOf(e)>=0}function st(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&" ".indexOf(String.fromCharCode(e))>0}function T(e){return e===10||e===13||e===8232||e===8233}function q(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&_n.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function an(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&_n.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function Lr(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return true;default:return false}}function un(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true;default:return false}}function L(e){return e==="eval"||e==="arguments"}function Yr(e){if(v&&un(e)){return true}switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try"||e==="let";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return false}}function O(){var n,t,r;t=false;r=false;while(e<y){n=s.charCodeAt(e);if(r){++e;if(T(n)){r=false;if(n===13&&s.charCodeAt(e)===10){++e}++h;g=e}}else if(t){if(T(n)){if(n===13){++e}if(n!==13||s.charCodeAt(e)===10){++h;++e;g=e;if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}}else{n=s.charCodeAt(e++);if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}if(n===42){n=s.charCodeAt(e);if(n===47){++e;t=false}}}}else if(n===47){n=s.charCodeAt(e+1);if(n===47){e+=2;r=true}else if(n===42){e+=2;t=true;if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}else{break}}else if(st(n)){++e}else if(T(n)){++e;if(n===13&&s.charCodeAt(e)===10){++e}++h;g=e}else{break}}}function cn(a){var n,r,l,t=0;r=a==="u"?4:2;for(n=0;n<r;++n){if(e<y&&Dn(s[e])){l=s[e++];t=t*16+"0123456789abcdef".indexOf(l.toLowerCase())}else{return""}}return String.fromCharCode(t)}function zn(){var t,n,r,l;t=s[e];n=0;if(t==="}"){d({},i.UnexpectedToken,"ILLEGAL")}while(e<y){t=s[e++];if(!Dn(t)){break}n=n*16+"0123456789abcdef".indexOf(t.toLowerCase())}if(n>1114111||t!=="}"){d({},i.UnexpectedToken,"ILLEGAL")}if(n<=65535){return String.fromCharCode(n)}r=(n-65536>>10)+55296;l=(n-65536&1023)+56320;return String.fromCharCode(r,l)}function Yn(){var n,t;n=s.charCodeAt(e++);t=String.fromCharCode(n);if(n===92){if(s.charCodeAt(e)!==117){d({},i.UnexpectedToken,"ILLEGAL")}++e;n=cn("u");if(!n||n==="\\"||!q(n.charCodeAt(0))){d({},i.UnexpectedToken,"ILLEGAL")}t=n}while(e<y){n=s.charCodeAt(e);if(!an(n)){break}++e;t+=String.fromCharCode(n);if(n===92){t=t.substr(0,t.length-1);if(s.charCodeAt(e)!==117){d({},i.UnexpectedToken,"ILLEGAL")}++e;n=cn("u");if(!n||n==="\\"||!an(n.charCodeAt(0))){d({},i.UnexpectedToken,"ILLEGAL")}t+=n}}return t}function ar(){var n,t;n=e++;while(e<y){t=s.charCodeAt(e);if(t===92){e=n;return Yn()}if(an(t)){++e}else{break}}return s.slice(n,e)}function pr(){var r,n,t;r=e;n=s.charCodeAt(e)===92?Yn():ar();if(n.length===1){t=u.Identifier}else if(Yr(n)){t=u.Keyword}else if(n==="null"){t=u.NullLiteral}else if(n==="true"||n==="false"){t=u.BooleanLiteral}else{t=u.Identifier}return{type:t,value:n,lineNumber:h,lineStart:g,range:[r,e]}}function V(){var n=e,l=s.charCodeAt(e),c,t=s[e],r,o,f;switch(l){case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:++e;if(p.tokenize){if(l===40){p.openParenToken=p.tokens.length}else if(l===123){p.openCurlyToken=p.tokens.length}}return{type:u.Punctuator,value:String.fromCharCode(l),lineNumber:h,lineStart:g,range:[n,e]};default:c=s.charCodeAt(e+1);if(c===61){switch(l){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:e+=2;return{type:u.Punctuator,value:String.fromCharCode(l)+String.fromCharCode(c),lineNumber:h,lineStart:g,range:[n,e]};case 33:case 61:e+=2;if(s.charCodeAt(e)===61){++e}return{type:u.Punctuator,value:s.slice(n,e),lineNumber:h,lineStart:g,range:[n,e]};default:break}}break}r=s[e+1];o=s[e+2];f=s[e+3];if(t===">"&&r===">"&&o===">"){if(f==="="){e+=4;return{type:u.Punctuator,value:">>>=",lineNumber:h,lineStart:g,range:[n,e]}}}if(t===">"&&r===">"&&o===">"){e+=3;return{type:u.Punctuator,value:">>>",lineNumber:h,lineStart:g,range:[n,e]}}if(t==="<"&&r==="<"&&o==="="){e+=3;return{type:u.Punctuator,value:"<<=",lineNumber:h,lineStart:g,range:[n,e]}}if(t===">"&&r===">"&&o==="="){e+=3;return{type:u.Punctuator,value:">>=",lineNumber:h,lineStart:g,range:[n,e]}}if(t==="."&&r==="."&&o==="."){e+=3;return{type:u.Punctuator,value:"...",lineNumber:h,lineStart:g,range:[n,e]}}if(t===r&&"+-<>&|".indexOf(t)>=0&&!a.inType){e+=2;return{type:u.Punctuator,value:t+r,lineNumber:h,lineStart:g,range:[n,e]}}if(t==="="&&r===">"){e+=2;return{type:u.Punctuator,value:"=>",lineNumber:h,lineStart:g,range:[n,e]}}if("<>=!+-*%&|^/".indexOf(t)>=0){++e;return{type:u.Punctuator,value:t,lineNumber:h,lineStart:g,range:[n,e]}}if(t==="."){++e;return{type:u.Punctuator,value:t,lineNumber:h,lineStart:g,range:[n,e]}}d({},i.UnexpectedToken,"ILLEGAL")}function qr(t){var n="";while(e<y){if(!Dn(s[e])){break}n+=s[e++]}if(n.length===0){d({},i.UnexpectedToken,"ILLEGAL")}if(q(s.charCodeAt(e))){d({},i.UnexpectedToken,"ILLEGAL")}return{type:u.NumericLiteral,value:parseInt("0x"+n,16),lineNumber:h,lineStart:g,range:[t,e]}}function Wr(r,l){var n,t;if(U(r)){t=true;n="0"+s[e++]}else{t=false;++e;n=""}while(e<y){if(!U(s[e])){break}n+=s[e++]}if(!t&&n.length===0){d({},i.UnexpectedToken,"ILLEGAL")}if(q(s.charCodeAt(e))||D(s.charCodeAt(e))){d({},i.UnexpectedToken,"ILLEGAL")}return{type:u.NumericLiteral,value:parseInt(n,8),octal:t,lineNumber:h,lineStart:g,range:[l,e]}}function Zn(){var t,r,n,l;n=s[e];G(D(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point");r=e;t="";if(n!=="."){t=s[e++];n=s[e];if(t==="0"){if(n==="x"||n==="X"){++e;return qr(r)}if(n==="b"||n==="B"){++e;t="";while(e<y){n=s[e];if(n!=="0"&&n!=="1"){break}t+=s[e++]}if(t.length===0){d({},i.UnexpectedToken,"ILLEGAL")}if(e<y){n=s.charCodeAt(e);if(q(n)||D(n)){d({},i.UnexpectedToken,"ILLEGAL")}}return{type:u.NumericLiteral,value:parseInt(t,2),lineNumber:h,lineStart:g,range:[r,e]}}if(n==="o"||n==="O"||U(n)){return Wr(n,r)}if(n&&D(n.charCodeAt(0))){d({},i.UnexpectedToken,"ILLEGAL")}}while(D(s.charCodeAt(e))){t+=s[e++]}n=s[e]}if(n==="."){t+=s[e++];while(D(s.charCodeAt(e))){t+=s[e++]}n=s[e]}if(n==="e"||n==="E"){t+=s[e++];n=s[e];if(n==="+"||n==="-"){t+=s[e++]}if(D(s.charCodeAt(e))){while(D(s.charCodeAt(e))){t+=s[e++]}}else{d({},i.UnexpectedToken,"ILLEGAL")}}if(q(s.charCodeAt(e))){d({},i.UnexpectedToken,"ILLEGAL")}return{type:u.NumericLiteral,value:parseFloat(t),lineNumber:h,lineStart:g,range:[r,e]}}function St(){var t="",l,c,n,r,a,f,o=false;l=s[e];G(l==="'"||l==='"',"String literal must starts with a quote");c=e;++e;while(e<y){n=s[e++];if(n===l){l="";break}else if(n==="\\"){n=s[e++];if(!n||!T(n.charCodeAt(0))){switch(n){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+=" ";break;case"u":case"x":if(s[e]==="{"){++e;t+=zn()}else{f=e;a=cn(n);if(a){t+=a}else{e=f;t+=n}}break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="";break;default:if(U(n)){r="01234567".indexOf(n);if(r!==0){o=true}if(e<y&&U(s[e])){o=true;r=r*8+"01234567".indexOf(s[e++]);if("0123".indexOf(n)>=0&&e<y&&U(s[e])){r=r*8+"01234567".indexOf(s[e++])}}t+=String.fromCharCode(r)}else{t+=n}break}}else{++h;if(n==="\r"&&s[e]==="\n"){++e}g=e}}else if(T(n.charCodeAt(0))){break}else{t+=n}}if(l!==""){d({},i.UnexpectedToken,"ILLEGAL")}return{type:u.StringLiteral,value:t,octal:o,lineNumber:h,lineStart:g,range:[c,e]}}function rt(){var t="",n,o,l,a,p,c,r,f;l=false;a=false;o=e;++e;while(e<y){n=s[e++];if(n==="`"){a=true;l=true;break}else if(n==="$"){if(s[e]==="{"){++e;l=true;break}t+=n}else if(n==="\\"){n=s[e++];if(!T(n.charCodeAt(0))){switch(n){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+=" ";break;case"u":case"x":if(s[e]==="{"){++e;t+=zn()}else{p=e;c=cn(n);if(c){t+=c}else{e=p;t+=n}}break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="";break;default:if(U(n)){r="01234567".indexOf(n);if(r!==0){f=true}if(e<y&&U(s[e])){f=true;r=r*8+"01234567".indexOf(s[e++]);if("0123".indexOf(n)>=0&&e<y&&U(s[e])){r=r*8+"01234567".indexOf(s[e++])}}t+=String.fromCharCode(r)}else{t+=n}break}}else{++h;if(n==="\r"&&s[e]==="\n"){++e}g=e}}else if(T(n.charCodeAt(0))){++h;if(n==="\r"&&s[e]==="\n"){++e}g=e;t+="\n"}else{t+=n}}if(!l){d({},i.UnexpectedToken,"ILLEGAL")}return{type:u.Template,value:{cooked:t,raw:s.slice(o+1,e-(a?1:2))},tail:a,octal:f,lineNumber:h,lineStart:g,range:[o,e]}}function Xt(r){var n,t;c=null;O();n=r.head?"`":"}";if(s[e]!==n){d({},i.UnexpectedToken,"ILLEGAL")}t=rt();mn();return t}function N(){var t,n,v,l,r,a,m=false,o,x=false,f;c=null;O();v=e;n=s[e];G(n==="/","Regular expression literal must start with a slash");t=s[e++];while(e<y){n=s[e++];t+=n;if(m){if(n==="]"){m=false}}else{if(n==="\\"){n=s[e++];if(T(n.charCodeAt(0))){d({},i.UnterminatedRegExp)}t+=n}else if(n==="/"){x=true;break}else if(n==="["){m=true}else if(T(n.charCodeAt(0))){d({},i.UnterminatedRegExp)}}}if(!x){d({},i.UnterminatedRegExp)}l=t.substr(1,t.length-2);r="";while(e<y){n=s[e];if(!an(n.charCodeAt(0))){break}++e;if(n==="\\"&&e<y){n=s[e];if(n==="u"){++e;o=e;n=cn("u");if(n){r+=n;for(t+="\\u";o<e;++o){t+=s[o]}}else{e=o;r+="u";t+="\\u"}}else{t+="\\"}}else{r+=n;t+=n}}f=l;if(r.indexOf("u")>=0){f=f.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{a=new RegExp(f)}catch(b){d({},i.InvalidRegExp)}try{a=new RegExp(l,r)}catch(E){a=null}mn();if(p.tokenize){return{type:u.RegularExpression,value:a,regex:{pattern:l,flags:r},lineNumber:h,lineStart:g,range:[v,e]}}return{literal:t,value:a,regex:{pattern:l,flags:r},range:[v,e]}}function On(e){return e.type===u.Identifier||e.type===u.Keyword||e.type===u.BooleanLiteral||e.type===u.NullLiteral}function gr(){var n,e;n=p.tokens[p.tokens.length-1];if(!n){return N()}if(n.type==="Punctuator"){if(n.value===")"){e=p.tokens[p.openParenToken-1];if(e&&e.type==="Keyword"&&(e.value==="if"||e.value==="while"||e.value==="for"||e.value==="with")){return N()}return V()}if(n.value==="}"){if(p.tokens[p.openCurlyToken-3]&&p.tokens[p.openCurlyToken-3].type==="Keyword"){e=p.tokens[p.openCurlyToken-4];if(!e){return V()}}else if(p.tokens[p.openCurlyToken-4]&&p.tokens[p.openCurlyToken-4].type==="Keyword"){e=p.tokens[p.openCurlyToken-5];if(!e){return N()}}else{return V()}if(Gn.indexOf(e.value)>=0){return V()}return N()}return N()}if(n.type==="Keyword"){return N()}return V()}function nn(){var n;if(!a.inXJSChild){O()}if(e>=y){return{type:u.EOF,lineNumber:h,lineStart:g,range:[e,e]}}if(a.inXJSChild){return Ar()}n=s.charCodeAt(e);if(n===40||n===41||n===58){return V()}if(n===39||n===34){if(a.inXJSTag){return Cr()}return St()}if(a.inXJSTag&&_r(n)){return kr()}if(n===96){return rt()}if(q(n)){return pr()}if(n===46){if(D(s.charCodeAt(e+1))){return Zn()}return V()}if(D(n)){return Zn()}if(p.tokenize&&n===47){return gr()}return V()}function m(){var n;n=c;e=n.range[1];h=n.lineNumber;g=n.lineStart;c=nn();e=n.range[1];h=n.lineNumber;g=n.lineStart;return n}function mn(){var n,t,r;n=e;t=h;r=g;c=nn();e=n;h=t;g=r}function P(){var n,t,r,l,a;n=typeof p.advance==="function"?p.advance:nn;t=e;r=h;l=g;if(c===null){c=n()}e=c.range[1];h=c.lineNumber;g=c.lineStart;a=n();e=t;h=r;g=l;return a}function fn(n){e=n.range[0];h=n.lineNumber;g=n.lineStart;c=n}function f(){if(!p.loc&&!p.range){return undefined}O();return{offset:e,line:h,col:e-g}}function Xn(){if(!p.loc&&!p.range){return undefined}return{offset:e,line:h,col:e-g}}function er(e){var t,r,a=p.bottomRightStack,n=a[a.length-1];if(e.type===l.Program){if(e.body.length>0){return}}if(p.trailingComments.length>0){if(p.trailingComments[0].range[0]>=e.range[1]){r=p.trailingComments;p.trailingComments=[]}else{p.trailingComments.length=0}}else{if(n&&n.trailingComments&&n.trailingComments[0].range[0]>=e.range[1]){r=n.trailingComments;delete n.trailingComments}}if(n){while(n&&n.range[0]>=e.range[0]){t=n;n=a.pop()}}if(t){if(t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]){e.leadingComments=t.leadingComments;delete t.leadingComments}}else if(p.leadingComments.length>0&&p.leadingComments[p.leadingComments.length-1].range[1]<=e.range[0]){e.leadingComments=p.leadingComments;p.leadingComments=[]}if(r){e.trailingComments=r}a.push(e)}function n(r,n){if(p.range){n.range=[r.offset,e]}if(p.loc){n.loc={start:{line:r.line,column:r.col},end:{line:h,column:e-g}};n=t.postProcess(n)}if(p.attachComment){er(n)}return n}Fn={name:"SyntaxTree",postProcess:function(e){return e},createArrayExpression:function(e){return{type:l.ArrayExpression,elements:e}},createAssignmentExpression:function(e,n,t){return{type:l.AssignmentExpression,operator:e,left:n,right:t}},createBinaryExpression:function(e,n,t){var r=e==="||"||e==="&&"?l.LogicalExpression:l.BinaryExpression;return{type:r,operator:e,left:n,right:t}},createBlockStatement:function(e){return{type:l.BlockStatement,body:e}},createBreakStatement:function(e){return{type:l.BreakStatement,label:e}},createCallExpression:function(e,n){return{type:l.CallExpression,callee:e,arguments:n}},createCatchClause:function(e,n){return{type:l.CatchClause,param:e,body:n}},createConditionalExpression:function(e,n,t){return{type:l.ConditionalExpression,test:e,consequent:n,alternate:t}},createContinueStatement:function(e){return{type:l.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:l.DebuggerStatement}},createDoWhileStatement:function(e,n){return{type:l.DoWhileStatement,body:e,test:n}},createEmptyStatement:function(){return{type:l.EmptyStatement}},createExpressionStatement:function(e){return{type:l.ExpressionStatement,expression:e}},createForStatement:function(e,n,t,r){return{type:l.ForStatement,init:e,test:n,update:t,body:r}},createForInStatement:function(e,n,t){return{type:l.ForInStatement,left:e,right:n,body:t,each:false}},createForOfStatement:function(e,n,t){return{type:l.ForOfStatement,left:e,right:n,body:t}},createFunctionDeclaration:function(n,i,t,r,a,f,s,o,u,c){var e={type:l.FunctionDeclaration,id:n,params:i,defaults:t,body:r,rest:a,generator:f,expression:s,returnType:u,typeParameters:c};if(o){e.async=true}return e},createFunctionExpression:function(n,i,t,r,a,f,s,o,u,c){var e={type:l.FunctionExpression,id:n,params:i,defaults:t,body:r,rest:a,generator:f,expression:s,returnType:u,typeParameters:c};if(o){e.async=true}return e},createIdentifier:function(e){return{type:l.Identifier,name:e,typeAnnotation:undefined,optional:undefined}},createTypeAnnotation:function(e){return{type:l.TypeAnnotation,typeAnnotation:e}},createFunctionTypeAnnotation:function(e,n,t,r){return{type:l.FunctionTypeAnnotation,params:e,returnType:n,rest:t,typeParameters:r}},createFunctionTypeParam:function(e,n,t){return{type:l.FunctionTypeParam,name:e,typeAnnotation:n,optional:t}},createNullableTypeAnnotation:function(e){return{type:l.NullableTypeAnnotation,typeAnnotation:e}},createArrayTypeAnnotation:function(e){return{type:l.ArrayTypeAnnotation,elementType:e}},createGenericTypeAnnotation:function(e,n){return{type:l.GenericTypeAnnotation,id:e,typeParameters:n}},createQualifiedTypeIdentifier:function(e,n){return{type:l.QualifiedTypeIdentifier,qualification:e,id:n}},createTypeParameterDeclaration:function(e){return{type:l.TypeParameterDeclaration,params:e}},createTypeParameterInstantiation:function(e){return{type:l.TypeParameterInstantiation,params:e}},createAnyTypeAnnotation:function(){return{type:l.AnyTypeAnnotation}},createBooleanTypeAnnotation:function(){return{type:l.BooleanTypeAnnotation}},createNumberTypeAnnotation:function(){return{type:l.NumberTypeAnnotation}},createStringTypeAnnotation:function(){return{type:l.StringTypeAnnotation}},createStringLiteralTypeAnnotation:function(e){return{type:l.StringLiteralTypeAnnotation,value:e.value,raw:s.slice(e.range[0],e.range[1])}},createVoidTypeAnnotation:function(){return{type:l.VoidTypeAnnotation}},createTypeofTypeAnnotation:function(e){return{type:l.TypeofTypeAnnotation,argument:e}},createTupleTypeAnnotation:function(e){return{type:l.TupleTypeAnnotation,types:e}},createObjectTypeAnnotation:function(e,n,t){return{type:l.ObjectTypeAnnotation,properties:e,indexers:n,callProperties:t}},createObjectTypeIndexer:function(e,n,t,r){return{type:l.ObjectTypeIndexer,id:e,key:n,value:t,"static":r}},createObjectTypeCallProperty:function(e,n){return{type:l.ObjectTypeCallProperty,value:e,"static":n}},createObjectTypeProperty:function(e,n,t,r){return{type:l.ObjectTypeProperty,key:e,value:n,optional:t,"static":r}},createUnionTypeAnnotation:function(e){return{type:l.UnionTypeAnnotation,types:e}},createIntersectionTypeAnnotation:function(e){return{type:l.IntersectionTypeAnnotation,types:e}},createTypeAlias:function(e,n,t){return{type:l.TypeAlias,id:e,typeParameters:n,right:t}},createInterface:function(e,n,t,r){return{type:l.InterfaceDeclaration,id:e,typeParameters:n,body:t,"extends":r}},createInterfaceExtends:function(e,n){return{type:l.InterfaceExtends,id:e,typeParameters:n}},createDeclareFunction:function(e){return{type:l.DeclareFunction,id:e}},createDeclareVariable:function(e){return{type:l.DeclareVariable,id:e}},createDeclareModule:function(e,n){return{type:l.DeclareModule,id:e,body:n}},createXJSAttribute:function(e,n){return{type:l.XJSAttribute,name:e,value:n||null}},createXJSSpreadAttribute:function(e){return{type:l.XJSSpreadAttribute,argument:e}},createXJSIdentifier:function(e){return{type:l.XJSIdentifier,name:e}},createXJSNamespacedName:function(e,n){return{type:l.XJSNamespacedName,namespace:e,name:n}},createXJSMemberExpression:function(e,n){return{type:l.XJSMemberExpression,object:e,property:n}},createXJSElement:function(e,n,t){return{type:l.XJSElement,openingElement:e,closingElement:n,children:t}},createXJSEmptyExpression:function(){return{type:l.XJSEmptyExpression}},createXJSExpressionContainer:function(e){return{type:l.XJSExpressionContainer,expression:e}},createXJSOpeningElement:function(e,n,t){return{type:l.XJSOpeningElement,name:e,selfClosing:t,attributes:n}},createXJSClosingElement:function(e){return{type:l.XJSClosingElement,name:e}},createIfStatement:function(e,n,t){return{type:l.IfStatement,test:e,consequent:n,alternate:t}},createLabeledStatement:function(e,n){return{type:l.LabeledStatement,label:e,body:n}},createLiteral:function(e){var n={type:l.Literal,value:e.value,raw:s.slice(e.range[0],e.range[1])};if(e.regex){n.regex=e.regex}return n},createMemberExpression:function(e,n,t){return{type:l.MemberExpression,computed:e==="[",object:n,property:t}},createNewExpression:function(e,n){return{type:l.NewExpression,callee:e,arguments:n}},createObjectExpression:function(e){return{type:l.ObjectExpression,properties:e}},createPostfixExpression:function(e,n){return{type:l.UpdateExpression,operator:e,argument:n,prefix:false}},createProgram:function(e){return{type:l.Program,body:e}},createProperty:function(e,n,t,r,a,i){return{type:l.Property,key:n,value:t,kind:e,method:r,shorthand:a,computed:i}},createReturnStatement:function(e){return{type:l.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:l.SequenceExpression,expressions:e}},createSwitchCase:function(e,n){return{type:l.SwitchCase,test:e,consequent:n}},createSwitchStatement:function(e,n){return{type:l.SwitchStatement,discriminant:e,cases:n}},createThisExpression:function(){return{type:l.ThisExpression}},createThrowStatement:function(e){return{type:l.ThrowStatement,argument:e}},createTryStatement:function(e,n,t,r){return{type:l.TryStatement,block:e,guardedHandlers:n,handlers:t,finalizer:r}},createUnaryExpression:function(e,n){if(e==="++"||e==="--"){return{type:l.UpdateExpression,operator:e,argument:n,prefix:true}}return{type:l.UnaryExpression,operator:e,argument:n,prefix:true}},createVariableDeclaration:function(e,n){return{type:l.VariableDeclaration,declarations:e,kind:n}},createVariableDeclarator:function(e,n){return{type:l.VariableDeclarator,id:e,init:n}},createWhileStatement:function(e,n){return{type:l.WhileStatement,test:e,body:n}},createWithStatement:function(e,n){return{type:l.WithStatement,object:e,body:n}},createTemplateElement:function(e,n){return{type:l.TemplateElement,value:e,tail:n}},createTemplateLiteral:function(e,n){return{type:l.TemplateLiteral,quasis:e,expressions:n}},createSpreadElement:function(e){return{type:l.SpreadElement,argument:e}},createSpreadProperty:function(e){return{type:l.SpreadProperty,argument:e}},createTaggedTemplateExpression:function(e,n){return{type:l.TaggedTemplateExpression,tag:e,quasi:n}},createArrowFunctionExpression:function(n,t,r,a,i,s){var e={type:l.ArrowFunctionExpression,id:null,params:n,defaults:t,body:r,rest:a,generator:false,expression:i};if(s){e.async=true}return e},createMethodDefinition:function(e,n,t,r){return{type:l.MethodDefinition,key:t,value:r,kind:n,"static":e===$.static}},createClassProperty:function(e,n,t,r){return{type:l.ClassProperty,key:e,typeAnnotation:n,computed:t,"static":r}},createClassBody:function(e){return{type:l.ClassBody,body:e}},createClassImplements:function(e,n){return{type:l.ClassImplements,id:e,typeParameters:n}},createClassExpression:function(e,n,t,r,a,i){return{type:l.ClassExpression,id:e,superClass:n,body:t,typeParameters:r,superTypeParameters:a,"implements":i}},createClassDeclaration:function(e,n,t,r,a,i){return{type:l.ClassDeclaration,id:e,superClass:n,body:t,typeParameters:r,superTypeParameters:a,"implements":i}},createModuleSpecifier:function(e){return{type:l.ModuleSpecifier,value:e.value,raw:s.slice(e.range[0],e.range[1])}},createExportSpecifier:function(e,n){return{type:l.ExportSpecifier,id:e,name:n}},createExportBatchSpecifier:function(){return{type:l.ExportBatchSpecifier}},createImportDefaultSpecifier:function(e){return{type:l.ImportDefaultSpecifier,id:e}},createImportNamespaceSpecifier:function(e){return{type:l.ImportNamespaceSpecifier,id:e}},createExportDeclaration:function(e,n,t,r){return{type:l.ExportDeclaration,"default":!!e,declaration:n,specifiers:t,source:r}},createImportSpecifier:function(e,n){return{type:l.ImportSpecifier,id:e,name:n}},createImportDeclaration:function(e,n){return{type:l.ImportDeclaration,specifiers:e,source:n}},createYieldExpression:function(e,n){return{type:l.YieldExpression,argument:e,delegate:n}},createAwaitExpression:function(e){return{type:l.AwaitExpression,argument:e}},createComprehensionExpression:function(e,n,t){return{type:l.ComprehensionExpression,filter:e,blocks:n,body:t}}};function K(){var t,n,r,l;t=e;n=h;r=g;O();l=h!==n;e=t;h=n;g=r;return l}function d(t,a){var n,l=Array.prototype.slice.call(arguments,2),r=a.replace(/%(\d)/g,function(n,e){G(e<l.length,"Message reference must be in range");return l[e]});if(typeof t.lineNumber==="number"){n=new Error("Line "+t.lineNumber+": "+r);n.index=t.range[0];n.lineNumber=t.lineNumber;n.column=t.range[0]-g+1}else{n=new Error("Line "+h+": "+r);n.index=e;n.lineNumber=h;n.column=e-g+1}n.description=r;throw n}function E(){try{d.apply(null,arguments)}catch(e){if(p.errors){p.errors.push(e)}else{throw e}}}function I(e){if(e.type===u.EOF){d(e,i.UnexpectedEOS)}if(e.type===u.NumericLiteral){d(e,i.UnexpectedNumber)}if(e.type===u.StringLiteral||e.type===u.XJSText){d(e,i.UnexpectedString)}if(e.type===u.Identifier){d(e,i.UnexpectedIdentifier)}if(e.type===u.Keyword){if(Lr(e.value)){d(e,i.UnexpectedReserved)}else if(v&&un(e.value)){E(e,i.StrictReservedWord);return}d(e,i.UnexpectedToken,e.value)}if(e.type===u.Template){d(e,i.UnexpectedTemplate,e.value.raw)}d(e,i.UnexpectedToken,e.value)}function o(n){var e=m();if(e.type!==u.Punctuator||e.value!==n){I(e)}}function b(n,t){var e=m();if(e.type!==(t?u.Identifier:u.Keyword)||e.value!==n){I(e)}}function X(e){return b(e,true)}function r(e){return c.type===u.Punctuator&&c.value===e}function x(e,n){var t=n?u.Identifier:u.Keyword;return c.type===t&&c.value===e}function _(e){return x(e,true)}function tr(){var e;if(c.type!==u.Punctuator){return false}e=c.value;return e==="="||e==="*="||e==="/="||e==="%="||e==="+="||e==="-="||e==="<<="||e===">>="||e===">>>="||e==="&="||e==="^="||e==="|="}function lr(){return a.yieldAllowed&&x("yield",!v)}function ln(){var n=c,e=false;if(_("async")){m();e=!K();fn(n)}return e}function ir(){return a.awaitAllowed&&_("await")}function S(){var n,t=e,l=h,a=g,i=c;if(s.charCodeAt(e)===59){m();return}n=h;O();if(h!==n){e=t;h=l;g=a;c=i;return}if(r(";")){m();return}if(c.type!==u.EOF&&!r("}")){I(c)}}function vn(e){return e.type===l.Identifier||e.type===l.MemberExpression}function Tr(e){return vn(e)||e.type===l.ObjectPattern||e.type===l.ArrayPattern}function xn(){var a=[],s=[],h=null,e,p=true,y,g=f();o("[");while(!r("]")){if(c.value==="for"&&c.type===u.Keyword){if(!p){d({},i.ComprehensionError)}x("for");e=$n({ignoreBody:true});e.of=e.type===l.ForOfStatement;e.type=l.ComprehensionBlock;if(e.left.kind){d({},i.ComprehensionError)}s.push(e)}else if(c.value==="if"&&c.type===u.Keyword){if(!p){d({},i.ComprehensionError)}b("if");o("(");h=w();o(")")}else if(c.value===","&&c.type===u.Punctuator){p=false;m();a.push(null)}else{e=Ln();a.push(e);if(e&&e.type===l.SpreadElement){if(!r("]")){d({},i.ElementAfterSpreadElement)}}else if(!(r("]")||x("for")||x("if"))){o(",");p=false}}}o("]");if(h&&!s.length){d({},i.ComprehensionRequiresBlock)}if(s.length){if(a.length!==1){d({},i.ComprehensionError)}return n(g,t.createComprehensionExpression(h,s,a[0]))}return n(g,t.createArrayExpression(a))}function rn(e){var o,u,c,r,p,s,d=f();o=v;u=a.yieldAllowed;a.yieldAllowed=e.generator;c=a.awaitAllowed;a.awaitAllowed=e.async;r=e.params||[];p=e.defaults||[];s=Qn();if(e.name&&v&&L(r[0].name)){E(e.name,i.StrictParamName)}v=o;a.yieldAllowed=u;a.awaitAllowed=c;return n(d,t.createFunctionExpression(null,r,p,s,e.rest||null,e.generator,s.type!==l.BlockStatement,e.async,e.returnType,e.typeParameters))}function en(n){var t,e,r;t=v;v=true;e=hn();if(e.stricted){E(e.stricted,e.message)}r=rn({params:e.params,defaults:e.defaults,rest:e.rest,generator:n.generator,async:n.async,returnType:e.returnType,typeParameters:n.typeParameters});v=t;return r}function j(){var r=f(),e=m(),l,a;if(e.type===u.StringLiteral||e.type===u.NumericLiteral){if(v&&e.octal){E(e,i.StrictOctalLiteral)}return n(r,t.createLiteral(e))}if(e.type===u.Punctuator&&e.value==="["){r=f();l=R();a=n(r,l);o("]");return a}return n(r,t.createIdentifier(e.value))}function el(){var l,a,s,h,d,g,e,i=f(),p;l=c;e=l.value==="[";if(l.type===u.Identifier||e||ln()){s=j();if(r(":")){m();return n(i,t.createProperty("init",s,R(),false,false,e))}if(r("(")){return n(i,t.createProperty("init",s,en({generator:false,async:false}),true,false,e))}if(l.value==="get"){e=c.value==="[";a=j();o("(");o(")");if(r(":")){p=M()}return n(i,t.createProperty("get",a,rn({generator:false,async:false,returnType:p}),false,false,e))}if(l.value==="set"){e=c.value==="[";a=j();o("(");l=c;d=[tn()];o(")");if(r(":")){p=M()}return n(i,t.createProperty("set",a,rn({params:d,generator:false,async:false,name:l,returnType:p}),false,false,e))}if(l.value==="async"){e=c.value==="[";a=j();return n(i,t.createProperty("init",a,en({generator:false,async:true}),true,false,e))}if(e){I(c)}return n(i,t.createProperty("init",s,s,false,true,false))}if(l.type===u.EOF||l.type===u.Punctuator){if(!r("*")){I(l)}m();e=c.type===u.Punctuator&&c.value==="[";s=j();if(!r("(")){I(m())}return n(i,t.createProperty("init",s,en({generator:true}),true,false,e))}a=j();if(r(":")){m();return n(i,t.createProperty("init",a,R(),false,false,false))}if(r("(")){return n(i,t.createProperty("init",a,en({generator:false}),true,false,false))}I(m())}function nl(){var e=f();o("...");return n(e,t.createSpreadProperty(R()))}function dn(){var p=[],e,c,s,a,u={},d=String,m=f();o("{");while(!r("}")){if(r("...")){e=nl()}else{e=el();if(e.key.type===l.Identifier){c=e.key.name}else{c=d(e.key.value)}a=e.kind==="init"?J.Data:e.kind==="get"?J.Get:J.Set;s="$"+c;if(Object.prototype.hasOwnProperty.call(u,s)){if(u[s]===J.Data){if(v&&a===J.Data){E({},i.StrictDuplicateProperty)}else if(a!==J.Data){E({},i.AccessorDataProperty)}}else{if(a===J.Data){E({},i.AccessorDataProperty)}else if(u[s]&a){E({},i.AccessorGetSet)}}u[s]|=a}else{u[s]=a}}p.push(e);if(!r("}")){o(",")}}o("}");return n(m,t.createObjectExpression(p))}function _t(r){var l=f(),e=Xt(r);if(v&&e.octal){d(e,i.StrictOctalLiteral)}return n(l,t.createTemplateElement({raw:e.value.raw,cooked:e.value.cooked},e.tail))}function Sn(){var e,r,l,a=f();e=_t({head:true});r=[e];l=[];while(!e.tail){l.push(w());e=_t({head:false});r.push(e)}return n(a,t.createTemplateLiteral(r,l))}function Zt(){var e;o("(");++a.parenthesizedCount;e=w();o(")");return e}function et(){var e;if(ln()){e=P();if(e.type===u.Keyword&&e.value==="function"){return true}}return false}function nt(){var e,l,a,s;l=c.type;if(l===u.Identifier){e=f();return n(e,t.createIdentifier(m().value))}if(l===u.StringLiteral||l===u.NumericLiteral){if(v&&c.octal){E(c,i.StrictOctalLiteral)}e=f();return n(e,t.createLiteral(m()))}if(l===u.Keyword){if(x("this")){e=f();m();return n(e,t.createThisExpression())}if(x("function")){return Mn()}if(x("class")){return it()}if(x("super")){e=f();m();return n(e,t.createIdentifier("super"))}}if(l===u.BooleanLiteral){e=f();a=m();a.value=a.value==="true";return n(e,t.createLiteral(a))}if(l===u.NullLiteral){e=f();a=m();a.value=null;return n(e,t.createLiteral(a))}if(r("[")){return xn()}if(r("{")){return dn()}if(r("(")){return Zt()}if(r("/")||r("/=")){e=f();return n(e,t.createLiteral(N()))
}if(l===u.Template){return Sn()}if(r("<")){return Bn()}I(m())}function tt(){var t=[],n;o("(");if(!r(")")){while(e<y){n=Ln();t.push(n);if(r(")")){break}else if(n.type===l.SpreadElement){d({},i.ElementAfterSpreadElement)}o(",")}}o(")");return t}function Ln(){if(r("...")){var e=f();m();return n(e,t.createSpreadElement(R()))}return R()}function W(){var r=f(),e=m();if(!On(e)){I(e)}return n(r,t.createIdentifier(e.value))}function ut(){o(".");return W()}function gt(){var e;o("[");e=w();o("]");return e}function Un(){var e,l,a=f();b("new");e=jr();l=r("(")?tt():[];return n(a,t.createNewExpression(e,l))}function An(){var e,a,l=f();e=x("new")?Un():nt();while(r(".")||r("[")||r("(")||c.type===u.Template){if(r("(")){a=tt();e=n(l,t.createCallExpression(e,a))}else if(r("[")){e=n(l,t.createMemberExpression("[",e,gt()))}else if(r(".")){e=n(l,t.createMemberExpression(".",e,ut()))}else{e=n(l,t.createTaggedTemplateExpression(e,Sn()))}}return e}function jr(){var e,l=f();e=x("new")?Un():nt();while(r(".")||r("[")||c.type===u.Template){if(r("[")){e=n(l,t.createMemberExpression("[",e,gt()))}else if(r(".")){e=n(l,t.createMemberExpression(".",e,ut()))}else{e=n(l,t.createTaggedTemplateExpression(e,Sn()))}}return e}function Jn(){var s=f(),e=An(),a;if(c.type!==u.Punctuator){return e}if((r("++")||r("--"))&&!K()){if(v&&e.type===l.Identifier&&L(e.name)){E({},i.StrictLHSPostfix)}if(!vn(e)){d({},i.InvalidLHSInAssignment)}a=m();e=n(s,t.createPostfixExpression(a.value,e))}return e}function Z(){var a,s,e;if(c.type!==u.Punctuator&&c.type!==u.Keyword){return Jn()}if(r("++")||r("--")){a=f();s=m();e=Z();if(v&&e.type===l.Identifier&&L(e.name)){E({},i.StrictLHSPrefix)}if(!vn(e)){d({},i.InvalidLHSInAssignment)}return n(a,t.createUnaryExpression(s.value,e))}if(r("+")||r("-")||r("~")||r("!")){a=f();s=m();e=Z();return n(a,t.createUnaryExpression(s.value,e))}if(x("delete")||x("void")||x("typeof")){a=f();s=m();e=Z();e=n(a,t.createUnaryExpression(s.value,e));if(v&&e.operator==="delete"&&e.argument.type===l.Identifier){E({},i.StrictDelete)}return e}return Jn()}function Wn(n,t){var e=0;if(n.type!==u.Punctuator&&n.type!==u.Keyword){return 0}switch(n.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":e=7;break;case"in":e=t?7:0;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break;default:break}return e}function $r(){var r,i,u,d,e,h,g,p,o,l,s;d=a.allowIn;a.allowIn=true;l=f();p=Z();i=c;u=Wn(i,d);if(u===0){return p}i.prec=u;m();s=[l,f()];h=Z();e=[p,i,h];while((u=Wn(c,d))>0){while(e.length>2&&u<=e[e.length-2].prec){h=e.pop();g=e.pop().value;p=e.pop();r=t.createBinaryExpression(g,p,h);s.pop();l=s.pop();n(l,r);e.push(r);s.push(l)}i=m();i.prec=u;e.push(i);s.push(f());r=Z();e.push(r)}a.allowIn=d;o=e.length-1;r=e[o];s.pop();while(o>1){r=t.createBinaryExpression(e[o-1].value,e[o-2],r);o-=2;l=s.pop();n(l,r)}return r}function Hn(){var e,l,i,s,u=f();e=$r();if(r("?")){m();l=a.allowIn;a.allowIn=true;i=R();a.allowIn=l;o(":");s=R();e=n(u,t.createConditionalExpression(e,i,s))}return e}function z(e){var n,t,r,a;if(e.type===l.ObjectExpression){e.type=l.ObjectPattern;for(n=0,t=e.properties.length;n<t;n+=1){r=e.properties[n];if(r.type===l.SpreadProperty){if(n<t-1){d({},i.PropertyAfterSpreadProperty)}z(r.argument)}else{if(r.kind!=="init"){d({},i.InvalidLHSInAssignment)}z(r.value)}}}else if(e.type===l.ArrayExpression){e.type=l.ArrayPattern;for(n=0,t=e.elements.length;n<t;n+=1){a=e.elements[n];if(a){z(a)}}}else if(e.type===l.Identifier){if(L(e.name)){d({},i.InvalidLHSInAssignment)}}else if(e.type===l.SpreadElement){z(e.argument);if(e.argument.type===l.ObjectPattern){d({},i.ObjectPatternAsSpread)}}else{if(e.type!==l.MemberExpression&&e.type!==l.CallExpression&&e.type!==l.NewExpression){d({},i.InvalidLHSInAssignment)}}}function Y(a,e){var n,t,r,s;if(e.type===l.ObjectExpression){e.type=l.ObjectPattern;for(n=0,t=e.properties.length;n<t;n+=1){r=e.properties[n];if(r.type===l.SpreadProperty){if(n<t-1){d({},i.PropertyAfterSpreadProperty)}Y(a,r.argument)}else{if(r.kind!=="init"){d({},i.InvalidLHSInFormalsList)}Y(a,r.value)}}}else if(e.type===l.ArrayExpression){e.type=l.ArrayPattern;for(n=0,t=e.elements.length;n<t;n+=1){s=e.elements[n];if(s){Y(a,s)}}}else if(e.type===l.Identifier){yn(a,e,e.name)}else{if(e.type!==l.MemberExpression){d({},i.InvalidLHSInFormalsList)}}}function Cn(c){var r,s,e,a,t,o,n,u;a=[];t=[];o=0;u=null;n={paramSet:{}};for(r=0,s=c.length;r<s;r+=1){e=c[r];if(e.type===l.Identifier){a.push(e);t.push(null);yn(n,e,e.name)}else if(e.type===l.ObjectExpression||e.type===l.ArrayExpression){Y(n,e);a.push(e);t.push(null)}else if(e.type===l.SpreadElement){G(r===s-1,"It is guaranteed that SpreadElement is last element by parseExpression");Y(n,e.argument);u=e.argument}else if(e.type===l.AssignmentExpression){a.push(e.left);t.push(e.right);++o;yn(n,e.left,e.left.name)}else{return null}}if(n.message===i.StrictParamDupe){d(v?n.stricted:n.firstRestricted,n.message)}if(o===0){t=[]}return{params:a,defaults:t,rest:u,stricted:n.stricted,firstRestricted:n.firstRestricted,message:n.message}}function In(e,c){var i,s,u,r;o("=>");i=v;s=a.yieldAllowed;a.yieldAllowed=false;u=a.awaitAllowed;a.awaitAllowed=!!e.async;r=Qn();if(v&&e.firstRestricted){d(e.firstRestricted,e.message)}if(v&&e.stricted){E(e.stricted,e.message)}v=i;a.yieldAllowed=s;a.awaitAllowed=u;return n(c,t.createArrowFunctionExpression(e.params,e.defaults,r,e.rest,r.type!==l.BlockStatement,!!e.async))}function R(){var h,e,o,s,g,y=c,p=false;if(lr()){return sr()}if(ir()){return or()}g=a.parenthesizedCount;h=f();if(et()){return Mn()}if(ln()){p=true;m()}if(r("(")){o=P();if(o.type===u.Punctuator&&o.value===")"||o.value==="..."){s=hn();if(!r("=>")){I(m())}s.async=p;return In(s,h)}}o=c;if(p&&!r("(")&&o.type!==u.Identifier){p=false;fn(y)}e=Hn();if(r("=>")&&(a.parenthesizedCount===g||a.parenthesizedCount===g+1)){if(e.type===l.Identifier){s=Cn([e])}else if(e.type===l.SequenceExpression){s=Cn(e.expressions)}if(s){s.async=p;return In(s,h)}}if(p){p=false;fn(y);e=Hn()}if(tr()){if(v&&e.type===l.Identifier&&L(e.name)){E(o,i.StrictLHSAssignment)}if(r("=")&&(e.type===l.ObjectExpression||e.type===l.ArrayExpression)){z(e)}else if(!vn(e)){d({},i.InvalidLHSInAssignment)}e=n(h,t.createAssignmentExpression(m().value,e,R()))}return e}function w(){var u,s,o,h,c,g,p;p=a.parenthesizedCount;u=f();s=R();o=[s];if(r(",")){while(e<y){if(!r(",")){break}m();s=Ln();o.push(s);if(s.type===l.SpreadElement){g=true;if(!r(")")){d({},i.ElementAfterSpreadElement)}break}}h=n(u,t.createSequenceExpression(o))}if(r("=>")){if(a.parenthesizedCount===p||a.parenthesizedCount===p+1){s=s.type===l.SequenceExpression?s.expressions:o;c=Cn(s);if(c){return In(c,u)}}I(m())}if(g&&P().value!=="=>"){d({},i.IllegalSpread)}return h||s}function nr(){var t=[],n;while(e<y){if(r("}")){break}n=H();if(typeof n==="undefined"){break}t.push(n)}return t}function gn(){var e,r=f();o("{");e=nr();o("}");return n(r,t.createBlockStatement(e))}function F(){var l=f(),e=[];o("<");while(!r(">")){e.push(k());if(!r(">")){o(",")}}o(">");return n(l,t.createTypeParameterDeclaration(e))}function sn(){var l=f(),i=a.inType,e=[];a.inType=true;o("<");while(!r(">")){e.push(A());if(!r(">")){o(",")}}o(">");a.inType=i;return n(l,t.createTypeParameterInstantiation(e))}function al(a,i){var e,r,l;o("[");e=j();o(":");r=A();o("]");o(":");l=A();return n(a,t.createObjectTypeIndexer(e,r,l,i))}function ct(s){var e=[],l=null,a,i=null;if(r("<")){i=F()}o("(");while(c.type===u.Identifier){e.push(bn());if(!r(")")){o(",")}}if(r("...")){m();l=bn()}o(")");o(":");a=A();return n(s,t.createFunctionTypeAnnotation(e,a,l,i))}function dr(e,l,a){var i=false,r;r=ct(e);return n(e,t.createObjectTypeProperty(a,r,i,l))}function mr(e,r){var l=f();return n(e,t.createObjectTypeCallProperty(ct(l),r))}function pt(y){var p=[],g=[],e,d=false,s=[],v,a,h,u,l;o("{");while(!r("}")){e=f();if(y&&_("static")){u=m();l=true}if(r("[")){g.push(al(e,l))}else if(r("(")||r("<")){p.push(mr(e,y))}else{if(l&&r(":")){a=n(e,t.createIdentifier(u));E(u,i.StrictReservedWord)}else{a=j()}if(r("<")||r("(")){s.push(dr(e,l,a))}else{if(r("?")){m();d=true}o(":");h=A();s.push(n(e,t.createObjectTypeProperty(a,h,d,l)))}}if(r(";")){m()}else if(!r("}")){I(c)}}o("}");return t.createObjectTypeAnnotation(s,g,p)}function yr(){var l=f(),i=null,a=null,e,s=f;e=k();while(r(".")){o(".");e=n(l,t.createQualifiedTypeIdentifier(e,k()))}if(r("<")){a=sn()}return n(l,t.createGenericTypeAnnotation(e,a))}function br(){var e=f();b("void");return n(e,t.createVoidTypeAnnotation())}function wr(){var e,r=f();b("typeof");e=Vn();return n(r,t.createTypeofTypeAnnotation(e))}function Rr(){var a=f(),l=[];o("[");while(e<y&&!r("]")){l.push(A());if(r("]")){break}o(",")}o("]");return n(a,t.createTupleTypeAnnotation(l))}function bn(){var i=f(),e,l=false,a;e=k();if(r("?")){m();l=true}o(":");a=A();return n(i,t.createFunctionTypeParam(e,a,l))}function Pn(){var e={params:[],rest:null};while(c.type===u.Identifier){e.params.push(bn());if(!r(")")){o(",")}}if(r("...")){m();e.rest=bn()}return e}function Vn(){var x=null,s=null,p=null,e=f(),h=null,a,y,l,v,g=false;switch(c.type){case u.Identifier:switch(c.value){case"any":m();return n(e,t.createAnyTypeAnnotation());case"bool":case"boolean":m();return n(e,t.createBooleanTypeAnnotation());case"number":m();return n(e,t.createNumberTypeAnnotation());case"string":m();return n(e,t.createStringTypeAnnotation())}return n(e,yr());case u.Punctuator:switch(c.value){case"{":return n(e,pt());case"[":return Rr();case"<":y=F();o("(");a=Pn();s=a.params;h=a.rest;o(")");o("=>");p=A();return n(e,t.createFunctionTypeAnnotation(s,p,h,y));case"(":m();if(!r(")")&&!r("...")){if(c.type===u.Identifier){l=P();g=l.value!=="?"&&l.value!==":"}else{g=true}}if(g){v=A();o(")");if(r("=>")){d({},i.ConfusedAboutFunctionType)}return v}a=Pn();s=a.params;h=a.rest;o(")");o("=>");p=A();return n(e,t.createFunctionTypeAnnotation(s,p,h,null))}break;case u.Keyword:switch(c.value){case"void":return n(e,br());case"typeof":return n(e,wr())}break;case u.StringLiteral:l=m();if(l.octal){d(l,i.StrictOctalLiteral)}return n(e,t.createStringLiteralTypeAnnotation(l))}I(c)}function Nr(){var l=f(),e=Vn();if(r("[")){o("[");o("]");return n(l,t.createArrayTypeAnnotation(e))}return e}function kn(){var e=f();if(r("?")){m();return n(e,t.createNullableTypeAnnotation(kn()))}return Nr()}function qn(){var a=f(),l,e;l=kn();e=[l];while(r("&")){m();e.push(kn())}return e.length===1?l:n(a,t.createIntersectionTypeAnnotation(e))}function zr(){var a=f(),l,e;l=qn();e=[l];while(r("|")){m();e.push(qn())}return e.length===1?l:n(a,t.createUnionTypeAnnotation(e))}function A(){var n=a.inType,e;a.inType=true;e=zr();a.inType=n;return e}function M(){var r=f(),e;o(":");e=A();return n(r,t.createTypeAnnotation(e))}function k(){var r=f(),e=m();if(e.type!==u.Identifier){I(e)}return n(r,t.createIdentifier(e.value))}function tn(a,i){var t=f(),e=k(),l=false;if(i&&r("?")){o("?");l=true}if(a||r(":")){e.typeAnnotation=M();e=n(t,e)}if(l){e.optional=true;e=n(t,e)}return e}function tl(u){var e,c=f(),l=null,s=f();if(r("{")){e=dn();z(e);if(r(":")){e.typeAnnotation=M();n(s,e)}}else if(r("[")){e=xn();z(e);if(r(":")){e.typeAnnotation=M();n(s,e)}}else{e=a.allowKeyword?W():tn();if(v&&L(e.name)){E({},i.StrictVarName)}}if(u==="const"){if(!r("=")){d({},i.NoUnintializedConst)}o("=");l=R()}else if(r("=")){m();l=R()}return n(c,t.createVariableDeclarator(e,l))}function Rn(t){var n=[];do{n.push(tl(t));if(!r(",")){break}m()}while(e<y);return n}function kt(){var e,r=f();b("var");e=Rn();S();return n(r,t.createVariableDeclaration(e,"var"))}function It(e){var r,l=f();b(e);r=Rn(e);S();return n(l,t.createVariableDeclaration(r,e))}function pn(){var r=f(),e;if(c.type!==u.StringLiteral){d({},i.InvalidModuleSpecifier)}e=t.createModuleSpecifier(c);m();return n(r,e)}function Ct(){var e=f();o("*");return n(e,t.createExportBatchSpecifier())}function At(){var e,r=null,l=f(),a;if(x("default")){m();e=n(l,t.createIdentifier("default"))}else{e=k()}if(_("as")){m();r=W()}return n(l,t.createExportSpecifier(e,r))}function Tt(){var p,g,y,l=null,h,s=null,a=[],e=f();b("export");if(x("default")){m();if(x("function")||x("class")){p=c;m();if(On(c)){g=W();fn(p);return n(e,t.createExportDeclaration(true,H(),[g],null))}fn(p);switch(c.value){case"class":return n(e,t.createExportDeclaration(true,it(),[],null));case"function":return n(e,t.createExportDeclaration(true,Mn(),[],null))}}if(_("from")){d({},i.UnexpectedToken,c.value)}if(r("{")){l=dn()}else if(r("[")){l=xn()}else{l=R()}S();return n(e,t.createExportDeclaration(true,l,[],null))}if(c.type===u.Keyword){switch(c.value){case"let":case"const":case"var":case"class":case"function":return n(e,t.createExportDeclaration(false,H(),a,null))}}if(r("*")){a.push(Ct());if(!_("from")){d({},c.value?i.UnexpectedToken:i.MissingFromClause,c.value)}m();s=pn();S();return n(e,t.createExportDeclaration(false,null,a,s))}o("{");do{h=h||x("default");a.push(At())}while(r(",")&&m());o("}");if(_("from")){m();s=pn();S()}else if(h){d({},c.value?i.UnexpectedToken:i.MissingFromClause,c.value)}else{S()}return n(e,t.createExportDeclaration(false,l,a,s))}function Lt(){var e,r=null,l=f();e=W();if(_("as")){m();r=k()}return n(l,t.createImportSpecifier(e,r))}function Pt(){var e=[];o("{");do{e.push(Lt())}while(r(",")&&m());o("}");return e}function jt(){var e,r=f();e=W();return n(r,t.createImportDefaultSpecifier(e))}function Mt(){var e,r=f();o("*");if(!_("as")){d({},i.NoAsAfterImportNamespace)}m();e=W();return n(r,t.createImportNamespaceSpecifier(e))}function Ot(){var e,l,a=f();b("import");e=[];if(c.type===u.StringLiteral){l=pn();S();return n(a,t.createImportDeclaration(e,l))}if(!x("default")&&On(c)){e.push(jt());if(r(",")){m()}}if(r("*")){e.push(Mt())}else if(r("{")){e=e.concat(Pt())}if(!_("from")){d({},c.value?i.UnexpectedToken:i.MissingFromClause,c.value)}m();l=pn();S();return n(a,t.createImportDeclaration(e,l))}function Dt(){var e=f();o(";");return n(e,t.createEmptyStatement())}function Nt(){var e=f(),r=w();S();return n(e,t.createExpressionStatement(r))}function Ft(){var r,l,e,a=f();b("if");o("(");r=w();o(")");l=B();if(x("else")){m();e=B()}else{e=null}return n(a,t.createIfStatement(r,l,e))}function Bt(){var e,l,i,s=f();b("do");i=a.inIteration;a.inIteration=true;e=B();a.inIteration=i;b("while");o("(");l=w();o(")");if(r(";")){m()}return n(s,t.createDoWhileStatement(e,l))}function Ut(){var e,r,l,i=f();b("while");o("(");e=w();o(")");l=a.inIteration;a.inIteration=true;r=B();a.inIteration=l;return n(i,t.createWhileStatement(e,r))}function Vt(){var e=f(),r=m(),l=Rn();return n(e,t.createVariableDeclaration(l,r.value))}function $n(v){var e,h,g,l,s,p,u,E,y=f();e=h=g=null;b("for");if(_("each")){d({},i.EachNotAllowed)}o("(");if(r(";")){m()}else{if(x("var")||x("let")||x("const")){a.allowIn=false;e=Vt();a.allowIn=true;if(e.declarations.length===1){if(x("in")||_("of")){u=c;if(!((u.value==="in"||e.kind!=="var")&&e.declarations[0].init)){m();l=e;s=w();e=null}}}}else{a.allowIn=false;e=w();a.allowIn=true;if(_("of")){u=m();l=e;s=w();e=null}else if(x("in")){if(!Tr(e)){d({},i.InvalidLHSInForIn)}u=m();l=e;s=w();e=null}}if(typeof l==="undefined"){o(";")}}if(typeof l==="undefined"){if(!r(";")){h=w()}o(";");if(!r(")")){g=w()}}o(")");E=a.inIteration;a.inIteration=true;if(!(v!==undefined&&v.ignoreBody)){p=B()}a.inIteration=E;if(typeof l==="undefined"){return n(y,t.createForStatement(e,h,g,p))}if(u.value==="in"){return n(y,t.createForInStatement(l,s,p))}return n(y,t.createForOfStatement(l,s,p))}function qt(){var r=null,o,l=f();b("continue");if(s.charCodeAt(e)===59){m();if(!a.inIteration){d({},i.IllegalContinue)}return n(l,t.createContinueStatement(null))}if(K()){if(!a.inIteration){d({},i.IllegalContinue)}return n(l,t.createContinueStatement(null))}if(c.type===u.Identifier){r=k();o="$"+r.name;if(!Object.prototype.hasOwnProperty.call(a.labelSet,o)){d({},i.UnknownLabel,r.name)}}S();if(r===null&&!a.inIteration){d({},i.IllegalContinue)}return n(l,t.createContinueStatement(r))}function Jt(){var r=null,o,l=f();b("break");if(s.charCodeAt(e)===59){m();if(!(a.inIteration||a.inSwitch)){d({},i.IllegalBreak)}return n(l,t.createBreakStatement(null))}if(K()){if(!(a.inIteration||a.inSwitch)){d({},i.IllegalBreak)}return n(l,t.createBreakStatement(null))}if(c.type===u.Identifier){r=k();o="$"+r.name;if(!Object.prototype.hasOwnProperty.call(a.labelSet,o)){d({},i.UnknownLabel,r.name)}}S();if(r===null&&!(a.inIteration||a.inSwitch)){d({},i.IllegalBreak)}return n(l,t.createBreakStatement(r))}function Gt(){var l=null,o=f();b("return");if(!a.inFunctionBody){E({},i.IllegalReturn)}if(s.charCodeAt(e)===32){if(q(s.charCodeAt(e+1))){l=w();S();return n(o,t.createReturnStatement(l))}}if(K()){return n(o,t.createReturnStatement(null))}if(!r(";")){if(!r("}")&&c.type!==u.EOF){l=w()}}S();return n(o,t.createReturnStatement(l))}function Wt(){var e,r,l=f();if(v){E({},i.StrictModeWith)}b("with");o("(");e=w();o(")");r=B();return n(l,t.createWithStatement(e,r))}function Ht(){var l,i=[],a,s=f();if(x("default")){m();l=null}else{b("case");l=w()}o(":");while(e<y){if(r("}")||x("default")||x("case")){break}a=H();if(typeof a==="undefined"){break}i.push(a)}return n(s,t.createSwitchCase(l,i))}function zt(){var s,l,u,p,c,h=f();b("switch");o("(");s=w();o(")");o("{");l=[];if(r("}")){m();return n(h,t.createSwitchStatement(s,l))}p=a.inSwitch;a.inSwitch=true;c=false;while(e<y){if(r("}")){break}u=Ht();if(u.test===null){if(c){d({},i.MultipleDefaultsInSwitch)}c=true}l.push(u)}a.inSwitch=p;o("}");return n(h,t.createSwitchStatement(s,l))}function Yt(){var e,r=f();b("throw");if(K()){d({},i.NewlineAfterThrow)}e=w();S();return n(r,t.createThrowStatement(e))}function $t(){var e,a,s=f();b("catch");o("(");if(r(")")){I(c)}e=w();if(v&&e.type===l.Identifier&&L(e.name)){E({},i.StrictCatchVariable)}o(")");a=gn();return n(s,t.createCatchClause(e,a))}function Kt(){var l,e=[],r=null,a=f();b("try");l=gn();if(x("catch")){e.push($t())}if(x("finally")){m();r=gn()}if(e.length===0&&!r){d({},i.NoCatchOrFinally)}return n(a,t.createTryStatement(l,[],e,r))}function Qt(){var e=f();b("debugger");S();return n(e,t.createDebuggerStatement())}function B(){var o=c.type,p,e,h,s;if(o===u.EOF){I(c)}if(o===u.Punctuator){switch(c.value){case";":return Dt();case"{":return gn();case"(":return Nt();default:break}}if(o===u.Keyword){switch(c.value){case"break":return Jt();case"continue":return qt();case"debugger":return Qt();case"do":return Bt();case"for":return $n();case"function":return jn();case"class":return hr();case"if":return Ft();case"return":return Gt();case"switch":return zt();case"throw":return Yt();case"try":return Kt();case"var":return kt();case"while":return Ut();case"with":return Wt();default:break}}if(et()){return jn()}p=f();e=w();if(e.type===l.Identifier&&r(":")){m();s="$"+e.name;if(Object.prototype.hasOwnProperty.call(a.labelSet,s)){d({},i.Redeclaration,"Label",e.name)}a.labelSet[s]=true;h=B();delete a.labelSet[s];return n(p,t.createLabeledStatement(e,h))}S();return n(p,t.createExpressionStatement(e))}function Qn(){if(r("{")){return Tn()}return R()}function Tn(){var p,h=[],d,x,m,g,b,w,_,S,k=f();o("{");while(e<y){if(c.type!==u.StringLiteral){break}d=c;p=H();h.push(p);if(p.expression.type!==l.Literal){break}x=s.slice(d.range[0]+1,d.range[1]-1);if(x==="use strict"){v=true;if(m){E(m,i.StrictOctalLiteral)}}else{if(!m&&d.octal){m=d}}}g=a.labelSet;b=a.inIteration;w=a.inSwitch;_=a.inFunctionBody;S=a.parenthesizedCount;a.labelSet={};a.inIteration=false;a.inSwitch=false;a.inFunctionBody=true;a.parenthesizedCount=0;while(e<y){if(r("}")){break}p=H();if(typeof p==="undefined"){break}h.push(p)}o("}");a.labelSet=g;a.inIteration=b;a.inSwitch=w;a.inFunctionBody=_;a.parenthesizedCount=S;return n(k,t.createBlockStatement(h))}function yn(e,n,t){var r="$"+t;if(v){if(L(t)){e.stricted=n;e.message=i.StrictParamName}if(Object.prototype.hasOwnProperty.call(e.paramSet,r)){e.stricted=n;e.message=i.StrictParamDupe}}else if(!e.firstRestricted){if(L(t)){e.firstRestricted=n;e.message=i.StrictParamName}else if(un(t)){e.firstRestricted=n;e.message=i.StrictReservedWord}else if(Object.prototype.hasOwnProperty.call(e.paramSet,r)){e.firstRestricted=n;e.message=i.StrictParamDupe}}e.paramSet[r]=true}function rr(t){var s,l,a,e,o;l=c;if(l.value==="..."){l=m();a=true}if(r("[")){s=f();e=xn();Y(t,e);if(r(":")){e.typeAnnotation=M();n(s,e)}}else if(r("{")){s=f();if(a){d({},i.ObjectPatternAsRestParameter)}e=dn();Y(t,e);if(r(":")){e.typeAnnotation=M();n(s,e)}}else{e=a?tn(false,false):tn(false,true);yn(t,l,l.value)}if(r("=")){if(a){E(c,i.DefaultRestParameter)}m();o=R();++t.defaultCount}if(a){if(!r(")")){d({},i.ParameterAfterRestParameter)}t.rest=e;return false}t.params.push(e);t.defaults.push(o);return!r(")")}function hn(l){var t,a=f();t={params:[],defaultCount:0,defaults:[],rest:null,firstRestricted:l};o("(");if(!r(")")){t.paramSet={};while(e<y){if(!rr(t)){break}o(",")}}o(")");if(t.defaultCount===0){t.defaults=[]}if(r(":")){t.returnType=M()}return n(a,t)}function jn(){var g,h,l,e,s,o,u,p,y,x,w,S=f(),_;p=false;if(ln()){m();p=true}b("function");u=false;if(r("*")){m();u=true}l=c;g=k();if(r("<")){_=F()}if(v){if(L(l.value)){E(l,i.StrictFunctionName)}}else{if(L(l.value)){s=l;o=i.StrictFunctionName}else if(un(l.value)){s=l;o=i.StrictReservedWord}}e=hn(s);s=e.firstRestricted;if(e.message){o=e.message}y=v;x=a.yieldAllowed;a.yieldAllowed=u;w=a.awaitAllowed;a.awaitAllowed=p;h=Tn();if(v&&s){d(s,o)}if(v&&e.stricted){E(e.stricted,o)}v=y;a.yieldAllowed=x;a.awaitAllowed=w;return n(S,t.createFunctionDeclaration(g,e.params,e.defaults,h,e.rest,u,false,p,e.returnType,_))}function Mn(){var l,h=null,s,o,e,g,u,p,y,x,w,S=f(),_;p=false;if(ln()){m();p=true}b("function");u=false;if(r("*")){m();u=true}if(!r("(")){if(!r("<")){l=c;h=k();if(v){if(L(l.value)){E(l,i.StrictFunctionName)}}else{if(L(l.value)){s=l;o=i.StrictFunctionName}else if(un(l.value)){s=l;o=i.StrictReservedWord}}}if(r("<")){_=F()}}e=hn(s);s=e.firstRestricted;if(e.message){o=e.message}y=v;x=a.yieldAllowed;a.yieldAllowed=u;w=a.awaitAllowed;a.awaitAllowed=p;g=Tn();if(v&&s){d(s,o)}if(v&&e.stricted){E(e.stricted,o)}v=y;a.yieldAllowed=x;a.awaitAllowed=w;return n(S,t.createFunctionExpression(h,e.params,e.defaults,g,e.rest,u,false,p,e.returnType,_))}function sr(){var e,l,a=f();b("yield",!v);e=false;if(r("*")){m();e=true}l=R();return n(a,t.createYieldExpression(l,e))}function or(){var e,r=f();X("await");e=R();return n(r,t.createAwaitExpression(e))}function ur(l,e,y,g,v){var p,m,n,a=false,f,h,u,s,x;n=y?$.static:$.prototype;if(g){return t.createMethodDefinition(n,"",e,en({generator:true}))}u=e.type==="Identifier"&&e.name;if(u==="get"&&!r("(")){e=j();if(l[n].hasOwnProperty(e.name)){a=l[n][e.name].get===undefined&&l[n][e.name].data===undefined&&l[n][e.name].set!==undefined;if(!a){d(e,i.IllegalDuplicateClassProperty)}}else{l[n][e.name]={}}l[n][e.name].get=true;o("(");o(")");if(r(":")){s=M()}return t.createMethodDefinition(n,"get",e,rn({generator:false,returnType:s}))}if(u==="set"&&!r("(")){e=j();if(l[n].hasOwnProperty(e.name)){a=l[n][e.name].set===undefined&&l[n][e.name].data===undefined&&l[n][e.name].get!==undefined;if(!a){d(e,i.IllegalDuplicateClassProperty)}}else{l[n][e.name]={}}l[n][e.name].set=true;o("(");p=c;m=[tn()];o(")");if(r(":")){s=M()}return t.createMethodDefinition(n,"set",e,rn({params:m,generator:false,name:p,returnType:s}))}if(r("<")){h=F()}f=u==="async"&&!r("(");if(f){e=j()}if(l[n].hasOwnProperty(e.name)){d(e,i.IllegalDuplicateClassProperty)}else{l[n][e.name]={}}l[n][e.name].data=true;return t.createMethodDefinition(n,"",e,en({generator:false,async:f,typeParameters:h}))}function cr(a,n,r,l){var e;e=M();o(";");return t.createClassProperty(n,e,r,l)}function fr(i){var e,t=false,l,s=f(),a=false;if(r(";")){m();return}if(c.value==="static"){m();a=true}if(r("*")){m();t=true}e=c.value==="[";l=j();if(!t&&c.value===":"){return n(s,cr(i,l,e,a))}return n(s,ur(i,l,a,t,e))}function lt(){var l,i=[],a={},s=f();a[$.static]={};a[$.prototype]={};o("{");while(e<y){if(r("}")){break}l=fr(a);if(typeof l!=="undefined"){i.push(l)}}o("}");return n(s,t.createClassBody(i))}function at(){var a,i=[],s,l;X("implements");while(e<y){s=f();a=k();if(r("<")){l=sn()}else{l=null}i.push(n(s,t.createClassImplements(a,l)));if(!r(",")){break}o(",")}return i}function it(){var e,l,i,s=null,o,c=f(),u;b("class");if(!x("extends")&&!_("implements")&&!r("{")){e=k()}if(r("<")){u=F()}if(x("extends")){b("extends");i=a.yieldAllowed;a.yieldAllowed=false;s=An();if(r("<")){o=sn()}a.yieldAllowed=i}if(_("implements")){l=at()}return n(c,t.createClassExpression(e,s,lt(),u,o,l))}function hr(){var e,l,i,s=null,o,c=f(),u;b("class");e=k();if(r("<")){u=F()}if(x("extends")){b("extends");i=a.yieldAllowed;a.yieldAllowed=false;s=An();if(r("<")){o=sn()}a.yieldAllowed=i}if(_("implements")){l=at()}return n(c,t.createClassDeclaration(e,s,lt(),u,o,l))}function H(){var e;if(c.type===u.Keyword){switch(c.value){case"const":case"let":return It(c.value);case"function":return jn();default:return B()}}if(_("type")&&P().type===u.Identifier){return Jr()}if(_("interface")&&P().type===u.Identifier){return Hr()}if(_("declare")){e=P();if(e.type===u.Keyword){switch(e.value){case"class":return vt();case"function":return xt();case"var":return bt()}}else if(e.type===u.Identifier&&e.value==="module"){return Kr()}}if(c.type!==u.EOF){return B()}}function ot(){if(c.type===u.Keyword){switch(c.value){case"export":return Tt();case"import":return Ot()}}return H()}function vr(){var n,a=[],t,o,r;while(e<y){t=c;if(t.type!==u.StringLiteral){break}n=ot();a.push(n);if(n.expression.type!==l.Literal){break}o=s.slice(t.range[0]+1,t.range[1]-1);if(o==="use strict"){v=true;if(r){E(r,i.StrictOctalLiteral)}}else{if(!r&&t.octal){r=t}}}while(e<y){n=ot();if(typeof n==="undefined"){break}a.push(n)}return a}function xr(){var e,r=f();v=false;mn();e=vr();return n(r,t.createProgram(e))}function wn(t,r,n,l,i){var e;G(typeof n==="number","Comment must have valid position");if(a.lastCommentStart>=n){return}a.lastCommentStart=n;e={type:t,value:r};if(p.range){e.range=[n,l]}if(p.loc){e.loc=i}p.comments.push(e);if(p.attachComment){p.leadingComments.push(e);p.trailingComments.push(e)}}function Er(){var t,n,r,l,o,a;t="";o=false;a=false;while(e<y){n=s[e];if(a){n=s[e++];if(T(n.charCodeAt(0))){r.end={line:h,column:e-g-1};a=false;wn("Line",t,l,e-1,r);if(n==="\r"&&s[e]==="\n"){++e}++h;g=e;t=""}else if(e>=y){a=false;t+=n;r.end={line:h,column:y-g};wn("Line",t,l,y,r)}else{t+=n}}else if(o){if(T(n.charCodeAt(0))){if(n==="\r"){++e;t+="\r"}if(n!=="\r"||s[e]==="\n"){t+=s[e];++h;++e;g=e;if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}}else{n=s[e++];if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}t+=n;if(n==="*"){n=s[e];if(n==="/"){t=t.substr(0,t.length-1);o=false;++e;r.end={line:h,column:e-g};wn("Block",t,l,e,r);t=""}}}}else if(n==="/"){n=s[e+1];if(n==="/"){r={start:{line:h,column:e-g}};l=e;e+=2;a=true;if(e>=y){r.end={line:h,column:e-g};a=false;wn("Line",t,l,e,r)}}else if(n==="*"){l=e;e+=2;o=true;r={start:{line:h,column:e-g-2}};if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}else{break}}else if(st(n.charCodeAt(0))){++e}else if(T(n.charCodeAt(0))){++e;if(n==="\r"&&s[e]==="\n"){++e}++h;g=e}else{break}}}Nn={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function on(e){if(e.type===l.XJSIdentifier){return e.name}if(e.type===l.XJSNamespacedName){return e.namespace.name+":"+e.name.name}if(e.type===l.XJSMemberExpression){return on(e.object)+"."+on(e.property)}}function _r(e){return e!==92&&q(e)}function Sr(e){return e!==92&&(e===45||an(e))}function kr(){var n,t,r="";t=e;while(e<y){n=s.charCodeAt(e);if(!Sr(n)){break}r+=s[e++]}return{type:u.XJSIdentifier,value:r,lineNumber:h,lineStart:g,range:[t,e]}}function Ir(){var t,n="",l=e,a=0,r;t=s[e];G(t==="&","Entity must start with an ampersand");e++;while(e<y&&a++<10){t=s[e++];if(t===";"){break}n+=t}if(t===";"){if(n[0]==="#"){if(n[1]==="x"){r=+("0"+n.substr(1))}else{r=+n.substr(1).replace(_n.LeadingZeros,"")}if(!isNaN(r)){return String.fromCharCode(r)}}else if(Nn[n]){return Nn[n]}}e=l+1;return"&"}function ft(l){var n,t="",r;r=e;while(e<y){n=s[e];if(l.indexOf(n)!==-1){break}if(n==="&"){t+=Ir()}else{e++;if(n==="\r"&&s[e]==="\n"){t+=n;n=s[e];e++}if(T(n.charCodeAt(0))){++h;g=e}t+=n}}return{type:u.XJSText,value:t,lineNumber:h,lineStart:g,range:[r,e]}}function Cr(){var t,n,r;n=s[e];G(n==="'"||n==='"',"String literal must starts with a quote");r=e;++e;t=ft([n]);if(n!==s[e]){d({},i.UnexpectedToken,"ILLEGAL")}++e;t.range=[r,e];return t}function Ar(){var n=s.charCodeAt(e);if(n!==123&&n!==60){return ft(["<","{"])}return V()}function Q(){var e,r=f();if(c.type!==u.XJSIdentifier){I(c)}e=m();return n(r,t.createXJSIdentifier(e.value))}function dt(){var e,r,l=f();e=Q();o(":");r=Q();return n(l,t.createXJSNamespacedName(e,r))}function Pr(){var l=f(),e=Q();while(r(".")){m();e=n(l,t.createXJSMemberExpression(e,Q()))}return e}function mt(){if(P().value===":"){return dt()}if(P().value==="."){return Pr()}return Q()}function Mr(){if(P().value===":"){return dt()}return Q()}function Or(){var e,a;if(r("{")){e=ht();if(e.expression.type===l.XJSEmptyExpression){d(e,"XJS attributes must only be assigned a non-empty "+"expression")}}else if(r("<")){e=Bn()}else if(c.type===u.XJSText){a=f();e=n(a,t.createLiteral(m()))}else{d({},i.InvalidXJSAttributeValue)}return e}function Dr(){var r=Xn();while(s.charAt(e)!=="}"){e++}return n(r,t.createXJSEmptyExpression())}function ht(){var e,l,i,s=f();l=a.inXJSChild;i=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=false;o("{");if(r("}")){e=Dr()}else{e=w()}a.inXJSChild=l;a.inXJSTag=i;o("}");return n(s,t.createXJSExpressionContainer(e))}function Fr(){var e,r,l,i=f();r=a.inXJSChild;l=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=false;
o("{");o("...");e=R();a.inXJSChild=r;a.inXJSTag=l;o("}");return n(i,t.createXJSSpreadAttribute(e))}function Br(){var e,l;if(r("{")){return Fr()}l=f();e=Mr();if(r("=")){m();return n(l,t.createXJSAttribute(e,Or()))}return n(l,t.createXJSAttribute(e))}function Ur(){var e,l;if(r("{")){e=ht()}else if(c.type===u.XJSText){l=Xn();e=n(l,t.createLiteral(m()))}else{e=Bn()}return e}function Vr(){var e,r,l,i=f();r=a.inXJSChild;l=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=true;o("<");o("/");e=mt();a.inXJSChild=r;a.inXJSTag=l;o(">");return n(i,t.createXJSClosingElement(e))}function Xr(){var r,d,l=[],i=false,s,u,p=f();s=a.inXJSChild;u=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=true;o("<");r=mt();while(e<y&&c.value!=="/"&&c.value!==">"){l.push(Br())}a.inXJSTag=u;if(c.value==="/"){o("/");a.inXJSChild=s;o(">");i=true}else{a.inXJSChild=true;o(">")}return n(p,t.createXJSOpeningElement(r,l,i))}function Bn(){var l,s=null,u=[],o,p,m=f();o=a.inXJSChild;p=a.inXJSTag;l=Xr();if(!l.selfClosing){while(e<y){a.inXJSChild=false;if(c.value==="<"&&P().value==="/"){break}a.inXJSChild=true;u.push(Ur())}a.inXJSChild=o;a.inXJSTag=p;s=Vr();if(on(s.name)!==on(l.name)){d({},i.ExpectedXJSClosingTag,on(l.name))}}if(!o&&r("<")){d(c,i.AdjacentXJSElements)}return n(m,t.createXJSElement(l,s,u))}function Jr(){var e,i=f(),l=null,a;X("type");e=k();if(r("<")){l=F()}o("=");a=A();S();return n(i,t.createTypeAlias(e,l,a))}function Gr(){var a=f(),e,l=null;e=k();if(r("<")){l=sn()}return n(a,t.createInterfaceExtends(e,l))}function yt(c,p){var l,a,i=[],s,u=null;s=k();if(r("<")){u=F()}if(x("extends")){b("extends");while(e<y){i.push(Gr());if(!r(",")){break}o(",")}}a=f();l=n(a,pt(p));return n(c,t.createInterface(s,u,l,i))}function Hr(){var n,t,r=[],l,e=f(),a=null;X("interface");return yt(e,false)}function vt(){var n=f(),e;X("declare");b("class");e=yt(n,true);e.type=l.DeclareClass;return e}function xt(){var e,i,m=f(),s,u,c,l,p=null,d,a;X("declare");b("function");i=f();e=k();a=f();if(r("<")){p=F()}o("(");l=Pn();s=l.params;c=l.rest;o(")");o(":");u=A();d=n(a,t.createFunctionTypeAnnotation(s,u,c,p));e.typeAnnotation=n(a,t.createTypeAnnotation(d));n(i,e);S();return n(m,t.createDeclareFunction(e))}function bt(){var e,r=f();X("declare");b("var");e=tn();S();return n(r,t.createDeclareVariable(e))}function Kr(){var l=[],s,a,p,h=f(),d;X("declare");X("module");if(c.type===u.StringLiteral){if(v&&c.octal){E(c,i.StrictOctalLiteral)}p=f();a=n(p,t.createLiteral(m()))}else{a=k()}s=f();o("{");while(e<y&&!r("}")){d=P();switch(d.value){case"class":l.push(vt());break;case"function":l.push(xt());break;case"var":l.push(bt());break;default:I(c)}}o("}");return n(h,t.createDeclareModule(a,n(s,t.createBlockStatement(l))))}function Qr(){var o,t,n,l,i,r;if(!a.inXJSChild){O()}o=e;t={start:{line:h,column:e-g}};n=p.advance();t.end={line:h,column:e-g};if(n.type!==u.EOF){l=[n.range[0],n.range[1]];i=s.slice(n.range[0],n.range[1]);r={type:C[n.type],value:i,range:l,loc:t};if(n.regex){r.regex={pattern:n.regex.pattern,flags:n.regex.flags}}p.tokens.push(r)}return n}function Zr(){var r,l,t,n;O();r=e;l={start:{line:h,column:e-g}};t=p.scanRegExp();l.end={line:h,column:e-g};if(!p.tokenize){if(p.tokens.length>0){n=p.tokens[p.tokens.length-1];if(n.range[0]===r&&n.type==="Punctuator"){if(n.value==="/"||n.value==="/="){p.tokens.pop()}}}p.tokens.push({type:"RegularExpression",value:t.literal,regex:t.regex,range:[r,e],loc:l})}return t}function Et(){var t,e,n,r=[];for(t=0;t<p.tokens.length;++t){e=p.tokens[t];n={type:e.type,value:e.value};if(e.regex){n.regex={pattern:e.regex.pattern,flags:e.regex.flags}}if(p.range){n.range=e.range}if(p.loc){n.loc=e.loc}r.push(n)}p.tokens=r}function wt(){if(p.comments){p.skipComment=O;O=Er}if(typeof p.tokens!=="undefined"){p.advance=nn;p.scanRegExp=N;nn=Qr;N=Zr}}function Kn(){if(typeof p.skipComment==="function"){O=p.skipComment}if(typeof p.scanRegExp==="function"){nn=p.advance;N=p.scanRegExp}}function rl(n,t){var e,r={};for(e in n){if(n.hasOwnProperty(e)){r[e]=n[e]}}for(e in t){if(t.hasOwnProperty(e)){r[e]=t[e]}}return r}function ll(r,n){var o,i,l;o=String;if(typeof r!=="string"&&!(r instanceof String)){r=o(r)}t=Fn;s=r;e=0;h=s.length>0?1:0;g=0;y=s.length;c=null;a={allowKeyword:true,allowIn:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1};p={};n=n||{};n.tokens=true;p.tokens=[];p.tokenize=true;p.openParenToken=-1;p.openCurlyToken=-1;p.range=typeof n.range==="boolean"&&n.range;p.loc=typeof n.loc==="boolean"&&n.loc;if(typeof n.comment==="boolean"&&n.comment){p.comments=[]}if(typeof n.tolerant==="boolean"&&n.tolerant){p.errors=[]}if(y>0){if(typeof s[0]==="undefined"){if(r instanceof String){s=r.valueOf()}}}wt();try{mn();if(c.type===u.EOF){return p.tokens}i=m();while(c.type!==u.EOF){try{i=m()}catch(f){i=c;if(p.errors){p.errors.push(f);break}else{throw f}}}Et();l=p.tokens;if(typeof p.comments!=="undefined"){l.comments=p.comments}if(typeof p.errors!=="undefined"){l.errors=p.errors}}catch(d){throw d}finally{Kn();p={}}return l}function Rt(r,n){var l,i;i=String;if(typeof r!=="string"&&!(r instanceof String)){r=i(r)}t=Fn;s=r;e=0;h=s.length>0?1:0;g=0;y=s.length;c=null;a={allowKeyword:false,allowIn:true,labelSet:{},parenthesizedCount:0,inFunctionBody:false,inIteration:false,inSwitch:false,inXJSChild:false,inXJSTag:false,inType:false,lastCommentStart:-1,yieldAllowed:false,awaitAllowed:false};p={};if(typeof n!=="undefined"){p.range=typeof n.range==="boolean"&&n.range;p.loc=typeof n.loc==="boolean"&&n.loc;p.attachComment=typeof n.attachComment==="boolean"&&n.attachComment;if(p.loc&&n.source!==null&&n.source!==undefined){t=rl(t,{postProcess:function(e){e.loc.source=i(n.source);return e}})}if(typeof n.tokens==="boolean"&&n.tokens){p.tokens=[]}if(typeof n.comment==="boolean"&&n.comment){p.comments=[]}if(typeof n.tolerant==="boolean"&&n.tolerant){p.errors=[]}if(p.attachComment){p.range=true;p.comments=[];p.bottomRightStack=[];p.trailingComments=[];p.leadingComments=[]}}if(y>0){if(typeof s[0]==="undefined"){if(r instanceof String){s=r.valueOf()}}}wt();try{l=xr();if(typeof p.comments!=="undefined"){l.comments=p.comments}if(typeof p.tokens!=="undefined"){Et();l.tokens=p.tokens}if(typeof p.errors!=="undefined"){l.errors=p.errors}}catch(o){throw o}finally{Kn();p={}}return l}En.version="8001.1001.0-dev-harmony-fb";En.tokenize=ll;En.parse=Rt;En.Syntax=function(){var e,n={};if(typeof Object.create==="function"){n=Object.create(null)}for(e in l){if(l.hasOwnProperty(e)){n[e]=l[e]}}if(typeof Object.freeze==="function"){Object.freeze(n)}return n}()})},{}],162:[function(t,e,r){var n=function(){"use strict";function e(n,t){var e=Array.prototype.slice.call(arguments,1);return n.replace(/\{(\d+)\}/g,function(t,n){return n in e?e[n]:t})}function n(n,e){return n.replace(/\{([_$a-zA-Z0-9][_$a-zA-Z0-9]*)\}/g,function(t,n){return n in e?e[n]:t})}function t(e,n){return new Array(n+1).join(e)}e.fmt=e;e.obj=n;e.repeat=t;return e}();if(typeof e!=="undefined"&&typeof e.exports!=="undefined"){e.exports=n}},{}],163:[function(t,e,r){var n=function(){"use strict";var e=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;var t=void 0;return{nan:function(e){return e!==e},"boolean":function(e){return typeof e==="boolean"},number:function(e){return typeof e==="number"},string:function(e){return typeof e==="string"},fn:function(e){return typeof e==="function"},object:function(e){return e!==null&&typeof e==="object"},primitive:function(e){var n=typeof e;return e===null||e===t||n==="boolean"||n==="number"||n==="string"},array:Array.isArray||function(e){return n.call(e)==="[object Array]"},finitenumber:function(e){return typeof e==="number"&&isFinite(e)},someof:function(e,n){return n.indexOf(e)>=0},noneof:function(e,n){return n.indexOf(e)===-1},own:function(n,t){return e.call(n,t)}}}();if(typeof e!=="undefined"&&typeof e.exports!=="undefined"){e.exports=n}},{}],164:[function(t,e,r){var n=function(){"use strict";var n=Object.prototype.hasOwnProperty;var t=function(){function r(e){for(var t in e){if(n.call(e,t)){return true}}return false}function l(e){return n.call(e,"__count__")||n.call(e,"__parent__")}var e=false;if(typeof Object.create==="function"){if(!r(Object.create(null))){e=true}}if(e===false){if(r({})){throw new Error("StringMap environment error 0, please file a bug at https://github.com/olov/stringmap/issues")}}var t=e?Object.create(null):{};var a=false;if(l(t)){t.__proto__=null;if(r(t)||l(t)){throw new Error("StringMap environment error 1, please file a bug at https://github.com/olov/stringmap/issues")}a=true}return function(){var n=e?Object.create(null):{};if(a){n.__proto__=null}return n}}();function e(n){if(!(this instanceof e)){return new e(n)}this.obj=t();this.hasProto=false;this.proto=undefined;if(n){this.setMany(n)}}e.prototype.has=function(e){if(typeof e!=="string"){throw new Error("StringMap expected string key")}return e==="__proto__"?this.hasProto:n.call(this.obj,e)};e.prototype.get=function(e){if(typeof e!=="string"){throw new Error("StringMap expected string key")}return e==="__proto__"?this.proto:n.call(this.obj,e)?this.obj[e]:undefined};e.prototype.set=function(e,n){if(typeof e!=="string"){throw new Error("StringMap expected string key")}if(e==="__proto__"){this.hasProto=true;this.proto=n}else{this.obj[e]=n}};e.prototype.remove=function(e){if(typeof e!=="string"){throw new Error("StringMap expected string key")}var n=this.has(e);if(e==="__proto__"){this.hasProto=false;this.proto=undefined}else{delete this.obj[e]}return n};e.prototype["delete"]=e.prototype.remove;e.prototype.isEmpty=function(){for(var e in this.obj){if(n.call(this.obj,e)){return false}}return!this.hasProto};e.prototype.size=function(){var e=0;for(var t in this.obj){if(n.call(this.obj,t)){++e}}return this.hasProto?e+1:e};e.prototype.keys=function(){var e=[];for(var t in this.obj){if(n.call(this.obj,t)){e.push(t)}}if(this.hasProto){e.push("__proto__")}return e};e.prototype.values=function(){var e=[];for(var t in this.obj){if(n.call(this.obj,t)){e.push(this.obj[t])}}if(this.hasProto){e.push(this.proto)}return e};e.prototype.items=function(){var e=[];for(var t in this.obj){if(n.call(this.obj,t)){e.push([t,this.obj[t]])}}if(this.hasProto){e.push(["__proto__",this.proto])}return e};e.prototype.setMany=function(e){if(e===null||typeof e!=="object"&&typeof e!=="function"){throw new Error("StringMap expected Object")}for(var t in e){if(n.call(e,t)){this.set(t,e[t])}}return this};e.prototype.merge=function(n){var t=n.keys();for(var e=0;e<t.length;e++){var r=t[e];this.set(r,n.get(r))}return this};e.prototype.map=function(r){var e=this.keys();for(var n=0;n<e.length;n++){var t=e[n];e[n]=r(this.get(t),t)}return e};e.prototype.forEach=function(r){var n=this.keys();for(var e=0;e<n.length;e++){var t=n[e];r(this.get(t),t)}};e.prototype.clone=function(){var n=e();return n.merge(this)};e.prototype.toString=function(){var e=this;return"{"+this.keys().map(function(n){return JSON.stringify(n)+":"+JSON.stringify(e.get(n))}).join(",")+"}"};return e}();if(typeof e!=="undefined"&&typeof e.exports!=="undefined"){e.exports=n}},{}],165:[function(t,e,r){var n=function(){"use strict";var n=Object.prototype.hasOwnProperty;var t=function(){function r(e){for(var t in e){if(n.call(e,t)){return true}}return false}function l(e){return n.call(e,"__count__")||n.call(e,"__parent__")}var e=false;if(typeof Object.create==="function"){if(!r(Object.create(null))){e=true}}if(e===false){if(r({})){throw new Error("StringSet environment error 0, please file a bug at https://github.com/olov/stringset/issues")}}var t=e?Object.create(null):{};var a=false;if(l(t)){t.__proto__=null;if(r(t)||l(t)){throw new Error("StringSet environment error 1, please file a bug at https://github.com/olov/stringset/issues")}a=true}return function(){var n=e?Object.create(null):{};if(a){n.__proto__=null}return n}}();function e(n){if(!(this instanceof e)){return new e(n)}this.obj=t();this.hasProto=false;if(n){this.addMany(n)}}e.prototype.has=function(e){if(typeof e!=="string"){throw new Error("StringSet expected string item")}return e==="__proto__"?this.hasProto:n.call(this.obj,e)};e.prototype.add=function(e){if(typeof e!=="string"){throw new Error("StringSet expected string item")}if(e==="__proto__"){this.hasProto=true}else{this.obj[e]=true}};e.prototype.remove=function(e){if(typeof e!=="string"){throw new Error("StringSet expected string item")}var n=this.has(e);if(e==="__proto__"){this.hasProto=false}else{delete this.obj[e]}return n};e.prototype["delete"]=e.prototype.remove;e.prototype.isEmpty=function(){for(var e in this.obj){if(n.call(this.obj,e)){return false}}return!this.hasProto};e.prototype.size=function(){var e=0;for(var t in this.obj){if(n.call(this.obj,t)){++e}}return this.hasProto?e+1:e};e.prototype.items=function(){var e=[];for(var t in this.obj){if(n.call(this.obj,t)){e.push(t)}}if(this.hasProto){e.push("__proto__")}return e};e.prototype.addMany=function(e){if(!Array.isArray(e)){throw new Error("StringSet expected array")}for(var n=0;n<e.length;n++){this.add(e[n])}return this};e.prototype.merge=function(e){this.addMany(e.items());return this};e.prototype.clone=function(){var n=e();return n.merge(this)};e.prototype.toString=function(){return"{"+this.items().map(JSON.stringify).join(",")+"}"};return e}();if(typeof e!=="undefined"&&typeof e.exports!=="undefined"){e.exports=n}},{}],166:[function(n,t,e){(function(t,n){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],n)}else if(typeof e!=="undefined"){n(e)}else{n(t.esprima={})}})(this,function(En){"use strict";var o,A,bt,r,G,i,wn,kn,Rn,tn,s,v,e,h,g,y,l,c,a,f;o={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10,XJSIdentifier:11,XJSText:12};A={};A[o.BooleanLiteral]="Boolean";A[o.EOF]="<end>";A[o.Identifier]="Identifier";A[o.Keyword]="Keyword";A[o.NullLiteral]="Null";A[o.NumericLiteral]="Numeric";A[o.Punctuator]="Punctuator";A[o.StringLiteral]="String";A[o.XJSIdentifier]="XJSIdentifier";A[o.XJSText]="XJSText";A[o.RegularExpression]="RegularExpression";bt=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];r={AnyTypeAnnotation:"AnyTypeAnnotation",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrayTypeAnnotation:"ArrayTypeAnnotation",ArrowFunctionExpression:"ArrowFunctionExpression",AssignmentExpression:"AssignmentExpression",BinaryExpression:"BinaryExpression",BlockStatement:"BlockStatement",BooleanTypeAnnotation:"BooleanTypeAnnotation",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ClassImplements:"ClassImplements",ClassProperty:"ClassProperty",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DeclareClass:"DeclareClass",DeclareFunction:"DeclareFunction",DeclareModule:"DeclareModule",DeclareVariable:"DeclareVariable",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportDeclaration:"ExportDeclaration",ExportBatchSpecifier:"ExportBatchSpecifier",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",ForStatement:"ForStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",FunctionTypeAnnotation:"FunctionTypeAnnotation",FunctionTypeParam:"FunctionTypeParam",GenericTypeAnnotation:"GenericTypeAnnotation",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",InterfaceDeclaration:"InterfaceDeclaration",InterfaceExtends:"InterfaceExtends",IntersectionTypeAnnotation:"IntersectionTypeAnnotation",LabeledStatement:"LabeledStatement",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",NullableTypeAnnotation:"NullableTypeAnnotation",NumberTypeAnnotation:"NumberTypeAnnotation",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",ObjectTypeAnnotation:"ObjectTypeAnnotation",ObjectTypeCallProperty:"ObjectTypeCallProperty",ObjectTypeIndexer:"ObjectTypeIndexer",ObjectTypeProperty:"ObjectTypeProperty",Program:"Program",Property:"Property",QualifiedTypeIdentifier:"QualifiedTypeIdentifier",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SpreadProperty:"SpreadProperty",StringLiteralTypeAnnotation:"StringLiteralTypeAnnotation",StringTypeAnnotation:"StringTypeAnnotation",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TupleTypeAnnotation:"TupleTypeAnnotation",TryStatement:"TryStatement",TypeAlias:"TypeAlias",TypeAnnotation:"TypeAnnotation",TypeofTypeAnnotation:"TypeofTypeAnnotation",TypeParameterDeclaration:"TypeParameterDeclaration",TypeParameterInstantiation:"TypeParameterInstantiation",UnaryExpression:"UnaryExpression",UnionTypeAnnotation:"UnionTypeAnnotation",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",VoidTypeAnnotation:"VoidTypeAnnotation",WhileStatement:"WhileStatement",WithStatement:"WithStatement",XJSIdentifier:"XJSIdentifier",XJSNamespacedName:"XJSNamespacedName",XJSMemberExpression:"XJSMemberExpression",XJSEmptyExpression:"XJSEmptyExpression",XJSExpressionContainer:"XJSExpressionContainer",XJSElement:"XJSElement",XJSClosingElement:"XJSClosingElement",XJSOpeningElement:"XJSOpeningElement",XJSAttribute:"XJSAttribute",XJSSpreadAttribute:"XJSSpreadAttribute",XJSText:"XJSText",YieldExpression:"YieldExpression",AwaitExpression:"AwaitExpression"};G={Data:1,Get:2,Set:4};tn={"static":"static",prototype:"prototype"};i={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInFormalsList:"Invalid left-hand side in formals list",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalDuplicateClassProperty:"Illegal duplicate property in class definition",IllegalReturn:"Illegal return statement",IllegalSpread:"Illegal spread element",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",ParameterAfterRestParameter:"Rest parameter must be final parameter of an argument list",DefaultRestParameter:"Rest parameter can not have a default value",ElementAfterSpreadElement:"Spread must be the final element of an element list",PropertyAfterSpreadProperty:"A rest property must be the final property of an object literal",ObjectPatternAsRestParameter:"Invalid rest parameter",ObjectPatternAsSpread:"Invalid spread argument",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingFromClause:"Missing from clause",NoAsAfterImportNamespace:"Missing as after import *",InvalidModuleSpecifier:"Invalid module specifier",IllegalImportDeclaration:"Illegal import declaration",IllegalExportDeclaration:"Illegal export declaration",NoUnintializedConst:"Const must be initialized",ComprehensionRequiresBlock:"Comprehension must have at least one block",ComprehensionError:"Comprehension Error",EachNotAllowed:"Each is not supported",InvalidXJSAttributeValue:"XJS value should be either an expression or a quoted XJS text",ExpectedXJSClosingTag:"Expected corresponding XJS closing tag for %0",AdjacentXJSElements:"Adjacent XJS elements must be wrapped in an enclosing tag",ConfusedAboutFunctionType:"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType"};wn={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),LeadingZeros:new RegExp("^0+(?!$)")};function J(e,n){if(!e){throw new Error("ASSERT: "+n)}}function O(){this.$data={}}O.prototype.get=function(e){e="$"+e;return this.$data[e]};O.prototype.set=function(e,n){e="$"+e;this.$data[e]=n;return this};O.prototype.has=function(e){e="$"+e;return Object.prototype.hasOwnProperty.call(this.$data,e)};O.prototype["delete"]=function(e){e="$"+e;return delete this.$data[e]};function B(e){return e>=48&&e<=57}function Un(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function X(e){return"01234567".indexOf(e)>=0}function gt(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&" ".indexOf(String.fromCharCode(e))>0}function T(e){return e===10||e===13||e===8232||e===8233}function W(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&wn.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function an(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&wn.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function jr(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return true;default:return false}}function ln(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true;default:return false}}function L(e){return e==="eval"||e==="arguments"}function Kr(e){if(v&&ln(e)){return true}switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try"||e==="let";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return false}}function N(){var n,t,r;t=false;r=false;while(e<y){n=s.charCodeAt(e);if(r){++e;if(T(n)){r=false;if(n===13&&s.charCodeAt(e)===10){++e}++h;g=e}}else if(t){if(T(n)){if(n===13){++e}if(n!==13||s.charCodeAt(e)===10){++h;++e;g=e;if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}}else{n=s.charCodeAt(e++);if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}if(n===42){n=s.charCodeAt(e);if(n===47){++e;t=false}}}}else if(n===47){n=s.charCodeAt(e+1);if(n===47){e+=2;r=true}else if(n===42){e+=2;t=true;if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}else{break}}else if(gt(n)){++e}else if(T(n)){++e;if(n===13&&s.charCodeAt(e)===10){++e}++h;g=e}else{break}}}function pn(a){var n,r,l,t=0;r=a==="u"?4:2;for(n=0;n<r;++n){if(e<y&&Un(s[e])){l=s[e++];t=t*16+"0123456789abcdef".indexOf(l.toLowerCase())}else{return""}}return String.fromCharCode(t)}function mt(){var t,n,r,l;t=s[e];n=0;if(t==="}"){d({},i.UnexpectedToken,"ILLEGAL")}while(e<y){t=s[e++];if(!Un(t)){break}n=n*16+"0123456789abcdef".indexOf(t.toLowerCase())}if(n>1114111||t!=="}"){d({},i.UnexpectedToken,"ILLEGAL")}if(n<=65535){return String.fromCharCode(n)}r=(n-65536>>10)+55296;l=(n-65536&1023)+56320;return String.fromCharCode(r,l)}function dt(){var n,t;n=s.charCodeAt(e++);t=String.fromCharCode(n);if(n===92){if(s.charCodeAt(e)!==117){d({},i.UnexpectedToken,"ILLEGAL")}++e;n=pn("u");if(!n||n==="\\"||!W(n.charCodeAt(0))){d({},i.UnexpectedToken,"ILLEGAL")}t=n}while(e<y){n=s.charCodeAt(e);if(!an(n)){break}++e;t+=String.fromCharCode(n);if(n===92){t=t.substr(0,t.length-1);if(s.charCodeAt(e)!==117){d({},i.UnexpectedToken,"ILLEGAL")}++e;n=pn("u");if(!n||n==="\\"||!an(n.charCodeAt(0))){d({},i.UnexpectedToken,"ILLEGAL")}t+=n}}return t}function sr(){var n,t;n=e++;while(e<y){t=s.charCodeAt(e);if(t===92){e=n;return dt()}if(an(t)){++e}else{break}}return s.slice(n,e)}function gr(){var r,n,t;r=e;n=s.charCodeAt(e)===92?dt():sr();if(n.length===1){t=o.Identifier}else if(Kr(n)){t=o.Keyword}else if(n==="null"){t=o.NullLiteral}else if(n==="true"||n==="false"){t=o.BooleanLiteral}else{t=o.Identifier}return{type:t,value:n,lineNumber:h,lineStart:g,range:[r,e]}}function U(){var n=e,l=s.charCodeAt(e),c,t=s[e],r,u,p;switch(l){case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:++e;if(f.tokenize){if(l===40){f.openParenToken=f.tokens.length}else if(l===123){f.openCurlyToken=f.tokens.length}}return{type:o.Punctuator,value:String.fromCharCode(l),lineNumber:h,lineStart:g,range:[n,e]};default:c=s.charCodeAt(e+1);if(c===61){switch(l){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:e+=2;return{type:o.Punctuator,value:String.fromCharCode(l)+String.fromCharCode(c),lineNumber:h,lineStart:g,range:[n,e]};case 33:case 61:e+=2;if(s.charCodeAt(e)===61){++e}return{type:o.Punctuator,value:s.slice(n,e),lineNumber:h,lineStart:g,range:[n,e]};default:break}}break}r=s[e+1];u=s[e+2];p=s[e+3];if(t===">"&&r===">"&&u===">"){if(p==="="){e+=4;return{type:o.Punctuator,value:">>>=",lineNumber:h,lineStart:g,range:[n,e]}}}if(t===">"&&r===">"&&u===">"){e+=3;return{type:o.Punctuator,value:">>>",lineNumber:h,lineStart:g,range:[n,e]}}if(t==="<"&&r==="<"&&u==="="){e+=3;return{type:o.Punctuator,value:"<<=",lineNumber:h,lineStart:g,range:[n,e]}}if(t===">"&&r===">"&&u==="="){e+=3;return{type:o.Punctuator,value:">>=",lineNumber:h,lineStart:g,range:[n,e]}}if(t==="."&&r==="."&&u==="."){e+=3;return{type:o.Punctuator,value:"...",lineNumber:h,lineStart:g,range:[n,e]}}if(t===r&&"+-<>&|".indexOf(t)>=0&&!a.inType){e+=2;return{type:o.Punctuator,value:t+r,lineNumber:h,lineStart:g,range:[n,e]}}if(t==="="&&r===">"){e+=2;return{type:o.Punctuator,value:"=>",lineNumber:h,lineStart:g,range:[n,e]}}if("<>=!+-*%&|^/".indexOf(t)>=0){++e;return{type:o.Punctuator,value:t,lineNumber:h,lineStart:g,range:[n,e]}}if(t==="."){++e;return{type:o.Punctuator,value:t,lineNumber:h,lineStart:g,range:[n,e]}}d({},i.UnexpectedToken,"ILLEGAL")}function Ur(t){var n="";while(e<y){if(!Un(s[e])){break}n+=s[e++]}if(n.length===0){d({},i.UnexpectedToken,"ILLEGAL")}if(W(s.charCodeAt(e))){d({},i.UnexpectedToken,"ILLEGAL")}return{type:o.NumericLiteral,value:parseInt("0x"+n,16),lineNumber:h,lineStart:g,range:[t,e]}}function Yr(r,l){var n,t;if(X(r)){t=true;n="0"+s[e++]}else{t=false;++e;n=""}while(e<y){if(!X(s[e])){break}n+=s[e++]}if(!t&&n.length===0){d({},i.UnexpectedToken,"ILLEGAL")}if(W(s.charCodeAt(e))||B(s.charCodeAt(e))){d({},i.UnexpectedToken,"ILLEGAL")}return{type:o.NumericLiteral,value:parseInt(n,8),octal:t,lineNumber:h,lineStart:g,range:[l,e]}}function ft(){var t,r,n,l;n=s[e];J(B(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point");r=e;t="";if(n!=="."){t=s[e++];n=s[e];if(t==="0"){if(n==="x"||n==="X"){++e;return Ur(r)}if(n==="b"||n==="B"){++e;t="";while(e<y){n=s[e];if(n!=="0"&&n!=="1"){break}t+=s[e++]}if(t.length===0){d({},i.UnexpectedToken,"ILLEGAL")}if(e<y){n=s.charCodeAt(e);if(W(n)||B(n)){d({},i.UnexpectedToken,"ILLEGAL")}}return{type:o.NumericLiteral,value:parseInt(t,2),lineNumber:h,lineStart:g,range:[r,e]}}if(n==="o"||n==="O"||X(n)){return Yr(n,r)}if(n&&B(n.charCodeAt(0))){d({},i.UnexpectedToken,"ILLEGAL")}}while(B(s.charCodeAt(e))){t+=s[e++]}n=s[e]}if(n==="."){t+=s[e++];while(B(s.charCodeAt(e))){t+=s[e++]}n=s[e]}if(n==="e"||n==="E"){t+=s[e++];n=s[e];if(n==="+"||n==="-"){t+=s[e++]}if(B(s.charCodeAt(e))){while(B(s.charCodeAt(e))){t+=s[e++]}}else{d({},i.UnexpectedToken,"ILLEGAL")}}if(W(s.charCodeAt(e))){d({},i.UnexpectedToken,"ILLEGAL")}return{type:o.NumericLiteral,value:parseFloat(t),lineNumber:h,lineStart:g,range:[r,e]}}function Pt(){var t="",l,c,n,r,a,f,u=false;l=s[e];J(l==="'"||l==='"',"String literal must starts with a quote");c=e;++e;while(e<y){n=s[e++];if(n===l){l="";break}else if(n==="\\"){n=s[e++];if(!n||!T(n.charCodeAt(0))){switch(n){case"n":t+="\n";
break;case"r":t+="\r";break;case"t":t+=" ";break;case"u":case"x":if(s[e]==="{"){++e;t+=mt()}else{f=e;a=pn(n);if(a){t+=a}else{e=f;t+=n}}break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="";break;default:if(X(n)){r="01234567".indexOf(n);if(r!==0){u=true}if(e<y&&X(s[e])){u=true;r=r*8+"01234567".indexOf(s[e++]);if("0123".indexOf(n)>=0&&e<y&&X(s[e])){r=r*8+"01234567".indexOf(s[e++])}}t+=String.fromCharCode(r)}else{t+=n}break}}else{++h;if(n==="\r"&&s[e]==="\n"){++e}g=e}}else if(T(n.charCodeAt(0))){break}else{t+=n}}if(l!==""){d({},i.UnexpectedToken,"ILLEGAL")}return{type:o.StringLiteral,value:t,octal:u,lineNumber:h,lineStart:g,range:[c,e]}}function st(){var t="",n,u,l,a,p,c,r,f;l=false;a=false;u=e;++e;while(e<y){n=s[e++];if(n==="`"){a=true;l=true;break}else if(n==="$"){if(s[e]==="{"){++e;l=true;break}t+=n}else if(n==="\\"){n=s[e++];if(!T(n.charCodeAt(0))){switch(n){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+=" ";break;case"u":case"x":if(s[e]==="{"){++e;t+=mt()}else{p=e;c=pn(n);if(c){t+=c}else{e=p;t+=n}}break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="";break;default:if(X(n)){r="01234567".indexOf(n);if(r!==0){f=true}if(e<y&&X(s[e])){f=true;r=r*8+"01234567".indexOf(s[e++]);if("0123".indexOf(n)>=0&&e<y&&X(s[e])){r=r*8+"01234567".indexOf(s[e++])}}t+=String.fromCharCode(r)}else{t+=n}break}}else{++h;if(n==="\r"&&s[e]==="\n"){++e}g=e}}else if(T(n.charCodeAt(0))){++h;if(n==="\r"&&s[e]==="\n"){++e}g=e;t+="\n"}else{t+=n}}if(!l){d({},i.UnexpectedToken,"ILLEGAL")}return{type:o.Template,value:{cooked:t,raw:s.slice(u+1,e-(a?1:2))},tail:a,octal:f,lineNumber:h,lineStart:g,range:[u,e]}}function Jt(r){var n,t;c=null;N();n=r.head?"`":"}";if(s[e]!==n){d({},i.UnexpectedToken,"ILLEGAL")}t=st();mn();return t}function F(){var t,n,v,l,r,a,m=false,u,x=false,p;c=null;N();v=e;n=s[e];J(n==="/","Regular expression literal must start with a slash");t=s[e++];while(e<y){n=s[e++];t+=n;if(m){if(n==="]"){m=false}}else{if(n==="\\"){n=s[e++];if(T(n.charCodeAt(0))){d({},i.UnterminatedRegExp)}t+=n}else if(n==="/"){x=true;break}else if(n==="["){m=true}else if(T(n.charCodeAt(0))){d({},i.UnterminatedRegExp)}}}if(!x){d({},i.UnterminatedRegExp)}l=t.substr(1,t.length-2);r="";while(e<y){n=s[e];if(!an(n.charCodeAt(0))){break}++e;if(n==="\\"&&e<y){n=s[e];if(n==="u"){++e;u=e;n=pn("u");if(n){r+=n;for(t+="\\u";u<e;++u){t+=s[u]}}else{e=u;r+="u";t+="\\u"}E({},i.UnexpectedToken,"ILLEGAL")}else{t+="\\"}}else{r+=n;t+=n}}p=l;if(r.indexOf("u")>=0){p=p.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(n,e){if(parseInt(e,16)<=1114111){return"x"}d({},i.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{a=new RegExp(p)}catch(b){d({},i.InvalidRegExp)}try{a=new RegExp(l,r)}catch(w){a=null}if(f.tokenize){return{type:o.RegularExpression,value:a,regex:{pattern:l,flags:r},lineNumber:h,lineStart:g,range:[v,e]}}return{literal:t,value:a,regex:{pattern:l,flags:r},range:[v,e]}}function Dn(e){return e.type===o.Identifier||e.type===o.Keyword||e.type===o.BooleanLiteral||e.type===o.NullLiteral}function kr(){var n,e;n=f.tokens[f.tokens.length-1];if(!n){return F()}if(n.type==="Punctuator"){if(n.value===")"){e=f.tokens[f.openParenToken-1];if(e&&e.type==="Keyword"&&(e.value==="if"||e.value==="while"||e.value==="for"||e.value==="with")){return F()}return U()}if(n.value==="}"){if(f.tokens[f.openCurlyToken-3]&&f.tokens[f.openCurlyToken-3].type==="Keyword"){e=f.tokens[f.openCurlyToken-4];if(!e){return U()}}else if(f.tokens[f.openCurlyToken-4]&&f.tokens[f.openCurlyToken-4].type==="Keyword"){e=f.tokens[f.openCurlyToken-5];if(!e){return F()}}else{return U()}if(bt.indexOf(e.value)>=0){return U()}return F()}return F()}if(n.type==="Keyword"){return F()}return U()}function en(){var n;if(!a.inXJSChild){N()}if(e>=y){return{type:o.EOF,lineNumber:h,lineStart:g,range:[e,e]}}if(a.inXJSChild){return Pr()}n=s.charCodeAt(e);if(n===40||n===41||n===58){return U()}if(n===39||n===34){if(a.inXJSTag){return Lr()}return Pt()}if(a.inXJSTag&&Ir(n)){return Cr()}if(n===96){return st()}if(W(n)){return gr()}if(n===46){if(B(s.charCodeAt(e+1))){return ft()}return U()}if(B(n)){return ft()}if(f.tokenize&&n===47){return kr()}return U()}function m(){var n;n=c;e=n.range[1];h=n.lineNumber;g=n.lineStart;c=en();e=n.range[1];h=n.lineNumber;g=n.lineStart;return n}function mn(){var n,t,r;n=e;t=h;r=g;c=en();e=n;h=t;g=r}function P(){var n,t,r,l,a;n=typeof f.advance==="function"?f.advance:en;t=e;r=h;l=g;if(c===null){c=n()}e=c.range[1];h=c.lineNumber;g=c.lineStart;a=n();e=t;h=r;g=l;return a}function dn(n){e=n.range[0];h=n.lineNumber;g=n.lineStart;c=n}function p(){if(!f.loc&&!f.range){return undefined}N();return{offset:e,line:h,col:e-g}}function it(){if(!f.loc&&!f.range){return undefined}return{offset:e,line:h,col:e-g}}function rr(e){var t,l,a=f.bottomRightStack,n=a[a.length-1];if(e.type===r.Program){if(e.body.length>0){return}}if(f.trailingComments.length>0){if(f.trailingComments[0].range[0]>=e.range[1]){l=f.trailingComments;f.trailingComments=[]}else{f.trailingComments.length=0}}else{if(n&&n.trailingComments&&n.trailingComments[0].range[0]>=e.range[1]){l=n.trailingComments;delete n.trailingComments}}if(n){while(n&&n.range[0]>=e.range[0]){t=n;n=a.pop()}}if(t){if(t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]){e.leadingComments=t.leadingComments;delete t.leadingComments}}else if(f.leadingComments.length>0&&f.leadingComments[f.leadingComments.length-1].range[1]<=e.range[0]){e.leadingComments=f.leadingComments;f.leadingComments=[]}if(l){e.trailingComments=l}a.push(e)}function t(t,n){if(f.range){n.range=[t.offset,e]}if(f.loc){n.loc={start:{line:t.line,column:t.col},end:{line:h,column:e-g}};n=l.postProcess(n)}if(f.attachComment){rr(n)}return n}kn={name:"SyntaxTree",postProcess:function(e){return e},createArrayExpression:function(e){return{type:r.ArrayExpression,elements:e}},createAssignmentExpression:function(e,n,t){return{type:r.AssignmentExpression,operator:e,left:n,right:t}},createBinaryExpression:function(e,n,t){var l=e==="||"||e==="&&"?r.LogicalExpression:r.BinaryExpression;return{type:l,operator:e,left:n,right:t}},createBlockStatement:function(e){return{type:r.BlockStatement,body:e}},createBreakStatement:function(e){return{type:r.BreakStatement,label:e}},createCallExpression:function(e,n){return{type:r.CallExpression,callee:e,arguments:n}},createCatchClause:function(e,n){return{type:r.CatchClause,param:e,body:n}},createConditionalExpression:function(e,n,t){return{type:r.ConditionalExpression,test:e,consequent:n,alternate:t}},createContinueStatement:function(e){return{type:r.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:r.DebuggerStatement}},createDoWhileStatement:function(e,n){return{type:r.DoWhileStatement,body:e,test:n}},createEmptyStatement:function(){return{type:r.EmptyStatement}},createExpressionStatement:function(e){return{type:r.ExpressionStatement,expression:e}},createForStatement:function(e,n,t,l){return{type:r.ForStatement,init:e,test:n,update:t,body:l}},createForInStatement:function(e,n,t){return{type:r.ForInStatement,left:e,right:n,body:t,each:false}},createForOfStatement:function(e,n,t){return{type:r.ForOfStatement,left:e,right:n,body:t}},createFunctionDeclaration:function(n,i,t,l,a,f,s,o,u,c){var e={type:r.FunctionDeclaration,id:n,params:i,defaults:t,body:l,rest:a,generator:f,expression:s,returnType:u,typeParameters:c};if(o){e.async=true}return e},createFunctionExpression:function(n,i,t,l,a,f,s,o,u,c){var e={type:r.FunctionExpression,id:n,params:i,defaults:t,body:l,rest:a,generator:f,expression:s,returnType:u,typeParameters:c};if(o){e.async=true}return e},createIdentifier:function(e){return{type:r.Identifier,name:e,typeAnnotation:undefined,optional:undefined}},createTypeAnnotation:function(e){return{type:r.TypeAnnotation,typeAnnotation:e}},createFunctionTypeAnnotation:function(e,n,t,l){return{type:r.FunctionTypeAnnotation,params:e,returnType:n,rest:t,typeParameters:l}},createFunctionTypeParam:function(e,n,t){return{type:r.FunctionTypeParam,name:e,typeAnnotation:n,optional:t}},createNullableTypeAnnotation:function(e){return{type:r.NullableTypeAnnotation,typeAnnotation:e}},createArrayTypeAnnotation:function(e){return{type:r.ArrayTypeAnnotation,elementType:e}},createGenericTypeAnnotation:function(e,n){return{type:r.GenericTypeAnnotation,id:e,typeParameters:n}},createQualifiedTypeIdentifier:function(e,n){return{type:r.QualifiedTypeIdentifier,qualification:e,id:n}},createTypeParameterDeclaration:function(e){return{type:r.TypeParameterDeclaration,params:e}},createTypeParameterInstantiation:function(e){return{type:r.TypeParameterInstantiation,params:e}},createAnyTypeAnnotation:function(){return{type:r.AnyTypeAnnotation}},createBooleanTypeAnnotation:function(){return{type:r.BooleanTypeAnnotation}},createNumberTypeAnnotation:function(){return{type:r.NumberTypeAnnotation}},createStringTypeAnnotation:function(){return{type:r.StringTypeAnnotation}},createStringLiteralTypeAnnotation:function(e){return{type:r.StringLiteralTypeAnnotation,value:e.value,raw:s.slice(e.range[0],e.range[1])}},createVoidTypeAnnotation:function(){return{type:r.VoidTypeAnnotation}},createTypeofTypeAnnotation:function(e){return{type:r.TypeofTypeAnnotation,argument:e}},createTupleTypeAnnotation:function(e){return{type:r.TupleTypeAnnotation,types:e}},createObjectTypeAnnotation:function(e,n,t){return{type:r.ObjectTypeAnnotation,properties:e,indexers:n,callProperties:t}},createObjectTypeIndexer:function(e,n,t,l){return{type:r.ObjectTypeIndexer,id:e,key:n,value:t,"static":l}},createObjectTypeCallProperty:function(e,n){return{type:r.ObjectTypeCallProperty,value:e,"static":n}},createObjectTypeProperty:function(e,n,t,l){return{type:r.ObjectTypeProperty,key:e,value:n,optional:t,"static":l}},createUnionTypeAnnotation:function(e){return{type:r.UnionTypeAnnotation,types:e}},createIntersectionTypeAnnotation:function(e){return{type:r.IntersectionTypeAnnotation,types:e}},createTypeAlias:function(e,n,t){return{type:r.TypeAlias,id:e,typeParameters:n,right:t}},createInterface:function(e,n,t,l){return{type:r.InterfaceDeclaration,id:e,typeParameters:n,body:t,"extends":l}},createInterfaceExtends:function(e,n){return{type:r.InterfaceExtends,id:e,typeParameters:n}},createDeclareFunction:function(e){return{type:r.DeclareFunction,id:e}},createDeclareVariable:function(e){return{type:r.DeclareVariable,id:e}},createDeclareModule:function(e,n){return{type:r.DeclareModule,id:e,body:n}},createXJSAttribute:function(e,n){return{type:r.XJSAttribute,name:e,value:n||null}},createXJSSpreadAttribute:function(e){return{type:r.XJSSpreadAttribute,argument:e}},createXJSIdentifier:function(e){return{type:r.XJSIdentifier,name:e}},createXJSNamespacedName:function(e,n){return{type:r.XJSNamespacedName,namespace:e,name:n}},createXJSMemberExpression:function(e,n){return{type:r.XJSMemberExpression,object:e,property:n}},createXJSElement:function(e,n,t){return{type:r.XJSElement,openingElement:e,closingElement:n,children:t}},createXJSEmptyExpression:function(){return{type:r.XJSEmptyExpression}},createXJSExpressionContainer:function(e){return{type:r.XJSExpressionContainer,expression:e}},createXJSOpeningElement:function(e,n,t){return{type:r.XJSOpeningElement,name:e,selfClosing:t,attributes:n}},createXJSClosingElement:function(e){return{type:r.XJSClosingElement,name:e}},createIfStatement:function(e,n,t){return{type:r.IfStatement,test:e,consequent:n,alternate:t}},createLabeledStatement:function(e,n){return{type:r.LabeledStatement,label:e,body:n}},createLiteral:function(e){var n={type:r.Literal,value:e.value,raw:s.slice(e.range[0],e.range[1])};if(e.regex){n.regex=e.regex}return n},createMemberExpression:function(e,n,t){return{type:r.MemberExpression,computed:e==="[",object:n,property:t}},createNewExpression:function(e,n){return{type:r.NewExpression,callee:e,arguments:n}},createObjectExpression:function(e){return{type:r.ObjectExpression,properties:e}},createPostfixExpression:function(e,n){return{type:r.UpdateExpression,operator:e,argument:n,prefix:false}},createProgram:function(e){return{type:r.Program,body:e}},createProperty:function(e,n,t,l,a,i){return{type:r.Property,key:n,value:t,kind:e,method:l,shorthand:a,computed:i}},createReturnStatement:function(e){return{type:r.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:r.SequenceExpression,expressions:e}},createSwitchCase:function(e,n){return{type:r.SwitchCase,test:e,consequent:n}},createSwitchStatement:function(e,n){return{type:r.SwitchStatement,discriminant:e,cases:n}},createThisExpression:function(){return{type:r.ThisExpression}},createThrowStatement:function(e){return{type:r.ThrowStatement,argument:e}},createTryStatement:function(e,n,t,l){return{type:r.TryStatement,block:e,guardedHandlers:n,handlers:t,finalizer:l}},createUnaryExpression:function(e,n){if(e==="++"||e==="--"){return{type:r.UpdateExpression,operator:e,argument:n,prefix:true}}return{type:r.UnaryExpression,operator:e,argument:n,prefix:true}},createVariableDeclaration:function(e,n){return{type:r.VariableDeclaration,declarations:e,kind:n}},createVariableDeclarator:function(e,n){return{type:r.VariableDeclarator,id:e,init:n}},createWhileStatement:function(e,n){return{type:r.WhileStatement,test:e,body:n}},createWithStatement:function(e,n){return{type:r.WithStatement,object:e,body:n}},createTemplateElement:function(e,n){return{type:r.TemplateElement,value:e,tail:n}},createTemplateLiteral:function(e,n){return{type:r.TemplateLiteral,quasis:e,expressions:n}},createSpreadElement:function(e){return{type:r.SpreadElement,argument:e}},createSpreadProperty:function(e){return{type:r.SpreadProperty,argument:e}},createTaggedTemplateExpression:function(e,n){return{type:r.TaggedTemplateExpression,tag:e,quasi:n}},createArrowFunctionExpression:function(n,t,l,a,i,s){var e={type:r.ArrowFunctionExpression,id:null,params:n,defaults:t,body:l,rest:a,generator:false,expression:i};if(s){e.async=true}return e},createMethodDefinition:function(e,n,t,l,a){return{type:r.MethodDefinition,key:t,value:l,kind:n,"static":e===tn.static,computed:a}},createClassProperty:function(e,n,t,l){return{type:r.ClassProperty,key:e,typeAnnotation:n,computed:t,"static":l}},createClassBody:function(e){return{type:r.ClassBody,body:e}},createClassImplements:function(e,n){return{type:r.ClassImplements,id:e,typeParameters:n}},createClassExpression:function(e,n,t,l,a,i){return{type:r.ClassExpression,id:e,superClass:n,body:t,typeParameters:l,superTypeParameters:a,"implements":i}},createClassDeclaration:function(e,n,t,l,a,i){return{type:r.ClassDeclaration,id:e,superClass:n,body:t,typeParameters:l,superTypeParameters:a,"implements":i}},createModuleSpecifier:function(e){return{type:r.ModuleSpecifier,value:e.value,raw:s.slice(e.range[0],e.range[1])}},createExportSpecifier:function(e,n){return{type:r.ExportSpecifier,id:e,name:n}},createExportBatchSpecifier:function(){return{type:r.ExportBatchSpecifier}},createImportDefaultSpecifier:function(e){return{type:r.ImportDefaultSpecifier,id:e}},createImportNamespaceSpecifier:function(e){return{type:r.ImportNamespaceSpecifier,id:e}},createExportDeclaration:function(e,n,t,l){return{type:r.ExportDeclaration,"default":!!e,declaration:n,specifiers:t,source:l}},createImportSpecifier:function(e,n){return{type:r.ImportSpecifier,id:e,name:n}},createImportDeclaration:function(e,n){return{type:r.ImportDeclaration,specifiers:e,source:n}},createYieldExpression:function(e,n){return{type:r.YieldExpression,argument:e,delegate:n}},createAwaitExpression:function(e){return{type:r.AwaitExpression,argument:e}},createComprehensionExpression:function(e,n,t){return{type:r.ComprehensionExpression,filter:e,blocks:n,body:t}}};function rn(){var t,n,r,l;t=e;n=h;r=g;N();l=h!==n;e=t;h=n;g=r;return l}function d(t,a){var n,l=Array.prototype.slice.call(arguments,2),r=a.replace(/%(\d)/g,function(n,e){J(e<l.length,"Message reference must be in range");return l[e]});if(typeof t.lineNumber==="number"){n=new Error("Line "+t.lineNumber+": "+r);n.index=t.range[0];n.lineNumber=t.lineNumber;n.column=t.range[0]-g+1}else{n=new Error("Line "+h+": "+r);n.index=e;n.lineNumber=h;n.column=e-g+1}n.description=r;throw n}function E(){try{d.apply(null,arguments)}catch(e){if(f.errors){f.errors.push(e)}else{throw e}}}function S(e){if(e.type===o.EOF){d(e,i.UnexpectedEOS)}if(e.type===o.NumericLiteral){d(e,i.UnexpectedNumber)}if(e.type===o.StringLiteral||e.type===o.XJSText){d(e,i.UnexpectedString)}if(e.type===o.Identifier){d(e,i.UnexpectedIdentifier)}if(e.type===o.Keyword){if(jr(e.value)){d(e,i.UnexpectedReserved)}else if(v&&ln(e.value)){E(e,i.StrictReservedWord);return}d(e,i.UnexpectedToken,e.value)}if(e.type===o.Template){d(e,i.UnexpectedTemplate,e.value.raw)}d(e,i.UnexpectedToken,e.value)}function u(n){var e=m();if(e.type!==o.Punctuator||e.value!==n){S(e)}}function x(n,t){var e=m();if(e.type!==(t?o.Identifier:o.Keyword)||e.value!==n){S(e)}}function V(e){return x(e,true)}function n(e){return c.type===o.Punctuator&&c.value===e}function b(e,n){var t=n?o.Identifier:o.Keyword;return c.type===t&&c.value===e}function _(e){return b(e,true)}function lr(){var e;if(c.type!==o.Punctuator){return false}e=c.value;return e==="="||e==="*="||e==="/="||e==="%="||e==="+="||e==="-="||e==="<<="||e===">>="||e===">>>="||e==="&="||e==="^="||e==="|="}function ir(){return a.yieldAllowed&&b("yield",!v)}function un(){var n=c,e=false;if(_("async")){m();e=!rn();dn(n)}return e}function or(){return a.awaitAllowed&&_("await")}function k(){var t,r=e,l=h,a=g,i=c;if(s.charCodeAt(e)===59){m();return}t=h;N();if(h!==t){e=r;h=l;g=a;c=i;return}if(n(";")){m();return}if(c.type!==o.EOF&&!n("}")){S(c)}}function gn(e){return e.type===r.Identifier||e.type===r.MemberExpression}function Tr(e){return gn(e)||e.type===r.ObjectPattern||e.type===r.ArrayPattern}function yn(){var a=[],s=[],h=null,e,f=true,y,g=p();u("[");while(!n("]")){if(c.value==="for"&&c.type===o.Keyword){if(!f){d({},i.ComprehensionError)}b("for");e=Zn({ignoreBody:true});e.of=e.type===r.ForOfStatement;e.type=r.ComprehensionBlock;if(e.left.kind){d({},i.ComprehensionError)}s.push(e)}else if(c.value==="if"&&c.type===o.Keyword){if(!f){d({},i.ComprehensionError)}x("if");u("(");h=w();u(")")}else if(c.value===","&&c.type===o.Punctuator){f=false;m();a.push(null)}else{e=jn();a.push(e);if(e&&e.type===r.SpreadElement){if(!n("]")){d({},i.ElementAfterSpreadElement)}}else if(!(n("]")||b("for")||b("if"))){u(",");f=false}}}u("]");if(h&&!s.length){d({},i.ComprehensionRequiresBlock)}if(s.length){if(a.length!==1){d({},i.ComprehensionError)}return t(g,l.createComprehensionExpression(h,s,a[0]))}return t(g,l.createArrayExpression(a))}function cn(e){var o,u,c,n,f,s,d=p();o=v;u=a.yieldAllowed;a.yieldAllowed=e.generator;c=a.awaitAllowed;a.awaitAllowed=e.async;n=e.params||[];f=e.defaults||[];s=nt();if(e.name&&v&&L(n[0].name)){E(e.name,i.StrictParamName)}v=o;a.yieldAllowed=u;a.awaitAllowed=c;return t(d,l.createFunctionExpression(null,n,f,s,e.rest||null,e.generator,s.type!==r.BlockStatement,e.async,e.returnType,e.typeParameters))}function Z(n){var t,e,r;t=v;v=true;e=hn();if(e.stricted){E(e.stricted,e.message)}r=cn({params:e.params,defaults:e.defaults,rest:e.rest,generator:n.generator,async:n.async,returnType:e.returnType,typeParameters:n.typeParameters});v=t;return r}function M(){var n=p(),e=m(),r,a;if(e.type===o.StringLiteral||e.type===o.NumericLiteral){if(v&&e.octal){E(e,i.StrictOctalLiteral)}return t(n,l.createLiteral(e))}if(e.type===o.Punctuator&&e.value==="["){n=p();r=R();a=t(n,r);u("]");return a}return t(n,l.createIdentifier(e.value))}function Zr(){var r,a,f,g,h,y,e,i=p(),d,s;r=c;e=r.value==="["&&r.type===o.Punctuator;if(r.type===o.Identifier||e||un()){f=M();if(n(":")){m();return t(i,l.createProperty("init",f,R(),false,false,e))}if(n("(")||n("<")){if(n("<")){s=C()}return t(i,l.createProperty("init",f,Z({generator:false,async:false,typeParameters:s}),true,false,e))}if(r.value==="get"){e=c.value==="[";a=M();u("(");u(")");if(n(":")){d=D()}return t(i,l.createProperty("get",a,cn({generator:false,async:false,returnType:d}),false,false,e))}if(r.value==="set"){e=c.value==="[";a=M();u("(");r=c;h=[Q()];u(")");if(n(":")){d=D()}return t(i,l.createProperty("set",a,cn({params:h,generator:false,async:false,name:r,returnType:d}),false,false,e))}if(r.value==="async"){e=c.value==="[";a=M();if(n("<")){s=C()}return t(i,l.createProperty("init",a,Z({generator:false,async:true,typeParameters:s}),true,false,e))}if(e){S(c)}return t(i,l.createProperty("init",f,f,false,true,false))}if(r.type===o.EOF||r.type===o.Punctuator){if(!n("*")){S(r)}m();e=c.type===o.Punctuator&&c.value==="[";f=M();if(n("<")){s=C()}if(!n("(")){S(m())}return t(i,l.createProperty("init",f,Z({generator:true,typeParameters:s}),true,false,e))}a=M();if(n(":")){m();return t(i,l.createProperty("init",a,R(),false,false,false))}if(n("(")||n("<")){if(n("<")){s=C()}return t(i,l.createProperty("init",a,Z({generator:false,typeParameters:s}),true,false,false))}S(m())}function ll(){var e=p();u("...");return t(e,l.createSpreadProperty(R()))}function At(e){var n=String;if(e.type===r.Identifier){return e.name}return n(e.value)}function _n(){var f=[],e,s,a,o,c=new O,d=p(),m=String;u("{");while(!n("}")){if(n("...")){e=ll()}else{e=Zr();if(e.key.type===r.Identifier){s=e.key.name}else{s=m(e.key.value)}a=e.kind==="init"?G.Data:e.kind==="get"?G.Get:G.Set;if(c.has(s)){o=c.get(s);if(o===G.Data){if(v&&a===G.Data){E({},i.StrictDuplicateProperty)}else if(a!==G.Data){E({},i.AccessorDataProperty)}}else{if(a===G.Data){E({},i.AccessorDataProperty)}else if(o&a){E({},i.AccessorGetSet)}}c.set(s,o|a)}else{c.set(s,a)}}f.push(e);if(!n("}")){u(",")}}u("}");return t(d,l.createObjectExpression(f))}function at(n){var r=p(),e=Jt(n);if(v&&e.octal){d(e,i.StrictOctalLiteral)}return t(r,l.createTemplateElement({raw:e.value.raw,cooked:e.value.cooked},e.tail))}function Cn(){var e,n,r,a=p();e=at({head:true});n=[e];r=[];while(!e.tail){r.push(w());e=at({head:false});n.push(e)}return t(a,l.createTemplateLiteral(n,r))}function nr(){var e;u("(");++a.parenthesizedCount;e=w();u(")");return e}function lt(){var e;if(un()){e=P();if(e.type===o.Keyword&&e.value==="function"){return true}}return false}function rt(){var e,r,a,s;r=c.type;if(r===o.Identifier){e=p();return t(e,l.createIdentifier(m().value))}if(r===o.StringLiteral||r===o.NumericLiteral){if(v&&c.octal){E(c,i.StrictOctalLiteral)}e=p();return t(e,l.createLiteral(m()))}if(r===o.Keyword){if(b("this")){e=p();m();return t(e,l.createThisExpression())}if(b("function")){return On()}if(b("class")){return ct()}if(b("super")){e=p();m();return t(e,l.createIdentifier("super"))}}if(r===o.BooleanLiteral){e=p();a=m();a.value=a.value==="true";return t(e,l.createLiteral(a))}if(r===o.NullLiteral){e=p();a=m();a.value=null;return t(e,l.createLiteral(a))}if(n("[")){return yn()}if(n("{")){return _n()}if(n("(")){return nr()}if(n("/")||n("/=")){e=p();s=l.createLiteral(F());mn();return t(e,s)}if(r===o.Template){return Cn()}if(n("<")){return Mn()}S(m())}function tt(){var l=[],t;u("(");if(!n(")")){while(e<y){t=jn();l.push(t);if(n(")")){break}else if(t.type===r.SpreadElement){d({},i.ElementAfterSpreadElement)}u(",")}}u(")");return l}function jn(){if(n("...")){var e=p();m();return t(e,l.createSpreadElement(R()))}return R()}function H(){var n=p(),e=m();if(!Dn(e)){S(e)}return t(n,l.createIdentifier(e.value))}function et(){u(".");return H()}function $n(){var e;u("[");e=w();u("]");return e}function Yn(){var e,r,a=p();x("new");e=Dr();r=n("(")?tt():[];return t(a,l.createNewExpression(e,r))}function Fn(){var e,a,r=p();e=b("new")?Yn():rt();while(n(".")||n("[")||n("(")||c.type===o.Template){if(n("(")){a=tt();e=t(r,l.createCallExpression(e,a))}else if(n("[")){e=t(r,l.createMemberExpression("[",e,$n()))}else if(n(".")){e=t(r,l.createMemberExpression(".",e,et()))}else{e=t(r,l.createTaggedTemplateExpression(e,Cn()))}}return e}function Dr(){var e,r=p();e=b("new")?Yn():rt();while(n(".")||n("[")||c.type===o.Template){if(n("[")){e=t(r,l.createMemberExpression("[",e,$n()))}else if(n(".")){e=t(r,l.createMemberExpression(".",e,et()))}else{e=t(r,l.createTaggedTemplateExpression(e,Cn()))}}return e}function zn(){var s=p(),e=Fn(),a;if(c.type!==o.Punctuator){return e}if((n("++")||n("--"))&&!rn()){if(v&&e.type===r.Identifier&&L(e.name)){E({},i.StrictLHSPostfix)}if(!gn(e)){d({},i.InvalidLHSInAssignment)}a=m();e=t(s,l.createPostfixExpression(a.value,e))}return e}function K(){var a,s,e;if(c.type!==o.Punctuator&&c.type!==o.Keyword){return zn()}if(n("++")||n("--")){a=p();s=m();e=K();if(v&&e.type===r.Identifier&&L(e.name)){E({},i.StrictLHSPrefix)}if(!gn(e)){d({},i.InvalidLHSInAssignment)}return t(a,l.createUnaryExpression(s.value,e))}if(n("+")||n("-")||n("~")||n("!")){a=p();s=m();e=K();return t(a,l.createUnaryExpression(s.value,e))}if(b("delete")||b("void")||b("typeof")){a=p();s=m();e=K();e=t(a,l.createUnaryExpression(s.value,e));if(v&&e.operator==="delete"&&e.argument.type===r.Identifier){E({},i.StrictDelete)}return e}return zn()}function Hn(n,t){var e=0;if(n.type!==o.Punctuator&&n.type!==o.Keyword){return 0}switch(n.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":e=7;break;case"in":e=t?7:0;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break;default:break}return e}function Qr(){var n,i,u,d,e,h,g,f,o,r,s;d=a.allowIn;a.allowIn=true;r=p();f=K();i=c;u=Hn(i,d);if(u===0){return f}i.prec=u;m();s=[r,p()];h=K();e=[f,i,h];while((u=Hn(c,d))>0){while(e.length>2&&u<=e[e.length-2].prec){h=e.pop();g=e.pop().value;f=e.pop();n=l.createBinaryExpression(g,f,h);s.pop();r=s.pop();t(r,n);e.push(n);s.push(r)}i=m();i.prec=u;e.push(i);s.push(p());n=K();e.push(n)}a.allowIn=d;o=e.length-1;n=e[o];s.pop();while(o>1){n=l.createBinaryExpression(e[o-1].value,e[o-2],n);o-=2;r=s.pop();t(r,n)}return n}function Wn(){var e,r,i,s,o=p();e=Qr();if(n("?")){m();r=a.allowIn;a.allowIn=true;i=R();a.allowIn=r;u(":");s=R();e=t(o,l.createConditionalExpression(e,i,s))}return e}function z(e){var n,t,l,a;if(e.type===r.ObjectExpression){e.type=r.ObjectPattern;for(n=0,t=e.properties.length;n<t;n+=1){l=e.properties[n];if(l.type===r.SpreadProperty){if(n<t-1){d({},i.PropertyAfterSpreadProperty)}z(l.argument)}else{if(l.kind!=="init"){d({},i.InvalidLHSInAssignment)}z(l.value)}}}else if(e.type===r.ArrayExpression){e.type=r.ArrayPattern;for(n=0,t=e.elements.length;n<t;n+=1){a=e.elements[n];if(a){z(a)}}}else if(e.type===r.Identifier){if(L(e.name)){d({},i.InvalidLHSInAssignment)}}else if(e.type===r.SpreadElement){z(e.argument);if(e.argument.type===r.ObjectPattern){d({},i.ObjectPatternAsSpread)}}else{if(e.type!==r.MemberExpression&&e.type!==r.CallExpression&&e.type!==r.NewExpression){d({},i.InvalidLHSInAssignment)}}}function Y(t,e){var n,l,a,s;if(e.type===r.ObjectExpression){e.type=r.ObjectPattern;for(n=0,l=e.properties.length;n<l;n+=1){a=e.properties[n];if(a.type===r.SpreadProperty){if(n<l-1){d({},i.PropertyAfterSpreadProperty)}Y(t,a.argument)}else{if(a.kind!=="init"){d({},i.InvalidLHSInFormalsList)}Y(t,a.value)}}}else if(e.type===r.ArrayExpression){e.type=r.ArrayPattern;for(n=0,l=e.elements.length;n<l;n+=1){s=e.elements[n];if(s){Y(t,s)}}}else if(e.type===r.Identifier){sn(t,e,e.name)}else if(e.type===r.SpreadElement){if(e.argument.type!==r.Identifier){d({},i.InvalidLHSInFormalsList)}sn(t,e.argument,e.argument.name)}else{d({},i.InvalidLHSInFormalsList)}}function Tn(c){var l,s,e,a,t,o,n,u;a=[];t=[];o=0;u=null;n={paramSet:new O};for(l=0,s=c.length;l<s;l+=1){e=c[l];if(e.type===r.Identifier){a.push(e);t.push(null);sn(n,e,e.name)}else if(e.type===r.ObjectExpression||e.type===r.ArrayExpression){Y(n,e);a.push(e);t.push(null)}else if(e.type===r.SpreadElement){J(l===s-1,"It is guaranteed that SpreadElement is last element by parseExpression");if(e.argument.type!==r.Identifier){d({},i.InvalidLHSInFormalsList)}Y(n,e.argument);u=e.argument}else if(e.type===r.AssignmentExpression){a.push(e.left);t.push(e.right);++o;sn(n,e.left,e.left.name)}else{return null}}if(n.message===i.StrictParamDupe){d(v?n.stricted:n.firstRestricted,n.message)}if(o===0){t=[]}return{params:a,defaults:t,rest:u,stricted:n.stricted,firstRestricted:n.firstRestricted,message:n.message}}function Ln(e,c){var i,s,o,n;u("=>");i=v;s=a.yieldAllowed;a.yieldAllowed=false;o=a.awaitAllowed;a.awaitAllowed=!!e.async;n=nt();if(v&&e.firstRestricted){d(e.firstRestricted,e.message)}if(v&&e.stricted){E(e.stricted,e.message)}v=i;a.yieldAllowed=s;a.awaitAllowed=o;return t(c,l.createArrowFunctionExpression(e.params,e.defaults,n,e.rest,n.type!==r.BlockStatement,!!e.async))}function R(){var h,e,u,s,g,y=c,f=false;if(ir()){return ur()}if(or()){return cr()}g=a.parenthesizedCount;h=p();if(lt()){return On()}if(un()){f=true;m()}if(n("(")){u=P();if(u.type===o.Punctuator&&u.value===")"||u.value==="..."){s=hn();if(!n("=>")){S(m())}s.async=f;return Ln(s,h)}}u=c;if(f&&!n("(")&&u.type!==o.Identifier){f=false;dn(y)}e=Wn();if(n("=>")&&(a.parenthesizedCount===g||a.parenthesizedCount===g+1)){if(e.type===r.Identifier){s=Tn([e])}else if(e.type===r.SequenceExpression){s=Tn(e.expressions)}if(s){s.async=f;return Ln(s,h)}}if(f){f=false;dn(y);e=Wn()}if(lr()){if(v&&e.type===r.Identifier&&L(e.name)){E(u,i.StrictLHSAssignment)}if(n("=")&&(e.type===r.ObjectExpression||e.type===r.ArrayExpression)){z(e)}else if(!gn(e)){d({},i.InvalidLHSInAssignment)}e=t(h,l.createAssignmentExpression(m().value,e,R()))}return e}function w(){var u,s,o,h,c,g,f;f=a.parenthesizedCount;u=p();s=R();o=[s];if(n(",")){while(e<y){if(!n(",")){break}m();s=jn();o.push(s);if(s.type===r.SpreadElement){g=true;if(!n(")")){d({},i.ElementAfterSpreadElement)}break}}h=t(u,l.createSequenceExpression(o))}if(n("=>")){if(a.parenthesizedCount===f||a.parenthesizedCount===f+1){s=s.type===r.SequenceExpression?s.expressions:o;c=Tn(s);if(c){return Ln(c,u)}}S(m())}if(g&&P().value!=="=>"){d({},i.IllegalSpread)}return h||s}function tr(){var r=[],t;while(e<y){if(n("}")){break}t=$();if(typeof t==="undefined"){break}r.push(t)}return r}function xn(){var e,n=p();u("{");e=tr();u("}");return t(n,l.createBlockStatement(e))}function C(){var r=p(),e=[];u("<");while(!n(">")){e.push(I());if(!n(">")){u(",")}}u(">");return t(r,l.createTypeParameterDeclaration(e))}function fn(){var r=p(),i=a.inType,e=[];a.inType=true;u("<");while(!n(">")){e.push(j());if(!n(">")){u(",")}}u(">");a.inType=i;return t(r,l.createTypeParameterInstantiation(e))}function ol(a,i){var e,n,r;u("[");e=M();u(":");n=j();u("]");u(":");r=j();return t(a,l.createObjectTypeIndexer(e,n,r,i))}function Gn(s){var e=[],r=null,a,i=null;if(n("<")){i=C()}u("(");while(c.type===o.Identifier){e.push(Sn());if(!n(")")){u(",")}}if(n("...")){m();r=Sn()}u(")");u(":");a=j();return t(s,l.createFunctionTypeAnnotation(e,a,r,i))}function fr(e,r,a){var i=false,n;n=Gn(e);return t(e,l.createObjectTypeProperty(a,n,i,r))}function hr(e,n){var r=p();return t(e,l.createObjectTypeCallProperty(Gn(r),n))}function ot(y){var f=[],g=[],e,d=false,s=[],v,a,h,o,r;u("{");while(!n("}")){e=p();if(y&&_("static")){o=m();r=true}if(n("[")){g.push(ol(e,r))}else if(n("(")||n("<")){f.push(hr(e,y))}else{if(r&&n(":")){a=t(e,l.createIdentifier(o));E(o,i.StrictReservedWord)}else{a=M()}if(n("<")||n("(")){s.push(fr(e,r,a))}else{if(n("?")){m();d=true}u(":");h=j();s.push(t(e,l.createObjectTypeProperty(a,h,d,r)))}}if(n(";")){m()}else if(!n("}")){S(c)}}u("}");return l.createObjectTypeAnnotation(s,g,f)}function yr(){var r=p(),i=null,a=null,e,s=p;e=I();while(n(".")){u(".");e=t(r,l.createQualifiedTypeIdentifier(e,I()))}if(n("<")){a=fn()}return t(r,l.createGenericTypeAnnotation(e,a))}function xr(){var e=p();x("void");return t(e,l.createVoidTypeAnnotation())}function br(){var e,n=p();x("typeof");e=qn();return t(n,l.createTypeofTypeAnnotation(e))}function _r(){var a=p(),r=[];u("[");while(e<y&&!n("]")){r.push(j());if(n("]")){break}u(",")}u("]");return t(a,l.createTupleTypeAnnotation(r))}function Sn(){var i=p(),e,r=false,a;e=I();if(n("?")){m();r=true}u(":");a=j();return t(i,l.createFunctionTypeParam(e,a,r))}function Vn(){var e={params:[],rest:null};while(c.type===o.Identifier){e.params.push(Sn());
if(!n(")")){u(",")}}if(n("...")){m();e.rest=Sn()}return e}function qn(){var x=null,s=null,f=null,e=p(),h=null,a,y,r,v,g=false;switch(c.type){case o.Identifier:switch(c.value){case"any":m();return t(e,l.createAnyTypeAnnotation());case"bool":case"boolean":m();return t(e,l.createBooleanTypeAnnotation());case"number":m();return t(e,l.createNumberTypeAnnotation());case"string":m();return t(e,l.createStringTypeAnnotation())}return t(e,yr());case o.Punctuator:switch(c.value){case"{":return t(e,ot());case"[":return _r();case"<":y=C();u("(");a=Vn();s=a.params;h=a.rest;u(")");u("=>");f=j();return t(e,l.createFunctionTypeAnnotation(s,f,h,y));case"(":m();if(!n(")")&&!n("...")){if(c.type===o.Identifier){r=P();g=r.value!=="?"&&r.value!==":"}else{g=true}}if(g){v=j();u(")");if(n("=>")){d({},i.ConfusedAboutFunctionType)}return v}a=Vn();s=a.params;h=a.rest;u(")");u("=>");f=j();return t(e,l.createFunctionTypeAnnotation(s,f,h,null))}break;case o.Keyword:switch(c.value){case"void":return t(e,xr());case"typeof":return t(e,br())}break;case o.StringLiteral:r=m();if(r.octal){d(r,i.StrictOctalLiteral)}return t(e,l.createStringLiteralTypeAnnotation(r))}S(c)}function Mr(){var r=p(),e=qn();if(n("[")){u("[");u("]");return t(r,l.createArrayTypeAnnotation(e))}return e}function Bn(){var e=p();if(n("?")){m();return t(e,l.createNullableTypeAnnotation(Bn()))}return Mr()}function Jn(){var a=p(),r,e;r=Bn();e=[r];while(n("&")){m();e.push(Bn())}return e.length===1?r:t(a,l.createIntersectionTypeAnnotation(e))}function Wr(){var a=p(),r,e;r=Jn();e=[r];while(n("|")){m();e.push(Jn())}return e.length===1?r:t(a,l.createUnionTypeAnnotation(e))}function j(){var n=a.inType,e;a.inType=true;e=Wr();a.inType=n;return e}function D(){var n=p(),e;u(":");e=j();return t(n,l.createTypeAnnotation(e))}function I(){var n=p(),e=m();if(e.type!==o.Identifier){S(e)}return t(n,l.createIdentifier(e.value))}function Q(a,i){var r=p(),e=I(),l=false;if(i&&n("?")){u("?");l=true}if(a||n(":")){e.typeAnnotation=D();e=t(r,e)}if(l){e.optional=true;e=t(r,e)}return e}function rl(o){var e,c=p(),r=null,s=p();if(n("{")){e=_n();z(e);if(n(":")){e.typeAnnotation=D();t(s,e)}}else if(n("[")){e=yn();z(e);if(n(":")){e.typeAnnotation=D();t(s,e)}}else{e=a.allowKeyword?H():Q();if(v&&L(e.name)){E({},i.StrictVarName)}}if(o==="const"){if(!n("=")){d({},i.NoUnintializedConst)}u("=");r=R()}else if(n("=")){m();r=R()}return t(c,l.createVariableDeclarator(e,r))}function Nn(r){var t=[];do{t.push(rl(r));if(!n(",")){break}m()}while(e<y);return t}function al(){var e,n=p();x("var");e=Nn();k();return t(n,l.createVariableDeclaration(e,"var"))}function Ct(e){var n,r=p();x(e);n=Nn(e);k();return t(r,l.createVariableDeclaration(n,e))}function bn(){var n=p(),e;if(c.type!==o.StringLiteral){d({},i.InvalidModuleSpecifier)}e=l.createModuleSpecifier(c);m();return t(n,e)}function Tt(){var e=p();u("*");return t(e,l.createExportBatchSpecifier())}function Lt(){var e,n=null,r=p(),a;if(b("default")){m();e=t(r,l.createIdentifier("default"))}else{e=I()}if(_("as")){m();n=H()}return t(r,l.createExportSpecifier(e,n))}function Kn(){var f,g,y,r=null,h,s=null,a=[],e=p();x("export");if(b("default")){m();if(b("function")||b("class")){f=c;m();if(Dn(c)){g=H();dn(f);return t(e,l.createExportDeclaration(true,$(),[g],null))}dn(f);switch(c.value){case"class":return t(e,l.createExportDeclaration(true,ct(),[],null));case"function":return t(e,l.createExportDeclaration(true,On(),[],null))}}if(_("from")){d({},i.UnexpectedToken,c.value)}if(n("{")){r=_n()}else if(n("[")){r=yn()}else{r=R()}k();return t(e,l.createExportDeclaration(true,r,[],null))}if(c.type===o.Keyword){switch(c.value){case"let":case"const":case"var":case"class":case"function":return t(e,l.createExportDeclaration(false,$(),a,null))}}if(n("*")){a.push(Tt());if(!_("from")){d({},c.value?i.UnexpectedToken:i.MissingFromClause,c.value)}m();s=bn();k();return t(e,l.createExportDeclaration(false,null,a,s))}u("{");if(!n("}")){do{h=h||b("default");a.push(Lt())}while(n(",")&&m())}u("}");if(_("from")){m();s=bn();k()}else if(h){d({},c.value?i.UnexpectedToken:i.MissingFromClause,c.value)}else{k()}return t(e,l.createExportDeclaration(false,r,a,s))}function jt(){var e,n=null,r=p();e=H();if(_("as")){m();n=I()}return t(r,l.createImportSpecifier(e,n))}function Mt(){var e=[];u("{");if(!n("}")){do{e.push(jt())}while(n(",")&&m())}u("}");return e}function Ot(){var e,n=p();e=H();return t(n,l.createImportDefaultSpecifier(e))}function Dt(){var e,n=p();u("*");if(!_("as")){d({},i.NoAsAfterImportNamespace)}m();e=H();return t(n,l.createImportNamespaceSpecifier(e))}function Qn(){var e,r,a=p();x("import");e=[];if(c.type===o.StringLiteral){r=bn();k();return t(a,l.createImportDeclaration(e,r))}if(!b("default")&&Dn(c)){e.push(Ot());if(n(",")){m()}}if(n("*")){e.push(Dt())}else if(n("{")){e=e.concat(Mt())}if(!_("from")){d({},c.value?i.UnexpectedToken:i.MissingFromClause,c.value)}m();r=bn();k();return t(a,l.createImportDeclaration(e,r))}function Ft(){var e=p();u(";");return t(e,l.createEmptyStatement())}function Bt(){var e=p(),n=w();k();return t(e,l.createExpressionStatement(n))}function Ut(){var n,r,e,a=p();x("if");u("(");n=w();u(")");r=q();if(b("else")){m();e=q()}else{e=null}return t(a,l.createIfStatement(n,r,e))}function Vt(){var e,r,i,s=p();x("do");i=a.inIteration;a.inIteration=true;e=q();a.inIteration=i;x("while");u("(");r=w();u(")");if(n(";")){m()}return t(s,l.createDoWhileStatement(e,r))}function Xt(){var e,n,r,i=p();x("while");u("(");e=w();u(")");r=a.inIteration;a.inIteration=true;n=q();a.inIteration=r;return t(i,l.createWhileStatement(e,n))}function qt(){var e=p(),n=m(),r=Nn();return t(e,l.createVariableDeclaration(r,n.value))}function Zn(v){var e,h,g,r,s,f,o,E,y=p();e=h=g=null;x("for");if(_("each")){d({},i.EachNotAllowed)}u("(");if(n(";")){m()}else{if(b("var")||b("let")||b("const")){a.allowIn=false;e=qt();a.allowIn=true;if(e.declarations.length===1){if(b("in")||_("of")){o=c;if(!((o.value==="in"||e.kind!=="var")&&e.declarations[0].init)){m();r=e;s=w();e=null}}}}else{a.allowIn=false;e=w();a.allowIn=true;if(_("of")){o=m();r=e;s=w();e=null}else if(b("in")){if(!Tr(e)){d({},i.InvalidLHSInForIn)}o=m();r=e;s=w();e=null}}if(typeof r==="undefined"){u(";")}}if(typeof r==="undefined"){if(!n(";")){h=w()}u(";");if(!n(")")){g=w()}}u(")");E=a.inIteration;a.inIteration=true;if(!(v!==undefined&&v.ignoreBody)){f=q()}a.inIteration=E;if(typeof r==="undefined"){return t(y,l.createForStatement(e,h,g,f))}if(o.value==="in"){return t(y,l.createForInStatement(r,s,f))}return t(y,l.createForOfStatement(r,s,f))}function Gt(){var n=null,r=p();x("continue");if(s.charCodeAt(e)===59){m();if(!a.inIteration){d({},i.IllegalContinue)}return t(r,l.createContinueStatement(null))}if(rn()){if(!a.inIteration){d({},i.IllegalContinue)}return t(r,l.createContinueStatement(null))}if(c.type===o.Identifier){n=I();if(!a.labelSet.has(n.name)){d({},i.UnknownLabel,n.name)}}k();if(n===null&&!a.inIteration){d({},i.IllegalContinue)}return t(r,l.createContinueStatement(n))}function Wt(){var n=null,r=p();x("break");if(s.charCodeAt(e)===59){m();if(!(a.inIteration||a.inSwitch)){d({},i.IllegalBreak)}return t(r,l.createBreakStatement(null))}if(rn()){if(!(a.inIteration||a.inSwitch)){d({},i.IllegalBreak)}return t(r,l.createBreakStatement(null))}if(c.type===o.Identifier){n=I();if(!a.labelSet.has(n.name)){d({},i.UnknownLabel,n.name)}}k();if(n===null&&!(a.inIteration||a.inSwitch)){d({},i.IllegalBreak)}return t(r,l.createBreakStatement(n))}function Ht(){var r=null,u=p();x("return");if(!a.inFunctionBody){E({},i.IllegalReturn)}if(s.charCodeAt(e)===32){if(W(s.charCodeAt(e+1))){r=w();k();return t(u,l.createReturnStatement(r))}}if(rn()){return t(u,l.createReturnStatement(null))}if(!n(";")){if(!n("}")&&c.type!==o.EOF){r=w()}}k();return t(u,l.createReturnStatement(r))}function zt(){var e,n,r=p();if(v){E({},i.StrictModeWith)}x("with");u("(");e=w();u(")");n=q();return t(r,l.createWithStatement(e,n))}function Yt(){var r,i=[],a,s=p();if(b("default")){m();r=null}else{x("case");r=w()}u(":");while(e<y){if(n("}")||b("default")||b("case")){break}a=$();if(typeof a==="undefined"){break}i.push(a)}return t(s,l.createSwitchCase(r,i))}function $t(){var s,r,o,f,c,h=p();x("switch");u("(");s=w();u(")");u("{");r=[];if(n("}")){m();return t(h,l.createSwitchStatement(s,r))}f=a.inSwitch;a.inSwitch=true;c=false;while(e<y){if(n("}")){break}o=Yt();if(o.test===null){if(c){d({},i.MultipleDefaultsInSwitch)}c=true}r.push(o)}a.inSwitch=f;u("}");return t(h,l.createSwitchStatement(s,r))}function Kt(){var e,n=p();x("throw");if(rn()){d({},i.NewlineAfterThrow)}e=w();k();return t(n,l.createThrowStatement(e))}function Qt(){var e,a,s=p();x("catch");u("(");if(n(")")){S(c)}e=w();if(v&&e.type===r.Identifier&&L(e.name)){E({},i.StrictCatchVariable)}u(")");a=xn();return t(s,l.createCatchClause(e,a))}function Zt(){var r,e=[],n=null,a=p();x("try");r=xn();if(b("catch")){e.push(Qt())}if(b("finally")){m();n=xn()}if(e.length===0&&!n){d({},i.NoCatchOrFinally)}return t(a,l.createTryStatement(r,[],e,n))}function er(){var e=p();x("debugger");k();return t(e,l.createDebuggerStatement())}function q(){var s=c.type,u,e,f;if(s===o.EOF){S(c)}if(s===o.Punctuator){switch(c.value){case";":return Ft();case"{":return xn();case"(":return Bt();default:break}}if(s===o.Keyword){switch(c.value){case"break":return Wt();case"continue":return Gt();case"debugger":return er();case"do":return Vt();case"for":return Zn();case"function":return In();case"class":return vr();case"if":return Ut();case"return":return Ht();case"switch":return $t();case"throw":return Kt();case"try":return Zt();case"var":return al();case"while":return Xt();case"with":return zt();default:break}}if(lt()){return In()}u=p();e=w();if(e.type===r.Identifier&&n(":")){m();if(a.labelSet.has(e.name)){d({},i.Redeclaration,"Label",e.name)}a.labelSet.set(e.name,true);f=q();a.labelSet["delete"](e.name);return t(u,l.createLabeledStatement(e,f))}k();return t(u,l.createExpressionStatement(e))}function nt(){if(n("{")){return Pn()}return R()}function Pn(){var f,h=[],d,x,m,g,b,w,_,S,k=p();u("{");while(e<y){if(c.type!==o.StringLiteral){break}d=c;f=$();h.push(f);if(f.expression.type!==r.Literal){break}x=s.slice(d.range[0]+1,d.range[1]-1);if(x==="use strict"){v=true;if(m){E(m,i.StrictOctalLiteral)}}else{if(!m&&d.octal){m=d}}}g=a.labelSet;b=a.inIteration;w=a.inSwitch;_=a.inFunctionBody;S=a.parenthesizedCount;a.labelSet=new O;a.inIteration=false;a.inSwitch=false;a.inFunctionBody=true;a.parenthesizedCount=0;while(e<y){if(n("}")){break}f=$();if(typeof f==="undefined"){break}h.push(f)}u("}");a.labelSet=g;a.inIteration=b;a.inSwitch=w;a.inFunctionBody=_;a.parenthesizedCount=S;return t(k,l.createBlockStatement(h))}function sn(e,t,n){if(v){if(L(n)){e.stricted=t;e.message=i.StrictParamName}if(e.paramSet.has(n)){e.stricted=t;e.message=i.StrictParamDupe}}else if(!e.firstRestricted){if(L(n)){e.firstRestricted=t;e.message=i.StrictParamName}else if(ln(n)){e.firstRestricted=t;e.message=i.StrictReservedWord}else if(e.paramSet.has(n)){e.firstRestricted=t;e.message=i.StrictParamDupe}}e.paramSet.set(n,true)}function ar(r){var s,l,a,e,o;l=c;if(l.value==="..."){l=m();a=true}if(n("[")){s=p();e=yn();Y(r,e);if(n(":")){e.typeAnnotation=D();t(s,e)}}else if(n("{")){s=p();if(a){d({},i.ObjectPatternAsRestParameter)}e=_n();Y(r,e);if(n(":")){e.typeAnnotation=D();t(s,e)}}else{e=a?Q(false,false):Q(false,true);sn(r,l,l.value)}if(n("=")){if(a){E(c,i.DefaultRestParameter)}m();o=R();++r.defaultCount}if(a){if(!n(")")){d({},i.ParameterAfterRestParameter)}r.rest=e;return false}r.params.push(e);r.defaults.push(o);return!n(")")}function hn(l){var r,a=p();r={params:[],defaultCount:0,defaults:[],rest:null,firstRestricted:l};u("(");if(!n(")")){r.paramSet=new O;while(e<y){if(!ar(r)){break}u(",")}}u(")");if(r.defaultCount===0){r.defaults=[]}if(n(":")){r.returnType=D()}return t(a,r)}function In(){var g,h,r,e,s,o,u,f,y,b,w,S=p(),_;f=false;if(un()){m();f=true}x("function");u=false;if(n("*")){m();u=true}r=c;g=I();if(n("<")){_=C()}if(v){if(L(r.value)){E(r,i.StrictFunctionName)}}else{if(L(r.value)){s=r;o=i.StrictFunctionName}else if(ln(r.value)){s=r;o=i.StrictReservedWord}}e=hn(s);s=e.firstRestricted;if(e.message){o=e.message}y=v;b=a.yieldAllowed;a.yieldAllowed=u;w=a.awaitAllowed;a.awaitAllowed=f;h=Pn();if(v&&s){d(s,o)}if(v&&e.stricted){E(e.stricted,o)}v=y;a.yieldAllowed=b;a.awaitAllowed=w;return t(S,l.createFunctionDeclaration(g,e.params,e.defaults,h,e.rest,u,false,f,e.returnType,_))}function On(){var r,h=null,s,o,e,g,u,f,y,b,w,S=p(),_;f=false;if(un()){m();f=true}x("function");u=false;if(n("*")){m();u=true}if(!n("(")){if(!n("<")){r=c;h=I();if(v){if(L(r.value)){E(r,i.StrictFunctionName)}}else{if(L(r.value)){s=r;o=i.StrictFunctionName}else if(ln(r.value)){s=r;o=i.StrictReservedWord}}}if(n("<")){_=C()}}e=hn(s);s=e.firstRestricted;if(e.message){o=e.message}y=v;b=a.yieldAllowed;a.yieldAllowed=u;w=a.awaitAllowed;a.awaitAllowed=f;g=Pn();if(v&&s){d(s,o)}if(v&&e.stricted){E(e.stricted,o)}v=y;a.yieldAllowed=b;a.awaitAllowed=w;return t(S,l.createFunctionExpression(h,e.params,e.defaults,g,e.rest,u,false,f,e.returnType,_))}function ur(){var e,r,a=p();x("yield",!v);e=false;if(n("*")){m();e=true}r=R();return t(a,l.createYieldExpression(r,e))}function cr(){var e,n=p();V("await");e=R();return t(n,l.createAwaitExpression(e))}function An(r,s,n){var e,l,t,a;t=At(s);if(r.has(t)){e=r.get(t);if(n==="data"){a=false}else{if(n==="get"){l="set"}else{l="get"}a=e[n]===undefined&&e.data===undefined&&e[l]!==undefined}if(!a){d(s,i.IllegalDuplicateClassProperty)}}else{e={get:undefined,set:undefined,data:undefined};r.set(t,e)}e[n]=true}function pr(g,e,h,m,t){var p,f,r,y=false,o,d,a,s,v,i;r=h?tn.static:tn.prototype;i=g[r];if(m){return l.createMethodDefinition(r,"",e,Z({generator:true}),t)}a=e.type==="Identifier"&&e.name;if(a==="get"&&!n("(")){e=M();if(!t){An(i,e,"get")}u("(");u(")");if(n(":")){s=D()}return l.createMethodDefinition(r,"get",e,cn({generator:false,returnType:s}),t)}if(a==="set"&&!n("(")){e=M();if(!t){An(i,e,"set")}u("(");p=c;f=[Q()];u(")");if(n(":")){s=D()}return l.createMethodDefinition(r,"set",e,cn({params:f,generator:false,name:p,returnType:s}),t)}if(n("<")){d=C()}o=a==="async"&&!n("(");if(o){e=M()}if(!t){An(i,e,"data")}return l.createMethodDefinition(r,"",e,Z({generator:false,async:o,typeParameters:d}),t)}function dr(a,n,t,r){var e;e=D();u(";");return l.createClassProperty(n,e,t,r)}function mr(s){var r=false,l=false,a,u=p(),i=false,e;if(n(";")){m();return}if(c.value==="static"){m();i=true}if(n("*")){m();l=true}e=c;if(_("get")||_("set")){e=P()}if(e.type===o.Punctuator&&e.value==="["){r=true}a=M();if(!l&&c.value===":"){return t(u,dr(s,a,r,i))}return t(u,pr(s,a,i,l,r))}function Xn(){var r,i=[],a={},s=p();a[tn.static]=new O;a[tn.prototype]=new O;u("{");while(e<y){if(n("}")){break}r=mr(a);if(typeof r!=="undefined"){i.push(r)}}u("}");return t(s,l.createClassBody(i))}function ut(){var a,i=[],s,r;V("implements");while(e<y){s=p();a=I();if(n("<")){r=fn()}else{r=null}i.push(t(s,l.createClassImplements(a,r)));if(!n(",")){break}u(",")}return i}function ct(){var e,r,i,s=null,o,c=p(),u;x("class");if(!b("extends")&&!_("implements")&&!n("{")){e=I()}if(n("<")){u=C()}if(b("extends")){x("extends");i=a.yieldAllowed;a.yieldAllowed=false;s=Fn();if(n("<")){o=fn()}a.yieldAllowed=i}if(_("implements")){r=ut()}return t(c,l.createClassExpression(e,s,Xn(),u,o,r))}function vr(){var e,r,i,s=null,o,c=p(),u;x("class");e=I();if(n("<")){u=C()}if(b("extends")){x("extends");i=a.yieldAllowed;a.yieldAllowed=false;s=Fn();if(n("<")){o=fn()}a.yieldAllowed=i}if(_("implements")){r=ut()}return t(c,l.createClassDeclaration(e,s,Xn(),u,o,r))}function $(){var e;if(c.type===o.Keyword){switch(c.value){case"const":case"let":return Ct(c.value);case"function":return In();case"export":E({},i.IllegalExportDeclaration);return Kn();case"import":E({},i.IllegalImportDeclaration);return Qn();default:return q()}}if(_("type")&&P().type===o.Identifier){return Hr()}if(_("interface")&&P().type===o.Identifier){return $r()}if(_("declare")){e=P();if(e.type===o.Keyword){switch(e.value){case"class":return wt();case"function":return _t();case"var":return St()}}else if(e.type===o.Identifier&&e.value==="module"){return el()}}if(c.type!==o.EOF){return q()}}function pt(){if(f.isModule&&c.type===o.Keyword){switch(c.value){case"export":return Kn();case"import":return Qn()}}return $()}function Er(){var n,a=[],t,u,l;while(e<y){t=c;if(t.type!==o.StringLiteral){break}n=pt();a.push(n);if(n.expression.type!==r.Literal){break}u=s.slice(t.range[0]+1,t.range[1]-1);if(u==="use strict"){v=true;if(l){E(l,i.StrictOctalLiteral)}}else{if(!l&&t.octal){l=t}}}while(e<y){n=pt();if(typeof n==="undefined"){break}a.push(n)}return a}function wr(){var e,n=p();v=!!f.isModule;mn();e=Er();return t(n,l.createProgram(e))}function vn(t,r,n,l,i){var e;J(typeof n==="number","Comment must have valid position");if(a.lastCommentStart>=n){return}a.lastCommentStart=n;e={type:t,value:r};if(f.range){e.range=[n,l]}if(f.loc){e.loc=i}f.comments.push(e);if(f.attachComment){f.leadingComments.push(e);f.trailingComments.push(e)}}function Sr(){var t,n,r,l,o,a;t="";o=false;a=false;while(e<y){n=s[e];if(a){n=s[e++];if(T(n.charCodeAt(0))){r.end={line:h,column:e-g-1};a=false;vn("Line",t,l,e-1,r);if(n==="\r"&&s[e]==="\n"){++e}++h;g=e;t=""}else if(e>=y){a=false;t+=n;r.end={line:h,column:y-g};vn("Line",t,l,y,r)}else{t+=n}}else if(o){if(T(n.charCodeAt(0))){if(n==="\r"){++e;t+="\r"}if(n!=="\r"||s[e]==="\n"){t+=s[e];++h;++e;g=e;if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}}else{n=s[e++];if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}t+=n;if(n==="*"){n=s[e];if(n==="/"){t=t.substr(0,t.length-1);o=false;++e;r.end={line:h,column:e-g};vn("Block",t,l,e,r);t=""}}}}else if(n==="/"){n=s[e+1];if(n==="/"){r={start:{line:h,column:e-g}};l=e;e+=2;a=true;if(e>=y){r.end={line:h,column:e-g};a=false;vn("Line",t,l,e,r)}}else if(n==="*"){l=e;e+=2;o=true;r={start:{line:h,column:e-g-2}};if(e>=y){d({},i.UnexpectedToken,"ILLEGAL")}}else{break}}else if(gt(n.charCodeAt(0))){++e}else if(T(n.charCodeAt(0))){++e;if(n==="\r"&&s[e]==="\n"){++e}++h;g=e}else{break}}}Rn={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function on(e){if(e.type===r.XJSIdentifier){return e.name}if(e.type===r.XJSNamespacedName){return e.namespace.name+":"+e.name.name}if(e.type===r.XJSMemberExpression){return on(e.object)+"."+on(e.property)}S(e)}function Ir(e){return e!==92&&W(e)}function Rr(e){return e!==92&&(e===45||an(e))}function Cr(){var n,t,r="";t=e;while(e<y){n=s.charCodeAt(e);if(!Rr(n)){break}r+=s[e++]}return{type:o.XJSIdentifier,value:r,lineNumber:h,lineStart:g,range:[t,e]}}function Ar(){var t,n="",l=e,a=0,r;t=s[e];J(t==="&","Entity must start with an ampersand");e++;while(e<y&&a++<10){t=s[e++];if(t===";"){break}n+=t}if(t===";"){if(n[0]==="#"){if(n[1]==="x"){r=+("0"+n.substr(1))}else{r=+n.substr(1).replace(wn.LeadingZeros,"")}if(!isNaN(r)){return String.fromCharCode(r)}}else if(Rn[n]){return Rn[n]}}e=l+1;return"&"}function ht(l){var n,t="",r;r=e;while(e<y){n=s[e];if(l.indexOf(n)!==-1){break}if(n==="&"){t+=Ar()}else{e++;if(n==="\r"&&s[e]==="\n"){t+=n;n=s[e];e++}if(T(n.charCodeAt(0))){++h;g=e}t+=n}}return{type:o.XJSText,value:t,lineNumber:h,lineStart:g,range:[r,e]}}function Lr(){var t,n,r;n=s[e];J(n==="'"||n==='"',"String literal must starts with a quote");r=e;++e;t=ht([n]);if(n!==s[e]){d({},i.UnexpectedToken,"ILLEGAL")}++e;t.range=[r,e];return t}function Pr(){var n=s.charCodeAt(e);if(n!==123&&n!==60){return ht(["<","{"])}return U()}function nn(){var e,n=p();if(c.type!==o.XJSIdentifier){S(c)}e=m();return t(n,l.createXJSIdentifier(e.value))}function yt(){var e,n,r=p();e=nn();u(":");n=nn();return t(r,l.createXJSNamespacedName(e,n))}function Or(){var r=p(),e=nn();while(n(".")){m();e=t(r,l.createXJSMemberExpression(e,nn()))}return e}function vt(){if(P().value===":"){return yt()}if(P().value==="."){return Or()}return nn()}function Nr(){if(P().value===":"){return yt()}return nn()}function Fr(){var e,a;if(n("{")){e=xt();if(e.expression.type===r.XJSEmptyExpression){d(e,"XJS attributes must only be assigned a non-empty "+"expression")}}else if(n("<")){e=Mn()}else if(c.type===o.XJSText){a=p();e=t(a,l.createLiteral(m()))}else{d({},i.InvalidXJSAttributeValue)}return e}function Br(){var n=it();while(s.charAt(e)!=="}"){e++}return t(n,l.createXJSEmptyExpression())}function xt(){var e,r,i,s=p();r=a.inXJSChild;i=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=false;u("{");if(n("}")){e=Br()}else{e=w()}a.inXJSChild=r;a.inXJSTag=i;u("}");return t(s,l.createXJSExpressionContainer(e))}function Vr(){var e,n,r,i=p();n=a.inXJSChild;r=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=false;u("{");u("...");e=R();a.inXJSChild=n;a.inXJSTag=r;u("}");return t(i,l.createXJSSpreadAttribute(e))}function Xr(){var e,r;if(n("{")){return Vr()}r=p();e=Nr();if(n("=")){m();return t(r,l.createXJSAttribute(e,Fr()))}return t(r,l.createXJSAttribute(e))}function qr(){var e,r;if(n("{")){e=xt()}else if(c.type===o.XJSText){r=it();e=t(r,l.createLiteral(m()))}else{e=Mn()}return e}function Jr(){var e,n,r,i=p();n=a.inXJSChild;r=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=true;u("<");u("/");e=vt();a.inXJSChild=n;a.inXJSTag=r;u(">");return t(i,l.createXJSClosingElement(e))}function Gr(){var n,d,r=[],i=false,s,o,f=p();s=a.inXJSChild;o=a.inXJSTag;a.inXJSChild=false;a.inXJSTag=true;u("<");n=vt();while(e<y&&c.value!=="/"&&c.value!==">"){r.push(Xr())}a.inXJSTag=o;if(c.value==="/"){u("/");a.inXJSChild=s;u(">");i=true}else{a.inXJSChild=true;u(">")}return t(f,l.createXJSOpeningElement(n,r,i))}function Mn(){var r,s=null,u=[],o,f,m=p();o=a.inXJSChild;f=a.inXJSTag;r=Gr();if(!r.selfClosing){while(e<y){a.inXJSChild=false;if(c.value==="<"&&P().value==="/"){break}a.inXJSChild=true;u.push(qr())}a.inXJSChild=o;a.inXJSTag=f;s=Jr();if(on(s.name)!==on(r.name)){d({},i.ExpectedXJSClosingTag,on(r.name))}}if(!o&&n("<")){d(c,i.AdjacentXJSElements)}return t(m,l.createXJSElement(r,s,u))}function Hr(){var e,i=p(),r=null,a;V("type");e=I();if(n("<")){r=C()}u("=");a=j();k();return t(i,l.createTypeAlias(e,r,a))}function zr(){var a=p(),e,r=null;e=I();if(n("<")){r=fn()}return t(a,l.createInterfaceExtends(e,r))}function Et(c,f){var r,a,i=[],s,o=null;s=I();if(n("<")){o=C()}if(b("extends")){x("extends");while(e<y){i.push(zr());if(!n(",")){break}u(",")}}a=p();r=t(a,ot(f));return t(c,l.createInterface(s,o,r,i))}function $r(){var n,t,r=[],l,e=p(),a=null;V("interface");return Et(e,false)}function wt(){var n=p(),e;V("declare");x("class");e=Et(n,true);e.type=r.DeclareClass;return e}function _t(){var e,i,m=p(),s,o,c,r,f=null,d,a;V("declare");x("function");i=p();e=I();a=p();if(n("<")){f=C()}u("(");r=Vn();s=r.params;c=r.rest;u(")");u(":");o=j();d=t(a,l.createFunctionTypeAnnotation(s,o,c,f));e.typeAnnotation=t(a,l.createTypeAnnotation(d));t(i,e);k();return t(m,l.createDeclareFunction(e))}function St(){var e,n=p();V("declare");x("var");e=Q();k();return t(n,l.createDeclareVariable(e))}function el(){var r=[],s,a,f,h=p(),d;V("declare");V("module");if(c.type===o.StringLiteral){if(v&&c.octal){E(c,i.StrictOctalLiteral)}f=p();a=t(f,l.createLiteral(m()))}else{a=I()}s=p();u("{");while(e<y&&!n("}")){d=P();switch(d.value){case"class":r.push(wt());break;case"function":r.push(_t());break;case"var":r.push(St());break;default:S(c)}}u("}");return t(h,l.createDeclareModule(a,t(s,l.createBlockStatement(r))))}function nl(){var u,t,n,l,i,r;if(!a.inXJSChild){N()}u=e;t={start:{line:h,column:e-g}};n=f.advance();t.end={line:h,column:e-g};if(n.type!==o.EOF){l=[n.range[0],n.range[1]];i=s.slice(n.range[0],n.range[1]);r={type:A[n.type],value:i,range:l,loc:t};if(n.regex){r.regex={pattern:n.regex.pattern,flags:n.regex.flags}}f.tokens.push(r)}return n}function tl(){var r,l,t,n;N();r=e;l={start:{line:h,column:e-g}};t=f.scanRegExp();l.end={line:h,column:e-g};if(!f.tokenize){if(f.tokens.length>0){n=f.tokens[f.tokens.length-1];if(n.range[0]===r&&n.type==="Punctuator"){if(n.value==="/"||n.value==="/="){f.tokens.pop()}}}f.tokens.push({type:"RegularExpression",value:t.literal,regex:t.regex,range:[r,e],loc:l})}return t}function kt(){var t,e,n,r=[];for(t=0;t<f.tokens.length;++t){e=f.tokens[t];n={type:e.type,value:e.value};if(e.regex){n.regex={pattern:e.regex.pattern,flags:e.regex.flags}}if(f.range){n.range=e.range}if(f.loc){n.loc=e.loc}r.push(n)}f.tokens=r}function It(){if(f.comments){f.skipComment=N;N=Sr}if(typeof f.tokens!=="undefined"){f.advance=en;f.scanRegExp=F;en=nl;F=tl}}function Rt(){if(typeof f.skipComment==="function"){N=f.skipComment}if(typeof f.scanRegExp==="function"){en=f.advance;F=f.scanRegExp}}function il(n,t){var e,r={};for(e in n){if(n.hasOwnProperty(e)){r[e]=n[e]}}for(e in t){if(t.hasOwnProperty(e)){r[e]=t[e]}}return r}function sl(t,n){var u,i,r;u=String;if(typeof t!=="string"&&!(t instanceof String)){t=u(t)}l=kn;s=t;e=0;h=s.length>0?1:0;g=0;y=s.length;c=null;a={allowKeyword:true,allowIn:true,labelSet:new O,inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1};f={};n=n||{};n.tokens=true;f.tokens=[];f.tokenize=true;f.openParenToken=-1;f.openCurlyToken=-1;f.range=typeof n.range==="boolean"&&n.range;f.loc=typeof n.loc==="boolean"&&n.loc;if(typeof n.comment==="boolean"&&n.comment){f.comments=[]}if(typeof n.tolerant==="boolean"&&n.tolerant){f.errors=[]}It();try{mn();if(c.type===o.EOF){return f.tokens}i=m();while(c.type!==o.EOF){try{i=m()}catch(p){i=c;if(f.errors){f.errors.push(p);break}else{throw p}}}kt();r=f.tokens;if(typeof f.comments!=="undefined"){r.comments=f.comments}if(typeof f.errors!=="undefined"){r.errors=f.errors}}catch(d){throw d}finally{Rt();f={}}return r}function Nt(t,n){var r,i;i=String;if(typeof t!=="string"&&!(t instanceof String)){t=i(t)}l=kn;s=t;e=0;h=s.length>0?1:0;g=0;y=s.length;c=null;a={allowKeyword:false,allowIn:true,labelSet:new O,parenthesizedCount:0,inFunctionBody:false,inIteration:false,inSwitch:false,inXJSChild:false,inXJSTag:false,inType:false,lastCommentStart:-1,yieldAllowed:false,awaitAllowed:false};f={};if(typeof n!=="undefined"){f.range=typeof n.range==="boolean"&&n.range;f.loc=typeof n.loc==="boolean"&&n.loc;f.attachComment=typeof n.attachComment==="boolean"&&n.attachComment;if(f.loc&&n.source!==null&&n.source!==undefined){l=il(l,{postProcess:function(e){e.loc.source=i(n.source);return e}})}if(n.sourceType==="module"){f.isModule=true}if(typeof n.tokens==="boolean"&&n.tokens){f.tokens=[]}if(typeof n.comment==="boolean"&&n.comment){f.comments=[]}if(typeof n.tolerant==="boolean"&&n.tolerant){f.errors=[]}if(f.attachComment){f.range=true;f.comments=[];f.bottomRightStack=[];f.trailingComments=[];f.leadingComments=[]}}It();try{r=wr();if(typeof f.comments!=="undefined"){r.comments=f.comments}if(typeof f.tokens!=="undefined"){kt();r.tokens=f.tokens}if(typeof f.errors!=="undefined"){r.errors=f.errors}}catch(o){throw o}finally{Rt();f={}}return r}En.version="10001.1.0-dev-harmony-fb";En.tokenize=sl;En.parse=Nt;En.Syntax=function(){var e,n={};if(typeof Object.create==="function"){n=Object.create(null)}for(e in r){if(r.hasOwnProperty(e)){n[e]=r[e]}}if(typeof Object.freeze==="function"){Object.freeze(n)}return n}()})},{}],167:[function(t,b,g){var n=t("assert");var s=t("./types");var h=s.namedTypes;var m=s.builtInTypes.array;var y=s.builtInTypes.object;var o=t("./lines");var l=o.fromString;var u=o.Lines;var f=o.concat;var a=t("./util").comparePos;var c=t("private").makeUniqueKey();function p(e,n){if(!e){return}if(n){if(h.Node.check(e)&&h.SourceLocation.check(e.loc)){for(var t=n.length-1;t>=0;--t){if(a(n[t].loc.end,e.loc.start)<=0){break}}n.splice(t+1,0,e);return}}else if(e[c]){return e[c]}var r;if(m.check(e)){r=Object.keys(e)}else if(y.check(e)){r=s.getFieldNames(e)}else{return}if(!n){Object.defineProperty(e,c,{value:n=[],enumerable:false})}for(var t=0,l=r.length;t<l;++t){p(e[r[t]],n)}return n}function d(u,e){var i=p(u);var t=0,r=i.length;while(t<r){var l=t+r>>1;var n=i[l];if(a(n.loc.start,e.loc.start)<=0&&a(e.loc.end,n.loc.end)<=0){d(e.enclosingNode=n,e);return}if(a(n.loc.end,e.loc.start)<=0){var s=n;t=l+1;continue}if(a(e.loc.end,n.loc.start)<=0){var o=n;r=l;continue}throw new Error("Comment location overlaps with node location")}if(s){e.precedingNode=s}if(o){e.followingNode=o}}g.attach=function(a,i,l){if(!m.check(a)){return}var t=[];a.forEach(function(a){a.loc.lines=l;d(i,a);var s=a.precedingNode;var c=a.enclosingNode;var o=a.followingNode;if(s&&o){var f=t.length;if(f>0){var u=t[f-1];n.strictEqual(u.precedingNode===a.precedingNode,u.followingNode===a.followingNode);if(u.followingNode!==a.followingNode){r(t,l)}}t.push(a)}else if(s){r(t,l);e.forNode(s).addTrailing(a)}else if(o){r(t,l);e.forNode(o).addLeading(a)}else if(c){r(t,l);e.forNode(c).addDangling(a)}else{throw new Error("AST contains no nodes at all?")}});r(t,l)};function r(t,u){var i=t.length;if(i===0){return}var s=t[0].precedingNode;var a=t[0].followingNode;var o=a.loc.start;for(var r=i;r>0;--r){var l=t[r-1];n.strictEqual(l.precedingNode,s);n.strictEqual(l.followingNode,a);var c=u.sliceString(l.loc.end,o);if(/\S/.test(c)){break}o=l.loc.start}while(r<=i&&(l=t[r])&&l.type==="Line"&&l.loc.start.column>a.loc.start.column){++r}t.forEach(function(n,t){if(t<r){e.forNode(s).addTrailing(n)}else{e.forNode(a).addLeading(n)}});t.length=0}function e(){n.ok(this instanceof e);this.leading=[];this.dangling=[];this.trailing=[]}var i=e.prototype;e.forNode=function E(t){var n=t.comments;if(!n){Object.defineProperty(t,"comments",{value:n=new e,enumerable:false})}return n};i.forEach=function w(e,n){this.leading.forEach(e,n);this.trailing.forEach(e,n)};i.addLeading=function _(e){this.leading.push(e)};i.addDangling=function S(e){this.dangling.push(e)};i.addTrailing=function k(e){e.trailing=true;if(e.type==="Block"){this.trailing.push(e)}else{this.leading.push(e)}};function v(e,s){var r=e.loc;var a=r&&r.lines;var t=[];if(e.type==="Block"){t.push("/*",l(e.value,s),"*/")}else if(e.type==="Line"){t.push("//",l(e.value,s))
}else n.fail(e.type);if(e.trailing){t.push("\n")}else if(a instanceof u){var i=a.slice(r.end,a.skipSpaces(r.end));if(i.length===1){t.push(i)}else{t.push(new Array(i.length).join("\n"))}}else{t.push("\n")}return f(t).stripMargin(r?r.start.column:0)}function x(e,s){var t=e.loc;var a=t&&t.lines;var r=[];if(a instanceof u){var o=a.skipSpaces(t.start,true)||a.firstPos();var i=a.slice(o,t.start);if(i.length===1){r.push(i)}else{r.push(new Array(i.length).join("\n"))}}if(e.type==="Block"){r.push("/*",l(e.value,s),"*/")}else if(e.type==="Line"){r.push("//",l(e.value,s),"\n")}else n.fail(e.type);return f(r).stripMargin(t?t.start.column:0,true)}g.printComments=function(e,t,a){if(t){n.ok(t instanceof u)}else{t=l("")}if(!e||!(e.leading.length+e.trailing.length)){return t}var r=[];e.leading.forEach(function(e){r.push(v(e,a))});r.push(t);e.trailing.forEach(function(e){n.strictEqual(e.type,"Block");r.push(x(e,a))});return f(r)}},{"./lines":169,"./types":175,"./util":176,assert:110,"private":143}],168:[function(s,u,m){var t=s("assert");var l=s("./types");var e=l.namedTypes;var p=e.Node;var f=l.builtInTypes.array;var o=l.builtInTypes.number;function r(e){t.ok(this instanceof r);this.stack=[e]}var n=r.prototype;u.exports=r;r.from=function(e){if(e instanceof r){return e.copy()}if(e instanceof l.NodePath){var t=Object.create(r.prototype);var a=[e.value];for(var n;n=e.parentPath;e=n)a.push(e.name,n.value);t.stack=a.reverse();return t}return new r(e)};n.copy=function h(){var h=Object.create(r.prototype);h.stack=this.stack.slice(0);return h};n.getName=function g(){var e=this.stack;var n=e.length;if(n>1){return e[n-2]}return null};n.getValue=function y(){var e=this.stack;return e[e.length-1]};n.getNode=function v(){var t=this.stack;for(var n=t.length-1;n>=0;n-=2){var r=t[n];if(e.Node.check(r)){return r}}return null};n.getParentNode=function x(){var t=this.stack;var l=0;for(var n=t.length-1;n>=0;n-=2){var r=t[n];if(e.Node.check(r)&&l++>0){return r}}return null};n.getRootValue=function b(){var e=this.stack;if(e.length%2===0){return e[1]}return e[0]};n.call=function E(a){var e=this.stack;var r=e.length;var n=e[r-1];var i=arguments.length;for(var t=1;t<i;++t){var l=arguments[t];n=n[l];e.push(l,n)}var s=a(this);e.length=r;return s};n.each=function w(a){var n=this.stack;var r=n.length;var t=n[r-1];var i=arguments.length;for(var e=1;e<i;++e){var l=arguments[e];t=t[l];n.push(l,t)}for(var e=0;e<t.length;++e){if(e in t){n.push(e,t[e]);a(this);n.length-=2}}n.length=r};n.map=function _(i){var t=this.stack;var r=t.length;var n=t[r-1];var s=arguments.length;for(var e=1;e<s;++e){var l=arguments[e];n=n[l];t.push(l,n)}var a=new Array(n.length);for(var e=0;e<n.length;++e){if(e in n){t.push(e,n[e]);a[e]=i(this,e);t.length-=2}}t.length=r;return a};n.needsParens=function(c){var n=this.getParentNode();if(!n){return false}var l=this.getName();var r=this.getNode();if(!e.Expression.check(r)){return false}if(r.type==="Identifier"){return false}switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return n.type==="MemberExpression"&&l==="object"&&n.object===r;case"BinaryExpression":case"LogicalExpression":switch(n.type){case"CallExpression":return l==="callee"&&n.callee===r;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return true;case"MemberExpression":return l==="object"&&n.object===r;case"BinaryExpression":case"LogicalExpression":var f=n.operator;var s=i[f];var p=r.operator;var u=i[p];if(s>u){return true}if(s===u&&l==="right"){t.strictEqual(n.right,r);return true}default:return false}case"SequenceExpression":switch(n.type){case"ForStatement":return false;case"ExpressionStatement":return l!=="expression";default:return true}case"YieldExpression":switch(n.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return true;default:return false}case"Literal":return n.type==="MemberExpression"&&o.check(r.value)&&l==="object"&&n.object===r;case"AssignmentExpression":case"ConditionalExpression":switch(n.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return true;case"CallExpression":return l==="callee"&&n.callee===r;case"ConditionalExpression":return l==="test"&&n.test===r;case"MemberExpression":return l==="object"&&n.object===r;default:return false}default:if(n.type==="NewExpression"&&l==="callee"&&n.callee===r){return a(r)}}if(c!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function c(n){return e.BinaryExpression.check(n)||e.LogicalExpression.check(n)}function d(n){return e.UnaryExpression.check(n)||e.SpreadElement&&e.SpreadElement.check(n)||e.SpreadProperty&&e.SpreadProperty.check(n)}var i={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,n){e.forEach(function(e){i[e]=n})});function a(n){if(e.CallExpression.check(n)){return true}if(f.check(n)){return n.some(a)}if(e.Node.check(n)){return l.someField(n,function(n,e){return a(e)})}return false}n.canBeFirstInStatement=function(){var n=this.getNode();return!e.FunctionExpression.check(n)&&!e.ObjectExpression.check(n)};n.firstInStatement=function(){var i=this.stack;var s,n;var l,r;for(var a=i.length-1;a>=0;a-=2){if(e.Node.check(i[a])){l=s;r=n;s=i[a-1];n=i[a]}if(!n||!r){continue}if(e.BlockStatement.check(n)&&s==="body"&&l===0){t.strictEqual(n.body[0],r);return true}if(e.ExpressionStatement.check(n)&&l==="expression"){t.strictEqual(n.expression,r);return true}if(e.SequenceExpression.check(n)&&s==="expressions"&&l===0){t.strictEqual(n.expressions[0],r);continue}if(e.CallExpression.check(n)&&l==="callee"){t.strictEqual(n.callee,r);continue}if(e.MemberExpression.check(n)&&l==="object"){t.strictEqual(n.object,r);continue}if(e.ConditionalExpression.check(n)&&l==="test"){t.strictEqual(n.test,r);continue}if(c(n)&&l==="left"){t.strictEqual(n.left,r);continue}if(e.UnaryExpression.check(n)&&!n.prefix&&l==="argument"){t.strictEqual(n.argument,r);continue}return false}return true}},{"./types":175,assert:110}],169:[function(l,_,p){var n=l("assert");var E=l("source-map");var h=l("./options").normalize;var y=l("private").makeUniqueKey();var w=l("./types");var m=w.builtInTypes.string;var g=l("./util").comparePos;var b=l("./mapping");function t(e){return e[y]}function r(l,e){n.ok(this instanceof r);n.ok(l.length>0);if(e){m.assert(e)}else{e=null}Object.defineProperty(this,y,{value:{infos:l,mappings:[],name:e,cachedSourceMap:null}});if(e){t(this).mappings.push(new b(this,{start:this.firstPos(),end:this.lastPos()}))}}p.Lines=r;var e=r.prototype;Object.defineProperties(e,{length:{get:function(){return t(this).infos.length}},name:{get:function(){return t(this).name}}});function o(e){return{line:e.line,indent:e.indent,sliceStart:e.sliceStart,sliceEnd:e.sliceEnd}}var f={};var c=f.hasOwnProperty;var v=10;function d(a,t){var e=0;var s=a.length;for(var l=0;l<s;++l){var r=a.charAt(l);if(r===" "){e+=1}else if(r===" "){n.strictEqual(typeof t,"number");n.ok(t>0);var i=Math.ceil(e/t)*t;if(i===e){e+=t}else{e=i}}else if(r==="\r"){}else{n.fail("unexpected whitespace character",r)}}return e}p.countSpaces=d;var x=/^\s*/;function u(e,t){if(e instanceof r)return e;e+="";var l=t&&t.tabWidth;var a=e.indexOf(" ")<0;var i=!t&&a&&e.length<=v;n.ok(l||a,"No tab width specified but encountered tabs in string\n"+e);if(i&&c.call(f,e))return f[e];var s=new r(e.split("\n").map(function(e){var n=x.exec(e)[0];return{line:e,indent:d(n,l),sliceStart:n.length,sliceEnd:e.length}}),h(t).sourceFileName);if(i)f[e]=s;return s}p.fromString=u;function s(e){return!/\S/.test(e)}e.toString=function(e){return this.sliceString(this.firstPos(),this.lastPos(),e)};e.getSourceMap=function(a,i){if(!a){return null}var e=this;function s(e){e=e||{};m.assert(a);e.file=a;if(i){m.assert(i);e.sourceRoot=i}return e}var r=t(e);if(r.cachedSourceMap){return s(r.cachedSourceMap.toJSON())}var l=new E.SourceMapGenerator(s());var o={};r.mappings.forEach(function(t){var r=t.sourceLines.skipSpaces(t.sourceLoc.start)||t.sourceLines.lastPos();var a=e.skipSpaces(t.targetLoc.start)||e.lastPos();while(g(r,t.sourceLoc.end)<0&&g(a,t.targetLoc.end)<0){var u=t.sourceLines.charAt(r);var f=e.charAt(a);n.strictEqual(u,f);var i=t.sourceLines.name;l.addMapping({source:i,original:{line:r.line,column:r.column},generated:{line:a.line,column:a.column}});if(!c.call(o,i)){var s=t.sourceLines.toString();l.setSourceContent(i,s);o[i]=s}e.nextPos(a,true);t.sourceLines.nextPos(r,true)}});r.cachedSourceMap=l;return l.toJSON()};e.bootstrapCharAt=function(e){n.strictEqual(typeof e,"object");n.strictEqual(typeof e.line,"number");n.strictEqual(typeof e.column,"number");var l=e.line,r=e.column,a=this.toString().split("\n"),t=a[l-1];if(typeof t==="undefined")return"";if(r===t.length&&l<a.length)return"\n";if(r>=t.length)return"";return t.charAt(r)};e.charAt=function(r){n.strictEqual(typeof r,"object");n.strictEqual(typeof r.line,"number");n.strictEqual(typeof r.column,"number");var a=r.line,s=r.column,o=t(this),u=o.infos,l=u[a-1],e=s;if(typeof l==="undefined"||e<0)return"";var i=this.getIndentAt(a);if(e<i)return" ";e+=l.sliceStart-i;if(e===l.sliceEnd&&a<this.length)return"\n";if(e>=l.sliceEnd)return"";return l.line.charAt(e)};e.stripMargin=function(e,l){if(e===0)return this;n.ok(e>0,"negative margin: "+e);if(l&&this.length===1)return this;var a=t(this);var i=new r(a.infos.map(function(n,t){if(n.line&&(t>0||!l)){n=o(n);n.indent=Math.max(0,n.indent-e)}return n}));if(a.mappings.length>0){var s=t(i).mappings;n.strictEqual(s.length,0);a.mappings.forEach(function(n){s.push(n.indent(e,l,true))})}return i};e.indent=function(e){if(e===0)return this;var l=t(this);var a=new r(l.infos.map(function(n){if(n.line){n=o(n);n.indent+=e}return n}));if(l.mappings.length>0){var i=t(a).mappings;n.strictEqual(i.length,0);l.mappings.forEach(function(n){i.push(n.indent(e))})}return a};e.indentTail=function(e){if(e===0)return this;if(this.length<2)return this;var l=t(this);var a=new r(l.infos.map(function(n,t){if(t>0&&n.line){n=o(n);n.indent+=e}return n}));if(l.mappings.length>0){var i=t(a).mappings;n.strictEqual(i.length,0);l.mappings.forEach(function(n){i.push(n.indent(e,true))})}return a};e.getIndentAt=function(e){n.ok(e>=1,"no line "+e+" (line numbers start from 1)");var r=t(this),l=r.infos[e-1];return Math.max(l.indent,0)};e.guessTabWidth=function(){var l=t(this);if(c.call(l,"cachedTabWidth")){return l.cachedTabWidth}var n=[];var i=0;for(var a=1,p=this.length;a<=p;++a){var r=l.infos[a-1];var d=r.line.slice(r.sliceStart,r.sliceEnd);if(s(d)){continue}var o=Math.abs(r.indent-i);n[o]=~~n[o]+1;i=r.indent}var u=-1;var f=2;for(var e=1;e<n.length;e+=1){if(c.call(n,e)&&n[e]>u){u=n[e];f=e}}return l.cachedTabWidth=f};e.isOnlyWhitespace=function(){return s(this.toString())};e.isPrecededOnlyByWhitespace=function(n){var a=t(this);var e=a.infos[n.line-1];var i=Math.max(e.indent,0);var r=n.column-i;if(r<=0){return true}var l=e.sliceStart;var o=Math.min(l+r,e.sliceEnd);var u=e.line.slice(l,o);return s(u)};e.getLineLength=function(e){var r=t(this),n=r.infos[e-1];return this.getIndentAt(e)+n.sliceEnd-n.sliceStart};e.nextPos=function(e,n){var t=Math.max(e.line,0),r=Math.max(e.column,0);if(r<this.getLineLength(t)){e.column+=1;return n?!!this.skipSpaces(e,false,true):true}if(t<this.length){e.line+=1;e.column=0;return n?!!this.skipSpaces(e,false,true):true}return false};e.prevPos=function(e,r){var n=e.line,t=e.column;if(t<1){n-=1;if(n<1)return false;t=this.getLineLength(n)}else{t=Math.min(t-1,this.getLineLength(n))}e.line=n;e.column=t;return r?!!this.skipSpaces(e,true,true):true};e.firstPos=function(){return{line:1,column:0}};e.lastPos=function(){return{line:this.length,column:this.getLineLength(this.length)}};e.skipSpaces=function(e,n,t){if(e){e=t?e:{line:e.line,column:e.column}}else if(n){e=this.lastPos()}else{e=this.firstPos()}if(n){while(this.prevPos(e)){if(!s(this.charAt(e))&&this.nextPos(e)){return e}}return null}else{while(s(this.charAt(e))){if(!this.nextPos(e)){return null}}return e}};e.trimLeft=function(){var e=this.skipSpaces(this.firstPos(),false,true);return e?this.slice(e):a};e.trimRight=function(){var e=this.skipSpaces(this.lastPos(),true,true);return e?this.slice(this.firstPos(),e):a};e.trim=function(){var e=this.skipSpaces(this.firstPos(),false,true);if(e===null)return a;var t=this.skipSpaces(this.lastPos(),true,true);n.notStrictEqual(t,null);return this.slice(e,t)};e.eachPos=function(r,n,t){var e=this.firstPos();if(n){e.line=n.line,e.column=n.column}if(t&&!this.skipSpaces(e,false,true)){return}do r.call(this,e);while(this.nextPos(e,t))};e.bootstrapSlice=function(n,t){var e=this.toString().split("\n").slice(n.line-1,t.line);e.push(e.pop().slice(0,t.column));e[0]=e[0].slice(n.column);return u(e.join("\n"))};e.slice=function(l,e){if(!e){if(!l){return this}e=this.lastPos()}var s=t(this);var a=s.infos.slice(l.line-1,e.line);if(l.line===e.line){a[0]=i(a[0],l.column,e.column)}else{n.ok(l.line<e.line);a[0]=i(a[0],l.column);a.push(i(a.pop(),0,e.column))}var o=new r(a);if(s.mappings.length>0){var u=t(o).mappings;n.strictEqual(u.length,0);s.mappings.forEach(function(t){var n=t.slice(this,l,e);if(n){u.push(n)}},this)}return o};function i(r,l,t){var a=r.sliceStart;var i=r.sliceEnd;var e=Math.max(r.indent,0);var s=e+i-a;if(typeof t==="undefined"){t=s}l=Math.max(l,0);t=Math.min(t,s);t=Math.max(t,l);if(t<e){e=t;i=a}else{i-=s-t}s=t;s-=l;if(l<e){e-=l}else{l-=e;e=0;a+=l}n.ok(e>=0);n.ok(a<=i);n.strictEqual(s,e+i-a);if(r.indent===e&&r.sliceStart===a&&r.sliceEnd===i){return r}return{line:r.line,indent:e,sliceStart:a,sliceEnd:i}}e.bootstrapSliceString=function(e,n,t){return this.slice(e,n).toString(t)};e.sliceString=function(a,n,l){if(!n){if(!a){return this}n=this.lastPos()}l=h(l);var y=t(this).infos;var c=[];var m=l.tabWidth;for(var r=a.line;r<=n.line;++r){var e=y[r-1];if(r===a.line){if(r===n.line){e=i(e,a.column,n.column)}else{e=i(e,a.column)}}else if(r===n.line){e=i(e,0,n.column)}var f=Math.max(e.indent,0);var g=e.line.slice(0,e.sliceStart);if(l.reuseWhitespace&&s(g)&&d(g,l.tabWidth)===f){c.push(e.line.slice(0,e.sliceEnd));continue}var o=0;var p=f;if(l.useTabs){o=Math.floor(f/m);p-=o*m}var u="";if(o>0){u+=new Array(o+1).join(" ")}if(p>0){u+=new Array(p+1).join(" ")}u+=e.line.slice(e.sliceStart,e.sliceEnd);c.push(u)}return c.join("\n")};e.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1};e.join=function(f){var s=this;var p=t(s);var n=[];var l=[];var e;function i(t){if(t===null)return;if(e){var r=t.infos[0];var a=new Array(r.indent+1).join(" ");var i=n.length;var s=Math.max(e.indent,0)+e.sliceEnd-e.sliceStart;e.line=e.line.slice(0,e.sliceEnd)+a+r.line.slice(r.sliceStart,r.sliceEnd);e.sliceEnd=e.line.length;if(t.mappings.length>0){t.mappings.forEach(function(e){l.push(e.add(i,s))})}}else if(t.mappings.length>0){l.push.apply(l,t.mappings)}t.infos.forEach(function(t,r){if(!e||r>0){e=o(t);n.push(e)}})}function d(e,n){if(n>0)i(p);i(e)}f.map(function(n){var e=u(n);if(e.isEmpty())return null;return t(e)}).forEach(s.isEmpty()?i:d);if(n.length<1)return a;var c=new r(n);t(c).mappings=l;return c};p.concat=function(e){return a.join(e)};e.concat=function(r){var t=arguments,e=[this];e.push.apply(e,t);n.strictEqual(e.length,t.length+1);return a.join(e)};var a=u("")},{"./mapping":170,"./options":171,"./types":175,"./util":176,assert:110,"private":143,"source-map":186}],170:[function(s,f,h){var e=s("assert");var o=s("./types");var m=o.builtInTypes.string;var i=o.builtInTypes.number;var p=o.namedTypes.SourceLocation;var l=o.namedTypes.Position;var u=s("./lines");var t=s("./util").comparePos;function r(l,t,n){e.ok(this instanceof r);e.ok(l instanceof u.Lines);p.assert(t);if(n){e.ok(i.check(n.start.line)&&i.check(n.start.column)&&i.check(n.end.line)&&i.check(n.end.column))}else{n=t}Object.defineProperties(this,{sourceLines:{value:l},sourceLoc:{value:t},targetLoc:{value:n}})}var a=r.prototype;f.exports=r;a.slice=function(f,a,s){e.ok(f instanceof u.Lines);l.assert(a);if(s){l.assert(s)}else{s=f.lastPos()}var p=this.sourceLines;var o=this.sourceLoc;var i=this.targetLoc;function c(n){var r=o[n];var l=i[n];var t=a;if(n==="end"){t=s}else{e.strictEqual(n,"start")}return d(p,r,f,l,t)}if(t(a,i.start)<=0){if(t(i.end,s)<=0){i={start:n(i.start,a.line,a.column),end:n(i.end,a.line,a.column)}}else if(t(s,i.start)<=0){return null}else{o={start:o.start,end:c("end")};i={start:n(i.start,a.line,a.column),end:n(s,a.line,a.column)}}}else{if(t(i.end,a)<=0){return null}if(t(i.end,s)<=0){o={start:c("start"),end:o.end};i={start:{line:1,column:0},end:n(i.end,a.line,a.column)}}else{o={start:c("start"),end:c("end")};i={start:{line:1,column:0},end:n(s,a.line,a.column)}}}return new r(this.sourceLines,o,i)};a.add=function(e,n){return new r(this.sourceLines,this.sourceLoc,{start:c(this.targetLoc.start,e,n),end:c(this.targetLoc.end,e,n)})};function c(e,n,t){return{line:e.line+n-1,column:e.line===1?e.column+t:e.column}}a.subtract=function(e,t){return new r(this.sourceLines,this.sourceLoc,{start:n(this.targetLoc.start,e,t),end:n(this.targetLoc.end,e,t)})};function n(e,n,t){return{line:e.line-n+1,column:e.line===n?e.column-t:e.column}}a.indent=function(n,t,i){if(n===0){return this}var e=this.targetLoc;var l=e.start.line;var a=e.end.line;if(t&&l===1&&a===1){return this}e={start:e.start,end:e.end};if(!t||l>1){var s=e.start.column+n;e.start={line:l,column:i?Math.max(0,s):s}}if(!t||a>1){var o=e.end.column+n;e.end={line:a,column:i?Math.max(0,o):o}}return new r(this.sourceLines,this.sourceLoc,e)};function d(a,c,i,f,o){e.ok(a instanceof u.Lines);e.ok(i instanceof u.Lines);l.assert(c);l.assert(f);l.assert(o);var p=t(f,o);if(p===0){return c}if(p<0){var r=a.skipSpaces(c);var n=i.skipSpaces(f);var s=o.line-n.line;r.line+=s;n.line+=s;if(s>0){r.column=0;n.column=0}else{e.strictEqual(s,0)}while(t(n,o)<0&&i.nextPos(n,true)){e.ok(a.nextPos(r,true));e.strictEqual(a.charAt(r),i.charAt(n))}}else{var r=a.skipSpaces(c,true);var n=i.skipSpaces(f,true);var s=o.line-n.line;r.line+=s;n.line+=s;if(s<0){r.column=a.getLineLength(r.line);n.column=i.getLineLength(n.line)}else{e.strictEqual(s,0)}while(t(o,n)<0&&i.prevPos(n,true)){e.ok(a.prevPos(r,true));e.strictEqual(a.charAt(r),i.charAt(n))}}return r}},{"./lines":169,"./types":175,"./util":176,assert:110}],171:[function(n,l,t){var e={esprima:n("esprima-fb"),tabWidth:4,useTabs:false,reuseWhitespace:true,wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:false,tolerant:true},r=e.hasOwnProperty;t.normalize=function(t){t=t||e;function n(n){return r.call(t,n)?t[n]:e[n]}return{tabWidth:+n("tabWidth"),useTabs:!!n("useTabs"),reuseWhitespace:!!n("reuseWhitespace"),wrapColumn:Math.max(n("wrapColumn"),0),sourceFileName:n("sourceFileName"),sourceMapName:n("sourceMapName"),sourceRoot:n("sourceRoot"),inputSourceMap:n("inputSourceMap"),esprima:n("esprima"),range:n("range"),tolerant:n("tolerant")}}},{"esprima-fb":166}],172:[function(e,h,a){var o=e("assert");var n=e("./types");var t=n.namedTypes;var i=n.builders;var s=n.builtInTypes.object;var p=n.builtInTypes.array;var m=n.builtInTypes.function;var d=e("./patcher").Patcher;var f=e("./options").normalize;var c=e("./lines").fromString;var u=e("./comments").attach;a.parse=function g(s,e){e=f(e);var n=c(s,e);var o=n.toString({tabWidth:e.tabWidth,reuseWhitespace:false,useTabs:false});var t=e.esprima.parse(o,{loc:true,range:e.range,comment:true,tolerant:e.tolerant,sourceType:"module"});var p=t.comments;delete t.comments;var l=i.file(t);l.loc={lines:n,indent:0,start:n.firstPos(),end:n.lastPos()};var a=new r(n).copy(l);u(p,a.program,n);return a};function r(e){o.ok(this instanceof r);this.lines=e;this.indent=0}var l=r.prototype;l.copy=function(e){if(p.check(e)){return e.map(this.copy,this)}if(!s.check(e)){return e}if(t.MethodDefinition&&t.MethodDefinition.check(e)||t.Property.check(e)&&(e.method||e.shorthand)){e.value.loc=null;if(t.FunctionExpression.check(e.value)){e.value.id=null}}var l=Object.create(Object.getPrototypeOf(e),{original:{value:e,configurable:false,enumerable:false,writable:true}});var n=e.loc;var i=this.indent;var o=i;if(n){if(n.start.line<1){n.start.line=1}if(n.end.line<1){n.end.line=1}if(this.lines.isPrecededOnlyByWhitespace(n.start)){o=this.indent=n.start.column}n.lines=this.lines;n.indent=o}var u=Object.keys(e);var c=u.length;for(var a=0;a<c;++a){var r=u[a];if(r==="loc"){l[r]=e[r]}else if(r==="comments"){}else{l[r]=this.copy(e[r])}}this.indent=i;if(e.comments){Object.defineProperty(l,"comments",{value:e.comments,enumerable:false})}return l}},{"./comments":167,"./lines":169,"./options":171,"./patcher":173,"./types":175,assert:110}],173:[function(a,S,h){var r=a("assert");var o=a("./lines");var e=a("./types");var k=e.getFieldValue;var l=e.namedTypes.Node;var g=e.namedTypes.Expression;var E=e.namedTypes.SourceLocation;var f=a("./util");var t=f.comparePos;var p=a("./fast-path");var n=e.builtInTypes.object;var u=e.builtInTypes.array;var v=e.builtInTypes.string;function i(e){r.ok(this instanceof i);r.ok(e instanceof o.Lines);var n=this,l=[];n.replace=function(n,e){if(v.check(e))e=o.fromString(e);l.push({lines:e,start:n.start,end:n.end})};n.get=function(n){n=n||{start:{line:1,column:0},end:{line:e.length,column:e.getLineLength(e.length)}};var a=n.start,i=[];function s(n,l){r.ok(t(n,l)<=0);i.push(e.slice(n,l))}l.sort(function(e,n){return t(e.start,n.start)}).forEach(function(e){if(t(a,e.start)>0){}else{s(a,e.start);i.push(e.lines);a=e.end}});s(a,n.end);return o.concat(i)}}h.Patcher=i;h.getReprinter=function(e){r.ok(e instanceof p);var a=e.getValue();if(!l.check(a))return;var n=a.original;var t=n&&n.loc;var s=t&&t.lines;var o=[];if(!s||!y(e,o))return;return function(r){var e=new i(s);o.forEach(function(t){var n=t.oldNode;E.assert(n.loc,true);e.replace(n.loc,r(t.newPath).indentTail(n.loc.indent))});return e.get(t).indentTail(-n.loc.indent)}};function y(a,e){var n=a.getValue();l.assert(n);var t=n.original;l.assert(t);r.deepEqual(e,[]);if(n.type!==t.type){return false}var o=new p(t);var i=s(a,o,e);if(!i){e.length=0}return i}function c(e,t,l){var r=e.getValue();var a=t.getValue();if(r===a)return true;if(u.check(r))return x(e,t,l);if(n.check(r))return b(e,t,l);return false}function x(n,t,i){var r=n.getValue();var l=t.getValue();u.assert(r);var a=r.length;if(!(u.check(l)&&l.length===a))return false;for(var e=0;e<a;++e){n.stack.push(e,r[e]);t.stack.push(e,l[e]);var s=c(n,t,i);n.stack.length-=2;t.stack.length-=2;if(!s){return false}}return true}function b(t,i,r){var a=t.getValue();n.assert(a);if(a.original===null){return false}var e=i.getValue();if(!n.check(e))return false;if(l.check(a)){if(!l.check(e)){return false}if(!e.loc){return false}if(a.type===e.type){var o=[];if(s(t,i,o)){r.push.apply(r,o)}else{r.push({oldNode:e,newPath:t.copy()})}return true}if(g.check(a)&&g.check(e)){r.push({oldNode:e,newPath:t.copy()});return true}return false}return s(t,i,r)}var m={line:1,column:0};function d(l){var i=l.getValue();var n=i.loc;var r=n&&n.lines;if(r){var e=m;e.line=n.start.line;e.column=n.start.column;while(r.prevPos(e)){var a=r.charAt(e);if(a==="("){return t(l.getRootValue().loc.start,e)<=0}if(a!==" "){return false}}}return false}function w(l){var i=l.getValue();var n=i.loc;var r=n&&n.lines;if(r){var e=m;e.line=n.end.line;e.column=n.end.column;do{var a=r.charAt(e);if(a===")"){return t(e,l.getRootValue().loc.end)<=0}if(a!==" "){return false}}while(r.nextPos(e))}return false}function _(e){return d(e)&&w(e)}function s(t,r,s){var a=t.getValue();var i=r.getValue();n.assert(a);n.assert(i);if(a.original===null){return false}if(!t.canBeFirstInStatement()&&t.firstInStatement()&&!d(r))return false;if(t.needsParens(true)&&!_(r)){return false}for(var l in f.getUnionOfKeys(a,i)){if(l==="loc")continue;t.stack.push(l,e.getFieldValue(a,l));r.stack.push(l,e.getFieldValue(i,l));var o=c(t,r,s);t.stack.length-=2;r.stack.length-=2;if(!o){return false}}return true}},{"./fast-path":168,"./lines":169,"./types":175,"./util":176,assert:110}],174:[function(l,D,j){var r=l("assert");var O=l("source-map");var L=l("./comments").printComments;var h=l("./lines");var n=h.fromString;var e=h.concat;var A=l("./options").normalize;var I=l("./patcher").getReprinter;var f=l("./types");var t=f.namedTypes;var E=f.builtInTypes.string;var P=f.builtInTypes.object;var s=l("./fast-path");var c=l("./util");function i(n,e){r.ok(this instanceof i);E.assert(n);this.code=n;if(e){P.assert(e);this.map=e}}var M=i.prototype;var g=false;M.toString=function(){if(!g){console.warn("Deprecation warning: recast.print now returns an object with "+"a .code property. You appear to be treating the object as a "+"string, which might still work but is strongly discouraged.");g=true}return this.code};var y=new i("");function v(n){r.ok(this instanceof v);var u=n&&n.tabWidth;var e=A(n);r.notStrictEqual(e,n);e.sourceFileName=null;function l(n){r.ok(n instanceof s);return L(n.getNode().comments,a(n),e)}function a(n,i){if(i)return l(n);r.ok(n instanceof s);if(!u){var o=e.tabWidth;var a=n.getNode().loc;if(a&&a.lines&&a.lines.guessTabWidth){e.tabWidth=a.lines.guessTabWidth();var c=t(n);e.tabWidth=o;return c}}return t(n)}function t(e){var n=I(e);if(n)return x(e,n(t));return f(e)}function f(n){return b(n,e,l)}function o(n){return b(n,e,o)}this.print=function(n){if(!n){return y}var t=a(s.from(n),true);return new i(t.toString(e),c.composeSourceMaps(e.inputSourceMap,t.getSourceMap(e.sourceMapName,e.sourceRoot)))};this.printGenerically=function(n){if(!n){return y}var t=s.from(n);var r=e.reuseWhitespace;e.reuseWhitespace=false;var l=new i(o(t).toString(e));e.reuseWhitespace=r;return l}}j.Printer=v;function x(t,n){return t.needsParens()?e(["(",n,")"]):n}function b(e,n,t){r.ok(e instanceof s);return x(e,k(e,n,t))}function k(l,f,i){var c=l.getValue();if(!c){return n("")}if(typeof c==="string"){return n(c,f)}t.Node.assert(c);switch(c.type){case"File":return l.call(i,"program");case"Program":return u(l.call(function(e){return o(e,f,i)},"body"));case"EmptyStatement":return n("");case"ExpressionStatement":return e([l.call(i,"expression"),";"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return n(" ").join([l.call(i,"left"),c.operator,l.call(i,"right")]);case"MemberExpression":var s=[l.call(i,"object")];if(c.computed)s.push("[",l.call(i,"property"),"]");else s.push(".",l.call(i,"property"));return e(s);case"Path":return n(".").join(c.body);case"Identifier":return n(c.name,f);case"SpreadElement":case"SpreadElementPattern":case"SpreadProperty":case"SpreadPropertyPattern":return e(["...",l.call(i,"argument")]);case"FunctionDeclaration":case"FunctionExpression":var s=[];if(c.async)s.push("async ");s.push("function");if(c.generator)s.push("*");if(c.id)s.push(" ",l.call(i,"id"));s.push("(",m(l,f,i),") ",l.call(i,"body"));return e(s);case"ArrowFunctionExpression":var s=[];if(c.async)s.push("async ");if(c.params.length===1){s.push(l.call(i,"params",0))}else{s.push("(",m(l,f,i),")")}s.push(" => ",l.call(i,"body"));return e(s);case"MethodDefinition":var s=[];if(c.static){s.push("static ")}s.push(w(l,f,i));return e(s);case"YieldExpression":var s=["yield"];if(c.delegate)s.push("*");if(c.argument)s.push(" ",l.call(i,"argument"));return e(s);case"AwaitExpression":var s=["await"];if(c.all)s.push("*");if(c.argument)s.push(" ",l.call(i,"argument"));return e(s);case"ModuleDeclaration":var s=["module",l.call(i,"id")];if(c.source){r.ok(!c.body);s.push("from",l.call(i,"source"))}else{s.push(l.call(i,"body"))}return n(" ").join(s);case"ImportSpecifier":case"ExportSpecifier":var s=[l.call(i,"id")];if(c.name)s.push(" as ",l.call(i,"name"));return e(s);case"ExportBatchSpecifier":return n("*");case"ImportNamespaceSpecifier":return e(["* as ",l.call(i,"id")]);case"ImportDefaultSpecifier":return l.call(i,"id");case"ExportDeclaration":var s=["export"];if(c["default"]){s.push(" default")}else if(c.specifiers&&c.specifiers.length>0){if(c.specifiers.length===1&&c.specifiers[0].type==="ExportBatchSpecifier"){s.push(" *")}else{s.push(" { ",n(", ").join(l.map(i,"specifiers"))," }")}if(c.source)s.push(" from ",l.call(i,"source"));s.push(";");return e(s)}if(c.declaration){if(!t.Node.check(c.declaration)){console.log(JSON.stringify(c,null,2))}var D=l.call(i,"declaration");s.push(" ",D);if(d(D)!==";"){s.push(";")}}return e(s);case"ImportDeclaration":var s=["import "];if(c.specifiers&&c.specifiers.length>0){var y=false;l.each(function(e){var l=e.getName();if(l>0){s.push(", ")}var n=e.getValue();if(t.ImportDefaultSpecifier.check(n)||t.ImportNamespaceSpecifier.check(n)){r.strictEqual(y,false)}else{t.ImportSpecifier.assert(n);if(!y){y=true;s.push("{")}}s.push(i(e))},"specifiers");if(y){s.push("}")}s.push(" from ")}s.push(l.call(i,"source"),";");return e(s);case"BlockStatement":var O=l.call(function(e){return o(e,f,i)},"body");if(O.isEmpty()){return n("{}")}return e(["{\n",O.indent(f.tabWidth),"\n}"]);case"ReturnStatement":var s=["return"];if(c.argument){var E=l.call(i,"argument");if(E.length>1&&t.XJSElement&&t.XJSElement.check(c.argument)){s.push(" (\n",E.indent(f.tabWidth),"\n)")}else{s.push(" ",E)}}s.push(";");return e(s);case"CallExpression":return e([l.call(i,"callee"),_(l,f,i)]);case"ObjectExpression":case"ObjectPattern":var R=false,v=c.properties.length,s=[v>0?"{\n":"{"];l.map(function(e){var r=e.getName();var l=e.getValue();var t=i(e).indent(f.tabWidth);var n=t.length>1;if(n&&R){s.push("\n")}s.push(t);if(r<v-1){s.push(n?",\n\n":",\n");R=!n}},"properties");s.push(v>0?"\n}":"}");return e(s);case"PropertyPattern":return e([l.call(i,"key"),": ",l.call(i,"pattern")]);case"Property":if(c.method||c.kind==="get"||c.kind==="set"){return w(l,f,i)}if(c.shorthand){return l.call(i,"key")}return e([l.call(i,"key"),": ",l.call(i,"value")]);case"ArrayExpression":case"ArrayPattern":var X=c.elements,v=X.length,s=["["];l.each(function(e){var n=e.getName();var t=e.getValue();if(!t){s.push(",")}else{if(n>0)s.push(" ");s.push(i(e));if(n<v-1)s.push(",")}},"elements");s.push("]");return e(s);case"SequenceExpression":return n(", ").join(l.map(i,"expressions"));case"ThisExpression":return n("this");case"Literal":if(typeof c.value!=="string")return n(c.value,f);case"ModuleSpecifier":return n(T(c),f);case"UnaryExpression":var s=[c.operator];if(/[a-z]$/.test(c.operator))s.push(" ");s.push(l.call(i,"argument"));return e(s);case"UpdateExpression":var s=[l.call(i,"argument"),c.operator];if(c.prefix)s.reverse();return e(s);case"ConditionalExpression":return e(["(",l.call(i,"test")," ? ",l.call(i,"consequent")," : ",l.call(i,"alternate"),")"]);case"NewExpression":var s=["new ",l.call(i,"callee")];var N=c.arguments;if(N){s.push(_(l,f,i))}return e(s);case"VariableDeclaration":var s=[c.kind," "];var I=0;var x=l.map(function(n){var e=i(n);I=Math.max(e.length,I);return e},"declarations");if(I===1){s.push(n(", ").join(x))}else if(x.length>1){s.push(n(",\n").join(x).indentTail(c.kind.length+1))}else{s.push(x[0])}var b=l.getParentNode();if(!t.ForStatement.check(b)&&!t.ForInStatement.check(b)&&!(t.ForOfStatement&&t.ForOfStatement.check(b))){s.push(";")}return e(s);case"VariableDeclarator":return c.init?n(" = ").join([l.call(i,"id"),l.call(i,"init")]):l.call(i,"id");case"WithStatement":return e(["with (",l.call(i,"object"),") ",l.call(i,"body")]);case"IfStatement":var C=a(l.call(i,"consequent"),f),s=["if (",l.call(i,"test"),")",C];if(c.alternate)s.push(S(C)?" else":"\nelse",a(l.call(i,"alternate"),f));return e(s);case"ForStatement":var A=l.call(i,"init"),V=A.length>1?";\n":"; ",L="for (",F=n(V).join([A,l.call(i,"test"),l.call(i,"update")]).indentTail(L.length),P=e([L,F,")"]),k=a(l.call(i,"body"),f),s=[P];if(P.length>1){s.push("\n");k=k.trimLeft()}s.push(k);return e(s);case"WhileStatement":return e(["while (",l.call(i,"test"),")",a(l.call(i,"body"),f)]);case"ForInStatement":return e([c.each?"for each (":"for (",l.call(i,"left")," in ",l.call(i,"right"),")",a(l.call(i,"body"),f)]);case"ForOfStatement":return e(["for (",l.call(i,"left")," of ",l.call(i,"right"),")",a(l.call(i,"body"),f)]);
case"DoWhileStatement":var j=e(["do",a(l.call(i,"body"),f)]),s=[j];if(S(j))s.push(" while");else s.push("\nwhile");s.push(" (",l.call(i,"test"),");");return e(s);case"BreakStatement":var s=["break"];if(c.label)s.push(" ",l.call(i,"label"));s.push(";");return e(s);case"ContinueStatement":var s=["continue"];if(c.label)s.push(" ",l.call(i,"label"));s.push(";");return e(s);case"LabeledStatement":return e([l.call(i,"label"),":\n",l.call(i,"body")]);case"TryStatement":var s=["try ",l.call(i,"block")];l.each(function(e){s.push(" ",i(e))},"handlers");if(c.finalizer)s.push(" finally ",l.call(i,"finalizer"));return e(s);case"CatchClause":var s=["catch (",l.call(i,"param")];if(c.guard)s.push(" if ",l.call(i,"guard"));s.push(") ",l.call(i,"body"));return e(s);case"ThrowStatement":return e(["throw ",l.call(i,"argument"),";"]);case"SwitchStatement":return e(["switch (",l.call(i,"discriminant"),") {\n",n("\n").join(l.map(i,"cases")),"\n}"]);case"SwitchCase":var s=[];if(c.test)s.push("case ",l.call(i,"test"),":");else s.push("default:");if(c.consequent.length>0){s.push("\n",l.call(function(e){return o(e,f,i)},"consequent").indent(f.tabWidth))}return e(s);case"DebuggerStatement":return n("debugger;");case"XJSAttribute":var s=[l.call(i,"name")];if(c.value)s.push("=",l.call(i,"value"));return e(s);case"XJSIdentifier":return n(c.name,f);case"XJSNamespacedName":return n(":").join([l.call(i,"namespace"),l.call(i,"name")]);case"XJSMemberExpression":return n(".").join([l.call(i,"object"),l.call(i,"property")]);case"XJSSpreadAttribute":return e(["{...",l.call(i,"argument"),"}"]);case"XJSExpressionContainer":return e(["{",l.call(i,"expression"),"}"]);case"XJSElement":var M=l.call(i,"openingElement");if(c.openingElement.selfClosing){r.ok(!c.closingElement);return M}var B=e(l.map(function(n){var e=n.getValue();if(t.Literal.check(e)&&typeof e.value==="string"){if(/\S/.test(e.value)){return e.value.replace(/^\s+|\s+$/g,"")}else if(/\n/.test(e.value)){return"\n"}}return i(n)},"children")).indentTail(f.tabWidth);var U=l.call(i,"closingElement");return e([M,B,U]);case"XJSOpeningElement":var s=["<",l.call(i,"name")];var h=[];l.each(function(e){h.push(" ",i(e))},"attributes");var g=e(h);var q=g.length>1||g.getLineLength(1)>f.wrapColumn;if(q){h.forEach(function(n,e){if(n===" "){r.strictEqual(e%2,0);h[e]="\n"}});g=e(h).indentTail(f.tabWidth)}s.push(g,c.selfClosing?" />":">");return e(s);case"XJSClosingElement":return e(["</",l.call(i,"name"),">"]);case"XJSText":return n(c.value,f);case"XJSEmptyExpression":return n("");case"TypeAnnotatedIdentifier":return e([l.call(i,"annotation")," ",l.call(i,"identifier")]);case"ClassBody":if(c.body.length===0){return n("{}")}return e(["{\n",l.call(function(e){return o(e,f,i)},"body").indent(f.tabWidth),"\n}"]);case"ClassPropertyDefinition":var s=["static ",l.call(i,"definition")];if(!t.MethodDefinition.check(c.definition))s.push(";");return e(s);case"ClassProperty":return e([l.call(i,"id"),";"]);case"ClassDeclaration":case"ClassExpression":var s=["class"];if(c.id)s.push(" ",l.call(i,"id"));if(c.superClass)s.push(" extends ",l.call(i,"superClass"));s.push(" ",l.call(i,"body"));return e(s);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Block":case"Line":throw new Error("unprintable type: "+JSON.stringify(c.type));case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"TaggedTemplateExpression":case"TemplateElement":case"TemplateLiteral":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"AnyTypeAnnotation":case"BooleanTypeAnnotation":case"ClassImplements":case"DeclareClass":case"DeclareFunction":case"DeclareModule":case"DeclareVariable":case"FunctionTypeAnnotation":case"FunctionTypeParam":case"GenericTypeAnnotation":case"InterfaceDeclaration":case"InterfaceExtends":case"IntersectionTypeAnnotation":case"MemberTypeAnnotation":case"NullableTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"QualifiedTypeIdentifier":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"TupleTypeAnnotation":case"Type":case"TypeAlias":case"TypeAnnotation":case"TypeParameterDeclaration":case"TypeParameterInstantiation":case"TypeofTypeAnnotation":case"UnionTypeAnnotation":case"VoidTypeAnnotation":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:debugger;throw new Error("unknown type: "+JSON.stringify(c.type))}return p}function o(l,s,o){var a=t.ClassBody&&t.ClassBody.check(l.getParentNode());var n=[];l.each(function(r){var l=r.getName();var e=r.getValue();if(!e){return}if(e.type==="EmptyStatement"){return}if(!a){t.Statement.assert(e)}n.push({node:e,printed:o(r)})});var i=null;var c=n.length;var r=[];n.forEach(function(h,g){var o=h.printed;var f=h.node;var y=true;var v=o.length>1;var w=g>0;var m=g<c-1;var p;var e;if(a){if(t.MethodDefinition.check(f)||t.ClassPropertyDefinition.check(f)&&t.MethodDefinition.check(f.definition)){y=false}}if(y){o=u(o)}var n=s.reuseWhitespace&&R(f);var l=n&&n.lines;if(w){if(l){var x=l.skipSpaces(n.start,true);var b=x?x.line:1;var E=n.start.line-b;p=Array(E+1).join("\n")}else{p=v?"\n\n":"\n"}}else{p=""}if(m){if(l){var d=l.skipSpaces(n.end);var _=d?d.line:l.length;var S=_-n.end.line;e=Array(S+1).join("\n")}else{e=v?"\n\n":"\n"}}else{e=""}r.push(C(i,p),o);if(m){i=e}else if(e){r.push(e)}});return e(r)}function R(e){if(!e.loc){return null}if(!e.comments){return e.loc}var n=e.loc.start;var t=e.loc.end;e.comments.forEach(function(e){if(e.loc){if(c.comparePos(e.loc.start,n)<0){n=e.loc.start}if(c.comparePos(t,e.loc.end)<0){t=e.loc.end}}});return{lines:e.loc.lines,start:n,end:t}}function C(e,t){if(!e&&!t){return n("")}if(!e){return n(t)}if(!t){return n(e)}var r=n(e);var l=n(t);if(l.length>r.length){return l}return r}function w(a,o,s){var i=a.getNode();var n=i.kind;var l=[];t.FunctionExpression.assert(i.value);if(i.value.async){l.push("async ")}if(!n||n==="init"){if(i.value.generator){l.push("*")}}else{r.ok(n==="get"||n==="set");l.push(n," ")}l.push(a.call(s,"key"),"(",a.call(function(e){return m(e,o,s)},"value"),") ",a.call(s,"value","body"));return e(l)}function _(a,r,i){var l=a.map(i,"arguments");var t=n(", ").join(l);if(t.getLineLength(1)>r.wrapColumn){t=n(",\n").join(l);return e(["(\n",t.indent(r.tabWidth),"\n)"])}return e(["(",t,")"])}function m(a,o,i){var s=a.getValue();t.Function.assert(s);var r=a.map(i,"params");if(s.defaults){a.each(function(n){var t=n.getName();var l=r[t];if(l&&n.getValue()){r[t]=e([l,"=",i(n)])}},"defaults")}if(s.rest){r.push(e(["...",a.call(i,"rest")]))}var l=n(", ").join(r);if(l.length>1||l.getLineLength(1)>o.wrapColumn){l=n(",\n").join(r);return e(["\n",l.indent(o.tabWidth)])}return l}function a(n,t){if(n.length>1)return e([" ",n]);return e(["\n",u(n).indent(t.tabWidth)])}function d(e){var n=e.lastPos();do{var t=e.charAt(n);if(/\S/.test(t))return t}while(e.prevPos(n))}function S(e){return d(e)==="}"}function T(e){t.Literal.assert(e);E.assert(e.value);return JSON.stringify(e.value)}function u(n){var t=d(n);if(!t||"\n};".indexOf(t)<0)return e([n,";"]);return n}},{"./comments":167,"./fast-path":168,"./lines":169,"./options":171,"./patcher":173,"./types":175,"./util":176,assert:110,"source-map":186}],175:[function(t,r,l){var e=t("ast-types");var n=e.Type.def;n("File").bases("Node").build("program").field("program",n("Program"));e.finalize();r.exports=e},{"ast-types":108}],176:[function(e,u,n){var c=e("assert");var o=e("./types").getFieldValue;var t=e("source-map");var r=t.SourceMapConsumer;var l=t.SourceMapGenerator;var a=Object.prototype.hasOwnProperty;function i(){var t={};var l=arguments.length;for(var e=0;e<l;++e){var r=Object.keys(arguments[e]);var a=r.length;for(var n=0;n<a;++n){t[r[n]]=true}}return t}n.getUnionOfKeys=i;function s(e,n){return e.line-n.line||e.column-n.column}n.comparePos=s;n.composeSourceMaps=function(n,e){if(n){if(!e){return n}}else{return e||null}var i=new r(n);var o=new r(e);var t=new l({file:e.file,sourceRoot:e.sourceRoot});var s={};o.eachMapping(function(n){var r=i.originalPositionFor({line:n.originalLine,column:n.originalColumn});var e=r.source;if(e===null){return}t.addMapping({source:e,original:{line:r.line,column:r.column},generated:{line:n.generatedLine,column:n.generatedColumn},name:n.name});var l=i.sourceContentFor(e);if(l&&!a.call(s,e)){s[e]=l;t.setSourceContent(e,l)}});return t.toJSON()}},{"./types":175,assert:110,"source-map":186}],177:[function(e,t,n){(function(t){var r=e("./lib/types");var l=e("./lib/parser").parse;var a=e("./lib/printer").Printer;function i(e,n){return new a(n).print(e)}function s(e,n){return new a(n).printGenerically(e)}function o(e,n){return u(t.argv[2],e,n)}function u(n,t,r){e("fs").readFile(n,"utf-8",function(e,n){if(e){console.error(e);return}f(n,t,r)})}function c(e){t.stdout.write(e)}function f(n,t,e){var r=e&&e.writeback||c;t(l(n,e),function(n){r(i(n,e).code)})}Object.defineProperties(n,{parse:{enumerable:true,value:l},visit:{enumerable:true,value:r.visit},print:{enumerable:true,value:i},prettyPrint:{enumerable:false,value:s},types:{enumerable:false,value:r},run:{enumerable:false,value:o}})}).call(this,e("_process"))},{"./lib/parser":172,"./lib/printer":174,"./lib/types":175,_process:119,fs:109}],178:[function(e,n,t){(function(l){var a=e("stream");t=n.exports=r;r.through=r;function r(t,r,s){t=t||function(e){this.queue(e)};r=r||function(){this.queue(null)};var i=false,o=false,n=[],u=false;var e=new a;e.readable=e.writable=true;e.paused=false;e.autoDestroy=!(s&&s.autoDestroy===false);e.write=function(n){t.call(this,n);return!e.paused};function c(){while(n.length&&!e.paused){var t=n.shift();if(null===t)return e.emit("end");else e.emit("data",t)}}e.queue=e.push=function(t){if(u)return e;if(t==null)u=true;n.push(t);c();return e};e.on("end",function(){e.readable=false;if(!e.writable&&e.autoDestroy)l.nextTick(function(){e.destroy()})});function f(){e.writable=false;r.call(e);if(!e.readable&&e.autoDestroy)e.destroy()}e.end=function(n){if(i)return;i=true;if(arguments.length)e.write(n);f();return e};e.destroy=function(){if(o)return;o=true;i=true;n.length=0;e.writable=e.readable=false;e.emit("close");return e};e.pause=function(){if(e.paused)return;e.paused=true;return e};e.resume=function(){if(e.paused){e.paused=false;e.emit("resume")}c();if(!e.paused)e.emit("drain");return e};return e}}).call(this,e("_process"))},{_process:119,stream:131}],179:[function(n,e,t){(function(n){!function(h){"use strict";var r=Object.prototype.hasOwnProperty;var t;var d=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";var m=typeof e==="object";var n=h.regeneratorRuntime;if(n){if(m){e.exports=n}return}n=h.regeneratorRuntime=m?e.exports:{};function b(e,n,t,r){return new y(e,n,t||null,r||[])}n.wrap=b;function f(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(r){return{type:"throw",arg:r}}}var c="suspendedStart";var u="suspendedYield";var g="executing";var s="completed";var o={};function i(){}function a(){}var l=a.prototype=y.prototype;i.prototype=l.constructor=a;a.constructor=i;i.displayName="GeneratorFunction";n.isGeneratorFunction=function(n){var e=typeof n==="function"&&n.constructor;return e?e===i||(e.displayName||e.name)==="GeneratorFunction":false};n.mark=function(e){e.__proto__=a;e.prototype=Object.create(l);return e};n.async=function(e,n,t,r){return new Promise(function(s,o){var l=b(e,n,t,r);var a=i.bind(l.next);var u=i.bind(l["throw"]);function i(t){var e=f(this,null,t);if(e.type==="throw"){o(e.arg);return}var n=e.arg;if(n.done){s(n.value)}else{Promise.resolve(n.value).then(a,u)}}a()})};function y(i,a,d,m){var r=a?Object.create(a.prototype):this;var e=new p(m);var n=c;function l(l,r){if(n===g){throw new Error("Generator is already running")}if(n===s){return E()}while(true){var p=e.delegate;if(p){var a=f(p.iterator[l],p.iterator,r);if(a.type==="throw"){e.delegate=null;l="throw";r=a.arg;continue}l="next";r=t;var m=a.arg;if(m.done){e[p.resultName]=m.value;e.next=p.nextLoc}else{n=u;return m}e.delegate=null}if(l==="next"){if(n===c&&typeof r!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(r)+" to newborn generator")}if(n===u){e.sent=r}else{delete e.sent}}else if(l==="throw"){if(n===c){n=s;throw r}if(e.dispatchException(r)){l="next";r=t}}else if(l==="return"){e.abrupt("return",r)}n=g;var a=f(i,d,e);if(a.type==="normal"){n=e.done?s:u;var m={value:a.arg,done:e.done};if(a.arg===o){if(e.delegate&&l==="next"){r=t}}else{return m}}else if(a.type==="throw"){n=s;if(l==="next"){e.dispatchException(a.arg)}else{r=a.arg}}}}r.next=l.bind(r,"next");r["throw"]=l.bind(r,"throw");r["return"]=l.bind(r,"return");return r}l[d]=function(){return this};l.toString=function(){return"[object Generator]"};function w(e){var n={tryLoc:e[0]};if(1 in e){n.catchLoc=e[1]}if(2 in e){n.finallyLoc=e[2]}this.tryEntries.push(n)}function x(n,t){var e=n.completion||{};e.type=t===0?"normal":"return";delete e.arg;n.completion=e}function p(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(w,this);this.reset()}n.keys=function(n){var e=[];for(var t in n){e.push(t)}e.reverse();return function r(){while(e.length){var t=e.pop();if(t in n){r.value=t;r.done=false;return r}}r.done=true;return r}};function v(e){if(e){var l=e[d];if(l){return l.call(e)}if(typeof e.next==="function"){return e}if(!isNaN(e.length)){var n=-1,a=function i(){while(++n<e.length){if(r.call(e,n)){i.value=e[n];i.done=false;return i}}i.value=t;i.done=true;return i};return a.next=a}}return{next:E}}n.values=v;function E(){return{value:t,done:true}}p.prototype={constructor:p,reset:function(){this.prev=0;this.next=0;this.sent=t;this.done=false;this.delegate=null;this.tryEntries.forEach(x);for(var e=0,n;r.call(this,n="t"+e)||e<20;++e){this[n]=null}},stop:function(){this.done=true;var n=this.tryEntries[0];var e=n.completion;if(e.type==="throw"){throw e.arg}return this.rval},dispatchException:function(l){if(this.done){throw l}var o=this;function n(e,n){a.type="throw";a.arg=l;o.next=e;return!!n}for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];var a=e.completion;if(e.tryLoc==="root"){return n("end")}if(e.tryLoc<=this.prev){var i=r.call(e,"catchLoc");var s=r.call(e,"finallyLoc");if(i&&s){if(this.prev<e.catchLoc){return n(e.catchLoc,true)}else if(this.prev<e.finallyLoc){return n(e.finallyLoc)}}else if(i){if(this.prev<e.catchLoc){return n(e.catchLoc,true)}}else if(s){if(this.prev<e.finallyLoc){return n(e.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc<=this.prev&&r.call(e,"finallyLoc")&&(e.finallyLoc===t||this.prev<e.finallyLoc)){return e}}},abrupt:function(t,r){var e=this._findFinallyEntry();var n=e?e.completion:{};n.type=t;n.arg=r;if(e){this.next=e.finallyLoc}else{this.complete(n)}return o},complete:function(e){if(e.type==="throw"){throw e.arg}if(e.type==="break"||e.type==="continue"){this.next=e.arg}else if(e.type==="return"){this.rval=e.arg;this.next="end"}return o},finish:function(e){var n=this._findFinallyEntry(e);return this.complete(n.completion)},"catch":function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var t=n.completion;if(t.type==="throw"){var l=t.arg;x(n,e)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){this.delegate={iterator:v(e),resultName:n,nextLoc:t};return o}}}(typeof n==="object"?n:typeof window==="object"?window:this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],180:[function(t,r,n){var e=t("regenerate");n.REGULAR={d:e().addRange(48,57),D:e().addRange(0,47).addRange(58,65535),s:e(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:e().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:e(95).addRange(48,57).addRange(65,90).addRange(97,122),W:e(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)};n.UNICODE={d:e().addRange(48,57),D:e().addRange(0,47).addRange(58,1114111),s:e(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:e().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:e(95).addRange(48,57).addRange(65,90).addRange(97,122),W:e(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)};n.UNICODE_IGNORE_CASE={d:e().addRange(48,57),D:e().addRange(0,47).addRange(58,1114111),s:e(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:e().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:e(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:e(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:182}],181:[function(n,e,t){e.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},{}],182:[function(t,e,n){(function(t){(function(_){var h=typeof n=="object"&&n;var S=typeof e=="object"&&e&&e.exports==h&&e;var c=typeof t=="object"&&t;if(c.global===c||c.window===c){_=c}var f={rangeOrder:"A range’s `stop` value must be greater than or equal "+"to the `start` value.",codePointRange:"Invalid code point value. Code points range from "+"U+000000 to U+10FFFF."};var r=55296;var l=56319;var o=56320;var v=57343;var X=/\\x00([^0123456789]|$)/g;var R={};var U=R.hasOwnProperty;var F=function(t,n){var e;for(e in n){if(U.call(n,e)){t[e]=n[e]}}return t};var g=function(n,t){var e=-1;var r=n.length;while(++e<r){t(n[e],e)}};var j=R.toString;var T=function(e){return j.call(e)=="[object Array]"};var s=function(e){return typeof e=="number"||j.call(e)=="[object Number]"};var V="0000";var D=function(t,n){var e=String(t);return e.length<n?(V+e).slice(-n):e};var w=function(e){return Number(e).toString(16).toUpperCase()};var E=[].slice;var Y=function(a){var l=-1;var i=a.length;var s=i-1;var n=[];var r=true;var e;var t=0;while(++l<i){e=a[l];if(r){n.push(e);t=e;r=false}else{if(e==t+1){if(l!=s){t=e;continue}else{r=true;n.push(e+1)}}else{n.push(t+1,e);t=e}}}if(!r){n.push(e+1)}return n};var k=function(e,n){var t=0;var r;var l;var a=e.length;while(t<a){r=e[t];l=e[t+1];if(n>=r&&n<l){if(n==r){if(l==r+1){e.splice(t,2);return e}else{e[t]=n+1;return e}}else if(n==l-1){e[t+1]=n;return e}else{e.splice(t,2,r,n,n+1,l);return e}}t+=2}return e};var I=function(e,r,t){if(t<r){throw Error(f.rangeOrder)}var n=0;var l;var a;while(n<e.length){l=e[n];a=e[n+1]-1;if(l>t){return e}if(r<=l&&t>=a){e.splice(n,2);continue}if(r>=l&&t<a){if(r==l){e[n]=t+1;e[n+1]=a+1;return e}e.splice(n,2,l,r,t+1,a+1);return e}if(r>=l&&r<=a){e[n+1]=r}else if(t>=l&&t<=a){e[n]=t+1;return e}n+=2}return e};var p=function(e,n){var t=0;var r;var l;var a=null;var i=e.length;if(n<0||n>1114111){throw RangeError(f.codePointRange)}while(t<i){r=e[t];l=e[t+1];if(n>=r&&n<l){return e}if(n==r-1){e[t]=n;return e}if(r>n){e.splice(a!=null?a+2:0,0,n,n+1);return e}if(n==l){if(n+1==e[t+2]){e.splice(t,4,r,e[t+3]);return e}e[t+1]=n+1;return e}a=t;t+=2}e.push(n,n+1);return e};var C=function(a,r){var n=0;var t;var l;var e=a.slice();var i=r.length;while(n<i){t=r[n];l=r[n+1]-1;if(t==l){e=p(e,t)}else{e=d(e,t,l)}n+=2}return e};var B=function(a,r){var n=0;var t;var l;var e=a.slice();var i=r.length;while(n<i){t=r[n];l=r[n+1]-1;if(t==l){e=k(e,t)}else{e=I(e,t,l)}n+=2}return e};var d=function(e,n,t){if(t<n){throw Error(f.rangeOrder)}if(n<0||n>1114111||t<0||t>1114111){throw RangeError(f.codePointRange)}var r=0;var l;var a;var i=false;var s=e.length;while(r<s){l=e[r];a=e[r+1];if(i){if(l==t+1){e.splice(r-1,2);return e}if(l>t){return e}if(l>=n&&l<=t){if(a>n&&a-1<=t){e.splice(r,2);r-=2}else{e.splice(r-1,2);r-=2}}}else if(l==t+1){e[r]=n;return e}else if(l>t){e.splice(r,0,n,t+1);return e}else if(n>=l&&n<a&&t+1<=a){return e}else if(n>=l&&n<a||a==n){e[r+1]=t+1;i=true}else if(n<=l&&t+1>=a){e[r]=n;e[r+1]=t+1;i=true}r+=2}if(!i){e.push(n,t+1)}return e};var L=function(n,t){var e=0;var r;var l;var a=n.length;while(e<a){r=n[e];l=n[e+1];if(t>=r&&t<l){return true}e+=2}return false};var J=function(l,t){var e=0;var a=t.length;var n;var r=[];while(e<a){n=t[e];if(L(l,n)){r.push(n)}++e}return Y(r)};var y=function(e){return!e.length};var b=function(e){return e.length==2&&e[0]+1==e[1]};var O=function(t){var e=0;var n;var r;var l=[];var a=t.length;while(e<a){n=t[e];r=t[e+1];while(n<r){l.push(n);++n}e+=2}return l};var $=Math.floor;var M=function(e){return parseInt($((e-65536)/1024)+r,10)};var P=function(e){return parseInt((e-65536)%1024+o,10)};var A=String.fromCharCode;var u=function(e){var n;if(e==9){n="\\t"}else if(e==10){n="\\n"}else if(e==12){n="\\f"}else if(e==13){n="\\r"}else if(e==92){n="\\\\"}else if(e==36||e>=40&&e<=43||e==45||e==46||e==63||e>=91&&e<=94||e>=123&&e<=125){n="\\"+A(e)}else if(e>=32&&e<=126){n=A(e)}else if(e<=255){n="\\x"+D(w(e),2)}else{n="\\u"+D(w(e),4)}return n};var i=function(n){var a=n.length;var e=n.charCodeAt(0);var t;if(e>=r&&e<=l&&a>1){t=n.charCodeAt(1);return(e-r)*1024+t-o+65536}return e};var m=function(n){var r="";var l=0;var e;var t;var a=n.length;if(b(n)){return u(n[0])}while(l<a){e=n[l];t=n[l+1]-1;if(e==t){r+=u(e)}else if(e+1==t){r+=u(e)+u(t)}else{r+=u(e)+"-"+u(t)}l+=2}return"["+r+"]"};var q=function(s){var a=[];var t=[];var o=[];var i=0;var e;var n;var u=s.length;while(i<u){e=s[i];n=s[i+1]-1;if(e<=65535&&n<=65535){if(e>=r&&e<=l){if(n<=l){a.push(e,n+1)}else{a.push(e,l+1);t.push(l+1,n+1)}}else if(n>=r&&n<=l){t.push(e,r);a.push(r,n+1)}else if(e<r&&n>l){t.push(e,r,l+1,n+1);a.push(r,l+1)}else{t.push(e,n+1)}}else if(e<=65535&&n>65535){if(e>=r&&e<=l){a.push(e,l+1);t.push(l+1,65535+1)}else if(e<r){t.push(e,r,l+1,65535+1);a.push(r,l+1)}else{t.push(e,65535+1)}o.push(65535+1,n+1)}else{o.push(e,n+1)}i+=2}return{loneHighSurrogates:a,bmp:t,astral:o}};var N=function(i){var u=[];var t=[];var c=false;var n;var e;var a;var o;var s;var l;var r=-1;var f=i.length;while(++r<f){n=i[r];e=i[r+1];if(!e){u.push(n);continue}a=n[0];o=n[1];s=e[0];l=e[1];t=o;while(s&&a[0]==s[0]&&a[1]==s[1]){if(b(l)){t=p(t,l[0])}else{t=d(t,l[0],l[1]-1)}++r;n=i[r];a=n[0];o=n[1];e=i[r+1];s=e&&e[0];l=e&&e[1];c=true}u.push([a,c?t:o]);c=false}return G(u)};var G=function(e){if(e.length==1){return e}var l=-1;var n=-1;while(++l<e.length){var t=e[l];var a=t[1];var c=a[0];var o=a[1];n=l;while(++n<e.length){var r=e[n];var i=r[1];var u=i[0];var s=i[1];if(c==u&&o==s){if(b(r[0])){t[0]=p(t[0],r[0][0])}else{t[0]=d(t[0],r[0][0],r[0][1]-1)}e.splice(n,1);--n}}}return e};var W=function(l){if(!l.length){return[]}var s=0;var c;var u;var e;var a;var d=0;var p=0;var y=[];var n;var r;var t=[];var m=l.length;var g=[];while(s<m){c=l[s];u=l[s+1]-1;e=M(c);a=P(c);n=M(u);r=P(u);var h=a==o;var f=r==v;var i=false;if(e==n||h&&f){t.push([[e,n+1],[a,r+1]]);i=true}else{t.push([[e,e+1],[a,v+1]])}if(!i&&e+1<n){if(f){t.push([[e+1,n+1],[o,r+1]]);i=true}else{t.push([[e+1,n],[o,v+1]])}}if(!i){t.push([[n,n+1],[o,r+1]])}d=e;p=n;s+=2}return N(t)};var H=function(n){var e=[];g(n,function(n){var t=n[0];var r=n[1];e.push(m(t)+m(r))});return e.join("|")};var z=function(s){var e=[];var n=q(s);var r=n.loneHighSurrogates;var t=n.bmp;var o=n.astral;var l=!y(n.astral);var a=!y(r);var i=W(o);if(!l&&a){t=C(t,r)}if(!y(t)){e.push(m(t))}if(i.length){e.push(H(i))}if(l&&a){e.push(m(r))}return e.join("|")};var a=function(e){if(arguments.length>1){e=E.call(arguments)}if(this instanceof a){this.data=[];return e?this.add(e):this}return(new a).add(e)};a.version="1.0.1";var x=a.prototype;F(x,{add:function(e){var n=this;if(e==null){return n}if(e instanceof a){n.data=C(n.data,e.data);return n}if(arguments.length>1){e=E.call(arguments)}if(T(e)){g(e,function(e){n.add(e)});return n}n.data=p(n.data,s(e)?e:i(e));return n},remove:function(e){var n=this;if(e==null){return n}if(e instanceof a){n.data=B(n.data,e.data);return n}if(arguments.length>1){e=E.call(arguments)}if(T(e)){g(e,function(e){n.remove(e)});return n}n.data=k(n.data,s(e)?e:i(e));return n},addRange:function(e,n){var t=this;t.data=d(t.data,s(e)?e:i(e),s(n)?n:i(n));return t},removeRange:function(e,n){var t=this;var r=s(e)?e:i(e);var l=s(n)?n:i(n);t.data=I(t.data,r,l);return t},intersection:function(e){var n=this;var t=e instanceof a?O(e.data):e;n.data=J(n.data,t);return n},contains:function(e){return L(this.data,s(e)?e:i(e))},clone:function(){var e=new a;e.data=this.data.slice(0);return e},toString:function(){var e=z(this.data);return e.replace(X,"\\0$1")},toRegExp:function(e){return RegExp(this.toString(),e||"")},valueOf:function(){return O(this.data)}});x.toArray=x.valueOf;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return a})}else if(h&&!h.nodeType){if(S){S.exports=a}else{h.regenerate=a}}else{_.regenerate=a}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],183:[function(t,e,n){(function(t){(function(){"use strict";var i={"function":true,object:true};var u=i[typeof window]&&window||this;var R=u;var s=i[typeof n]&&n;var p=i[typeof e]&&e&&!e.nodeType&&e;var a=s&&p&&typeof t=="object"&&t;if(a&&(a.global===a||a.window===a||a.self===a)){u=a}var b=String.fromCharCode;var d=Math.floor;function o(){var s=16384;var n=[];var l;var a;var t=-1;var r=arguments.length;if(!r){return""}var i="";while(++t<r){var e=Number(arguments[t]);if(!isFinite(e)||e<0||e>1114111||d(e)!=e){throw RangeError("Invalid code point: "+e)}if(e<=65535){n.push(e)}else{e-=65536;l=(e>>10)+55296;a=e%1024+56320;n.push(l,a)}if(t+1==r||n.length>s){i+=b.apply(null,n);n.length=0}}return i}function l(n,e){if(e.indexOf("|")==-1){if(n==e){return}throw Error("Invalid node type: "+n)}e=l.hasOwnProperty(e)?l[e]:l[e]=RegExp("^(?:"+e+")$");if(e.test(n)){return}throw Error("Invalid node type: "+n)}function r(n){var e=n.type;if(r.hasOwnProperty(e)&&typeof r[e]=="function"){return r[e](n)}throw Error("Invalid node type: "+e)}function m(n){l(n.type,"alternative");var e=n.body,t=e?e.length:0;if(t==1){return f(e[0])}else{var r=-1,a="";while(++r<t){a+=f(e[r])}return a}}function I(e){l(e.type,"anchor");switch(e.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function g(e){l(e.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value");return r(e)}function y(n){l(n.type,"characterClass");var t=n.body,a=t?t.length:0;var r=-1,e="[";if(n.negative){e+="^"}while(++r<a){e+=c(t[r])}e+="]";return e}function v(e){l(e.type,"characterClassEscape");return"\\"+e.value}function x(e){l(e.type,"characterClassRange");var n=e.min,t=e.max;if(n.type=="characterClassRange"||t.type=="characterClassRange"){throw Error("Invalid character class range")}return c(n)+"-"+c(t)}function c(e){l(e.type,"anchor|characterClassEscape|characterClassRange|dot|value");return r(e)}function E(i){l(i.type,"disjunction");var e=i.body,n=e?e.length:0;if(n==0){throw Error("No body")}else if(n==1){return r(e[0])}else{var t=-1,a="";while(++t<n){if(t!=0){a+="|"}a+=r(e[t])}return a}}function w(e){l(e.type,"dot");return"."}function _(n){l(n.type,"group");var e="(";switch(n.behavior){case"normal":break;case"ignore":e+="?:";break;case"lookahead":e+="?=";break;case"negativeLookahead":e+="?!";break;default:throw Error("Invalid behaviour: "+n.behaviour)}var t=n.body,a=t?t.length:0;if(a==1){e+=r(t[0])}else{var i=-1;while(++i<a){e+=r(t[i])}}e+=")";return e}function S(t){l(t.type,"quantifier");var e="",n=t.min,r=t.max;switch(r){case undefined:case null:switch(n){case 0:e="*";break;case 1:e="+";break;default:e="{"+n+",}";break}break;default:if(n==r){e="{"+n+"}"}else if(n==0&&r==1){e="?"}else{e="{"+n+","+r+"}"}break}if(!t.greedy){e+="?"}return g(t.body[0])+e}function k(e){l(e.type,"reference");return"\\"+e.matchIndex}function f(e){l(e.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value");return r(e)}function h(n){l(n.type,"value");var t=n.kind,e=n.codePoint;switch(t){case"controlLetter":return"\\c"+o(e+64);case"hexadecimalEscape":return"\\x"+("00"+e.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+o(e);case"null":return"\\"+e;case"octal":return"\\"+e.toString(8);case"singleEscape":switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+e)}case"symbol":return o(e);case"unicodeEscape":return"\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+e.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+t)}}r.alternative=m;r.anchor=I;r.characterClass=y;r.characterClassEscape=v;r.characterClassRange=x;r.disjunction=E;r.dot=w;r.group=_;r.quantifier=S;r.reference=k;r.value=h;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return{generate:r}})}else if(s&&p){s.generate=r}else{u.regjsgen={generate:r}}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})
},{}],184:[function(n,e,t){(function(){function t(r,L){var m=(L||"").indexOf("u")!==-1;var e=0;var g=0;function l(e){e.raw=r.substring(e.range[0],e.range[1]);return e}function S(e,n){e.range[0]=n;return l(e)}function o(n,t){return l({type:"anchor",kind:n,range:[e-t,e]})}function p(e,n,t,r){return l({type:"value",kind:e,codePoint:n,range:[t,r]})}function a(t,r,l,n){n=n||0;return p(t,r,e-(l.length+n),e)}function u(l){var r=l[0];var n=r.charCodeAt(0);if(m){var t;if(r.length===1&&n>=55296&&n<=56319){t=T().charCodeAt(0);if(t>=56320&&t<=57343){e++;return p("symbol",(n-55296)*1024+t-56320+65536,e-2,e)}}}return p("symbol",n,e-1,e)}function z(e,n,t){return l({type:"disjunction",body:e,range:[n,t]})}function G(){return l({type:"dot",range:[e-1,e]})}function J(n){return l({type:"characterClassEscape",value:n,range:[e-2,e]})}function F(n){return l({type:"reference",matchIndex:parseInt(n,10),range:[e-1-n.length,e]})}function N(e,n,t,r){return l({type:"group",behavior:e,body:n,range:[t,r]})}function s(r,a,t,n){if(n==null){t=e-1;n=e}return l({type:"quantifier",min:r,max:a,greedy:true,body:null,range:[t,n]})}function D(e,n,t){return l({type:"alternative",body:e,range:[n,t]})}function v(e,n,t,r){return l({type:"characterClass",body:e,negative:n,range:[t,r]})}function x(e,n,t,r){if(e.codePoint>n.codePoint){throw SyntaxError("invalid range in character class")}return l({type:"characterClassRange",min:e,max:n,range:[t,r]})}function b(e){if(e.type==="alternative"){return e.body}else{return[e]}}function $(e){return e.type==="empty"}function f(n){n=n||1;var t=r.substring(e,e+n);e+=n||1;return t}function c(e){if(!n(e)){throw SyntaxError("character: "+e)}}function n(n){if(r.indexOf(n,e)===e){return f(n.length)}}function T(){return r[e]}function i(n){return r.indexOf(n,e)===e}function R(n){return r[e+1]===n}function t(t){var l=r.substring(e);var n=l.match(t);if(n){n.range=[];n.range[0]=e;f(n[0].length);n.range[1]=e}return n}function A(){var t=[],r=e;t.push(k());while(n("|")){t.push(k())}if(t.length===1){return t[0]}return z(t,r,e)}function k(){var n=[],r=e;var t;while(t=U()){n.push(t)}if(n.length===1){return n[0]}return D(n,r,e)}function U(){if(e>=r.length||i("|")||i(")")){return null}var l=j();if(l){return l}var n=O();if(!n){throw SyntaxError("Expected atom")}var t=M()||false;if(t){t.body=b(n);S(t,n.range[0]);return t}return n}function E(l,a,i,s){var t=null,o=e;if(n(l)){t=a}else if(n(i)){t=s}else{return false}var r=A();if(!r){throw SyntaxError("Expected disjunction")}c(")");var u=N(t,b(r),o,e);if(t=="normal"){g++}return u}function j(){var t,r=e;if(n("^")){return o("start",1)}else if(n("$")){return o("end",1)}else if(n("\\b")){return o("boundary",2)}else if(n("\\B")){return o("not-boundary",2)}else{return E("(?=","lookahead","(?!","negativeLookahead")}}function M(){var e;var r;var l,a;if(n("*")){r=s(0)}else if(n("+")){r=s(1)}else if(n("?")){r=s(0,1)}else if(e=t(/^\{([0-9]+)\}/)){l=parseInt(e[1],10);r=s(l,l,e.range[0],e.range[1])}else if(e=t(/^\{([0-9]+),\}/)){l=parseInt(e[1],10);r=s(l,undefined,e.range[0],e.range[1])}else if(e=t(/^\{([0-9]+),([0-9]+)\}/)){l=parseInt(e[1],10);a=parseInt(e[2],10);if(l>a){throw SyntaxError("numbers out of order in {} quantifier")}r=s(l,a,e.range[0],e.range[1])}if(r){if(n("?")){r.greedy=false;r.range[1]+=1}}return r}function O(){var e;if(e=t(/^[^^$\\.*+?(){[|]/)){return u(e)}else if(n(".")){return G()}else if(n("\\")){e=I();if(!e){throw SyntaxError("atomEscape")}return e}else if(e=q()){return e}else{return E("(?:","ignore","(","normal")}}function y(n){if(m){var t,r;if(n.kind=="unicodeEscape"&&(t=n.codePoint)>=55296&&t<=56319&&i("\\")&&R("u")){var s=e;e++;var a=C();if(a.kind=="unicodeEscape"&&(r=a.codePoint)>=56320&&r<=57343){n.range[1]=a.range[1];n.codePoint=(t-55296)*1024+r-56320+65536;n.type="value";n.kind="unicodeCodePointEscape";l(n)}else{e=s}}}return n}function C(){return I(true)}function I(t){var e;e=B();if(e){return e}if(t){if(n("b")){return a("singleEscape",8,"\\b")}else if(n("B")){throw SyntaxError("\\B not possible inside of CharacterClass")}}e=Y();return e}function B(){var e,n;if(e=t(/^(?!0)\d+/)){n=e[0];var r=parseInt(e[0],10);if(r<=g){return F(e[0])}else{f(-e[0].length);if(e=t(/^[0-7]{1,3}/)){return a("octal",parseInt(e[0],8),e[0],1)}else{e=u(t(/^[89]/));return S(e,e.range[0]-1)}}}else if(e=t(/^[0-7]{1,3}/)){n=e[0];if(/^0{1,3}$/.test(n)){return a("null",0,"0",n.length+1)}else{return a("octal",parseInt(n,8),n,1)}}else if(e=t(/^[dDsSwW]/)){return J(e[0])}return false}function Y(){var e;if(e=t(/^[fnrtv]/)){var n=0;switch(e[0]){case"t":n=9;break;case"n":n=10;break;case"v":n=11;break;case"f":n=12;break;case"r":n=13;break}return a("singleEscape",n,"\\"+e[0])}else if(e=t(/^c([a-zA-Z])/)){return a("controlLetter",e[1].charCodeAt(0)%32,e[1],2)}else if(e=t(/^x([0-9a-fA-F]{2})/)){return a("hexadecimalEscape",parseInt(e[1],16),e[1],2)}else if(e=t(/^u([0-9a-fA-F]{4})/)){return y(a("unicodeEscape",parseInt(e[1],16),e[1],2))}else if(m&&(e=t(/^u\{([0-9a-fA-F]{1,})\}/))){return a("unicodeCodePointEscape",parseInt(e[1],16),e[1],4)}else{return X()}}function V(e){var n=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&n.test(String.fromCharCode(e))}function X(){var t="";var r="";var l;var e;if(!V(T())){e=f();return a("identifier",e.charCodeAt(0),e,1)}if(n(t)){return a("identifier",8204,t)}else if(n(r)){return a("identifier",8205,r)}return null}function q(){var r,l=e;if(r=t(/^\[\^/)){r=d();c("]");return v(r,true,l,e)}else if(n("[")){r=d();c("]");return v(r,false,l,e)}return null}function d(){var e;if(i("]")){return[]}else{e=W();if(!e){throw SyntaxError("nonEmptyClassRanges")}return e}}function _(t){var r,l,n;if(i("-")&&!R("]")){c("-");n=h();if(!n){throw SyntaxError("classAtom")}l=e;var a=d();if(!a){throw SyntaxError("classRanges")}r=t.range[0];if(a.type==="empty"){return[x(t,n,r,l)]}return[x(t,n,r,l)].concat(a)}n=H();if(!n){throw SyntaxError("nonEmptyClassRangesNoDash")}return[t].concat(n)}function W(){var e=h();if(!e){throw SyntaxError("classAtom")}if(i("]")){return[e]}return _(e)}function H(){var e=h();if(!e){throw SyntaxError("classAtom")}if(i("]")){return e}return _(e)}function h(){if(n("-")){return u("-")}else{return P()}}function P(){var e;if(e=t(/^[^\\\]-]/)){return u(e[0])}else if(n("\\")){e=C();if(!e){throw SyntaxError("classEscape")}return y(e)}}r=String(r);if(r===""){r="(?:)"}var w=A();if(w.range[1]!==r.length){throw SyntaxError("Could not parse entire input - got stuck: "+r)}return w}var n={parse:t};if(typeof e!=="undefined"&&e.exports){e.exports=n}else{window.regjsparser=n}})()},{}],185:[function(n,h,_){var E=n("regjsgen").generate;var s=n("regjsparser").parse;var r=n("regenerate");var c=n("./data/iu-mappings.json");var a=n("./data/character-class-escape-sets.js");function o(n){if(e){if(t){return a.UNICODE_IGNORE_CASE[n]}return a.UNICODE[n]}return a.REGULAR[n]}var b={};var v=b.hasOwnProperty;function y(e,n){return v.call(e,n)}var m=r().addRange(0,1114111);var d=r().addRange(0,65535);var p=m.clone().remove(10,13,8232,8233);var g=p.clone().intersection(d);r.prototype.iuAddRange=function(e,r){var n=this;do{var t=i(e);if(t){n.add(t)}}while(++e<=r);return n};function f(t,e){for(var n in e){t[n]=e[n]}}function l(t,n){var e=s(n,"");switch(e.type){case"characterClass":case"group":case"value":break;default:e=x(e,n)}f(t,e)}function x(e,n){return{type:"group",behavior:"ignore",body:[e],raw:"(?:"+n+")"}}function i(e){return y(c,e)?c[e]:false}var t=false;var e=false;function w(a){var n=r();var s=a.body.forEach(function(r){switch(r.type){case"value":n.add(r.codePoint);if(t&&e){var l=i(r.codePoint);if(l){n.add(l)}}break;case"characterClassRange":var a=r.min.codePoint;var s=r.max.codePoint;n.addRange(a,s);if(t&&e){n.iuAddRange(a,s)}break;case"characterClassEscape":n.add(o(r.value));break;default:throw Error("Unknown term type: "+r.type)}});if(a.negative){n=(e?m:d).clone().remove(n)}l(a,n.toString());return a}function u(n){switch(n.type){case"dot":l(n,(e?p:g).toString());break;case"characterClass":n=w(n);break;case"characterClassEscape":l(n,o(n.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":n.body=n.body.map(u);break;case"value":var a=n.codePoint;var s=r(a);if(t&&e){var c=i(a);if(c){s.add(c)}}l(n,s.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+n.type)}return n}h.exports=function(l,n){var r=s(l,n);t=n?n.indexOf("i")>-1:false;e=n?n.indexOf("u")>-1:false;f(r,u(r));return E(r)}},{"./data/character-class-escape-sets.js":180,"./data/iu-mappings.json":181,regenerate:182,regjsgen:183,regjsparser:184}],186:[function(e,t,n){n.SourceMapGenerator=e("./source-map/source-map-generator").SourceMapGenerator;n.SourceMapConsumer=e("./source-map/source-map-consumer").SourceMapConsumer;n.SourceNode=e("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":192,"./source-map/source-map-generator":193,"./source-map/source-node":194}],187:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(t,r,l){var n=t("./util");function e(){this._array=[];this._set={}}e.fromArray=function a(t,l){var r=new e;for(var n=0,a=t.length;n<a;n++){r.add(t[n],l)}return r};e.prototype.add=function i(e,r){var t=this.has(e);var l=this._array.length;if(!t||r){this._array.push(e)}if(!t){this._set[n.toSetString(e)]=l}};e.prototype.has=function s(e){return Object.prototype.hasOwnProperty.call(this._set,n.toSetString(e))};e.prototype.indexOf=function o(e){if(this.has(e)){return this._set[n.toSetString(e)]}throw new Error('"'+e+'" is not in the set.')};e.prototype.at=function u(e){if(e>=0&&e<this._array.length){return this._array[e]}throw new Error("No element indexed by "+e)};e.prototype.toArray=function c(){return this._array.slice()};r.ArraySet=e})},{"./util":195,amdefine:196}],188:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(i,n,u){var t=i("./base64");var e=5;var r=1<<e;var l=r-1;var a=r;function s(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var t=(e&1)===1;var n=e>>1;return t?-n:n}n.encode=function c(o){var i="";var r;var n=s(o);do{r=n&l;n>>>=e;if(n>0){r|=a}i+=t.encode(r)}while(n>0);return i};n.decode=function f(r,u){var i=0;var p=r.length;var s=0;var c=0;var f,n;do{if(i>=p){throw new Error("Expected more digits in base 64 VLQ value.")}n=t.decode(r.charAt(i++));f=!!(n&a);n&=l;s=s+(n<<c);c+=e}while(f);u.value=o(s);u.rest=r.slice(i)}})},{"./base64":189,amdefine:196}],189:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(r,t,l){var e={};var n={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(t,r){e[t]=r;n[r]=t});t.encode=function a(e){if(e in n){return n[e]}throw new TypeError("Must be between 0 and 63: "+e)};t.decode=function i(n){if(n in e){return e[n]}throw new TypeError("Not a valid base 64 digit: "+n)}})},{amdefine:196}],190:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(t,n,r){function e(t,r,l,a,i){var n=Math.floor((r-t)/2)+t;var s=i(l,a[n],true);if(s===0){return n}else if(s>0){if(r-n>1){return e(n,r,l,a,i)}return n}else{if(n-t>1){return e(t,n,l,a,i)}return t<0?-1:t}}n.search=function l(t,n,r){if(n.length===0){return-1}return e(-1,n.length,t,n,r)}})},{amdefine:196}],191:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(t,r,a){var n=t("./util");function l(e,t){var r=e.generatedLine;var l=t.generatedLine;var a=e.generatedColumn;var i=t.generatedColumn;return l>r||l==r&&i>=a||n.compareByGeneratedPositions(e,t)<=0}function e(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}e.prototype.unsortedForEach=function i(e,n){this._array.forEach(e,n)};e.prototype.add=function s(e){var n;if(l(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};e.prototype.toArray=function o(){if(!this._sorted){this._array.sort(n.compareByGeneratedPositions);this._sorted=true}return this._array};r.MappingList=e})},{"./util":195,amdefine:196}],192:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(r,a,s){var e=r("./util");var i=r("./binary-search");var l=r("./array-set").ArraySet;var t=r("./base64-vlq");function n(t){var n=t;if(typeof t==="string"){n=JSON.parse(t.replace(/^\)\]\}'/,""))}var a=e.getArg(n,"version");var r=e.getArg(n,"sources");var i=e.getArg(n,"names",[]);var s=e.getArg(n,"sourceRoot",null);var o=e.getArg(n,"sourcesContent",null);var u=e.getArg(n,"mappings");var c=e.getArg(n,"file",null);if(a!=this._version){throw new Error("Unsupported version: "+a)}r=r.map(e.normalize);this._names=l.fromArray(i,true);this._sources=l.fromArray(r,true);this.sourceRoot=s;this.sourcesContent=o;this._mappings=u;this.file=c}n.fromSourceMap=function o(r){var t=Object.create(n.prototype);t._names=l.fromArray(r._names.toArray(),true);t._sources=l.fromArray(r._sources.toArray(),true);t.sourceRoot=r._sourceRoot;t.sourcesContent=r._generateSourcesContent(t._sources.toArray(),t.sourceRoot);t.file=r._file;t.__generatedMappings=r._mappings.toArray().slice();t.__originalMappings=r._mappings.toArray().slice().sort(e.compareByOriginalPositions);return t};n.prototype._version=3;Object.defineProperty(n.prototype,"sources",{get:function(){return this._sources.toArray().map(function(n){return this.sourceRoot!=null?e.join(this.sourceRoot,n):n},this)}});n.prototype.__generatedMappings=null;Object.defineProperty(n.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});n.prototype.__originalMappings=null;Object.defineProperty(n.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});n.prototype._nextCharIsMappingSeparator=function u(n){var e=n.charAt(0);return e===";"||e===","};n.prototype._parseMappings=function c(f,p){var o=1;var a=0;var s=0;var i=0;var u=0;var c=0;var n=f;var r={};var l;while(n.length>0){if(n.charAt(0)===";"){o++;n=n.slice(1);a=0}else if(n.charAt(0)===","){n=n.slice(1)}else{l={};l.generatedLine=o;t.decode(n,r);l.generatedColumn=a+r.value;a=l.generatedColumn;n=r.rest;if(n.length>0&&!this._nextCharIsMappingSeparator(n)){t.decode(n,r);l.source=this._sources.at(u+r.value);u+=r.value;n=r.rest;if(n.length===0||this._nextCharIsMappingSeparator(n)){throw new Error("Found a source, but no line and column")}t.decode(n,r);l.originalLine=s+r.value;s=l.originalLine;l.originalLine+=1;n=r.rest;if(n.length===0||this._nextCharIsMappingSeparator(n)){throw new Error("Found a source and line, but no column")}t.decode(n,r);l.originalColumn=i+r.value;i=l.originalColumn;n=r.rest;if(n.length>0&&!this._nextCharIsMappingSeparator(n)){t.decode(n,r);l.name=this._names.at(c+r.value);c+=r.value;n=r.rest}}this.__generatedMappings.push(l);if(typeof l.originalLine==="number"){this.__originalMappings.push(l)}}}this.__generatedMappings.sort(e.compareByGeneratedPositions);this.__originalMappings.sort(e.compareByOriginalPositions)};n.prototype._findMapping=function f(e,r,n,t,l){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,l)};n.prototype.computeColumnSpans=function p(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var t=this._generatedMappings[e+1];if(n.generatedLine===t.generatedLine){n.lastGeneratedColumn=t.generatedColumn-1;continue}}n.lastGeneratedColumn=Infinity}};n.prototype.originalPositionFor=function d(r){var l={generatedLine:e.getArg(r,"line"),generatedColumn:e.getArg(r,"column")};var a=this._findMapping(l,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositions);if(a>=0){var n=this._generatedMappings[a];if(n.generatedLine===l.generatedLine){var t=e.getArg(n,"source",null);if(t!=null&&this.sourceRoot!=null){t=e.join(this.sourceRoot,t)}return{source:t,line:e.getArg(n,"originalLine",null),column:e.getArg(n,"originalColumn",null),name:e.getArg(n,"name",null)}}}return{source:null,line:null,column:null,name:null}};n.prototype.sourceContentFor=function m(n){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){n=e.relative(this.sourceRoot,n)}if(this._sources.has(n)){return this.sourcesContent[this._sources.indexOf(n)]}var t;if(this.sourceRoot!=null&&(t=e.urlParse(this.sourceRoot))){var r=n.replace(/^file:\/\//,"");if(t.scheme=="file"&&this._sources.has(r)){return this.sourcesContent[this._sources.indexOf(r)]}if((!t.path||t.path=="/")&&this._sources.has("/"+n)){return this.sourcesContent[this._sources.indexOf("/"+n)]}}throw new Error('"'+n+'" is not in the SourceMap.')};n.prototype.generatedPositionFor=function h(n){var t={source:e.getArg(n,"source"),originalLine:e.getArg(n,"line"),originalColumn:e.getArg(n,"column")};if(this.sourceRoot!=null){t.source=e.relative(this.sourceRoot,t.source)}var l=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions);if(l>=0){var r=this._originalMappings[l];return{line:e.getArg(r,"generatedLine",null),column:e.getArg(r,"generatedColumn",null),lastColumn:e.getArg(r,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};n.prototype.allGeneratedPositionsFor=function g(l){var t={source:e.getArg(l,"source"),originalLine:e.getArg(l,"line"),originalColumn:Infinity};if(this.sourceRoot!=null){t.source=e.relative(this.sourceRoot,t.source)}var a=[];var r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions);if(r>=0){var n=this._originalMappings[r];while(n&&n.originalLine===t.originalLine){a.push({line:e.getArg(n,"generatedLine",null),column:e.getArg(n,"generatedColumn",null),lastColumn:e.getArg(n,"lastGeneratedColumn",null)});n=this._originalMappings[--r]}}return a.reverse()};n.GENERATED_ORDER=1;n.ORIGINAL_ORDER=2;n.prototype.eachMapping=function y(l,a,i){var s=a||null;var o=i||n.GENERATED_ORDER;var t;switch(o){case n.GENERATED_ORDER:t=this._generatedMappings;break;case n.ORIGINAL_ORDER:t=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var r=this.sourceRoot;t.map(function(n){var t=n.source;if(t!=null&&r!=null){t=e.join(r,t)}return{source:t,generatedLine:n.generatedLine,generatedColumn:n.generatedColumn,originalLine:n.originalLine,originalColumn:n.originalColumn,name:n.name}}).forEach(l,s)};a.SourceMapConsumer=n})},{"./array-set":187,"./base64-vlq":188,"./binary-search":190,"./util":195,amdefine:196}],193:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(r,a,s){var t=r("./base64-vlq");var e=r("./util");var l=r("./array-set").ArraySet;var i=r("./mapping-list").MappingList;function n(n){if(!n){n={}}this._file=e.getArg(n,"file",null);this._sourceRoot=e.getArg(n,"sourceRoot",null);this._skipValidation=e.getArg(n,"skipValidation",false);this._sources=new l;this._names=new l;this._mappings=new i;this._sourcesContents=null}n.prototype._version=3;n.fromSourceMap=function o(t){var r=t.sourceRoot;var l=new n({file:t.file,sourceRoot:r});t.eachMapping(function(n){var t={generated:{line:n.generatedLine,column:n.generatedColumn}};if(n.source!=null){t.source=n.source;if(r!=null){t.source=e.relative(r,t.source)}t.original={line:n.originalLine,column:n.originalColumn};if(n.name!=null){t.name=n.name}}l.addMapping(t)});t.sources.forEach(function(e){var n=t.sourceContentFor(e);if(n!=null){l.setSourceContent(e,n)}});return l};n.prototype.addMapping=function u(l){var a=e.getArg(l,"generated");var n=e.getArg(l,"original",null);var t=e.getArg(l,"source",null);var r=e.getArg(l,"name",null);if(!this._skipValidation){this._validateMapping(a,n,t,r)}if(t!=null&&!this._sources.has(t)){this._sources.add(t)}if(r!=null&&!this._names.has(r)){this._names.add(r)}this._mappings.add({generatedLine:a.line,generatedColumn:a.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:r})};n.prototype.setSourceContent=function c(r,t){var n=r;if(this._sourceRoot!=null){n=e.relative(this._sourceRoot,n)}if(t!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[e.toSetString(n)]=t}else if(this._sourcesContents){delete this._sourcesContents[e.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};n.prototype.applySourceMap=function f(t,o,r){var a=o;if(o==null){if(t.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}a=t.file}var n=this._sourceRoot;if(n!=null){a=e.relative(n,a)}var i=new l;var s=new l;this._mappings.unsortedForEach(function(l){if(l.source===a&&l.originalLine!=null){var o=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});if(o.source!=null){l.source=o.source;if(r!=null){l.source=e.join(r,l.source)}if(n!=null){l.source=e.relative(n,l.source)}l.originalLine=o.line;l.originalColumn=o.column;if(o.name!=null){l.name=o.name}}}var u=l.source;if(u!=null&&!i.has(u)){i.add(u)}var c=l.name;if(c!=null&&!s.has(c)){s.add(c)}},this);this._sources=i;this._names=s;t.sources.forEach(function(l){var a=t.sourceContentFor(l);if(a!=null){if(r!=null){l=e.join(r,l)}if(n!=null){l=e.relative(n,l)}this.setSourceContent(l,a)}},this)};n.prototype._validateMapping=function p(e,n,t,r){if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!r){return}else if(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:r}))}};n.prototype._serializeMappings=function d(){var i=0;var a=1;var u=0;var c=0;var f=0;var o=0;var r="";var n;var s=this._mappings.toArray();for(var l=0,p=s.length;l<p;l++){n=s[l];if(n.generatedLine!==a){i=0;while(n.generatedLine!==a){r+=";";a++}}else{if(l>0){if(!e.compareByGeneratedPositions(n,s[l-1])){continue}r+=","}}r+=t.encode(n.generatedColumn-i);i=n.generatedColumn;if(n.source!=null){r+=t.encode(this._sources.indexOf(n.source)-o);o=this._sources.indexOf(n.source);r+=t.encode(n.originalLine-1-c);c=n.originalLine-1;r+=t.encode(n.originalColumn-u);u=n.originalColumn;if(n.name!=null){r+=t.encode(this._names.indexOf(n.name)-f);f=this._names.indexOf(n.name)}}}return r};n.prototype._generateSourcesContent=function m(t,n){return t.map(function(t){if(!this._sourcesContents){return null}if(n!=null){t=e.relative(n,t)}var r=e.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};n.prototype.toJSON=function h(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};n.prototype.toString=function g(){return JSON.stringify(this)};a.SourceMapGenerator=n})},{"./array-set":187,"./base64-vlq":188,"./mapping-list":191,"./util":195,amdefine:196}],194:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(r,l,o){var a=r("./source-map-generator").SourceMapGenerator;var t=r("./util");var i=/(\r?\n)/;var s=10;var n="$$$isSourceNode$$$";function e(e,t,r,l,a){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=t==null?null:t;this.source=r==null?null:r;this.name=a==null?null:a;this[n]=true;if(l!=null)this.add(l)}e.fromStringWithSourceMap=function u(p,c,s){var r=new e;var n=p.split(i);var u=function(){var e=n.shift();var t=n.shift()||"";return e+t};var o=1,a=0;var l=null;c.eachMapping(function(e){if(l!==null){if(o<e.generatedLine){var i="";f(l,u());o++;a=0}else{var t=n[0];var i=t.substr(0,e.generatedColumn-a);n[0]=t.substr(e.generatedColumn-a);a=e.generatedColumn;f(l,i);l=e;return}}while(o<e.generatedLine){r.add(u());o++}if(a<e.generatedColumn){var t=n[0];r.add(t.substr(0,e.generatedColumn));n[0]=t.substr(e.generatedColumn);a=e.generatedColumn}l=e},this);if(n.length>0){if(l){f(l,u())}r.add(n.join(""))}c.sources.forEach(function(e){var n=c.sourceContentFor(e);if(n!=null){if(s!=null){e=t.join(s,e)}r.setSourceContent(e,n)}});return r;function f(n,l){if(n===null||n.source===undefined){r.add(l)}else{var a=s?t.join(s,n.source):n.source;r.add(new e(n.originalLine,n.originalColumn,a,l,n.name))}}};e.prototype.add=function c(e){if(Array.isArray(e)){e.forEach(function(e){this.add(e)},this)}else if(e[n]||typeof e==="string"){if(e){this.children.push(e)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};e.prototype.prepend=function f(e){if(Array.isArray(e)){for(var t=e.length-1;t>=0;t--){this.prepend(e[t])}}else if(e[n]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};e.prototype.walk=function p(r){var e;for(var t=0,l=this.children.length;t<l;t++){e=this.children[t];if(e[n]){e.walk(r)}else{if(e!==""){r(e,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};e.prototype.join=function d(r){var e;var n;var t=this.children.length;if(t>0){e=[];for(n=0;n<t-1;n++){e.push(this.children[n]);e.push(r)}e.push(this.children[n]);this.children=e}return this};e.prototype.replaceRight=function m(t,r){var e=this.children[this.children.length-1];if(e[n]){e.replaceRight(t,r)}else if(typeof e==="string"){this.children[this.children.length-1]=e.replace(t,r)}else{this.children.push("".replace(t,r))}return this};e.prototype.setSourceContent=function h(e,n){this.sourceContents[t.toSetString(e)]=n};e.prototype.walkSourceContents=function g(l){for(var e=0,a=this.children.length;e<a;e++){if(this.children[e][n]){this.children[e].walkSourceContents(l)}}var r=Object.keys(this.sourceContents);for(var e=0,a=r.length;e<a;e++){l(t.fromSetString(r[e]),this.sourceContents[r[e]])}};e.prototype.toString=function y(){var e="";this.walk(function(n){e+=n});return e};e.prototype.toStringWithSourceMap=function v(u){var e={code:"",line:1,column:0};var n=new a(u);var t=false;var r=null;var l=null;var i=null;var o=null;this.walk(function(c,a){e.code+=c;if(a.source!==null&&a.line!==null&&a.column!==null){if(r!==a.source||l!==a.line||i!==a.column||o!==a.name){n.addMapping({source:a.source,original:{line:a.line,column:a.column},generated:{line:e.line,column:e.column},name:a.name})}r=a.source;l=a.line;i=a.column;o=a.name;t=true}else if(t){n.addMapping({generated:{line:e.line,column:e.column}});r=null;t=false}for(var u=0,f=c.length;u<f;u++){if(c.charCodeAt(u)===s){e.line++;e.column=0;if(u+1===f){r=null;t=false}else if(t){n.addMapping({source:a.source,original:{line:a.line,column:a.column},generated:{line:e.line,column:e.column},name:a.name})}}else{e.column++}}});this.walkSourceContents(function(e,t){n.setSourceContent(e,t)});return{code:e.code,map:n}};l.SourceNode=e})},{"./source-map-generator":193,"./util":195,amdefine:196}],195:[function(e,t,r){if(typeof n!=="function"){var n=e("amdefine")(t,e)}n(function(h,e,m){function o(n,e,t){if(e in n){return n[e]}else if(arguments.length===3){return t}else{throw new Error('"'+e+'" is a required argument.')}}e.getArg=o;var d=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;var a=/^data:.+\,.+$/;function n(n){var e=n.match(d);if(!e){return null}return{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}}e.urlParse=n;function t(e){var n="";if(e.scheme){n+=e.scheme+":"}n+="//";if(e.auth){n+=e.auth+"@"}if(e.host){n+=e.host}if(e.port){n+=":"+e.port}if(e.path){n+=e.path}return n}e.urlGenerate=t;function l(o){var e=o;var r=n(o);if(r){if(!r.path){return o}e=r.path}var u=e.charAt(0)==="/";var l=e.split(/\/+/);for(var s,i=0,a=l.length-1;a>=0;a--){s=l[a];if(s==="."){l.splice(a,1)}else if(s===".."){i++}else if(i>0){if(s===""){l.splice(a+1,i);i=0}else{l.splice(a,2);i--}}}e=l.join("/");if(e===""){e=u?"/":"."}if(r){r.path=e;return t(r)}return e}e.normalize=l;function u(i,r){if(i===""){i="."}if(r===""){r="."}var s=n(r);var e=n(i);if(e){i=e.path||"/"}if(s&&!s.scheme){if(e){s.scheme=e.scheme}return t(s)}if(s||r.match(a)){return r}if(e&&!e.host&&!e.path){e.host=r;return t(e)}var o=r.charAt(0)==="/"?r:l(i.replace(/\/+$/,"")+"/"+r);if(e){e.path=o;return t(e)}return o}e.join=u;function c(e,t){if(e===""){e="."}e=e.replace(/\/$/,"");var r=n(e);if(t.charAt(0)=="/"&&r&&r.path=="/"){return t.slice(1)}return t.indexOf(e+"/")===0?t.substr(e.length+1):t}e.relative=c;function f(e){return"$"+e}e.toSetString=f;function p(e){return e.substr(1)}e.fromSetString=p;function r(t,r){var e=t||"";var n=r||"";return(e>n)-(e<n)}function s(n,t,l){var e;e=r(n.source,t.source);if(e){return e}e=n.originalLine-t.originalLine;if(e){return e}e=n.originalColumn-t.originalColumn;if(e||l){return e}e=r(n.name,t.name);if(e){return e}e=n.generatedLine-t.generatedLine;if(e){return e}return n.generatedColumn-t.generatedColumn}e.compareByOriginalPositions=s;function i(n,t,l){var e;e=n.generatedLine-t.generatedLine;if(e){return e}e=n.generatedColumn-t.generatedColumn;if(e||l){return e}e=r(n.source,t.source);if(e){return e}e=n.originalLine-t.originalLine;if(e){return e}e=n.originalColumn-t.originalColumn;if(e){return e}return r(n.name,t.name)}e.compareByGeneratedPositions=i})},{amdefine:196}],196:[function(e,n,t){(function(t,r){"use strict";function l(l,o){"use strict";var a={},n={},p=false,d=e("path"),i,u;function m(n){var e,t;for(e=0;n[e];e+=1){t=n[e];if(t==="."){n.splice(e,1);e-=1}else if(t===".."){if(e===1&&(n[2]===".."||n[0]==="..")){break}else if(e>0){n.splice(e-1,2);e-=2}}}}function s(n,t){var e;if(n&&n.charAt(0)==="."){if(t){e=t.split("/");e=e.slice(0,e.length-1);e=e.concat(n.split("/"));m(e);n=e.join("/")}}return n}function h(e){return function(n){return s(n,e)}}function g(t){function e(e){n[t]=e}e.fromText=function(e,n){throw new Error("amdefine does not implement load.fromText")};return e}i=function(n,r,e,l){function a(a,i){if(typeof a==="string"){return u(n,r,e,a,l)}else{a=a.map(function(t){return u(n,r,e,t,l)});t.nextTick(function(){i.apply(null,a)})}}a.toUrl=function(n){if(n.indexOf(".")===0){return s(n,d.dirname(e.filename))}else{return n}};return a};o=o||function y(){return l.require.apply(l,arguments)};function c(t,s,c){var f,a,e,u;if(t){a=n[t]={};e={id:t,uri:r,exports:a};f=i(o,a,e,t)}else{if(p){throw new Error("amdefine with no module ID cannot be called more than once per file.")}p=true;a=l.exports;e=l;f=i(o,a,e,l.id)}if(s){s=s.map(function(e){return f(e)})}if(typeof c==="function"){u=c.apply(e.exports,s)
}else{u=c}if(u!==undefined){e.exports=u;if(t){n[t]=e.exports}}}u=function(r,l,o,e,t){var p=e.indexOf("!"),m=e,d,f;if(p===-1){e=s(e,t);if(e==="require"){return i(r,l,o,t)}else if(e==="exports"){return l}else if(e==="module"){return o}else if(n.hasOwnProperty(e)){return n[e]}else if(a[e]){c.apply(null,a[e]);return n[e]}else{if(r){return r(m)}else{throw new Error("No module with ID: "+e)}}}else{d=e.substring(0,p);e=e.substring(p+1,e.length);f=u(r,l,o,d,t);if(f.normalize){e=f.normalize(e,h(t))}else{e=s(e,t)}if(n[e]){return n[e]}else{f.load(e,i(r,l,o,t),g(e),{});return n[e]}}};function f(n,e,t){if(Array.isArray(n)){t=e;e=n;n=undefined}else if(typeof n!=="string"){t=n;n=e=undefined}if(e&&!Array.isArray(e)){t=e;e=undefined}if(!e){e=["require","exports","module"]}if(n){a[n]=[n,e,t]}else{c(n,e,t)}}f.require=function(e){if(n[e]){return n[e]}if(a[e]){c.apply(null,a[e]);return n[e]}};f.amd={};return f}n.exports=l}).call(this,e("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:119,path:118}],197:[function(n,e,t){e.exports={name:"6to5",description:"Turn ES6 code into readable vanilla ES5 with source maps",version:"2.13.0",author:"Sebastian McKenzie <sebmck@gmail.com>",homepage:"https://6to5.org/",repository:"6to5/6to5",preferGlobal:true,main:"lib/6to5/index.js",bin:{"6to5":"./bin/6to5/index.js","6to5-node":"./bin/6to5-node","6to5-runtime":"./bin/6to5-runtime"},browser:{"./lib/6to5/index.js":"./lib/6to5/browser.js","./lib/6to5/register.js":"./lib/6to5/register-browser.js"},keywords:["harmony","classes","modules","let","const","var","es6","transpile","transpiler","6to5"],scripts:{bench:"make bench",test:"make test"},dependencies:{"acorn-6to5":"0.11.1-18","ast-types":"~0.6.1",chokidar:"0.12.6",commander:"2.6.0","core-js":"0.4.5",estraverse:"1.9.1",esutils:"1.1.6",esvalid:"1.1.0","fs-readdir-recursive":"0.1.0",jshint:"2.5.11",lodash:"2.4.1","output-file-sync":"^1.1.0","private":"0.1.6",regenerator:"0.8.9",regexpu:"1.0.0",roadrunner:"1.0.4","source-map":"0.1.43","source-map-support":"0.2.9"},devDependencies:{browserify:"8.1.1",chai:"1.10.0",istanbul:"0.3.5","jshint-stylish":"1.0.0",matcha:"0.6.0",mocha:"2.1.0",rimraf:"2.2.8","uglify-js":"2.4.16"},optionalDependencies:{kexec:"0.2.0"}}},{}],198:[function(n,e,t){e.exports={"abstract-expression-call":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceGet",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"abstract-expression-delete":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceDelete",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"abstract-expression-get":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceGet",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"abstract-expression-set":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceSet",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"apply-constructor":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"args",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"create",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"args",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"object",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"||",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-comprehension-container":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ArrayExpression",start:null,end:null,loc:null,range:null,elements:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-comprehension-for-each":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"forEach",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-from":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-push":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"push",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STATEMENT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"async-to-generator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"fn",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"fn",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Promise",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"reject",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"FunctionDeclaration",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getNext",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"TryStatement",start:null,end:null,loc:null,range:null,block:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getNext",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},handler:{type:"CatchClause",start:null,end:null,loc:null,range:null,param:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"e",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},guard:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"reject",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"e",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},guardedHandlers:[],finalizer:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Promise",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"then",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"v",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"v",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"e",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"throw",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"e",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},bind:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Function",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},call:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CONTEXT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"class-super-constructor-call-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"class-super-constructor-call":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"common-export-default-assign":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXTENDS_HELPER",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"default",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"corejs-iterator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CORE_ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"$for",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getIterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"default-parameter":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VARIABLE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENT_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"DEFAULT_VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENT_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},defaults:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"define-property":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"enumerable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"exports-assign":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"exports-default-module-override":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"exports-default-module":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"extends":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:1,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"<",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:false,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"for-of-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:null,update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:">=",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:false,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"for-of":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STEP_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:true,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STEP_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},get:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getOwnPropertyDescriptor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"value",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},operator:"in",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"has-own":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},inherits:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"TypeError",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"Super expression must either be null or a function, not ",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},operator:"+",right:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"create",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"enumerable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:false,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__proto__",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"interop-require-wildcard":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"default",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"interop-require":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"default",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"||",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"let-scoping-return":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"RETURN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"object",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"RETURN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"v",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"object-without-properties":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"indexOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:">=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ContinueStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:true,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ContinueStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"property-method-assignment-wrapper":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"prototype-identifier":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"prototype-properties":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"require-assign-key":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VARIABLE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"require",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},require:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"require",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},rest:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LEN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY_LEN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"START",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"<",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LEN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:false,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"self-global":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"global",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"self",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"global",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},slice:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"slice",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"sliced-to-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ArrayExpression",start:null,end:null,loc:null,range:null,elements:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:true,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"push",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},system:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"System",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"register",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_DEPENDENCIES",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXPORT_IDENTIFIER",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"setters",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SETTERS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"execute",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXECUTE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"tagged-template-literal-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"tagged-template-literal":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"freeze",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"freeze",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"test-exports":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"test-module":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"to-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"typeof":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Literal",start:null,end:null,loc:null,range:null,value:"symbol",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},alternate:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"umd-runner-body":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],defaults:[],rest:null,generator:false,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"amd",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"AMD_ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"COMMON_TEST",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"COMMON_ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},expression:false,_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}}
},{}]},{},[2])(2)});
|
examples/todo/src/containers/Link.js
|
mirrorjs/mirror
|
import React from 'react'
import {connect} from 'mirrorx'
import Link from '../components/Link'
export default connect((state, props) => {
return {
active: state.todos.visibility === props.filter
}
})(Link)
|
granvilleBusMaps/index.ios.js
|
granvilledigital/hackathon
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
export default class granvilleBusMaps extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('granvilleBusMaps', () => granvilleBusMaps);
|
src/components/repos/Repos.js
|
azinasili/githubsearch
|
import React from 'react';
import { connect } from 'react-redux';
import './Repos.css';
function mapStateToProps(state) {
return {
repos: state.repos.items,
reposResultLength: state.searchResultLength.repos,
};
}
function Repos(props) {
let repos = null;
if (props.repos !== undefined && props.repos.length > 0) {
let repoList = props.repos.slice(0, props.reposResultLength);
repos = repoList.map((repo) => {
return (
<li key={repo.id} className="Repo">
<div className="Repo-header">
<a href={repo.html_url} className="Repo-title">{repo.full_name}</a>
<div className="Repo-stats">
<p className="Repo-stat">
<i className="Repo-stat-icon material-icons">star</i>
<span className="Repo-stat-value">{repo.stargazers_count}</span>
</p>
<p className="Repo-stat">
<i className="Repo-stat-icon material-icons">content_copy</i>
<span className="Repo-stat-value">{repo.forks}</span>
</p>
<p className="Repo-stat">
<i className="Repo-stat-icon material-icons">remove_red_eye</i>
<span className="Repo-stat-value">{repo.watchers}</span>
</p>
</div>
</div>
<p className="Repo-description">{repo.description}</p>
{repo.language ? <p className="Repo-languages">Language: <span>{repo.language}</span></p> : ''}
</li>
);
});
}
return (
<ul className="Repos-list">{repos}</ul>
);
}
export default connect(mapStateToProps)(Repos);
|
src/pages/settings/settings-followers.js
|
Lokiedu/libertysoil-site
|
/*
This file is a part of libertysoil.org website
Copyright (C) 2016 Loki Education (Social Enterprise)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import { List } from 'immutable';
import {
mapOf as mapOfPropType,
uuid4 as uuid4PropType
} from '../../prop-types/common';
import {
ArrayOfUsersId as ArrayOfUsersIdPropType,
CurrentUser as CurrentUserPropType,
MapOfUsers as MapOfUsersPropType
} from '../../prop-types/users';
import UserGrid from '../../components/user-grid';
import ApiClient from '../../api/client';
import { API_HOST } from '../../config';
import { ActionsTrigger } from '../../triggers';
import { createSelector, currentUserSelector } from '../../selectors';
function SettingsFollowersPage(props) {
const {
current_user,
is_logged_in,
following,
followers,
users
} = props;
if (!is_logged_in) {
return false;
}
const i_am_following = following.get(current_user.get('id'));
const client = new ApiClient(API_HOST);
const triggers = new ActionsTrigger(client, props.dispatch);
const followingUsers = (following.get(current_user.get('id')) || List())
.map(userId => users.get(userId));
const followersUsers = (followers.get(current_user.get('id')) || List())
.map(userId => users.get(userId));
return (
<div className="paper">
<Helmet title="Manage Followers on " />
<div className="paper__page">
<h1 className="content__title">Manage Followers</h1>
</div>
<div className="paper__page">
<h2 className="content__sub_title layout__row">People you follow</h2>
<div className="layout__row layout__row-double">
<UserGrid
current_user={current_user}
i_am_following={i_am_following}
notFoundMessage="You are not following any users"
triggers={triggers}
users={followingUsers}
/>
</div>
</div>
<div className="paper__page">
<h2 className="content__sub_title layout__row">Following you</h2>
<div className="layout__row layout__row-double">
<UserGrid
current_user={current_user}
i_am_following={i_am_following}
notFoundMessage="No one follows you yet"
triggers={triggers}
users={followersUsers}
/>
</div>
</div>
</div>
);
}
SettingsFollowersPage.displayName = 'SettingsFollowersPage';
SettingsFollowersPage.propTypes = {
current_user: CurrentUserPropType,
followers: mapOfPropType(uuid4PropType, ArrayOfUsersIdPropType).isRequired,
following: mapOfPropType(uuid4PropType, ArrayOfUsersIdPropType).isRequired,
is_logged_in: PropTypes.bool.isRequired,
users: MapOfUsersPropType.isRequired
};
const selector = createSelector(
currentUserSelector,
state => state.get('messages'),
state => state.get('following'),
state => state.get('followers'),
state => state.get('users'),
(current_user, messages, following, followers, users) => ({
messages,
following,
followers,
users,
...current_user
})
);
export default connect(selector)(SettingsFollowersPage);
|
src/modules/browse/routes/index.js
|
cltk/cltk_frontend
|
import React from 'react';
import { Route } from 'react-router';
// components
import BrowsePage from '../components/BrowsePage';
import MainLayout from '../../../layouts/MainLayout';
export default (
<div>
<Route
path="browse"
component={() => (
<MainLayout>
<BrowsePage />
</MainLayout>
)}
/>
</div>
);
|
components/Animate/Roll.js
|
rdjpalmer/bloom
|
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { spring, TransitionMotion } from 'react-motion';
const DEFAULT_SPRINT_CONFIG = { stiffness: 250, damping: 25 };
export default class Roll extends Component {
static propTypes = {
children: PropTypes.any,
width: PropTypes.string,
springConfig: PropTypes.shape({
stiffness: PropTypes.number,
damping: PropTypes.number,
})
};
static defaultProps = {
width: 'auto',
springConfig: DEFAULT_SPRINT_CONFIG,
};
getStyles = () => {
const { springConfig } = this.props;
return {
y: spring(0, springConfig),
opacity: spring(1, springConfig),
};
};
willEnter = () => ({
y: 50,
opacity: 0,
});
willLeave = () => {
const { springConfig } = this.props;
return {
y: spring(-50, springConfig),
opacity: spring(0, springConfig),
};
};
render() {
const { children: child, width } = this.props;
return (
<TransitionMotion
styles={ [{
key: child.props.id,
style: this.getStyles(),
data: child,
}] }
willEnter={ this.willEnter }
willLeave={ this.willLeave }
>
{ interpolated => (
<div
style={ {
position: 'relative',
display: 'inline-block',
verticalAlign: 'top',
width,
} }
>
{ interpolated.map(({ key, data, style }) => (
<div
key={ key }
style={ {
position: style.y === 0 ? 'relative' : 'absolute',
opacity: style.opacity,
transform: `translate3d(0, ${style.y}%, 0)`,
width,
willChange: 'transform, opacity',
backfaceVisibility: 'hidden',
} }
>
{ data }
</div>
)) }
</div>
)}
</TransitionMotion>
);
}
}
|
src/svg-icons/av/volume-up.js
|
ichiohta/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvVolumeUp = (props) => (
<SvgIcon {...props}>
<path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>
</SvgIcon>
);
AvVolumeUp = pure(AvVolumeUp);
AvVolumeUp.displayName = 'AvVolumeUp';
AvVolumeUp.muiName = 'SvgIcon';
export default AvVolumeUp;
|
app/javascript/mastodon/features/notifications/index.js
|
rutan/mastodon
|
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Column from '../../components/column';
import ColumnHeader from '../../components/column_header';
import { expandNotifications, scrollTopNotifications } from '../../actions/notifications';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
import NotificationContainer from './containers/notification_container';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ColumnSettingsContainer from './containers/column_settings_container';
import { createSelector } from 'reselect';
import { List as ImmutableList } from 'immutable';
import { debounce } from 'lodash';
import ScrollableList from '../../components/scrollable_list';
import LoadGap from '../../components/load_gap';
const messages = defineMessages({
title: { id: 'column.notifications', defaultMessage: 'Notifications' },
});
const getNotifications = createSelector([
state => ImmutableList(state.getIn(['settings', 'notifications', 'shows']).filter(item => !item).keys()),
state => state.getIn(['notifications', 'items']),
], (excludedTypes, notifications) => notifications.filterNot(item => item !== null && excludedTypes.includes(item.get('type'))));
const mapStateToProps = state => ({
notifications: getNotifications(state),
isLoading: state.getIn(['notifications', 'isLoading'], true),
isUnread: state.getIn(['notifications', 'unread']) > 0,
hasMore: state.getIn(['notifications', 'hasMore']),
});
@connect(mapStateToProps)
@injectIntl
export default class Notifications extends React.PureComponent {
static propTypes = {
columnId: PropTypes.string,
notifications: ImmutablePropTypes.list.isRequired,
dispatch: PropTypes.func.isRequired,
shouldUpdateScroll: PropTypes.func,
intl: PropTypes.object.isRequired,
isLoading: PropTypes.bool,
isUnread: PropTypes.bool,
multiColumn: PropTypes.bool,
hasMore: PropTypes.bool,
};
static defaultProps = {
trackScroll: true,
};
componentWillUnmount () {
this.handleLoadOlder.cancel();
this.handleScrollToTop.cancel();
this.handleScroll.cancel();
this.props.dispatch(scrollTopNotifications(false));
}
handleLoadGap = (maxId) => {
this.props.dispatch(expandNotifications({ maxId }));
};
handleLoadOlder = debounce(() => {
const last = this.props.notifications.last();
this.props.dispatch(expandNotifications({ maxId: last && last.get('id') }));
}, 300, { leading: true });
handleScrollToTop = debounce(() => {
this.props.dispatch(scrollTopNotifications(true));
}, 100);
handleScroll = debounce(() => {
this.props.dispatch(scrollTopNotifications(false));
}, 100);
handlePin = () => {
const { columnId, dispatch } = this.props;
if (columnId) {
dispatch(removeColumn(columnId));
} else {
dispatch(addColumn('NOTIFICATIONS', {}));
}
}
handleMove = (dir) => {
const { columnId, dispatch } = this.props;
dispatch(moveColumn(columnId, dir));
}
handleHeaderClick = () => {
this.column.scrollTop();
}
setColumnRef = c => {
this.column = c;
}
handleMoveUp = id => {
const elementIndex = this.props.notifications.findIndex(item => item !== null && item.get('id') === id) - 1;
this._selectChild(elementIndex);
}
handleMoveDown = id => {
const elementIndex = this.props.notifications.findIndex(item => item !== null && item.get('id') === id) + 1;
this._selectChild(elementIndex);
}
_selectChild (index) {
const element = this.column.node.querySelector(`article:nth-of-type(${index + 1}) .focusable`);
if (element) {
element.focus();
}
}
render () {
const { intl, notifications, shouldUpdateScroll, isLoading, isUnread, columnId, multiColumn, hasMore } = this.props;
const pinned = !!columnId;
const emptyMessage = <FormattedMessage id='empty_column.notifications' defaultMessage="You don't have any notifications yet. Interact with others to start the conversation." />;
let scrollableContent = null;
if (isLoading && this.scrollableContent) {
scrollableContent = this.scrollableContent;
} else if (notifications.size > 0 || hasMore) {
scrollableContent = notifications.map((item, index) => item === null ? (
<LoadGap
key={'gap:' + notifications.getIn([index + 1, 'id'])}
disabled={isLoading}
maxId={index > 0 ? notifications.getIn([index - 1, 'id']) : null}
onClick={this.handleLoadGap}
/>
) : (
<NotificationContainer
key={item.get('id')}
notification={item}
accountId={item.get('account')}
onMoveUp={this.handleMoveUp}
onMoveDown={this.handleMoveDown}
/>
));
} else {
scrollableContent = null;
}
this.scrollableContent = scrollableContent;
const scrollContainer = (
<ScrollableList
scrollKey={`notifications-${columnId}`}
trackScroll={!pinned}
isLoading={isLoading}
hasMore={hasMore}
emptyMessage={emptyMessage}
onLoadMore={this.handleLoadOlder}
onScrollToTop={this.handleScrollToTop}
onScroll={this.handleScroll}
shouldUpdateScroll={shouldUpdateScroll}
>
{scrollableContent}
</ScrollableList>
);
return (
<Column ref={this.setColumnRef} label={intl.formatMessage(messages.title)}>
<ColumnHeader
icon='bell'
active={isUnread}
title={intl.formatMessage(messages.title)}
onPin={this.handlePin}
onMove={this.handleMove}
onClick={this.handleHeaderClick}
pinned={pinned}
multiColumn={multiColumn}
>
<ColumnSettingsContainer />
</ColumnHeader>
{scrollContainer}
</Column>
);
}
}
|
imports/ui/components/WelcomeContent/WelcomeContent.js
|
hwillson/meteor-solr-demo
|
import React from 'react';
const WelcomeContent = () => (
<div className="welcome-content">
<h1>Meteor Solr Search Demo</h1>
<p>
Welcome to the Meteor Solr search demo!
</p>
<div className="welcome-get-started clearfix">
<div className="pull-left hidden-xs">
<i className="fa fa-info-circle fa-2x" />
</div>
<div className="pull-left welcome-get-started-msg">
To get started, enter your search keywords into the box above.
</div>
</div>
<h3>The Details</h3>
<p>
This demo shows how Meteor can be used with Solr to provide a quick,
simple, easy to use/maintain search based application.
</p>
<p>This application demonstrates the following:</p>
<ul>
<li>Meteor based single page search application</li>
<li>Searches automatically as you type</li>
<li>
Provides Solr facet handling capabilities through custom facet UI
widgets
</li>
<li>
Demonstrates single level facet refinements through sample Document
Type, Date and Author facet widgets
</li>
<li>
Demonstrates multi level facet refinements through a sample
Categories facet widget
</li>
<li>
Search can be refined by each facet independently, with each
facet keeping track of its current state (making it easy to
unrefine)
</li>
<li>
Tracks general user search actions (search keywords used, number
of results found, results selected, page of result selected, facet
refinement selected, etc.) via Mongo
</li>
</ul>
</div>
);
export default WelcomeContent;
|
node_modules/react-native-tab-view/src/TabBar.js
|
joan17cast/Enigma
|
/* @flow */
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import {
Animated,
StyleSheet,
View,
Text,
ScrollView,
Platform,
I18nManager,
} from 'react-native';
import TouchableItem from './TouchableItem';
import { SceneRendererPropType } from './TabViewPropTypes';
import type {
Scene,
SceneRendererProps,
Route,
Style,
} from './TabViewTypeDefinitions';
type IndicatorProps<T> = SceneRendererProps<T> & {
width: Animated.Value,
};
type ScrollEvent = {
nativeEvent: {
contentOffset: {
x: number,
},
},
};
type DefaultProps<T> = {
getLabelText: (scene: Scene<T>) => ?string,
};
type Props<T> = SceneRendererProps<T> & {
scrollEnabled?: boolean,
pressColor?: string,
pressOpacity?: number,
getLabelText: (scene: Scene<T>) => ?string,
renderLabel?: (scene: Scene<T>) => ?React.Element<any>,
renderIcon?: (scene: Scene<T>) => ?React.Element<any>,
renderBadge?: (scene: Scene<T>) => ?React.Element<any>,
renderIndicator?: (props: IndicatorProps<T>) => ?React.Element<any>,
onTabPress?: (scene: Scene<T>) => void,
tabStyle?: Style,
indicatorStyle?: Style,
labelStyle?: Style,
style?: Style,
};
type State = {
offset: Animated.Value,
visibility: Animated.Value,
initialOffset: { x: number, y: number },
};
export default class TabBar<T: Route<*>>
extends PureComponent<DefaultProps<T>, Props<T>, State> {
static propTypes = {
...SceneRendererPropType,
scrollEnabled: PropTypes.bool,
pressColor: TouchableItem.propTypes.pressColor,
pressOpacity: TouchableItem.propTypes.pressOpacity,
getLabelText: PropTypes.func,
renderIcon: PropTypes.func,
renderLabel: PropTypes.func,
renderIndicator: PropTypes.func,
onTabPress: PropTypes.func,
labelStyle: Text.propTypes.style,
style: PropTypes.any,
};
static defaultProps = {
getLabelText: ({ route }) =>
route.title ? route.title.toUpperCase() : null,
};
constructor(props: Props<T>) {
super(props);
let initialVisibility = 0;
if (this.props.scrollEnabled === true) {
const tabWidth = this._getTabWidthFromStyle(this.props.tabStyle);
if (this.props.layout.width || tabWidth) {
initialVisibility = 1;
}
} else {
initialVisibility = 1;
}
this.state = {
offset: new Animated.Value(0),
visibility: new Animated.Value(initialVisibility),
initialOffset: {
x: this._getScrollAmount(this.props, this.props.navigationState.index),
y: 0,
},
};
}
state: State;
componentDidMount() {
this._adjustScroll(this.props.navigationState.index);
this._positionListener = this.props.subscribe(
'position',
this._adjustScroll,
);
}
componentWillReceiveProps(nextProps: Props<T>) {
if (this.props.navigationState !== nextProps.navigationState) {
this._resetScrollOffset(nextProps);
}
const nextTabWidth = this._getTabWidthFromStyle(nextProps.tabStyle);
if (
(this.props.tabStyle !== nextProps.tabStyle && nextTabWidth) ||
(this.props.layout.width !== nextProps.layout.width &&
nextProps.layout.width)
) {
this.state.visibility.setValue(1);
}
}
componentDidUpdate(prevProps: Props<T>) {
if (
this.props.scrollEnabled &&
(prevProps.layout !== this.props.layout ||
prevProps.tabStyle !== this.props.tabStyle)
) {
global.requestAnimationFrame(() =>
this._adjustScroll(this.props.navigationState.index),
);
}
}
componentWillUnmount() {
this._positionListener.remove();
}
_positionListener: Object;
_scrollView: Object;
_isManualScroll: boolean = false;
_isMomentumScroll: boolean = false;
_renderLabel = (scene: Scene<*>) => {
if (typeof this.props.renderLabel !== 'undefined') {
return this.props.renderLabel(scene);
}
const label = this.props.getLabelText(scene);
if (typeof label !== 'string') {
return null;
}
return (
<Text style={[styles.tabLabel, this.props.labelStyle]}>{label}</Text>
);
};
_renderIndicator = (props: IndicatorProps<T>) => {
if (typeof this.props.renderIndicator !== 'undefined') {
return this.props.renderIndicator(props);
}
const { width, position } = props;
const translateX = Animated.multiply(
Animated.multiply(position, width),
I18nManager.isRTL ? -1 : 1,
);
return (
<Animated.View
style={[
styles.indicator,
{ width, transform: [{ translateX }] },
this.props.indicatorStyle,
]}
/>
);
};
_tabWidthCache: ?{ style: any, width: ?number };
_getTabWidthFromStyle = (style: any) => {
if (this._tabWidthCache && this._tabWidthCache.style === style) {
return this._tabWidthCache.width;
}
const passedTabStyle = StyleSheet.flatten(this.props.tabStyle);
const cache = {
style,
width: passedTabStyle ? passedTabStyle.width : null,
};
this._tabWidthCache = cache;
return cache;
};
_getFinalTabWidth = (props: Props<T>) => {
const { layout, navigationState } = props;
const tabWidth = this._getTabWidthFromStyle(props.tabStyle);
if (typeof tabWidth === 'number') {
return tabWidth;
}
if (typeof tabWidth === 'string' && tabWidth.endsWith('%')) {
return layout.width * (parseFloat(tabWidth, 10) / 100);
}
if (props.scrollEnabled) {
return layout.width / 5 * 2;
}
return layout.width / navigationState.routes.length;
};
_getMaxScrollableDistance = (props: Props<T>) => {
const { layout, navigationState } = props;
if (layout.width === 0) {
return 0;
}
const finalTabWidth = this._getFinalTabWidth(props);
const tabBarWidth = finalTabWidth * navigationState.routes.length;
const maxDistance = tabBarWidth - layout.width;
return Math.max(maxDistance, 0);
};
_normalizeScrollValue = (props: Props<T>, value: number) => {
const maxDistance = this._getMaxScrollableDistance(props);
return Math.max(Math.min(value, maxDistance), 0);
};
_getScrollAmount = (props: Props<T>, i: number) => {
const { layout } = props;
const finalTabWidth = this._getFinalTabWidth(props);
const centerDistance = finalTabWidth * i + finalTabWidth / 2;
const scrollAmount = centerDistance - layout.width / 2;
return this._normalizeScrollValue(props, scrollAmount);
};
_resetScrollOffset = (props: Props<T>) => {
if (!props.scrollEnabled || !this._scrollView) {
return;
}
const scrollAmount = this._getScrollAmount(
props,
props.navigationState.index,
);
this._scrollView.scrollTo({
x: scrollAmount,
animated: true,
});
Animated.timing(this.state.offset, {
toValue: 0,
duration: 150,
}).start();
};
_adjustScroll = (index: number) => {
if (!this.props.scrollEnabled || !this._scrollView) {
return;
}
const scrollAmount = this._getScrollAmount(this.props, index);
this._scrollView.scrollTo({
x: scrollAmount,
animated: false,
});
};
_adjustOffset = (value: number) => {
if (!this._isManualScroll || !this.props.scrollEnabled) {
return;
}
const scrollAmount = this._getScrollAmount(
this.props,
this.props.navigationState.index,
);
const scrollOffset = value - scrollAmount;
if (this._isMomentumScroll) {
Animated.spring(this.state.offset, {
toValue: -scrollOffset,
tension: 300,
friction: 35,
}).start();
} else {
this.state.offset.setValue(-scrollOffset);
}
};
_handleScroll = (e: ScrollEvent) => {
this._adjustOffset(e.nativeEvent.contentOffset.x);
};
_handleBeginDrag = () => {
// onScrollBeginDrag fires when user touches the ScrollView
this._isManualScroll = true;
this._isMomentumScroll = false;
};
_handleEndDrag = () => {
// onScrollEndDrag fires when user lifts his finger
// onMomentumScrollBegin fires after touch end
// run the logic in next frame so we get onMomentumScrollBegin first
global.requestAnimationFrame(() => {
if (this._isMomentumScroll) {
return;
}
this._isManualScroll = false;
});
};
_handleMomentumScrollBegin = () => {
// onMomentumScrollBegin fires on flick, as well as programmatic scroll
this._isMomentumScroll = true;
};
_handleMomentumScrollEnd = () => {
// onMomentumScrollEnd fires when the scroll finishes
this._isMomentumScroll = false;
this._isManualScroll = false;
};
_setRef = (el: Object) => (this._scrollView = el);
render() {
const { position, navigationState, scrollEnabled } = this.props;
const { routes, index } = navigationState;
const maxDistance = this._getMaxScrollableDistance(this.props);
const finalTabWidth = this._getFinalTabWidth(this.props);
const tabBarWidth = finalTabWidth * routes.length;
// Prepend '-1', so there are always at least 2 items in inputRange
const inputRange = [-1, ...routes.map((x, i) => i)];
const translateOutputRange = inputRange.map(
i => this._getScrollAmount(this.props, i) * -1,
);
const translateX = Animated.add(
position.interpolate({
inputRange,
outputRange: translateOutputRange,
}),
this.state.offset,
).interpolate({
inputRange: [-maxDistance, 0],
outputRange: [-maxDistance, 0],
extrapolate: 'clamp',
});
return (
<Animated.View style={[styles.tabBar, this.props.style]}>
<Animated.View
pointerEvents="none"
style={[
styles.indicatorContainer,
scrollEnabled
? { width: tabBarWidth, transform: [{ translateX }] }
: null,
]}
>
{this._renderIndicator({
...this.props,
width: new Animated.Value(finalTabWidth),
})}
</Animated.View>
<View style={styles.scroll}>
<ScrollView
horizontal
scrollEnabled={scrollEnabled}
bounces={false}
alwaysBounceHorizontal={false}
scrollsToTop={false}
showsHorizontalScrollIndicator={false}
automaticallyAdjustContentInsets={false}
overScrollMode="never"
contentContainerStyle={[
styles.tabContent,
scrollEnabled ? null : styles.container,
]}
scrollEventThrottle={16}
onScroll={this._handleScroll}
onScrollBeginDrag={this._handleBeginDrag}
onScrollEndDrag={this._handleEndDrag}
onMomentumScrollBegin={this._handleMomentumScrollBegin}
onMomentumScrollEnd={this._handleMomentumScrollEnd}
contentOffset={this.state.initialOffset}
ref={this._setRef}
>
{routes.map((route, i) => {
const focused = index === i;
const outputRange = inputRange.map(
inputIndex => (inputIndex === i ? 1 : 0.7),
);
const opacity = Animated.multiply(
this.state.visibility,
position.interpolate({
inputRange,
outputRange,
}),
);
const scene = {
route,
focused,
index: i,
};
const label = this._renderLabel(scene);
const icon = this.props.renderIcon
? this.props.renderIcon(scene)
: null;
const badge = this.props.renderBadge
? this.props.renderBadge(scene)
: null;
const tabStyle = {};
tabStyle.opacity = opacity;
if (icon) {
if (label) {
tabStyle.paddingTop = 8;
} else {
tabStyle.padding = 12;
}
}
const passedTabStyle = StyleSheet.flatten(this.props.tabStyle);
const isWidthSet =
(passedTabStyle &&
typeof passedTabStyle.width !== 'undefined') ||
scrollEnabled === true;
const tabContainerStyle = {};
if (isWidthSet) {
tabStyle.width = finalTabWidth;
}
if (passedTabStyle && typeof passedTabStyle.flex === 'number') {
tabContainerStyle.flex = passedTabStyle.flex;
} else if (!isWidthSet) {
tabContainerStyle.flex = 1;
}
const accessibilityLabel =
route.accessibilityLabel || route.title;
return (
<TouchableItem
borderless
key={route.key}
testID={route.testID}
accessible={route.accessible}
accessibilityLabel={accessibilityLabel}
accessibilityTraits="button"
pressColor={this.props.pressColor}
pressOpacity={this.props.pressOpacity}
delayPressIn={0}
onPress={() => {
// eslint-disable-line react/jsx-no-bind
const { onTabPress, jumpToIndex } = this.props;
jumpToIndex(i);
if (onTabPress) {
onTabPress(scene);
}
}}
style={tabContainerStyle}
>
<View style={styles.container}>
<Animated.View
style={[
styles.tabItem,
tabStyle,
passedTabStyle,
styles.container,
]}
>
{icon}
{label}
</Animated.View>
{badge
? <Animated.View
style={[
styles.badge,
{ opacity: this.state.visibility },
]}
>
{badge}
</Animated.View>
: null}
</View>
</TouchableItem>
);
})}
</ScrollView>
</View>
</Animated.View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
scroll: {
overflow: Platform.OS === 'web' ? 'auto' : 'scroll',
},
tabBar: {
backgroundColor: '#2196f3',
elevation: 4,
shadowColor: 'black',
shadowOpacity: 0.1,
shadowRadius: StyleSheet.hairlineWidth,
shadowOffset: {
height: StyleSheet.hairlineWidth,
},
zIndex: 1,
},
tabContent: {
flexDirection: 'row',
flexWrap: 'nowrap',
},
tabLabel: {
backgroundColor: 'transparent',
color: 'white',
margin: 8,
},
tabItem: {
flexGrow: 1,
padding: 8,
alignItems: 'center',
justifyContent: 'center',
},
badge: {
position: 'absolute',
top: 0,
right: 0,
},
indicatorContainer: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
indicator: {
backgroundColor: '#ffeb3b',
position: 'absolute',
left: 0,
bottom: 0,
right: 0,
height: 2,
},
});
|
client/src/components/Listing/AllListings/AllListingsComponents/AllListingsSearch.js
|
wolnewitz/raptor-ads
|
import React from 'react';
import { Form, Icon, Input } from 'semantic-ui-react';
const AllListingsSearch = ({ onChange, onSubmit }) =>
<Form onSubmit={e => onSubmit(e)}>
<Form.Field>
<Input
icon={<Icon onClick={e => onSubmit(e)} name="search" inverted circular link />}
placeholder="Enter search address here"
name="image"
onChange={e => onChange(e)}
size="large"
/>
</Form.Field>
</Form>;
AllListingsSearch.propTypes = {
onChange: React.PropTypes.func.isRequired,
onSubmit: React.PropTypes.func.isRequired,
};
export default AllListingsSearch;
|
src/app/containers/Hints.js
|
lmcjt37/kulor-reactify
|
import React from 'react';
import Dialog from 'react-toolbox/lib/dialog';
import themedHints from '../theme/themedHints';
export default class Hints extends React.Component {
constructor(props) {
super(props);
}
getContent() {
let array = this.props.dialogs.helphints.text;
return (
<ul className={themedHints.list}>
{array.map((text,i) => <li key={i} className={themedHints.listItem}>{text}</li>)}
</ul>
)
}
handleToggle() {
this.props.onStateChange({ isDialogActive: false });
}
render() {
const actions = [
{ label: "Close", onClick: () => this.handleToggle() }
];
return (
<Dialog
actions={actions}
active={this.props.isDialogActive}
onEscKeyDown={() => this.handleToggle()}
onOverlayClick={() => this.handleToggle()}
title={this.props.dialogs.helphints.title} >
{this.getContent()}
</Dialog>
);
}
}
|
src/svg-icons/av/featured-video.js
|
kittyjumbalaya/material-components-web
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvFeaturedVideo = (props) => (
<SvgIcon {...props}>
<path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 9H3V5h9v7z"/>
</SvgIcon>
);
AvFeaturedVideo = pure(AvFeaturedVideo);
AvFeaturedVideo.displayName = 'AvFeaturedVideo';
AvFeaturedVideo.muiName = 'SvgIcon';
export default AvFeaturedVideo;
|
examples/react-native-vanilla/storybook/stories/Knobs/index.js
|
rhalff/storybook
|
import React from 'react';
import { View, Text } from 'react-native';
import {
text,
number,
boolean,
color,
select,
array,
date,
object,
} from '@storybook/addon-knobs/react';
export default () => {
const name = text('Name', 'Storyteller');
const age = number('Age', 70, { range: true, min: 0, max: 90, step: 5 });
const fruits = {
apple: 'Apple',
banana: 'Banana',
cherry: 'Cherry',
};
const fruit = select('Fruit', fruits, 'apple');
const dollars = number('Dollars', 12.5);
// NOTE: color picker is currently broken
const backgroundColor = color('background', '#ffff00');
const items = array('Items', ['Laptop', 'Book', 'Whiskey']);
const otherStyles = object('Styles', {
borderWidth: 3,
borderColor: '#ff00ff',
padding: 10,
});
const nice = boolean('Nice', true);
// NOTE: put this last because it currently breaks everything after it :D
const birthday = date('Birthday', new Date('Jan 20 2017'));
const intro = `My name is ${name}, I'm ${age} years old, and my favorite fruit is ${fruit}.`;
const style = { backgroundColor, ...otherStyles };
const salutation = nice ? 'Nice to meet you!' : 'Leave me alone!';
const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' };
return (
<View style={style}>
<Text>{intro}</Text>
<Text>My birthday is: {new Date(birthday).toLocaleDateString('en-US', dateOptions)}</Text>
<Text>My wallet contains: ${dollars.toFixed(2)}</Text>
<Text>In my backpack, I have:</Text>
<View>{items.map(item => <Text key={item}>{item}</Text>)}</View>
<Text>{salutation}</Text>
</View>
);
};
|
src/svg-icons/image/style.js
|
pomerantsev/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageStyle = (props) => (
<SvgIcon {...props}>
<path d="M2.53 19.65l1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zM7.88 8.75c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-2 11c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"/>
</SvgIcon>
);
ImageStyle = pure(ImageStyle);
ImageStyle.displayName = 'ImageStyle';
ImageStyle.muiName = 'SvgIcon';
export default ImageStyle;
|
packages/material-ui/src/styles/withStyles.js
|
cherniavskii/material-ui
|
import React from 'react';
import PropTypes from 'prop-types';
import warning from 'warning';
import hoistNonReactStatics from 'hoist-non-react-statics';
import getDisplayName from 'recompose/getDisplayName';
import wrapDisplayName from 'recompose/wrapDisplayName';
import contextTypes from 'react-jss/lib/contextTypes';
import { create } from 'jss';
import * as ns from 'react-jss/lib/ns';
import jssPreset from './jssPreset';
import createMuiTheme from './createMuiTheme';
import themeListener from './themeListener';
import createGenerateClassName from './createGenerateClassName';
import getStylesCreator from './getStylesCreator';
import getThemeProps from './getThemeProps';
// Default JSS instance.
const jss = create(jssPreset());
// Use a singleton or the provided one by the context.
const generateClassName = createGenerateClassName();
// Global index counter to preserve source order.
// We create the style sheet during at the creation of the component,
// children are handled after the parents, so the order of style elements would be parent->child.
// It is a problem though when a parent passes a className
// which needs to override any childs styles.
// StyleSheet of the child has a higher specificity, because of the source order.
// So our solution is to render sheets them in the reverse order child->sheet, so
// that parent has a higher specificity.
let indexCounter = Number.MIN_SAFE_INTEGER;
export const sheetsManager = new Map();
// We use the same empty object to ref count the styles that don't need a theme object.
const noopTheme = {};
// In order to have self-supporting components, we rely on default theme when not provided.
let defaultTheme;
function getDefaultTheme() {
if (defaultTheme) {
return defaultTheme;
}
defaultTheme = createMuiTheme();
return defaultTheme;
}
// Link a style sheet with a component.
// It does not modify the component passed to it;
// instead, it returns a new component, with a `classes` property.
const withStyles = (stylesOrCreator, options = {}) => Component => {
const { withTheme = false, flip = null, name, ...styleSheetOptions } = options;
const stylesCreator = getStylesCreator(stylesOrCreator);
const listenToTheme = stylesCreator.themingEnabled || withTheme || typeof name === 'string';
indexCounter += 1;
stylesCreator.options.index = indexCounter;
warning(
indexCounter < 0,
[
'Material-UI: you might have a memory leak.',
'The indexCounter is not supposed to grow that much.',
].join(' '),
);
class WithStyles extends React.Component {
constructor(props, context) {
super(props, context);
this.jss = this.context[ns.jss] || jss;
const { muiThemeProviderOptions } = this.context;
if (muiThemeProviderOptions) {
if (muiThemeProviderOptions.sheetsManager) {
this.sheetsManager = muiThemeProviderOptions.sheetsManager;
}
this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration;
}
// Attach the stylesCreator to the instance of the component as in the context
// of react-hot-loader the hooks can be executed in a different closure context:
// https://github.com/gaearon/react-hot-loader/blob/master/src/patch.dev.js#L107
this.stylesCreatorSaved = stylesCreator;
this.sheetOptions = {
generateClassName,
...this.context[ns.sheetOptions],
};
// We use || as the function call is lazy evaluated.
this.theme = listenToTheme ? themeListener.initial(context) || getDefaultTheme() : noopTheme;
this.attach(this.theme);
}
state = {};
componentDidMount() {
if (!listenToTheme) {
return;
}
this.unsubscribeId = themeListener.subscribe(this.context, theme => {
const oldTheme = this.theme;
this.theme = theme;
this.attach(this.theme);
// Rerender the component so the underlying component gets the theme update.
// By theme update we mean receiving and applying the new class names.
this.setState({}, () => {
this.detach(oldTheme);
});
});
}
componentDidUpdate() {
// react-hot-loader specific logic
if (this.stylesCreatorSaved === stylesCreator || process.env.NODE_ENV === 'production') {
return;
}
this.detach(this.theme);
this.stylesCreatorSaved = stylesCreator;
this.attach(this.theme);
this.forceUpdate();
}
componentWillUnmount() {
this.detach(this.theme);
if (this.unsubscribeId !== null) {
themeListener.unsubscribe(this.context, this.unsubscribeId);
}
}
attach(theme) {
if (this.disableStylesGeneration) {
return;
}
const stylesCreatorSaved = this.stylesCreatorSaved;
let sheetManager = this.sheetsManager.get(stylesCreatorSaved);
if (!sheetManager) {
sheetManager = new Map();
this.sheetsManager.set(stylesCreatorSaved, sheetManager);
}
let sheetManagerTheme = sheetManager.get(theme);
if (!sheetManagerTheme) {
sheetManagerTheme = {
refs: 0,
sheet: null,
};
sheetManager.set(theme, sheetManagerTheme);
}
if (sheetManagerTheme.refs === 0) {
const styles = stylesCreatorSaved.create(theme, name);
let meta = name;
if (process.env.NODE_ENV !== 'production' && !meta) {
meta = getDisplayName(Component);
}
const sheet = this.jss.createStyleSheet(styles, {
meta,
classNamePrefix: meta,
flip: typeof flip === 'boolean' ? flip : theme.direction === 'rtl',
link: false,
...this.sheetOptions,
...stylesCreatorSaved.options,
name,
...styleSheetOptions,
});
sheetManagerTheme.sheet = sheet;
sheet.attach();
const sheetsRegistry = this.context[ns.sheetsRegistry];
if (sheetsRegistry) {
sheetsRegistry.add(sheet);
}
}
sheetManagerTheme.refs += 1;
}
detach(theme) {
if (this.disableStylesGeneration) {
return;
}
const stylesCreatorSaved = this.stylesCreatorSaved;
const sheetManager = this.sheetsManager.get(stylesCreatorSaved);
const sheetManagerTheme = sheetManager.get(theme);
sheetManagerTheme.refs -= 1;
if (sheetManagerTheme.refs === 0) {
sheetManager.delete(theme);
this.jss.removeStyleSheet(sheetManagerTheme.sheet);
const sheetsRegistry = this.context[ns.sheetsRegistry];
if (sheetsRegistry) {
sheetsRegistry.remove(sheetManagerTheme.sheet);
}
}
}
disableStylesGeneration = false;
jss = null;
sheetOptions = null;
sheetsManager = sheetsManager;
stylesCreatorSaved = null;
theme = null;
unsubscribeId = null;
render() {
const { classes: classesProp, innerRef, ...other } = this.props;
let classes;
let renderedClasses = {};
if (!this.disableStylesGeneration) {
const sheetManager = this.sheetsManager.get(this.stylesCreatorSaved);
const sheetsManagerTheme = sheetManager.get(this.theme);
renderedClasses = sheetsManagerTheme.sheet.classes;
}
if (classesProp) {
classes = {
...renderedClasses,
...Object.keys(classesProp).reduce((accumulator, key) => {
warning(
renderedClasses[key] || this.disableStylesGeneration,
[
`Material-UI: the key \`${key}\` ` +
`provided to the classes property is not implemented in ${getDisplayName(
Component,
)}.`,
`You can only override one of the following: ${Object.keys(renderedClasses).join(
',',
)}`,
].join('\n'),
);
warning(
!classesProp[key] || typeof classesProp[key] === 'string',
[
`Material-UI: the key \`${key}\` ` +
`provided to the classes property is not valid for ${getDisplayName(Component)}.`,
`You need to provide a non empty string instead of: ${classesProp[key]}.`,
].join('\n'),
);
if (classesProp[key]) {
accumulator[key] = `${renderedClasses[key]} ${classesProp[key]}`;
}
return accumulator;
}, {}),
};
} else {
classes = renderedClasses;
}
const more = getThemeProps({ theme: this.theme, name });
// Provide the theme to the wrapped component.
// So we don't have to use the `withTheme()` Higher-order Component.
if (withTheme) {
more.theme = this.theme;
}
return <Component {...more} classes={classes} ref={innerRef} {...other} />;
}
}
WithStyles.propTypes = {
/**
* Useful to extend the style applied to components.
*/
classes: PropTypes.object,
/**
* Use that property to pass a ref callback to the decorated component.
*/
innerRef: PropTypes.func,
};
WithStyles.contextTypes = {
muiThemeProviderOptions: PropTypes.object,
...contextTypes,
...(listenToTheme ? themeListener.contextTypes : {}),
};
if (process.env.NODE_ENV !== 'production') {
WithStyles.displayName = wrapDisplayName(Component, 'WithStyles');
}
hoistNonReactStatics(WithStyles, Component);
if (process.env.NODE_ENV !== 'production') {
// Exposed for test purposes.
WithStyles.Naked = Component;
WithStyles.options = options;
}
return WithStyles;
};
export default withStyles;
|
app/domain/page/UserProfile.js
|
njxiaohan/TransPal
|
'use strict';
import React, {Component} from 'react'
import {
Text,
View,
ScrollView,
StyleSheet,
Alert
} from 'react-native'
import NavBar from '../component/NavBar'
import Item from '../component/Item'
import {user_getinfo} from "domain/api/apis"
import {Routes} from "domain/page"
//FontAwesome
export class UserProfile extends Component {
constructor(props) {
super(props)
this.phoneNbr="***********"
}
componentDidMount(){
global.logged?this._user_getinfo():null
}
componentWillMount() {
}
back(){
this.props.navigator.pop()
}
async _user_getinfo() {
// alert("获取用户信息!")
if (this.loading) return
try {
this.loading = true
const resultStr = await user_getinfo({pkgCmd:"user.getinfo"})
const resultJson = JSON.parse(resultStr)
this.userName=resultJson.userName
this.phoneNbr=resultJson.phoneNbr
//alert(this.userName+this.phoneNbr)
this.setState({isLogin:true})
}
catch (e) {
alert("获取用户信息失败!")
}
finally {
this.loading = false
}
}
goPage(key) {
let pages = {
"reset-password": Routes.ResetPassword,
"login": Routes.Login,
"new-version": Routes.NewVersion
}
if (pages[key]) {
this.props.navigator.push({...pages[key]})
}
// this.props.navigator.push({...Routes.Address})
}
_exit=()=>{
// global.storage.clearMapForKey('token');
global.storage.remove({
key: 'token'
});
global.token=null
global.logged=null
this.props.navigator.push({...Routes.Tabs})
}
render() {
return (
<View style={{flex: 1, backgroundColor: "#f3f3f3"}}>
<NavBar
title="账户信息"
leftIcon="ios-arrow-back"
leftPress={this.back.bind(this)}
/>
<ScrollView>
<Item name="头像" avatar={2} first={true}/>
<Item name="用户名" disable={true} subName={global.logged?this.userName:"未登录"}/>
<Text style={styles.title}>{"账号绑定"}</Text>
<Item name="手机" font="FontAwesome" icon="mobile" subName={global.logged?this.phoneNbr.slice(0,3)+"****"+this.phoneNbr.slice(7):"未登录"}/>
<Item name="微信" color="#1bce4a" iconSize={15} font="FontAwesome" icon="wechat" subName="已绑定"/>
<Item name="QQ" color="#ce3c1b" iconSize={15} font="FontAwesome" icon="qq" subName="未绑定"/>
<Item name="微博" color="#fa7d3c" iconSize={16} font="FontAwesome" icon="weibo" subName="未绑定"/>
<Text style={styles.title}>{"安全设置"}</Text>
<Item name="登录密码" subName="未绑定" onPress={this.goPage.bind(this, "reset-password")}/>
<Item name=" 支付密码" subName=" 未绑定"/>
<Item name=" 小额免密支付"/>
<Item.Button name=" 退出登录" onPress={this._exit} first={true}/>
</ScrollView>
</View>
)
}
}
// ()=>{this.goPage("address")}
const styles = StyleSheet.create({
title: {
paddingHorizontal: 16,
paddingVertical: 8,
color: "#666"
}
})
|
benchmarks/src/implementations/react-native-web/Tweet/IconDirectMessage.js
|
rofrischmann/fela
|
/* eslint-disable react/prop-types */
import { createElement } from 'react-native';
import React from 'react';
import styles from './styles';
const IconDirectMessage = props =>
createElement('svg', {
children: (
<g>
<path d="M43.34 14H12.66L28 27.946z" />
<path d="M51.392 14.789L30.018 34.22c-.009.008-.028.006-.039.012-.563.5-1.266.768-1.98.768-.72 0-1.442-.258-2.017-.78L4.609 14.79A3.957 3.957 0 0 0 3 18v37a1.998 1.998 0 0 0 2 2c.464 0 .924-.162 1.292-.473L19 46h30c2.243 0 4-1.757 4-4V18a3.96 3.96 0 0 0-1.608-3.211z" />
</g>
),
style: [styles.icon, props.style],
viewBox: '0 0 56 72'
});
IconDirectMessage.metadata = { height: 72, width: 56 };
export default IconDirectMessage;
|
docs/src/app/components/Master.js
|
rscnt/material-ui
|
import React from 'react';
import Title from 'react-title-component';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
import spacing from 'material-ui/styles/spacing';
import styleResizable from 'material-ui/utils/styleResizable';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import {darkWhite, lightWhite, grey900} from 'material-ui/styles/colors';
import AppNavDrawer from './AppNavDrawer';
import FullWidthSection from './FullWidthSection';
const githubButton = (
<IconButton
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true}
/>
);
const Master = React.createClass({
propTypes: {
children: React.PropTypes.node,
location: React.PropTypes.object,
},
contextTypes: {
router: React.PropTypes.object.isRequired,
},
childContextTypes: {
muiTheme: React.PropTypes.object,
},
mixins: [
styleResizable,
],
getInitialState() {
return {
muiTheme: getMuiTheme(),
navDrawerOpen: false,
};
},
getChildContext() {
return {
muiTheme: this.state.muiTheme,
};
},
componentWillMount() {
this.setState({
muiTheme: this.state.muiTheme,
});
},
componentWillReceiveProps(nextProps, nextContext) {
const newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme;
this.setState({
muiTheme: newMuiTheme,
});
},
getStyles() {
const styles = {
appBar: {
position: 'fixed',
// Needed to overlap the examples
zIndex: this.state.muiTheme.zIndex.appBar + 1,
top: 0,
},
root: {
paddingTop: spacing.desktopKeylineIncrement,
minHeight: 400,
},
content: {
margin: spacing.desktopGutter,
},
contentWhenMedium: {
margin: `${spacing.desktopGutter * 2}px ${spacing.desktopGutter * 3}px`,
},
footer: {
backgroundColor: grey900,
textAlign: 'center',
},
a: {
color: darkWhite,
},
p: {
margin: '0 auto',
padding: 0,
color: lightWhite,
maxWidth: 356,
},
iconButton: {
color: darkWhite,
},
};
if (this.isDeviceSize(styleResizable.statics.Sizes.MEDIUM) ||
this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
styles.content = Object.assign(styles.content, styles.contentWhenMedium);
}
return styles;
},
handleTouchTapLeftIconButton() {
this.setState({
navDrawerOpen: !this.state.navDrawerOpen,
});
},
handleChangeRequestNavDrawer(open) {
this.setState({
navDrawerOpen: open,
});
},
handleRequestChangeList(event, value) {
this.context.router.push(value);
this.setState({
navDrawerOpen: false,
});
},
handleChangeMuiTheme(muiTheme) {
this.setState({
muiTheme: muiTheme,
});
},
render() {
const {
location,
children,
} = this.props;
let {
navDrawerOpen,
} = this.state;
const {
prepareStyles,
} = this.state.muiTheme;
const router = this.context.router;
const styles = this.getStyles();
const title =
router.isActive('/get-started') ? 'Get Started' :
router.isActive('/customization') ? 'Customization' :
router.isActive('/components') ? 'Components' :
router.isActive('/discover-more') ? 'Discover More' : '';
let docked = false;
let showMenuIconButton = true;
if (this.isDeviceSize(styleResizable.statics.Sizes.LARGE) && title !== '') {
docked = true;
navDrawerOpen = true;
showMenuIconButton = false;
styles.navDrawer = {
zIndex: styles.appBar.zIndex - 1,
};
styles.root.paddingLeft = 256;
styles.footer.paddingLeft = 256;
}
return (
<div>
<Title render="Material-UI" />
<AppBar
onLeftIconButtonTouchTap={this.handleTouchTapLeftIconButton}
title={title}
zDepth={0}
iconElementRight={githubButton}
style={styles.appBar}
showMenuIconButton={showMenuIconButton}
/>
{title !== '' ?
<div style={prepareStyles(styles.root)}>
<div style={prepareStyles(styles.content)}>
{React.cloneElement(children, {
onChangeMuiTheme: this.handleChangeMuiTheme,
})}
</div>
</div> :
children
}
<AppNavDrawer
style={styles.navDrawer}
location={location}
docked={docked}
onRequestChangeNavDrawer={this.handleChangeRequestNavDrawer}
onRequestChangeList={this.handleRequestChangeList}
open={navDrawerOpen}
/>
<FullWidthSection style={styles.footer}>
<p style={prepareStyles(styles.p)}>
{'Hand crafted with love by the engineers at '}
<a style={styles.a} href="http://www.call-em-all.com/Careers">
Call-Em-All
</a>
{' and our awesome '}
<a
style={prepareStyles(styles.a)}
href="https://github.com/callemall/material-ui/graphs/contributors"
>
contributors
</a>.
</p>
<IconButton
iconStyle={styles.iconButton}
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true}
/>
</FullWidthSection>
</div>
);
},
});
export default Master;
|
packages/material-ui-icons/src/TuneTwoTone.js
|
kybarg/material-ui
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M3 5h10v2H3zm4 6H3v2h4v2h2V9H7zm6 4h-2v6h2v-2h8v-2h-8zM3 17h6v2H3zm8-6h10v2H11zm6-8h-2v6h2V7h4V5h-4z" />
, 'TuneTwoTone');
|
config/webpack/development.js
|
justin808/react-webpack-rails-tutorial
|
// The source code including full typescript support is available at:
// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
const { devServer, inliningCss } = require('@rails/webpacker');
const webpackConfig = require('./webpackConfig');
const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => {
// plugins
if (inliningCss) {
// Note, when this is run, we're building the server and client bundles in separate processes.
// Thus, this plugin is not applied to the server bundle.
// eslint-disable-next-line global-require
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
clientWebpackConfig.plugins.push(
new ReactRefreshWebpackPlugin({
overlay: {
sockPort: devServer.port,
},
}),
);
}
};
module.exports = webpackConfig(developmentEnvOnly);
|
packages/material-ui-icons/src/Battery30.js
|
allanalexandre/material-ui
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0z" /><path fillOpacity=".3" d="M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V15h10V5.33z" /><path d="M7 15v5.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V15H7z" /></React.Fragment>
, 'Battery30');
|
src/svg-icons/hardware/cast-connected.js
|
tan-jerene/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let HardwareCastConnected = (props) => (
<SvgIcon {...props}>
<path d="M1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm18-7H5v1.63c3.96 1.28 7.09 4.41 8.37 8.37H19V7zM1 10v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11zm20-7H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>
</SvgIcon>
);
HardwareCastConnected = pure(HardwareCastConnected);
HardwareCastConnected.displayName = 'HardwareCastConnected';
HardwareCastConnected.muiName = 'SvgIcon';
export default HardwareCastConnected;
|
src/Slider/Slider.spec.js
|
w01fgang/material-ui
|
/* eslint-env mocha */
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import {spy} from 'sinon';
import keycode from 'keycode';
import Slider from './Slider';
import getMuiTheme from '../styles/getMuiTheme';
describe('<Slider />', () => {
const muiTheme = getMuiTheme();
const shallowWithContext = (node) => shallow(node, {context: {muiTheme}});
const getThumbElement = function(shallowWrapper) {
return shallowWrapper.children().at(2).children().at(0).children().at(2);
};
const getTrackContainer = function(shallowWrapper) {
return shallowWrapper.children().at(2);
};
it('renders slider and the hidden input', () => {
const wrapper = shallowWithContext(
<Slider name="slider" />
);
assert.ok(wrapper.find('input[type="hidden"]').length, 'should contain a hidden input');
});
it('renders slider with an initial value', () => {
const wrapper = shallowWithContext(
<Slider name="slider" value={0.5} />
);
assert.strictEqual(wrapper.state().value, 0.5, 'should use the value property for the value state');
assert.strictEqual(
wrapper.find('input[type="hidden"]').props().value,
wrapper.state().value,
'the input value should be equal state.value'
);
});
it('renders slider as a required element in a form', () => {
const wrapper = shallowWithContext(
<Slider name="slider" required={true} />
);
assert.strictEqual(wrapper.find('input[type="hidden"]').props().required, true);
});
it('checks root node properties', () => {
const wrapper = shallowWithContext(
<Slider
name="slider"
style={{
backgroundColor: 'red',
}}
/>
);
assert.strictEqual(wrapper.props().style.backgroundColor, 'red', 'root element should have the style object');
});
it('checks slider initial state', () => {
const wrapper = shallowWithContext(
<Slider name="slider" />
);
assert.strictEqual(wrapper.state().active, false);
assert.strictEqual(wrapper.state().dragging, false);
assert.strictEqual(wrapper.state().focused, false);
assert.strictEqual(wrapper.state().hovered, false);
});
it('checks drag start state', () => {
const handleDragStart = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onDragStart={handleDragStart} />
);
wrapper.instance().onDragStart();
assert.strictEqual(handleDragStart.callCount, 1);
assert.strictEqual(wrapper.state().active, true);
assert.strictEqual(wrapper.state().dragging, true);
});
it('checks drag stop state', () => {
const handleDragStop = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onDragStop={handleDragStop} />
);
wrapper.instance().onDragStop();
assert.strictEqual(handleDragStop.callCount, 1);
assert.strictEqual(wrapper.state().active, false);
assert.strictEqual(wrapper.state().dragging, false);
});
describe('percent', () => {
it('checks that percent and value are being updated correctly', () => {
const wrapper = shallowWithContext(
<Slider
name="slider"
step={0.5}
min={1}
max={5}
/>
);
wrapper.setProps({
value: 1,
});
assert.strictEqual(wrapper.state().value, 1);
assert.strictEqual(getThumbElement(wrapper).props().style.left, '0%');
});
it('checks that value and percent are updated correctly when max prop changes', () => {
const wrapper = shallowWithContext(
<Slider
name="slider"
value={2}
min={0}
max={10}
/>
);
assert.strictEqual(wrapper.state().value, 2);
assert.strictEqual(getThumbElement(wrapper).props().style.left, '20%');
wrapper.setProps({max: 4});
assert.strictEqual(wrapper.state().value, 2);
assert.strictEqual(getThumbElement(wrapper).props().style.left, '50%');
});
});
it('checks events do not fire on the handle when the slider is disabled', () => {
const handleDragStart = spy();
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider
name="slider"
disabled={true}
onDragStart={handleDragStart}
onChange={handleChange}
/>
);
const trackContainer = getTrackContainer(wrapper);
trackContainer.simulate('keydown', {
keyCode: 33,
preventDefault: () => {},
});
trackContainer.simulate('mousedown');
trackContainer.simulate('touchstart');
assert.strictEqual(handleDragStart.callCount, 0);
assert.strictEqual(handleChange.callCount, 0);
});
it('simulates focus event', () => {
const handleFocus = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onFocus={handleFocus} />
);
getTrackContainer(wrapper).simulate('focus');
assert.strictEqual(handleFocus.callCount, 1);
});
it('simulates blur event', () => {
const handleBlur = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onBlur={handleBlur} />
);
getTrackContainer(wrapper).simulate('blur');
assert.strictEqual(handleBlur.callCount, 1);
});
it('simulates onmouseenter event', () => {
const wrapper = shallowWithContext(
<Slider name="slider" />
);
getTrackContainer(wrapper).simulate('mouseenter');
assert.strictEqual(wrapper.state().hovered, true);
});
it('simulates onmouseleave event', () => {
const wrapper = shallowWithContext(
<Slider name="slider" />
);
getTrackContainer(wrapper).simulate('mouseleave');
assert.strictEqual(wrapper.state().hovered, false);
});
describe('keydown', () => {
it('simulates keydown event with a non tracked key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
const event = {
keyCode: keycode('enter'),
preventDefault: spy(),
};
getTrackContainer(wrapper).simulate('keydown', event);
assert.strictEqual(event.preventDefault.callCount, 0);
});
it('simulates the end key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('end'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value, 1);
});
it('simulates the up arrow key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('up'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the up arrow key on an x-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="x-reverse" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('up'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the up arrow key on a y axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('up'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the up arrow key on a y-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y-reverse" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('up'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the right arrow key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('right'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the right arrow key on an x-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="x-reverse" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('right'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the right arrow key on an y axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('right'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the right arrow key on an y-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y-reverse" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('right'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the home key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('home'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the home key on a x-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="x-reverse" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('home'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the home key on a y axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('home'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the home key on a y-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('home'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the down arrow key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('down'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the down arrow key on a x-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="x-reverse" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('down'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the down arrow key on a y axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('down'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the down arrow key on a y-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y-reverse" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('down'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the left arrow key', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('left'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the left arrow key for an x-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="x-reverse" onChange={handleChange} />
);
const previousValue = wrapper.state().value;
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('left'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 1);
assert.strictEqual(wrapper.state().value > previousValue, true);
});
it('simulates the left arrow key for a y axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('left'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
it('simulates the left arrow key for a y-reverse axis slider', () => {
const handleChange = spy();
const wrapper = shallowWithContext(
<Slider name="slider" axis="y-reverse" onChange={handleChange} />
);
getTrackContainer(wrapper).simulate('keydown', {
keyCode: keycode('left'),
preventDefault: () => {},
});
assert.strictEqual(handleChange.callCount, 0);
assert.strictEqual(wrapper.state().value, 0);
});
});
});
|
components/input.js
|
kalicki/WhatsAppLike
|
import React from 'react'
const Input = ({ placeholder, value, onChange, onSubmit, name, margin = 0, buttonSubmit }) =>
<form onSubmit={onSubmit}>
<input
type="text"
value={value}
placeholder={placeholder}
name={name}
onChange={onChange}
style={{ margin }}
/>
<input type="submit" value={buttonSubmit}/>
<style jsx>
{`
input[type="submit"] {
font-size: 1.8rem;
display: inline-block;
width: 10%;
padding: 25px 30px;
outline: none;
border-radius: 0;
-webkit-appearance: none;
}
input[type="text"] {
font-family: 'Poppins', sans-serif;
font-size: 1.8rem;
border: 1px solid #EEEBF3;
border-left: 0;
border-bottom: 0;
padding: 25px 30px;
width: 90%;
display: inline-block;
outline: none;
transition: border .2s ease;
border-radius: 0;
-webkit-appearance: none;
}
`}
</style>
</form>
export default Input
|
components/Panel/stories.js
|
insane-ux/rebulma
|
// @flow
import React from 'react'
import { storiesOf } from '@kadira/storybook'
import { withState } from 'recompose'
import Input from 'components/Input'
import {
Panel,
PanelHeading,
PanelBlock,
PanelTabs,
} from './'
const items = [
'All',
'Success',
'Fail',
]
const MyPanel = withState('selectedTab', 'selectTab', 0)(
({
selectedTab,
selectTab,
}: {
selectedTab: number,
selectTab: (selectedTab: number) => void,
}) => (
<Panel>
<PanelHeading>Tasks</PanelHeading>
<PanelTabs
selected={selectedTab}
select={selectTab}
items={items}
/>
<PanelBlock>
<Input
leftIcon="fa-search"
theme={{
input: 'is-small',
leftIcon: 'is-small',
}}
/>
</PanelBlock>
{selectedTab === 0 && (
<PanelBlock>
All Tasks
</PanelBlock>
)}
{selectedTab === 1 && (
<PanelBlock>
Success Tasks
</PanelBlock>
)}
{selectedTab === 2 && (
<PanelBlock>
Fail Tasks
</PanelBlock>
)}
<PanelBlock>
The other block
</PanelBlock>
</Panel>
),
)
storiesOf('Panel', module)
.add('default', () => (
<div style={{ width: 300 }}>
<MyPanel />
</div>
))
|
ajax/libs/forerunnerdb/1.3.819/fdb-legacy.min.js
|
x112358/cdnjs
|
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("../lib/Core");a("../lib/CollectionGroup"),a("../lib/View"),a("../lib/Highchart"),a("../lib/Persist"),a("../lib/Document"),a("../lib/Overview"),a("../lib/OldView"),a("../lib/OldView.Bind"),a("../lib/Grid");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/CollectionGroup":6,"../lib/Core":8,"../lib/Document":10,"../lib/Grid":12,"../lib/Highchart":13,"../lib/OldView":30,"../lib/OldView.Bind":29,"../lib/Overview":33,"../lib/Persist":35,"../lib/View":41}],2:[function(a,b,c){"use strict";var d,e=a("./Shared"),f=a("./Path"),g=function(a){this._primaryKey="_id",this._keyArr=[],this._data=[],this._objLookup={},this._count=0,this._keyArr=d.parse(a,!0)};e.addModule("ActiveBucket",g),e.mixin(g.prototype,"Mixin.Sorting"),d=new f,e.synthesize(g.prototype,"primaryKey"),g.prototype.qs=function(a,b,c,d){if(!b.length)return 0;for(var e,f,g,h=-1,i=0,j=b.length-1;j>=i&&(e=Math.floor((i+j)/2),h!==e);)f=b[e],void 0!==f&&(g=d(this,a,c,f),g>0&&(i=e+1),0>g&&(j=e-1)),h=e;return g>0?e+1:e},g.prototype._sortFunc=function(a,b,c,e){var f,g,h,i=c.split(".:."),j=e.split(".:."),k=a._keyArr,l=k.length;for(f=0;l>f;f++)if(g=k[f],h=typeof d.get(b,g.path),"number"===h&&(i[f]=Number(i[f]),j[f]=Number(j[f])),i[f]!==j[f]){if(1===g.value)return a.sortAsc(i[f],j[f]);if(-1===g.value)return a.sortDesc(i[f],j[f])}},g.prototype.insert=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c?(c=this.qs(a,this._data,b,this._sortFunc),this._data.splice(c,0,b)):this._data.splice(c,0,b),this._objLookup[a[this._primaryKey]]=b,this._count++,c},g.prototype.remove=function(a){var b,c;return b=this._objLookup[a[this._primaryKey]],b?(c=this._data.indexOf(b),c>-1?(this._data.splice(c,1),delete this._objLookup[a[this._primaryKey]],this._count--,!0):!1):!1},g.prototype.index=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c&&(c=this.qs(a,this._data,b,this._sortFunc)),c},g.prototype.documentKey=function(a){var b,c,e="",f=this._keyArr,g=f.length;for(b=0;g>b;b++)c=f[b],e&&(e+=".:."),e+=d.get(a,c.path);return e+=".:."+a[this._primaryKey]},g.prototype.count=function(){return this._count},e.finishModule("ActiveBucket"),b.exports=g},{"./Path":34,"./Shared":40}],3:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=new e,g=function(a,b,c){this.init.apply(this,arguments)};g.prototype.init=function(a,b,c,d,e){this._store=[],this._keys=[],void 0!==c&&this.primaryKey(c),void 0!==b&&this.index(b),void 0!==d&&this.compareFunc(d),void 0!==e&&this.hashFunc(e),void 0!==a&&this.data(a)},d.addModule("BinaryTree",g),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Sorting"),d.mixin(g.prototype,"Mixin.Common"),d.synthesize(g.prototype,"compareFunc"),d.synthesize(g.prototype,"hashFunc"),d.synthesize(g.prototype,"indexDir"),d.synthesize(g.prototype,"primaryKey"),d.synthesize(g.prototype,"keys"),d.synthesize(g.prototype,"index",function(a){return void 0!==a&&(this.debug()&&console.log("Setting index",a,f.parse(a,!0)),this.keys(f.parse(a,!0))),this.$super.call(this,a)}),g.prototype.clear=function(){delete this._data,delete this._left,delete this._right,this._store=[]},g.prototype.data=function(a){return void 0!==a?(this._data=a,this._hashFunc&&(this._hash=this._hashFunc(a)),this):this._data},g.prototype.push=function(a){return void 0!==a?(this._store.push(a),this):!1},g.prototype.pull=function(a){if(void 0!==a){var b=this._store.indexOf(a);if(b>-1)return this._store.splice(b,1),this}return!1},g.prototype._compareFunc=function(a,b){var c,d,e=0;for(c=0;c<this._keys.length;c++)if(d=this._keys[c],1===d.value?e=this.sortAsc(f.get(a,d.path),f.get(b,d.path)):-1===d.value&&(e=this.sortDesc(f.get(a,d.path),f.get(b,d.path))),this.debug()&&console.log("Compared %s with %s order %d in path %s and result was %d",f.get(a,d.path),f.get(b,d.path),d.value,d.path,e),0!==e)return this.debug()&&console.log("Retuning result %d",e),e;return this.debug()&&console.log("Retuning result %d",e),e},g.prototype._hashFunc=function(a){return a[this._keys[0].path]},g.prototype.removeChildNode=function(a){this._left===a?delete this._left:this._right===a&&delete this._right},g.prototype.nodeBranch=function(a){return this._left===a?"left":this._right===a?"right":void 0},g.prototype.insert=function(a){var b,c,d,e;if(a instanceof Array){for(c=[],d=[],e=0;e<a.length;e++)this.insert(a[e])?c.push(a[e]):d.push(a[e]);return{inserted:c,failed:d}}return this.debug()&&console.log("Inserting",a),this._data?(b=this._compareFunc(this._data,a),0===b?(this.debug()&&console.log("Data is equal (currrent, new)",this._data,a),this._left?this._left.insert(a):(this._left=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._left._parent=this),!0):-1===b?(this.debug()&&console.log("Data is greater (currrent, new)",this._data,a),this._right?this._right.insert(a):(this._right=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._right._parent=this),!0):1===b?(this.debug()&&console.log("Data is less (currrent, new)",this._data,a),this._left?this._left.insert(a):(this._left=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._left._parent=this),!0):!1):(this.debug()&&console.log("Node has no data, setting data",a),this.data(a),!0)},g.prototype.remove=function(a){var b,c,d,e=this.primaryKey();if(a instanceof Array){for(c=[],d=0;d<a.length;d++)this.remove(a[d])&&c.push(a[d]);return c}return this.debug()&&console.log("Removing",a),this._data[e]===a[e]?this._remove(this):(b=this._compareFunc(this._data,a),-1===b&&this._right?this._right.remove(a):1===b&&this._left?this._left.remove(a):!1)},g.prototype._remove=function(a){var b,c;return this._left?(b=this._left,c=this._right,this._left=b._left,this._right=b._right,this._data=b._data,this._store=b._store,c&&(b.rightMost()._right=c)):this._right?(c=this._right,this._left=c._left,this._right=c._right,this._data=c._data,this._store=c._store):this.clear(),!0},g.prototype.leftMost=function(){return this._left?this._left.leftMost():this},g.prototype.rightMost=function(){return this._right?this._right.rightMost():this},g.prototype.lookup=function(a,b,c,d){var e=this._compareFunc(this._data,a);return d=d||[],0===e&&(this._left&&this._left.lookup(a,b,c,d),d.push(this._data),this._right&&this._right.lookup(a,b,c,d)),-1===e&&this._right&&this._right.lookup(a,b,c,d),1===e&&this._left&&this._left.lookup(a,b,c,d),d},g.prototype.inOrder=function(a,b){switch(b=b||[],this._left&&this._left.inOrder(a,b),a){case"hash":b.push(this._hash);break;case"data":b.push(this._data);break;default:b.push({key:this._data,arr:this._store})}return this._right&&this._right.inOrder(a,b),b},g.prototype.startsWith=function(a,b,c,d){var e,g,h=f.get(this._data,a),i=h.substr(0,b.length);return d=d||[],void 0===d._visitedCount&&(d._visitedCount=0),d._visitedCount++,d._visitedNodes=d._visitedNodes||[],d._visitedNodes.push(h),g=this.sortAsc(i,b),e=i===b,0===g&&(this._left&&this._left.startsWith(a,b,c,d),e&&d.push(this._data),this._right&&this._right.startsWith(a,b,c,d)),-1===g&&(e&&d.push(this._data),this._right&&this._right.startsWith(a,b,c,d)),1===g&&(this._left&&this._left.startsWith(a,b,c,d),e&&d.push(this._data)),d},g.prototype.findRange=function(a,b,c,d,f,g){f=f||[],g=g||new e(b),this._left&&this._left.findRange(a,b,c,d,f,g);var h=g.value(this._data),i=this.sortAsc(h,c),j=this.sortAsc(h,d);if(!(0!==i&&1!==i||0!==j&&-1!==j))switch(a){case"hash":f.push(this._hash);break;case"data":f.push(this._data);break;default:f.push({key:this._data,arr:this._store})}return this._right&&this._right.findRange(a,b,c,d,f,g),f},g.prototype.match=function(a,b,c){var d,e,g,h=[],i=0;for(d=f.parseArr(this._index,{verbose:!0}),e=f.parseArr(a,c&&c.pathOptions?c.pathOptions:{ignore:/\$/,verbose:!0}),g=0;g<d.length;g++)e[g]===d[g]&&(i++,h.push(e[g]));return{matchedKeys:h,totalKeyCount:e.length,score:i}},d.finishModule("BinaryTree"),b.exports=g},{"./Path":34,"./Shared":40}],4:[function(a,b,c){"use strict";var d,e;d=function(){var a,b,c,d=[];for(b=0;256>b;b++){for(a=b,c=0;8>c;c++)a=1&a?3988292384^a>>>1:a>>>1;d[b]=a}return d}(),e=function(a){var b,c=-1;for(b=0;b<a.length;b++)c=c>>>8^d[255&(c^a.charCodeAt(b))];return(-1^c)>>>0},b.exports=e},{}],5:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n,o;d=a("./Shared");var p=function(a,b){this.init.apply(this,arguments)};p.prototype.init=function(a,b){this.sharedPathSolver=o,this._primaryKey="_id",this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._name=a,this._data=[],this._metrics=new f,this._options=b||{changeTimestamp:!1},this._options.db&&this.db(this._options.db),this._metaData={},this._deferQueue={insert:[],update:[],remove:[],upsert:[],async:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100},this._deferTime={insert:1,update:1,remove:1,upsert:1},this._deferredCalls=!0,this.subsetOf(this)},d.addModule("Collection",p),d.mixin(p.prototype,"Mixin.Common"),d.mixin(p.prototype,"Mixin.Events"),d.mixin(p.prototype,"Mixin.ChainReactor"),d.mixin(p.prototype,"Mixin.CRUD"),d.mixin(p.prototype,"Mixin.Constants"),d.mixin(p.prototype,"Mixin.Triggers"),d.mixin(p.prototype,"Mixin.Sorting"),d.mixin(p.prototype,"Mixin.Matching"),d.mixin(p.prototype,"Mixin.Updating"),d.mixin(p.prototype,"Mixin.Tags"),f=a("./Metrics"),g=a("./KeyValueStore"),h=a("./Path"),i=a("./IndexHashMap"),j=a("./IndexBinaryTree"),k=a("./Index2d"),e=d.modules.Db,l=a("./Overload"),m=a("./ReactorIO"),n=a("./Condition"),o=new h,d.synthesize(p.prototype,"deferredCalls"),d.synthesize(p.prototype,"state"),d.synthesize(p.prototype,"name"),d.synthesize(p.prototype,"metaData"),d.synthesize(p.prototype,"capped"),d.synthesize(p.prototype,"cappedSize"),p.prototype._asyncPending=function(a){this._deferQueue.async.push(a)},p.prototype._asyncComplete=function(a){for(var b=this._deferQueue.async.indexOf(a);b>-1;)this._deferQueue.async.splice(b,1),b=this._deferQueue.async.indexOf(a);0===this._deferQueue.async.length&&this.deferEmit("ready")},p.prototype.data=function(){return this._data},p.prototype.drop=function(a){var b;if(this.isDropped())return a&&a.call(this,!1,!0),!0;if(this._db&&this._db._collection&&this._name){if(this.debug()&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this.emit("drop",this),delete this._db._collection[this._name],this._collate)for(b in this._collate)this._collate.hasOwnProperty(b)&&this.collateRemove(b);return delete this._primaryKey,delete this._primaryIndex,delete this._primaryCrc,delete this._crcLookup,delete this._data,delete this._metrics,delete this._listeners,a&&a.call(this,!1,!0),!0}return a&&a.call(this,!1,!0),!1},p.prototype.primaryKey=function(a){if(void 0!==a){if(this._primaryKey!==a){var b=this._primaryKey;this._primaryKey=a,this._primaryIndex.primaryKey(a),this.rebuildPrimaryKeyIndex(),this.chainSend("primaryKey",{keyName:a,oldData:b})}return this}return this._primaryKey},p.prototype._onInsert=function(a,b){this.emit("insert",a,b)},p.prototype._onUpdate=function(a){this.emit("update",a)},p.prototype._onRemove=function(a){this.emit("remove",a)},p.prototype._onChange=function(){this._options.changeTimestamp&&(this._metaData.lastChange=this.serialiser.convert(new Date))},d.synthesize(p.prototype,"db",function(a){return a&&"_id"===this.primaryKey()&&(this.primaryKey(a.primaryKey()),this.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(p.prototype,"mongoEmulation"),p.prototype.setData=new l("Collection.prototype.setData",{"*":function(a){return this.$main.call(this,a,{})},"*, object":function(a,b){return this.$main.call(this,a,b)},"*, function":function(a,b){return this.$main.call(this,a,{},b)},"*, *, function":function(a,b,c){return this.$main.call(this,a,b,c)},"*, *, *":function(a,b,c){return this.$main.call(this,a,b,c)},$main:function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var d=this.deferredCalls(),e=[].concat(this._data);this.deferredCalls(!1),b=this.options(b),b.$decouple&&(a=this.decouple(a)),a instanceof Array||(a=[a]),this.remove({}),this.insert(a),this.deferredCalls(d),this._onChange(),this.emit("setData",this._data,e)}return c&&c.call(this),this}}),p.prototype.rebuildPrimaryKeyIndex=function(a){a=a||{$ensureKeys:void 0,$violationCheck:void 0};var b,c,d,e,f=a&&void 0!==a.$ensureKeys?a.$ensureKeys:!0,g=a&&void 0!==a.$violationCheck?a.$violationCheck:!0,h=this._primaryIndex,i=this._primaryCrc,j=this._crcLookup,k=this._primaryKey;for(h.truncate(),i.truncate(),j.truncate(),b=this._data,c=b.length;c--;){if(d=b[c],f&&this.ensurePrimaryKey(d),g){if(!h.uniqueSet(d[k],d))throw this.logIdentifier()+" Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: "+d[this._primaryKey]}else h.set(d[k],d);e=this.hash(d),i.set(d[k],e),j.set(e,d)}},p.prototype.ensurePrimaryKey=function(a){void 0===a[this._primaryKey]&&(a[this._primaryKey]=this.objectId())},p.prototype.truncate=function(){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.emit("truncate",this._data),this._data.length=0,this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._onChange(),this.emit("immediateChange",{type:"truncate"}),this.deferEmit("change",{type:"truncate"}),this},p.prototype.upsert=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var c,d,e=this._deferQueue.upsert,f=this._deferThreshold.upsert,g={};if(a instanceof Array){if(this._deferredCalls&&a.length>f)return this._deferQueue.upsert=e.concat(a),this._asyncPending("upsert"),this.processQueue("upsert",b),{};for(g=[],d=0;d<a.length;d++)g.push(this.upsert(a[d]));return b&&b.call(this),g}switch(a[this._primaryKey]?(c={},c[this._primaryKey]=a[this._primaryKey],this._primaryIndex.lookup(c)[0]?g.op="update":g.op="insert"):g.op="insert",g.op){case"insert":g.result=this.insert(a,b);break;case"update":g.result=this.update(c,a,{},b)}return g}return b&&b.call(this),{}},p.prototype.filter=function(a,b,c){return this.find(a,c).filter(b)},p.prototype.filterUpdate=function(a,b,c){var d,e,f,g,h=this.find(a,c),i=[],j=this.primaryKey();for(g=0;g<h.length;g++)d=h[g],f=b(d),f&&(e={},e[j]=d[j],i.push(this.update(e,f)));return i},p.prototype.update=function(a,b,c,d){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.mongoEmulation()?(this.convertToFdb(a),this.convertToFdb(b)):b=this.decouple(b),b=this.transformIn(b),this._handleUpdate(a,b,c,d)},p.prototype._handleUpdate=function(a,b,c,d){var e,f,g=this,h=this._metrics.create("update"),i=function(d){var e,f,i,j=g.decouple(d);return g.willTrigger(g.TYPE_UPDATE,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_UPDATE,g.PHASE_AFTER)?(e=g.decouple(d),f={type:"update",query:g.decouple(a),update:g.decouple(b),options:g.decouple(c),op:h},i=g.updateObject(e,f.update,f.query,f.options,""),g.processTrigger(f,g.TYPE_UPDATE,g.PHASE_BEFORE,d,e)!==!1?(i=g.updateObject(d,e,f.query,f.options,""),g.processTrigger(f,g.TYPE_UPDATE,g.PHASE_AFTER,j,e)):i=!1):i=g.updateObject(d,b,a,c,""),g._updateIndexes(j,d),i};return h.start(),h.time("Retrieve documents to update"),e=this.find(a,{$decouple:!1}),h.time("Retrieve documents to update"),e.length?(h.time("Update documents"),f=e.filter(i),h.time("Update documents"),f.length?(this.debug()&&console.log(this.logIdentifier()+" Updated some data"),h.time("Resolve chains"),this.chainWillSend()&&this.chainSend("update",{query:a,update:b,dataSet:this.decouple(f)},c),h.time("Resolve chains"),this._onUpdate(f),this._onChange(),d&&d.call(this,f||[]),this.emit("immediateChange",{type:"update",data:f}),this.deferEmit("change",{type:"update",data:f})):d&&d.call(this,f||[])):d&&d.call(this,f||[]),h.stop(),f||[]},p.prototype._replaceObj=function(a,b){var c;this._removeFromIndexes(a);for(c in a)a.hasOwnProperty(c)&&delete a[c];for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);if(!this._insertIntoIndexes(a))throw this.logIdentifier()+" Primary key violation in update! Key violated: "+a[this._primaryKey];return this},p.prototype.updateById=function(a,b){var c={};return c[this._primaryKey]=a,this.update(c,b)[0]},p.prototype.updateObject=function(a,b,c,d,e,f){b=this.decouple(b),e=e||"","."===e.substr(0,1)&&(e=e.substr(1,e.length-1));var g,i,j,k,l,m,n,o,p,q,r,s,t=!1,u=!1;for(s in b)if(b.hasOwnProperty(s)){if(g=!1,"$"===s.substr(0,1))switch(s){case"$key":case"$index":case"$data":case"$min":case"$max":g=!0;break;case"$each":for(g=!0,k=b.$each.length,j=0;k>j;j++)u=this.updateObject(a,b.$each[j],c,d,e),u&&(t=!0);t=t||u;break;case"$replace":g=!0,n=b.$replace,o=this.primaryKey();for(m in a)a.hasOwnProperty(m)&&m!==o&&void 0===n[m]&&(this._updateUnset(a,m),t=!0);for(m in n)n.hasOwnProperty(m)&&m!==o&&(this._updateOverwrite(a,m,n[m]),t=!0);break;default:g=!0,u=this.updateObject(a,b[s],c,d,e,s),t=t||u}if(this._isPositionalKey(s)&&(g=!0,s=s.substr(0,s.length-2),p=new h(e+"."+s),a[s]&&a[s]instanceof Array&&a[s].length)){for(i=[],j=0;j<a[s].length;j++)this._match(a[s][j],p.value(c)[0],d,"",{})&&i.push(j);for(j=0;j<i.length;j++)u=this.updateObject(a[s][i[j]],b[s+".$"],c,d,e+"."+s,f),t=t||u}if(!g)if(f||"object"!=typeof b[s])switch(f){case"$inc":var v=!0;b[s]>0?b.$max&&a[s]>=b.$max&&(v=!1):b[s]<0&&b.$min&&a[s]<=b.$min&&(v=!1),v&&(this._updateIncrement(a,s,b[s]),t=!0);break;case"$cast":switch(b[s]){case"array":a[s]instanceof Array||(this._updateProperty(a,s,b.$data||[]),t=!0);break;case"object":a[s]instanceof Object&&!(a[s]instanceof Array)||(this._updateProperty(a,s,b.$data||{}),t=!0);break;case"number":"number"!=typeof a[s]&&(this._updateProperty(a,s,Number(a[s])),t=!0);break;case"string":"string"!=typeof a[s]&&(this._updateProperty(a,s,String(a[s])),t=!0);break;default:throw this.logIdentifier()+" Cannot update cast to unknown type: "+b[s]}break;case"$push":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot push to a key that is not an array! ("+s+")";if(void 0!==b[s].$position&&b[s].$each instanceof Array)for(l=b[s].$position,k=b[s].$each.length,j=0;k>j;j++)this._updateSplicePush(a[s],l+j,b[s].$each[j]);else if(b[s].$each instanceof Array)for(k=b[s].$each.length,j=0;k>j;j++)this._updatePush(a[s],b[s].$each[j]);else this._updatePush(a[s],b[s]);t=!0;break;case"$pull":if(a[s]instanceof Array){for(i=[],j=0;j<a[s].length;j++)this._match(a[s][j],b[s],d,"",{})&&i.push(j);for(k=i.length;k--;)this._updatePull(a[s],i[k]),t=!0}break;case"$pullAll":if(a[s]instanceof Array){if(!(b[s]instanceof Array))throw this.logIdentifier()+" Cannot pullAll without being given an array of values to pull! ("+s+")";if(i=a[s],k=i.length,k>0)for(;k--;){for(l=0;l<b[s].length;l++)i[k]===b[s][l]&&(this._updatePull(a[s],k),k--,t=!0);if(0>k)break}}break;case"$addToSet":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot addToSet on a key that is not an array! ("+s+")";var w,x,y,z,A=a[s],B=A.length,C=!0,D=d&&d.$addToSet;for(b[s].$key?(y=!1,z=new h(b[s].$key),x=z.value(b[s])[0],delete b[s].$key):D&&D.key?(y=!1,z=new h(D.key),x=z.value(b[s])[0]):(x=this.jStringify(b[s]),y=!0),w=0;B>w;w++)if(y){if(this.jStringify(A[w])===x){C=!1;break}}else if(x===z.value(A[w])[0]){C=!1;break}C&&(this._updatePush(a[s],b[s]),t=!0);break;case"$splicePush":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot splicePush with a key that is not an array! ("+s+")";if(l=b.$index,void 0===l)throw this.logIdentifier()+" Cannot splicePush without a $index integer value!";delete b.$index,l>a[s].length&&(l=a[s].length),this._updateSplicePush(a[s],l,b[s]),t=!0;break;case"$move":if(!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot move on a key that is not an array! ("+s+")";for(j=0;j<a[s].length;j++)if(this._match(a[s][j],b[s],d,"",{})){var E=b.$index;if(void 0===E)throw this.logIdentifier()+" Cannot move without a $index integer value!";delete b.$index,this._updateSpliceMove(a[s],j,E),t=!0;break}break;case"$mul":this._updateMultiply(a,s,b[s]),t=!0;break;case"$rename":this._updateRename(a,s,b[s]),t=!0;break;case"$overwrite":this._updateOverwrite(a,s,b[s]),t=!0;break;case"$unset":this._updateUnset(a,s),t=!0;break;case"$clear":this._updateClear(a,s),t=!0;break;case"$pop":if(!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot pop from a key that is not an array! ("+s+")";this._updatePop(a[s],b[s])&&(t=!0);break;case"$toggle":this._updateProperty(a,s,!a[s]),t=!0;break;default:a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0)}else if(null!==a[s]&&"object"==typeof a[s])if(q=a[s]instanceof Array,r=b[s]instanceof Array,q||r)if(!r&&q)for(j=0;j<a[s].length;j++)u=this.updateObject(a[s][j],b[s],c,d,e+"."+s,f),t=t||u;else a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0);else u=this.updateObject(a[s],b[s],c,d,e+"."+s,f),t=t||u;else a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0)}return t},p.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},p.prototype.remove=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f,g,h,i,j,k,l=this;if("function"==typeof b&&(c=b,b={}),this.mongoEmulation()&&this.convertToFdb(a),a instanceof Array){for(g=[],f=0;f<a.length;f++)g.push(this.remove(a[f],{noEmit:!0}));return(!b||b&&!b.noEmit)&&this._onRemove(g),c&&c.call(this,!1,g),g}if(g=[],d=this.find(a,{$decouple:!1}),d.length){h=function(a){l._removeFromIndexes(a),e=l._data.indexOf(a),l._dataRemoveAtIndex(e),g.push(a)};for(var m=0;m<d.length;m++)j=d[m],l.willTrigger(l.TYPE_REMOVE,l.PHASE_BEFORE)||l.willTrigger(l.TYPE_REMOVE,l.PHASE_AFTER)?(i={type:"remove"},k=l.decouple(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_BEFORE,k,k)!==!1&&(h(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_AFTER,k,k))):h(j);g.length&&(l.chainSend("remove",{query:a,dataSet:g},b),(!b||b&&!b.noEmit)&&this._onRemove(g),this._onChange(),this.emit("immediateChange",{type:"remove",data:g}),this.deferEmit("change",{type:"remove",data:g}))}return c&&c.call(this,!1,g),g},p.prototype.removeById=function(a){var b={};return b[this._primaryKey]=a,this.remove(b)[0]},p.prototype.processQueue=function(a,b,c){var d,e,f=this,g=this._deferQueue[a],h=this._deferThreshold[a],i=this._deferTime[a];if(c=c||{deferred:!0},g.length){switch(d=g.length>h?g.splice(0,h):g.splice(0,g.length),e=f[a](d),a){case"insert":c.inserted=c.inserted||[],c.failed=c.failed||[],c.inserted=c.inserted.concat(e.inserted),c.failed=c.failed.concat(e.failed)}setTimeout(function(){f.processQueue.call(f,a,b,c)},i)}else b&&b.call(this,c),this._asyncComplete(a);this.isProcessingQueue()||this.deferEmit("queuesComplete")},p.prototype.isProcessingQueue=function(){var a;for(a in this._deferQueue)if(this._deferQueue.hasOwnProperty(a)&&this._deferQueue[a].length)return!0;return!1},p.prototype.insert=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return"function"==typeof b?(c=b,b=this._data.length):void 0===b&&(b=this._data.length),a=this.transformIn(a),this._insertHandle(a,b,c)},p.prototype._insertHandle=function(a,b,c){var d,e,f,g=this._deferQueue.insert,h=this._deferThreshold.insert,i=[],j=[];if(a instanceof Array){if(this._deferredCalls&&a.length>h)return this._deferQueue.insert=g.concat(a),this._asyncPending("insert"),void this.processQueue("insert",c);for(f=0;f<a.length;f++)d=this._insert(a[f],b+f),d===!0?i.push(a[f]):j.push({doc:a[f],reason:d})}else d=this._insert(a,b),d===!0?i.push(a):j.push({doc:a,reason:d});return e={deferred:!1,inserted:i,failed:j},this._onInsert(i,j),c&&c.call(this,e),this._onChange(),this.emit("immediateChange",{type:"insert",data:i,failed:j}),this.deferEmit("change",{type:"insert",data:i,failed:j}),e},p.prototype._insert=function(a,b){if(a){var c,d,e,f,g=this,h=this.capped(),i=this.cappedSize();if(this.ensurePrimaryKey(a),c=this.insertIndexViolation(a),e=function(a){g._insertIntoIndexes(a),b>g._data.length&&(b=g._data.length),g._dataInsertAtIndex(b,a),h&&g._data.length>i&&g.removeById(g._data[0][g._primaryKey]),g.chainWillSend()&&g.chainSend("insert",{dataSet:g.decouple([a])},{index:b})},c)return"Index violation in index: "+c;if(g.willTrigger(g.TYPE_INSERT,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)){if(d={type:"insert"},g.processTrigger(d,g.TYPE_INSERT,g.PHASE_BEFORE,{},a)===!1)return"Trigger cancelled operation";e(a),g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)&&(f=g.decouple(a),g.processTrigger(d,g.TYPE_INSERT,g.PHASE_AFTER,{},f))}else e(a);return!0}return"No document passed to insert"},p.prototype._dataInsertAtIndex=function(a,b){this._data.splice(a,0,b)},p.prototype._dataRemoveAtIndex=function(a){this._data.splice(a,1)},p.prototype._dataReplace=function(a){for(;this._data.length;)this._data.pop();this._data=this._data.concat(a)},p.prototype._insertIntoIndexes=function(a){var b,c,d=this._indexByName,e=this.hash(a),f=this._primaryKey;c=this._primaryIndex.uniqueSet(a[f],a),this._primaryCrc.uniqueSet(a[f],e),this._crcLookup.uniqueSet(e,a);for(b in d)d.hasOwnProperty(b)&&d[b].insert(a);return c},p.prototype._removeFromIndexes=function(a){var b,c=this._indexByName,d=this.hash(a),e=this._primaryKey;this._primaryIndex.unSet(a[e]),this._primaryCrc.unSet(a[e]),this._crcLookup.unSet(d);for(b in c)c.hasOwnProperty(b)&&c[b].remove(a)},p.prototype._updateIndexes=function(a,b){this._removeFromIndexes(a),this._insertIntoIndexes(b)},p.prototype._rebuildIndexes=function(){var a,b=this._indexByName;for(a in b)b.hasOwnProperty(a)&&b[a].rebuild()},p.prototype.subset=function(a,b){var c,d=this.find(a,b);return c=new p,c.db(this._db),c.subsetOf(this).primaryKey(this._primaryKey).setData(d),c},d.synthesize(p.prototype,"subsetOf"),p.prototype.isSubsetOf=function(a){return this._subsetOf===a},p.prototype.distinct=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f=this.find(b,c),g=new h(a),i={},j=[];for(e=0;e<f.length;e++)d=g.value(f[e])[0],d&&!i[d]&&(i[d]=!0,j.push(d));return j},p.prototype.findById=function(a,b){var c={};return c[this._primaryKey]=a,this.find(c,b)[0]},p.prototype.peek=function(a,b){var c,d,e=this._data,f=e.length,g=new p,h=typeof a;if("string"===h){for(c=0;f>c;c++)d=this.jStringify(e[c]),d.indexOf(a)>-1&&g.insert(e[c]);return g.find({},b)}return this.find(a,b)},p.prototype.explain=function(a,b){var c=this.find(a,b);return c.__fdbOp._data},p.prototype.options=function(a){return a=a||{},a.$decouple=void 0!==a.$decouple?a.$decouple:!0,a.$explain=void 0!==a.$explain?a.$explain:!1,a},p.prototype.find=function(a,b,c){return this.mongoEmulation()&&this.convertToFdb(a),c?(c.call(this,"Callbacks for the find() operation are not yet implemented!",[]),[]):this._find.call(this,a,b,c)},p.prototype._find=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";a=a||{};var c,d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this._metrics.create("find"),y=this.primaryKey(),z=this,A=!0,B={},C=[],D=[],E=[],F={},G={};if(b instanceof Array||(b=this.options(b)),w=function(c){return z._match(c,a,b,"and",F)},x.start(),a){if(a instanceof Array){for(v=this,n=0;n<a.length;n++)v=v.subset(a[n],b&&b[n]?b[n]:{});return v.find()}if(a.$findSub){if(!a.$findSub.$path)throw"$findSub missing $path property!";return this.findSub(a.$findSub.$query,a.$findSub.$path,a.$findSub.$subQuery,a.$findSub.$subOptions)}if(a.$findSubOne){if(!a.$findSubOne.$path)throw"$findSubOne missing $path property!";return this.findSubOne(a.$findSubOne.$query,a.$findSubOne.$path,a.$findSubOne.$subQuery,a.$findSubOne.$subOptions)}if(x.time("analyseQuery"),c=this._analyseQuery(z.decouple(a),b,x),x.time("analyseQuery"),x.data("analysis",c),c.hasJoin&&c.queriesJoin){for(x.time("joinReferences"),f=0;f<c.joinsOn.length;f++)m=c.joinsOn[f],j=m.key,k=m.type,l=m.id,i=new h(c.joinQueries[j]),g=i.value(a)[0],B[l]=this._db[k](j).subset(g),delete a[c.joinQueries[j]];x.time("joinReferences")}if(c.indexMatch.length&&(!b||b&&!b.$skipIndex)?(x.data("index.potential",c.indexMatch),x.data("index.used",c.indexMatch[0].index),x.time("indexLookup"),e=c.indexMatch[0].lookup||[],x.time("indexLookup"),c.indexMatch[0].keyData.totalKeyCount===c.indexMatch[0].keyData.score&&(A=!1)):x.flag("usedIndex",!1),A&&(e&&e.length?(d=e.length,x.time("tableScan: "+d),e=e.filter(w)):(d=this._data.length,x.time("tableScan: "+d),e=this._data.filter(w)),x.time("tableScan: "+d)),b.$orderBy&&(x.time("sort"),e=this.sort(b.$orderBy,e),x.time("sort")),void 0!==b.$page&&void 0!==b.$limit&&(G.page=b.$page,G.pages=Math.ceil(e.length/b.$limit),G.records=e.length,b.$page&&b.$limit>0&&(x.data("cursor",G),e.splice(0,b.$page*b.$limit))),b.$skip&&(G.skip=b.$skip,e.splice(0,b.$skip),x.data("skip",b.$skip)),b.$limit&&e&&e.length>b.$limit&&(G.limit=b.$limit,e.length=b.$limit,x.data("limit",b.$limit)),b.$decouple&&(x.time("decouple"),e=this.decouple(e),x.time("decouple"),x.data("flag.decouple",!0)),b.$join&&(C=C.concat(this.applyJoin(e,b.$join,B)),x.data("flag.join",!0)),C.length&&(x.time("removalQueue"),this.spliceArrayByIndexList(e,C),x.time("removalQueue")),b.$transform){for(x.time("transform"),n=0;n<e.length;n++)e.splice(n,1,b.$transform(e[n]));x.time("transform"),x.data("flag.transform",!0)}this._transformEnabled&&this._transformOut&&(x.time("transformOut"),e=this.transformOut(e),x.time("transformOut")),x.data("results",e.length)}else e=[];if(!b.$aggregate){x.time("scanFields");for(n in b)b.hasOwnProperty(n)&&0!==n.indexOf("$")&&(1===b[n]?D.push(n):0===b[n]&&E.push(n));if(x.time("scanFields"),D.length||E.length){for(x.data("flag.limitFields",!0),x.data("limitFields.on",D),x.data("limitFields.off",E),x.time("limitFields"),n=0;n<e.length;n++){t=e[n];for(o in t)t.hasOwnProperty(o)&&(D.length&&o!==y&&-1===D.indexOf(o)&&delete t[o],E.length&&E.indexOf(o)>-1&&delete t[o])}x.time("limitFields")}if(b.$elemMatch){x.data("flag.elemMatch",!0),x.time("projection-elemMatch");for(n in b.$elemMatch)if(b.$elemMatch.hasOwnProperty(n))for(q=new h(n),o=0;o<e.length;o++)if(r=q.value(e[o])[0],r&&r.length)for(p=0;p<r.length;p++)if(z._match(r[p],b.$elemMatch[n],b,"",{})){q.set(e[o],n,[r[p]]);break}x.time("projection-elemMatch")}if(b.$elemsMatch){x.data("flag.elemsMatch",!0),x.time("projection-elemsMatch");for(n in b.$elemsMatch)if(b.$elemsMatch.hasOwnProperty(n))for(q=new h(n),o=0;o<e.length;o++)if(r=q.value(e[o])[0],r&&r.length){for(s=[],p=0;p<r.length;p++)z._match(r[p],b.$elemsMatch[n],b,"",{})&&s.push(r[p]);q.set(e[o],n,s)}x.time("projection-elemsMatch")}}return b.$aggregate&&(x.data("flag.aggregate",!0),x.time("aggregate"),u=new h(b.$aggregate),e=u.value(e),x.time("aggregate")),b.$groupBy&&(x.data("flag.group",!0),x.time("group"),e=this.group(b.$groupBy,e),x.time("group")),x.stop(),e.__fdbOp=x,e.$cursor=G,e},p.prototype.findOne=function(){return this.find.apply(this,arguments)[0]},p.prototype.indexOf=function(a,b){var c,d=this.find(a,{$decouple:!1})[0];return d?!b||b&&!b.$orderBy?this._data.indexOf(d):(b.$decouple=!1,c=this.find(a,b),c.indexOf(d)):-1},p.prototype.indexOfDocById=function(a,b){var c,d;return c="object"!=typeof a?this._primaryIndex.get(a):this._primaryIndex.get(a[this._primaryKey]),c?!b||b&&!b.$orderBy?this._data.indexOf(c):(b.$decouple=!1,d=this.find({},b),d.indexOf(c)):-1},p.prototype.removeByIndex=function(a){var b,c;return b=this._data[a],void 0!==b?(b=this.decouple(b),c=b[this.primaryKey()],this.removeById(c)):!1},p.prototype.transform=function(a){return void 0!==a?("object"==typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),
void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=a!==!1,this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}},p.prototype.transformIn=function(a){if(this._transformEnabled&&this._transformIn){if(a instanceof Array){var b,c,d=[];for(c=0;c<a.length;c++)b=this._transformIn(a[c]),b instanceof Array?d=d.concat(b):d.push(b);return d}return this._transformIn(a)}return a},p.prototype.transformOut=function(a){if(this._transformEnabled&&this._transformOut){if(a instanceof Array){var b,c,d=[];for(c=0;c<a.length;c++)b=this._transformOut(a[c]),b instanceof Array?d=d.concat(b):d.push(b);return d}return this._transformOut(a)}return a},p.prototype.sort=function(a,b){var c=this,d=o.parse(a,!0);return d.length&&b.sort(function(a,b){var e,f,g=0;for(e=0;e<d.length;e++)if(f=d[e],1===f.value?g=c.sortAsc(o.get(a,f.path),o.get(b,f.path)):-1===f.value&&(g=c.sortDesc(o.get(a,f.path),o.get(b,f.path))),0!==g)return g;return g}),b},p.prototype.group=function(a,b){var c,d,e,f=o.parse(a,!0),g=new h,i={};if(f.length)for(d=0;d<f.length;d++)for(g.path(f[d].path),e=0;e<b.length;e++)c=g.get(b[e]),i[c]=i[c]||[],i[c].push(b[e]);return i},p.prototype._sort=function(a,b){var c,d=this,e=new h,f=e.parse(a,!0)[0];if(e.path(f.path),1===f.value)c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortAsc(c,f)};else{if(-1!==f.value)throw this.logIdentifier()+" $orderBy clause has invalid direction: "+f.value+", accepted values are 1 or -1 for ascending or descending!";c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortDesc(c,f)}}return b.sort(c)},p.prototype._analyseQuery=function(a,b,c){var d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u={queriesOn:[{id:"$collection."+this._name,type:"colletion",key:this._name}],indexMatch:[],hasJoin:!1,queriesJoin:!1,joinQueries:{},query:a,options:b},v=[],w=[];if(c.time("checkIndexes"),p=new h,q=p.parseArr(a,{ignore:/\$/,verbose:!0}).length){void 0!==a[this._primaryKey]&&(r=typeof a[this._primaryKey],("string"===r||"number"===r||a[this._primaryKey]instanceof Array)&&(c.time("checkIndexMatch: Primary Key"),s=this._primaryIndex.lookup(a,b,c),u.indexMatch.push({lookup:s,keyData:{matchedKeys:[this._primaryKey],totalKeyCount:q,score:1},index:this._primaryIndex}),c.time("checkIndexMatch: Primary Key")));for(t in this._indexById)if(this._indexById.hasOwnProperty(t)&&(m=this._indexById[t],n=m.name(),c.time("checkIndexMatch: "+n),l=m.match(a,b),l.score>0&&(o=m.lookup(a,b,c),u.indexMatch.push({lookup:o,keyData:l,index:m})),c.time("checkIndexMatch: "+n),l.score===q))break;c.time("checkIndexes"),u.indexMatch.length>1&&(c.time("findOptimalIndex"),u.indexMatch.sort(function(a,b){return a.keyData.score>b.keyData.score?-1:a.keyData.score<b.keyData.score?1:a.keyData.score===b.keyData.score?a.lookup.length-b.lookup.length:void 0}),c.time("findOptimalIndex"))}if(b.$join){for(u.hasJoin=!0,d=0;d<b.$join.length;d++)for(e in b.$join[d])b.$join[d].hasOwnProperty(e)&&(i=b.$join[d][e],f=i.$sourceType||"collection",g="$"+f+"."+e,v.push({id:g,type:f,key:e}),void 0!==b.$join[d][e].$as?w.push(b.$join[d][e].$as):w.push(e));for(k=0;k<w.length;k++)j=this._queryReferencesSource(a,w[k],""),j&&(u.joinQueries[v[k].key]=j,u.queriesJoin=!0);u.joinsOn=v,u.queriesOn=u.queriesOn.concat(v)}return u},p.prototype._queryReferencesSource=function(a,b,c){var d;for(d in a)if(a.hasOwnProperty(d)){if(d===b)return c&&(c+="."),c+d;if("object"==typeof a[d])return c&&(c+="."),c+=d,this._queryReferencesSource(a[d],b,c)}return!1},p.prototype.count=function(a,b){return a?this.find(a,b).length:this._data.length},p.prototype.findSub=function(a,b,c,d){return this._findSub(this.find(a),b,c,d)},p.prototype._findSub=function(a,b,c,d){var e,f,g,i=new h(b),j=a.length,k=new p("__FDB_temp_"+this.objectId()).db(this._db),l={parents:j,subDocTotal:0,subDocs:[],pathFound:!1,err:""};for(d=d||{},e=0;j>e;e++)if(f=i.value(a[e])[0]){if(k.setData(f),g=k.find(c,d),d.returnFirst&&g.length)return g[0];d.$split?l.subDocs.push(g):l.subDocs=l.subDocs.concat(g),l.subDocTotal+=g.length,l.pathFound=!0}return k.drop(),l.pathFound||(l.err="No objects found in the parent documents with a matching path of: "+b),d.$stats?l:l.subDocs},p.prototype.findSubOne=function(a,b,c,d){return this.findSub(a,b,c,d)[0]},p.prototype.insertIndexViolation=function(a){var b,c,d,e=this._indexByName;if(this._primaryIndex.get(a[this._primaryKey]))b=this._primaryIndex;else for(c in e)if(e.hasOwnProperty(c)&&(d=e[c],d.unique()&&d.violation(a))){b=d;break}return b?b.name():!1},p.prototype.ensureIndex=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";this._indexByName=this._indexByName||{},this._indexById=this._indexById||{};var c,e={start:(new Date).getTime()};if(b)if(b.type){if(!d.index[b.type])throw this.logIdentifier()+' Cannot create index of type "'+b.type+'", type not found in the index type register (Shared.index)';c=new d.index[b.type](a,b,this)}else c=new i(a,b,this);else c=new i(a,b,this);return this._indexByName[c.name()]?{err:"Index with that name already exists"}:(c.rebuild(),this._indexByName[c.name()]=c,this._indexById[c.id()]=c,e.end=(new Date).getTime(),e.total=e.end-e.start,this._lastOp={type:"ensureIndex",stats:{time:e}},{index:c,id:c.id(),name:c.name(),state:c.state()})},p.prototype.index=function(a){return this._indexByName?this._indexByName[a]:void 0},p.prototype.lastOp=function(){return this._metrics.list()},p.prototype.diff=function(a){var b,c,d,e,f={insert:[],update:[],remove:[]},g=this.primaryKey();if(g!==a.primaryKey())throw this.logIdentifier()+" Diffing requires that both collections have the same primary key!";for(b=a._data;b&&!(b instanceof Array);)a=b,b=a._data;for(e=b.length,c=0;e>c;c++)d=b[c],this._primaryIndex.get(d[g])?this._primaryCrc.get(d[g])!==a._primaryCrc.get(d[g])&&f.update.push(d):f.insert.push(d);for(b=this._data,e=b.length,c=0;e>c;c++)d=b[c],a._primaryIndex.get(d[g])||f.remove.push(d);return f},p.prototype.collateAdd=new l("Collection.prototype.collateAdd",{"object, string":function(a,b){var c=this;c.collateAdd(a,function(d){var e,f;switch(d.type){case"insert":b?(e={$push:{}},e.$push[b]=c.decouple(d.data.dataSet),c.update({},e)):c.insert(d.data.dataSet);break;case"update":b?(e={},f={},e[b]=d.data.query,f[b+".$"]=d.data.update,c.update(e,f)):c.update(d.data.query,d.data.update);break;case"remove":b?(e={$pull:{}},e.$pull[b]={},e.$pull[b][c.primaryKey()]=d.data.dataSet[0][a.primaryKey()],c.update({},e)):c.remove(d.data.dataSet)}})},"object, function":function(a,b){if("string"==typeof a&&(a=this._db.collection(a,{autoCreate:!1,throwError:!1})),a)return this._collate=this._collate||{},this._collate[a.name()]=new m(a,this,b),this;throw"Cannot collate from a non-existent collection!"}}),p.prototype.collateRemove=function(a){if("object"==typeof a&&(a=a.name()),a)return this._collate[a].drop(),delete this._collate[a],this;throw"No collection name passed to collateRemove() or collection not found!"},p.prototype.when=function(a){var b=this.objectId();return this._when=this._when||{},this._when[b]=this._when[b]||new n(this,b,a),this._when[b]},e.prototype.collection=new l("Db.prototype.collection",{"":function(){return this.$main.call(this,{name:this.objectId()})},object:function(a){return a instanceof p?"droppped"!==a.state()?a:this.$main.call(this,{name:a.name()}):this.$main.call(this,a)},string:function(a){return this.$main.call(this,{name:a})},"string, string":function(a,b){return this.$main.call(this,{name:a,primaryKey:b})},"string, object":function(a,b){return b.name=a,this.$main.call(this,b)},"string, string, object":function(a,b,c){return c.name=a,c.primaryKey=b,this.$main.call(this,c)},$main:function(a){var b=this,c=a.name;if(c){if(this._collection[c])return this._collection[c];if(a&&a.autoCreate===!1){if(a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection "+c+" because it does not exist and auto-create has been disabled!";return}if(this.debug()&&console.log(this.logIdentifier()+" Creating collection "+c),this._collection[c]=this._collection[c]||new p(c,a).db(this),this._collection[c].mongoEmulation(this.mongoEmulation()),void 0!==a.primaryKey&&this._collection[c].primaryKey(a.primaryKey),void 0!==a.capped){if(void 0===a.size)throw this.logIdentifier()+" Cannot create a capped collection without specifying a size!";this._collection[c].capped(a.capped),this._collection[c].cappedSize(a.size)}return b._collection[c].on("change",function(){b.emit("change",b._collection[c],"collection",c)}),b.emit("create",b._collection[c],"collection",c),this._collection[c]}if(!a||a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection with undefined name!"}}),e.prototype.collectionExists=function(a){return Boolean(this._collection[a])},e.prototype.collections=function(a){var b,c,d=[],e=this._collection;a&&(a instanceof RegExp||(a=new RegExp(a)));for(c in e)e.hasOwnProperty(c)&&(b=e[c],a?a.exec(c)&&d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}):d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}));return d.sort(function(a,b){return a.name.localeCompare(b.name)}),d},d.finishModule("Collection"),b.exports=p},{"./Condition":7,"./Index2d":14,"./IndexBinaryTree":15,"./IndexHashMap":16,"./KeyValueStore":17,"./Metrics":18,"./Overload":32,"./Path":34,"./ReactorIO":38,"./Shared":40}],6:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){var b=this;b._name=a,b._data=new g("__FDB__cg_data_"+b._name),b._collections=[],b._view=[]},d.addModule("CollectionGroup",h),d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.ChainReactor"),d.mixin(h.prototype,"Mixin.Constants"),d.mixin(h.prototype,"Mixin.Triggers"),d.mixin(h.prototype,"Mixin.Tags"),d.mixin(h.prototype,"Mixin.Events"),g=a("./Collection"),e=d.modules.Db,f=d.modules.Db.prototype.init,h.prototype.on=function(){this._data.on.apply(this._data,arguments)},h.prototype.off=function(){this._data.off.apply(this._data,arguments)},h.prototype.emit=function(){this._data.emit.apply(this._data,arguments)},h.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},d.synthesize(h.prototype,"state"),d.synthesize(h.prototype,"db"),d.synthesize(h.prototype,"name"),h.prototype.addCollection=function(a){if(a&&-1===this._collections.indexOf(a)){if(this._collections.length){if(this._primaryKey!==a.primaryKey())throw this.logIdentifier()+" All collections in a collection group must have the same primary key!"}else this.primaryKey(a.primaryKey());this._collections.push(a),a._groups=a._groups||[],a._groups.push(this),a.chain(this),a.on("drop",function(){if(a._groups&&a._groups.length){var b,c=[];for(b=0;b<a._groups.length;b++)c.push(a._groups[b]);for(b=0;b<c.length;b++)a._groups[b].removeCollection(a)}delete a._groups}),this._data.insert(a.find())}return this},h.prototype.removeCollection=function(a){if(a){var b,c=this._collections.indexOf(a);-1!==c&&(a.unChain(this),this._collections.splice(c,1),a._groups=a._groups||[],b=a._groups.indexOf(this),-1!==b&&a._groups.splice(b,1),a.off("drop")),0===this._collections.length&&delete this._primaryKey}return this},h.prototype._chainHandler=function(a){switch(a.type){case"setData":a.data.dataSet=this.decouple(a.data.dataSet),this._data.remove(a.data.oldData),this._data.insert(a.data.dataSet);break;case"insert":a.data.dataSet=this.decouple(a.data.dataSet),this._data.insert(a.data.dataSet);break;case"update":this._data.update(a.data.query,a.data.update,a.options);break;case"remove":this._data.remove(a.data.query,a.options)}},h.prototype.insert=function(){this._collectionsRun("insert",arguments)},h.prototype.update=function(){this._collectionsRun("update",arguments)},h.prototype.updateById=function(){this._collectionsRun("updateById",arguments)},h.prototype.remove=function(){this._collectionsRun("remove",arguments)},h.prototype._collectionsRun=function(a,b){for(var c=0;c<this._collections.length;c++)this._collections[c][a].apply(this._collections[c],b)},h.prototype.find=function(a,b){return this._data.find(a,b)},h.prototype.removeById=function(a){for(var b=0;b<this._collections.length;b++)this._collections[b].removeById(a)},h.prototype.subset=function(a,b){var c=this.find(a,b);return(new g).subsetOf(this).primaryKey(this._primaryKey).setData(c)},h.prototype.drop=function(a){if(!this.isDropped()){var b,c,d;if(this._debug&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._collections&&this._collections.length)for(c=[].concat(this._collections),b=0;b<c.length;b++)this.removeCollection(c[b]);if(this._view&&this._view.length)for(d=[].concat(this._view),b=0;b<d.length;b++)this._removeView(d[b]);this.emit("drop",this),delete this._listeners,a&&a(!1,!0)}return!0},e.prototype.init=function(){this._collectionGroup={},f.apply(this,arguments)},e.prototype.collectionGroup=function(a){var b=this;return a?a instanceof h?a:this._collectionGroup&&this._collectionGroup[a]?this._collectionGroup[a]:(this._collectionGroup[a]=new h(a).db(this),b.emit("create",b._collectionGroup[a],"collectionGroup",a),this._collectionGroup[a]):this._collectionGroup},e.prototype.collectionGroups=function(){var a,b=[];for(a in this._collectionGroup)this._collectionGroup.hasOwnProperty(a)&&b.push({name:a});return b},b.exports=h},{"./Collection":5,"./Shared":40}],7:[function(a,b,c){"use strict";var d,e;d=a("./Shared"),e=function(){this.init.apply(this,arguments)},e.prototype.init=function(a,b,c){this._dataSource=a,this._id=b,this._query=[c],this._started=!1,this._state=[!1],this._satisfied=!1,this.earlyExit(!0)},d.addModule("Condition",e),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),d.synthesize(e.prototype,"id"),d.synthesize(e.prototype,"then"),d.synthesize(e.prototype,"else"),d.synthesize(e.prototype,"earlyExit"),d.synthesize(e.prototype,"debug"),e.prototype.and=function(a){return this._query.push(a),this._state.push(!1),this},e.prototype.start=function(a){if(!this._started){var b=this;0!==arguments.length&&(this._satisfied=a),this._updateStates(),b._onChange=function(){b._updateStates()},this._dataSource.on("change",b._onChange),this._started=!0}return this},e.prototype._updateStates=function(){var a,b=!0;for(a=0;a<this._query.length&&(this._state[a]=this._dataSource.count(this._query[a])>0,this._debug&&console.log(this.logIdentifier()+" Evaluating",this._query[a],"=",this._query[a]),this._state[a]||(b=!1,!this._earlyExit));a++);this._satisfied!==b&&(b?this._then&&this._then():this._else&&this._else(),this._satisfied=b)},e.prototype.stop=function(){return this._started&&(this._dataSource.off("change",this._onChange),delete this._onChange,this._started=!1),this},e.prototype.drop=function(){return this.stop(),delete this._dataSource.when[this._id],this},d.finishModule("Condition"),b.exports=e},{"./Shared":40}],8:[function(a,b,c){"use strict";var d,e,f,g,h=[];d=a("./Shared"),g=a("./Overload");var i=function(a){this.init.apply(this,arguments)};i.prototype.init=function(a){this._db={},this._debug={},this._name=a||"ForerunnerDB",h.push(this)},i.prototype.instantiatedCount=function(){return h.length},i.prototype.instances=function(a){return void 0!==a?h[a]:h},i.prototype.namedInstances=function(a){var b,c;{if(void 0===a){for(c=[],b=0;b<h.length;b++)c.push(h[b].name);return c}for(b=0;b<h.length;b++)if(h[b].name===a)return h[b]}},i.prototype.moduleLoaded=new g({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b&&b()}},"array, function":function(a,b){var c,e;for(e=0;e<a.length;e++)if(c=a[e],void 0!==c){c=c.replace(/ /g,"");var f,g=c.split(",");for(f=0;f<g.length;f++)if(!d.modules[g[f]])return!1}b&&b()},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),i.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},i.moduleLoaded=i.prototype.moduleLoaded,i.version=i.prototype.version,i.instances=i.prototype.instances,i.instantiatedCount=i.prototype.instantiatedCount,i.shared=d,i.prototype.shared=d,d.addModule("Core",i),d.mixin(i.prototype,"Mixin.Common"),d.mixin(i.prototype,"Mixin.Constants"),e=a("./Db.js"),f=a("./Metrics.js"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"mongoEmulation"),i.prototype._isServer=!1,i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.collection=function(){throw"ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"},b.exports=i},{"./Db.js":9,"./Metrics.js":18,"./Overload":32,"./Shared":40}],9:[function(a,b,c){"use strict";var d,e,f,g,h,i;d=a("./Shared"),i=a("./Overload");var j=function(a,b){this.init.apply(this,arguments)};j.prototype.init=function(a,b){this.core(b),this._primaryKey="_id",this._name=a,this._collection={},this._debug={}},d.addModule("Db",j),j.prototype.moduleLoaded=new i({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b&&b()}},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),j.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},j.moduleLoaded=j.prototype.moduleLoaded,j.version=j.prototype.version,j.shared=d,j.prototype.shared=d,d.addModule("Db",j),d.mixin(j.prototype,"Mixin.Common"),d.mixin(j.prototype,"Mixin.ChainReactor"),d.mixin(j.prototype,"Mixin.Constants"),d.mixin(j.prototype,"Mixin.Tags"),e=d.modules.Core,f=a("./Collection.js"),g=a("./Metrics.js"),h=a("./Checksum.js"),j.prototype._isServer=!1,d.synthesize(j.prototype,"core"),d.synthesize(j.prototype,"primaryKey"),d.synthesize(j.prototype,"state"),d.synthesize(j.prototype,"name"),d.synthesize(j.prototype,"mongoEmulation"),j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.Checksum=h,j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.arrayToCollection=function(a){return(new f).setData(a)},j.prototype.on=function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(b),this},j.prototype.off=function(a,b){if(a in this._listeners){var c=this._listeners[a],d=c.indexOf(b);d>-1&&c.splice(d,1)}return this},j.prototype.emit=function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d=this._listeners[a],e=d.length;for(c=0;e>c;c++)d[c].apply(this,Array.prototype.slice.call(arguments,1))}return this},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peekCat=function(a){var b,c,d,e={},f=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],"string"===f?(d=c.peek(a),d&&d.length&&(e[c.name()]=d)):(d=c.find(a),d&&d.length&&(e[c.name()]=d)));return e},j.prototype.drop=new i({"":function(){if(!this.isDropped()){var a,b=this.collections(),c=b.length;for(this._state="dropped",a=0;c>a;a++)this.collection(b[a].name).drop(),delete this._collection[b[a].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"function":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length,e=0,f=function(){e++,e===d&&a&&a()};for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(f),delete this._collection[c[b].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"boolean":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length;for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(a),delete this._collection[c[b].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"boolean, function":function(a,b){if(!this.isDropped()){var c,d=this.collections(),e=d.length,f=0,g=function(){f++,f===e&&b&&b()};for(this._state="dropped",c=0;e>c;c++)this.collection(d[c].name).drop(a,g),delete this._collection[d[c].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0}}),e.prototype.db=function(a){return a instanceof j?a:(a||(a=this.objectId()),this._db[a]=this._db[a]||new j(a,this),this._db[a].mongoEmulation(this.mongoEmulation()),this._db[a])},e.prototype.databases=function(a){var b,c,d,e=[];a&&(a instanceof RegExp||(a=new RegExp(a)));for(d in this._db)this._db.hasOwnProperty(d)&&(c=!0,a&&(a.exec(d)||(c=!1)),c&&(b={name:d,children:[]},this.shared.moduleExists("Collection")&&b.children.push({module:"collection",moduleName:"Collections",count:this._db[d].collections().length}),this.shared.moduleExists("CollectionGroup")&&b.children.push({module:"collectionGroup",moduleName:"Collection Groups",count:this._db[d].collectionGroups().length}),this.shared.moduleExists("Document")&&b.children.push({module:"document",moduleName:"Documents",count:this._db[d].documents().length}),this.shared.moduleExists("Grid")&&b.children.push({module:"grid",moduleName:"Grids",count:this._db[d].grids().length}),this.shared.moduleExists("Overview")&&b.children.push({module:"overview",moduleName:"Overviews",count:this._db[d].overviews().length}),this.shared.moduleExists("View")&&b.children.push({module:"view",moduleName:"Views",count:this._db[d].views().length}),e.push(b)));return e.sort(function(a,b){return a.name.localeCompare(b.name)}),e},d.finishModule("Db"),b.exports=j},{"./Checksum.js":4,"./Collection.js":5,"./Metrics.js":18,"./Overload":32,"./Shared":40}],10:[function(a,b,c){"use strict";var d,e,f;d=a("./Shared");var g=function(){this.init.apply(this,arguments)};g.prototype.init=function(a){this._name=a,this._data={}},d.addModule("Document",g),d.mixin(g.prototype,"Mixin.Common"),d.mixin(g.prototype,"Mixin.Events"),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Constants"),d.mixin(g.prototype,"Mixin.Triggers"),d.mixin(g.prototype,"Mixin.Matching"),d.mixin(g.prototype,"Mixin.Updating"),d.mixin(g.prototype,"Mixin.Tags"),e=a("./Collection"),f=d.modules.Db,d.synthesize(g.prototype,"state"),d.synthesize(g.prototype,"db"),d.synthesize(g.prototype,"name"),g.prototype.setData=function(a,b){var c,d;if(a){if(b=b||{$decouple:!0},b&&b.$decouple===!0&&(a=this.decouple(a)),this._linked){d={};for(c in this._data)"jQuery"!==c.substr(0,6)&&this._data.hasOwnProperty(c)&&void 0===a[c]&&(d[c]=1);a.$unset=d,this.updateObject(this._data,a,{})}else this._data=a;this.deferEmit("change",{type:"setData",data:this.decouple(this._data)})}return this},g.prototype.find=function(a,b){var c;return c=b&&b.$decouple===!1?this._data:this.decouple(this._data)},g.prototype.update=function(a,b,c){var d=this.updateObject(this._data,b,a,c);d&&this.deferEmit("change",{type:"update",data:this.decouple(this._data)})},g.prototype.updateObject=e.prototype.updateObject,g.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},g.prototype._updateProperty=function(a,b,c){this._linked?(window.jQuery.observable(a).setProperty(b,c),this.debug()&&console.log(this.logIdentifier()+' Setting data-bound document property "'+b+'"')):(a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'" to val "'+c+'"'))},g.prototype._updateIncrement=function(a,b,c){this._linked?window.jQuery.observable(a).setProperty(b,a[b]+c):a[b]+=c},g.prototype._updateSpliceMove=function(a,b,c){this._linked?(window.jQuery.observable(a).move(b,c),this.debug()&&console.log(this.logIdentifier()+' Moving data-bound document array index from "'+b+'" to "'+c+'"')):(a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"'))},g.prototype._updateSplicePush=function(a,b,c){a.length>b?this._linked?window.jQuery.observable(a).insert(b,c):a.splice(b,0,c):this._linked?window.jQuery.observable(a).insert(c):a.push(c)},g.prototype._updatePush=function(a,b){this._linked?window.jQuery.observable(a).insert(b):a.push(b)},g.prototype._updatePull=function(a,b){this._linked?window.jQuery.observable(a).remove(b):a.splice(b,1)},g.prototype._updateMultiply=function(a,b,c){this._linked?window.jQuery.observable(a).setProperty(b,a[b]*c):a[b]*=c},g.prototype._updateRename=function(a,b,c){var d=a[b];this._linked?(window.jQuery.observable(a).setProperty(c,d),window.jQuery.observable(a).removeProperty(b)):(a[c]=d,delete a[b])},g.prototype._updateUnset=function(a,b){this._linked?window.jQuery.observable(a).removeProperty(b):delete a[b]},g.prototype.drop=function(a){return this.isDropped()?!0:this._db&&this._name&&this._db&&this._db._document&&this._db._document[this._name]?(this._state="dropped",delete this._db._document[this._name],delete this._data,this.emit("drop",this),a&&a(!1,!0),delete this._listeners,!0):!1},f.prototype.document=function(a){var b=this;if(a){if(a instanceof g){if("droppped"!==a.state())return a;a=a.name()}return this._document&&this._document[a]?this._document[a]:(this._document=this._document||{},this._document[a]=new g(a).db(this),b.emit("create",b._document[a],"document",a),this._document[a])}return this._document},f.prototype.documents=function(){var a,b,c=[];for(b in this._document)this._document.hasOwnProperty(b)&&(a=this._document[b],c.push({name:b,linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("Document"),b.exports=g},{"./Collection":5,"./Shared":40}],11:[function(a,b,c){"use strict";var d,e,f,g,h=Math.PI/180,i=180/Math.PI,j=6371;d=[16,8,4,2,1],e="0123456789bcdefghjkmnpqrstuvwxyz",f={right:{even:"bc01fg45238967deuvhjyznpkmstqrwx"},left:{even:"238967debc01fg45kmstqrwxuvhjyznp"},top:{even:"p0r21436x8zb9dcf5h7kjnmqesgutwvy"},bottom:{even:"14365h7k9dcfesgujnmqp0r2twvyx8zb"}},g={right:{even:"bcfguvyz"},left:{even:"0145hjnp"},top:{even:"prxz"},bottom:{even:"028b"}},f.bottom.odd=f.left.even,f.top.odd=f.right.even,f.left.odd=f.bottom.even,f.right.odd=f.top.even,g.bottom.odd=g.left.even,g.top.odd=g.right.even,g.left.odd=g.bottom.even,g.right.odd=g.top.even;var k=function(){};k.prototype.radians=function(a){return a*h},k.prototype.degrees=function(a){return a*i},k.prototype.refineInterval=function(a,b,c){b&c?a[0]=(a[0]+a[1])/2:a[1]=(a[0]+a[1])/2},k.prototype.calculateNeighbours=function(a,b){var c;return b&&"object"!==b.type?(c=[],c[4]=a,c[3]=this.calculateAdjacent(a,"left"),c[5]=this.calculateAdjacent(a,"right"),c[1]=this.calculateAdjacent(a,"top"),c[7]=this.calculateAdjacent(a,"bottom"),c[0]=this.calculateAdjacent(c[3],"top"),c[2]=this.calculateAdjacent(c[5],"top"),c[6]=this.calculateAdjacent(c[3],"bottom"),c[8]=this.calculateAdjacent(c[5],"bottom")):(c={center:a,left:this.calculateAdjacent(a,"left"),right:this.calculateAdjacent(a,"right"),top:this.calculateAdjacent(a,"top"),bottom:this.calculateAdjacent(a,"bottom")},c.topLeft=this.calculateAdjacent(c.left,"top"),c.topRight=this.calculateAdjacent(c.right,"top"),c.bottomLeft=this.calculateAdjacent(c.left,"bottom"),c.bottomRight=this.calculateAdjacent(c.right,"bottom")),c},k.prototype.calculateLatLngByDistanceBearing=function(a,b,c){var d=a[1],e=a[0],f=Math.asin(Math.sin(this.radians(e))*Math.cos(b/j)+Math.cos(this.radians(e))*Math.sin(b/j)*Math.cos(this.radians(c))),g=this.radians(d)+Math.atan2(Math.sin(this.radians(c))*Math.sin(b/j)*Math.cos(this.radians(e)),Math.cos(b/j)-Math.sin(this.radians(e))*Math.sin(f)),h=(g+3*Math.PI)%(2*Math.PI)-Math.PI;return{lat:this.degrees(f),lng:this.degrees(h)}},k.prototype.calculateExtentByRadius=function(a,b){var c,d,e,f,g=[],h=[];return e=this.calculateLatLngByDistanceBearing(a,b,0),d=this.calculateLatLngByDistanceBearing(a,b,90),f=this.calculateLatLngByDistanceBearing(a,b,180),c=this.calculateLatLngByDistanceBearing(a,b,270),g[0]=e.lat,g[1]=f.lat,h[0]=c.lng,h[1]=d.lng,{lat:g,lng:h}},k.prototype.calculateHashArrayByRadius=function(a,b,c){var d,e,f,g=this.calculateExtentByRadius(a,b),h=[g.lat[0],g.lng[0]],i=[g.lat[0],g.lng[1]],j=[g.lat[1],g.lng[0]],k=this.encode(h[0],h[1],c),l=this.encode(i[0],i[1],c),m=this.encode(j[0],j[1],c),n=0,o=0,p=[];for(d=k,p.push(d);d!==l;)d=this.calculateAdjacent(d,"right"),n++,p.push(d);for(d=k;d!==m;)d=this.calculateAdjacent(d,"bottom"),o++;for(e=0;n>=e;e++)for(d=p[e],f=0;o>f;f++)d=this.calculateAdjacent(d,"bottom"),p.push(d);return p},k.prototype.calculateAdjacent=function(a,b){a=a.toLowerCase();var c=a.charAt(a.length-1),d=a.length%2?"odd":"even",h=a.substring(0,a.length-1);return-1!==g[b][d].indexOf(c)&&(h=this.calculateAdjacent(h,b)),h+e[f[b][d].indexOf(c)]},k.prototype.decode=function(a){var b,c,f,g,h,i,j,k=1,l=[],m=[];for(l[0]=-90,l[1]=90,m[0]=-180,m[1]=180,i=90,j=180,b=0;b<a.length;b++)for(c=a[b],f=e.indexOf(c),g=0;5>g;g++)h=d[g],k?(j/=2,this.refineInterval(m,f,h)):(i/=2,this.refineInterval(l,f,h)),k=!k;return l[2]=(l[0]+l[1])/2,m[2]=(m[0]+m[1])/2,{lat:l,lng:m}},k.prototype.encode=function(a,b,c){var f,g=1,h=[],i=[],j=0,k=0,l="";for(c||(c=12),h[0]=-90,h[1]=90,i[0]=-180,i[1]=180;l.length<c;)g?(f=(i[0]+i[1])/2,b>f?(k|=d[j],i[0]=f):i[1]=f):(f=(h[0]+h[1])/2,a>f?(k|=d[j],h[0]=f):h[1]=f),g=!g,4>j?j++:(l+=e[k],j=0,k=0);return l},"undefined"!=typeof b&&(b.exports=k)},{}],12:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k;d=a("./Shared");var l=function(a,b,c){this.init.apply(this,arguments)};l.prototype.init=function(a,b,c){var d=this;this._baseQuery={},this._selector=a,this._template=b,this._options=c||{},this._debug={},this._id=this.objectId(),this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)}},d.addModule("Grid",l),d.mixin(l.prototype,"Mixin.Common"),d.mixin(l.prototype,"Mixin.ChainReactor"),d.mixin(l.prototype,"Mixin.Constants"),d.mixin(l.prototype,"Mixin.Triggers"),d.mixin(l.prototype,"Mixin.Events"),d.mixin(l.prototype,"Mixin.Tags"),f=a("./Collection"),g=a("./CollectionGroup"),h=a("./View"),k=a("./ReactorIO"),i=f.prototype.init,e=d.modules.Db,j=e.prototype.init,d.synthesize(l.prototype,"state"),d.synthesize(l.prototype,"name"),l.prototype.insert=function(){this._from.insert.apply(this._from,arguments)},l.prototype.update=function(){this._from.update.apply(this._from,arguments)},l.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)},l.prototype.remove=function(){this._from.remove.apply(this._from,arguments)},l.prototype.from=function(a){return void 0!==a&&(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeGrid(this)),"string"==typeof a&&(a=this._db.collection(a)),this._from=a,this._from.on("drop",this._collectionDroppedWrap),"function"==typeof this._from.query&&(this._baseQuery=this._from.query()),this.refresh()),this},d.synthesize(l.prototype,"db",function(a){return a&&this.debug(a.debug()),this.$super.apply(this,arguments)}),l.prototype._collectionDropped=function(a){a&&delete this._from},l.prototype.drop=function(a){return this.isDropped()?!0:this._from?(this._from.unlink(this._selector,this.template()),
this._from.off("drop",this._collectionDroppedWrap),this._from._removeGrid(this),(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Dropping grid "+this._selector),this._state="dropped",this._db&&this._selector&&delete this._db._grid[this._selector],this.emit("drop",this),a&&a(!1,!0),delete this._selector,delete this._template,delete this._from,delete this._db,delete this._listeners,!0):!1},l.prototype.template=function(a){return void 0!==a?(this._template=a,this):this._template},l.prototype._sortGridClick=function(a){var b,c=window.jQuery(a.currentTarget),e=c.attr("data-grid-sort")||"",f=-1===parseInt(c.attr("data-grid-dir")||"-1",10)?1:-1,g=e.split(","),h={};for(window.jQuery(this._selector).find("[data-grid-dir]").removeAttr("data-grid-dir"),c.attr("data-grid-dir",f),b=0;b<g.length;b++)h[g]=f;d.mixin(h,this._options.$orderBy),this._from.orderBy(h),this.emit("sort",h)},l.prototype.query=function(a,b){return this._baseQuery=a,this._baseQueryOptions=b,this},l.prototype.refresh=function(){if(this._from){if(!this._from.link)throw"Grid requires the AutoBind module in order to operate!";var a=this,b=window.jQuery(this._selector),c=function(){a._sortGridClick.apply(a,arguments)};if(b.html(""),a._from.orderBy&&b.off("click","[data-grid-sort]",c),a._from.query&&b.off("click","[data-grid-filter]",c),a._options.$wrap=a._options.$wrap||"gridRow",a._from.link(a._selector,a.template(),a._options),a._from.orderBy&&b.on("click","[data-grid-sort]",c),a._from.query){var d=a.decouple(a._baseQuery);b.find("[data-grid-filter]").each(function(c,e){e=window.jQuery(e);var f,g,h,i,j,k=e.attr("data-grid-filter"),l=e.attr("data-grid-vartype"),m={},n=e.html(),o=a._db.view("tmpGridFilter_"+a._id+"_"+k);m[k]=1,j={$distinct:m},o.query(j).orderBy(m).from(a._from._from),i=function(){o.refresh()},a._from._from.on("change",i),a.on("drop",function(){a._from&&a._from._from&&a._from._from.off("change",i),o.drop()}),h=['<div class="dropdown" id="'+a._id+"_"+k+'">','<button class="btn btn-default dropdown-toggle" type="button" id="'+a._id+"_"+k+'_dropdownButton" data-toggle="dropdown" aria-expanded="true">',n+' <span class="caret"></span>',"</button>","</div>"],f=window.jQuery(h.join("")),g=window.jQuery('<ul class="dropdown-menu" role="menu" id="'+a._id+"_"+k+'_dropdownMenu"></ul>'),f.append(g),e.html(f),o.link(g,{template:['<li role="presentation" class="input-group" style="width: 240px; padding-left: 10px; padding-right: 10px; padding-top: 5px;">','<input type="search" class="form-control gridFilterSearch" placeholder="Search...">','<span class="input-group-btn">','<button class="btn btn-default gridFilterClearSearch" type="button"><span class="glyphicon glyphicon-remove-circle glyphicons glyphicons-remove"></span></button>',"</span>","</li>",'<li role="presentation" class="divider"></li>','<li role="presentation" data-val="$all">','<a role="menuitem" tabindex="-1">','<input type="checkbox" checked> All',"</a>","</li>",'<li role="presentation" class="divider"></li>',"{^{for options}}",'<li role="presentation" data-link="data-val{:'+k+'}">','<a role="menuitem" tabindex="-1">','<input type="checkbox"> {^{:'+k+"}}","</a>","</li>","{{/for}}"].join("")},{$wrap:"options"}),b.on("keyup","#"+a._id+"_"+k+"_dropdownMenu .gridFilterSearch",function(a){var b=window.jQuery(this),c=o.query(),d=b.val();d?c[k]=new RegExp(d,"gi"):delete c[k],o.query(c)}),b.on("click","#"+a._id+"_"+k+"_dropdownMenu .gridFilterClearSearch",function(a){window.jQuery(this).parents("li").find(".gridFilterSearch").val("");var b=o.query();delete b[k],o.query(b)}),b.on("click","#"+a._id+"_"+k+"_dropdownMenu li",function(b){b.stopPropagation();var c,e,f,g,h,i=$(this),j=i.find('input[type="checkbox"]'),m=!0;if(window.jQuery(b.target).is("input")?(j.prop("checked",j.prop("checked")),e=j.is(":checked")):(j.prop("checked",!j.prop("checked")),e=j.is(":checked")),g=window.jQuery(this),c=g.attr("data-val"),"$all"===c)delete d[k],g.parent().find('li[data-val!="$all"]').find('input[type="checkbox"]').prop("checked",!1);else{switch(g.parent().find('[data-val="$all"]').find('input[type="checkbox"]').prop("checked",!1),l){case"integer":c=parseInt(c,10);break;case"float":c=parseFloat(c)}for(d[k]=d[k]||{$in:[]},f=d[k].$in,h=0;h<f.length;h++)if(f[h]===c){e===!1&&f.splice(h,1),m=!1;break}m&&e&&f.push(c),f.length||delete d[k]}a._from.queryData(d),a._from.pageFirst&&a._from.pageFirst()})})}a.emit("refresh")}return this},l.prototype.count=function(){return this._from.count()},f.prototype.grid=h.prototype.grid=function(a,b,c){if(this._db&&this._db._grid){if(void 0!==a){if(void 0!==b){if(this._db._grid[a])throw this.logIdentifier()+" Cannot create a grid because a grid with this name already exists: "+a;var d=new l(a,b,c).db(this._db).from(this);return this._grid=this._grid||[],this._grid.push(d),this._db._grid[a]=d,d}return this._db._grid[a]}return this._db._grid}},f.prototype.unGrid=h.prototype.unGrid=function(a,b,c){var d,e;if(this._db&&this._db._grid){if(a&&b){if(this._db._grid[a])return e=this._db._grid[a],delete this._db._grid[a],e.drop();throw this.logIdentifier()+" Cannot remove grid because a grid with this name does not exist: "+name}for(d in this._db._grid)this._db._grid.hasOwnProperty(d)&&(e=this._db._grid[d],delete this._db._grid[d],e.drop(),this.debug()&&console.log(this.logIdentifier()+' Removed grid binding "'+d+'"'));this._db._grid={}}},f.prototype._addGrid=g.prototype._addGrid=h.prototype._addGrid=function(a){return void 0!==a&&(this._grid=this._grid||[],this._grid.push(a)),this},f.prototype._removeGrid=g.prototype._removeGrid=h.prototype._removeGrid=function(a){if(void 0!==a&&this._grid){var b=this._grid.indexOf(a);b>-1&&this._grid.splice(b,1)}return this},e.prototype.init=function(){this._grid={},j.apply(this,arguments)},e.prototype.gridExists=function(a){return Boolean(this._grid[a])},e.prototype.grid=function(a,b,c){return this._grid[a]||(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating grid "+a),this._grid[a]=this._grid[a]||new l(a,b,c).db(this),this._grid[a]},e.prototype.unGrid=function(a,b,c){return this._grid[a]||(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating grid "+a),this._grid[a]=this._grid[a]||new l(a,b,c).db(this),this._grid[a]},e.prototype.grids=function(){var a,b,c=[];for(b in this._grid)this._grid.hasOwnProperty(b)&&(a=this._grid[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("Grid"),b.exports=l},{"./Collection":5,"./CollectionGroup":6,"./ReactorIO":38,"./Shared":40,"./View":41}],13:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared"),g=a("./Overload");var h=function(a,b){this.init.apply(this,arguments)};h.prototype.init=function(a,b){if(this._options=b,this._selector=window.jQuery(this._options.selector),!this._selector[0])throw this.classIdentifier()+' "'+a.name()+'": Chart target element does not exist via selector: '+this._options.selector;this._listeners={},this._collection=a,this._options.series=[],b.chartOptions=b.chartOptions||{},b.chartOptions.credits=!1;var c,d,e;switch(this._options.type){case"pie":this._selector.highcharts(this._options.chartOptions),this._chart=this._selector.highcharts(),c=this._collection.find(),d={allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b>: {y} ({point.percentage:.0f}%)",style:{color:window.Highcharts.theme&&window.Highcharts.theme.contrastTextColor||"black"}}},e=this.pieDataFromCollectionData(c,this._options.keyField,this._options.valField),window.jQuery.extend(d,this._options.seriesOptions),window.jQuery.extend(d,{name:this._options.seriesName,data:e}),this._chart.addSeries(d,!0,!0);break;case"line":case"area":case"column":case"bar":e=this.seriesDataFromCollectionData(this._options.seriesField,this._options.keyField,this._options.valField,this._options.orderBy,this._options),this._options.chartOptions.xAxis=e.xAxis,this._options.chartOptions.series=e.series,this._selector.highcharts(this._options.chartOptions),this._chart=this._selector.highcharts();break;default:throw this.classIdentifier()+' "'+a.name()+'": Chart type specified is not currently supported by ForerunnerDB: '+this._options.type}this._hookEvents()},d.addModule("Highchart",h),e=d.modules.Collection,f=e.prototype.init,d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.Events"),d.synthesize(h.prototype,"state"),h.prototype.pieDataFromCollectionData=function(a,b,c){var d,e=[];for(d=0;d<a.length;d++)e.push([a[d][b],a[d][c]]);return e},h.prototype.seriesDataFromCollectionData=function(a,b,c,d,e){var f,g,h,i,j,k,l,m=this._collection.distinct(a),n=[],o=e&&e.chartOptions&&e.chartOptions.xAxis?e.chartOptions.xAxis:{categories:[]};for(k=0;k<m.length;k++){for(f=m[k],g={},g[a]=f,i=[],h=this._collection.find(g,{orderBy:d}),l=0;l<h.length;l++)o.categories?(o.categories.push(h[l][b]),i.push(h[l][c])):i.push([h[l][b],h[l][c]]);if(j={name:f,data:i},e.seriesOptions)for(l in e.seriesOptions)e.seriesOptions.hasOwnProperty(l)&&(j[l]=e.seriesOptions[l]);n.push(j)}return{xAxis:o,series:n}},h.prototype._hookEvents=function(){var a=this;a._collection.on("change",function(){a._changeListener.apply(a,arguments)}),a._collection.on("drop",function(){a.drop.apply(a)})},h.prototype._changeListener=function(){var a=this;if("undefined"!=typeof a._collection&&a._chart){var b,c=a._collection.find();switch(a._options.type){case"pie":a._chart.series[0].setData(a.pieDataFromCollectionData(c,a._options.keyField,a._options.valField),!0,!0);break;case"bar":case"line":case"area":case"column":var d=a.seriesDataFromCollectionData(a._options.seriesField,a._options.keyField,a._options.valField,a._options.orderBy,a._options);for(d.xAxis.categories&&a._chart.xAxis[0].setCategories(d.xAxis.categories),b=0;b<d.series.length;b++)a._chart.series[b]?a._chart.series[b].setData(d.series[b].data,!0,!0):a._chart.addSeries(d.series[b],!0,!0)}}},h.prototype.drop=function(a){return this.isDropped()?!0:(this._state="dropped",this._chart&&this._chart.destroy(),this._collection&&(this._collection.off("change",this._changeListener),this._collection.off("drop",this.drop),this._collection._highcharts&&delete this._collection._highcharts[this._options.selector]),delete this._chart,delete this._options,delete this._collection,this.emit("drop",this),a&&a(!1,!0),delete this._listeners,!0)},e.prototype.init=function(){this._highcharts={},f.apply(this,arguments)},e.prototype.pieChart=new g({object:function(a){return a.type="pie",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="pie",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.selector=a,e.keyField=b,e.valField=c,e.seriesName=d,this.pieChart(e)}}),e.prototype.lineChart=new g({string:function(a){return this._highcharts[a]},object:function(a){return a.type="line",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="line",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.lineChart(e)}}),e.prototype.areaChart=new g({object:function(a){return a.type="area",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="area",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.areaChart(e)}}),e.prototype.columnChart=new g({object:function(a){return a.type="column",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="column",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.columnChart(e)}}),e.prototype.barChart=new g({object:function(a){return a.type="bar",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="bar",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.barChart(e)}}),e.prototype.stackedBarChart=new g({object:function(a){return a.type="bar",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="bar",a.plotOptions=a.plotOptions||{},a.plotOptions.series=a.plotOptions.series||{},a.plotOptions.series.stacking=a.plotOptions.series.stacking||"normal",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.stackedBarChart(e)}}),e.prototype.dropChart=function(a){this._highcharts&&this._highcharts[a]&&this._highcharts[a].drop()},d.finishModule("Highchart"),b.exports=h},{"./Overload":32,"./Shared":40}],14:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=a("./GeoHash"),h=new e,i=new g,j=[5e3,1250,156,39.1,4.89,1.22,.153,.0382,.00477,.00119,149e-6,372e-7],k=function(){this.init.apply(this,arguments)};k.prototype.init=function(a,b,c){this._btree=new f,this._btree.index(a),this._size=0,this._id=this._itemKeyHash(a,a),this._debug=b&&b.debug?b.debug:!1,this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&(this.collection(c),this._btree.primaryKey(c.primaryKey())),this.name(b&&b.name?b.name:this._id),this._btree.debug(this._debug)},d.addModule("Index2d",k),d.mixin(k.prototype,"Mixin.Common"),d.mixin(k.prototype,"Mixin.ChainReactor"),d.mixin(k.prototype,"Mixin.Sorting"),k.prototype.id=function(){return this._id},k.prototype.state=function(){return this._state},k.prototype.size=function(){return this._size},d.synthesize(k.prototype,"data"),d.synthesize(k.prototype,"name"),d.synthesize(k.prototype,"collection"),d.synthesize(k.prototype,"type"),d.synthesize(k.prototype,"unique"),k.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=h.parse(this._keys).length,this):this._keys},k.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree.clear(),this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},k.prototype.insert=function(a,b){var c,d=this._unique;a=this.decouple(a),d&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a);var e,f,g,j,k,l=this._btree.keys();for(k=0;k<l.length;k++)e=h.get(a,l[k].path),e instanceof Array&&(g=e[0],j=e[1],f=i.encode(g,j),h.set(a,l[k].path,f));return this._btree.insert(a)?(this._size++,!0):!1},k.prototype.remove=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),this._btree.remove(a)?(this._size--,!0):!1},k.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},k.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},k.prototype.lookup=function(a,b,c){var d,e,f,g,i=this._btree.keys();for(g=0;g<i.length;g++)if(d=i[g].path,e=h.get(a,d),"object"==typeof e)return e.$near&&(f=[],f=f.concat(this.near(d,e.$near,b,c))),e.$geoWithin&&(f=[],f=f.concat(this.geoWithin(d,e.$geoWithin,b,c))),f;return this._btree.lookup(a,b)},k.prototype.near=function(a,b,c,d){var e,f,g,k,l,m,n,o,p,q,r,s,t=this,u=[],v=this._collection.primaryKey();if("km"===b.$distanceUnits){for(o=b.$maxDistance,s=0;s<j.length;s++)if(o>j[s]){n=s+1;break}}else if("miles"===b.$distanceUnits)for(o=1.60934*b.$maxDistance,s=0;s<j.length;s++)if(o>j[s]){n=s+1;break}for(0===n&&(n=1),d&&d.time("index2d.calculateHashArea"),e=i.calculateHashArrayByRadius(b.$point,o,n),d&&d.time("index2d.calculateHashArea"),d&&(d.data("index2d.near.precision",n),d.data("index2d.near.hashArea",e),d.data("index2d.near.maxDistanceKm",o),d.data("index2d.near.centerPointCoords",[b.$point[0],b.$point[1]])),m=[],f=0,k={},g=[],d&&d.time("index2d.near.getDocsInsideHashArea"),s=0;s<e.length;s++)l=this._btree.startsWith(a,e[s]),k[e[s]]=l,f+=l._visitedCount,g=g.concat(l._visitedNodes),m=m.concat(l);if(d&&(d.time("index2d.near.getDocsInsideHashArea"),d.data("index2d.near.startsWith",k),d.data("index2d.near.visitedTreeNodes",g)),d&&d.time("index2d.near.lookupDocsById"),m=this._collection._primaryIndex.lookup(m),d&&d.time("index2d.near.lookupDocsById"),b.$distanceField&&(m=this.decouple(m)),m.length){for(p={},d&&d.time("index2d.near.calculateDistanceFromCenter"),s=0;s<m.length;s++)r=h.get(m[s],a),q=p[m[s][v]]=this.distanceBetweenPoints(b.$point[0],b.$point[1],r[0],r[1]),o>=q&&(b.$distanceField&&h.set(m[s],b.$distanceField,"km"===b.$distanceUnits?q:Math.round(.621371*q)),b.$geoHashField&&h.set(m[s],b.$geoHashField,i.encode(r[0],r[1],n)),u.push(m[s]));d&&d.time("index2d.near.calculateDistanceFromCenter"),d&&d.time("index2d.near.sortResultsByDistance"),u.sort(function(a,b){return t.sortAsc(p[a[v]],p[b[v]])}),d&&d.time("index2d.near.sortResultsByDistance")}return u},k.prototype.geoWithin=function(a,b,c){return console.log("geoWithin() is currently a prototype method with no actual implementation... it just returns a blank array."),[]},k.prototype.distanceBetweenPoints=function(a,b,c,d){var e=6371,f=this.toRadians(a),g=this.toRadians(c),h=this.toRadians(c-a),i=this.toRadians(d-b),j=Math.sin(h/2)*Math.sin(h/2)+Math.cos(f)*Math.cos(g)*Math.sin(i/2)*Math.sin(i/2),k=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));return e*k},k.prototype.toRadians=function(a){return.01747722222222*a},k.prototype.match=function(a,b){return this._btree.match(a,b)},k.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},k.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},k.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index["2d"]=k,d.finishModule("Index2d"),b.exports=k},{"./BinaryTree":3,"./GeoHash":11,"./Path":34,"./Shared":40}],15:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=function(){this.init.apply(this,arguments)};g.prototype.init=function(a,b,c){this._btree=new f,this._btree.index(a),this._size=0,this._id=this._itemKeyHash(a,a),this._debug=b&&b.debug?b.debug:!1,this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&(this.collection(c),this._btree.primaryKey(c.primaryKey())),this.name(b&&b.name?b.name:this._id),this._btree.debug(this._debug)},d.addModule("IndexBinaryTree",g),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Sorting"),g.prototype.id=function(){return this._id},g.prototype.state=function(){return this._state},g.prototype.size=function(){return this._size},d.synthesize(g.prototype,"data"),d.synthesize(g.prototype,"name"),d.synthesize(g.prototype,"collection"),d.synthesize(g.prototype,"type"),d.synthesize(g.prototype,"unique"),g.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},g.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree.clear(),this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},g.prototype.insert=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),this._btree.insert(a)?(this._size++,!0):!1},g.prototype.remove=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),this._btree.remove(a)?(this._size--,!0):!1},g.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},g.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},g.prototype.lookup=function(a,b,c){return this._btree.lookup(a,b,c)},g.prototype.match=function(a,b){return this._btree.match(a,b)},g.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},g.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},g.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index.btree=g,d.finishModule("IndexBinaryTree"),b.exports=g},{"./BinaryTree":3,"./Path":34,"./Shared":40}],16:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a,b,c){this._crossRef={},this._size=0,this._id=this._itemKeyHash(a,a),this.data({}),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexHashMap",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.id=function(){return this._id},f.prototype.state=function(){return this._state},f.prototype.size=function(){return this._size},d.synthesize(f.prototype,"data"),d.synthesize(f.prototype,"name"),d.synthesize(f.prototype,"collection"),d.synthesize(f.prototype,"type"),d.synthesize(f.prototype,"unique"),f.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},f.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._data={},this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},f.prototype.insert=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pushToPathValue(d[e],a)},f.prototype.update=function(a,b){},f.prototype.remove=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pullFromPathValue(d[e],a)},f.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},f.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},f.prototype.pushToPathValue=function(a,b){var c=this._data[a]=this._data[a]||[];-1===c.indexOf(b)&&(c.push(b),this._size++,this.pushToCrossRef(b,c))},f.prototype.pullFromPathValue=function(a,b){var c,d=this._data[a];c=d.indexOf(b),c>-1&&(d.splice(c,1),this._size--,this.pullFromCrossRef(b,d)),d.length||delete this._data[a]},f.prototype.pull=function(a){var b,c,d=a[this._collection.primaryKey()],e=this._crossRef[d],f=e.length;for(b=0;f>b;b++)c=e[b],this._pullFromArray(c,a);this._size--,delete this._crossRef[d]},f.prototype._pullFromArray=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1)},f.prototype.pushToCrossRef=function(a,b){var c,d=a[this._collection.primaryKey()];this._crossRef[d]=this._crossRef[d]||[],c=this._crossRef[d],-1===c.indexOf(b)&&c.push(b)},f.prototype.pullFromCrossRef=function(a,b){var c=a[this._collection.primaryKey()];delete this._crossRef[c]},f.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},f.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},f.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},f.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},f.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index.hashed=f,d.finishModule("IndexHashMap"),b.exports=f},{"./Path":34,"./Shared":40}],17:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){this._name=a,this._data={},this._primaryKey="_id"},d.addModule("KeyValueStore",e),d.mixin(e.prototype,"Mixin.ChainReactor"),d.synthesize(e.prototype,"name"),e.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},e.prototype.truncate=function(){return this._data={},this},e.prototype.set=function(a,b){return this._data[a]=b?b:!0,this},e.prototype.get=function(a){return this._data[a]},e.prototype.lookup=function(a){var b,c,d,e=this._primaryKey,f=typeof a,g=[];if("string"===f||"number"===f)return d=this.get(a),void 0!==d?[d]:[];if("object"===f){if(a instanceof Array){for(c=a.length,g=[],b=0;c>b;b++)d=this.lookup(a[b]),d&&(d instanceof Array?g=g.concat(d):g.push(d));return g}if(void 0!==a[e]&&null!==a[e])return this.lookup(a[e])}},e.prototype.unSet=function(a){return delete this._data[a],this},e.prototype.uniqueSet=function(a,b){return void 0===this._data[a]?(this._data[a]=b,!0):!1},d.finishModule("KeyValueStore"),b.exports=e},{"./Shared":40}],18:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Operation"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(){this._data=[]},d.addModule("Metrics",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.create=function(a){var b=new e(a);return this._enabled&&this._data.push(b),b},f.prototype.start=function(){return this._enabled=!0,this},f.prototype.stop=function(){return this._enabled=!1,this},f.prototype.clear=function(){return this._data=[],this},f.prototype.list=function(){return this._data},d.finishModule("Metrics"),b.exports=f},{"./Operation":31,"./Shared":40}],19:[function(a,b,c){"use strict";var d={preSetData:function(){},postSetData:function(){}};b.exports=d},{}],20:[function(a,b,c){"use strict";var d={chain:function(a){this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Adding target "'+a._reactorOut.instanceIdentifier()+'" to the chain reactor target list'):console.log(this.logIdentifier()+' Adding target "'+a.instanceIdentifier()+'" to the chain reactor target list')),this._chain=this._chain||[];var b=this._chain.indexOf(a);-1===b&&this._chain.push(a)},unChain:function(a){if(this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Removing target "'+a._reactorOut.instanceIdentifier()+'" from the chain reactor target list'):console.log(this.logIdentifier()+' Removing target "'+a.instanceIdentifier()+'" from the chain reactor target list')),this._chain){var b=this._chain.indexOf(a);b>-1&&this._chain.splice(b,1)}},chainEnabled:function(a){return void 0!==a?(this._chainDisabled=!a,this):!this._chainDisabled},chainWillSend:function(){return Boolean(this._chain&&!this._chainDisabled)},chainSend:function(a,b,c){if(this._chain&&!this._chainDisabled){var d,e,f=this._chain,g=f.length,h=this.decouple(b,g);for(e=0;g>e;e++){if(d=f[e],d._state&&(!d._state||d.isDropped()))throw console.log("Reactor Data:",a,b,c),console.log("Reactor Node:",d),"Chain reactor attempting to send data to target reactor node that is in a dropped state!";this.debug&&this.debug()&&(d._reactorIn&&d._reactorOut?console.log(d._reactorIn.logIdentifier()+' Sending data down the chain reactor pipe to "'+d._reactorOut.instanceIdentifier()+'"'):console.log(this.logIdentifier()+' Sending data down the chain reactor pipe to "'+d.instanceIdentifier()+'"')),d.chainReceive&&d.chainReceive(this,a,h[e],c)}}},chainReceive:function(a,b,c,d){var e={sender:a,type:b,data:c,options:d},f=!1;this.debug&&this.debug()&&console.log(this.logIdentifier()+" Received data from parent reactor node"),this._chainHandler&&(f=this._chainHandler(e)),f||this.chainSend(e.type,e.data,e.options)}};b.exports=d},{}],21:[function(a,b,c){"use strict";var d,e=0,f=a("./Overload"),g=a("./Serialiser"),h=new g;d={serialiser:h,make:function(a){return h.convert(a)},store:function(a,b){if(void 0!==a){if(void 0!==b)return this._store=this._store||{},this._store[a]=b,this;if(this._store)return this._store[a]}},unStore:function(a){return void 0!==a&&delete this._store[a],this},decouple:function(a,b){if(void 0!==a&&""!==a){if(b){var c,d=this.jStringify(a),e=[];for(c=0;b>c;c++)e.push(this.jParse(d));return e}return this.jParse(this.jStringify(a))}},jParse:function(a){return JSON.parse(a,h.reviver())},jStringify:function(a){return JSON.stringify(a)},objectId:function(a){var b,c=Math.pow(10,17);if(a){var d,f=0,g=a.length;for(d=0;g>d;d++)f+=a.charCodeAt(d)*c;b=f.toString(16)}else e++,b=(e+(Math.random()*c+Math.random()*c+Math.random()*c+Math.random()*c)).toString(16);return b},hash:function(a){return JSON.stringify(a)},debug:new f([function(){return this._debug&&this._debug.all},function(a){return void 0!==a?"boolean"==typeof a?(this._debug=this._debug||{},this._debug.all=a,this.chainSend("debug",this._debug),this):this._debug&&this._debug[a]||this._db&&this._db._debug&&this._db._debug[a]||this._debug&&this._debug.all:this._debug&&this._debug.all},function(a,b){return void 0!==a?void 0!==b?(this._debug=this._debug||{},this._debug[a]=b,this.chainSend("debug",this._debug),this):this._debug&&this._debug[b]||this._db&&this._db._debug&&this._db._debug[a]:this._debug&&this._debug.all}]),classIdentifier:function(){return"ForerunnerDB."+this.className},instanceIdentifier:function(){return"["+this.className+"]"+this.name()},logIdentifier:function(){return"ForerunnerDB "+this.instanceIdentifier()},convertToFdb:function(a){var b,c,d,e;for(e in a)if(a.hasOwnProperty(e)&&(d=a,e.indexOf(".")>-1)){for(e=e.replace(".$","[|$|]"),c=e.split(".");b=c.shift();)b=b.replace("[|$|]",".$"),c.length?d[b]={}:d[b]=a[e],d=d[b];delete a[e]}},isDropped:function(){return"dropped"===this._state},debounce:function(a,b,c){var d,e=this;e._debounce=e._debounce||{},e._debounce[a]&&clearTimeout(e._debounce[a].timeout),d={callback:b,timeout:setTimeout(function(){delete e._debounce[a],b()},c)},e._debounce[a]=d}},b.exports=d},{"./Overload":32,"./Serialiser":39}],22:[function(a,b,c){"use strict";var d={TYPE_INSERT:0,TYPE_UPDATE:1,TYPE_REMOVE:2,PHASE_BEFORE:0,PHASE_AFTER:1};b.exports=d},{}],23:[function(a,b,c){"use strict";var d=a("./Overload"),e={on:new d({"string, function":function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a]["*"]=this._listeners[a]["*"]||[],this._listeners[a]["*"].push(b),this},"string, *, function":function(a,b,c){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a][b]=this._listeners[a][b]||[],this._listeners[a][b].push(c),this}}),once:new d({"string, function":function(a,b){var c=this,d=!1,e=function(){d||(c.off(a,e),b.apply(c,arguments),d=!0)};return this.on(a,e)},"string, *, function":function(a,b,c){
var d=this,e=!1,f=function(){e||(d.off(a,b,f),c.apply(d,arguments),e=!0)};return this.on(a,b,f)}}),off:new d({string:function(a){var b=this;return this._emitting?(this._eventRemovalQueue=this._eventRemovalQueue||[],this._eventRemovalQueue.push(function(){b.off(a)})):this._listeners&&this._listeners[a]&&a in this._listeners&&delete this._listeners[a],this},"string, function":function(a,b){var c,d,e=this;return this._emitting?(this._eventRemovalQueue=this._eventRemovalQueue||[],this._eventRemovalQueue.push(function(){e.off(a,b)})):"string"==typeof b?this._listeners&&this._listeners[a]&&this._listeners[a][b]&&delete this._listeners[a][b]:this._listeners&&a in this._listeners&&(c=this._listeners[a]["*"],d=c.indexOf(b),d>-1&&c.splice(d,1)),this},"string, *, function":function(a,b,c){var d=this;if(this._emitting)this._eventRemovalQueue=this._eventRemovalQueue||[],this._eventRemovalQueue.push(function(){d.off(a,b,c)});else if(this._listeners&&a in this._listeners&&b in this.listeners[a]){var e=this._listeners[a][b],f=e.indexOf(c);f>-1&&e.splice(f,1)}},"string, *":function(a,b){var c=this;this._emitting?(this._eventRemovalQueue=this._eventRemovalQueue||[],this._eventRemovalQueue.push(function(){c.off(a,b)})):this._listeners&&a in this._listeners&&b in this._listeners[a]&&delete this._listeners[a][b]}}),emit:function(a,b){if(this._listeners=this._listeners||{},this._emitting=!0,a in this._listeners){var c,d,e,f,g,h,i;if(this._listeners[a]["*"])for(f=this._listeners[a]["*"],d=f.length,c=0;d>c;c++)e=f[c],"function"==typeof e&&e.apply(this,Array.prototype.slice.call(arguments,1));if(b instanceof Array&&b[0]&&b[0][this._primaryKey])for(g=this._listeners[a],d=b.length,c=0;d>c;c++)if(g[b[c][this._primaryKey]])for(h=g[b[c][this._primaryKey]].length,i=0;h>i;i++)e=g[b[c][this._primaryKey]][i],"function"==typeof e&&g[b[c][this._primaryKey]][i].apply(this,Array.prototype.slice.call(arguments,1))}return this._emitting=!1,this._processRemovalQueue(),this},_processRemovalQueue:function(){var a;if(this._eventRemovalQueue&&this._eventRemovalQueue.length){for(a=0;a<this._eventRemovalQueue.length;a++)this._eventRemovalQueue[a]();this._eventRemovalQueue=[]}},deferEmit:function(a,b){var c,d=this;return this._noEmitDefer||this._db&&(!this._db||this._db._noEmitDefer)?this.emit.apply(this,arguments):(c=arguments,this._deferTimeout=this._deferTimeout||{},this._deferTimeout[a]&&clearTimeout(this._deferTimeout[a]),this._deferTimeout[a]=setTimeout(function(){d.debug()&&console.log(d.logIdentifier()+" Emitting "+c[0]),d.emit.apply(d,c)},1)),this}};b.exports=e},{"./Overload":32}],24:[function(a,b,c){"use strict";var d={_match:function(a,b,c,d,e){var f,g,h,i,j,k,l=d,m=typeof a,n=typeof b,o=!0;if("object"===m&&null===a&&(m="null"),"object"===n&&null===b&&(n="null"),e=e||{},c=c||{},e.$rootQuery||(e.$rootQuery=b),e.$rootSource||(e.$rootSource=a),e.$currentQuery=b,e.$rootData=e.$rootData||{},"string"!==m&&"number"!==m&&"null"!==m||"string"!==n&&"number"!==n&&"null"!==n){if(("string"===m||"number"===m)&&"object"===n&&b instanceof RegExp)b.test(a)||(o=!1);else for(k in b)if(b.hasOwnProperty(k)){if(e.$previousQuery=e.$parent,e.$parent={query:b[k],key:k,parent:e.$previousQuery},f=!1,j=k.substr(0,2),"//"===j)continue;if(0===j.indexOf("$")&&(i=this._matchOp(k,a,b[k],c,e),i>-1)){if(i){if("or"===d)return!0}else o=i;f=!0}if(!f&&b[k]instanceof RegExp)if(f=!0,"object"===m&&void 0!==a[k]&&b[k].test(a[k])){if("or"===d)return!0}else o=!1;if(!f)if("object"==typeof b[k])if(void 0!==a[k])if(a[k]instanceof Array&&!(b[k]instanceof Array)){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if(!(a[k]instanceof Array)&&b[k]instanceof Array){for(g=!1,h=0;h<b[k].length&&!(g=this._match(a[k],b[k][h],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if("object"==typeof a)if(g=this._match(a[k],b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(b[k]&&void 0!==b[k].$exists)if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else o=!1;else if(a&&a[k]===b[k]){if("or"===d)return!0}else if(a&&a[k]&&a[k]instanceof Array&&b[k]&&"object"!=typeof b[k]){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else o=!1;if("and"===d&&!o)return!1}}else"number"===m||"null"===m||"null"===n?a!==b&&(o=!1):a.localeCompare(b)&&(o=!1);return o},_matchOp:function(a,b,c,d,e){switch(a){case"$gt":return b>c;case"$gte":return b>=c;case"$lt":return c>b;case"$lte":return c>=b;case"$exists":return void 0===b!==c;case"$eq":return b==c;case"$eeq":return b===c;case"$ne":return b!=c;case"$nee":return b!==c;case"$or":for(var f=0;f<c.length;f++)if(this._match(b,c[f],d,"and",e))return!0;return!1;case"$and":for(var g=0;g<c.length;g++)if(!this._match(b,c[g],d,"and",e))return!1;return!0;case"$in":if(c instanceof Array){var h,i=c,j=i.length;for(h=0;j>h;h++)if(this._match(b,i[h],d,"and",e))return!0;return!1}return"object"==typeof c?this._match(b,c,d,"and",e):(console.log(this.logIdentifier()+" Cannot use an $in operator on a non-array key: "+a,e.$rootQuery),!1);case"$nin":if(c instanceof Array){var k,l=c,m=l.length;for(k=0;m>k;k++)if(this._match(b,l[k],d,"and",e))return!1;return!0}return"object"==typeof c?this._match(b,c,d,"and",e):(console.log(this.logIdentifier()+" Cannot use a $nin operator on a non-array key: "+a,e.$rootQuery),!1);case"$fastIn":return c instanceof Array?-1!==c.indexOf(b):(console.log(this.logIdentifier()+" Cannot use an $fastIn operator on a non-array key: "+a,e.$rootQuery),!1);case"$distinct":e.$rootData["//distinctLookup"]=e.$rootData["//distinctLookup"]||{};for(var n in c)if(c.hasOwnProperty(n))return e.$rootData["//distinctLookup"][n]=e.$rootData["//distinctLookup"][n]||{},e.$rootData["//distinctLookup"][n][b[n]]?!1:(e.$rootData["//distinctLookup"][n][b[n]]=!0,!0);break;case"$count":var o,p,q;for(o in c)if(c.hasOwnProperty(o)&&(p=b[o],q="object"==typeof p&&p instanceof Array?p.length:0,!this._match(q,c[o],d,"and",e)))return!1;return!0;case"$find":case"$findOne":case"$findSub":var r,s,t,u,v,w,x="collection",y={};if(!c.$from)throw a+" missing $from property!";if(c.$fromType&&(x=c.$fromType,!this.db()[x]||"function"!=typeof this.db()[x]))throw a+' cannot operate against $fromType "'+x+'" because the database does not recognise this type of object!';if(r=c.$query||{},s=c.$options||{},"$findSub"===a){if(!c.$path)throw a+" missing $path property!";if(v=c.$path,t=c.$subQuery||{},u=c.$subOptions||{},!(e.$parent&&e.$parent.parent&&e.$parent.parent.key))return this._match(b,r,{},"and",e)&&(w=this._findSub([b],v,t,u)),w&&w.length>0;w=this.db()[x](c.$from).findSub(r,v,t,u)}else w=this.db()[x](c.$from)[a.substr(1)](r,s);return y[e.$parent.parent.key]=w,this._match(b,y,d,"and",e)}return-1},applyJoin:function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this,y=[];for(a instanceof Array||(a=[a]),e=0;e<b.length;e++)for(f in b[e])if(b[e].hasOwnProperty(f))for(g=b[e][f],h=g.$sourceType||"collection",i="$"+h+"."+f,j=f,c[i]?k=c[i]:this._db[h]&&"function"==typeof this._db[h]&&(k=this._db[h](f)),l=0;l<a.length;l++){m={},n=!1,o=!1,p="";for(q in g)if(g.hasOwnProperty(q))if(r=g[q],"$"===q.substr(0,1))switch(q){case"$where":if(!r.$query&&!r.$options)throw'$join $where clause requires "$query" and / or "$options" keys to work!';r.$query&&(m=x.resolveDynamicQuery(r.$query,a[l])),r.$options&&(s=r.$options);break;case"$as":j=r;break;case"$multi":n=r;break;case"$require":o=r;break;case"$prefix":p=r}else m[q]=x.resolveDynamicQuery(r,a[l]);if(t=k.find(m,s),!o||o&&t[0])if("$root"===j){if(n!==!1)throw this.logIdentifier()+' Cannot combine [$as: "$root"] with [$multi: true] in $join clause!';u=t[0],v=a[l];for(w in u)u.hasOwnProperty(w)&&void 0===v[p+w]&&(v[p+w]=u[w])}else a[l][j]=n===!1?t[0]:t;else y.push(l)}return y},resolveDynamicQuery:function(a,b){var c,d,e,f,g,h=this;if("string"==typeof a)return f="$$."===a.substr(0,3)?this.sharedPathSolver.value(b,a.substr(3,a.length-3)):this.sharedPathSolver.value(b,a),f.length>1?{$in:f}:f[0];c={};for(g in a)if(a.hasOwnProperty(g))switch(d=typeof a[g],e=a[g],d){case"string":"$$."===e.substr(0,3)?c[g]=this.sharedPathSolver.value(b,e.substr(3,e.length-3))[0]:c[g]=e;break;case"object":c[g]=h.resolveDynamicQuery(e,b);break;default:c[g]=e}return c},spliceArrayByIndexList:function(a,b){var c;for(c=b.length-1;c>=0;c--)a.splice(b[c],1)}};b.exports=d},{}],25:[function(a,b,c){"use strict";var d={sortAsc:function(a,b){return"string"==typeof a&&"string"==typeof b?a.localeCompare(b):a>b?1:b>a?-1:0},sortDesc:function(a,b){return"string"==typeof a&&"string"==typeof b?b.localeCompare(a):a>b?-1:b>a?1:0}};b.exports=d},{}],26:[function(a,b,c){"use strict";var d,e={};d={tagAdd:function(a){var b,c=this,d=e[a]=e[a]||[];for(b=0;b<d.length;b++)if(d[b]===c)return!0;return d.push(c),c.on&&c.on("drop",function(){c.tagRemove(a)}),!0},tagRemove:function(a){var b,c=e[a];if(c)for(b=0;b<c.length;b++)if(c[b]===this)return c.splice(b,1),!0;return!1},tagLookup:function(a){return e[a]||[]},tagDrop:function(a,b){var c,d,e,f=this.tagLookup(a);if(c=function(){d--,b&&0===d&&b(!1)},f.length)for(d=f.length,e=f.length-1;e>=0;e--)f[e].drop(c);return!0}},b.exports=d},{}],27:[function(a,b,c){"use strict";var d=a("./Overload"),e={addTrigger:function(a,b,c,d){var e,f=this;return e=f._triggerIndexOf(a,b,c),-1===e?(f.triggerStack={},f._trigger=f._trigger||{},f._trigger[b]=f._trigger[b]||{},f._trigger[b][c]=f._trigger[b][c]||[],f._trigger[b][c].push({id:a,method:d,enabled:!0}),!0):!1},removeTrigger:function(a,b,c){var d,e=this;return d=e._triggerIndexOf(a,b,c),d>-1&&e._trigger[b][c].splice(d,1),!1},ignoreTriggers:function(a){return void 0!==a?(this._ignoreTriggers=a,this):this._ignoreTriggers},addLinkIO:function(a,b){var c,d,e,f,g,h,i,j,k,l=this;if(l._linkIO=l._linkIO||{},l._linkIO[a]=b,d=b["export"],e=b["import"],d&&(h=l.db().collection(d.to)),e&&(i=l.db().collection(e.from)),j=[l.TYPE_INSERT,l.TYPE_UPDATE,l.TYPE_REMOVE],c=function(a,b){b(!1,!0)},d&&(d.match||(d.match=c),d.types||(d.types=j),f=function(a,b,c){d.match(c,function(b,e){!b&&e&&d.data(c,a.type,function(b,c,d){!b&&c&&(h.ignoreTriggers(!0),"remove"!==a.type?h.upsert(c,d):h.remove(c,d),h.ignoreTriggers(!1))})})}),e&&(e.match||(e.match=c),e.types||(e.types=j),g=function(a,b,c){e.match(c,function(b,d){!b&&d&&e.data(c,a.type,function(b,c,d){!b&&c&&(h.ignoreTriggers(!0),"remove"!==a.type?l.upsert(c,d):l.remove(c,d),h.ignoreTriggers(!1))})})}),d)for(k=0;k<d.types.length;k++)l.addTrigger(a+"export"+d.types[k],d.types[k],l.PHASE_AFTER,f);if(e)for(k=0;k<e.types.length;k++)i.addTrigger(a+"import"+e.types[k],e.types[k],l.PHASE_AFTER,g)},removeLinkIO:function(a){var b,c,d,e,f=this,g=f._linkIO[a];if(g){if(b=g["export"],c=g["import"],b)for(e=0;e<b.types.length;e++)f.removeTrigger(a+"export"+b.types[e],b.types[e],f.db.PHASE_AFTER);if(c)for(d=f.db().collection(c.from),e=0;e<c.types.length;e++)d.removeTrigger(a+"import"+c.types[e],c.types[e],f.db.PHASE_AFTER);return delete f._linkIO[a],!0}return!1},enableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!0,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!0,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!0,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!0,!0):!1}}),disableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!1,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!1,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!1,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!1,!0):!1}}),willTrigger:function(a,b){if(!this._ignoreTriggers&&this._trigger&&this._trigger[a]&&this._trigger[a][b]&&this._trigger[a][b].length){var c,d=this._trigger[a][b];for(c=0;c<d.length;c++)if(d[c].enabled)return!0}return!1},processTrigger:function(a,b,c,d,e){var f,g,h,i,j,k,l,m=this;if(!m._ignoreTriggers&&m._trigger&&m._trigger[b]&&m._trigger[b][c]){for(f=m._trigger[b][c],h=f.length,g=0;h>g;g++)if(i=f[g],i.enabled){if(m.debug()){switch(b){case this.TYPE_INSERT:k="insert";break;case this.TYPE_UPDATE:k="update";break;case this.TYPE_REMOVE:k="remove";break;default:k=""}switch(c){case this.PHASE_BEFORE:l="before";break;case this.PHASE_AFTER:l="after";break;default:l=""}console.log('Triggers: Processing trigger "'+i.id+'" for '+k+' in phase "'+l+'"')}if(m.triggerStack&&m.triggerStack[b]&&m.triggerStack[b][c]&&m.triggerStack[b][c][i.id]){m.debug()&&console.log('Triggers: Will not run trigger "'+i.id+'" for '+k+' in phase "'+l+'" as it is already in the stack!');continue}if(m.triggerStack=m.triggerStack||{},m.triggerStack[b]={},m.triggerStack[b][c]={},m.triggerStack[b][c][i.id]=!0,j=i.method.call(m,a,d,e),m.triggerStack=m.triggerStack||{},m.triggerStack[b]={},m.triggerStack[b][c]={},m.triggerStack[b][c][i.id]=!1,j===!1)return!1;if(void 0!==j&&j!==!0&&j!==!1)throw"ForerunnerDB.Mixin.Triggers: Trigger error: "+j}return!0}},_triggerIndexOf:function(a,b,c){var d,e,f,g=this;if(g._trigger&&g._trigger[b]&&g._trigger[b][c])for(d=g._trigger[b][c],e=d.length,f=0;e>f;f++)if(d[f].id===a)return f;return-1}};b.exports=e},{"./Overload":32}],28:[function(a,b,c){"use strict";var d={_updateProperty:function(a,b,c){a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'" to val "'+c+'"')},_updateIncrement:function(a,b,c){a[b]+=c},_updateSpliceMove:function(a,b,c){a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"')},_updateSplicePush:function(a,b,c){a.length>b?a.splice(b,0,c):a.push(c)},_updatePush:function(a,b){a.push(b)},_updatePull:function(a,b){a.splice(b,1)},_updateMultiply:function(a,b,c){a[b]*=c},_updateRename:function(a,b,c){a[c]=a[b],delete a[b]},_updateOverwrite:function(a,b,c){a[b]=c},_updateUnset:function(a,b){delete a[b]},_updateClear:function(a,b){var c,d=a[b];if(d&&"object"==typeof d)for(c in d)d.hasOwnProperty(c)&&this._updateUnset(d,c)},_updatePop:function(a,b){var c,d=!1;if(a.length>0)if(b>0){for(c=0;b>c;c++)a.pop();d=!0}else if(0>b){for(c=0;c>b;c--)a.shift();d=!0}return d}};b.exports=d},{}],29:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared"),e=d.modules.Core,f=d.modules.OldView,g=f.prototype.init,f.prototype.init=function(){var a=this;this._binds=[],this._renderStart=0,this._renderEnd=0,this._deferQueue={insert:[],update:[],remove:[],upsert:[],_bindInsert:[],_bindUpdate:[],_bindRemove:[],_bindUpsert:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100,_bindInsert:100,_bindUpdate:100,_bindRemove:100,_bindUpsert:100},this._deferTime={insert:100,update:1,remove:1,upsert:1,_bindInsert:100,_bindUpdate:1,_bindRemove:1,_bindUpsert:1},g.apply(this,arguments),this.on("insert",function(b,c){a._bindEvent("insert",b,c)}),this.on("update",function(b,c){a._bindEvent("update",b,c)}),this.on("remove",function(b,c){a._bindEvent("remove",b,c)}),this.on("change",a._bindChange)},f.prototype.bind=function(a,b){if(!b||!b.template)throw'ForerunnerDB.OldView "'+this.name()+'": Cannot bind data to element, missing options information!';return this._binds[a]=b,this},f.prototype.unBind=function(a){return delete this._binds[a],this},f.prototype.isBound=function(a){return Boolean(this._binds[a])},f.prototype.bindSortDom=function(a,b){var c,d,e,f=window.jQuery(a);for(this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sorting data in DOM...",b),c=0;c<b.length;c++)d=b[c],e=f.find("#"+d[this._primaryKey]),e.length?0===c?(this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sort, moving to index 0...",e),f.prepend(e)):(this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sort, moving to index "+c+"...",e),e.insertAfter(f.children(":eq("+(c-1)+")"))):this.debug()&&console.log("ForerunnerDB.OldView.Bind: Warning, element for array item not found!",d)},f.prototype.bindRefresh=function(a){var b,c,d=this._binds;a||(a={data:this.find()});for(b in d)d.hasOwnProperty(b)&&(c=d[b],this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sorting DOM..."),this.bindSortDom(b,a.data),c.afterOperation&&c.afterOperation(),c.refresh&&c.refresh())},f.prototype.bindRender=function(a,b){var c,d,e,f,g,h=this._binds[a],i=window.jQuery(a),j=window.jQuery("<ul></ul>");if(h){for(c=this._data.find(),f=function(a){j.append(a)},g=0;g<c.length;g++)d=c[g],e=h.template(d,f);b?b(a,j.html()):i.append(j.html())}},f.prototype.processQueue=function(a,b){var c=this._deferQueue[a],d=this._deferThreshold[a],e=this._deferTime[a];if(c.length){var f,g=this;c.length&&(f=c.length>d?c.splice(0,d):c.splice(0,c.length),this._bindEvent(a,f,[])),setTimeout(function(){g.processQueue(a,b)},e)}else b&&b(),this.emit("bindQueueComplete")},f.prototype._bindEvent=function(a,b,c){var d,e,f=this._binds,g=this.find({});for(e in f)if(f.hasOwnProperty(e))switch(d=f[e].reduce?this.find(f[e].reduce.query,f[e].reduce.options):g,a){case"insert":this._bindInsert(e,f[e],b,c,d);break;case"update":this._bindUpdate(e,f[e],b,c,d);break;case"remove":this._bindRemove(e,f[e],b,c,d)}},f.prototype._bindChange=function(a){this.debug()&&console.log("ForerunnerDB.OldView.Bind: Bind data change, refreshing bind...",a),this.bindRefresh(a)},f.prototype._bindInsert=function(a,b,c,d,e){var f,g,h,i,j=window.jQuery(a);for(h=function(a,c,d,e){return function(a){b.insert?b.insert(a,c,d,e):b.prependInsert?j.prepend(a):j.append(a),b.afterInsert&&b.afterInsert(a,c,d,e)}},i=0;i<c.length;i++)f=j.find("#"+c[i][this._primaryKey]),f.length||(g=b.template(c[i],h(f,c[i],d,e)))},f.prototype._bindUpdate=function(a,b,c,d,e){var f,g,h,i=window.jQuery(a);for(g=function(a,c){return function(d){b.update?b.update(d,c,e,a.length?"update":"append"):a.length?a.replaceWith(d):b.prependUpdate?i.prepend(d):i.append(d),b.afterUpdate&&b.afterUpdate(d,c,e)}},h=0;h<c.length;h++)f=i.find("#"+c[h][this._primaryKey]),b.template(c[h],g(f,c[h]))},f.prototype._bindRemove=function(a,b,c,d,e){var f,g,h,i=window.jQuery(a);for(g=function(a,c,d){return function(){b.remove?b.remove(a,c,d):(a.remove(),b.afterRemove&&b.afterRemove(a,c,d))}},h=0;h<c.length;h++)f=i.find("#"+c[h][this._primaryKey]),f.length&&(b.beforeRemove?b.beforeRemove(f,c[h],e,g(f,c[h],e)):b.remove?b.remove(f,c[h],e):(f.remove(),b.afterRemove&&b.afterRemove(f,c[h],e)))}},{"./Shared":40}],30:[function(a,b,c){"use strict";var d,e,f,g,h,i,j;d=a("./Shared");var k=function(a){this.init.apply(this,arguments)};k.prototype.init=function(a){var b=this;this._name=a,this._listeners={},this._query={query:{},options:{}},this._onFromSetData=function(){b._onSetData.apply(b,arguments)},this._onFromInsert=function(){b._onInsert.apply(b,arguments)},this._onFromUpdate=function(){b._onUpdate.apply(b,arguments)},this._onFromRemove=function(){b._onRemove.apply(b,arguments)},this._onFromChange=function(){b.debug()&&console.log("ForerunnerDB.OldView: Received change"),b._onChange.apply(b,arguments)}},d.addModule("OldView",k),f=a("./CollectionGroup"),g=a("./Collection"),h=g.prototype.init,i=f.prototype.init,e=d.modules.Db,j=e.prototype.init,d.mixin(k.prototype,"Mixin.Events"),k.prototype.drop=function(){return(this._db||this._from)&&this._name?(this.debug()&&console.log("ForerunnerDB.OldView: Dropping view "+this._name),this._state="dropped",this.emit("drop",this),this._db&&this._db._oldViews&&delete this._db._oldViews[this._name],this._from&&this._from._oldViews&&delete this._from._oldViews[this._name],delete this._listeners,!0):!1},k.prototype.debug=function(){return!1},k.prototype.db=function(a){return void 0!==a?(this._db=a,this):this._db},k.prototype.from=function(a){if(void 0!==a){if("string"==typeof a){if(!this._db.collectionExists(a))throw'ForerunnerDB.OldView "'+this.name()+'": Invalid collection in view.from() call.';a=this._db.collection(a)}return this._from!==a&&(this._from&&this.removeFrom(),this.addFrom(a)),this}return this._from},k.prototype.addFrom=function(a){if(this._from=a,this._from)return this._from.on("setData",this._onFromSetData),this._from.on("change",this._onFromChange),this._from._addOldView(this),this._primaryKey=this._from._primaryKey,this.refresh(),this;throw'ForerunnerDB.OldView "'+this.name()+'": Cannot determine collection type in view.from()'},k.prototype.removeFrom=function(){this._from.off("setData",this._onFromSetData),this._from.off("change",this._onFromChange),this._from._removeOldView(this)},k.prototype.primaryKey=function(){return this._from?this._from.primaryKey():void 0},k.prototype.queryData=function(a,b,c){return void 0!==a&&(this._query.query=a),void 0!==b&&(this._query.options=b),void 0!==a||void 0!==b?(void 0!==c&&c!==!0||this.refresh(),this):this._query},k.prototype.queryAdd=function(a,b,c){var d,e=this._query.query;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||void 0!==e[d]&&b)&&(e[d]=a[d]);void 0!==c&&c!==!0||this.refresh()},k.prototype.queryRemove=function(a,b){var c,d=this._query.query;if(void 0!==a)for(c in a)a.hasOwnProperty(c)&&delete d[c];void 0!==b&&b!==!0||this.refresh()},k.prototype.query=function(a,b){return void 0!==a?(this._query.query=a,void 0!==b&&b!==!0||this.refresh(),this):this._query.query},k.prototype.queryOptions=function(a,b){return void 0!==a?(this._query.options=a,void 0!==b&&b!==!0||this.refresh(),this):this._query.options},k.prototype.refresh=function(a){if(this._from){var b,c,d,e,f,g,h,i,j=this._data,k=[],l=[],m=[],n=!1;if(this.debug()&&(console.log("ForerunnerDB.OldView: Refreshing view "+this._name),console.log("ForerunnerDB.OldView: Existing data: "+("undefined"!=typeof this._data)),"undefined"!=typeof this._data&&console.log("ForerunnerDB.OldView: Current data rows: "+this._data.find().length)),this._query?(this.debug()&&console.log("ForerunnerDB.OldView: View has query and options, getting subset..."),this._data=this._from.subset(this._query.query,this._query.options)):this._query.options?(this.debug()&&console.log("ForerunnerDB.OldView: View has options, getting subset..."),this._data=this._from.subset({},this._query.options)):(this.debug()&&console.log("ForerunnerDB.OldView: View has no query or options, getting subset..."),this._data=this._from.subset({})),!a&&j)if(this.debug()&&console.log("ForerunnerDB.OldView: Refresh not forced, old data detected..."),d=this._data,j.subsetOf()===d.subsetOf()){for(this.debug()&&console.log("ForerunnerDB.OldView: Old and new data are from same collection..."),e=d.find(),b=j.find(),g=d._primaryKey,i=0;i<e.length;i++)h=e[i],f={},f[g]=h[g],c=j.find(f)[0],c?JSON.stringify(c)!==JSON.stringify(h)&&l.push(h):k.push(h);for(i=0;i<b.length;i++)h=b[i],f={},f[g]=h[g],d.find(f)[0]||m.push(h);this.debug()&&(console.log("ForerunnerDB.OldView: Removed "+m.length+" rows"),console.log("ForerunnerDB.OldView: Inserted "+k.length+" rows"),console.log("ForerunnerDB.OldView: Updated "+l.length+" rows")),k.length&&(this._onInsert(k,[]),n=!0),l.length&&(this._onUpdate(l,[]),n=!0),m.length&&(this._onRemove(m,[]),n=!0)}else this.debug()&&console.log("ForerunnerDB.OldView: Old and new data are from different collections..."),m=j.find(),m.length&&(this._onRemove(m),n=!0),k=d.find(),k.length&&(this._onInsert(k),n=!0);else this.debug()&&console.log("ForerunnerDB.OldView: Forcing data update",e),this._data=this._from.subset(this._query.query,this._query.options),e=this._data.find(),this.debug()&&console.log("ForerunnerDB.OldView: Emitting change event with data",e),this._onInsert(e,[]);this.debug()&&console.log("ForerunnerDB.OldView: Emitting change"),this.emit("change")}return this},k.prototype.count=function(){return this._data&&this._data._data?this._data._data.length:0},k.prototype.find=function(){return this._data?(this.debug()&&console.log("ForerunnerDB.OldView: Finding data in view collection...",this._data),this._data.find.apply(this._data,arguments)):[]},k.prototype.insert=function(){return this._from?this._from.insert.apply(this._from,arguments):[]},k.prototype.update=function(){return this._from?this._from.update.apply(this._from,arguments):[]},k.prototype.remove=function(){return this._from?this._from.remove.apply(this._from,arguments):[]},k.prototype._onSetData=function(a,b){this.emit("remove",b,[]),this.emit("insert",a,[])},k.prototype._onInsert=function(a,b){this.emit("insert",a,b)},k.prototype._onUpdate=function(a,b){this.emit("update",a,b)},k.prototype._onRemove=function(a,b){this.emit("remove",a,b)},k.prototype._onChange=function(){this.debug()&&console.log("ForerunnerDB.OldView: Refreshing data"),this.refresh()},g.prototype.init=function(){this._oldViews=[],h.apply(this,arguments)},g.prototype._addOldView=function(a){return void 0!==a&&(this._oldViews[a._name]=a),this},g.prototype._removeOldView=function(a){return void 0!==a&&delete this._oldViews[a._name],this},f.prototype.init=function(){this._oldViews=[],i.apply(this,arguments)},f.prototype._addOldView=function(a){return void 0!==a&&(this._oldViews[a._name]=a),this},f.prototype._removeOldView=function(a){return void 0!==a&&delete this._oldViews[a._name],this},e.prototype.init=function(){this._oldViews={},j.apply(this,arguments)},e.prototype.oldView=function(a){return this._oldViews[a]||this.debug()&&console.log("ForerunnerDB.OldView: Creating view "+a),this._oldViews[a]=this._oldViews[a]||new k(a).db(this),this._oldViews[a]},e.prototype.oldViewExists=function(a){return Boolean(this._oldViews[a])},e.prototype.oldViews=function(){var a,b=[];for(a in this._oldViews)this._oldViews.hasOwnProperty(a)&&b.push({name:a,count:this._oldViews[a].count()});return b},d.finishModule("OldView"),b.exports=k},{"./Collection":5,"./CollectionGroup":6,"./Shared":40}],31:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(a){this.pathSolver=new e,this.counter=0,this.init.apply(this,arguments)};f.prototype.init=function(a){this._data={operation:a,index:{potential:[],used:!1},steps:[],time:{startMs:0,stopMs:0,totalMs:0,process:{}},flag:{},log:[]}},d.addModule("Operation",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.start=function(){this._data.time.startMs=(new Date).getTime()},f.prototype.log=function(a){if(a){var b=this._log.length>0?this._data.log[this._data.log.length-1].time:0,c={event:a,time:(new Date).getTime(),delta:0};return this._data.log.push(c),b&&(c.delta=c.time-b),this}return this._data.log},f.prototype.time=function(a){if(void 0!==a){var b=this._data.time.process,c=b[a]=b[a]||{};return c.startMs?(c.stopMs=(new Date).getTime(),c.totalMs=c.stopMs-c.startMs,c.stepObj.totalMs=c.totalMs,delete c.stepObj):(c.startMs=(new Date).getTime(),c.stepObj={name:a},this._data.steps.push(c.stepObj)),this}return this._data.time},f.prototype.flag=function(a,b){return void 0===a||void 0===b?void 0!==a?this._data.flag[a]:this._data.flag:void(this._data.flag[a]=b)},f.prototype.data=function(a,b,c){return void 0!==b?(this.pathSolver.set(this._data,a,b),this):this.pathSolver.get(this._data,a)},f.prototype.pushData=function(a,b,c){this.pathSolver.push(this._data,a,b)},f.prototype.stop=function(){this._data.time.stopMs=(new Date).getTime(),this._data.time.totalMs=this._data.time.stopMs-this._data.time.startMs},d.finishModule("Operation"),b.exports=f},{"./Path":34,"./Shared":40}],32:[function(a,b,c){"use strict";var d=function(a,b){if(b||(b=a,a=void 0),b){var c,d,e,f,g,h,i=this;if(!(b instanceof Array)){e={};for(c in b)if(b.hasOwnProperty(c))if(f=c.replace(/ /g,""),-1===f.indexOf("*"))e[f]=b[c];else for(h=this.generateSignaturePermutations(f),g=0;g<h.length;g++)e[h[g]]||(e[h[g]]=b[c]);b=e}return function(){var e,f,g,h=[];if(b instanceof Array){for(d=b.length,c=0;d>c;c++)if(b[c].length===arguments.length)return i.callExtend(this,"$main",b,b[c],arguments)}else{for(c=0;c<arguments.length&&(f=typeof arguments[c],"object"===f&&arguments[c]instanceof Array&&(f="array"),1!==arguments.length||"undefined"!==f);c++)h.push(f);if(e=h.join(","),b[e])return i.callExtend(this,"$main",b,b[e],arguments);for(c=h.length;c>=0;c--)if(e=h.slice(0,c).join(","),b[e+",..."])return i.callExtend(this,"$main",b,b[e+",..."],arguments)}throw g=void 0!==a?a:"function"==typeof this.name?this.name():"Unknown",console.log("Overload Definition:",b),'ForerunnerDB.Overload "'+g+'": Overloaded method does not have a matching signature "'+e+'" for the passed arguments: '+this.jStringify(h)}}return function(){}};d.prototype.generateSignaturePermutations=function(a){var b,c,d=[],e=["array","string","object","number","function","undefined"];if(a.indexOf("*")>-1)for(c=0;c<e.length;c++)b=a.replace("*",e[c]),d=d.concat(this.generateSignaturePermutations(b));else d.push(a);return d},d.prototype.callExtend=function(a,b,c,d,e){var f,g;return a&&c[b]?(f=a[b],a[b]=c[b],g=d.apply(a,e),a[b]=f,g):d.apply(a,e)},b.exports=d},{}],33:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){var b=this;this._name=a,this._data=new g("__FDB__dc_data_"+this._name),this._collData=new f,this._sources=[],this._sourceDroppedWrap=function(){b._sourceDropped.apply(b,arguments)}},d.addModule("Overview",h),d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.ChainReactor"),d.mixin(h.prototype,"Mixin.Constants"),d.mixin(h.prototype,"Mixin.Triggers"),d.mixin(h.prototype,"Mixin.Events"),d.mixin(h.prototype,"Mixin.Tags"),f=a("./Collection"),g=a("./Document"),e=d.modules.Db,d.synthesize(h.prototype,"state"),d.synthesize(h.prototype,"db"),d.synthesize(h.prototype,"name"),d.synthesize(h.prototype,"query",function(a){var b=this.$super(a);return void 0!==a&&this._refresh(),b}),d.synthesize(h.prototype,"queryOptions",function(a){var b=this.$super(a);return void 0!==a&&this._refresh(),b}),d.synthesize(h.prototype,"reduce",function(a){var b=this.$super(a);return void 0!==a&&this._refresh(),b}),h.prototype.from=function(a){return void 0!==a?("string"==typeof a&&(a=this._db.collection(a)),this._setFrom(a),this):this._sources},h.prototype.find=function(){return this._collData.find.apply(this._collData,arguments)},h.prototype.exec=function(){var a=this.reduce();return a?a.apply(this):void 0},h.prototype.count=function(){return this._collData.count.apply(this._collData,arguments)},h.prototype._setFrom=function(a){for(;this._sources.length;)this._removeSource(this._sources[0]);return this._addSource(a),this},h.prototype._addSource=function(a){return a&&"View"===a.className&&(a=a.data(),this.debug()&&console.log(this.logIdentifier()+' Using internal private data "'+a.instanceIdentifier()+'" for IO graph linking')),-1===this._sources.indexOf(a)&&(this._sources.push(a),a.chain(this),a.on("drop",this._sourceDroppedWrap),this._refresh()),this},h.prototype._removeSource=function(a){a&&"View"===a.className&&(a=a.data(),this.debug()&&console.log(this.logIdentifier()+' Using internal private data "'+a.instanceIdentifier()+'" for IO graph linking'));var b=this._sources.indexOf(a);return b>-1&&(this._sources.splice(a,1),a.unChain(this),a.off("drop",this._sourceDroppedWrap),this._refresh()),this},h.prototype._sourceDropped=function(a){a&&this._removeSource(a)},h.prototype._refresh=function(){if(!this.isDropped()){if(this._sources&&this._sources[0]){this._collData.primaryKey(this._sources[0].primaryKey());var a,b=[];for(a=0;a<this._sources.length;a++)b=b.concat(this._sources[a].find(this._query,this._queryOptions));this._collData.setData(b)}if(this._reduce){
var c=this._reduce.apply(this);this._data.setData(c)}}},h.prototype._chainHandler=function(a){switch(a.type){case"setData":case"insert":case"update":case"remove":this._refresh()}},h.prototype.data=function(){return this._data},h.prototype.drop=function(a){if(!this.isDropped()){for(this._state="dropped",delete this._data,delete this._collData;this._sources.length;)this._removeSource(this._sources[0]);delete this._sources,this._db&&this._name&&delete this._db._overview[this._name],this.emit("drop",this),a&&a(!1,!0),delete this._listeners}return!0},e.prototype.overview=function(a){var b=this;return a?a instanceof h?a:this._overview&&this._overview[a]?this._overview[a]:(this._overview=this._overview||{},this._overview[a]=new h(a).db(this),b.emit("create",b._overview[a],"overview",a),this._overview[a]):this._overview||{}},e.prototype.overviews=function(){var a,b,c=[];for(b in this._overview)this._overview.hasOwnProperty(b)&&(a=this._overview[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("Overview"),b.exports=h},{"./Collection":5,"./Document":10,"./Shared":40}],34:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){a&&this.path(a)},d.addModule("Path",e),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),e.prototype.path=function(a){return void 0!==a?(this._path=this.clean(a),this._pathParts=this._path.split("."),this):this._path},e.prototype.hasObjectPaths=function(a,b){var c,d=!0;for(c in a)if(a.hasOwnProperty(c)){if(void 0===b[c])return!1;if("object"==typeof a[c]&&(d=this.hasObjectPaths(a[c],b[c]),!d))return!1}return d},e.prototype.countKeys=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&void 0!==a[b]&&("object"!=typeof a[b]?c++:c+=this.countKeys(a[b]));return c},e.prototype.countObjectPaths=function(a,b){var c,d,e={},f=0,g=0;for(d in b)b.hasOwnProperty(d)&&("object"==typeof b[d]?(c=this.countObjectPaths(a[d],b[d]),e[d]=c.matchedKeys,g+=c.totalKeyCount,f+=c.matchedKeyCount):(g++,a&&a[d]&&"object"!=typeof a[d]?(e[d]=!0,f++):e[d]=!1));return{matchedKeys:e,matchedKeyCount:f,totalKeyCount:g}},e.prototype.parse=function(a,b){var c,d,e,f=[],g="";for(d in a)if(a.hasOwnProperty(d))if(g=d,"object"==typeof a[d])if(b)for(c=this.parse(a[d],b),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path,value:c[e].value});else for(c=this.parse(a[d]),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path});else b?f.push({path:g,value:a[d]}):f.push({path:g});return f},e.prototype.parseArr=function(a,b){return b=b||{},this._parseArr(a,"",[],b)},e.prototype._parseArr=function(a,b,c,d){var e,f="";b=b||"",c=c||[];for(e in a)a.hasOwnProperty(e)&&(!d.ignore||d.ignore&&!d.ignore.test(e))&&(f=b?b+"."+e:e,"object"==typeof a[e]?(d.verbose&&c.push(f),this._parseArr(a[e],f,c,d)):c.push(f));return c},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.get=function(a,b){return this.value(a,b)[0]},e.prototype.value=function(a,b,c){var d,e,f,g,h,i,j,k,l;if(b&&-1===b.indexOf("."))return[a[b]];if(void 0!==a&&"object"==typeof a){if((!c||c&&!c.skipArrCheck)&&a instanceof Array){for(j=[],k=0;k<a.length;k++)j.push(this.get(a[k],b));return j}for(i=[],void 0!==b&&(b=this.clean(b),d=b.split(".")),e=d||this._pathParts,f=e.length,g=a,k=0;f>k;k++){if(g=g[e[k]],h instanceof Array){for(l=0;l<h.length;l++)i=i.concat(this.value(h,l+"."+e[k],{skipArrCheck:!0}));return i}if(!g||"object"!=typeof g)break;h=g}return[g]}return[]},e.prototype.push=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;if(b=this.clean(b),d=b.split("."),e=d.shift(),d.length)a[e]=a[e]||{},this.set(a[e],d.join("."),c);else{if(a[e]=a[e]||[],!(a[e]instanceof Array))throw"ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!";a[e].push(c)}}return a},e.prototype.keyValue=function(a,b){var c,d,e,f,g,h,i;for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,i=0;e>i;i++){if(f=f[d[i]],!f||"object"!=typeof f){h=d[i]+":"+f;break}g=f}return h},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.clean=function(a){return"."===a.substr(0,1)&&(a=a.substr(1,a.length-1)),a},d.finishModule("Path"),b.exports=e},{"./Shared":40}],35:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m=a("./Shared"),n=a("async"),o=a("localforage");a("./PersistCompress"),a("./PersistCrypto");k=function(){this.init.apply(this,arguments)},k.prototype.localforage=o,k.prototype.init=function(a){var b=this;this._encodeSteps=[function(){return b._encode.apply(b,arguments)}],this._decodeSteps=[function(){return b._decode.apply(b,arguments)}],a.isClient()&&void 0!==window.Storage&&(this.mode("localforage"),o.config({driver:[o.INDEXEDDB,o.WEBSQL,o.LOCALSTORAGE],name:String(a.core().name()),storeName:"FDB"}))},m.addModule("Persist",k),m.mixin(k.prototype,"Mixin.ChainReactor"),m.mixin(k.prototype,"Mixin.Common"),d=m.modules.Db,e=a("./Collection"),f=e.prototype.drop,g=a("./CollectionGroup"),h=e.prototype.init,i=d.prototype.init,j=d.prototype.drop,l=m.overload,m.synthesize(k.prototype,"auto",function(a){var b=this;return void 0!==a&&(a?(this._db.on("create",function(){b._autoLoad.apply(b,arguments)}),this._db.on("change",function(){b._autoSave.apply(b,arguments)}),this._db.debug()&&console.log(this._db.logIdentifier()+" Automatic load/save enabled")):(this._db.off("create",this._autoLoad),this._db.off("change",this._autoSave),this._db.debug()&&console.log(this._db.logIdentifier()+" Automatic load/save disbled"))),this.$super.call(this,a)}),k.prototype._autoLoad=function(a,b,c){var d=this;"function"==typeof a.load?(d._db.debug()&&console.log(d._db.logIdentifier()+" Auto-loading data for "+b+":",c),a.load(function(a,b){a&&d._db.debug()&&console.log(d._db.logIdentifier()+" Automatic load failed:",a),d.emit("load",a,b)})):d._db.debug()&&console.log(d._db.logIdentifier()+" Auto-load for "+b+":",c,"no load method, skipping")},k.prototype._autoSave=function(a,b,c){var d=this;"function"==typeof a.save&&(d._db.debug()&&console.log(d._db.logIdentifier()+" Auto-saving data for "+b+":",c),a.save(function(a,b){a&&d._db.debug()&&console.log(d._db.logIdentifier()+" Automatic save failed:",a),d.emit("save",a,b)}))},k.prototype.mode=function(a){return void 0!==a?(this._mode=a,this):this._mode},k.prototype.driver=function(a){if(void 0!==a){switch(a.toUpperCase()){case"LOCALSTORAGE":o.setDriver(o.LOCALSTORAGE);break;case"WEBSQL":o.setDriver(o.WEBSQL);break;case"INDEXEDDB":o.setDriver(o.INDEXEDDB);break;default:throw"ForerunnerDB.Persist: The persistence driver you have specified is not found. Please use either IndexedDB, WebSQL or LocalStorage!"}return this}return o.driver()},k.prototype.decode=function(a,b){n.waterfall([function(b){b&&b(!1,a,{})}].concat(this._decodeSteps),b)},k.prototype.encode=function(a,b){n.waterfall([function(b){b&&b(!1,a,{})}].concat(this._encodeSteps),b)},m.synthesize(k.prototype,"encodeSteps"),m.synthesize(k.prototype,"decodeSteps"),k.prototype.addStep=new l({object:function(a){this.$main.call(this,function(){a.encode.apply(a,arguments)},function(){a.decode.apply(a,arguments)},0)},"function, function":function(a,b){this.$main.call(this,a,b,0)},"function, function, number":function(a,b,c){this.$main.call(this,a,b,c)},$main:function(a,b,c){0===c||void 0===c?(this._encodeSteps.push(a),this._decodeSteps.unshift(b)):(this._encodeSteps.splice(c,0,a),this._decodeSteps.splice(this._decodeSteps.length-c,0,b))}}),k.prototype.unwrap=function(a){var b,c=a.split("::fdb::");switch(c[0]){case"json":b=this.jParse(c[1]);break;case"raw":b=c[1]}},k.prototype._decode=function(a,b,c){var d,e;if(a){switch(d=a.split("::fdb::"),d[0]){case"json":e=this.jParse(d[1]);break;case"raw":e=d[1]}e?(b.foundData=!0,b.rowCount=e.length||0):(b.foundData=!1,b.rowCount=0),c&&c(!1,e,b)}else b.foundData=!1,b.rowCount=0,c&&c(!1,a,b)},k.prototype._encode=function(a,b,c){var d=a;a="object"==typeof a?"json::fdb::"+this.jStringify(a):"raw::fdb::"+a,d?(b.foundData=!0,b.rowCount=d.length||0):(b.foundData=!1,b.rowCount=0),c&&c(!1,a,b)},k.prototype.save=function(a,b,c){switch(this.mode()){case"localforage":this.encode(b,function(b,d,e){b?c(b):o.setItem(a,d).then(function(a){c&&c(!1,a,e)},function(a){c&&c(a)})});break;default:c&&c("No data handler.")}},k.prototype.load=function(a,b){var c=this;switch(this.mode()){case"localforage":o.getItem(a).then(function(a){c.decode(a,b)},function(a){b&&b(a)});break;default:b&&b("No data handler or unrecognised data type.")}},k.prototype.drop=function(a,b){switch(this.mode()){case"localforage":o.removeItem(a).then(function(){b&&b(!1)},function(a){b&&b(a)});break;default:b&&b("No data handler or unrecognised data type.")}},e.prototype.drop=new l({"":function(){this.isDropped()||this.drop(!0)},"function":function(a){this.isDropped()||this.drop(!0,a)},"boolean":function(a){if(!this.isDropped()){if(a){if(!this._name)throw"ForerunnerDB.Persist: Cannot drop a collection's persistent storage when no name assigned to collection!";this._db&&(this._db.persist.drop(this._db._name+"-"+this._name),this._db.persist.drop(this._db._name+"-"+this._name+"-metaData"))}f.call(this)}},"boolean, function":function(a,b){var c=this;if(!this.isDropped()){if(!a)return f.call(this,b);if(this._name){if(this._db)return this._db.persist.drop(this._db._name+"-"+this._name,function(){c._db.persist.drop(c._db._name+"-"+c._name+"-metaData",b)}),f.call(this);b&&b("Cannot drop a collection's persistent storage when the collection is not attached to a database!")}else b&&b("Cannot drop a collection's persistent storage when no name assigned to collection!")}}}),e.prototype.save=function(a){var b,c=this;c._name?c._db?(b=function(){c._db.persist.save(c._db._name+"-"+c._name,c._data,function(b,d,e){b?a&&a(b):c._db.persist.save(c._db._name+"-"+c._name+"-metaData",c.metaData(),function(b,f,g){a&&a(b,e,g,{tableData:d,metaData:f,tableDataName:c._db._name+"-"+c._name,metaDataName:c._db._name+"-"+c._name+"-metaData"})})})},c.isProcessingQueue()?c.on("queuesComplete",function(){b()}):b()):a&&a("Cannot save a collection that is not attached to a database!"):a&&a("Cannot save a collection with no assigned name!")},e.prototype.load=function(a){var b=this;b._name?b._db?b._db.persist.load(b._db._name+"-"+b._name,function(c,d,e){c?a&&a(c):b.remove({},function(){d=d||[],b.insert(d,function(){b._db.persist.load(b._db._name+"-"+b._name+"-metaData",function(c,d,f){c||d&&b.metaData(d),a&&a(c,e,f)})})})}):a&&a("Cannot load a collection that is not attached to a database!"):a&&a("Cannot load a collection with no assigned name!")},e.prototype.saveCustom=function(a){var b,c=this,d={};c._name?c._db?(b=function(){c.encode(c._data,function(b,e,f){b?a(b):(d.data={name:c._db._name+"-"+c._name,store:e,tableStats:f},c.encode(c._data,function(b,e,f){b?a(b):(d.metaData={name:c._db._name+"-"+c._name+"-metaData",store:e,tableStats:f},a(!1,d))}))})},c.isProcessingQueue()?c.on("queuesComplete",function(){b()}):b()):a&&a("Cannot save a collection that is not attached to a database!"):a&&a("Cannot save a collection with no assigned name!")},e.prototype.loadCustom=function(a,b){var c=this;c._name?c._db?a.data&&a.data.store?a.metaData&&a.metaData.store?c.decode(a.data.store,function(d,e,f){d?b(d):e&&(c.remove({}),c.insert(e),c.decode(a.metaData.store,function(a,d,e){a?b(a):d&&(c.metaData(d),b&&b(a,f,e))}))}):b('No "metaData" key found in passed object!'):b('No "data" key found in passed object!'):b&&b("Cannot load a collection that is not attached to a database!"):b&&b("Cannot load a collection with no assigned name!")},d.prototype.init=function(){i.apply(this,arguments),this.persist=new k(this)},d.prototype.load=new l({"function":function(a){this.$main.call(this,{},a)},"object, function":function(a,b){this.$main.call(this,a,b)},$main:function(a,b){var c,d,e=this._collection,f=e.keys(),g=f.length;c=function(a){a?b&&b(a):(g--,0===g&&b&&b(!1))};for(d in e)e.hasOwnProperty(d)&&(a?e[d].loadCustom(a,c):e[d].load(c))}}),d.prototype.save=new l({"function":function(a){this.$main.call(this,{},a)},"object, function":function(a,b){this.$main.call(this,a,b)},$main:function(a,b){var c,d,e=this._collection,f=e.keys(),g=f.length;c=function(a){a?b&&b(a):(g--,0===g&&b&&b(!1))};for(d in e)e.hasOwnProperty(d)&&(a.custom?e[d].saveCustom(c):e[d].save(c))}}),m.finishModule("Persist"),b.exports=k},{"./Collection":5,"./CollectionGroup":6,"./PersistCompress":36,"./PersistCrypto":37,"./Shared":40,async:43,localforage:81}],36:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("pako"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a){},d.mixin(f.prototype,"Mixin.Common"),f.prototype.encode=function(a,b,c){var d,f,g,h={data:a,type:"fdbCompress",enabled:!1};d=a.length,g=e.deflate(a,{to:"string"}),f=g.length,d>f&&(h.data=g,h.enabled=!0),b.compression={enabled:h.enabled,compressedBytes:f,uncompressedBytes:d,effect:Math.round(100/d*f)+"%"},c(!1,this.jStringify(h),b)},f.prototype.decode=function(a,b,c){var d,f=!1;a?(a=this.jParse(a),a.enabled?(d=e.inflate(a.data,{to:"string"}),f=!0):(d=a.data,f=!1),b.compression={enabled:f},c&&c(!1,d,b)):c&&c(!1,d,b)},d.plugins.FdbCompress=f,b.exports=f},{"./Shared":40,pako:83}],37:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("crypto-js"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a){if(!a||!a.pass)throw'Cannot initialise persistent storage encryption without a passphrase provided in the passed options object as the "pass" field.';this._algo=a.algo||"AES",this._pass=a.pass},d.mixin(f.prototype,"Mixin.Common"),d.synthesize(f.prototype,"pass"),f.prototype.stringify=function(a){var b={ct:a.ciphertext.toString(e.enc.Base64)};return a.iv&&(b.iv=a.iv.toString()),a.salt&&(b.s=a.salt.toString()),this.jStringify(b)},f.prototype.parse=function(a){var b=this.jParse(a),c=e.lib.CipherParams.create({ciphertext:e.enc.Base64.parse(b.ct)});return b.iv&&(c.iv=e.enc.Hex.parse(b.iv)),b.s&&(c.salt=e.enc.Hex.parse(b.s)),c},f.prototype.encode=function(a,b,c){var d,f=this,g={type:"fdbCrypto"};d=e[this._algo].encrypt(a,this._pass,{format:{stringify:function(){return f.stringify.apply(f,arguments)},parse:function(){return f.parse.apply(f,arguments)}}}),g.data=d.toString(),g.enabled=!0,b.encryption={enabled:g.enabled},c&&c(!1,this.jStringify(g),b)},f.prototype.decode=function(a,b,c){var d,f=this;a?(a=this.jParse(a),d=e[this._algo].decrypt(a.data,this._pass,{format:{stringify:function(){return f.stringify.apply(f,arguments)},parse:function(){return f.parse.apply(f,arguments)}}}).toString(e.enc.Utf8),c&&c(!1,d,b)):c&&c(!1,a,b)},d.plugins.FdbCrypto=f,b.exports=f},{"./Shared":40,"crypto-js":52}],38:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a,b,c){if(!(a&&b&&c))throw"ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!";if(this._reactorIn=a,this._reactorOut=b,this._chainHandler=c,!a.chain)throw"ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!";a.chain(this),this.chain(b)};d.addModule("ReactorIO",e),e.prototype.drop=function(){return this.isDropped()||(this._state="dropped",this._reactorIn&&this._reactorIn.unChain(this),this._reactorOut&&this.unChain(this._reactorOut),delete this._reactorIn,delete this._reactorOut,delete this._chainHandler,this.emit("drop",this),delete this._listeners),!0},d.synthesize(e.prototype,"state"),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),d.mixin(e.prototype,"Mixin.Events"),d.finishModule("ReactorIO"),b.exports=e},{"./Shared":40}],39:[function(a,b,c){"use strict";var d=function(){this.init.apply(this,arguments)};d.prototype.init=function(){var a=this;this._encoder=[],this._decoder=[],this.registerHandler("$date",function(a){return a instanceof Date?(a.toJSON=function(){return"$date:"+this.toISOString()},!0):!1},function(b){return"string"==typeof b&&0===b.indexOf("$date:")?a.convert(new Date(b.substr(6))):void 0}),this.registerHandler("$regexp",function(a){return a instanceof RegExp?(a.toJSON=function(){return"$regexp:"+this.source.length+":"+this.source+":"+(this.global?"g":"")+(this.ignoreCase?"i":"")},!0):!1},function(b){if("string"==typeof b&&0===b.indexOf("$regexp:")){var c=b.substr(8),d=c.indexOf(":"),e=Number(c.substr(0,d)),f=c.substr(d+1,e),g=c.substr(d+e+2);return a.convert(new RegExp(f,g))}})},d.prototype.registerHandler=function(a,b,c){void 0!==a&&(this._encoder.push(b),this._decoder.push(c))},d.prototype.convert=function(a){var b,c=this._encoder;for(b=0;b<c.length;b++)if(c[b](a))return a;return a},d.prototype.reviver=function(){var a=this._decoder;return function(b,c){var d,e;for(e=0;e<a.length;e++)if(d=a[e](c),void 0!==d)return d;return c}},b.exports=d},{}],40:[function(a,b,c){"use strict";var d=a("./Overload"),e={version:"1.3.819",modules:{},plugins:{},index:{},_synth:{},addModule:function(a,b){this.modules[a]=b,this.emit("moduleLoad",[a,b])},finishModule:function(a){if(!this.modules[a])throw"ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): "+a;this.modules[a]._fdbFinished=!0,this.modules[a].prototype?this.modules[a].prototype.className=a:this.modules[a].className=a,this.emit("moduleFinished",[a,this.modules[a]])},moduleFinished:function(a,b){this.modules[a]&&this.modules[a]._fdbFinished?b&&b(a,this.modules[a]):this.on("moduleFinished",b)},moduleExists:function(a){return Boolean(this.modules[a])},mixin:new d({"object, string":function(a,b){var c;if("string"==typeof b&&(c=this.mixins[b],!c))throw"ForerunnerDB.Shared: Cannot find mixin named: "+b;return this.$main.call(this,a,c)},"object, *":function(a,b){return this.$main.call(this,a,b)},$main:function(a,b){if(b&&"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}}),synthesize:function(a,b,c){if(this._synth[b]=this._synth[b]||function(a){return void 0!==a?(this["_"+b]=a,this):this["_"+b]},c){var d=this;a[b]=function(){var a,e=this.$super;return this.$super=d._synth[b],a=c.apply(this,arguments),this.$super=e,a}}else a[b]=this._synth[b]},overload:d,mixins:{"Mixin.Common":a("./Mixin.Common"),"Mixin.Events":a("./Mixin.Events"),"Mixin.ChainReactor":a("./Mixin.ChainReactor"),"Mixin.CRUD":a("./Mixin.CRUD"),"Mixin.Constants":a("./Mixin.Constants"),"Mixin.Triggers":a("./Mixin.Triggers"),"Mixin.Sorting":a("./Mixin.Sorting"),"Mixin.Matching":a("./Mixin.Matching"),"Mixin.Updating":a("./Mixin.Updating"),"Mixin.Tags":a("./Mixin.Tags")}};e.mixin(e,"Mixin.Events"),b.exports=e},{"./Mixin.CRUD":19,"./Mixin.ChainReactor":20,"./Mixin.Common":21,"./Mixin.Constants":22,"./Mixin.Events":23,"./Mixin.Matching":24,"./Mixin.Sorting":25,"./Mixin.Tags":26,"./Mixin.Triggers":27,"./Mixin.Updating":28,"./Overload":32}],41:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n=a("./Overload");d=a("./Shared");var o=function(a,b,c){this.init.apply(this,arguments)};d.addModule("View",o),d.mixin(o.prototype,"Mixin.Common"),d.mixin(o.prototype,"Mixin.Matching"),d.mixin(o.prototype,"Mixin.ChainReactor"),d.mixin(o.prototype,"Mixin.Constants"),d.mixin(o.prototype,"Mixin.Tags"),f=a("./Collection"),g=a("./CollectionGroup"),k=a("./ActiveBucket"),j=a("./ReactorIO"),h=f.prototype.init,e=d.modules.Db,i=e.prototype.init,l=d.modules.Path,m=new l,o.prototype.init=function(a,b,c){var d=this;this.sharedPathSolver=m,this._name=a,this._listeners={},this._querySettings={},this._debug={},this.query(b,c,!1),this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)},this._data=new f(this.name()+"_internal")},o.prototype._handleChainIO=function(a,b){var c,d,e,f,g=a.type;return"setData"!==g&&"insert"!==g&&"update"!==g&&"remove"!==g?!1:(c=Boolean(b._querySettings.options&&b._querySettings.options.$join),d=Boolean(b._querySettings.query),e=void 0!==b._data._transformIn,c||d||e?(f={dataArr:[],removeArr:[]},"insert"===a.type?a.data.dataSet instanceof Array?f.dataArr=a.data.dataSet:f.dataArr=[a.data.dataSet]:"update"===a.type?f.dataArr=a.data.dataSet:"remove"===a.type&&(a.data.dataSet instanceof Array?f.removeArr=a.data.dataSet:f.removeArr=[a.data.dataSet]),f.dataArr instanceof Array||(console.warn("WARNING: dataArr being processed by chain reactor in View class is inconsistent!"),f.dataArr=[]),f.removeArr instanceof Array||(console.warn("WARNING: removeArr being processed by chain reactor in View class is inconsistent!"),f.removeArr=[]),c&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_ActiveJoin"),b._handleChainIO_ActiveJoin(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_ActiveJoin")),d&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_ActiveQuery"),b._handleChainIO_ActiveQuery(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_ActiveQuery")),e&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_TransformIn"),b._handleChainIO_TransformIn(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_TransformIn")),f.dataArr.length||f.removeArr.length?(f.pk=b._data.primaryKey(),f.removeArr.length&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_RemovePackets"),b._handleChainIO_RemovePackets(this,a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_RemovePackets")),f.dataArr.length&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_UpsertPackets"),b._handleChainIO_UpsertPackets(this,a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_UpsertPackets")),!0):!0):!1)},o.prototype._handleChainIO_ActiveJoin=function(a,b){var c,d=b.dataArr;c=this.applyJoin(d,this._querySettings.options.$join,{},{}),this.spliceArrayByIndexList(d,c),b.removeArr=b.removeArr.concat(c)},o.prototype._handleChainIO_ActiveQuery=function(a,b){var c,d=this,e=b.dataArr;for(c=e.length-1;c>=0;c--)d._match(e[c],d._querySettings.query,d._querySettings.options,"and",{})||(b.removeArr.push(e[c]),e.splice(c,1))},o.prototype._handleChainIO_TransformIn=function(a,b){var c,d=this,e=b.dataArr,f=b.removeArr,g=d._data._transformIn;for(c=0;c<e.length;c++)e[c]=g(e[c]);for(c=0;c<f.length;c++)f[c]=g(f[c])},o.prototype._handleChainIO_RemovePackets=function(a,b,c){var d,e,f=[],g=c.pk,h=c.removeArr,i={dataSet:h,query:{$or:f}};for(e=0;e<h.length;e++)d={},d[g]=h[e][g],f.push(d);a.chainSend("remove",i)},o.prototype._handleChainIO_UpsertPackets=function(a,b,c){var d,e,f,g=this._data,h=g._primaryIndex,i=g._primaryCrc,j=c.pk,k=c.dataArr,l=[],m=[];for(f=0;f<k.length;f++)d=k[f],h.get(d[j])?i.get(d[j])!==this.hash(d[j])&&m.push(d):l.push(d);if(l.length&&a.chainSend("insert",{dataSet:l}),m.length)for(f=0;f<m.length;f++)d=m[f],e={},e[j]=d[j],a.chainSend("update",{query:e,update:d,dataSet:[d]})},o.prototype.insert=function(){this._from.insert.apply(this._from,arguments)},o.prototype.update=function(a,b,c,d){var e={$and:[this.query(),a]};this._from.update.call(this._from,e,b,c,d)},o.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)},o.prototype.remove=function(){this._from.remove.apply(this._from,arguments)},o.prototype.find=function(a,b){return this._data.find(a,b)},o.prototype.findOne=function(a,b){return this._data.findOne(a,b)},o.prototype.findById=function(a,b){return this._data.findById(a,b)},o.prototype.findSub=function(a,b,c,d){return this._data.findSub(a,b,c,d)},o.prototype.findSubOne=function(a,b,c,d){return this._data.findSubOne(a,b,c,d)},o.prototype.data=function(){return this._data},o.prototype.from=function(a,b){var c=this;if(void 0!==a){this._from&&(this._from.off("drop",this._collectionDroppedWrap),delete this._from),this._io&&(this._io.drop(),delete this._io),"string"==typeof a&&(a=this._db.collection(a)),"View"===a.className&&(a=a._data,this.debug()&&console.log(this.logIdentifier()+' Using internal data "'+a.instanceIdentifier()+'" for IO graph linking')),this._from=a,this._from.on("drop",this._collectionDroppedWrap),this._io=new j(this._from,this,function(a){return c._handleChainIO.call(this,a,c)}),this._data.primaryKey(a.primaryKey());var d=a.find(this._querySettings.query,this._querySettings.options);return this._data.setData(d,{},b),this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this}return this._from},o.prototype._chainHandler=function(a){var b,c,d,e,f,g,h,i;switch(this.debug()&&console.log(this.logIdentifier()+" Received chain reactor data: "+a.type),a.type){case"setData":this.debug()&&console.log(this.logIdentifier()+' Setting data in underlying (internal) view collection "'+this._data.name()+'"');var j=this._from.find(this._querySettings.query,this._querySettings.options);this._data.setData(j),this.rebuildActiveBucket(this._querySettings.options);break;case"insert":if(this.debug()&&console.log(this.logIdentifier()+' Inserting some data into underlying (internal) view collection "'+this._data.name()+'"'),a.data.dataSet=this.decouple(a.data.dataSet),a.data.dataSet instanceof Array||(a.data.dataSet=[a.data.dataSet]),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data.dataSet,c=b.length,d=0;c>d;d++)e=this._activeBucket.insert(b[d]),this._data._insertHandle(b[d],e);else e=this._data._data.length,this._data._insertHandle(a.data.dataSet,e);break;case"update":if(this.debug()&&console.log(this.logIdentifier()+' Updating some data in underlying (internal) view collection "'+this._data.name()+'"'),g=this._data.primaryKey(),f=this._data._handleUpdate(a.data.query,a.data.update,a.data.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(c=f.length,d=0;c>d;d++)h=f[d],this._activeBucket.remove(h),i=this._data._data.indexOf(h),e=this._activeBucket.insert(h),i!==e&&this._data._updateSpliceMove(this._data._data,i,e);break;case"remove":if(this.debug()&&console.log(this.logIdentifier()+' Removing some data from underlying (internal) view collection "'+this._data.name()+'"'),this._data.remove(a.data.query,a.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data.dataSet,c=b.length,d=0;c>d;d++)this._activeBucket.remove(b[d])}},o.prototype._collectionDropped=function(a){a&&delete this._from},o.prototype.ensureIndex=function(){return this._data.ensureIndex.apply(this._data,arguments)},o.prototype.on=function(){return this._data.on.apply(this._data,arguments)},o.prototype.off=function(){return this._data.off.apply(this._data,arguments)},o.prototype.emit=function(){return this._data.emit.apply(this._data,arguments)},o.prototype.deferEmit=function(){return this._data.deferEmit.apply(this._data,arguments)},o.prototype.distinct=function(a,b,c){return this._data.distinct(a,b,c)},o.prototype.primaryKey=function(){return this._data.primaryKey()},o.prototype.addTrigger=function(){return this._data.addTrigger.apply(this._data,arguments)},o.prototype.removeTrigger=function(){return this._data.removeTrigger.apply(this._data,arguments)},o.prototype.ignoreTriggers=function(){return this._data.ignoreTriggers.apply(this._data,arguments)},o.prototype.addLinkIO=function(){return this._data.addLinkIO.apply(this._data,arguments)},o.prototype.removeLinkIO=function(){return this._data.removeLinkIO.apply(this._data,arguments)},o.prototype.willTrigger=function(){return this._data.willTrigger.apply(this._data,arguments)},o.prototype.processTrigger=function(){return this._data.processTrigger.apply(this._data,arguments)},o.prototype._triggerIndexOf=function(){return this._data._triggerIndexOf.apply(this._data,arguments)},o.prototype.drop=function(a){return this.isDropped()?!1:(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeView(this)),(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._io&&this._io.drop(),this._data&&this._data.drop(),this._db&&this._name&&delete this._db._view[this._name],this.emit("drop",this),a&&a(!1,!0),delete this._chain,delete this._from,delete this._data,delete this._io,delete this._listeners,delete this._querySettings,delete this._db,!0)},o.prototype.queryData=function(a,b,c){return void 0!==a&&(this._querySettings.query=a,a.$findSub&&!a.$findSub.$from&&(a.$findSub.$from=this._data.name()),a.$findSubOne&&!a.$findSubOne.$from&&(a.$findSubOne.$from=this._data.name())),void 0!==b&&(this._querySettings.options=b),void 0===a&&void 0===b||void 0!==c&&c!==!0||this.refresh(),void 0!==a&&this.emit("queryChange",a),void 0!==b&&this.emit("queryOptionsChange",b),void 0!==a||void 0!==b?this:this._querySettings},o.prototype.queryAdd=function(a,b,c){this._querySettings.query=this._querySettings.query||{};var d,e=this._querySettings.query;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||void 0!==e[d]&&b!==!1)&&(e[d]=a[d]);void 0!==c&&c!==!0||this.refresh(),void 0!==e&&this.emit("queryChange",e)},o.prototype.queryRemove=function(a,b){var c,d=this._querySettings.query;if(d){if(void 0!==a)for(c in a)a.hasOwnProperty(c)&&delete d[c];void 0!==b&&b!==!0||this.refresh(),void 0!==d&&this.emit("queryChange",d)}},o.prototype.query=new n({"":function(){return this.decouple(this._querySettings.query)},object:function(a){return this.$main.call(this,a,void 0,!0)},"*, boolean":function(a,b){return this.$main.call(this,a,void 0,b)},"object, object":function(a,b){return this.$main.call(this,a,b,!0)},"*, *, boolean":function(a,b,c){return this.$main.call(this,a,b,c)},$main:function(a,b,c){return void 0!==a&&(this._querySettings.query=a,a.$findSub&&!a.$findSub.$from&&(a.$findSub.$from=this._data.name()),a.$findSubOne&&!a.$findSubOne.$from&&(a.$findSubOne.$from=this._data.name())),void 0!==b&&(this._querySettings.options=b),void 0===a&&void 0===b||void 0!==c&&c!==!0||this.refresh(),void 0!==a&&this.emit("queryChange",a),void 0!==b&&this.emit("queryOptionsChange",b),void 0!==a||void 0!==b?this:this.decouple(this._querySettings)}}),o.prototype.orderBy=function(a){if(void 0!==a){var b=this.queryOptions()||{};return b.$orderBy=a,this.queryOptions(b),this}return(this.queryOptions()||{}).$orderBy},o.prototype.page=function(a){if(void 0!==a){var b=this.queryOptions()||{};return a!==b.$page&&(b.$page=a,this.queryOptions(b)),this}return(this.queryOptions()||{}).$page},o.prototype.pageFirst=function(){return this.page(0)},o.prototype.pageLast=function(){var a=this.cursor().pages,b=void 0!==a?a:0;return this.page(b-1)},o.prototype.pageScan=function(a){if(void 0!==a){var b=this.cursor().pages,c=this.queryOptions()||{},d=void 0!==c.$page?c.$page:0;return d+=a,0>d&&(d=0),d>=b&&(d=b-1),this.page(d)}},o.prototype.queryOptions=function(a,b){return void 0!==a?(this._querySettings.options=a,void 0===a.$decouple&&(a.$decouple=!0),void 0===b||b===!0?this.refresh():this.rebuildActiveBucket(a.$orderBy),void 0!==a&&this.emit("queryOptionsChange",a),this):this._querySettings.options},o.prototype.rebuildActiveBucket=function(a){if(a){var b=this._data._data,c=b.length;this._activeBucket=new k(a),this._activeBucket.primaryKey(this._data.primaryKey());for(var d=0;c>d;d++)this._activeBucket.insert(b[d])}else delete this._activeBucket},o.prototype.refresh=function(){var a,b,c,d,e=this;if(this._from&&(this._data.remove(),a=this._from.find(this._querySettings.query,this._querySettings.options),this.cursor(a.$cursor),this._data.insert(a),this._data._data.$cursor=a.$cursor),this._querySettings&&this._querySettings.options&&this._querySettings.options.$join&&this._querySettings.options.$join.length){if(e.__joinChange=e.__joinChange||function(){e._joinChange()},this._joinCollections&&this._joinCollections.length)for(c=0;c<this._joinCollections.length;c++)this._db.collection(this._joinCollections[c]).off("immediateChange",e.__joinChange);for(b=this._querySettings.options.$join,this._joinCollections=[],c=0;c<b.length;c++)for(d in b[c])b[c].hasOwnProperty(d)&&this._joinCollections.push(d);
if(this._joinCollections.length)for(c=0;c<this._joinCollections.length;c++)this._db.collection(this._joinCollections[c]).on("immediateChange",e.__joinChange)}return this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this},o.prototype._joinChange=function(a,b){this.emit("joinChange"),this.refresh()},o.prototype.count=function(){return this._data.count.apply(this._data,arguments)},o.prototype.subset=function(){return this._data.subset.apply(this._data,arguments)},o.prototype.transform=function(a){var b,c;return b=this._data.transform(),this._data.transform(a),c=this._data.transform(),c.enabled&&c.dataIn&&(b.enabled!==c.enabled||b.dataIn!==c.dataIn)&&this.refresh(),c},o.prototype.filter=function(a,b,c){return this._data.filter(a,b,c)},o.prototype.data=function(){return this._data},o.prototype.indexOf=function(){return this._data.indexOf.apply(this._data,arguments)},d.synthesize(o.prototype,"db",function(a){return a&&(this._data.db(a),this.debug(a.debug()),this._data.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(o.prototype,"state"),d.synthesize(o.prototype,"name"),d.synthesize(o.prototype,"cursor",function(a){return void 0===a?this._cursor||{}:void this.$super.apply(this,arguments)}),f.prototype.init=function(){this._view=[],h.apply(this,arguments)},f.prototype.view=function(a,b,c){if(this._db&&this._db._view){if(this._db._view[a])throw this.logIdentifier()+" Cannot create a view using this collection because a view with this name already exists: "+a;var d=new o(a,b,c).db(this._db).from(this);return this._view=this._view||[],this._view.push(d),d}},f.prototype._addView=g.prototype._addView=function(a){return void 0!==a&&this._view.push(a),this},f.prototype._removeView=g.prototype._removeView=function(a){if(void 0!==a){var b=this._view.indexOf(a);b>-1&&this._view.splice(b,1)}return this},e.prototype.init=function(){this._view={},i.apply(this,arguments)},e.prototype.view=function(a){var b=this;return a instanceof o?a:this._view[a]?this._view[a]:((this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating view "+a),this._view[a]=new o(a).db(this),b.emit("create",b._view[a],"view",a),this._view[a])},e.prototype.viewExists=function(a){return Boolean(this._view[a])},e.prototype.views=function(){var a,b,c=[];for(b in this._view)this._view.hasOwnProperty(b)&&(a=this._view[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("View"),b.exports=o},{"./ActiveBucket":2,"./Collection":5,"./CollectionGroup":6,"./Overload":32,"./ReactorIO":38,"./Shared":40}],42:[function(a,b,c){(function(a){function c(){for(;e.next;){e=e.next;var a=e.task;e.task=void 0;var b=e.domain;b&&(e.domain=void 0,b.enter());try{a()}catch(d){if(i)throw b&&b.exit(),setTimeout(c,0),b&&b.enter(),d;setTimeout(function(){throw d},0)}b&&b.exit()}g=!1}function d(b){f=f.next={task:b,domain:i&&a.domain,next:null},g||(g=!0,h())}var e={task:void 0,next:null},f=e,g=!1,h=void 0,i=!1;if("undefined"!=typeof a&&a.nextTick)i=!0,h=function(){a.nextTick(c)};else if("function"==typeof setImmediate)h="undefined"!=typeof window?setImmediate.bind(window,c):function(){setImmediate(c)};else if("undefined"!=typeof MessageChannel){var j=new MessageChannel;j.port1.onmessage=c,h=function(){j.port2.postMessage(0)}}else h=function(){setTimeout(c,0)};b.exports=d}).call(this,a("_process"))},{_process:99}],43:[function(a,b,c){(function(a,c){!function(){function d(){}function e(a){return a}function f(a){return!!a}function g(a){return!a}function h(a){return function(){if(null===a)throw new Error("Callback was already called.");a.apply(this,arguments),a=null}}function i(a){return function(){null!==a&&(a.apply(this,arguments),a=null)}}function j(a){return N(a)||"number"==typeof a.length&&a.length>=0&&a.length%1===0}function k(a,b){for(var c=-1,d=a.length;++c<d;)b(a[c],c,a)}function l(a,b){for(var c=-1,d=a.length,e=Array(d);++c<d;)e[c]=b(a[c],c,a);return e}function m(a){return l(Array(a),function(a,b){return b})}function n(a,b,c){return k(a,function(a,d,e){c=b(c,a,d,e)}),c}function o(a,b){k(P(a),function(c){b(a[c],c)})}function p(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function q(a){var b,c,d=-1;return j(a)?(b=a.length,function(){return d++,b>d?d:null}):(c=P(a),b=c.length,function(){return d++,b>d?c[d]:null})}function r(a,b){return b=null==b?a.length-1:+b,function(){for(var c=Math.max(arguments.length-b,0),d=Array(c),e=0;c>e;e++)d[e]=arguments[e+b];switch(b){case 0:return a.call(this,d);case 1:return a.call(this,arguments[0],d)}}}function s(a){return function(b,c,d){return a(b,d)}}function t(a){return function(b,c,e){e=i(e||d),b=b||[];var f=q(b);if(0>=a)return e(null);var g=!1,j=0,k=!1;!function l(){if(g&&0>=j)return e(null);for(;a>j&&!k;){var d=f();if(null===d)return g=!0,void(0>=j&&e(null));j+=1,c(b[d],d,h(function(a){j-=1,a?(e(a),k=!0):l()}))}}()}}function u(a){return function(b,c,d){return a(K.eachOf,b,c,d)}}function v(a){return function(b,c,d,e){return a(t(c),b,d,e)}}function w(a){return function(b,c,d){return a(K.eachOfSeries,b,c,d)}}function x(a,b,c,e){e=i(e||d),b=b||[];var f=j(b)?[]:{};a(b,function(a,b,d){c(a,function(a,c){f[b]=c,d(a)})},function(a){e(a,f)})}function y(a,b,c,d){var e=[];a(b,function(a,b,d){c(a,function(c){c&&e.push({index:b,value:a}),d()})},function(){d(l(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})}function z(a,b,c,d){y(a,b,function(a,b){c(a,function(a){b(!a)})},d)}function A(a,b,c){return function(d,e,f,g){function h(){g&&g(c(!1,void 0))}function i(a,d,e){return g?void f(a,function(d){g&&b(d)&&(g(c(!0,a)),g=f=!1),e()}):e()}arguments.length>3?a(d,e,i,h):(g=f,f=e,a(d,i,h))}}function B(a,b){return b}function C(a,b,c){c=c||d;var e=j(b)?[]:{};a(b,function(a,b,c){a(r(function(a,d){d.length<=1&&(d=d[0]),e[b]=d,c(a)}))},function(a){c(a,e)})}function D(a,b,c,d){var e=[];a(b,function(a,b,d){c(a,function(a,b){e=e.concat(b||[]),d(a)})},function(a){d(a,e)})}function E(a,b,c){function e(a,b,c,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");return a.started=!0,N(b)||(b=[b]),0===b.length&&a.idle()?K.setImmediate(function(){a.drain()}):(k(b,function(b){var f={data:b,callback:e||d};c?a.tasks.unshift(f):a.tasks.push(f),a.tasks.length===a.concurrency&&a.saturated()}),void K.setImmediate(a.process))}function f(a,b){return function(){g-=1;var c=!1,d=arguments;k(b,function(a){k(i,function(b,d){b!==a||c||(i.splice(d,1),c=!0)}),a.callback.apply(a,d)}),a.tasks.length+g===0&&a.drain(),a.process()}}if(null==b)b=1;else if(0===b)throw new Error("Concurrency must not be zero");var g=0,i=[],j={tasks:[],concurrency:b,payload:c,saturated:d,empty:d,drain:d,started:!1,paused:!1,push:function(a,b){e(j,a,!1,b)},kill:function(){j.drain=d,j.tasks=[]},unshift:function(a,b){e(j,a,!0,b)},process:function(){for(;!j.paused&&g<j.concurrency&&j.tasks.length;){var b=j.payload?j.tasks.splice(0,j.payload):j.tasks.splice(0,j.tasks.length),c=l(b,function(a){return a.data});0===j.tasks.length&&j.empty(),g+=1,i.push(b[0]);var d=h(f(j,b));a(c,d)}},length:function(){return j.tasks.length},running:function(){return g},workersList:function(){return i},idle:function(){return j.tasks.length+g===0},pause:function(){j.paused=!0},resume:function(){if(j.paused!==!1){j.paused=!1;for(var a=Math.min(j.concurrency,j.tasks.length),b=1;a>=b;b++)K.setImmediate(j.process)}}};return j}function F(a){return r(function(b,c){b.apply(null,c.concat([r(function(b,c){"object"==typeof console&&(b?console.error&&console.error(b):console[a]&&k(c,function(b){console[a](b)}))})]))})}function G(a){return function(b,c,d){a(m(b),c,d)}}function H(a){return r(function(b,c){var d=r(function(c){var d=this,e=c.pop();return a(b,function(a,b,e){a.apply(d,c.concat([e]))},e)});return c.length?d.apply(this,c):d})}function I(a){return r(function(b){var c=b.pop();b.push(function(){var a=arguments;d?K.setImmediate(function(){c.apply(null,a)}):c.apply(null,a)});var d=!0;a.apply(this,b),d=!1})}var J,K={},L="object"==typeof self&&self.self===self&&self||"object"==typeof c&&c.global===c&&c||this;null!=L&&(J=L.async),K.noConflict=function(){return L.async=J,K};var M=Object.prototype.toString,N=Array.isArray||function(a){return"[object Array]"===M.call(a)},O=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},P=Object.keys||function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},Q="function"==typeof setImmediate&&setImmediate,R=Q?function(a){Q(a)}:function(a){setTimeout(a,0)};"object"==typeof a&&"function"==typeof a.nextTick?K.nextTick=a.nextTick:K.nextTick=R,K.setImmediate=Q?R:K.nextTick,K.forEach=K.each=function(a,b,c){return K.eachOf(a,s(b),c)},K.forEachSeries=K.eachSeries=function(a,b,c){return K.eachOfSeries(a,s(b),c)},K.forEachLimit=K.eachLimit=function(a,b,c,d){return t(b)(a,s(c),d)},K.forEachOf=K.eachOf=function(a,b,c){function e(a){j--,a?c(a):null===f&&0>=j&&c(null)}c=i(c||d),a=a||[];for(var f,g=q(a),j=0;null!=(f=g());)j+=1,b(a[f],f,h(e));0===j&&c(null)},K.forEachOfSeries=K.eachOfSeries=function(a,b,c){function e(){var d=!0;return null===g?c(null):(b(a[g],g,h(function(a){if(a)c(a);else{if(g=f(),null===g)return c(null);d?K.setImmediate(e):e()}})),void(d=!1))}c=i(c||d),a=a||[];var f=q(a),g=f();e()},K.forEachOfLimit=K.eachOfLimit=function(a,b,c,d){t(b)(a,c,d)},K.map=u(x),K.mapSeries=w(x),K.mapLimit=v(x),K.inject=K.foldl=K.reduce=function(a,b,c,d){K.eachOfSeries(a,function(a,d,e){c(b,a,function(a,c){b=c,e(a)})},function(a){d(a,b)})},K.foldr=K.reduceRight=function(a,b,c,d){var f=l(a,e).reverse();K.reduce(f,b,c,d)},K.transform=function(a,b,c,d){3===arguments.length&&(d=c,c=b,b=N(a)?[]:{}),K.eachOf(a,function(a,d,e){c(b,a,d,e)},function(a){d(a,b)})},K.select=K.filter=u(y),K.selectLimit=K.filterLimit=v(y),K.selectSeries=K.filterSeries=w(y),K.reject=u(z),K.rejectLimit=v(z),K.rejectSeries=w(z),K.any=K.some=A(K.eachOf,f,e),K.someLimit=A(K.eachOfLimit,f,e),K.all=K.every=A(K.eachOf,g,g),K.everyLimit=A(K.eachOfLimit,g,g),K.detect=A(K.eachOf,e,B),K.detectSeries=A(K.eachOfSeries,e,B),K.detectLimit=A(K.eachOfLimit,e,B),K.sortBy=function(a,b,c){function d(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0}K.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){return a?c(a):void c(null,l(b.sort(d),function(a){return a.value}))})},K.auto=function(a,b,c){function e(a){s.unshift(a)}function f(a){var b=p(s,a);b>=0&&s.splice(b,1)}function g(){j--,k(s.slice(0),function(a){a()})}"function"==typeof arguments[1]&&(c=b,b=null),c=i(c||d);var h=P(a),j=h.length;if(!j)return c(null);b||(b=j);var l={},m=0,q=!1,s=[];e(function(){j||c(null,l)}),k(h,function(d){function h(){return b>m&&n(t,function(a,b){return a&&l.hasOwnProperty(b)},!0)&&!l.hasOwnProperty(d)}function i(){h()&&(m++,f(i),k[k.length-1](s,l))}if(!q){for(var j,k=N(a[d])?a[d]:[a[d]],s=r(function(a,b){if(m--,b.length<=1&&(b=b[0]),a){var e={};o(l,function(a,b){e[b]=a}),e[d]=b,q=!0,c(a,e)}else l[d]=b,K.setImmediate(g)}),t=k.slice(0,k.length-1),u=t.length;u--;){if(!(j=a[t[u]]))throw new Error("Has nonexistent dependency in "+t.join(", "));if(N(j)&&p(j,d)>=0)throw new Error("Has cyclic dependencies")}h()?(m++,k[k.length-1](s,l)):e(i)}})},K.retry=function(a,b,c){function d(a,b){if("number"==typeof b)a.times=parseInt(b,10)||f;else{if("object"!=typeof b)throw new Error("Unsupported argument type for 'times': "+typeof b);a.times=parseInt(b.times,10)||f,a.interval=parseInt(b.interval,10)||g}}function e(a,b){function c(a,c){return function(d){a(function(a,b){d(!a||c,{err:a,result:b})},b)}}function d(a){return function(b){setTimeout(function(){b(null)},a)}}for(;i.times;){var e=!(i.times-=1);h.push(c(i.task,e)),!e&&i.interval>0&&h.push(d(i.interval))}K.series(h,function(b,c){c=c[c.length-1],(a||i.callback)(c.err,c.result)})}var f=5,g=0,h=[],i={times:f,interval:g},j=arguments.length;if(1>j||j>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=j&&"function"==typeof a&&(c=b,b=a),"function"!=typeof a&&d(i,a),i.callback=c,i.task=b,i.callback?e():e},K.waterfall=function(a,b){function c(a){return r(function(d,e){if(d)b.apply(null,[d].concat(e));else{var f=a.next();f?e.push(c(f)):e.push(b),I(a).apply(null,e)}})}if(b=i(b||d),!N(a)){var e=new Error("First argument to waterfall must be an array of functions");return b(e)}return a.length?void c(K.iterator(a))():b()},K.parallel=function(a,b){C(K.eachOf,a,b)},K.parallelLimit=function(a,b,c){C(t(b),a,c)},K.series=function(a,b){C(K.eachOfSeries,a,b)},K.iterator=function(a){function b(c){function d(){return a.length&&a[c].apply(null,arguments),d.next()}return d.next=function(){return c<a.length-1?b(c+1):null},d}return b(0)},K.apply=r(function(a,b){return r(function(c){return a.apply(null,b.concat(c))})}),K.concat=u(D),K.concatSeries=w(D),K.whilst=function(a,b,c){if(c=c||d,a()){var e=r(function(d,f){d?c(d):a.apply(this,f)?b(e):c.apply(null,[null].concat(f))});b(e)}else c(null)},K.doWhilst=function(a,b,c){var d=0;return K.whilst(function(){return++d<=1||b.apply(this,arguments)},a,c)},K.until=function(a,b,c){return K.whilst(function(){return!a.apply(this,arguments)},b,c)},K.doUntil=function(a,b,c){return K.doWhilst(a,function(){return!b.apply(this,arguments)},c)},K.during=function(a,b,c){c=c||d;var e=r(function(b,d){b?c(b):(d.push(f),a.apply(this,d))}),f=function(a,d){a?c(a):d?b(e):c(null)};a(f)},K.doDuring=function(a,b,c){var d=0;K.during(function(a){d++<1?a(null,!0):b.apply(this,arguments)},a,c)},K.queue=function(a,b){var c=E(function(b,c){a(b[0],c)},b,1);return c},K.priorityQueue=function(a,b){function c(a,b){return a.priority-b.priority}function e(a,b,c){for(var d=-1,e=a.length-1;e>d;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function f(a,b,f,g){if(null!=g&&"function"!=typeof g)throw new Error("task callback must be a function");return a.started=!0,N(b)||(b=[b]),0===b.length?K.setImmediate(function(){a.drain()}):void k(b,function(b){var h={data:b,priority:f,callback:"function"==typeof g?g:d};a.tasks.splice(e(a.tasks,h,c)+1,0,h),a.tasks.length===a.concurrency&&a.saturated(),K.setImmediate(a.process)})}var g=K.queue(a,b);return g.push=function(a,b,c){f(g,a,b,c)},delete g.unshift,g},K.cargo=function(a,b){return E(a,1,b)},K.log=F("log"),K.dir=F("dir"),K.memoize=function(a,b){var c={},d={},f=Object.prototype.hasOwnProperty;b=b||e;var g=r(function(e){var g=e.pop(),h=b.apply(null,e);f.call(c,h)?K.setImmediate(function(){g.apply(null,c[h])}):f.call(d,h)?d[h].push(g):(d[h]=[g],a.apply(null,e.concat([r(function(a){c[h]=a;var b=d[h];delete d[h];for(var e=0,f=b.length;f>e;e++)b[e].apply(null,a)})])))});return g.memo=c,g.unmemoized=a,g},K.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},K.times=G(K.map),K.timesSeries=G(K.mapSeries),K.timesLimit=function(a,b,c,d){return K.mapLimit(m(a),b,c,d)},K.seq=function(){var a=arguments;return r(function(b){var c=this,e=b[b.length-1];"function"==typeof e?b.pop():e=d,K.reduce(a,b,function(a,b,d){b.apply(c,a.concat([r(function(a,b){d(a,b)})]))},function(a,b){e.apply(c,[a].concat(b))})})},K.compose=function(){return K.seq.apply(null,Array.prototype.reverse.call(arguments))},K.applyEach=H(K.eachOf),K.applyEachSeries=H(K.eachOfSeries),K.forever=function(a,b){function c(a){return a?e(a):void f(c)}var e=h(b||d),f=I(a);c()},K.ensureAsync=I,K.constant=r(function(a){var b=[null].concat(a);return function(a){return a.apply(this,b)}}),K.wrapSync=K.asyncify=function(a){return r(function(b){var c,d=b.pop();try{c=a.apply(this,b)}catch(e){return d(e)}O(c)&&"function"==typeof c.then?c.then(function(a){d(null,a)})["catch"](function(a){d(a.message?a:new Error(a))}):d(null,c)})},"object"==typeof b&&b.exports?b.exports=K:"function"==typeof define&&define.amd?define([],function(){return K}):L.async=K}()}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:99}],44:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.BlockCipher,e=b.algo,f=[],g=[],h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=[];!function(){for(var a=[],b=0;256>b;b++)128>b?a[b]=b<<1:a[b]=b<<1^283;for(var c=0,d=0,b=0;256>b;b++){var e=d^d<<1^d<<2^d<<3^d<<4;e=e>>>8^255&e^99,f[c]=e,g[e]=c;var p=a[c],q=a[p],r=a[q],s=257*a[e]^16843008*e;h[c]=s<<24|s>>>8,i[c]=s<<16|s>>>16,j[c]=s<<8|s>>>24,k[c]=s;var s=16843009*r^65537*q^257*p^16843008*c;l[e]=s<<24|s>>>8,m[e]=s<<16|s>>>16,n[e]=s<<8|s>>>24,o[e]=s,c?(c=p^a[a[a[r^p]]],d^=a[a[d]]):c=d=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],q=e.AES=d.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes/4,d=this._nRounds=c+6,e=4*(d+1),g=this._keySchedule=[],h=0;e>h;h++)if(c>h)g[h]=b[h];else{var i=g[h-1];h%c?c>6&&h%c==4&&(i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i]):(i=i<<8|i>>>24,i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i],i^=p[h/c|0]<<24),g[h]=g[h-c]^i}for(var j=this._invKeySchedule=[],k=0;e>k;k++){var h=e-k;if(k%4)var i=g[h];else var i=g[h-4];4>k||4>=h?j[k]=i:j[k]=l[f[i>>>24]]^m[f[i>>>16&255]]^n[f[i>>>8&255]]^o[f[255&i]]}},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,h,i,j,k,f)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c,this._doCryptBlock(a,b,this._invKeySchedule,l,m,n,o,g);var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c},_doCryptBlock:function(a,b,c,d,e,f,g,h){for(var i=this._nRounds,j=a[b]^c[0],k=a[b+1]^c[1],l=a[b+2]^c[2],m=a[b+3]^c[3],n=4,o=1;i>o;o++){var p=d[j>>>24]^e[k>>>16&255]^f[l>>>8&255]^g[255&m]^c[n++],q=d[k>>>24]^e[l>>>16&255]^f[m>>>8&255]^g[255&j]^c[n++],r=d[l>>>24]^e[m>>>16&255]^f[j>>>8&255]^g[255&k]^c[n++],s=d[m>>>24]^e[j>>>16&255]^f[k>>>8&255]^g[255&l]^c[n++];j=p,k=q,l=r,m=s}var p=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[255&m])^c[n++],q=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[255&j])^c[n++],r=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[255&k])^c[n++],s=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[255&l])^c[n++];a[b]=p,a[b+1]=q,a[b+2]=r,a[b+3]=s},keySize:8});b.AES=d._createHelper(q)}(),a.AES})},{"./cipher-core":45,"./core":46,"./enc-base64":47,"./evpkdf":49,"./md5":54}],45:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){a.lib.Cipher||function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=d.BufferedBlockAlgorithm,h=c.enc,i=(h.Utf8,h.Base64),j=c.algo,k=j.EvpKDF,l=d.Cipher=g.extend({cfg:e.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c),this._xformMode=a,this._key=b,this.reset()},reset:function(){g.reset.call(this),this._doReset()},process:function(a){return this._append(a),this._process()},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function a(a){return"string"==typeof a?x:u}return function(b){return{encrypt:function(c,d,e){return a(d).encrypt(b,c,d,e)},decrypt:function(c,d,e){return a(d).decrypt(b,c,d,e)}}}}()}),m=(d.StreamCipher=l.extend({_doFinalize:function(){var a=this._process(!0);return a},blockSize:1}),c.mode={}),n=d.BlockCipherMode=e.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a,this._iv=b}}),o=m.CBC=function(){function a(a,c,d){var e=this._iv;if(e){var f=e;this._iv=b}else var f=this._prevBlock;for(var g=0;d>g;g++)a[c+g]^=f[g]}var c=n.extend();return c.Encryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize;a.call(this,b,c,e),d.encryptBlock(b,c),this._prevBlock=b.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize,f=b.slice(c,c+e);d.decryptBlock(b,c),a.call(this,b,c,e),this._prevBlock=f}}),c}(),p=c.pad={},q=p.Pkcs7={pad:function(a,b){for(var c=4*b,d=c-a.sigBytes%c,e=d<<24|d<<16|d<<8|d,g=[],h=0;d>h;h+=4)g.push(e);var i=f.create(g,d);a.concat(i)},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},r=(d.BlockCipher=l.extend({cfg:l.cfg.extend({mode:o,padding:q}),reset:function(){l.reset.call(this);var a=this.cfg,b=a.iv,c=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=c.createEncryptor;else{var d=c.createDecryptor;this._minBufferSize=1}this._mode=d.call(c,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else{var b=this._process(!0);a.unpad(b)}return b},blockSize:4}),d.CipherParams=e.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}})),s=c.format={},t=s.OpenSSL={stringify:function(a){var b=a.ciphertext,c=a.salt;if(c)var d=f.create([1398893684,1701076831]).concat(c).concat(b);else var d=b;return d.toString(i)},parse:function(a){var b=i.parse(a),c=b.words;if(1398893684==c[0]&&1701076831==c[1]){var d=f.create(c.slice(2,4));c.splice(0,4),b.sigBytes-=16}return r.create({ciphertext:b,salt:d})}},u=d.SerializableCipher=e.extend({cfg:e.extend({format:t}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d),f=e.finalize(b),g=e.cfg;return r.create({ciphertext:f,key:c,iv:g.iv,algorithm:a,mode:g.mode,padding:g.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=a.createDecryptor(c,d).finalize(b.ciphertext);return e},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),v=c.kdf={},w=v.OpenSSL={execute:function(a,b,c,d){d||(d=f.random(8));var e=k.create({keySize:b+c}).compute(a,d),g=f.create(e.words.slice(b),4*c);return e.sigBytes=4*b,r.create({key:e,iv:g,salt:d})}},x=d.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:w}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=e.iv;var f=u.encrypt.call(this,a,b,e.key,d);return f.mixIn(e),f},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=e.iv;var f=u.decrypt.call(this,a,b,e.key,d);return f}})}()})},{"./core":46}],46:[function(a,b,c){!function(a,d){"object"==typeof c?b.exports=c=d():"function"==typeof define&&define.amd?define([],d):a.CryptoJS=d()}(this,function(){var a=a||function(a,b){var c={},d=c.lib={},e=d.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;return b&&c.mixIn(b),c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)}),c.init.prototype=c,c.$super=this,c},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=d.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;e>f;f++){var g=c[f>>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;e>f;f+=4)b[d+f>>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=e.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c,d=[],e=function(b){var b=b,c=987654321,d=4294967295;return function(){c=36969*(65535&c)+(c>>16)&d,b=18e3*(65535&b)+(b>>16)&d;var e=(c<<16)+b&d;return e/=4294967296,e+=.5,e*(a.random()>.5?1:-1)}},g=0;b>g;g+=4){var h=e(4294967296*(c||a.random()));c=987654071*h(),d.push(4294967296*h()|0)}return new f.init(d,b)}}),g=c.enc={},h=g.Hex={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new f.init(c,b/2)}},i=g.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new f.init(c,b)}},j=g.Utf8={stringify:function(a){try{return decodeURIComponent(escape(i.stringify(a)))}catch(b){throw new Error("Malformed UTF-8 data")}},parse:function(a){return i.parse(unescape(encodeURIComponent(a)))}},k=d.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,g=this.blockSize,h=4*g,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*g,k=a.min(4*j,e);if(j){for(var l=0;j>l;l+=g)this._doProcessBlock(d,l);var m=d.splice(0,j);c.sigBytes-=k}return new f.init(m,k)},clone:function(){var a=e.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),l=(d.Hasher=k.extend({cfg:e.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){k.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new l.HMAC.init(a,c).finalize(b)}}}),c.algo={});return c}(Math);return a})},{}],47:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=b.enc;e.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp();for(var e=[],f=0;c>f;f+=3)for(var g=b[f>>>2]>>>24-f%4*8&255,h=b[f+1>>>2]>>>24-(f+1)%4*8&255,i=b[f+2>>>2]>>>24-(f+2)%4*8&255,j=g<<16|h<<8|i,k=0;4>k&&c>f+.75*k;k++)e.push(d.charAt(j>>>6*(3-k)&63));var l=d.charAt(64);if(l)for(;e.length%4;)e.push(l);return e.join("")},parse:function(a){var b=a.length,c=this._map,e=c.charAt(64);if(e){var f=a.indexOf(e);-1!=f&&(b=f)}for(var g=[],h=0,i=0;b>i;i++)if(i%4){var j=c.indexOf(a.charAt(i-1))<<i%4*2,k=c.indexOf(a.charAt(i))>>>6-i%4*2,l=j|k;g[h>>>2]|=l<<24-h%4*8,h++}return d.create(g,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),a.enc.Base64})},{"./core":46}],48:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a){return a<<8&4278255360|a>>>8&16711935}var c=a,d=c.lib,e=d.WordArray,f=c.enc;f.Utf16=f.Utf16BE={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e+=2){var f=b[e>>>2]>>>16-e%4*8&65535;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>1]|=a.charCodeAt(d)<<16-d%2*16;return e.create(c,2*b)}};f.Utf16LE={stringify:function(a){for(var c=a.words,d=a.sigBytes,e=[],f=0;d>f;f+=2){var g=b(c[f>>>2]>>>16-f%4*8&65535);e.push(String.fromCharCode(g))}return e.join("")},parse:function(a){for(var c=a.length,d=[],f=0;c>f;f++)d[f>>>1]|=b(a.charCodeAt(f)<<16-f%2*16);return e.create(d,2*c)}}}(),a.enc.Utf16})},{"./core":46}],49:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.MD5,h=f.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),f=e.create(),g=f.words,h=c.keySize,i=c.iterations;g.length<h;){j&&d.update(j);var j=d.update(a).finalize(b);d.reset();for(var k=1;i>k;k++)j=d.finalize(j),d.reset();f.concat(j)}return f.sigBytes=4*h,f}});b.EvpKDF=function(a,b,c){return h.create(c).compute(a,b)}}(),a.EvpKDF})},{"./core":46,"./hmac":51,"./sha1":70}],50:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.CipherParams,f=c.enc,g=f.Hex,h=c.format;h.Hex={stringify:function(a){return a.ciphertext.toString(g)},parse:function(a){var b=g.parse(a);return e.create({ciphertext:b})}}}(),a.format.Hex})},{"./cipher-core":45,"./core":46}],51:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){!function(){var b=a,c=b.lib,d=c.Base,e=b.enc,f=e.Utf8,g=b.algo;g.HMAC=d.extend({init:function(a,b){a=this._hasher=new a.init,"string"==typeof b&&(b=f.parse(b));var c=a.blockSize,d=4*c;b.sigBytes>d&&(b=a.finalize(b)),b.clamp();for(var e=this._oKey=b.clone(),g=this._iKey=b.clone(),h=e.words,i=g.words,j=0;c>j;j++)h[j]^=1549556828,i[j]^=909522486;e.sigBytes=g.sigBytes=d,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher,c=b.finalize(a);b.reset();var d=b.finalize(this._oKey.clone().concat(c));return d}})}()})},{"./core":46}],52:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./lib-typedarrays"),a("./enc-utf16"),a("./enc-base64"),a("./md5"),a("./sha1"),a("./sha256"),a("./sha224"),a("./sha512"),a("./sha384"),a("./sha3"),a("./ripemd160"),a("./hmac"),a("./pbkdf2"),a("./evpkdf"),a("./cipher-core"),a("./mode-cfb"),a("./mode-ctr"),a("./mode-ctr-gladman"),a("./mode-ofb"),a("./mode-ecb"),a("./pad-ansix923"),a("./pad-iso10126"),a("./pad-iso97971"),a("./pad-zeropadding"),a("./pad-nopadding"),a("./format-hex"),a("./aes"),a("./tripledes"),a("./rc4"),a("./rabbit"),a("./rabbit-legacy")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],e):d.CryptoJS=e(d.CryptoJS)}(this,function(a){return a})},{"./aes":44,"./cipher-core":45,"./core":46,"./enc-base64":47,"./enc-utf16":48,"./evpkdf":49,"./format-hex":50,"./hmac":51,"./lib-typedarrays":53,"./md5":54,"./mode-cfb":55,"./mode-ctr":57,"./mode-ctr-gladman":56,"./mode-ecb":58,"./mode-ofb":59,"./pad-ansix923":60,"./pad-iso10126":61,"./pad-iso97971":62,"./pad-nopadding":63,"./pad-zeropadding":64,"./pbkdf2":65,"./rabbit":67,"./rabbit-legacy":66,"./rc4":68,"./ripemd160":69,"./sha1":70,"./sha224":71,"./sha256":72,"./sha3":73,"./sha384":74,"./sha512":75,"./tripledes":76,"./x64-core":77}],53:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS);
}(this,function(a){return function(){if("function"==typeof ArrayBuffer){var b=a,c=b.lib,d=c.WordArray,e=d.init,f=d.init=function(a){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var b=a.byteLength,c=[],d=0;b>d;d++)c[d>>>2]|=a[d]<<24-d%4*8;e.call(this,c,b)}else e.apply(this,arguments)};f.prototype=d}}(),a.lib.WordArray})},{"./core":46}],54:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c,d,e,f,g){var h=a+(b&c|~b&d)+e+g;return(h<<f|h>>>32-f)+b}function d(a,b,c,d,e,f,g){var h=a+(b&d|c&~d)+e+g;return(h<<f|h>>>32-f)+b}function e(a,b,c,d,e,f,g){var h=a+(b^c^d)+e+g;return(h<<f|h>>>32-f)+b}function f(a,b,c,d,e,f,g){var h=a+(c^(b|~d))+e+g;return(h<<f|h>>>32-f)+b}var g=a,h=g.lib,i=h.WordArray,j=h.Hasher,k=g.algo,l=[];!function(){for(var a=0;64>a;a++)l[a]=4294967296*b.abs(b.sin(a+1))|0}();var m=k.MD5=j.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(a,b){for(var g=0;16>g;g++){var h=b+g,i=a[h];a[h]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var j=this._hash.words,k=a[b+0],m=a[b+1],n=a[b+2],o=a[b+3],p=a[b+4],q=a[b+5],r=a[b+6],s=a[b+7],t=a[b+8],u=a[b+9],v=a[b+10],w=a[b+11],x=a[b+12],y=a[b+13],z=a[b+14],A=a[b+15],B=j[0],C=j[1],D=j[2],E=j[3];B=c(B,C,D,E,k,7,l[0]),E=c(E,B,C,D,m,12,l[1]),D=c(D,E,B,C,n,17,l[2]),C=c(C,D,E,B,o,22,l[3]),B=c(B,C,D,E,p,7,l[4]),E=c(E,B,C,D,q,12,l[5]),D=c(D,E,B,C,r,17,l[6]),C=c(C,D,E,B,s,22,l[7]),B=c(B,C,D,E,t,7,l[8]),E=c(E,B,C,D,u,12,l[9]),D=c(D,E,B,C,v,17,l[10]),C=c(C,D,E,B,w,22,l[11]),B=c(B,C,D,E,x,7,l[12]),E=c(E,B,C,D,y,12,l[13]),D=c(D,E,B,C,z,17,l[14]),C=c(C,D,E,B,A,22,l[15]),B=d(B,C,D,E,m,5,l[16]),E=d(E,B,C,D,r,9,l[17]),D=d(D,E,B,C,w,14,l[18]),C=d(C,D,E,B,k,20,l[19]),B=d(B,C,D,E,q,5,l[20]),E=d(E,B,C,D,v,9,l[21]),D=d(D,E,B,C,A,14,l[22]),C=d(C,D,E,B,p,20,l[23]),B=d(B,C,D,E,u,5,l[24]),E=d(E,B,C,D,z,9,l[25]),D=d(D,E,B,C,o,14,l[26]),C=d(C,D,E,B,t,20,l[27]),B=d(B,C,D,E,y,5,l[28]),E=d(E,B,C,D,n,9,l[29]),D=d(D,E,B,C,s,14,l[30]),C=d(C,D,E,B,x,20,l[31]),B=e(B,C,D,E,q,4,l[32]),E=e(E,B,C,D,t,11,l[33]),D=e(D,E,B,C,w,16,l[34]),C=e(C,D,E,B,z,23,l[35]),B=e(B,C,D,E,m,4,l[36]),E=e(E,B,C,D,p,11,l[37]),D=e(D,E,B,C,s,16,l[38]),C=e(C,D,E,B,v,23,l[39]),B=e(B,C,D,E,y,4,l[40]),E=e(E,B,C,D,k,11,l[41]),D=e(D,E,B,C,o,16,l[42]),C=e(C,D,E,B,r,23,l[43]),B=e(B,C,D,E,u,4,l[44]),E=e(E,B,C,D,x,11,l[45]),D=e(D,E,B,C,A,16,l[46]),C=e(C,D,E,B,n,23,l[47]),B=f(B,C,D,E,k,6,l[48]),E=f(E,B,C,D,s,10,l[49]),D=f(D,E,B,C,z,15,l[50]),C=f(C,D,E,B,q,21,l[51]),B=f(B,C,D,E,x,6,l[52]),E=f(E,B,C,D,o,10,l[53]),D=f(D,E,B,C,v,15,l[54]),C=f(C,D,E,B,m,21,l[55]),B=f(B,C,D,E,t,6,l[56]),E=f(E,B,C,D,A,10,l[57]),D=f(D,E,B,C,r,15,l[58]),C=f(C,D,E,B,y,21,l[59]),B=f(B,C,D,E,p,6,l[60]),E=f(E,B,C,D,w,10,l[61]),D=f(D,E,B,C,n,15,l[62]),C=f(C,D,E,B,u,21,l[63]),j[0]=j[0]+B|0,j[1]=j[1]+C|0,j[2]=j[2]+D|0,j[3]=j[3]+E|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;c[e>>>5]|=128<<24-e%32;var f=b.floor(d/4294967296),g=d;c[(e+64>>>9<<4)+15]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c[(e+64>>>9<<4)+14]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),a.sigBytes=4*(c.length+1),this._process();for(var h=this._hash,i=h.words,j=0;4>j;j++){var k=i[j];i[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}return h},clone:function(){var a=j.clone.call(this);return a._hash=this._hash.clone(),a}});g.MD5=j._createHelper(m),g.HmacMD5=j._createHmacHelper(m)}(Math),a.MD5})},{"./core":46}],55:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CFB=function(){function b(a,b,c,d){var e=this._iv;if(e){var f=e.slice(0);this._iv=void 0}else var f=this._prevBlock;d.encryptBlock(f,0);for(var g=0;c>g;g++)a[b+g]^=f[g]}var c=a.lib.BlockCipherMode.extend();return c.Encryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize;b.call(this,a,c,e,d),this._prevBlock=a.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize,f=a.slice(c,c+e);b.call(this,a,c,e,d),this._prevBlock=f}}),c}(),a.mode.CFB})},{"./cipher-core":45,"./core":46}],56:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTRGladman=function(){function b(a){if(255===(a>>24&255)){var b=a>>16&255,c=a>>8&255,d=255&a;255===b?(b=0,255===c?(c=0,255===d?d=0:++d):++c):++b,a=0,a+=b<<16,a+=c<<8,a+=d}else a+=1<<24;return a}function c(a){return 0===(a[0]=b(a[0]))&&(a[1]=b(a[1])),a}var d=a.lib.BlockCipherMode.extend(),e=d.Encryptor=d.extend({processBlock:function(a,b){var d=this._cipher,e=d.blockSize,f=this._iv,g=this._counter;f&&(g=this._counter=f.slice(0),this._iv=void 0),c(g);var h=g.slice(0);d.encryptBlock(h,0);for(var i=0;e>i;i++)a[b+i]^=h[i]}});return d.Decryptor=e,d}(),a.mode.CTRGladman})},{"./cipher-core":45,"./core":46}],57:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTR=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._counter;e&&(f=this._counter=e.slice(0),this._iv=void 0);var g=f.slice(0);c.encryptBlock(g,0),f[d-1]=f[d-1]+1|0;for(var h=0;d>h;h++)a[b+h]^=g[h]}});return b.Decryptor=c,b}(),a.mode.CTR})},{"./cipher-core":45,"./core":46}],58:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.ECB=function(){var b=a.lib.BlockCipherMode.extend();return b.Encryptor=b.extend({processBlock:function(a,b){this._cipher.encryptBlock(a,b)}}),b.Decryptor=b.extend({processBlock:function(a,b){this._cipher.decryptBlock(a,b)}}),b}(),a.mode.ECB})},{"./cipher-core":45,"./core":46}],59:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.OFB=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._keystream;e&&(f=this._keystream=e.slice(0),this._iv=void 0),c.encryptBlock(f,0);for(var g=0;d>g;g++)a[b+g]^=f[g]}});return b.Decryptor=c,b}(),a.mode.OFB})},{"./cipher-core":45,"./core":46}],60:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.AnsiX923={pad:function(a,b){var c=a.sigBytes,d=4*b,e=d-c%d,f=c+e-1;a.clamp(),a.words[f>>>2]|=e<<24-f%4*8,a.sigBytes+=e},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Ansix923})},{"./cipher-core":45,"./core":46}],61:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso10126={pad:function(b,c){var d=4*c,e=d-b.sigBytes%d;b.concat(a.lib.WordArray.random(e-1)).concat(a.lib.WordArray.create([e<<24],1))},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Iso10126})},{"./cipher-core":45,"./core":46}],62:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso97971={pad:function(b,c){b.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(b,c)},unpad:function(b){a.pad.ZeroPadding.unpad(b),b.sigBytes--}},a.pad.Iso97971})},{"./cipher-core":45,"./core":46}],63:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding})},{"./cipher-core":45,"./core":46}],64:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.ZeroPadding={pad:function(a,b){var c=4*b;a.clamp(),a.sigBytes+=c-(a.sigBytes%c||c)},unpad:function(a){for(var b=a.words,c=a.sigBytes-1;!(b[c>>>2]>>>24-c%4*8&255);)c--;a.sigBytes=c+1}},a.pad.ZeroPadding})},{"./cipher-core":45,"./core":46}],65:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.SHA1,h=f.HMAC,i=f.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=h.create(c.hasher,a),f=e.create(),g=e.create([1]),i=f.words,j=g.words,k=c.keySize,l=c.iterations;i.length<k;){var m=d.update(b).finalize(g);d.reset();for(var n=m.words,o=n.length,p=m,q=1;l>q;q++){p=d.finalize(p),d.reset();for(var r=p.words,s=0;o>s;s++)n[s]^=r[s]}f.concat(m),j[0]++}return f.sigBytes=4*k,f}});b.PBKDF2=function(a,b,c){return i.create(c).compute(a,b)}}(),a.PBKDF2})},{"./core":46,"./hmac":51,"./sha1":70}],66:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;8>c;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;8>c;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.RabbitLegacy=e.extend({_doReset:function(){var a=this._key.words,c=this.cfg.iv,d=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],e=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var f=0;4>f;f++)b.call(this);for(var f=0;8>f;f++)e[f]^=d[f+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;e[0]^=j,e[1]^=l,e[2]^=k,e[3]^=m,e[4]^=j,e[5]^=l,e[6]^=k,e[7]^=m;for(var f=0;4>f;f++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;4>e;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.RabbitLegacy=e._createHelper(j)}(),a.RabbitLegacy})},{"./cipher-core":45,"./core":46,"./enc-base64":47,"./evpkdf":49,"./md5":54}],67:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;8>c;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;8>c;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.Rabbit=e.extend({_doReset:function(){for(var a=this._key.words,c=this.cfg.iv,d=0;4>d;d++)a[d]=16711935&(a[d]<<8|a[d]>>>24)|4278255360&(a[d]<<24|a[d]>>>8);var e=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],f=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var d=0;4>d;d++)b.call(this);for(var d=0;8>d;d++)f[d]^=e[d+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;f[0]^=j,f[1]^=l,f[2]^=k,f[3]^=m,f[4]^=j,f[5]^=l,f[6]^=k,f[7]^=m;for(var d=0;4>d;d++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;4>e;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.Rabbit=e._createHelper(j)}(),a.Rabbit})},{"./cipher-core":45,"./core":46,"./enc-base64":47,"./evpkdf":49,"./md5":54}],68:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._S,b=this._i,c=this._j,d=0,e=0;4>e;e++){b=(b+1)%256,c=(c+a[b])%256;var f=a[b];a[b]=a[c],a[c]=f,d|=a[(a[b]+a[c])%256]<<24-8*e}return this._i=b,this._j=c,d}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=f.RC4=e.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes,d=this._S=[],e=0;256>e;e++)d[e]=e;for(var e=0,f=0;256>e;e++){var g=e%c,h=b[g>>>2]>>>24-g%4*8&255;f=(f+d[e]+h)%256;var i=d[e];d[e]=d[f],d[f]=i}this._i=this._j=0},_doProcessBlock:function(a,c){a[c]^=b.call(this)},keySize:8,ivSize:0});c.RC4=e._createHelper(g);var h=f.RC4Drop=g.extend({cfg:g.cfg.extend({drop:192}),_doReset:function(){g._doReset.call(this);for(var a=this.cfg.drop;a>0;a--)b.call(this)}});c.RC4Drop=e._createHelper(h)}(),a.RC4})},{"./cipher-core":45,"./core":46,"./enc-base64":47,"./evpkdf":49,"./md5":54}],69:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c){return a^b^c}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return(a|~b)^c}function f(a,b,c){return a&c|b&~c}function g(a,b,c){return a^(b|~c)}function h(a,b){return a<<b|a>>>32-b}var i=a,j=i.lib,k=j.WordArray,l=j.Hasher,m=i.algo,n=k.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=k.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),p=k.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),q=k.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),r=k.create([0,1518500249,1859775393,2400959708,2840853838]),s=k.create([1352829926,1548603684,1836072691,2053994217,0]),t=m.RIPEMD160=l.extend({_doReset:function(){this._hash=k.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var i=0;16>i;i++){var j=b+i,k=a[j];a[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l,m,t,u,v,w,x,y,z,A,B=this._hash.words,C=r.words,D=s.words,E=n.words,F=o.words,G=p.words,H=q.words;w=l=B[0],x=m=B[1],y=t=B[2],z=u=B[3],A=v=B[4];for(var I,i=0;80>i;i+=1)I=l+a[b+E[i]]|0,I+=16>i?c(m,t,u)+C[0]:32>i?d(m,t,u)+C[1]:48>i?e(m,t,u)+C[2]:64>i?f(m,t,u)+C[3]:g(m,t,u)+C[4],I=0|I,I=h(I,G[i]),I=I+v|0,l=v,v=u,u=h(t,10),t=m,m=I,I=w+a[b+F[i]]|0,I+=16>i?g(x,y,z)+D[0]:32>i?f(x,y,z)+D[1]:48>i?e(x,y,z)+D[2]:64>i?d(x,y,z)+D[3]:c(x,y,z)+D[4],I=0|I,I=h(I,H[i]),I=I+A|0,w=A,A=z,z=h(y,10),y=x,x=I;I=B[1]+t+z|0,B[1]=B[2]+u+A|0,B[2]=B[3]+v+w|0,B[3]=B[4]+l+x|0,B[4]=B[0]+m+y|0,B[0]=I},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),a.sigBytes=4*(b.length+1),this._process();for(var e=this._hash,f=e.words,g=0;5>g;g++){var h=f[g];f[g]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return e},clone:function(){var a=l.clone.call(this);return a._hash=this._hash.clone(),a}});i.RIPEMD160=l._createHelper(t),i.HmacRIPEMD160=l._createHmacHelper(t)}(Math),a.RIPEMD160})},{"./core":46}],70:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=c.Hasher,f=b.algo,g=[],h=f.SHA1=e.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=0;80>j;j++){if(16>j)g[j]=0|a[b+j];else{var k=g[j-3]^g[j-8]^g[j-14]^g[j-16];g[j]=k<<1|k>>>31}var l=(d<<5|d>>>27)+i+g[j];l+=20>j?(e&f|~e&h)+1518500249:40>j?(e^f^h)+1859775393:60>j?(e&f|e&h|f&h)-1894007588:(e^f^h)-899497514,i=h,h=f,f=e<<30|e>>>2,e=d,d=l}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA1=e._createHelper(h),b.HmacSHA1=e._createHmacHelper(h)}(),a.SHA1})},{"./core":46}],71:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=b.algo,f=e.SHA256,g=e.SHA224=f.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=f._doFinalize.call(this);return a.sigBytes-=4,a}});b.SHA224=f._createHelper(g),b.HmacSHA224=f._createHmacHelper(g)}(),a.SHA224})},{"./core":46,"./sha256":72}],72:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.algo,h=[],i=[];!function(){function a(a){for(var c=b.sqrt(a),d=2;c>=d;d++)if(!(a%d))return!1;return!0}function c(a){return 4294967296*(a-(0|a))|0}for(var d=2,e=0;64>e;)a(d)&&(8>e&&(h[e]=c(b.pow(d,.5))),i[e]=c(b.pow(d,1/3)),e++),d++}();var j=[],k=g.SHA256=f.extend({_doReset:function(){this._hash=new e.init(h.slice(0))},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],k=c[5],l=c[6],m=c[7],n=0;64>n;n++){if(16>n)j[n]=0|a[b+n];else{var o=j[n-15],p=(o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3,q=j[n-2],r=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;j[n]=p+j[n-7]+r+j[n-16]}var s=h&k^~h&l,t=d&e^d&f^e&f,u=(d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22),v=(h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25),w=m+v+s+i[n]+j[n],x=u+t;m=l,l=k,k=h,h=g+w|0,g=f,f=e,e=d,d=w+x|0}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+g|0,c[4]=c[4]+h|0,c[5]=c[5]+k|0,c[6]=c[6]+l|0,c[7]=c[7]+m|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;return c[e>>>5]|=128<<24-e%32,c[(e+64>>>9<<4)+14]=b.floor(d/4294967296),c[(e+64>>>9<<4)+15]=d,a.sigBytes=4*c.length,this._process(),this._hash},clone:function(){var a=f.clone.call(this);return a._hash=this._hash.clone(),a}});c.SHA256=f._createHelper(k),c.HmacSHA256=f._createHmacHelper(k)}(Math),a.SHA256})},{"./core":46}],73:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.x64,h=g.Word,i=c.algo,j=[],k=[],l=[];!function(){for(var a=1,b=0,c=0;24>c;c++){j[a+5*b]=(c+1)*(c+2)/2%64;var d=b%5,e=(2*a+3*b)%5;a=d,b=e}for(var a=0;5>a;a++)for(var b=0;5>b;b++)k[a+5*b]=b+(2*a+3*b)%5*5;for(var f=1,g=0;24>g;g++){for(var i=0,m=0,n=0;7>n;n++){if(1&f){var o=(1<<n)-1;32>o?m^=1<<o:i^=1<<o-32}128&f?f=f<<1^113:f<<=1}l[g]=h.create(i,m)}}();var m=[];!function(){for(var a=0;25>a;a++)m[a]=h.create()}();var n=i.SHA3=f.extend({cfg:f.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],b=0;25>b;b++)a[b]=new h.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,b){for(var c=this._state,d=this.blockSize/2,e=0;d>e;e++){var f=a[b+2*e],g=a[b+2*e+1];f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8);var h=c[e];h.high^=g,h.low^=f}for(var i=0;24>i;i++){for(var n=0;5>n;n++){for(var o=0,p=0,q=0;5>q;q++){var h=c[n+5*q];o^=h.high,p^=h.low}var r=m[n];r.high=o,r.low=p}for(var n=0;5>n;n++)for(var s=m[(n+4)%5],t=m[(n+1)%5],u=t.high,v=t.low,o=s.high^(u<<1|v>>>31),p=s.low^(v<<1|u>>>31),q=0;5>q;q++){var h=c[n+5*q];h.high^=o,h.low^=p}for(var w=1;25>w;w++){var h=c[w],x=h.high,y=h.low,z=j[w];if(32>z)var o=x<<z|y>>>32-z,p=y<<z|x>>>32-z;else var o=y<<z-32|x>>>64-z,p=x<<z-32|y>>>64-z;var A=m[k[w]];A.high=o,A.low=p}var B=m[0],C=c[0];B.high=C.high,B.low=C.low;for(var n=0;5>n;n++)for(var q=0;5>q;q++){var w=n+5*q,h=c[w],D=m[w],E=m[(n+1)%5+5*q],F=m[(n+2)%5+5*q];h.high=D.high^~E.high&F.high,h.low=D.low^~E.low&F.low}var h=c[0],G=l[i];h.high^=G.high,h.low^=G.low}},_doFinalize:function(){var a=this._data,c=a.words,d=(8*this._nDataBytes,8*a.sigBytes),f=32*this.blockSize;c[d>>>5]|=1<<24-d%32,c[(b.ceil((d+1)/f)*f>>>5)-1]|=128,a.sigBytes=4*c.length,this._process();for(var g=this._state,h=this.cfg.outputLength/8,i=h/8,j=[],k=0;i>k;k++){var l=g[k],m=l.high,n=l.low;m=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),j.push(n),j.push(m)}return new e.init(j,h)},clone:function(){for(var a=f.clone.call(this),b=a._state=this._state.slice(0),c=0;25>c;c++)b[c]=b[c].clone();return a}});c.SHA3=f._createHelper(n),c.HmacSHA3=f._createHmacHelper(n)}(Math),a.SHA3})},{"./core":46,"./x64-core":77}],74:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.x64,d=c.Word,e=c.WordArray,f=b.algo,g=f.SHA512,h=f.SHA384=g.extend({_doReset:function(){this._hash=new e.init([new d.init(3418070365,3238371032),new d.init(1654270250,914150663),new d.init(2438529370,812702999),new d.init(355462360,4144912697),new d.init(1731405415,4290775857),new d.init(2394180231,1750603025),new d.init(3675008525,1694076839),new d.init(1203062813,3204075428)])},_doFinalize:function(){var a=g._doFinalize.call(this);return a.sigBytes-=16,a}});b.SHA384=g._createHelper(h),b.HmacSHA384=g._createHmacHelper(h)}(),a.SHA384})},{"./core":46,"./sha512":75,"./x64-core":77}],75:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){return g.create.apply(g,arguments)}var c=a,d=c.lib,e=d.Hasher,f=c.x64,g=f.Word,h=f.WordArray,i=c.algo,j=[b(1116352408,3609767458),b(1899447441,602891725),b(3049323471,3964484399),b(3921009573,2173295548),b(961987163,4081628472),b(1508970993,3053834265),b(2453635748,2937671579),b(2870763221,3664609560),b(3624381080,2734883394),b(310598401,1164996542),b(607225278,1323610764),b(1426881987,3590304994),b(1925078388,4068182383),b(2162078206,991336113),b(2614888103,633803317),b(3248222580,3479774868),b(3835390401,2666613458),b(4022224774,944711139),b(264347078,2341262773),b(604807628,2007800933),b(770255983,1495990901),b(1249150122,1856431235),b(1555081692,3175218132),b(1996064986,2198950837),b(2554220882,3999719339),b(2821834349,766784016),b(2952996808,2566594879),b(3210313671,3203337956),b(3336571891,1034457026),b(3584528711,2466948901),b(113926993,3758326383),b(338241895,168717936),b(666307205,1188179964),b(773529912,1546045734),b(1294757372,1522805485),b(1396182291,2643833823),b(1695183700,2343527390),b(1986661051,1014477480),b(2177026350,1206759142),b(2456956037,344077627),b(2730485921,1290863460),b(2820302411,3158454273),b(3259730800,3505952657),b(3345764771,106217008),b(3516065817,3606008344),b(3600352804,1432725776),b(4094571909,1467031594),b(275423344,851169720),b(430227734,3100823752),b(506948616,1363258195),b(659060556,3750685593),b(883997877,3785050280),b(958139571,3318307427),b(1322822218,3812723403),b(1537002063,2003034995),b(1747873779,3602036899),b(1955562222,1575990012),b(2024104815,1125592928),b(2227730452,2716904306),b(2361852424,442776044),b(2428436474,593698344),b(2756734187,3733110249),b(3204031479,2999351573),b(3329325298,3815920427),b(3391569614,3928383900),b(3515267271,566280711),b(3940187606,3454069534),b(4118630271,4000239992),b(116418474,1914138554),b(174292421,2731055270),b(289380356,3203993006),b(460393269,320620315),b(685471733,587496836),b(852142971,1086792851),b(1017036298,365543100),b(1126000580,2618297676),b(1288033470,3409855158),b(1501505948,4234509866),b(1607167915,987167468),b(1816402316,1246189591)],k=[];!function(){for(var a=0;80>a;a++)k[a]=b()}();var l=i.SHA512=e.extend({_doReset:function(){this._hash=new h.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],l=c[6],m=c[7],n=d.high,o=d.low,p=e.high,q=e.low,r=f.high,s=f.low,t=g.high,u=g.low,v=h.high,w=h.low,x=i.high,y=i.low,z=l.high,A=l.low,B=m.high,C=m.low,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v,M=w,N=x,O=y,P=z,Q=A,R=B,S=C,T=0;80>T;T++){var U=k[T];if(16>T)var V=U.high=0|a[b+2*T],W=U.low=0|a[b+2*T+1];else{var X=k[T-15],Y=X.high,Z=X.low,$=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,_=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),aa=k[T-2],ba=aa.high,ca=aa.low,da=(ba>>>19|ca<<13)^(ba<<3|ca>>>29)^ba>>>6,ea=(ca>>>19|ba<<13)^(ca<<3|ba>>>29)^(ca>>>6|ba<<26),fa=k[T-7],ga=fa.high,ha=fa.low,ia=k[T-16],ja=ia.high,ka=ia.low,W=_+ha,V=$+ga+(_>>>0>W>>>0?1:0),W=W+ea,V=V+da+(ea>>>0>W>>>0?1:0),W=W+ka,V=V+ja+(ka>>>0>W>>>0?1:0);U.high=V,U.low=W}var la=L&N^~L&P,ma=M&O^~M&Q,na=D&F^D&H^F&H,oa=E&G^E&I^G&I,pa=(D>>>28|E<<4)^(D<<30|E>>>2)^(D<<25|E>>>7),qa=(E>>>28|D<<4)^(E<<30|D>>>2)^(E<<25|D>>>7),ra=(L>>>14|M<<18)^(L>>>18|M<<14)^(L<<23|M>>>9),sa=(M>>>14|L<<18)^(M>>>18|L<<14)^(M<<23|L>>>9),ta=j[T],ua=ta.high,va=ta.low,wa=S+sa,xa=R+ra+(S>>>0>wa>>>0?1:0),wa=wa+ma,xa=xa+la+(ma>>>0>wa>>>0?1:0),wa=wa+va,xa=xa+ua+(va>>>0>wa>>>0?1:0),wa=wa+W,xa=xa+V+(W>>>0>wa>>>0?1:0),ya=qa+oa,za=pa+na+(qa>>>0>ya>>>0?1:0);R=P,S=Q,P=N,Q=O,N=L,O=M,M=K+wa|0,L=J+xa+(K>>>0>M>>>0?1:0)|0,J=H,K=I,H=F,I=G,F=D,G=E,E=wa+ya|0,D=xa+za+(wa>>>0>E>>>0?1:0)|0}o=d.low=o+E,d.high=n+D+(E>>>0>o>>>0?1:0),q=e.low=q+G,e.high=p+F+(G>>>0>q>>>0?1:0),s=f.low=s+I,f.high=r+H+(I>>>0>s>>>0?1:0),u=g.low=u+K,g.high=t+J+(K>>>0>u>>>0?1:0),w=h.low=w+M,h.high=v+L+(M>>>0>w>>>0?1:0),y=i.low=y+O,i.high=x+N+(O>>>0>y>>>0?1:0),A=l.low=A+Q,l.high=z+P+(Q>>>0>A>>>0?1:0),C=m.low=C+S,m.high=B+R+(S>>>0>C>>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+128>>>10<<5)+30]=Math.floor(c/4294967296),b[(d+128>>>10<<5)+31]=c,a.sigBytes=4*b.length,this._process();var e=this._hash.toX32();return e},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a},blockSize:32});c.SHA512=e._createHelper(l),c.HmacSHA512=e._createHmacHelper(l)}(),a.SHA512})},{"./core":46,"./x64-core":77}],76:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a,b){var c=(this._lBlock>>>a^this._rBlock)&b;this._rBlock^=c,this._lBlock^=c<<a}function c(a,b){var c=(this._rBlock>>>a^this._lBlock)&b;this._lBlock^=c,this._rBlock^=c<<a}var d=a,e=d.lib,f=e.WordArray,g=e.BlockCipher,h=d.algo,i=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],j=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],k=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,
3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],m=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=h.DES=g.extend({_doReset:function(){for(var a=this._key,b=a.words,c=[],d=0;56>d;d++){var e=i[d]-1;c[d]=b[e>>>5]>>>31-e%32&1}for(var f=this._subKeys=[],g=0;16>g;g++){for(var h=f[g]=[],l=k[g],d=0;24>d;d++)h[d/6|0]|=c[(j[d]-1+l)%28]<<31-d%6,h[4+(d/6|0)]|=c[28+(j[d+24]-1+l)%28]<<31-d%6;h[0]=h[0]<<1|h[0]>>>31;for(var d=1;7>d;d++)h[d]=h[d]>>>4*(d-1)+3;h[7]=h[7]<<5|h[7]>>>27}for(var m=this._invSubKeys=[],d=0;16>d;d++)m[d]=f[15-d]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._subKeys)},decryptBlock:function(a,b){this._doCryptBlock(a,b,this._invSubKeys)},_doCryptBlock:function(a,d,e){this._lBlock=a[d],this._rBlock=a[d+1],b.call(this,4,252645135),b.call(this,16,65535),c.call(this,2,858993459),c.call(this,8,16711935),b.call(this,1,1431655765);for(var f=0;16>f;f++){for(var g=e[f],h=this._lBlock,i=this._rBlock,j=0,k=0;8>k;k++)j|=l[k][((i^g[k])&m[k])>>>0];this._lBlock=i,this._rBlock=h^j}var n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,b.call(this,1,1431655765),c.call(this,8,16711935),c.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),a[d]=this._lBlock,a[d+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});d.DES=g._createHelper(n);var o=h.TripleDES=g.extend({_doReset:function(){var a=this._key,b=a.words;this._des1=n.createEncryptor(f.create(b.slice(0,2))),this._des2=n.createEncryptor(f.create(b.slice(2,4))),this._des3=n.createEncryptor(f.create(b.slice(4,6)))},encryptBlock:function(a,b){this._des1.encryptBlock(a,b),this._des2.decryptBlock(a,b),this._des3.encryptBlock(a,b)},decryptBlock:function(a,b){this._des3.decryptBlock(a,b),this._des2.encryptBlock(a,b),this._des1.decryptBlock(a,b)},keySize:6,ivSize:2,blockSize:2});d.TripleDES=g._createHelper(o)}(),a.TripleDES})},{"./cipher-core":45,"./core":46,"./enc-base64":47,"./evpkdf":49,"./md5":54}],77:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=c.x64={};g.Word=e.extend({init:function(a,b){this.high=a,this.low=b}}),g.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=8*a.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;b>d;d++){var e=a[d];c.push(e.high),c.push(e.low)}return f.create(c,this.sigBytes)},clone:function(){for(var a=e.clone.call(this),b=a.words=this.words.slice(0),c=b.length,d=0;c>d;d++)b[d]=b[d].clone();return a}})}(),a})},{"./core":46}],78:[function(a,b,c){(function(){"use strict";function c(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(c){if("TypeError"!==c.name)throw c;for(var d=window.BlobBuilder||window.MSBlobBuilder||window.MozBlobBuilder||window.WebKitBlobBuilder,e=new d,f=0;f<a.length;f+=1)e.append(a[f]);return e.getBlob(b.type)}}function d(a){for(var b=a.length,c=new ArrayBuffer(b),d=new Uint8Array(c),e=0;b>e;e++)d[e]=a.charCodeAt(e);return c}function e(a){return new u(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.withCredentials=!0,d.responseType="arraybuffer",d.onreadystatechange=function(){return 4===d.readyState?200===d.status?b({response:d.response,type:d.getResponseHeader("Content-Type")}):void c({status:d.status,response:d.response}):void 0},d.send()})}function f(a){return new u(function(b,d){var f=c([""],{type:"image/png"}),g=a.transaction([x],"readwrite");g.objectStore(x).put(f,"key"),g.oncomplete=function(){var c=a.transaction([x],"readwrite"),f=c.objectStore(x).get("key");f.onerror=d,f.onsuccess=function(a){var c=a.target.result,d=URL.createObjectURL(c);e(d).then(function(a){b(!(!a||"image/png"!==a.type))},function(){b(!1)}).then(function(){URL.revokeObjectURL(d)})}}})["catch"](function(){return!1})}function g(a){return"boolean"==typeof w?u.resolve(w):f(a).then(function(a){return w=a})}function h(a){return new u(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function i(a){var b=d(atob(a.data));return c([b],{type:a.type})}function j(a){return a&&a.__local_forage_encoded_blob}function k(a){var b=this,c={db:null};if(a)for(var d in a)c[d]=a[d];return new u(function(a,d){var e=v.open(c.name,c.version);e.onerror=function(){d(e.error)},e.onupgradeneeded=function(a){e.result.createObjectStore(c.storeName),a.oldVersion<=1&&e.result.createObjectStore(x)},e.onsuccess=function(){c.db=e.result,b._dbInfo=c,a()}})}function l(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new u(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=f.get(a);g.onsuccess=function(){var a=g.result;void 0===a&&(a=null),j(a)&&(a=i(a)),b(a)},g.onerror=function(){d(g.error)}})["catch"](d)});return t(d,b),d}function m(a,b){var c=this,d=new u(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=f.openCursor(),h=1;g.onsuccess=function(){var c=g.result;if(c){var d=c.value;j(d)&&(d=i(d));var e=a(d,c.key,h++);void 0!==e?b(e):c["continue"]()}else b()},g.onerror=function(){d(g.error)}})["catch"](d)});return t(d,b),d}function n(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new u(function(c,e){var f;d.ready().then(function(){return f=d._dbInfo,g(f.db)}).then(function(a){return!a&&b instanceof Blob?h(b):b}).then(function(b){var d=f.db.transaction(f.storeName,"readwrite"),g=d.objectStore(f.storeName);null===b&&(b=void 0);var h=g.put(b,a);d.oncomplete=function(){void 0===b&&(b=null),c(b)},d.onabort=d.onerror=function(){var a=h.error?h.error:h.transaction.error;e(a)}})["catch"](e)});return t(e,c),e}function o(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new u(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readwrite"),g=f.objectStore(e.storeName),h=g["delete"](a);f.oncomplete=function(){b()},f.onerror=function(){d(h.error)},f.onabort=function(){var a=h.error?h.error:h.transaction.error;d(a)}})["catch"](d)});return t(d,b),d}function p(a){var b=this,c=new u(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readwrite"),f=e.objectStore(d.storeName),g=f.clear();e.oncomplete=function(){a()},e.onabort=e.onerror=function(){var a=g.error?g.error:g.transaction.error;c(a)}})["catch"](c)});return t(c,a),c}function q(a){var b=this,c=new u(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName),f=e.count();f.onsuccess=function(){a(f.result)},f.onerror=function(){c(f.error)}})["catch"](c)});return t(c,a),c}function r(a,b){var c=this,d=new u(function(b,d){return 0>a?void b(null):void c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=!1,h=f.openCursor();h.onsuccess=function(){var c=h.result;return c?void(0===a?b(c.key):g?b(c.key):(g=!0,c.advance(a))):void b(null)},h.onerror=function(){d(h.error)}})["catch"](d)});return t(d,b),d}function s(a){var b=this,c=new u(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName),f=e.openCursor(),g=[];f.onsuccess=function(){var b=f.result;return b?(g.push(b.key),void b["continue"]()):void a(g)},f.onerror=function(){c(f.error)}})["catch"](c)});return t(c,a),c}function t(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var u="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,v=v||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(v){var w,x="local-forage-detect-blob-support",y={_driver:"asyncStorage",_initStorage:k,iterate:m,getItem:l,setItem:n,removeItem:o,clear:p,length:q,key:r,keys:s};"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?b.exports=y:"function"==typeof define&&define.amd?define("asyncStorage",function(){return y}):this.asyncStorage=y}}).call(window)},{promise:101}],79:[function(a,b,c){(function(){"use strict";function c(b){var c=this,d={};if(b)for(var e in b)d[e]=b[e];d.keyPrefix=d.name+"/",c._dbInfo=d;var f=new m(function(b){s===r.DEFINE?a(["localforageSerializer"],b):b(s===r.EXPORT?a("./../utils/serializer"):n.localforageSerializer)});return f.then(function(a){return o=a,m.resolve()})}function d(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo.keyPrefix,c=p.length-1;c>=0;c--){var d=p.key(c);0===d.indexOf(a)&&p.removeItem(d)}});return l(c,a),c}function e(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo,d=p.getItem(b.keyPrefix+a);return d&&(d=o.deserialize(d)),d});return l(d,b),d}function f(a,b){var c=this,d=c.ready().then(function(){for(var b=c._dbInfo.keyPrefix,d=b.length,e=p.length,f=1,g=0;e>g;g++){var h=p.key(g);if(0===h.indexOf(b)){var i=p.getItem(h);if(i&&(i=o.deserialize(i)),i=a(i,h.substring(d),f++),void 0!==i)return i}}});return l(d,b),d}function g(a,b){var c=this,d=c.ready().then(function(){var b,d=c._dbInfo;try{b=p.key(a)}catch(e){b=null}return b&&(b=b.substring(d.keyPrefix.length)),b});return l(d,b),d}function h(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo,c=p.length,d=[],e=0;c>e;e++)0===p.key(e).indexOf(a.keyPrefix)&&d.push(p.key(e).substring(a.keyPrefix.length));return d});return l(c,a),c}function i(a){var b=this,c=b.keys().then(function(a){return a.length});return l(c,a),c}function j(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo;p.removeItem(b.keyPrefix+a)});return l(d,b),d}function k(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=d.ready().then(function(){void 0===b&&(b=null);var c=b;return new m(function(e,f){o.serialize(b,function(b,g){if(g)f(g);else try{var h=d._dbInfo;p.setItem(h.keyPrefix+a,b),e(c)}catch(i){"QuotaExceededError"!==i.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==i.name||f(i),f(i)}})})});return l(e,c),e}function l(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var m="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,n=this,o=null,p=null;try{if(!(this.localStorage&&"setItem"in this.localStorage))return;p=this.localStorage}catch(q){return}var r={DEFINE:1,EXPORT:2,WINDOW:3},s=r.WINDOW;"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?s=r.EXPORT:"function"==typeof define&&define.amd&&(s=r.DEFINE);var t={_driver:"localStorageWrapper",_initStorage:c,iterate:f,getItem:e,setItem:k,removeItem:j,clear:d,length:i,key:g,keys:h};s===r.EXPORT?b.exports=t:s===r.DEFINE?define("localStorageWrapper",function(){return t}):this.localStorageWrapper=t}).call(window)},{"./../utils/serializer":82,promise:101}],80:[function(a,b,c){(function(){"use strict";function c(b){var c=this,d={db:null};if(b)for(var e in b)d[e]="string"!=typeof b[e]?b[e].toString():b[e];var f=new m(function(b){r===q.DEFINE?a(["localforageSerializer"],b):b(r===q.EXPORT?a("./../utils/serializer"):n.localforageSerializer)}),g=new m(function(a,e){try{d.db=p(d.name,String(d.version),d.description,d.size)}catch(f){return c.setDriver(c.LOCALSTORAGE).then(function(){return c._initStorage(b)}).then(a)["catch"](e)}d.db.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){c._dbInfo=d,a()},function(a,b){e(b)})})});return f.then(function(a){return o=a,g})}function d(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var d=c.rows.length?c.rows.item(0).value:null;d&&(d=o.deserialize(d)),b(d)},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function e(a,b){var c=this,d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName,[],function(c,d){for(var e=d.rows,f=e.length,g=0;f>g;g++){var h=e.item(g),i=h.value;if(i&&(i=o.deserialize(i)),i=a(i,h.key,g+1),void 0!==i)return void b(i)}b()},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function f(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new m(function(c,e){d.ready().then(function(){void 0===b&&(b=null);var f=b;o.serialize(b,function(b,g){if(g)e(g);else{var h=d._dbInfo;h.db.transaction(function(d){d.executeSql("INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c(f)},function(a,b){e(b)})},function(a){a.code===a.QUOTA_ERR&&e(a)})}})})["catch"](e)});return l(e,c),e}function g(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("DELETE FROM "+e.storeName+" WHERE key = ?",[a],function(){b()},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function h(a){var b=this,c=new m(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("DELETE FROM "+d.storeName,[],function(){a()},function(a,b){c(b)})})})["catch"](c)});return l(c,a),c}function i(a){var b=this,c=new m(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+d.storeName,[],function(b,c){var d=c.rows.item(0).c;a(d)},function(a,b){c(b)})})})["catch"](c)});return l(c,a),c}function j(a,b){var c=this,d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT key FROM "+e.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var d=c.rows.length?c.rows.item(0).key:null;b(d)},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function k(a){var b=this,c=new m(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT key FROM "+d.storeName,[],function(b,c){for(var d=[],e=0;e<c.rows.length;e++)d.push(c.rows.item(e).key);a(d)},function(a,b){c(b)})})})["catch"](c)});return l(c,a),c}function l(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var m="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,n=this,o=null,p=this.openDatabase;if(p){var q={DEFINE:1,EXPORT:2,WINDOW:3},r=q.WINDOW;"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?r=q.EXPORT:"function"==typeof define&&define.amd&&(r=q.DEFINE);var s={_driver:"webSQLStorage",_initStorage:c,iterate:e,getItem:d,setItem:f,removeItem:g,clear:h,length:i,key:j,keys:k};r===q.DEFINE?define("webSQLStorage",function(){return s}):r===q.EXPORT?b.exports=s:this.webSQLStorage=s}}).call(window)},{"./../utils/serializer":82,promise:101}],81:[function(a,b,c){(function(){"use strict";function c(a,b){a[b]=function(){var c=arguments;return a.ready().then(function(){return a[b].apply(a,c)})}}function d(){for(var a=1;a<arguments.length;a++){var b=arguments[a];if(b)for(var c in b)b.hasOwnProperty(c)&&(p(b[c])?arguments[0][c]=b[c].slice():arguments[0][c]=b[c])}return arguments[0]}function e(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b]===a)return!0;return!1}function f(a){this._config=d({},m,a),this._driverSet=null,this._ready=!1,this._dbInfo=null;for(var b=0;b<k.length;b++)c(this,k[b]);this.setDriver(this._config.driver)}var g="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,h={},i={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage"},j=[i.INDEXEDDB,i.WEBSQL,i.LOCALSTORAGE],k=["clear","getItem","iterate","key","keys","length","removeItem","setItem"],l={DEFINE:1,EXPORT:2,WINDOW:3},m={description:"",driver:j.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},n=l.WINDOW;"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?n=l.EXPORT:"function"==typeof define&&define.amd&&(n=l.DEFINE);var o=function(a){var b=b||a.indexedDB||a.webkitIndexedDB||a.mozIndexedDB||a.OIndexedDB||a.msIndexedDB,c={};return c[i.WEBSQL]=!!a.openDatabase,c[i.INDEXEDDB]=!!function(){if("undefined"!=typeof a.openDatabase&&a.navigator&&a.navigator.userAgent&&/Safari/.test(a.navigator.userAgent)&&!/Chrome/.test(a.navigator.userAgent))return!1;try{return b&&"function"==typeof b.open&&"undefined"!=typeof a.IDBKeyRange}catch(c){return!1}}(),c[i.LOCALSTORAGE]=!!function(){try{return a.localStorage&&"setItem"in a.localStorage&&a.localStorage.setItem}catch(b){return!1}}(),c}(this),p=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},q=this;f.prototype.INDEXEDDB=i.INDEXEDDB,f.prototype.LOCALSTORAGE=i.LOCALSTORAGE,f.prototype.WEBSQL=i.WEBSQL,f.prototype.config=function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)"storeName"===b&&(a[b]=a[b].replace(/\W/g,"_")),this._config[b]=a[b];return"driver"in a&&a.driver&&this.setDriver(this._config.driver),!0}return"string"==typeof a?this._config[a]:this._config},f.prototype.defineDriver=function(a,b,c){var d=new g(function(b,c){try{var d=a._driver,f=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),i=new Error("Custom driver name already in use: "+a._driver);if(!a._driver)return void c(f);if(e(a._driver))return void c(i);for(var j=k.concat("_initStorage"),l=0;l<j.length;l++){var m=j[l];if(!m||!a[m]||"function"!=typeof a[m])return void c(f)}var n=g.resolve(!0);"_support"in a&&(n=a._support&&"function"==typeof a._support?a._support():g.resolve(!!a._support)),n.then(function(c){o[d]=c,h[d]=a,b()},c)}catch(p){c(p)}});return d.then(b,c),d},f.prototype.driver=function(){return this._driver||null},f.prototype.ready=function(a){var b=this,c=new g(function(a,c){b._driverSet.then(function(){null===b._ready&&(b._ready=b._initStorage(b._config)),b._ready.then(a,c)})["catch"](c)});return c.then(a,a),c},f.prototype.setDriver=function(b,c,d){function f(){i._config.driver=i.driver()}var i=this;return"string"==typeof b&&(b=[b]),this._driverSet=new g(function(c,d){var f=i._getFirstSupportedDriver(b),j=new Error("No available storage method found.");if(!f)return i._driverSet=g.reject(j),void d(j);if(i._dbInfo=null,i._ready=null,e(f)){var k=new g(function(b){if(n===l.DEFINE)a([f],b);else if(n===l.EXPORT)switch(f){case i.INDEXEDDB:b(a("./drivers/indexeddb"));break;case i.LOCALSTORAGE:b(a("./drivers/localstorage"));break;case i.WEBSQL:b(a("./drivers/websql"))}else b(q[f])});k.then(function(a){i._extend(a),c()})}else h[f]?(i._extend(h[f]),c()):(i._driverSet=g.reject(j),d(j))}),this._driverSet.then(f,f),this._driverSet.then(c,d),this._driverSet},f.prototype.supports=function(a){return!!o[a]},f.prototype._extend=function(a){d(this,a)},f.prototype._getFirstSupportedDriver=function(a){if(a&&p(a))for(var b=0;b<a.length;b++){var c=a[b];if(this.supports(c))return c}return null},f.prototype.createInstance=function(a){return new f(a)};var r=new f;n===l.DEFINE?define("localforage",function(){return r}):n===l.EXPORT?b.exports=r:this.localforage=r}).call(window)},{"./drivers/indexeddb":78,"./drivers/localstorage":79,"./drivers/websql":80,promise:101}],82:[function(a,b,c){(function(){"use strict";function c(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(c){if("TypeError"!==c.name)throw c;for(var d=y.BlobBuilder||y.MSBlobBuilder||y.MozBlobBuilder||y.WebKitBlobBuilder,e=new d,f=0;f<a.length;f+=1)e.append(a[f]);return e.getBlob(b.type)}}function d(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=k;a instanceof ArrayBuffer?(d=a,e+=m):(d=a.buffer,"[object Int8Array]"===c?e+=o:"[object Uint8Array]"===c?e+=p:"[object Uint8ClampedArray]"===c?e+=q:"[object Int16Array]"===c?e+=r:"[object Uint16Array]"===c?e+=t:"[object Int32Array]"===c?e+=s:"[object Uint32Array]"===c?e+=u:"[object Float32Array]"===c?e+=v:"[object Float64Array]"===c?e+=w:b(new Error("Failed to get type for BinaryArray"))),b(e+g(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var c=i+a.type+"~"+g(this.result);b(k+n+c)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(h){console.error("Couldn't convert value into a JSON string: ",a),b(null,h)}}function e(a){if(a.substring(0,l)!==k)return JSON.parse(a);var b,d=a.substring(x),e=a.substring(l,x);if(e===n&&j.test(d)){var g=d.match(j);b=g[1],d=d.substring(g[0].length)}var h=f(d);switch(e){case m:return h;case n:return c([h],{type:b});case o:return new Int8Array(h);case p:return new Uint8Array(h);case q:return new Uint8ClampedArray(h);case r:return new Int16Array(h);case t:return new Uint16Array(h);case s:return new Int32Array(h);case u:return new Uint32Array(h);case v:return new Float32Array(h);case w:return new Float64Array(h);default:throw new Error("Unkown type: "+e)}}function f(a){var b,c,d,e,f,g=.75*a.length,i=a.length,j=0;"="===a[a.length-1]&&(g--,"="===a[a.length-2]&&g--);var k=new ArrayBuffer(g),l=new Uint8Array(k);for(b=0;i>b;b+=4)c=h.indexOf(a[b]),d=h.indexOf(a[b+1]),e=h.indexOf(a[b+2]),f=h.indexOf(a[b+3]),l[j++]=c<<2|d>>4,l[j++]=(15&d)<<4|e>>2,l[j++]=(3&e)<<6|63&f;return k}function g(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=h[c[b]>>2],d+=h[(3&c[b])<<4|c[b+1]>>4],d+=h[(15&c[b+1])<<2|c[b+2]>>6],d+=h[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="~~local_forage_type~",j=/^~~local_forage_type~([^~]+)~/,k="__lfsc__:",l=k.length,m="arbf",n="blob",o="si08",p="ui08",q="uic8",r="si16",s="si32",t="ur16",u="ui32",v="fl32",w="fl64",x=l+m.length,y=this,z={serialize:d,deserialize:e,stringToBuffer:f,bufferToString:g};"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?b.exports=z:"function"==typeof define&&define.amd?define("localforageSerializer",function(){return z}):this.localforageSerializer=z}).call(window)},{}],83:[function(a,b,c){"use strict";var d=a("./lib/utils/common").assign,e=a("./lib/deflate"),f=a("./lib/inflate"),g=a("./lib/zlib/constants"),h={};d(h,e,f,g),b.exports=h},{"./lib/deflate":84,"./lib/inflate":85,"./lib/utils/common":86,"./lib/zlib/constants":89}],84:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.options=i.assign({level:s,method:u,chunkSize:16384,windowBits:15,memLevel:8,strategy:t,to:""},a||{});var b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=h.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==p)throw new Error(k[c]);b.header&&h.deflateSetHeader(this.strm,b.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}function g(a,b){return b=b||{},b.gzip=!0,e(a,b)}var h=a("./zlib/deflate"),i=a("./utils/common"),j=a("./utils/strings"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=Object.prototype.toString,n=0,o=4,p=0,q=1,r=2,s=-1,t=0,u=8;d.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?o:n,"string"==typeof a?e.input=j.string2buf(a):"[object ArrayBuffer]"===m.call(a)?e.input=new Uint8Array(a):e.input=a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new i.Buf8(f),e.next_out=0,e.avail_out=f),c=h.deflate(e,d),c!==q&&c!==p)return this.onEnd(c),this.ended=!0,!1;0!==e.avail_out&&(0!==e.avail_in||d!==o&&d!==r)||("string"===this.options.to?this.onData(j.buf2binstring(i.shrinkBuf(e.output,e.next_out))):this.onData(i.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||0===e.avail_out)&&c!==q);return d===o?(c=h.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===p):d===r?(this.onEnd(p),e.avail_out=0,!0):!0},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=d,c.deflate=e,c.deflateRaw=f,c.gzip=g},{"./utils/common":86,"./utils/strings":87,"./zlib/deflate":91,"./zlib/messages":96,
"./zlib/zstream":98}],85:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=g.inflateInit2(this.strm,b.windowBits);if(c!==j.Z_OK)throw new Error(k[c]);this.header=new m,g.inflateGetHeader(this.strm,this.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}var g=a("./zlib/inflate"),h=a("./utils/common"),i=a("./utils/strings"),j=a("./zlib/constants"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=a("./zlib/gzheader"),n=Object.prototype.toString;d.prototype.push=function(a,b){var c,d,e,f,k,l=this.strm,m=this.options.chunkSize,o=!1;if(this.ended)return!1;d=b===~~b?b:b===!0?j.Z_FINISH:j.Z_NO_FLUSH,"string"==typeof a?l.input=i.binstring2buf(a):"[object ArrayBuffer]"===n.call(a)?l.input=new Uint8Array(a):l.input=a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new h.Buf8(m),l.next_out=0,l.avail_out=m),c=g.inflate(l,j.Z_NO_FLUSH),c===j.Z_BUF_ERROR&&o===!0&&(c=j.Z_OK,o=!1),c!==j.Z_STREAM_END&&c!==j.Z_OK)return this.onEnd(c),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&c!==j.Z_STREAM_END&&(0!==l.avail_in||d!==j.Z_FINISH&&d!==j.Z_SYNC_FLUSH)||("string"===this.options.to?(e=i.utf8border(l.output,l.next_out),f=l.next_out-e,k=i.buf2string(l.output,e),l.next_out=f,l.avail_out=m-f,f&&h.arraySet(l.output,l.output,e,f,0),this.onData(k)):this.onData(h.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(o=!0)}while((l.avail_in>0||0===l.avail_out)&&c!==j.Z_STREAM_END);return c===j.Z_STREAM_END&&(d=j.Z_FINISH),d===j.Z_FINISH?(c=g.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===j.Z_OK):d===j.Z_SYNC_FLUSH?(this.onEnd(j.Z_OK),l.avail_out=0,!0):!0},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===j.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=d,c.inflate=e,c.inflateRaw=f,c.ungzip=e},{"./utils/common":86,"./utils/strings":87,"./zlib/constants":89,"./zlib/gzheader":92,"./zlib/inflate":94,"./zlib/messages":96,"./zlib/zstream":98}],86:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;c>b;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;c>b;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],87:[function(a,b,c){"use strict";function d(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c="",d=0;b>d;d++)c+=String.fromCharCode(a[d]);return c}var e=a("./common"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;256>j;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=new e.Buf8(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;d>c;c++)b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;h>c;)if(f=a[c++],128>f)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&h>c;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:65536>f?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":86}],88:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=d},{}],89:[function(a,b,c){"use strict";b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],90:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;256>c;c++){a=c;for(var d=0;8>d;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=f,g=d+c;a^=-1;for(var h=d;g>h;h++)a=a>>>8^e[255&(a^b[h])];return-1^a}var f=d();b.exports=e},{}],91:[function(a,b,c){"use strict";function d(a,b){return a.msg=H[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(D.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){E._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,D.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=F(a.adler,b,e,c):2===a.state.wrap&&(a.adler=G(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-ka?a.strstart-(a.w_size-ka):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ja,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&m>f);if(d=ja-(m-f),f=m-ja,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-ka)){D.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ia)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+ia-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,!(a.lookahead+a.insert<ia)););}while(a.lookahead<ka&&0!==a.strm.avail_in)}function n(a,b){var c=65535;for(c>a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===I)return ta;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return ta;if(a.strstart-a.block_start>=a.w_size-ka&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=0,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?ta:ta}function o(a,b){for(var c,d;;){if(a.lookahead<ka){if(m(a),a.lookahead<ka&&b===I)return ta;if(0===a.lookahead)break}if(c=0,a.lookahead>=ia&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),0!==c&&a.strstart-c<=a.w_size-ka&&(a.match_length=l(a,c)),a.match_length>=ia)if(d=E._tr_tally(a,a.strstart-a.match_start,a.match_length-ia),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=ia){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=E._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=a.strstart<ia-1?a.strstart:ia-1,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function p(a,b){for(var c,d,e;;){if(a.lookahead<ka){if(m(a),a.lookahead<ka&&b===I)return ta;if(0===a.lookahead)break}if(c=0,a.lookahead>=ia&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=ia-1,0!==c&&a.prev_length<a.max_lazy_match&&a.strstart-c<=a.w_size-ka&&(a.match_length=l(a,c),a.match_length<=5&&(a.strategy===T||a.match_length===ia&&a.strstart-a.match_start>4096)&&(a.match_length=ia-1)),a.prev_length>=ia&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ia,d=E._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ia),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=ia-1,a.strstart++,d&&(h(a,!1),0===a.strm.avail_out))return ta}else if(a.match_available){if(d=E._tr_tally(a,0,a.window[a.strstart-1]),d&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return ta}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(d=E._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<ia-1?a.strstart:ia-1,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function q(a,b){for(var c,d,e,f,g=a.window;;){if(a.lookahead<=ja){if(m(a),a.lookahead<=ja&&b===I)return ta;if(0===a.lookahead)break}if(a.match_length=0,a.lookahead>=ia&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ja;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&f>e);a.match_length=ja-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=ia?(c=E._tr_tally(a,1,a.match_length-ia),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=E._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=0,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===I)return ta;break}if(a.match_length=0,c=E._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=0,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function s(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e}function t(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=C[a.level].max_lazy,a.good_match=C[a.level].good_length,a.nice_match=C[a.level].nice_length,a.max_chain_length=C[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=ia-1,a.match_available=0,a.ins_h=0}function u(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new D.Buf16(2*ga),this.dyn_dtree=new D.Buf16(2*(2*ea+1)),this.bl_tree=new D.Buf16(2*(2*fa+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new D.Buf16(ha+1),this.heap=new D.Buf16(2*da+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new D.Buf16(2*da+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=Y,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?ma:ra,a.adler=2===b.wrap?0:1,b.last_flush=I,E._tr_init(b),N):d(a,P)}function w(a){var b=v(a);return b===N&&t(a.state),b}function x(a,b){return a&&a.state?2!==a.state.wrap?P:(a.state.gzhead=b,N):P}function y(a,b,c,e,f,g){if(!a)return P;var h=1;if(b===S&&(b=6),0>e?(h=0,e=-e):e>15&&(h=2,e-=16),1>f||f>$||c!==Z||8>e||e>15||0>b||b>9||0>g||g>W)return d(a,P);8===e&&(e=9);var i=new u;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<<i.w_bits,i.w_mask=i.w_size-1,i.hash_bits=f+7,i.hash_size=1<<i.hash_bits,i.hash_mask=i.hash_size-1,i.hash_shift=~~((i.hash_bits+ia-1)/ia),i.window=new D.Buf8(2*i.w_size),i.head=new D.Buf16(i.hash_size),i.prev=new D.Buf16(i.w_size),i.lit_bufsize=1<<f+6,i.pending_buf_size=4*i.lit_bufsize,i.pending_buf=new D.Buf8(i.pending_buf_size),i.d_buf=i.lit_bufsize>>1,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,w(a)}function z(a,b){return y(a,b,Z,_,aa,X)}function A(a,b){var c,h,k,l;if(!a||!a.state||b>M||0>b)return a?d(a,P):P;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===sa&&b!==L)return d(a,0===a.avail_out?R:P);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===ma)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=U||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=G(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=na):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=U||h.level<2?4:0),i(h,xa),h.status=ra);else{var m=Z+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=U||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=la),m+=31-m%31,h.status=ra,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===na)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=oa)}else h.status=oa;if(h.status===oa)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=pa)}else h.status=pa;if(h.status===pa)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=qa)}else h.status=qa;if(h.status===qa&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=ra)):h.status=ra),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,N}else if(0===a.avail_in&&e(b)<=e(c)&&b!==L)return d(a,R);if(h.status===sa&&0!==a.avail_in)return d(a,R);if(0!==a.avail_in||0!==h.lookahead||b!==I&&h.status!==sa){var o=h.strategy===U?r(h,b):h.strategy===V?q(h,b):C[h.level].func(h,b);if(o!==va&&o!==wa||(h.status=sa),o===ta||o===va)return 0===a.avail_out&&(h.last_flush=-1),N;if(o===ua&&(b===J?E._tr_align(h):b!==M&&(E._tr_stored_block(h,0,0,!1),b===K&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,N}return b!==L?N:h.wrap<=0?O:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?N:O)}function B(a){var b;return a&&a.state?(b=a.state.status,b!==ma&&b!==na&&b!==oa&&b!==pa&&b!==qa&&b!==ra&&b!==sa?d(a,P):(a.state=null,b===ra?d(a,Q):N)):P}var C,D=a("../utils/common"),E=a("./trees"),F=a("./adler32"),G=a("./crc32"),H=a("./messages"),I=0,J=1,K=3,L=4,M=5,N=0,O=1,P=-2,Q=-3,R=-5,S=-1,T=1,U=2,V=3,W=4,X=0,Y=2,Z=8,$=9,_=15,aa=8,ba=29,ca=256,da=ca+1+ba,ea=30,fa=19,ga=2*da+1,ha=15,ia=3,ja=258,ka=ja+ia+1,la=32,ma=42,na=69,oa=73,pa=91,qa=103,ra=113,sa=666,ta=1,ua=2,va=3,wa=4,xa=3;C=[new s(0,0,0,0,n),new s(4,4,8,4,o),new s(4,5,16,8,o),new s(4,6,32,32,o),new s(4,4,16,16,p),new s(8,16,32,32,p),new s(8,16,128,128,p),new s(8,32,128,256,p),new s(32,128,258,1024,p),new s(32,258,258,4096,p)],c.deflateInit=z,c.deflateInit2=y,c.deflateReset=w,c.deflateResetKeep=v,c.deflateSetHeader=x,c.deflate=A,c.deflateEnd=B,c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":86,"./adler32":88,"./crc32":90,"./messages":96,"./trees":97}],92:[function(a,b,c){"use strict";function d(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}b.exports=d},{}],93:[function(a,b,c){"use strict";var d=30,e=12;b.exports=function(a,b){var c,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;c=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=c.dmax,l=c.wsize,m=c.whave,n=c.wnext,o=c.window,p=c.hold,q=c.bits,r=c.lencode,s=c.distcode,t=(1<<c.lenbits)-1,u=(1<<c.distbits)-1;a:do{15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=r[p&t];b:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<<w)-1)];continue b}if(32&w){c.mode=e;break a}a.msg="invalid literal/length code",c.mode=d;break a}x=65535&v,w&=15,w&&(w>q&&(p+=B[f++]<<q,q+=8),x+=p&(1<<w)-1,p>>>=w,q-=w),15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=s[p&u];c:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<<w)-1)];continue c}a.msg="invalid distance code",c.mode=d;break a}if(y=65535&v,w&=15,w>q&&(p+=B[f++]<<q,q+=8,w>q&&(p+=B[f++]<<q,q+=8)),y+=p&(1<<w)-1,y>k){a.msg="invalid distance too far back",c.mode=d;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&c.sane){a.msg="invalid distance too far back",c.mode=d;break a}if(z=0,A=o,0===n){if(z+=l-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(w>n){if(z+=l+n-w,w-=n,x>w){x-=w;do C[h++]=o[z++];while(--w);if(z=0,x>n){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(g>f&&j>h);x=q>>3,f-=x,q-=x<<3,p&=(1<<q)-1,a.next_in=f,a.next_out=h,a.avail_in=g>f?5+(g-f):5-(f-g),a.avail_out=j>h?257+(j-h):257-(h-j),c.hold=p,c.bits=q}},{}],94:[function(a,b,c){"use strict";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=K,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new r.Buf32(oa),b.distcode=b.distdyn=new r.Buf32(pa),b.sane=1,b.back=-1,C):F}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):F}function h(a,b){var c,d;return a&&a.state?(d=a.state,0>b?(c=0,b=-b):(c=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||b>15)?F:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):F}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==C&&(a.state=null),c):F}function j(a){return i(a,ra)}function k(a){if(sa){var b;for(p=new r.Buf32(512),q=new r.Buf32(32),b=0;144>b;)a.lens[b++]=8;for(;256>b;)a.lens[b++]=9;for(;280>b;)a.lens[b++]=7;for(;288>b;)a.lens[b++]=8;for(v(x,a.lens,0,288,p,0,a.work,{bits:9}),b=0;32>b;)a.lens[b++]=5;v(y,a.lens,0,32,q,0,a.work,{bits:5}),sa=!1}a.lencode=p,a.lenbits=9,a.distcode=q,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<<f.wbits,f.wnext=0,f.whave=0,f.window=new r.Buf8(f.wsize)),d>=f.wsize?(r.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),r.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(r.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave<f.wsize&&(f.whave+=e))),0}function m(a,b){var c,e,f,g,h,i,j,m,n,o,p,q,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa=0,Ba=new r.Buf8(4),Ca=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return F;c=a.state,c.mode===V&&(c.mode=W),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,o=i,p=j,xa=C;a:for(;;)switch(c.mode){case K:if(0===c.wrap){c.mode=W;break}for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(2&c.wrap&&35615===m){c.check=0,Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0),m=0,n=0,c.mode=L;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=la;break}if((15&m)!==J){a.msg="unknown compression method",c.mode=la;break}if(m>>>=4,n-=4,wa=(15&m)+8,0===c.wbits)c.wbits=wa;else if(wa>c.wbits){a.msg="invalid window size",c.mode=la;break}c.dmax=1<<wa,a.adler=c.check=1,c.mode=512&m?T:V,m=0,n=0;break;case L:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.flags=m,(255&c.flags)!==J){a.msg="unknown compression method",c.mode=la;break}if(57344&c.flags){a.msg="unknown header flags set",c.mode=la;break}c.head&&(c.head.text=m>>8&1),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0,c.mode=M;case M:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.time=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,Ba[2]=m>>>16&255,Ba[3]=m>>>24&255,c.check=t(c.check,Ba,4,0)),m=0,n=0,c.mode=N;case N:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.xflags=255&m,c.head.os=m>>8),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0,c.mode=O;case O:if(1024&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length=m,c.head&&(c.head.extra_len=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=P;case P:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wa=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),r.arraySet(c.head.extra,e,g,q,wa)),512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=Q;case Q:if(2048&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.name+=String.fromCharCode(wa));while(wa&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=R;case R:if(4096&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.comment+=String.fromCharCode(wa));while(wa&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.comment=null);c.mode=S;case S:if(512&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(65535&c.check)){a.msg="header crc mismatch",c.mode=la;break}m=0,n=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=V;break;case T:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}a.adler=c.check=d(m),m=0,n=0,c.mode=U;case U:if(0===c.havedict)return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,E;a.adler=c.check=1,c.mode=V;case V:if(b===A||b===B)break a;case W:if(c.last){m>>>=7&n,n-=7&n,c.mode=ia;break}for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}switch(c.last=1&m,m>>>=1,n-=1,3&m){case 0:c.mode=X;break;case 1:if(k(c),c.mode=ba,b===B){m>>>=2,n-=2;break a}break;case 2:c.mode=$;break;case 3:a.msg="invalid block type",c.mode=la}m>>>=2,n-=2;break;case X:for(m>>>=7&n,n-=7&n;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if((65535&m)!==(m>>>16^65535)){a.msg="invalid stored block lengths",c.mode=la;break}if(c.length=65535&m,m=0,n=0,c.mode=Y,b===B)break a;case Y:c.mode=Z;case Z:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;r.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=V;break;case $:for(;14>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.nlen=(31&m)+257,m>>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=la;break}c.have=0,c.mode=_;case _:for(;c.have<c.ncode;){for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.lens[Ca[c.have++]]=7&m,m>>>=3,n-=3}for(;c.have<19;)c.lens[Ca[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ya={bits:c.lenbits},xa=v(w,c.lens,0,19,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid code lengths set",c.mode=la;break}c.have=0,c.mode=aa;case aa:for(;c.have<c.nlen+c.ndist;){for(;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(16>sa)m>>>=qa,n-=qa,c.lens[c.have++]=sa;else{if(16===sa){for(za=qa+2;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m>>>=qa,n-=qa,0===c.have){a.msg="invalid bit length repeat",c.mode=la;break}wa=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sa){for(za=qa+3;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=3+(7&m),m>>>=3,n-=3}else{for(za=qa+7;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=la;break}for(;q--;)c.lens[c.have++]=wa}}if(c.mode===la)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=la;break}if(c.lenbits=9,ya={bits:c.lenbits},xa=v(x,c.lens,0,c.nlen,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid literal/lengths set",c.mode=la;break}if(c.distbits=6,c.distcode=c.distdyn,ya={bits:c.distbits},xa=v(y,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ya),c.distbits=ya.bits,xa){a.msg="invalid distances set",c.mode=la;break}if(c.mode=ba,b===B)break a;case ba:c.mode=ca;case ca:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,u(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===V&&(c.back=-1);break}for(c.back=0;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(ra&&0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.lencode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=ta+qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,c.length=sa,0===ra){c.mode=ha;break}if(32&ra){c.back=-1,c.mode=V;break}if(64&ra){a.msg="invalid literal/length code",c.mode=la;break}c.extra=15&ra,c.mode=da;case da:if(c.extra){for(za=c.extra;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=ea;case ea:for(;Aa=c.distcode[m&(1<<c.distbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.distcode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=ta+qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,64&ra){a.msg="invalid distance code",c.mode=la;break}c.offset=sa,c.extra=15&ra,c.mode=fa;case fa:if(c.extra){for(za=c.extra;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.offset+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=la;break}c.mode=ga;case ga:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=la;break}q>c.wnext?(q-=c.wnext,oa=c.wsize-q):oa=c.wnext-q,q>c.length&&(q=c.length),pa=c.window}else pa=f,oa=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pa[oa++];while(--q);0===c.length&&(c.mode=ca);break;case ha:if(0===j)break a;f[h++]=c.length,j--,c.mode=ca;break;case ia:if(c.wrap){for(;32>n;){if(0===i)break a;i--,m|=e[g++]<<n,n+=8}if(p-=j,a.total_out+=p,c.total+=p,p&&(a.adler=c.check=c.flags?t(c.check,f,p,h-p):s(c.check,f,p,h-p)),p=j,(c.flags?m:d(m))!==c.check){a.msg="incorrect data check",c.mode=la;break}m=0,n=0}c.mode=ja;case ja:if(c.wrap&&c.flags){
for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(4294967295&c.total)){a.msg="incorrect length check",c.mode=la;break}m=0,n=0}c.mode=ka;case ka:xa=D;break a;case la:xa=G;break a;case ma:return H;case na:default:return F}return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,(c.wsize||p!==a.avail_out&&c.mode<la&&(c.mode<ia||b!==z))&&l(a,a.output,a.next_out,p-a.avail_out)?(c.mode=ma,H):(o-=a.avail_in,p-=a.avail_out,a.total_in+=o,a.total_out+=p,c.total+=p,c.wrap&&p&&(a.adler=c.check=c.flags?t(c.check,f,p,a.next_out-p):s(c.check,f,p,a.next_out-p)),a.data_type=c.bits+(c.last?64:0)+(c.mode===V?128:0)+(c.mode===ba||c.mode===Y?256:0),(0===o&&0===p||b===z)&&xa===C&&(xa=I),xa)}function n(a){if(!a||!a.state)return F;var b=a.state;return b.window&&(b.window=null),a.state=null,C}function o(a,b){var c;return a&&a.state?(c=a.state,0===(2&c.wrap)?F:(c.head=b,b.done=!1,C)):F}var p,q,r=a("../utils/common"),s=a("./adler32"),t=a("./crc32"),u=a("./inffast"),v=a("./inftrees"),w=0,x=1,y=2,z=4,A=5,B=6,C=0,D=1,E=2,F=-2,G=-3,H=-4,I=-5,J=8,K=1,L=2,M=3,N=4,O=5,P=6,Q=7,R=8,S=9,T=10,U=11,V=12,W=13,X=14,Y=15,Z=16,$=17,_=18,aa=19,ba=20,ca=21,da=22,ea=23,fa=24,ga=25,ha=26,ia=27,ja=28,ka=29,la=30,ma=31,na=32,oa=852,pa=592,qa=15,ra=qa,sa=!0;c.inflateReset=g,c.inflateReset2=h,c.inflateResetKeep=f,c.inflateInit=j,c.inflateInit2=i,c.inflate=m,c.inflateEnd=n,c.inflateGetHeader=o,c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":86,"./adler32":88,"./crc32":90,"./inffast":93,"./inftrees":95}],95:[function(a,b,c){"use strict";var d=a("../utils/common"),e=15,f=852,g=592,h=0,i=1,j=2,k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];b.exports=function(a,b,c,o,p,q,r,s){var t,u,v,w,x,y,z,A,B,C=s.bits,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=null,O=0,P=new d.Buf16(e+1),Q=new d.Buf16(e+1),R=null,S=0;for(D=0;e>=D;D++)P[D]=0;for(E=0;o>E;E++)P[b[c+E]]++;for(H=C,G=e;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;G>F&&0===P[F];F++);for(F>H&&(H=F),K=1,D=1;e>=D;D++)if(K<<=1,K-=P[D],0>K)return-1;if(K>0&&(a===h||1!==G))return-1;for(Q[1]=0,D=1;e>D;D++)Q[D+1]=Q[D]+P[D];for(E=0;o>E;E++)0!==b[c+E]&&(r[Q[b[c+E]]++]=E);if(a===h?(N=R=r,y=19):a===i?(N=k,O-=257,R=l,S-=257,y=256):(N=m,R=n,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<<H,w=L-1,a===i&&L>f||a===j&&L>g)return 1;for(var T=0;;){T++,z=D-J,r[E]<y?(A=0,B=r[E]):r[E]>y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<<D-J,u=1<<I,F=u;do u-=t,p[x+(M>>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<<D-1;M&t;)t>>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[c+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<<I;G>I+J&&(K-=P[I+J],!(0>=K));)I++,K<<=1;if(L+=1<<I,a===i&&L>f||a===j&&L>g)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":86}],96:[function(a,b,c){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],97:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length}function f(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b}function g(a){return 256>a?ia[a]:ia[256+(a>>>7)]}function h(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function i(a,b,c){a.bi_valid>X-c?(a.bi_buf|=b<<a.bi_valid&65535,h(a,a.bi_buf),a.bi_buf=b>>X-a.bi_valid,a.bi_valid+=c-X):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=c)}function j(a,b,c){i(a,c[2*b],c[2*b+1])}function k(a,b){var c=0;do c|=1&a,a>>>=1,c<<=1;while(--b>0);return c>>>1}function l(a){16===a.bi_valid?(h(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function m(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;W>=f;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;V>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function n(a,b,c){var d,e,f=new Array(W+1),g=0;for(d=1;W>=d;d++)f[d]=g=g+c[d-1]<<1;for(e=0;b>=e;e++){var h=a[2*e+1];0!==h&&(a[2*e]=k(f[h]++,h))}}function o(){var a,b,c,d,f,g=new Array(W+1);for(c=0,d=0;Q-1>d;d++)for(ka[d]=c,a=0;a<1<<ba[d];a++)ja[c++]=d;for(ja[c-1]=d,f=0,d=0;16>d;d++)for(la[d]=f,a=0;a<1<<ca[d];a++)ia[f++]=d;for(f>>=7;T>d;d++)for(la[d]=f<<7,a=0;a<1<<ca[d]-7;a++)ia[256+f++]=d;for(b=0;W>=b;b++)g[b]=0;for(a=0;143>=a;)ga[2*a+1]=8,a++,g[8]++;for(;255>=a;)ga[2*a+1]=9,a++,g[9]++;for(;279>=a;)ga[2*a+1]=7,a++,g[7]++;for(;287>=a;)ga[2*a+1]=8,a++,g[8]++;for(n(ga,S+1,g),a=0;T>a;a++)ha[2*a+1]=5,ha[2*a]=k(a,5);ma=new e(ga,ba,R+1,S,W),na=new e(ha,ca,0,T,W),oa=new e(new Array(0),da,0,U,Y)}function p(a){var b;for(b=0;S>b;b++)a.dyn_ltree[2*b]=0;for(b=0;T>b;b++)a.dyn_dtree[2*b]=0;for(b=0;U>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*Z]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function q(a){a.bi_valid>8?h(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function r(a,b,c,d){q(a),d&&(h(a,c),h(a,~c)),G.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function s(a,b,c,d){var e=2*b,f=2*c;return a[e]<a[f]||a[e]===a[f]&&d[b]<=d[c]}function t(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&s(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!s(b,d,a.heap[e],a.depth));)a.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}function u(a,b,c){var d,e,f,h,k=0;if(0!==a.last_lit)do d=a.pending_buf[a.d_buf+2*k]<<8|a.pending_buf[a.d_buf+2*k+1],e=a.pending_buf[a.l_buf+k],k++,0===d?j(a,e,b):(f=ja[e],j(a,f+R+1,b),h=ba[f],0!==h&&(e-=ka[f],i(a,e,h)),d--,f=g(d),j(a,f,c),h=ca[f],0!==h&&(d-=la[f],i(a,d,h)));while(k<a.last_lit);j(a,Z,b)}function v(a,b){var c,d,e,f=b.dyn_tree,g=b.stat_desc.static_tree,h=b.stat_desc.has_stree,i=b.stat_desc.elems,j=-1;for(a.heap_len=0,a.heap_max=V,c=0;i>c;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=2>j?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)t(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],t(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,t(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],m(a,b),n(f,j,a.bl_count)}function w(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++h<i&&e===g||(j>h?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*$]++):10>=h?a.bl_tree[2*_]++:a.bl_tree[2*aa]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function x(a,b,c){var d,e,f=-1,g=b[1],h=0,k=7,l=4;for(0===g&&(k=138,l=3),d=0;c>=d;d++)if(e=g,g=b[2*(d+1)+1],!(++h<k&&e===g)){if(l>h){do j(a,e,a.bl_tree);while(0!==--h)}else 0!==e?(e!==f&&(j(a,e,a.bl_tree),h--),j(a,$,a.bl_tree),i(a,h-3,2)):10>=h?(j(a,_,a.bl_tree),i(a,h-3,3)):(j(a,aa,a.bl_tree),i(a,h-11,7));h=0,f=e,0===g?(k=138,l=3):e===g?(k=6,l=3):(k=7,l=4)}}function y(a){var b;for(w(a,a.dyn_ltree,a.l_desc.max_code),w(a,a.dyn_dtree,a.d_desc.max_code),v(a,a.bl_desc),b=U-1;b>=3&&0===a.bl_tree[2*ea[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function z(a,b,c,d){var e;for(i(a,b-257,5),i(a,c-1,5),i(a,d-4,4),e=0;d>e;e++)i(a,a.bl_tree[2*ea[e]+1],3);x(a,a.dyn_ltree,b-1),x(a,a.dyn_dtree,c-1)}function A(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return I;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return J;for(b=32;R>b;b++)if(0!==a.dyn_ltree[2*b])return J;return I}function B(a){pa||(o(),pa=!0),a.l_desc=new f(a.dyn_ltree,ma),a.d_desc=new f(a.dyn_dtree,na),a.bl_desc=new f(a.bl_tree,oa),a.bi_buf=0,a.bi_valid=0,p(a)}function C(a,b,c,d){i(a,(L<<1)+(d?1:0),3),r(a,b,c,!0)}function D(a){i(a,M<<1,3),j(a,Z,ga),l(a)}function E(a,b,c,d){var e,f,g=0;a.level>0?(a.strm.data_type===K&&(a.strm.data_type=A(a)),v(a,a.l_desc),v(a,a.d_desc),g=y(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,e>=f&&(e=f)):e=f=c+5,e>=c+4&&-1!==b?C(a,b,c,d):a.strategy===H||f===e?(i(a,(M<<1)+(d?1:0),3),u(a,ga,ha)):(i(a,(N<<1)+(d?1:0),3),z(a,a.l_desc.max_code+1,a.d_desc.max_code+1,g+1),u(a,a.dyn_ltree,a.dyn_dtree)),p(a),d&&q(a)}function F(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(ja[c]+R+1)]++,a.dyn_dtree[2*g(b)]++),a.last_lit===a.lit_bufsize-1}var G=a("../utils/common"),H=4,I=0,J=1,K=2,L=0,M=1,N=2,O=3,P=258,Q=29,R=256,S=R+1+Q,T=30,U=19,V=2*S+1,W=15,X=16,Y=7,Z=256,$=16,_=17,aa=18,ba=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ca=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],da=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=512,ga=new Array(2*(S+2));d(ga);var ha=new Array(2*T);d(ha);var ia=new Array(fa);d(ia);var ja=new Array(P-O+1);d(ja);var ka=new Array(Q);d(ka);var la=new Array(T);d(la);var ma,na,oa,pa=!1;c._tr_init=B,c._tr_stored_block=C,c._tr_flush_block=E,c._tr_tally=F,c._tr_align=D},{"../utils/common":86}],98:[function(a,b,c){"use strict";function d(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=d},{}],99:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h&&h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],100:[function(a,b,c){"use strict";function d(a){function b(a){return null===j?void l.push(a):void g(function(){var b=j?a.onFulfilled:a.onRejected;if(null===b)return void(j?a.resolve:a.reject)(k);var c;try{c=b(k)}catch(d){return void a.reject(d)}a.resolve(c)})}function c(a){try{if(a===m)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var b=a.then;if("function"==typeof b)return void f(b.bind(a),c,h)}j=!0,k=a,i()}catch(d){h(d)}}function h(a){j=!1,k=a,i()}function i(){for(var a=0,c=l.length;c>a;a++)b(l[a]);l=null}if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");var j=null,k=null,l=[],m=this;this.then=function(a,c){return new d(function(d,f){b(new e(a,c,d,f))})},f(a,c,h)}function e(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function f(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var g=a("asap");b.exports=d},{asap:42}],101:[function(a,b,c){"use strict";function d(a){this.then=function(b){return"function"!=typeof b?this:new e(function(c,d){f(function(){try{c(b(a))}catch(e){d(e)}})})}}var e=a("./core.js"),f=a("asap");b.exports=e,d.prototype=Object.create(e.prototype);var g=new d(!0),h=new d(!1),i=new d(null),j=new d(void 0),k=new d(0),l=new d("");e.resolve=function(a){if(a instanceof e)return a;if(null===a)return i;if(void 0===a)return j;if(a===!0)return g;if(a===!1)return h;if(0===a)return k;if(""===a)return l;if("object"==typeof a||"function"==typeof a)try{var b=a.then;if("function"==typeof b)return new e(b.bind(a))}catch(c){return new e(function(a,b){b(c)})}return new d(a)},e.from=e.cast=function(a){var b=new Error("Promise.from and Promise.cast are deprecated, use Promise.resolve instead");return b.name="Warning",console.warn(b.stack),e.resolve(a)},e.denodeify=function(a,b){return b=b||1/0,function(){var c=this,d=Array.prototype.slice.call(arguments);return new e(function(e,f){for(;d.length&&d.length>b;)d.pop();d.push(function(a,b){a?f(a):e(b)}),a.apply(c,d)})}},e.nodeify=function(a){return function(){var b=Array.prototype.slice.call(arguments),c="function"==typeof b[b.length-1]?b.pop():null;try{return a.apply(this,arguments).nodeify(c)}catch(d){if(null===c||"undefined"==typeof c)return new e(function(a,b){b(d)});f(function(){c(d)})}}},e.all=function(){var a=1===arguments.length&&Array.isArray(arguments[0]),b=Array.prototype.slice.call(a?arguments[0]:arguments);if(!a){var c=new Error("Promise.all should be called with a single array, calling it with multiple arguments is deprecated");c.name="Warning",console.warn(c.stack)}return new e(function(a,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}b[f]=g,0===--e&&a(b)}catch(i){c(i)}}if(0===b.length)return a([]);for(var e=b.length,f=0;f<b.length;f++)d(f,b[f])})},e.reject=function(a){return new e(function(b,c){c(a)})},e.race=function(a){return new e(function(b,c){a.forEach(function(a){e.resolve(a).then(b,c)})})},e.prototype.done=function(a,b){var c=arguments.length?this.then.apply(this,arguments):this;c.then(null,function(a){f(function(){throw a})})},e.prototype.nodeify=function(a){return"function"!=typeof a?this:void this.then(function(b){f(function(){a(null,b)})},function(b){f(function(){a(b)})})},e.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":100,asap:42}]},{},[1]);
|
index.js
|
moritzmhmk/sane-webui
|
import React from 'react'
import { render } from 'react-dom'
import configureStore from './store/configureStore'
import Root from './containers/Root.jsx'
import {fetchDevices} from './actions/devices'
const store = configureStore()
store.dispatch(fetchDevices())
render(
<Root store={store} />,
document.getElementById('root')
)
|
docs/app/Examples/elements/List/ContentVariations/ListExampleFloatedHorizontal.js
|
koenvg/Semantic-UI-React
|
import React from 'react'
import { List } from 'semantic-ui-react'
const ListExampleFloatedHorizontal = () => (
<div>
<List floated='right' horizontal>
<List.Item disabled href='#'>© GitHub, Inc.</List.Item>
<List.Item href='#'>Terms</List.Item>
<List.Item href='#'>Privacy</List.Item>
<List.Item href='#'>Contact</List.Item>
</List>
<List horizontal>
<List.Item href='#'>About Us</List.Item>
<List.Item href='#'>Jobs</List.Item>
</List>
</div>
)
export default ListExampleFloatedHorizontal
|
src/components/Sidebar/Copyright/Copyright.js
|
bapti/blog
|
// @flow strict
import React from 'react';
import styles from './Copyright.module.scss';
type Props = {
copyright: string
};
const Copyright = ({ copyright }: Props) => (
<div className={styles['copyright']}>
{copyright}
</div>
);
export default Copyright;
|
3_compress_ensure_render/component/extPage/index.js
|
chkui/react-server-demo
|
import React from 'react'
const ExtPage = props =>{
return(
<div>这就是一个为了静态看的页面</div>
)
}
module.exports = ExtPage
module.exports.default = module.exports
|
web-app/src/shared/components/Button/index.js
|
crypticism/FF
|
import React from 'react';
import classNames from 'classnames';
import stylesheet from './Button.scss';
export default function Button({ onClick, type, className, children }) {
const buttonClass = classNames(className, stylesheet.button, {
[stylesheet.login]: type === 'login',
[stylesheet.export]: type === 'export',
[stylesheet.import]: type === 'import',
[stylesheet.importNew]: type === 'importNew',
[stylesheet.logout]: type === 'logout',
});
return (
<button className={buttonClass} onClick={onClick}>
{children}
</button>
);
}
|
packages/react/src/internal/__tests__/useId.server-test.js
|
carbon-design-system/carbon-components
|
/**
* Copyright IBM Corp. 2016, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/
import React from 'react';
import { renderToString } from 'react-dom/server';
import { useId } from '../useId';
describe('useId SSR', () => {
it('should not generate an id on the server', () => {
function Test() {
const id = useId('test');
return <span id={id}>test</span>;
}
const markup = renderToString(<Test />);
expect(markup.indexOf('id="')).toBe(-1);
});
});
|
src/package/plugins/slate-list-plugin/ListItemNode.js
|
abobwhite/slate-editor
|
import React from 'react'
const ListItemNode = ({ attributes, children }) => (
<li {...attributes}>
{children}
</li>
)
export default ListItemNode
|
1m_Redux_Lynda/Ex_Files_Learning_Redux/Exercise Files/Ch05/05_06/start/src/routes.js
|
yevheniyc/Autodidact
|
import React from 'react'
import { Router, Route, IndexRoute, hashHistory } from 'react-router'
import { App, Whoops404 } from './components'
import SkiDayCount from './components/containers/SkiDayCount'
import AddDayForm from './components/containers/AddDayForm'
import SkiDayList from './components/containers/SkiDayList'
const routes = (
<Router history={hashHistory}>
<Route path="/" component={App}>
<IndexRoute component={SkiDayCount}/>
<Route path="add-day" component={AddDayForm}/>
<Route path="list-days" component={SkiDayList}>
<Route path=":filter" component={SkiDayList}/>
</Route>
<Route path="*" component={Whoops404}/>
</Route>
</Router>
)
export default routes
|
src/ui/components/CrudSearch.js
|
dartelvis/zf3
|
import React from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import {CardActions, FloatingActionButton, CardTitle, CardText, Card, CardHeader, RaisedButton, TextField, MenuItem, GridList, GridTile, AutoComplete } from 'material-ui';
import moment from 'moment';
import ActionSearch from 'material-ui/svg-icons/action/search';
import ContentAdd from 'material-ui/svg-icons/content/add';
import DatePicker from "../../ui/components/DatePicker";
import SelectField from "../../ui/components/SelectField";
const tipos = {
boolean: {
'it': 'verdadeiro',
'if': 'falso',
'nu': 'nulo',
'nn': 'não nulo'
},
varchar: {
eq: 'igual',
ne: 'diferente',
bw: 'inicia com',
bn: 'não inicia com',
ew: 'termina com',
en: 'não termina com',
cn: 'contém',
nc: 'não contém',
nu: 'nulo',
nn: 'não nulo',
in: 'está em',
ni: 'não está em'
},
numeric: {
eq: 'igual',
ne: 'diferente',
lt: 'menor',
le: 'menor ou igual',
gt: 'maior',
ge: 'maior ou igual',
nu: 'nulo',
nn: 'não nulo',
in: 'está em',
ni: 'não está em'
},
integer: {
eq: 'igual',
ne: 'diferente',
lt: 'menor',
le: 'menor ou igual',
gt: 'maior',
ge: 'maior ou igual',
nu: 'nulo',
nn: 'não nulo',
in: 'está em',
ni: 'não está em'
}
};
class CrudSearch extends React.Component
{
constructor(props)
{
super(props);
this.onSubmit = this.onSubmit.bind(this);
this.onChange = this.onChange.bind(this);
this.setFiltros = this.setFiltros.bind(this);
this.handleAutoComplete = this.handleAutoComplete.bind(this);
this.state = {filtros: {}, operadores: []};
}
componentWillMount()
{
this.setFiltros(null);
}
onChange(name, value)
{
var filtros = this.state.filtros;
filtros[name] = value;
this.setState({filtros: filtros});
if (name === 'campo') {
this.setFiltros(value);
}
}
handleAutoComplete(name, value, url, dataSource)
{
this.onChange(name, value);
App.fetch.getJson(window.App.basePath + url, {
body: JSON.stringify({search: value}),
method: "POST"
}).then((resp) => {
if (resp.type !== 'success') {
return;
}
var state = {};
state[dataSource] = resp.data;
this.setState(state);
});
}
setFiltros(campo)
{
var type = '',
operadores = [],
campos = this.props.campos || [],
filtros = (campo ? this.state.filtros : (this.props.filtros || {})),
changeCampo = (campo !== undefined),
getTipos = function (c) {
campos.forEach(function (d) {
if ((!c && d.selected) || d.id == c) {
type = d.type;
campo = d.id;
}
});
if (type && tipos[type]) {
return tipos[type];
}
type = 'varchar';
return tipos[type];
},
prms = getTipos(campo);
(!filtros.campo) && (filtros.campo = campo);
(!filtros.operador || changeCampo) && (filtros.operador = (type === 'varchar' ? 'cn' : 'eq'));
for (var b in prms) {
operadores.push({id: b, name: prms[b]});
}
this.setState({filtros: filtros, operadores: operadores});
}
onSubmit(e)
{
e.preventDefault();
e.stopPropagation();
this.props.onSearch(this.state.filtros);
}
getFilter()
{
var filtersElm = [];
const filters = this.props.filters || [];
filters.map((filter, i) => {
filtersElm.push(
<div key={i} className="row">{
filter.map((campo) => {
switch (campo.type) {
case 'select':
if (!this.state.filtros[campo.name] && campo['value']) {
this.state.filtros[campo.name] = campo['value'];
}
campo['value'] = this.state.filtros[campo.name];
return (
<div key={campo.name} className={campo.className}>
<SelectField data={campo} onChange={this.onChange}/>
</div>
);
break;
case 'date':
return (
<div key={campo.name} className={campo.className}>
<DatePicker data={campo} onChange={this.onChange}/>
</div>
);
break;
case 'autocomplete':
return (
<div key={campo.name} className={campo.className}>
<AutoComplete
fullWidth={true}
floatingLabelText={campo.label}
searchText={this.state.filtros[campo.name]}
filter={AutoComplete.fuzzyFilter}
dataSource={this.state.cidades || []}
dataSourceConfig={{text: 'name', value: 'id'}}
onNewRequest={(a) => this.onChange(campo.name, a.id)}
onUpdateInput={(v) => this.handleAutoComplete(campo.name, v, campo.url, 'cidades')}
/>
</div>
);
break;
default:
return (
<div key={campo.name} className={campo.className}>
<TextField
fullWidth={true}
floatingLabelText={campo.label}
value={this.state.filtros[campo.name]}
onChange={(a, v) => this.onChange(campo.name, v)}
/>
</div>
);
break;
}
})
}</div>
);
});
return filtersElm;
}
render()
{
if (!this.props.campos) {
return null;
}
var campo = {
name: 'campo',
label: 'Campo',
items: this.props.campos,
value: this.state.filtros.campo
},
operador = {
name: 'operador',
label: 'Operador',
items: this.state.operadores,
value: this.state.filtros.operador
};
return (
<form ref={(f) => {this.form = f; }} onSubmit={this.onSubmit}>
<div style={{position: 'relative'}}>
<CardActions style={{ zIndex: 2, display: 'inline-block', position: 'absolute', top: 0, right: 0}}>
<FloatingActionButton secondary={true} mini={false} onTouchTap={this.props.handleConsultar}>
<ActionSearch/>
</FloatingActionButton>
<FloatingActionButton onTouchTap={this.props.handleAdicionar}>
<ContentAdd/>
</FloatingActionButton>
</CardActions>
</div>
<Card>
<CardHeader
style={{padding: 0, marginRight: '150px'}}
actAsExpander={true}
showExpandableButton={true}
children={this.props.title && <CardTitle style={{marginTop: '-4px', paddingTop: 0, fontWeight: 'normal'}} title={this.props.title}/>}
/>
<CardText expandable={true}>
<div className="row">
<div className="col-md-3">
<SelectField data={campo} onChange={this.onChange}/>
</div>
<div className="col-md-3">
<SelectField data={operador} onChange={this.onChange}/>
</div>
<div className="col-md-6">
<TextField
fullWidth={true}
onChange={(a, v) => this.onChange('valor', v)}
value={this.state.filtros.valor}
floatingLabelText="Pesquisa"
/>
</div>
</div>
{this.getFilter()}
</CardText>
</Card>
</form>
);
}
};
CrudSearch.propTypes = {
campos: PropTypes.array.isRequired,
onSearch: PropTypes.func.isRequired
};
export default CrudSearch;
|
app/containers/GalleryPage/index.js
|
Cherchercher/Wedding-Llama
|
/*
* GalleryPage
*
* List all the Gallerys
*/
import React from 'react';
import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl';
import Gallery from 'react-photo-gallery';
import H1 from 'components/H1';
import messages from './messages';
export default class GalleryPage extends React.Component { // eslint-disable-line react/prefer-stateless-function
// Since state and props are static,
// there's no need to re-render this component
shouldComponentUpdate() {
return false;
}
render() {
return (
<div>
<Helmet
title="Media Page"
meta={[
{ name: 'description', content: 'Media page of Wedding Llama' },
]}
/>
<H1>
<FormattedMessage {...messages.header} />
</H1>
<Gallery photos={PHOTO_SET} onClick={this.openLightbox}/>
</div>
);
}
}
const PHOTO_SET = [
{
src: ' https://i.pinimg.com/736x/1a/d3/5d/1ad35d2d7f3ec9da85f6454108c897da.jpg',
sizes:[
'(min-width: 480px) 50vw',
'(min-width: 1024px) 33.3vw',
'100vw'
],
width: 600,
height: 600,
alt: 'image 1',
},
{
src: 'https://static.boredpanda.com/blog/wp-content/uploads/2017/04/BTFAAA1Al4f-1-png__700.jpg',
sizes:[
'(min-width: 480px) 50vw',
'(min-width: 1024px) 33.3vw',
'100vw'
],
width: 600,
height: 600,
alt: 'image 2',
},
{
src: 'https://s.yimg.com/iu/api/res/1.2/p09lUAhwgyE6D_is3qCowA--~C/cm90YXRlPWF1dG87dz05NjA7YXBwaWQ9eXZpZGVv/https://s.yimg.com/ea/img/-/170428/5902cfa1ec2b5_86group.jpg',
sizes:[
'(min-width: 480px) 50vw',
'(min-width: 1024px) 33.3vw',
'100vw'
],
width: 600,
height: 600,
alt: 'image 3',
},
{
src: 'https://www.easyweddings.com.au/articles/wp-content/uploads/sites/5/2017/04/16788776_402481446781849_3016062207189319680_n.jpg',
sizes:[
'(min-width: 480px) 50vw',
'(min-width: 1024px) 33.3vw',
'100vw'
],
width: 600,
height: 600,
alt: 'image 4',
},
{
src: 'https://static1.squarespace.com/static/56a2644225981dbe8510f2d5/572e06104d088ea3a8f0b14c/5877e21fd482e93a5dd01002/1484251691426/Ashbourne+wedding3.jpg',
sizes:[
'(min-width: 480px) 50vw',
'(min-width: 1024px) 33.3vw',
'100vw'
],
width: 600,
height: 600,
alt: 'Llama Love Image 5',
},
{
src: 'https://images.britcdn.com/wp-content/uploads/2017/05/feature4.jpg',
sizes:[
'(min-width: 480px) 50vw',
'(min-width: 1024px) 33.3vw',
'100vw'
],
width: 600,
height: 600,
alt: 'Llama Love Image 6',
},
];
|
app/javascript/mastodon/components/__tests__/button-test.js
|
h3zjp/mastodon
|
import { shallow } from 'enzyme';
import React from 'react';
import renderer from 'react-test-renderer';
import Button from '../button';
describe('<Button />', () => {
it('renders a button element', () => {
const component = renderer.create(<Button />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders the given text', () => {
const text = 'foo';
const component = renderer.create(<Button text={text} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('handles click events using the given handler', () => {
const handler = jest.fn();
const button = shallow(<Button onClick={handler} />);
button.find('button').simulate('click');
expect(handler.mock.calls.length).toEqual(1);
});
it('does not handle click events if props.disabled given', () => {
const handler = jest.fn();
const button = shallow(<Button onClick={handler} disabled />);
button.find('button').simulate('click');
expect(handler.mock.calls.length).toEqual(0);
});
it('renders a disabled attribute if props.disabled given', () => {
const component = renderer.create(<Button disabled />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders the children', () => {
const children = <p>children</p>;
const component = renderer.create(<Button>{children}</Button>);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders the props.text instead of children', () => {
const text = 'foo';
const children = <p>children</p>;
const component = renderer.create(<Button text={text}>{children}</Button>);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders class="button--block" if props.block given', () => {
const component = renderer.create(<Button block />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('adds class "button-secondary" if props.secondary given', () => {
const component = renderer.create(<Button secondary />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
});
|
react/features/base/media/components/web/VideoTrack.js
|
KalinduDN/kalindudn.github.io
|
import React from 'react';
import { connect } from 'react-redux';
import AbstractVideoTrack from '../AbstractVideoTrack';
/**
* Component that renders a video element for a passed in video track.
*
* @extends AbstractVideoTrack
*/
class VideoTrack extends AbstractVideoTrack {
/**
* Default values for {@code VideoTrack} component's properties.
*
* @static
*/
static defaultProps = {
...AbstractVideoTrack.defaultProps,
className: '',
id: ''
};
/**
* {@code VideoTrack} component's property types.
*
* @static
*/
static propTypes = {
...AbstractVideoTrack.propTypes,
/**
* CSS classes to add to the video element.
*/
className: React.PropTypes.string,
/**
* The value of the id attribute of the video. Used by the torture tests
* to locate video elements.
*/
id: React.PropTypes.string
};
/**
* Initializes a new VideoTrack instance.
*
* @param {Object} props - The read-only properties with which the new
* instance is to be initialized.
*/
constructor(props) {
super(props);
/**
* The internal reference to the DOM/HTML element intended for
* displaying a video. This element may be an HTML video element or a
* temasys video object.
*
* @private
* @type {HTMLVideoElement|Object}
*/
this._videoElement = null;
// Bind event handlers so they are only bound once for every instance.
this._setVideoElement = this._setVideoElement.bind(this);
}
/**
* Invokes the library for rendering the video on initial display. Sets the
* volume level to zero to ensure no sound plays.
*
* @inheritdoc
* @returns {void}
*/
componentDidMount() {
// Add these attributes directly onto the video element so temasys can
// use them when converting the video to an object.
this._videoElement.volume = 0;
this._videoElement.onplaying = this._onVideoPlaying;
this._attachTrack(this.props.videoTrack);
}
/**
* Remove any existing associations between the current video track and the
* component's video element.
*
* @inheritdoc
* @returns {void}
*/
componentWillUnmount() {
this._detachTrack(this.props.videoTrack);
}
/**
* Updates the video display only if a new track is added. This component's
* updating is blackboxed from React to prevent re-rendering of video
* element, as the lib uses track.attach(videoElement) instead. Also,
* re-rendering cannot be used with temasys, which replaces video elements
* with an object.
*
* @inheritdoc
* @returns {boolean} - False is always returned to blackbox this component.
* from React.
*/
shouldComponentUpdate(nextProps) {
const currentJitsiTrack = this.props.videoTrack
&& this.props.videoTrack.jitsiTrack;
const nextJitsiTrack = nextProps.videoTrack
&& nextProps.videoTrack.jitsiTrack;
if (currentJitsiTrack !== nextJitsiTrack) {
this._detachTrack(this.props.videoTrack);
this._attachTrack(nextProps.videoTrack);
}
return false;
}
/**
* Renders the video element.
*
* @override
* @returns {ReactElement}
*/
render() {
// The wrapping div is necessary because temasys will replace the video
// with an object but react will keep expecting the video element. The
// div gives a constant element for react to keep track of.
return (
<div>
<video
autoPlay = { true }
className = { this.props.className }
id = { this.props.id }
ref = { this._setVideoElement } />
</div>
);
}
/**
* Calls into the passed in track to associate the track with the
* component's video element and render video.
*
* @param {Object} videoTrack - The redux representation of the
* {@code JitsiLocalTrack}.
* @private
* @returns {void}
*/
_attachTrack(videoTrack) {
if (!videoTrack || !videoTrack.jitsiTrack) {
return;
}
const updatedVideoElement
= videoTrack.jitsiTrack.attach(this._videoElement);
// Sets the instance variable for the video element again as the element
// maybe have been replaced with a new object by temasys.
this._setVideoElement(updatedVideoElement);
}
/**
* Removes the association to the component's video element from the passed
* in redux representation of jitsi video track to stop the track from
* rendering. With temasys, the video element must still be visible for
* detaching to complete.
*
* @param {Object} videoTrack - The redux representation of the
* {@code JitsiLocalTrack}.
* @private
* @returns {void}
*/
_detachTrack(videoTrack) {
// Detach the video element from the track only if it has already
// been attached. This accounts for a special case with temasys
// where if detach is being called before attach, the video
// element is converted to Object without updating this
// component's reference to the video element.
if (this._videoElement
&& videoTrack
&& videoTrack.jitsiTrack
&& videoTrack.jitsiTrack.containers.includes(this._videoElement)) {
videoTrack.jitsiTrack.detach(this._videoElement);
}
}
/**
* Sets an instance variable for the component's video element so it can be
* referenced later for attaching and detaching a JitsiLocalTrack.
*
* @param {Object} element - DOM element for the component's video display.
* @private
* @returns {void}
*/
_setVideoElement(element) {
this._videoElement = element;
}
}
export default connect()(VideoTrack);
|
test/specs/collections/Form/FormFieldInput-test.js
|
aabustamante/Semantic-UI-React
|
import React from 'react'
import FormInput from 'src/collections/Form/FormInput'
import Input from 'src/elements/Input/Input'
import * as common from 'test/specs/commonTests'
describe('FormInput', () => {
common.isConformant(FormInput)
common.labelImplementsHtmlForProp(FormInput)
it('renders a FormField with a Input control', () => {
shallow(<FormInput />)
.find('FormField')
.should.have.prop('control', Input)
})
})
|
src/widgets/button.story.js
|
francisl/baer-toolkit
|
import React from 'react';
import { storiesOf, action, linkTo } from '@storybook/react';
import { containerSizeStyles } from '../../stories/config';
import Button from './button';
export default () => (
<div>
<Button onClick={function(){alert('clicked')}}>Hello Button</Button>
<pre><code>{`
<Button onClick={function(){alert('clicked')}}>
Hello Button
</Button>
`}
</code></pre>
<br />
<Button primary onClick={function(){alert('clicked')}}>Primary 👍</Button>
<pre><code>{`
<Button primary onClick={function(){alert('clicked')}}>
Primary 👍
</Button>`}
</code></pre>
<br />
<Button warning>Warning 👍</Button>
<pre><code>{`
<Button warning>
Warning 👍
</Button>`}
</code></pre>
<br />
<Button danger>Danger</Button>
<pre><code>{`
<Button danger>
Danger
</Button>`}
</code></pre>
<br />
<Button type="submit">Submit</Button>
<pre><code>{`
<Button type="submit">
Submit
</Button>`}
</code></pre>
<br />
<Button disabled>Disabled</Button>
<pre><code>{`
<Button disabled>
Disabled
</Button>`}
</code></pre>
<br />
</div>
);
|
core/src/plugins/access.ajxp_conf/res/js/AdminPlugins/core/PluginEditor.js
|
huzergackl/pydio-core
|
/*
* Copyright 2007-2017 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <https://pydio.com>.
*/
import React from 'react'
import {RaisedButton, FlatButton} from 'material-ui'
/**
* Editor for a given plugin. By default, displays documentation in a left column panel,
* and plugin parameters as form cards on the right.
* May take additionalPanes to be appended to the form cards.
*/
const PluginEditor = React.createClass({
mixins:[AdminComponents.MessagesConsumerMixin],
propTypes:{
rootNode:React.PropTypes.instanceOf(AjxpNode).isRequired,
close:React.PropTypes.func,
style:React.PropTypes.string,
className:React.PropTypes.string,
additionalPanes:React.PropTypes.shape({
top:React.PropTypes.array,
bottom:React.PropTypes.array
}),
docAsAdditionalPane:React.PropTypes.bool,
additionalDescription:React.PropTypes.string,
registerCloseCallback:React.PropTypes.func,
onBeforeSave:React.PropTypes.func,
onAfterSave:React.PropTypes.func,
onRevert:React.PropTypes.func,
onDirtyChange:React.PropTypes.func
},
loadPluginData:function(plugId){
PydioApi.getClient().request({
get_action:'get_plugin_manifest',
plugin_id:plugId
}, function(transport){
var xmlData = transport.responseXML;
var params = PydioForm.Manager.parseParameters(xmlData, "//global_param");
var xmlValues = XMLUtils.XPathSelectNodes(xmlData, "//plugin_settings_values/param");
var documentation = XMLUtils.XPathSelectSingleNode(xmlData, "//plugin_doc");
var enabledAlways = false;
var rootNode = XMLUtils.XPathSelectSingleNode(xmlData, "admin_data");
var label = rootNode.firstChild.attributes.getNamedItem("label").value;
var description = rootNode.firstChild.attributes.getNamedItem("description").value;
try{enabledAlways = rootNode.firstChild.attributes.getNamedItem("enabled").value === 'always';}catch (e){}
var paramsValues = {};
xmlValues.forEach(function(child){
if(child.nodeName != 'param') return;
var valueParamName = child.getAttribute("name");
if(child.getAttribute("cdatavalue")){
paramsValues[valueParamName] = child.firstChild.nodeValue;
}else{
paramsValues[valueParamName] = child.getAttribute('value');
}
var cType = null;
params.map(function(def){
if(def.name == valueParamName) cType = def.type;
});
if(cType == 'boolean') paramsValues[valueParamName] = (paramsValues[valueParamName] == "true");
else if(cType == 'integer') paramsValues[valueParamName] = parseInt(paramsValues[valueParamName]);
});
this.setState({
loaded: true,
parameters:params,
values:paramsValues,
originalValues:LangUtils.deepCopy(paramsValues),
documentation:documentation,
enabledAlways:enabledAlways,
dirty:false,
label:label,
description:description,
pluginId:plugId
});
if(this.props.registerCloseCallback){
this.props.registerCloseCallback(function(){
if(this.state && this.state.dirty && !confirm(this.context.getMessage('19','role_editor'))){
return false;
}
}.bind(this));
}
}.bind(this));
},
componentWillReceiveProps:function(nextProps){
if(nextProps.rootNode.getPath()!= this.props.rootNode.getPath()){
this.loadPluginData(PathUtils.getBasename(nextProps.rootNode.getPath()));
this.setState({values:{}});
}
},
getInitialState:function(){
var plugId = PathUtils.getBasename(this.props.rootNode.getPath());
this.loadPluginData(plugId);
return {
loaded:false,
parameters:[],
values:{},
documentation:'',
dirty:false,
label:'',
docOpen:false
};
},
externalSetDirty:function(){
this.setState({dirty:true});
},
onChange:function(formValues, dirty){
this.setState({dirty:dirty, values:formValues});
if(this.props.onDirtyChange){
this.props.onDirtyChange(dirty, formValues);
}
},
save:function(){
var clientParams = {
get_action:"edit",
sub_action:"edit_plugin_options",
plugin_id:this.state.pluginId
};
var postParams = this.refs['formPanel'].getValuesForPOST(this.state.values);
if(postParams['DRIVER_OPTION_AJXP_PLUGIN_ENABLED']){
postParams['DRIVER_OPTION_AJXP_PLUGIN_ENABLED_ajxptype'] = "boolean";
}
clientParams = LangUtils.mergeObjectsRecursive(clientParams, postParams);
if(this.props.onBeforeSave){
this.props.onBeforeSave(clientParams);
}
PydioApi.getClient().request(clientParams, function(transport){
this.setState({dirty:false});
if(this.props.onAfterSave){
this.props.onAfterSave(transport);
}
}.bind(this));
},
revert:function(){
this.setState({dirty:false, values:this.state.originalValues});
if(this.props.onRevert){
this.props.onRevert(this.state.originalValues);
}
},
parameterHasHelper:function(paramName, testPluginId){
paramName = paramName.split('/').pop();
var h = PydioForm.Manager.hasHelper(PathUtils.getBasename(this.props.rootNode.getPath()), paramName);
if(!h && testPluginId){
h = PydioForm.Manager.hasHelper(testPluginId, paramName);
}
return h;
},
showHelper:function(helperData, testPluginId){
if(helperData){
var plugId = PathUtils.getBasename(this.props.rootNode.getPath());
if(testPluginId && !PydioForm.Manager.hasHelper(plugId, helperData['name'])){
helperData['pluginId'] = testPluginId;
}else{
helperData['pluginId'] = plugId;
}
helperData['updateCallback'] = this.helperUpdateValues.bind(this);
}
this.setState({helperData:helperData});
},
closeHelper:function(){
this.setState({helperData:null});
},
/**
* External helper can pass a full set of values and update them
* @param newValues
*/
helperUpdateValues:function(newValues){
this.onChange(newValues, true);
},
toggleDocPane: function(){
this.setState({docOpen:!this.state.docOpen});
},
monitorMainPaneScrolling:function(event){
if(event.target.className.indexOf('pydio-form-panel') === -1){
return;
}
var scroll = event.target.scrollTop;
var newState = (scroll > 5);
var currentScrolledState = (this.state && this.state.mainPaneScrolled);
if(newState != currentScrolledState){
this.setState({mainPaneScrolled:newState});
}
},
render: function(){
var addPanes = {top:[], bottom:[]};
if(this.props.additionalPanes){
addPanes.top = this.props.additionalPanes.top.slice();
addPanes.bottom = this.props.additionalPanes.bottom.slice();
}
var closeButton;
if(this.props.closeEditor){
closeButton = <RaisedButton label={this.context.getMessage('86','')} onTouchTap={this.props.closeEditor}/>
}
var doc = this.state.documentation;
if(doc && this.props.docAsAdditionalPane){
doc = doc.firstChild.nodeValue.replace('<p><ul', '<ul').replace('</ul></p>', '</ul>').replace('<p></p>', '');
doc = doc.replace('<img src="', '<img style="width:90%;" src="plugins/' + this.state.pluginId + '/');
var readDoc = function(){
return {__html:doc};
};
var docPane = (
<div className={"plugin-doc" + (this.state.docOpen?' plugin-doc-open':'')}>
<h3>Documentation</h3>
<div className="plugin-doc-pane" dangerouslySetInnerHTML={readDoc()}></div>
</div>
);
addPanes.top.push(docPane);
}
var scrollingClassName = '';
if(this.state && this.state.mainPaneScrolled){
scrollingClassName = ' main-pane-scrolled';
}
// Building a form
return (
<div className={(this.props.className?this.props.className+" ":"") + "main-layout-nav-to-stack vertical-layout plugin-board" + scrollingClassName} style={this.props.style}>
<ReactMUI.Paper className="left-nav" zDepth={0}>
<h1 className="admin-panel-title">{this.state.label}</h1>
<div className="buttons-cont" style={{padding:16}}>
<FlatButton secondary={true} disabled={!this.state.dirty} label={this.context.getMessage('plugins.6')} onTouchTap={this.revert}/>
<FlatButton secondary={true} disabled={!this.state.dirty} label={this.context.getMessage('plugins.5')} onTouchTap={this.save}/>
{closeButton}
</div>
<div className={"plugin-doc-pane"}>{this.state.description} {this.props.additionalDescription}</div>
</ReactMUI.Paper>
<PydioForm.FormPanel
ref="formPanel"
className="row-flex"
parameters={this.state.parameters}
values={this.state.values}
onChange={this.onChange}
disabled={false}
additionalPanes={addPanes}
tabs={this.props.tabs}
setHelperData={this.showHelper}
checkHasHelper={this.parameterHasHelper}
onScrollCallback={this.monitorMainPaneScrolling}
/>
<PydioForm.PydioHelper
helperData={this.state?this.state.helperData:null}
close={this.closeHelper}
/>
</div>
);
}
});
export {PluginEditor as default}
|
src/svg-icons/image/crop-original.js
|
pancho111203/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageCropOriginal = (props) => (
<SvgIcon {...props}>
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-5.04-6.71l-2.75 3.54-1.96-2.36L6.5 17h11l-3.54-4.71z"/>
</SvgIcon>
);
ImageCropOriginal = pure(ImageCropOriginal);
ImageCropOriginal.displayName = 'ImageCropOriginal';
ImageCropOriginal.muiName = 'SvgIcon';
export default ImageCropOriginal;
|
examples/sidebar/app.js
|
nkatsaros/react-router
|
var React = require('react');
var Router = require('react-router');
var { Route, DefaultRoute, RouteHandler, Link } = Router;
var data = require('./data');
var CategoryNav = React.createClass({
getInitialState: function () {
return { isOpen: this.props.defaultIsOpen};
},
getDefaultProps: function () {
return { isOpen: false };
},
componentWillReceiveProps: function (newProps) {
if (!this.state.isOpen)
this.setState({ isOpen: newProps.defaultIsOpen });
},
toggle: function () {
this.setState({ isOpen: !this.state.isOpen });
},
buildToggleClassName: function () {
var toggleClassName = 'CategoryNav__Toggle';
if (this.state.isOpen)
toggleClassName += ' CategoryNav__Toggle--is-open';
return toggleClassName;
},
renderItems: function () {
var category = this.props.category;
return this.state.isOpen ? category.items.map(function (item) {
var params = { name: item.name, category: category.name };
return (
<li key={item.name}>
<Link to="item" params={params}>{item.name}</Link>
</li>
);
}) : null;
},
render: function () {
var category = this.props.category;
return (
<div className="CategoryNav">
<h3
className={this.buildToggleClassName()}
onClick={this.toggle}
>{category.name}</h3>
<ul>{this.renderItems()}</ul>
</div>
);
}
});
var Sidebar = React.createClass({
renderCategory: function (category) {
return <CategoryNav
key={category.name}
defaultIsOpen={category.name === this.props.activeCategory}
category={category}
/>;
},
render: function () {
return (
<div className="Sidebar">
{this.props.categories.map(this.renderCategory)}
</div>
);
}
});
var App = React.createClass({
contextTypes: {
router: React.PropTypes.func.isRequired
},
render: function () {
var activeCategory = this.context.router.getCurrentParams().category;
return (
<div>
<Sidebar activeCategory={activeCategory} categories={data.getAll()}/>
<div className="Content">
<RouteHandler/>
</div>
</div>
);
}
});
var Item = React.createClass({
contextTypes: {
router: React.PropTypes.func.isRequired
},
render: function () {
var params = this.context.router.getCurrentParams();
var category = data.lookupCategory(params.category);
var item = data.lookupItem(params.category, params.name);
return (
<div>
<h2>{category.name} / {item.name}</h2>
<p>Price: ${item.price}</p>
</div>
);
}
});
var Index = React.createClass({
render: function () {
return (
<div>
<p>Sidebar features:</p>
<ul style={{maxWidth: '400px'}}>
<li>User can open/close categories</li>
<li>
Visiting an item on first page load will automatically open
the correct category. (Click an item, then reload the
browser.)
</li>
<li>
Navigating with forward/back buttons will open an active
category if it is not already open. (Navigate to several
items, close all the categories, then use back/forward
buttons.)
</li>
<li>
Only the user can close a category. (Navigating from an
active category will not close it.)
</li>
</ul>
</div>
);
}
});
var routes = (
<Route handler={App}>
<DefaultRoute handler={Index}/>
<Route name="item" path=":category/:name" handler={Item} />
</Route>
);
Router.run(routes, function (Handler) {
React.render(<Handler/>, document.getElementById('example'));
});
|
node_modules/material-ui/lib/svg-icons/action/shop.js
|
Sporks/Doc-tor
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);
var _svgIcon = require('../../svg-icon');
var _svgIcon2 = _interopRequireDefault(_svgIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ActionShop = _react2.default.createClass({
displayName: 'ActionShop',
mixins: [_reactAddonsPureRenderMixin2.default],
render: function render() {
return _react2.default.createElement(
_svgIcon2.default,
this.props,
_react2.default.createElement('path', { d: 'M16 6V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H2v13c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6h-6zm-6-2h4v2h-4V4zM9 18V9l7.5 4L9 18z' })
);
}
});
exports.default = ActionShop;
module.exports = exports['default'];
|
docs/src/app/components/pages/components/Avatar/Page.js
|
andrejunges/material-ui
|
import React from 'react';
import Title from 'react-title-component';
import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import avatarReadmeText from './README';
import AvatarExampleSimple from './ExampleSimple';
import avatarExampleSimpleCode from '!raw!./ExampleSimple';
import avatarCode from '!raw!material-ui/Avatar/Avatar';
const AvatarsPage = () => (
<div>
<Title render={(previousTitle) => `Avatar - ${previousTitle}`} />
<MarkdownElement text={avatarReadmeText} />
<CodeExample
code={avatarExampleSimpleCode}
title="Examples"
>
<AvatarExampleSimple />
</CodeExample>
<PropTypeDescription code={avatarCode} />
</div>
);
export default AvatarsPage;
|
app/views/Index.js
|
sysrex/sysrex
|
import React from 'react';
import { Link } from 'react-router-dom';
import Main from '../layouts/Main';
const Index = () => (
<Main>
<article className="post" id="index">
<header>
<div className="title">
<h2><Link to="/">About this site</Link></h2>
<p>Notes, thoughts and projects all built with express and react.</p>
</div>
</header>
<p> Welcome to my website. Please feel free to read more <Link to="/about">about me</Link>,
or you can check out my {' '}
<Link to="/resume">resume</Link>, {' '}
<Link to="/projects">projects</Link>, {' '}
view <Link to="/stats">site statistics</Link>, {' '}
or <Link to="/contact">contact</Link> me.</p>
<p> Source available <a href="https://github.com/sysrex/sysrex">here</a>.</p>
</article>
</Main>
);
export default Index;
|
examples/huge-apps/components/Dashboard.js
|
levjj/react-router
|
import React from 'react';
import { Link } from 'react-router';
class Dashboard extends React.Component {
render () {
let { courses } = this.props;
return (
<div>
<h2>Super Scalable Apps</h2>
<p>
Open the network tab as you navigate. Notice that only the amount of
your app that is required is actually downloaded as you navigate
around. Even the route configuration objects are loaded on the fly.
This way, a new route added deep in your app will not affect the
initial bundle of your application.
</p>
<h2>Courses</h2>{' '}
<ul>
{courses.map(course => (
<li key={course.id}>
<Link to={`/course/${course.id}`}>{course.name}</Link>
</li>
))}
</ul>
</div>
);
}
}
export default Dashboard;
|
src/Flags/Colombia.js
|
runjak/css-flags
|
// @flow
import React from 'react';
import LinearFlag from './LinearFlag';
import gradient from '../utils/gradient';
const yellow = '#FCD20F';
const blue = '#003694';
const red = '#CF0821';
export default function Colombia() {
return (
<LinearFlag
gradient={`${gradient([yellow, blue, red], [2, 1, 1])}`}
/>
);
}
|
docs/pages/discover-more/roadmap.js
|
mbrookes/material-ui
|
import * as React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import {
demos,
docs,
requireDemo,
} from '!@material-ui/markdown/loader!docs/src/pages/discover-more/roadmap/roadmap.md';
export default function Page() {
return <MarkdownDocs demos={demos} docs={docs} requireDemo={requireDemo} />;
}
|
node_modules/react-router/es6/IndexRoute.js
|
ajkhatibi/wheevy
|
import React from 'react';
import warning from './routerWarning';
import invariant from 'invariant';
import { createRouteFromReactElement as _createRouteFromReactElement } from './RouteUtils';
import { component, components, falsy } from './InternalPropTypes';
var func = React.PropTypes.func;
/**
* An <IndexRoute> is used to specify its parent's <Route indexRoute> in
* a JSX route config.
*/
var IndexRoute = React.createClass({
displayName: 'IndexRoute',
statics: {
createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) {
/* istanbul ignore else: sanity check */
if (parentRoute) {
parentRoute.indexRoute = _createRouteFromReactElement(element);
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'An <IndexRoute> does not make sense at the root of your route config') : void 0;
}
}
},
propTypes: {
path: falsy,
component: component,
components: components,
getComponent: func,
getComponents: func
},
/* istanbul ignore next: sanity check */
render: function render() {
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, '<IndexRoute> elements are for router configuration only and should not be rendered') : invariant(false) : void 0;
}
});
export default IndexRoute;
|
ajax/libs/graphiql/0.2.3/graphiql.min.js
|
cdnjs/cdnjs
|
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.GraphiQL=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function getLocation(r,e){for(var o,t=0,n=e,i=/\r\n|[\n\r]/g;(o=i.exec(r))&&o.index<e;)t+=1,n=e-(o.index+o[0].length);return _codemirror2.default.Pos(t,n)}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_jsonLint=require("./jsonLint");_codemirror2.default.registerHelper("lint","json",function(r){var e=_jsonLint.jsonLint(r);return e?[{message:e.message,severity:"error",from:getLocation(r,e.start),to:getLocation(r,e.end)}]:[]})},{"./jsonLint":2,codemirror:25}],2:[function(require,module,exports){"use strict";function jsonLint(e,r){string=e,strLen=e.length,end=-1;try{ch(),lex(),r?readVal():readObj(),expect("EOF")}catch(t){return t}}function readObj(){if(expect("{"),!skip("}")){do expect("String"),expect(":"),readVal();while(skip(","));expect("}")}}function readArr(){if(expect("["),!skip("]")){do readVal();while(skip(","));expect("]")}}function readVal(){switch(kind){case"[":return readArr();case"{":return readObj();case"String":return lex();default:return expect("Value")}}function syntaxError(e){return{message:e,start:start,end:end}}function expect(e){if(kind===e)return lex();throw syntaxError("Expected "+e+" but got "+string.slice(start,end)+".")}function skip(e){return kind===e?(lex(),!0):void 0}function ch(){strLen>end&&(end++,code=end===strLen?0:string.charCodeAt(end))}function lex(){for(;9===code||10===code||13===code||32===code;)ch();if(0===code)return void(kind="EOF");switch(start=end,code){case 34:return kind="String",readString();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return kind="Value",readNumber();case 102:if("false"!==string.slice(start,start+5))break;return end+=4,ch(),void(kind="Value");case 110:if("null"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Value");case 116:if("true"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Value")}kind=string[start],ch()}function readString(){for(ch();34!==code;)if(ch(),92===code)switch(ch(),code){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:ch();break;case 117:ch(),readHex(),readHex(),readHex(),readHex();break;default:throw syntaxError("Bad character escape sequence.")}else if(end===strLen)throw syntaxError("Unterminated string.");if(34===code)return void ch();throw syntaxError("Unterminated string.")}function readHex(){if(code>=48&&57>=code||code>=65&&70>=code||code>=97&&102>=code)return ch();throw syntaxError("Expected hexadecimal digit.")}function readNumber(){45===code&&ch(),48===code?ch():readDigits(),46===code&&(ch(),readDigits()),(69===code||101===code)&&(ch(),(43===code||45===code)&&ch(),readDigits())}function readDigits(){if(48>code||code>57)throw syntaxError("Expected decimal digit.");do ch();while(code>=48&&57>=code)}exports.__esModule=!0,exports.jsonLint=jsonLint;var string,strLen,start,end,code,kind},{}],3:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function renderType(e,t){return e instanceof _graphqlType.GraphQLNonNull?_react2.default.createElement("span",null,renderType(e.ofType,t),"!"):e instanceof _graphqlType.GraphQLList?_react2.default.createElement("span",null,"[",renderType(e.ofType,t),"]"):_react2.default.createElement("a",{className:"type-name",onClick:function(a){return t(e,a)}},e.name)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_marked=require("marked"),_marked2=_interopRequireDefault(_marked),_graphqlType=require("graphql/type"),DocExplorer=function(e){function t(){var a=this;_classCallCheck(this,t),e.call(this),this._onToggleBtnClick=function(){a.setState({expanded:!a.state.expanded})},this._onNavBackClick=function(){a.setState({navStack:a.state.navStack.slice(0,-1)})},this._onClickTypeOrField=function(e){a.showDoc(e)},this.state={navStack:[]}}return _inherits(t,e),t.prototype.showDoc=function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1]===e;a||(t=t.concat([e])),this.setState({navStack:t})},_createClass(t,null,[{key:"propTypes",value:{schema:_react.PropTypes.instanceOf(_graphqlType.GraphQLSchema)},enumerable:!0}]),t.prototype.shouldComponentUpdate=function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack},t.prototype.render=function(){var e,t=this.props.schema,a=this.state.navStack;a.length>0&&(e=a[a.length-1]);var r,n;e?(r=e.name,n=_graphqlType.isType(e)?_react2.default.createElement(TypeDoc,{key:e.name,type:e,onClickType:this._onClickTypeOrField,onClickField:this._onClickTypeOrField}):_react2.default.createElement(FieldDoc,{key:e.name,field:e,onClickType:this._onClickTypeOrField})):t&&(r="Documentation Explorer",n=_react2.default.createElement(SchemaDoc,{schema:t,onClickType:this._onClickTypeOrField}));var c;return 1===a.length?c="Schema":a.length>1&&(c=a[a.length-2].name),_react2.default.createElement("div",{className:"doc-explorer"},_react2.default.createElement("div",{className:"doc-explorer-title-bar"},c&&_react2.default.createElement("div",{className:"doc-explorer-back",onClick:this._onNavBackClick},c),_react2.default.createElement("div",{className:"doc-explorer-title"},r),_react2.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),_react2.default.createElement("div",{className:"doc-explorer-contents"},n))},t}(_react2.default.Component);exports.DocExplorer=DocExplorer;var SchemaDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.schema!==e.schema},t.prototype.render=function(){var e=this.props.schema,t=e.getQueryType(),a=e.getMutationType();return _react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:"A GraphQL schema provides a root type for each kind of operation."}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"root types"),_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"query"),": ",_react2.default.createElement(TypeLink,{type:t,onClick:this.props.onClickType})),a&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"mutation"),": ",_react2.default.createElement(TypeLink,{type:a,onClick:this.props.onClickType}))))},t}(_react2.default.Component),TypeDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.type!==e.type},t.prototype.render=function(){var e,t,a=this.props.type,r=this.props.onClickType||function(){},n=this.props.onClickField||function(){};a instanceof _graphqlType.GraphQLUnionType?(e="possible types",t=a.getPossibleTypes()):a instanceof _graphqlType.GraphQLInterfaceType?(e="implementations",t=a.getPossibleTypes()):a instanceof _graphqlType.GraphQLObjectType&&(e="implements",t=a.getInterfaces());var c;t&&t.length>0&&(c=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},e),t.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:e,onClick:r}))})));var l;if(a.getFields){var o=a.getFields(),i=Object.keys(o).map(function(e){return o[e]});l=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"fields"),i.map(function(e){var t;return e.args&&e.args.length>0&&(t=e.args.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))})),_react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(t){return n(e,a,t)}},e.name),t&&["(",_react2.default.createElement("span",null,t),")"],": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))}))}var s;return a instanceof _graphqlType.GraphQLEnumType&&(s=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"values"),a.getValues().map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",{className:"enum-value"},e.name),_react2.default.createElement(Description,{className:"doc-value-description",markdown:a.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:a.description||"No Description"}),a instanceof _graphqlType.GraphQLObjectType&&c,l,s,!(a instanceof _graphqlType.GraphQLObjectType)&&c)},t}(_react2.default.Component),FieldDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.field!==e.field},t.prototype.render=function(){var e,t=this,a=this.props.field;return a.args&&a.args.length>0&&(e=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"arguments"),a.args.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",null,_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:t.props.onClickType})),_react2.default.createElement(Description,{className:"doc-value-description",markdown:e.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:a.description||"No Description"}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"type"),_react2.default.createElement(TypeLink,{type:a.type,onClick:this.props.onClickType})),e)},t}(_react2.default.Component),TypeLink=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.type!==e.type},t.prototype.render=function(){return renderType(this.props.type,this.props.onClick)},t}(_react2.default.Component),Description=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.markdown!==e.markdown},t.prototype.render=function(){var e=this.props.markdown;if(!e)return _react2.default.createElement("div",null);var t=_marked2.default(e);return _react2.default.createElement("div",{className:this.props.className,dangerouslySetInnerHTML:{__html:t}})},t}(_react2.default.Component)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"graphql/type":137,marked:177}],4:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),ExecuteButton=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("button",{className:"execute-button",onClick:this.props.onClick,title:"Execute Query (Ctrl-Enter)"},_react2.default.createElement("svg",{width:"34",height:"34"},_react2.default.createElement("path",{d:"M 11 9 L 24 16 L 11 23 z"})))},t.prototype.componentDidMount=function(){var e=this;this.keyHandler=function(t){(t.metaKey||t.ctrlKey)&&13===t.keyCode&&(t.preventDefault(),e.props.onClick&&e.props.onClick())},document.addEventListener("keydown",this.keyHandler,!0)},t.prototype.componentWillUnmount=function(){document.removeEventListener("keydown",this.keyHandler,!0)},_createClass(t,null,[{key:"propTypes",value:{onClick:_react.PropTypes.func},enumerable:!0}]),t}(_react2.default.Component);exports.ExecuteButton=ExecuteButton}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_ExecuteButton=require("./ExecuteButton"),_QueryEditor=require("./QueryEditor"),_VariableEditor=require("./VariableEditor"),_ResultViewer=require("./ResultViewer"),_DocExplorer=require("./DocExplorer"),_graphqlType=require("graphql/type"),_graphqlUtilities=require("graphql/utilities"),_graphqlJsutilsFind=require("graphql/jsutils/find"),_graphqlJsutilsFind2=_interopRequireDefault(_graphqlJsutilsFind),_utilityFillLeafs=require("../utility/fillLeafs"),_utilityElementPosition=require("../utility/elementPosition"),GraphiQL=function(e){function t(r){var i=this;if(_classCallCheck(this,t),e.call(this),this._runEditorQuery=function(){i._editorQueryID++;var e=i._editorQueryID;i.autoCompleteLeafs(),i._fetchQuery(i.state.query,i.state.variables,function(t){e===i._editorQueryID&&i.setState({response:JSON.stringify(t,null,2)})})},this._onEditQuery=function(e){return i._storageSet("query",e),i.setState({query:e}),i.props.onEditQuery?i.props.onEditQuery(e):void 0},this._onEditVariables=function(e){i._storageSet("variables",e),i.setState({variables:e}),i.props.onEditVariables&&i.props.onEditVariables(e)},this._onHintInformationRender=function(e){e.addEventListener("click",i._onClickHintInformation);var t;e.addEventListener("DOMNodeRemoved",t=function(){e.removeEventListener("DOMNodeRemoved",t),e.removeEventListener("click",i._onClickHintInformation)})},this._onClickHintInformation=function(e){if("typeName"===e.target.className){var t=e.target.innerHTML,r=i.state.schema;if(r){var a=r.getType(t);a&&i.setState({docsOpen:!0},function(){i.refs.docExplorer.showDoc(a)})}}},this._onToggleDocs=function(){i.setState({docsOpen:!i.state.docsOpen})},this._onResizeStart=function(e){if(i._didClickDragBar(e)){e.preventDefault();var t=e.clientX-_utilityElementPosition.getLeft(e.target),r=function(e){if(0===e.buttons)return a();var r=_react2.default.findDOMNode(i.refs.editorBar),n=e.clientX-_utilityElementPosition.getLeft(r)-t,o=r.clientWidth-n;i.setState({editorFlex:n/o})},a=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){i._storageSet("editorFlex",i.state.editorFlex),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a),r=null,a=null});document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)}},this._onDocsResizeStart=function(e){e.preventDefault();var t=i.state.docsWidth,r=e.clientX-_utilityElementPosition.getLeft(e.target),a=function(e){if(0===e.buttons)return n();var t=_react2.default.findDOMNode(i),a=e.clientX-_utilityElementPosition.getLeft(t)-r,o=t.clientWidth-a;100>o?i.setState({docsOpen:!1}):i.setState({docsOpen:!0,docsWidth:Math.min(o,650)})},n=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){i.state.docsOpen?i._storageSet("docExplorerWidth",i.state.docsWidth):i.setState({docsWidth:t}),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",n),a=null,n=null});document.addEventListener("mousemove",a),document.addEventListener("mouseup",n)},this._onVariableResizeStart=function(e){e.preventDefault();var t=!1,r=i.state.variableEditorOpen,a=i.state.variableEditorHeight,n=e.clientY-_utilityElementPosition.getTop(e.target),o=function(e){if(0===e.buttons)return s();t=!0;var r=_react2.default.findDOMNode(i.refs.editorBar),o=e.clientY-_utilityElementPosition.getTop(r)-n,l=r.clientHeight-o;60>l?i.setState({variableEditorOpen:!1,variableEditorHeight:a}):i.setState({variableEditorOpen:!0,variableEditorHeight:l})},s=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){t?i._storageSet("variableEditorHeight",i.state.variableEditorHeight):i.setState({variableEditorOpen:!r}),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",s),o=null,s=null});document.addEventListener("mousemove",o),document.addEventListener("mouseup",s)},"function"!=typeof r.fetcher)throw new TypeError("GraphiQL requires a fetcher function.");this._storage=r.storage||window.localStorage;var a=r.query||this._storageGet("query")||r.defaultQuery||defaultQuery,n=r.variables||this._storageGet("variables");this.state={schema:r.schema,query:a,variables:n,response:null,editorFlex:this._storageGet("editorFlex")||1,variableEditorOpen:Boolean(n),variableEditorHeight:this._storageGet("variableEditorHeight")||200,docsOpen:!1,docsWidth:this._storageGet("docExplorerWidth")||350},this._editorQueryID=0}return _inherits(t,e),t.prototype.autoCompleteLeafs=function(){var e=_utilityFillLeafs.fillLeafs(this.state.schema,this.state.query,this.props.getDefaultFieldNames),t=e.insertions,r=e.result;if(t.length>0){var i=this.refs.queryEditor.getCodeMirror();i.operation(function(){var e=i.getCursor(),a=i.indexFromPos(e);i.setValue(r);var n=0,o=t.map(function(e){var t=e.index,r=e.string;return i.markText(i.posFromIndex(t+n),i.posFromIndex(t+(n+=r.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})});setTimeout(function(){return o.forEach(function(e){return e.clear()})},7e3);var s=a;t.forEach(function(e){var t=e.index,r=e.string;a>t&&(s+=r.length)});var l=i.posFromIndex(s);i.setCursor(l)})}},_createClass(t,null,[{key:"propTypes",value:{fetcher:_react.PropTypes.func.isRequired,schema:_react.PropTypes.instanceOf(_graphqlType.GraphQLSchema),query:_react.PropTypes.string,storage:_react.PropTypes.shape({getItem:_react.PropTypes.func,setItem:_react.PropTypes.func}),defaultQuery:_react.PropTypes.string,variables:_react.PropTypes.string,onEditQuery:_react.PropTypes.func,onEditVariables:_react.PropTypes.func,getDefaultFieldNames:_react.PropTypes.func},enumerable:!0}]),t.prototype.componentWillReceiveProps=function(e){var t=this.state.query,r=this.state.variables;e.query&&e.query!==t&&(t=e.query),e.variables&&e.variables!==r&&(r=e.variables),this.setState({query:t,variables:r})},t.prototype.componentDidMount=function(){var e=this;this.state.schema||this._fetchQuery(_graphqlUtilities.introspectionQuery,null,function(t){t.data?e.setState({schema:_graphqlUtilities.buildClientSchema(t.data)}):e.setState({response:JSON.stringify(t,null,2)})})},t.prototype.componentDidUpdate=function(e,t){(this.state.variableEditorOpen!==t.variableEditorOpen||this.state.variableEditorHeight!==t.variableEditorHeight)&&window.dispatchEvent(new Event("resize"))},t.prototype.render=function(){var e=[];_react2.default.Children.forEach(this.props.children,function(t){e.push(t)});var r=_graphqlJsutilsFind2.default(e,function(e){return e.type===t.Logo})||_react2.default.createElement(t.Logo,null),i=_graphqlJsutilsFind2.default(e,function(e){return e.type===t.Toolbar}),a=_graphqlJsutilsFind2.default(e,function(e){return e.type===t.Footer}),n={WebkitFlex:this.state.editorFlex,flex:this.state.editorFlex},o={display:this.state.docsOpen?"block":"none",width:this.state.docsWidth},s=this.state.variableEditorOpen,l={height:s?this.state.variableEditorHeight:null};return _react2.default.createElement("div",{id:"graphiql-container"},_react2.default.createElement("div",{className:"editorWrap"},_react2.default.createElement("div",{className:"topBarWrap"},_react2.default.createElement("div",{className:"topBar"},r,_react2.default.createElement(_ExecuteButton.ExecuteButton,{onClick:this._runEditorQuery}),i),!this.state.docsOpen&&_react2.default.createElement("button",{className:"docExplorerShow",onClick:this._onToggleDocs},"Docs")),_react2.default.createElement("div",{ref:"editorBar",className:"editorBar",onMouseDown:this._onResizeStart},_react2.default.createElement("div",{className:"queryWrap",style:n},_react2.default.createElement(_QueryEditor.QueryEditor,{ref:"queryEditor",schema:this.state.schema,value:this.state.query,onEdit:this._onEditQuery,onHintInformationRender:this._onHintInformationRender}),_react2.default.createElement("div",{className:"variable-editor",style:l},_react2.default.createElement("div",{className:"variable-editor-title",style:{cursor:s?"row-resize":"n-resize"},onMouseDown:this._onVariableResizeStart},"Query Variables"),_react2.default.createElement(_VariableEditor.VariableEditor,{value:this.state.variables,onEdit:this._onEditVariables}))),_react2.default.createElement("div",{className:"resultWrap"},_react2.default.createElement(_ResultViewer.ResultViewer,{ref:"result",value:this.state.response}),a))),_react2.default.createElement("div",{className:"docExplorerWrap",style:o},_react2.default.createElement("div",{className:"docExplorerResizer",onMouseDown:this._onDocsResizeStart}),_react2.default.createElement(_DocExplorer.DocExplorer,{ref:"docExplorer",schema:this.state.schema},_react2.default.createElement("div",{className:"docExplorerHide",onClick:this._onToggleDocs},"✕"))))},t.prototype._storageGet=function(e){return this._storage.getItem("graphiql:"+e)},t.prototype._storageSet=function(e,t){this._storage.setItem("graphiql:"+e,t)},t.prototype._fetchQuery=function(e,t,r){var i=this;this.props.fetcher({query:e,variables:t}).then(r).catch(function(e){i.setState({response:e&&e.stack||e})})},t.prototype._didClickDragBar=function(e){if(0!==e.button||e.ctrlKey)return!1;var t=e.target;if(0!==t.className.indexOf("CodeMirror-gutter"))return!1;for(var r=_react2.default.findDOMNode(this.refs.result);t;){if(t===r)return!0;t=t.parentNode}return!1},t}(_react2.default.Component);exports.GraphiQL=GraphiQL,GraphiQL.Logo=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("div",{className:"title"},this.props.children||_react2.default.createElement("span",null,"Graph",_react2.default.createElement("em",null,"i"),"QL"))},t}(_react2.default.Component),GraphiQL.Toolbar=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("div",{className:"toolbar"},this.props.children)},t}(_react2.default.Component),GraphiQL.Footer=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("div",{className:"footer"},this.props.children)},t}(_react2.default.Component);var defaultQuery="# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser IDE for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will\n# see intelligent typeaheads aware of the current GraphQL type schema and\n# live syntax and validation errors highlighted within the text.\n#\n# To bring up the auto-complete at any point, just press Ctrl-Space.\n#\n# Press the run button above, or Cmd-Enter to execute the query, and the result\n# will appear in the pane to the right.\n\n"}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/elementPosition":10,"../utility/fillLeafs":11,"./DocExplorer":3,"./ExecuteButton":4,"./QueryEditor":6,"./ResultViewer":7,"./VariableEditor":8,"graphql/jsutils/find":32,"graphql/type":137,"graphql/utilities":145}],6:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function renderType(e){return e instanceof _graphqlType.GraphQLNonNull?renderType(e.ofType)+"!":e instanceof _graphqlType.GraphQLList?"["+renderType(e.ofType)+"]":'<a class="typeName">'+e.name+"</a>"}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_marked=require("marked"),_marked2=_interopRequireDefault(_marked),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphqlType=require("graphql/type");require("codemirror/addon/hint/show-hint"),require("codemirror/addon/comment/comment"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror-graphql/hint"),require("codemirror-graphql/lint"),require("codemirror-graphql/mode");var QueryEditor=function(e){function t(r){var o=this;_classCallCheck(this,t),e.call(this),this._onKeyUp=function(e,t){var r=t.keyCode;(r>=65&&90>=r||!t.shiftKey&&r>=48&&57>=r||t.shiftKey&&189===r||t.shiftKey&&50===r||t.shiftKey&&57===r)&&o.editor.execCommand("autocomplete")},this._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},this._onHasCompletion=function(e,t){var r,i;_codemirror2.default.on(t,"select",function(t,n){if(!r){var a=n.parentNode,s=a.parentNode;r=document.createElement("div"),s.appendChild(r);var l=a.style.top,p="",d=e.cursorCoords().top;parseInt(l,10)<d&&(l="",p=window.innerHeight-d+3+"px"),r.className="CodeMirror-hints-wrapper",r.style.left=a.style.left,r.style.top=l,r.style.bottom=p,a.style.left="",a.style.top="",i=document.createElement("div"),i.className="CodeMirror-hint-information",p?(r.appendChild(i),r.appendChild(a)):(r.appendChild(a),r.appendChild(i));var c;r.addEventListener("DOMNodeRemoved",c=function(e){e.target===a&&(r.removeEventListener("DOMNodeRemoved",c),r.parentNode.removeChild(r),r=null,i=null,c=null)})}var u=t.description?_marked2.default(t.description,{smartypants:!0}):"Self descriptive.",h=t.type?'<span class="infoType">'+renderType(t.type)+"</span>":"";i.innerHTML='<div class="content">'+("<p>"===u.slice(0,3)?"<p>"+h+u.slice(3):h+u)+"</div>";var m=o.props.onHintInformationRender;m&&m(i)})},this.cachedValue=r.value||""}return _inherits(t,e),_createClass(t,null,[{key:"propTypes",value:{schema:_react.PropTypes.instanceOf(_graphqlType.GraphQLSchema),value:_react.PropTypes.string,onEdit:_react.PropTypes.func},enumerable:!0}]),t.prototype.getCodeMirror=function(){return this.editor},t.prototype.componentDidMount=function(){var e=this;this.editor=_codemirror2.default(_react2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql",theme:"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,foldGutter:{minFoldSize:4},lint:{schema:this.props.schema},hintOptions:{schema:this.props.schema,closeOnUnfocus:!1,completeSingle:!1},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit),this.editor.on("keyup",this._onKeyUp),this.editor.on("hasCompletion",this._onHasCompletion)},t.prototype.componentWillUnmount=function(){this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null},t.prototype.componentDidUpdate=function(e){this.ignoreChangeEvent=!0,this.props.schema!==e.schema&&(this.editor.options.lint.schema=this.props.schema,this.editor.options.hintOptions.schema=this.props.schema,_codemirror2.default.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),
this.ignoreChangeEvent=!1},t.prototype.render=function(){return _react2.default.createElement("div",{className:"query-editor"})},t}(_react2.default.Component);exports.QueryEditor=QueryEditor}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{codemirror:25,"codemirror-graphql/hint":12,"codemirror-graphql/lint":13,"codemirror-graphql/mode":14,"codemirror/addon/comment/comment":15,"codemirror/addon/edit/closebrackets":16,"codemirror/addon/edit/matchbrackets":17,"codemirror/addon/fold/brace-fold":18,"codemirror/addon/fold/foldgutter":20,"codemirror/addon/hint/show-hint":21,"codemirror/addon/lint/lint":22,"codemirror/keymap/sublime":24,"graphql/type":137,marked:177}],7:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}exports.__esModule=!0;var _createClass=function(){function e(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(r,t,o){return t&&e(r.prototype,t),o&&e(r,o),r}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/keymap/sublime"),require("codemirror/mode/javascript/javascript");var ResultViewer=function(e){function r(){_classCallCheck(this,r),e.apply(this,arguments)}return _inherits(r,e),r.prototype.componentDidMount=function(){this.viewer=_codemirror2.default(_react2.default.findDOMNode(this),{value:this.props.value||"",readOnly:!0,theme:"graphiql",mode:{name:"javascript",json:!0},keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-foldgutter"],extraKeys:{"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}})},r.prototype.componentWillUnmount=function(){this.viewer=null},r.prototype.shouldComponentUpdate=function(e){return this.props.value!==e.value},r.prototype.componentDidUpdate=function(){this.viewer.setValue(this.props.value||"")},r.prototype.render=function(){return _react2.default.createElement("div",{className:"result-window"})},_createClass(r,null,[{key:"propTypes",value:{value:_react.PropTypes.string},enumerable:!0}]),r}(_react2.default.Component);exports.ResultViewer=ResultViewer}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{codemirror:25,"codemirror/addon/fold/brace-fold":18,"codemirror/addon/fold/foldgutter":20,"codemirror/keymap/sublime":24,"codemirror/mode/javascript/javascript":26}],8:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}exports.__esModule=!0;var _createClass=function(){function e(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(r,t,o){return t&&e(r.prototype,t),o&&e(r,o),r}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror/mode/javascript/javascript"),require("../codemirror/lint/json-lint");var VariableEditor=function(e){function r(t){var o=this;_classCallCheck(this,r),e.call(this),this._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},this.cachedValue=t.value||""}return _inherits(r,e),_createClass(r,null,[{key:"propTypes",value:{value:_react.PropTypes.string,onEdit:_react.PropTypes.func},enumerable:!0}]),r.prototype.componentDidMount=function(){this.editor=_codemirror2.default(_react2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,theme:"graphiql",mode:{name:"javascript",json:!0},lint:!0,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit)},r.prototype.componentWillUnmount=function(){this.editor.off("change",this._onEdit),this.editor=null},r.prototype.componentDidUpdate=function(e){this.ignoreChangeEvent=!0,this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1},r.prototype.render=function(){return _react2.default.createElement("div",{className:"codemirrorWrap",ref:"codemirror"})},r}(_react2.default.Component);exports.VariableEditor=VariableEditor}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../codemirror/lint/json-lint":1,codemirror:25,"codemirror/addon/fold/brace-fold":18,"codemirror/addon/fold/foldgutter":20,"codemirror/addon/lint/lint":22,"codemirror/keymap/sublime":24,"codemirror/mode/javascript/javascript":26}],9:[function(require,module,exports){"use strict";module.exports=require("./components/GraphiQL").GraphiQL},{"./components/GraphiQL":5}],10:[function(require,module,exports){"use strict";function getLeft(t){for(var e=0,f=t;f.offsetParent;)e+=f.offsetLeft,f=f.offsetParent;return e}function getTop(t){for(var e=0,f=t;f.offsetParent;)e+=f.offsetTop,f=f.offsetParent;return e}exports.__esModule=!0,exports.getLeft=getLeft,exports.getTop=getTop},{}],11:[function(require,module,exports){"use strict";function fillLeafs(e,t,r){var i;try{i=_graphqlLanguage.parse(t)}catch(n){return t}var a=r||defaultGetDefaultFieldNames,l=[],u=new _graphqlUtilities.TypeInfo(e);return _graphqlLanguage.visit(i,{leave:function(e){u.leave(e)},enter:function(e){if(u.enter(e),"Field"===e.kind&&!e.selectionSet){var r=u.getType(),i=buildSelectionSet(r,a);if(i){var n=getIndentation(t,e.loc.start);l.push({index:e.loc.end,string:" "+_graphqlLanguage.print(i).replace(/\n/g,"\n"+n)})}}}}),{insertions:l,result:withInsertions(t,l)}}function defaultGetDefaultFieldNames(e){var t=e.getFields();if(t.id)return["id"];if(t.edges)return["edges"];if(t.node)return["node"];var r=[];return Object.keys(t).forEach(function(e){_graphqlType.isLeafType(t[e].type)&&r.push(e)}),r}function buildSelectionSet(e,t){if(e&&!_graphqlType.isLeafType(e)){var r=_graphqlType.getNamedType(e),i=t(r);if(Array.isArray(i)&&0!==i.length)return{kind:"SelectionSet",selections:i.map(function(e){var i=r.getFields()[e],n=i?i.type:null;return{kind:"Field",name:{kind:"Name",value:e},selectionSet:buildSelectionSet(n,t)}})}}}function withInsertions(e,t){if(0===t.length)return e;var r="",i=0;return t.forEach(function(t){var n=t.index,a=t.string;r+=e.slice(i,n)+a,i=n}),r+=e.slice(i)}function getIndentation(e,t){for(var r=t,i=t;r;){var n=e.charCodeAt(r-1);if(10===n||13===n||8232===n||8233===n)break;r--,9!==n&&11!==n&&12!==n&&32!==n&&160!==n&&(i=r)}return e.substring(r,i)}exports.__esModule=!0,exports.fillLeafs=fillLeafs;var _graphqlUtilities=require("graphql/utilities"),_graphqlLanguage=require("graphql/language"),_graphqlType=require("graphql/type")},{"graphql/language":38,"graphql/type":137,"graphql/utilities":145}],12:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTypeInfo(e,t){var r={type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return forEachState(t,function(t){switch(t.kind){case"Query":case"ShortQuery":r.type=e.getQueryType();break;case"Mutation":r.type=e.getMutationType();break;case"InlineFragment":case"FragmentDefinition":r.type=t.type&&e.getType(t.type);break;case"Field":r.fieldDef=r.type&&t.name?getFieldDef(e,r.parentType,t.name):null,r.type=r.fieldDef&&r.fieldDef.type;break;case"SelectionSet":r.parentType=_graphqlType.getNamedType(r.type);break;case"Directive":r.directiveDef=t.name&&e.getDirective(t.name);break;case"Arguments":r.argDefs="Field"===t.prevState.kind?r.fieldDef&&r.fieldDef.args:"Directive"===t.prevState.kind?r.directiveDef&&r.directiveDef.args:null;break;case"Argument":if(r.argDef=null,r.argDefs)for(var n=0;n<r.argDefs.length;n++)if(r.argDefs[n].name===t.name){r.argDef=r.argDefs[n];break}r.inputType=r.argDef&&r.argDef.type;break;case"ListValue":var i=_graphqlType.getNullableType(r.inputType);r.inputType=i instanceof _graphqlType.GraphQLList?i.ofType:null;break;case"ObjectValue":var a=_graphqlType.getNamedType(r.inputType);r.objectFieldDefs=a instanceof _graphqlType.GraphQLInputObjectType?a.getFields():null;break;case"ObjectField":var p=t.name&&r.objectFieldDefs?r.objectFieldDefs[t.name]:null;r.inputType=p&&p.type}}),r}function forEachState(e,t){for(var r=[],n=e;n&&n.kind;)r.push(n),n=n.prevState;for(var i=r.length-1;i>=0;i--)t(r[i])}function getFieldDef(e,t,r){return r===_graphqlTypeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_graphqlTypeIntrospection.SchemaMetaFieldDef:r===_graphqlTypeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_graphqlTypeIntrospection.TypeMetaFieldDef:r===_graphqlTypeIntrospection.TypeNameMetaFieldDef.name&&_graphqlType.isCompositeType(t)?_graphqlTypeIntrospection.TypeNameMetaFieldDef:t.getFields?t.getFields()[r]:void 0}function hintList(e,t,r,n,i){var a=filterAndSortList(i,normalizeText(n.string));if(a){var p=null===n.type?n.end:/\w/.test(n.string[0])?n.start:n.start+1,l={list:a,from:_codemirror2.default.Pos(r.line,p),to:_codemirror2.default.Pos(r.line,n.end)};return _codemirror2.default.signal(e,"hasCompletion",e,l,n),l}}function filterAndSortList(e,t){var r=t?e.map(function(e){return{proximity:getProximity(normalizeText(e.text),t),entry:e}}).filter(function(e){return e.proximity<=2}).sort(function(e,t){return e.proximity-t.proximity||e.entry.text.length-t.entry.text.length}).map(function(e){return e.entry}):e;return r.length>0?r:e}function normalizeText(e){return e.toLowerCase().replace(/\W/g,"")}function getProximity(e,t){var r=lexicalDistance(t,e);return e.length>t.length&&(r-=e.length-t.length-1,r+=0===e.indexOf(t)?0:.5),r}function lexicalDistance(e,t){var r,n,i=[],a=e.length,p=t.length;for(r=0;a>=r;r++)i[r]=[r];for(n=1;p>=n;n++)i[0][n]=n;for(r=1;a>=r;r++)for(n=1;p>=n;n++){var l=e[r-1]===t[n-1]?0:1;i[r][n]=Math.min(i[r-1][n]+1,i[r][n-1]+1,i[r-1][n-1]+l),r>1&&n>1&&e[r-1]===t[n-2]&&e[r-2]===t[n-1]&&(i[r][n]=Math.min(i[r][n],i[r-2][n-2]+l))}return i[a][p]}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphqlType=require("graphql/type"),_graphqlTypeIntrospection=require("graphql/type/introspection");_codemirror2.default.registerHelper("hint","graphql",function(e,t){var r=t.schema;if(r){var n=e.getCursor(),i=e.getTokenAt(n),a=getTypeInfo(r,i.state),p=i.state,l=p.kind,o=p.step;if("comment"!==i.type){if("Document"===l)return hintList(e,t,n,i,[{text:"query"},{text:"mutation"},{text:"fragment"},{text:"{"}]);if(("SelectionSet"===l||"Field"===l||"AliasedField"===l)&&a.parentType){var s;if(a.parentType.getFields){var u=a.parentType.getFields();s=Object.keys(u).map(function(e){return u[e]})}else s=[];return _graphqlType.isAbstractType(a.parentType)&&s.push(_graphqlTypeIntrospection.TypeNameMetaFieldDef),a.parentType===r.getQueryType()&&s.push(_graphqlTypeIntrospection.SchemaMetaFieldDef,_graphqlTypeIntrospection.TypeMetaFieldDef),hintList(e,t,n,i,s.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("Arguments"===l||"Argument"===l&&0===o){var f=a.argDefs;if(f)return hintList(e,t,n,i,f.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if(("ObjectValue"===l||"ObjectField"===l&&0===o)&&a.objectFieldDefs){var y=Object.keys(a.objectFieldDefs).map(function(e){return a.objectFieldDefs[e]});return hintList(e,t,n,i,y.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("EnumValue"===l||"ListValue"===l&&1===o||"ObjectField"===l&&2===o||"Argument"===l&&2===o){var c=_graphqlType.getNamedType(a.inputType);if(c instanceof _graphqlType.GraphQLEnumType){var g=c.getValues(),d=Object.keys(g).map(function(e){return g[e]});return hintList(e,t,n,i,d.map(function(e){return{text:e.name,type:c,description:e.description}}))}if(c===_graphqlType.GraphQLBoolean)return hintList(e,t,n,i,[{text:"true",type:_graphqlType.GraphQLBoolean,description:"Not false."},{text:"false",type:_graphqlType.GraphQLBoolean,description:"Not true."}])}if("FragmentDefinition"===l&&3===o||"InlineFragment"===l&&2===o||"NamedType"===l&&("FragmentDefinition"===p.prevState.kind||"InlineFragment"===p.prevState.kind)){var m;if(a.parentType)m=_graphqlType.isAbstractType(a.parentType)?a.parentType.getPossibleTypes():[a.parentType];else{var T=r.getTypeMap();m=Object.keys(T).map(function(e){return T[e]}).filter(_graphqlType.isCompositeType)}return hintList(e,t,n,i,m.map(function(e){return{text:e.name,description:e.description}}))}if("VariableDefinition"===l&&2===o||"ListType"===l&&1===o||"NamedType"===l&&("VariableDefinition"===p.prevState.kind||"ListType"===p.prevState.kind)){var h=r.getTypeMap(),D=Object.keys(h).map(function(e){return h[e]}).filter(_graphqlType.isInputType);return hintList(e,t,n,i,D.map(function(e){return{text:e.name,description:e.description}}))}if("Directive"===l){var v=r.getDirectives().filter(function(e){return e.onField&&"Field"===p.prevState.kind||e.onFragment&&("FragmentDefinition"===p.prevState.kind||"InlineFragment"===p.prevState.kind||"FragmentSpread"===p.prevState.kind)||e.onOperation&&("Query"===p.prevState.kind||"Mutation"===p.prevState.kind)});return hintList(e,t,n,i,v.map(function(e){return{text:e.name,description:e.description}}))}}}})},{codemirror:25,"graphql/type":137,"graphql/type/introspection":138}],13:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function errorAnnotations(r,e){return e.nodes.map(function(a){var o="Variable"!==a.kind&&a.name?a.name:a.variable?a.variable:a;return{message:e.message,severity:"error",type:"validation",from:r.posFromIndex(o.loc.start),to:r.posFromIndex(o.loc.end)}})}function mapCat(r,e){return Array.prototype.concat.apply([],r.map(e))}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphqlLanguage=require("graphql/language"),_graphqlValidation=require("graphql/validation");_codemirror2.default.registerHelper("lint","graphql",function(r,e,a){var o=e.schema;try{var t=_graphqlLanguage.parse(r)}catch(n){var i=n.locations[0],l=_codemirror2.default.Pos(i.line-1,i.column),u=a.getTokenAt(l);return[{message:n.message,severity:"error",type:"syntax",from:_codemirror2.default.Pos(i.line-1,u.start),to:_codemirror2.default.Pos(i.line-1,u.end)}]}var s=o?_graphqlValidation.validate(o,t):[];return mapCat(s,function(r){return errorAnnotations(a,r)})})},{codemirror:25,"graphql/language":38,"graphql/validation":152}],14:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getToken(e,t){if(t.needsAdvance&&(t.needsAdvance=!1,advanceRule(t)),e.sol()&&(t.indentLevel=Math.floor(e.indentation()/this.config.tabSize)),e.eatSpace()||e.eatWhile(","))return null;if(e.match(this.lineComment))return e.skipToEnd(),"comment";var n=lex(e);if(!n)return e.match(/\w+|./),"invalidchar";if(saveState(t),"Punctuation"===n.kind)if(/^[{([]/.test(n.value))t.levels=(t.levels||[]).concat(t.indentLevel+1);else if(/^[})\]]/.test(n.value)){var r=t.levels=(t.levels||[]).slice(0,-1);r.length>0&&r[r.length-1]<t.indentLevel&&(t.indentLevel=r[r.length-1])}for(;t.rule;){var i="function"==typeof t.rule?0===t.step?t.rule(n,e):null:t.rule[t.step];if(i){if(i.ofRule&&(i=i.ofRule),"string"==typeof i){pushRule(t,i);continue}if(i.match&&i.match(n))return i.update&&i.update(t,n),"Punctuation"===n.kind?advanceRule(t):t.needsAdvance=!0,i.style}unsuccessful(t)}return restoreState(t),"invalidchar"}function indent(e,t){var n=e.levels,r=n&&0!==n.length?n[n.length-1]-(this.electricInput.test(t)?1:0):e.indentLevel;return r*this.config.indentUnit}function assign(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++)e[n[r]]=t[n[r]];return e}function saveState(e){assign(stateCache,e)}function restoreState(e){assign(e,stateCache)}function pushRule(e,t){e.prevState=assign({},e),e.kind=t,e.name=null,e.type=null,e.rule=ParseRules[t],e.step=0}function popRule(e){e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.prevState=e.prevState.prevState}function advanceRule(e){for(e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)popRule(e),!e.rule||Array.isArray(e.rule)&&e.rule[e.step].isList||e.step++}function unsuccessful(e){for(;e.rule&&(!Array.isArray(e.rule)||!e.rule[e.step].ofRule);)popRule(e);e.rule&&advanceRule(e)}function lex(e){for(var t=Object.keys(LexRules),n=0;n<t.length;n++){var r=e.match(LexRules[t[n]]);if(r)return{kind:t[n],value:r[0]}}}function opt(e){return{ofRule:e}}function list(e){return{ofRule:e,isList:!0}}function t(e,t){return{style:t,match:function(t){return t.kind===e}}}function p(e,t){return{style:t||"punctuation",match:function(t){return"Punctuation"===t.kind&&t.value===e}}}function word(e){return{style:"keyword",match:function(t){return"Name"===t.kind&&t.value===e}}}function name(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,t){e.name=t.value}}}function type(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,t){e.type=t.value}}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);_codemirror2.default.defineMode("graphql",function(e){return{config:e,token:getToken,indent:indent,startState:function(){var e={level:0};return pushRule(e,"Document"),e},electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}});var stateCache={},LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|@|\[|\]|\{|\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/},ParseRules={Document:[list("Definition")],Definition:function(e){switch(e.value){case"query":return"Query";case"mutation":return"Mutation";case"fragment":return"FragmentDefinition";case"{":return"ShortQuery"}},Query:[word("query"),name("def"),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],ShortQuery:["SelectionSet"],Mutation:[word("mutation"),name("def"),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],VariableDefinitions:[p("("),list("VariableDefinition"),p(")")],VariableDefinition:["Variable",p(":"),"Type",opt("DefaultValue")],Variable:[p("$","variable"),name("variable")],DefaultValue:[p("="),"Value"],SelectionSet:[p("{"),list("Selection"),p("}")],Selection:function(e,t){return"..."===e.value?t.match(/[\s\u00a0,]*on\b/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("qualifier"),p(":"),"Field"],Field:[name("property"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Arguments:[p("("),list("Argument"),p(")")],Argument:[name("attribute"),p(":"),"Value"],FragmentSpread:[p("..."),name("def"),list("Directive")],InlineFragment:[p("..."),word("on"),type("atom"),list("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),name("def"),word("on"),type("atom"),list("Directive"),"SelectionSet"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"EnumValue"}},NumberValue:[t("Number","number")],StringValue:[t("String","string")],BooleanValue:[t("Name","builtin")],EnumValue:[name("string-2")],ListValue:[p("["),list("Value"),p("]")],ObjectValue:[p("{"),list("ObjectField"),p("}")],ObjectField:[name("attribute"),p(":"),"Value"],Type:function(e){return"["===e.value?"ListType":"NamedType"},ListType:[p("["),"NamedType",p("]"),opt(p("!"))],NamedType:[name("atom"),opt(p("!"))],Directive:[p("@","meta"),name("meta"),opt("Arguments")]}},{codemirror:25}],15:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.search(i);return-1==n?0:n}var t={},i=/[^\s\u00a0]/,l=e.Pos;e.commands.toggleComment=function(e){for(var n=1/0,t=e.listSelections(),i=null,o=t.length-1;o>=0;o--){var r=t[o].from(),a=t[o].to();r.line>=n||(a.line>=n&&(a=l(n,0)),n=r.line,null==i?e.uncomment(r,a)?i="un":(e.lineComment(r,a),i="line"):"un"==i?e.uncomment(r,a):e.lineComment(r,a))}},e.defineExtension("lineComment",function(e,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent)for(var t=f.slice(0,n(f)),o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);var r,a=this,m=a.getModeAt(e),c=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,a.lastLine()),f=Math.min(e.line,c),g=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var p=o.blockCommentStart||m.blockCommentStart,C=o.blockCommentEnd||m.blockCommentEnd;if(!p||!C)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(p),R=L.lastIndexOf(C);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(C)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(p,e.ch),M=-1==O?-1:k.slice(0,e.ch).indexOf(C,O+p.length);if(-1!=O&&-1!=M&&M+C.length!=e.ch)return!1;M=L.indexOf(C,n.ch);var E=L.slice(n.ch).lastIndexOf(p,M-n.ch);return O=-1==M||-1==E?-1:n.ch+E,-1!=M&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+C.length));var e=x+p.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!0)})})},{"../../lib/codemirror":25}],16:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=t(i,"pairs"),o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}for(var s=o.length-1;s>=0;s--){var f=o[s].head;n.replaceRange("",h(f.line,f.ch-1),h(f.line,f.ch+1))}}function a(n){var i=r(n),a=i&&t(i,"explode");if(!a||n.getOption("disableInput"))return e.Pass;for(var o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),o=n.listSelections();for(var e=0;e<o.length;e++){var t=o[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function o(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new h(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new h(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var a=r(n);if(!a||n.getOption("disableInput"))return e.Pass;var s=t(a,"pairs"),c=s.indexOf(i);if(-1==c)return e.Pass;for(var u,d,g=t(a,"triples"),p=s.charAt(c+1)==i,v=n.listSelections(),m=c%2==0,b=0;b<v.length;b++){var x,C=v[b],P=C.head,d=n.getRange(P,h(P.line,P.ch+1));if(m&&!C.empty())x="surround";else if(!p&&m||d!=i)if(p&&P.ch>1&&g.indexOf(i)>=0&&n.getRange(h(P.line,P.ch-2),P)==i+i&&(P.ch<=2||n.getRange(h(P.line,P.ch-3),h(P.line,P.ch-2))!=i))x="addFour";else if(p){if(e.isWordChar(d)||!f(n,P,i))return e.Pass;x="both"}else{if(!m||n.getLine(P.line).length!=P.ch&&!l(d,s)&&!/\s/.test(d))return e.Pass;x="both"}else x=g.indexOf(i)>=0&&n.getRange(P,h(P.line,P.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=x)return e.Pass}else u=x}var S=c%2?s.charAt(c-1):i,k=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=S+t[e]+k;n.replaceSelections(t,"around"),t=n.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=o(t[e]);n.setSelections(t)}else"both"==u?(n.replaceSelection(S+k,null),n.triggerElectric(S+k),n.execCommand("goCharLeft")):"addFour"==u&&(n.replaceSelection(S+S+S+S,"before"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function c(e,t){var n=e.getRange(h(t.line,t.ch-1),h(t.line,t.ch+1));return 2==n.length?n:null}function f(t,n,r){var i=t.getLine(n.line),a=t.getTokenAt(n);if(/\bstring2?\b/.test(a.type))return!1;var o=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(o.pos=o.start=a.start;;){var s=t.getMode().token(o,a.state);if(o.pos>=n.ch+1)return/\bstring2?\b/.test(s);o.start=o.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var d=u.pairs+"`",g={Backspace:i,Enter:a},p=0;p<d.length;p++)g["'"+d.charAt(p)+"'"]=n(d.charAt(p))})},{"../../lib/codemirror":25}],17:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){var o=e.getLineHandle(t.line),f=t.ch-1,l=f>=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),s=t.line;s!=h;s+=n){var m=e.getLine(s);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(s==t.line&&(d=t.ch-(0>n?1:0));d!=g;d+=n){var p=m.charAt(d);if(u.test(p)&&(void 0===i||e.getTokenTypeAt(a(s,d+1))==i)){var v=c[p];if(">"==v.charAt(1)==n>0)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l<f.length;l++){var u=f[l].empty()&&t(e,f[l].head,!1,i);if(u&&e.getLine(u.from.line).length<=r){var h=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";c.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:h})),u.to&&e.getLine(u.to.line).length<=r&&c.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:h}))}}if(c.length){o&&e.state.focused&&e.focus();var s=function(){e.operation(function(){for(var e=0;e<c.length;e++)c[e].clear()})};if(!n)return s;setTimeout(s,800)}}function r(e){e.operation(function(){f&&(f(),f=null),f=i(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)}),e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})})},{"../../lib/codemirror":25}],18:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(r,n){function t(t){for(var i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u<n.ch)break;if(o=r.getTokenTypeAt(e.Pos(l,u+1)),!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==s)break;s=1,i=f.length}}}var i,o,l=n.line,f=r.getLine(l),s="{",u="}",i=t("{");if(null==i&&(s="[",u="]",i=t("[")),null!=i){var a,d,c=1,g=r.lastLine();e:for(var v=l;g>=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),
0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),e.registerHelper("fold","include",function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})})},{"../../lib/codemirror":25}],19:[function(require,module,exports){!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,i,t,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.line<u)return null;for(var r=o.findMarksAt(e.from),t=0;t<r.length;++t)if(r[t].__isFold&&"fold"!==f){if(!n)return null;e.cleared=!0,r[t].clear()}return e}if(t&&t.call){var d=t;t=null}else var d=r(o,t,"rangeFinder");"number"==typeof i&&(i=n.Pos(i,0));var u=r(o,t,"minFoldSize"),a=l(!0);if(r(o,t,"scanUp"))for(;!a&&i.line>o.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){var c=e(o,t);n.on(c,"mousedown",function(o){s.clear(),n.e_preventDefault(o)});var s=o.markText(a.from,a.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});s.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,a.from,a.to)}}function e(n,o){var e=r(n,o,"widget");if("string"==typeof e){var i=document.createTextNode(e);e=document.createElement("span"),e.appendChild(i),e.className="CodeMirror-foldmarker"}return e}function r(n,o,e){if(o&&void 0!==o[e])return o[e];var r=n.options.foldOptions;return r&&void 0!==r[e]?r[e]:i[e]}n.newFoldFunction=function(n,e){return function(r,i){o(r,i,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e<o.length;++e)if(o[e].__isFold)return!0}),n.commands.toggleFold=function(n){n.foldCode(n.getCursor())},n.commands.fold=function(n){n.foldCode(n.getCursor(),null,"fold")},n.commands.unfold=function(n){n.foldCode(n.getCursor(),null,"unfold")},n.commands.foldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r<n.length;++r){var i=n[r](o,e);if(i)return i}}}),n.registerHelper("fold","auto",function(n,o){for(var e=n.getHelpers(o,"fold"),r=0;r<e.length;r++){var i=e[r](n,o);if(i)return i}});var i={rangeFinder:n.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};n.defineOption("foldOptions",null),n.defineExtension("foldOption",function(n,o){return r(this,n,o)})})},{"../../lib/codemirror":25}],20:[function(require,module,exports){!function(o){"object"==typeof exports&&"object"==typeof module?o(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],o):o(CodeMirror)}(function(o){"use strict";function t(o){this.options=o,this.from=this.to=0}function e(o){return o===!0&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o}function r(o,t){for(var e=o.findMarksAt(c(t)),r=0;r<e.length;++r)if(e[r].__isFold&&e[r].find().from.line==t)return e[r]}function n(o){if("string"==typeof o){var t=document.createElement("div");return t.className=o+" CodeMirror-guttermarker-subtle",t}return o.cloneNode(!0)}function i(o,t,e){var i=o.state.foldGutter.options,f=t,d=o.foldOption(i,"minFoldSize"),a=o.foldOption(i,"rangeFinder");o.eachLine(t,e,function(t){var e=null;if(r(o,f))e=n(i.indicatorFolded);else{var u=c(f,0),l=a&&a(o,u);l&&l.to.line-l.from.line>=d&&(e=n(i.indicatorOpen))}o.setGutterMarker(t,i.gutter,e),++f})}function f(o){var t=o.getViewport(),e=o.state.foldGutter;e&&(o.operation(function(){i(o,t.from,t.to)}),e.from=t.from,e.to=t.to)}function d(o,t,e){var n=o.state.foldGutter;if(n){var i=n.options;if(e==i.gutter){var f=r(o,t);f?f.clear():o.foldCode(c(t,0),i.rangeFinder)}}}function a(o){var t=o.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){f(o)},e.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var e=o.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?f(o):o.operation(function(){e.from<t.from&&(i(o,e.from,t.from),t.from=e.from),e.to>t.to&&(i(o,t.to,e.to),t.to=e.to)})},e.updateViewportTimeSpan||400)}}function l(o,t){var e=o.state.foldGutter;if(e){var r=t.line;r>=e.from&&r<e.to&&i(o,r,r+1)}}o.defineOption("foldGutter",!1,function(r,n,i){i&&i!=o.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",d),r.off("change",a),r.off("viewportChange",u),r.off("fold",l),r.off("unfold",l),r.off("swapDoc",f)),n&&(r.state.foldGutter=new t(e(n)),f(r),r.on("gutterClick",d),r.on("change",a),r.on("viewportChange",u),r.on("fold",l),r.on("unfold",l),r.on("swapDoc",f))});var c=o.Pos})},{"../../lib/codemirror":25,"./foldcode":19}],21:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function i(t,i){this.cm=t,this.options=this.buildOptions(i),this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(),this.startLen=this.cm.getLine(this.startPos.line).length;var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}function e(t){return"string"==typeof t?t:t.text}function n(t,i){function e(t,e){var o;o="string"!=typeof e?function(t){return e(t,i)}:n.hasOwnProperty(e)?n[e]:e,s[t]=o}var n={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(-i.menuSize()+1,!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close},o=t.options.customKeys,s=o?{}:n;if(o)for(var c in o)o.hasOwnProperty(c)&&e(c,o[c]);var h=t.options.extraKeys;if(h)for(var c in h)h.hasOwnProperty(c)&&e(c,h[c]);return s}function o(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function s(i,s){this.completion=i,this.data=s,this.picked=!1;var r=this,l=i.cm,a=this.hints=document.createElement("ul");a.className="CodeMirror-hints",this.selectedHint=s.selectedHint||0;for(var u=s.list,f=0;f<u.length;++f){var d=a.appendChild(document.createElement("li")),p=u[f],m=c+(f!=this.selectedHint?"":" "+h);null!=p.className&&(m=p.className+" "+m),d.className=m,p.render?p.render(d,s,p):d.appendChild(document.createTextNode(p.displayText||e(p))),d.hintId=f}var g=l.cursorCoords(i.options.alignWithWord?s.from:null),v=g.left,y=g.bottom,w=!0;a.style.left=v+"px",a.style.top=y+"px";var k=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),H=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(i.options.container||document.body).appendChild(a);var C=a.getBoundingClientRect(),b=C.bottom-H;if(b>0){var A=C.bottom-C.top,x=g.top-(g.bottom-C.top);if(x-A>0)a.style.top=(y=g.top-A)+"px",w=!1;else if(A>H){a.style.height=H-5+"px",a.style.top=(y=g.bottom-C.top)+"px";var T=l.getCursor();s.from.ch!=T.ch&&(g=l.cursorCoords(T),a.style.left=(v=g.left)+"px",C=a.getBoundingClientRect())}}var M=C.right-k;if(M>0&&(C.right-C.left>k&&(a.style.width=k-5+"px",M-=C.right-C.left-k),a.style.left=(v=g.left-M)+"px"),l.addKeyMap(this.keyMap=n(i,{moveFocus:function(t,i){r.changeActive(r.selectedHint+t,i)},setFocus:function(t){r.changeActive(t)},menuSize:function(){return r.screenAmount()},length:u.length,close:function(){i.close()},pick:function(){r.pick()},data:s})),i.options.closeOnUnfocus){var F;l.on("blur",this.onBlur=function(){F=setTimeout(function(){i.close()},100)}),l.on("focus",this.onFocus=function(){clearTimeout(F)})}var N=l.getScrollInfo();return l.on("scroll",this.onScroll=function(){var t=l.getScrollInfo(),e=l.getWrapperElement().getBoundingClientRect(),n=y+N.top-t.top,o=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return w||(o+=a.offsetHeight),o<=e.top||o>=e.bottom?i.close():(a.style.top=n+"px",void(a.style.left=v+N.left-t.left+"px"))}),t.on(a,"dblclick",function(t){var i=o(a,t.target||t.srcElement);i&&null!=i.hintId&&(r.changeActive(i.hintId),r.pick())}),t.on(a,"click",function(t){var e=o(a,t.target||t.srcElement);e&&null!=e.hintId&&(r.changeActive(e.hintId),i.options.completeOnSingleClick&&r.pick())}),t.on(a,"mousedown",function(){setTimeout(function(){l.focus()},20)}),t.signal(s,"select",u[0],a.firstChild),!0}var c="CodeMirror-hint",h="CodeMirror-hint-active";t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",function(e){if(!(this.listSelections().length>1||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var n=this.state.completionActive=new i(this,e);n.options.hint&&(t.signal(this,"startCompletion",this),n.update(!0))}});var r=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},l=window.cancelAnimationFrame||clearTimeout;i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(i,n){var o=i.list[n];o.hint?o.hint(this.cm,i,o):this.cm.replaceRange(e(o),o.from||i.from,o.to||i.to,"complete"),t.signal(i,"pick",o),this.close()},cursorActivity:function(){this.debounce&&(l(this.debounce),this.debounce=0);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch<this.startPos.ch||this.cm.somethingSelected()||t.ch&&this.options.closeCharacters.test(i.charAt(t.ch-1)))this.close();else{var e=this;this.debounce=r(function(){e.update()}),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick)if(this.options.hint.async){var i=++this.tick,e=this;this.options.hint(this.cm,function(n){e.tick==i&&e.finishUpdate(n,t)},this.options)}else this.finishUpdate(this.options.hint(this.cm,this.options),t)},finishUpdate:function(i,e){this.data&&t.signal(this.data,"update"),i&&this.data&&t.cmpPos(i.from,this.data.from)&&(i=null),this.data=i;var n=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),i&&i.list.length&&(n&&1==i.list.length?this.pick(i,0):(this.widget=new s(this,i),t.signal(i,"shown")))},buildOptions:function(t){var i=this.cm.options.hintOptions,e={};for(var n in a)e[n]=a[n];if(i)for(var n in i)void 0!==i[n]&&(e[n]=i[n]);if(t)for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}},s.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,e){if(i>=this.data.list.length?i=e?this.data.list.length-1:0:0>i&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+h,""),n=this.hints.childNodes[this.selectedHint=i],n.className+=" "+h,n.offsetTop<this.hints.scrollTop?this.hints.scrollTop=n.offsetTop-3:n.offsetTop+n.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",function(i,e){var n,o=i.getHelpers(i.getCursor(),"hint");if(o.length)for(var s=0;s<o.length;s++){var c=o[s](i,e);if(c&&c.list.length)return c}else if(n=i.getHelper(i.getCursor(),"hintWords")){if(n)return t.hint.fromList(i,{words:n})}else if(t.hint.anyword)return t.hint.anyword(i,e)}),t.registerHelper("hint","fromList",function(i,e){var n=i.getCursor(),o=i.getTokenAt(n),s=t.Pos(n.line,o.end);if(o.string&&/\w/.test(o.string[o.string.length-1]))var c=o.string,h=t.Pos(n.line,o.start);else var c="",h=s;for(var r=[],l=0;l<e.words.length;l++){var a=e.words[l];a.slice(0,c.length)==c&&r.push(a)}return r.length?{list:r,from:h,to:s}:void 0}),t.commands.autocomplete=t.showHint;var a={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)})},{"../../lib/codemirror":25}],22:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n){function o(e){return r.parentNode?(r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",void(r.style.left=e.clientX+5+"px")):t.off(document,"mousemove",o)}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),t.on(document,"mousemove",o),o(e),null!=r.style.opacity&&(r.style.opacity=1),r}function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(t){t.parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout(function(){n(t)},600))}function r(n,r,i){function a(){t.off(i,"mouseout",a),l&&(o(l),l=null)}var l=e(n,r),s=setInterval(function(){if(l)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}return l?void 0:clearInterval(s)},400);t.on(i,"mouseout",a)}function i(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)},this.waitingFor=0}function a(t,e){return e instanceof Function?{getAnnotations:e}:(e&&e!==!0||(e={}),e)}function l(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(y);for(var n=0;n<e.marked.length;++n)e.marked[n].clear();e.marked.length=0}function s(e,n,o,i){var a=document.createElement("div"),l=a;return a.className="CodeMirror-lint-marker-"+n,o&&(l=a.appendChild(document.createElement("div")),l.className="CodeMirror-lint-marker-multiple"),0!=i&&t.on(l,"mouseover",function(t){r(t,e,l)}),a}function u(t,e){return"error"==t?t:e}function c(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}function f(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message-"+e,n.appendChild(document.createTextNode(t.message)),n}function m(e,n,o){function r(){a=-1,e.off("change",r)}var i=e.state.lint,a=++i.waitingFor;e.on("change",r),n(e.getValue(),function(n,o){e.off("change",r),i.waitingFor==a&&(o&&n instanceof t&&(n=o),p(e,n))},o,e)}function d(e){var n=e.state.lint,o=n.options,r=o.options||o,i=o.getAnnotations||e.getHelper(t.Pos(0,0),"lint");i&&(o.async||i.async?m(e,i,r):p(e,i(e.getValue(),r,e)))}function p(t,e){l(t);for(var n=t.state.lint,o=n.options,r=c(e),i=0;i<r.length;++i){var a=r[i];if(a){for(var m=null,d=n.hasGutter&&document.createDocumentFragment(),p=0;p<a.length;++p){var v=a[p],h=v.severity;h||(h="error"),m=u(m,h),o.formatAnnotation&&(v=o.formatAnnotation(v)),n.hasGutter&&d.appendChild(f(v)),v.to&&n.marked.push(t.markText(v.from,v.to,{className:"CodeMirror-lint-mark-"+h,__annotation:v}))}n.hasGutter&&t.setGutterMarker(i,y,s(d,m,a.length>1,n.options.tooltips))}}o.onUpdateLinting&&o.onUpdateLinting(e,r,t)}function v(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(function(){d(t)},e.options.delay||500))}function h(t,e){var n=e.target||e.srcElement;r(e,f(t),n)}function g(t,e){var n=e.target||e.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className))for(var o=n.getBoundingClientRect(),r=(o.left+o.right)/2,i=(o.top+o.bottom)/2,a=t.findMarksAt(t.coordsChar({left:r,top:i},"client")),l=0;l<a.length;++l){var s=a[l].__annotation;if(s)return h(s,e)}}var y="CodeMirror-lint-markers";t.defineOption("lint",!1,function(e,n,o){if(o&&o!=t.Init&&(l(e),e.state.lint.options.lintOnChange!==!1&&e.off("change",v),t.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver),clearTimeout(e.state.lint.timeout),delete e.state.lint),n){for(var r=e.getOption("gutters"),s=!1,u=0;u<r.length;++u)r[u]==y&&(s=!0);var c=e.state.lint=new i(e,a(e,n),s);c.options.lintOnChange!==!1&&e.on("change",v),0!=c.options.tooltips&&t.on(e.getWrapperElement(),"mouseover",c.onMouseOver),d(e)}}),t.defineExtension("performLint",function(){this.state.lint&&d(this)})})},{"../../lib/codemirror":25}],23:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),r=r?e.clipPos(r):i(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;for(var o,s,l=e.getLine(r.line).slice(0,r.ch),h=0;;){t.lastIndex=h;var c=t.exec(l);if(!c)break;if(o=c,s=o.index,h=o.index+(o[0].length||1),h==l.length)break}var f=o&&o[0].length||0;f||(0==s&&0==l.length?o=void 0:s!=e.getLine(r.line).length&&f++)}else{t.lastIndex=r.ch;var l=e.getLine(r.line),o=t.exec(l),f=o&&o[0].length||0,s=o&&o.index;s+f==l.length||f||(f=1)}return o&&f?{from:i(r.line,s),to:i(r.line,s+f),match:o}:void 0};else{var s=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},h=t.split("\n");if(1==h.length)t.length?this.matches=function(r,o){if(r){var h=e.getLine(o.line).slice(0,o.ch),c=l(h),f=c.lastIndexOf(t);if(f>-1)return f=n(h,c,f),{from:i(o.line,f),to:i(o.line,f+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),c=l(h),f=c.indexOf(t);if(f>-1)return f=n(h,c,f)+o.ch,{from:i(o.line,f),to:i(o.line,f+s.length)}}}:this.matches=function(){};else{var c=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[r].length))!=h[h.length-1])return;for(var o=i(n.line,c[r].length),s=n.line-1,f=r-1;f>=1;--f,--s)if(h[f]!=l(e.getLine(s)))return;var u=e.getLine(s),a=u.length-c[0].length;if(l(u.slice(a))!=h[0])return;return{from:i(s,a),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),a=u.length-c[0].length;if(l(u.slice(a))==h[0]){for(var g=i(n.line,a),s=n.line+1,f=1;r>f;++f,++s)if(h[f]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,c[r].length))==h[r])return{from:g,to:i(s,c[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)}),e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)}),e.defineExtension("selectMatches",function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)})})},{"../../lib/codemirror":25}],24:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(0>r&&0==n.ch)return t.clipPos(h(n.line-1));var o=t.getLine(n.line);if(r>0&&n.ch>=o.length)return t.clipPos(h(n.line+1,0));for(var i,a="start",l=n.ch,s=0>r?0:o.length,c=0;l!=s;l+=r,c++){var f=o.charAt(0>r?l-1:l),u="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==u&&f.toUpperCase()==f&&(u="W"),"start"==a)"o"!=u&&(a="in",i=u);else if("in"==a&&i!=u){if("w"==i&&"W"==u&&0>r&&l--,"W"==i&&"w"==u&&r>0){i="w";continue}break}}return h(n.line,l)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):0>n?r.from():r.to()})}function r(e,t){e.operation(function(){for(var n=e.listSelections().length,r=[],o=-1,i=0;n>i;i++){var a=e.listSelections()[i].head;if(!(a.line<=o)){var l=h(a.line+(t?0:1),0);e.replaceRange("\n",l,null,"+insertLine"),e.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),o=a.line+1}}e.setSelections(r)})}function o(t,n){for(var r=n.ch,o=r,i=t.getLine(n.line);r&&e.isWordChar(i.charAt(r-1));)--r;for(;o<i.length&&e.isWordChar(i.charAt(o));)++o;return{from:h(n.line,r),to:h(n.line,o),word:i.slice(r,o)}}function i(e){var t=e.getCursor(),n=e.scanForBracket(t,-1);if(n)for(;;){var r=e.scanForBracket(t,1);if(!r)return;if(r.ch==g.charAt(g.indexOf(n.ch)+1))return e.setSelection(h(n.pos.line,n.pos.ch+1),r.pos,!1),!0;t=h(r.pos.line,r.pos.ch+1)}}function a(e,t){for(var n,r=e.listSelections(),o=[],i=0;i<r.length;i++){var a=r[i];if(!a.empty()){for(var l=a.from().line,s=a.to().line;i<r.length-1&&r[i+1].from().line==s;)s=a[++i].to().line;o.push(l,s)}}o.length?n=!0:o.push(e.firstLine(),e.lastLine()),e.operation(function(){for(var r=[],i=0;i<o.length;i+=2){var a=o[i],l=o[i+1],s=h(a,0),c=h(l),f=e.getRange(s,c,!1);t?f.sort():f.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),t>e?-1:e==t?0:1}),e.replaceRange(f,s,c),n&&r.push({anchor:s,head:c})}n&&e.setSelections(r,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),i=[],a=[],l=0;l<r.length;l++){var s=r[l];s.empty()?(i.push(l),a.push("")):a.push(n(t.getRange(s.from(),s.to())))}t.replaceSelections(a,"around","case");for(var c,l=i.length-1;l>=0;l--){var s=r[i[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var f=o(t,s.head);c=f.from,t.replaceRange(n(f.word),f.from,f.to)}}})}function s(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=o(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function c(e,t){var n=s(e);if(n){var r=n.query,o=e.getSearchCursor(r,t?n.to:n.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(r,t?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.keyMap.sublime={fallthrough:"default"},u=e.commands,h=e.Pos,d=e.keyMap.default==e.keyMap.macDefault,p=d?"Cmd-":"Ctrl-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)};var m=d?"Ctrl-Alt-":"Ctrl-";u[f[m+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},u[f[m+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},u[f["Shift-"+p+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var o=t[r].from(),i=t[r].to(),a=o.line;a<=i.line;++a)i.line>o.line&&a==i.line&&0==i.ch||n.push({anchor:a==o.line?o:h(a,0),head:a==i.line?i:h(a)});e.setSelections(n,0)},f["Shift-Tab"]="indentLess",u[f.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},u[f[p+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var o=t[r];n.push({anchor:h(o.from().line,0),head:h(o.to().line+1,0)})}e.setSelections(n)},f["Shift-"+p+"K"]="deleteLine",u[f[p+"Enter"]="insertLineAfter"]=function(e){r(e,!1)},u[f["Shift-"+p+"Enter"]="insertLineBefore"]=function(e){r(e,!0)},u[f[p+"D"]="selectNextOccurrence"]=function(t){var n=t.getCursor("from"),r=t.getCursor("to"),i=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,r)){var a=o(t,n);if(!a.word)return;t.setSelection(a.from,a.to),i=!0}else{var l=t.getRange(n,r),s=i?new RegExp("\\b"+l+"\\b"):l,c=t.getSearchCursor(s,r);c.findNext()?t.addSelection(c.from(),c.to()):(c=t.getSearchCursor(s,h(t.firstLine(),0)),c.findNext()&&t.addSelection(c.from(),c.to()))}i&&(t.state.sublimeFindFullWord=t.doc.sel)};var g="(){}[]";u[f["Shift-"+p+"Space"]="selectScope"]=function(e){i(e)||e.execCommand("selectAll")},u[f["Shift-"+p+"M"]="selectBetweenBrackets"]=function(t){return i(t)?void 0:e.Pass},u[f[p+"M"]="goToBracket"]=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var o=t.scanForBracket(n.head,-1);return o&&h(o.pos.line,o.pos.ch+1)||n.head})};var v=d?"Cmd-Ctrl-":"Shift-Ctrl-";u[f[v+"Up"]="swapLineUp"]=function(e){for(var t=e.listSelections(),n=[],r=e.firstLine()-1,o=[],i=0;i<t.length;i++){var a=t[i],l=a.from().line-1,s=a.to().line;o.push({anchor:h(a.anchor.line-1,a.anchor.ch),head:h(a.head.line-1,a.head.ch)}),0!=a.to().ch||a.empty()||--s,l>r?n.push(l,s):n.length&&(n[n.length-1]=s),r=s}e.operation(function(){for(var t=0;t<n.length;t+=2){var r=n[t],i=n[t+1],a=e.getLine(r);e.replaceRange("",h(r,0),h(r+1,0),"+swapLine"),i>e.lastLine()?e.replaceRange("\n"+a,h(e.lastLine()),null,"+swapLine"):e.replaceRange(a+"\n",h(i,0),null,"+swapLine")}e.setSelections(o),e.scrollIntoView()})},u[f[v+"Down"]="swapLineDown"]=function(e){for(var t=e.listSelections(),n=[],r=e.lastLine()+1,o=t.length-1;o>=0;o--){var i=t[o],a=i.to().line+1,l=i.from().line;0!=i.to().ch||i.empty()||a--,r>a?n.push(a,l):n.length&&(n[n.length-1]=l),r=l}e.operation(function(){for(var t=n.length-2;t>=0;t-=2){var r=n[t],o=n[t+1],i=e.getLine(r);r==e.lastLine()?e.replaceRange("",h(r-1),h(r),"+swapLine"):e.replaceRange("",h(r,0),h(r+1,0),"+swapLine"),e.replaceRange(i+"\n",h(o,0),null,"+swapLine")}e.scrollIntoView()})},f[p+"/"]="toggleComment",u[f[p+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var o=t[r],i=o.from(),a=i.line,l=o.to().line;r<t.length-1&&t[r+1].from().line==l;)l=t[++r].to().line;n.push({start:a,end:l,anchor:!o.empty()&&i})}e.operation(function(){for(var t=0,r=[],o=0;o<n.length;o++){for(var i,a=n[o],l=a.anchor&&h(a.anchor.line-t,a.anchor.ch),s=a.start;s<=a.end;s++){var c=s-t;s==a.end&&(i=h(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",h(c),h(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t)}r.push({anchor:l||i,head:i})}e.setSelections(r,0)})},u[f["Shift-"+p+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",h(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){a(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},u[f.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),a=e.findMarks(o,i),l=0;l<a.length;l++)if(a[l].sublimeBookmark){a[l].clear();for(var s=0;s<n.length;s++)n[s]==a[l]&&n.splice(s--,1);break}l==a.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},u[f["Shift-"+p+"F2"]="clearBookmarks"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},u[f["Alt-F2"]="selectBookmarks"]=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},f["Alt-Q"]="wrapLines";var S=p+"K ";f[S+p+"Backspace"]="delLineLeft",u[f.Backspace="smartBackspace"]=function(t){if(t.somethingSelected())return e.Pass;var n=t.getCursor(),r=t.getRange({line:n.line,ch:0},n),o=e.countColumn(r,null,t.getOption("tabSize")),i=t.getOption("indentUnit");if(r&&!/\S/.test(r)&&o%i==0){var a=new h(n.line,e.findColumn(r,o-i,i));return a.ch==n.ch?e.Pass:t.replaceRange("",a,n,"+delete")}return e.Pass},u[f[S+p+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[S+p+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},u[f[S+p+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},u[f[S+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[S+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[S+p+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;
if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},u[f[S+p+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},u[f[S+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[S+p+"G"]="clearBookmarks",u[f[S+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(h(r.head.line-1,r.head.ch))}})},u[f["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(h(r.head.line+1,r.head.ch))}})},u[f[p+"F3"]="findUnder"]=function(e){c(e,!0)},u[f["Shift-"+p+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},u[f["Alt-F3"]="findAllUnder"]=function(e){var t=s(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}},f["Shift-"+p+"["]="fold",f["Shift-"+p+"]"]="unfold",f[S+p+"0"]=f[S+p+"j"]="unfoldAll",f[p+"I"]="findIncremental",f["Shift-"+p+"I"]="findIncrementalReverse",f[p+"H"]="replace",f.F3="findNext",f["Shift-F3"]="findPrev",e.normalizeKeyMap(f)})},{"../addon/edit/matchbrackets":17,"../addon/search/searchcursor":23,"../lib/codemirror":25}],25:[function(require,module,exports){!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?Ei(n):{},Ei($o,n,!1),d(n);var i=n.value;"string"==typeof i&&(i=new bl(i,n.mode,null,n.lineSeparator)),this.doc=i;var o=new e.inputStyles[n.inputStyle](this),l=this.display=new t(r,i,o);l.wrapper.CodeMirror=this,u(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!To&&l.input.focus(),m(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ni,keySeq:null,specialChars:null};var a=this;go&&11>vo&&setTimeout(function(){a.display.input.reset(!0)},20),Gt(this),_i(),bt(this),this.curOp.forceUpdate=!0,$n(this,i),n.autofocus&&!To||a.hasFocus()?setTimeout(Ii(gr,this),20):vr(this);for(var c in qo)qo.hasOwnProperty(c)&&qo[c](this,n[c],Zo);C(this),n.finishInit&&n.finishInit(this);for(var h=0;h<tl.length;++h)tl[h](this);xt(this),mo&&n.lineWrapping&&"optimizelegibility"==getComputedStyle(l.lineDiv).textRendering&&(l.lineDiv.style.textRendering="auto")}function t(e,t,r){var n=this;this.input=r,n.scrollbarFiller=Bi("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=Bi("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=Bi("div",null,"CodeMirror-code"),n.selectionDiv=Bi("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=Bi("div",null,"CodeMirror-cursors"),n.measure=Bi("div",null,"CodeMirror-measure"),n.lineMeasure=Bi("div",null,"CodeMirror-measure"),n.lineSpace=Bi("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=Bi("div",[Bi("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=Bi("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=Bi("div",null,null,"position: absolute; height: "+Al+"px; width: 1px;"),n.gutters=Bi("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=Bi("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=Bi("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),go&&8>vo&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),mo||ho&&To||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Fe(e,100),e.state.modeGen++,e.curOp&&Pt(e)}function i(e){e.options.lineWrapping?(Xl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(jl(e.display.wrapper,"CodeMirror-wrap"),f(e)),l(e),Pt(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=mt(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/yt(e.display)-3);return function(i){if(xn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function l(e){var t=e.doc,r=o(e);t.iter(function(e){var t=r(e);t!=e.height&&Jn(e,t)})}function s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lt(e)}function a(e){u(e),Pt(e),setTimeout(function(){x(e)},20)}function u(e){var t=e.display.gutters,r=e.options.gutters;Gi(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(Bi("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function h(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=pn(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=gn(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,n=i.to.line,r+=n.text.length-i.to.ch}return r}function f(e){var t=e.display,r=e.doc;t.maxLine=qn(r,r.first),t.maxLineLength=h(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=h(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Oi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ve(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+je(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=Bi("div",[Bi("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Bi("div",[Bi("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Tl(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Tl(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,go&&8>vo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&jl(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Tl(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?nr(t,e):rr(t,e)},t),t.display.scrollbars.addClass&&Xl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ue(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ti(t,n),l=ti(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=ti(t,ri(qn(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=ti(t,ri(qn(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&r[l].gutter&&(r[l].gutter.style.left=o);var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function C(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=S(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(Bi("div",[Bi("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",c(e),!0}return!1}function S(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function T(e,t,r){var n=e.display;this.viewport=t,this.visible=w(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Xe(e),this.force=r,this.dims=H(e),this.events=[]}function k(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=je(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=je(e)+"px",t.scrollbarsClipped=!0)}function M(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return It(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Bt(e))return!1;C(e)&&(It(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Do&&(o=bn(e.doc,o),l=wn(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Rt(e,o,l),r.viewOffset=ri(qn(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Bt(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Vi();return a>4&&(r.lineDiv.style.display="none"),P(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&Vi()!=u&&u.offsetHeight&&u.focus(),Gi(r.cursorDiv),Gi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Fe(e,400)),r.updateLineNumbers=null,!0}function N(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Xe(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ve(e.display)-_e(e),r.top)}),t.visible=w(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);n=!1){O(e);var i=p(e);He(e),W(e,i),y(e,i)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var r=new T(e,t);if(M(e,r)){O(e),N(e,r);var n=p(e);He(e),W(e,n),y(e,n),r.finish()}}function W(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+je(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i,o=t.view[n];if(!o.hidden){if(go&&8>vo){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=mt(t)),(a>.001||-.001>a)&&(Jn(o.line,i),D(o.line),o.rest))for(var u=0;u<o.rest.length;u++)D(o.rest[u])}}}function D(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function H(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:L(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function P(e,t,r){function n(t){var r=t.nextSibling;return mo&&ko&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var i=e.display,o=e.options.lineNumbers,l=i.lineDiv,s=l.firstChild,a=i.view,u=i.viewFrom,c=0;c<a.length;c++){var h=a[c];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=n(s);var f=o&&null!=t&&u>=t&&h.lineNumber;h.changes&&(Oi(h.changes,"gutter")>-1&&(f=!1),E(e,h,u,r)),f&&(Gi(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=h.node.nextSibling}else{var d=V(e,h,u,r);l.insertBefore(d,s)}u+=h.size}for(;s;)s=n(s)}function E(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?R(e,t):"gutter"==o?G(e,t,r,n):"class"==o?B(t):"widget"==o&&U(e,t,n)}t.changes=null}function I(e){return e.node==e.text&&(e.node=Bi("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),go&&8>vo&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=I(e);e.background=r.insertBefore(Bi("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):zn(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=I(t);t.gutterBackground=Bi("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),l=t.gutter=Bi("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),i.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(Bi("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var a=e.options.gutters[s],u=o.hasOwnProperty(a)&&o[a];u&&l.appendChild(Bi("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[a]+"px; width: "+n.gutterWidth[a]+"px"))}}}function U(e,t,r){t.alignable&&(t.alignable=null);for(var n,i=t.node.firstChild;i;i=n){var n=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}K(e,t,r)}function V(e,t,r,n){var i=F(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),B(t),G(e,t,r,n),K(e,t,n),t.node}function K(e,t,r){if(j(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)j(e,t.rest[n],t,r,!1)}function j(e,t,r,n,i){if(t.widgets)for(var o=I(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=Bi("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),X(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Ci(a,"redraw")}}function X(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function _(e){return Ho(e.line,e.ch)}function Y(e,t){return Po(e,t)<0?t:e}function $(e,t){return Po(e,t)<0?e:t}function q(e){e.state.focused||(e.display.input.focus(),gr(e))}function Z(e){return e.options.readOnly||e.doc.cantEdit}function Q(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=o.splitLines(t),a=null;if(l&&n.ranges.length>1)if(Eo&&Eo.join("\n")==t){if(n.ranges.length%Eo.length==0){a=[];for(var u=0;u<Eo.length;u++)a.push(o.splitLines(Eo[u]))}}else s.length==n.ranges.length&&(a=Di(s,function(e){return[e]}));for(var u=n.ranges.length-1;u>=0;u--){var c=n.ranges[u],h=c.from(),f=c.to();c.empty()&&(r&&r>0?h=Ho(h.line,h.ch-r):e.state.overwrite&&!l&&(f=Ho(f.line,Math.min(qn(o,f.line).text.length,f.ch+Wi(s).length))));var d=e.curOp.updateInput,p={from:h,to:f,text:a?a[u%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Lr(e.doc,p),Ci(e,"inputRead",e,p)}t&&!l&&ee(e,t),Ir(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");return r?(e.preventDefault(),Z(t)||t.options.disableInput||Nt(t,function(){Q(t,r,0,null,"paste")}),!0):void 0}function ee(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Fr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(qn(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Fr(e,i.head.line,"smart"));l&&Ci(e,"electricInput",e,i.head.line)}}}function te(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:Ho(i,0),head:Ho(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function re(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ne(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ni,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ie(){var e=Bi("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Bi("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return mo?e.style.width="1000px":e.setAttribute("wrap","off"),Lo&&(e.style.border="1px solid black"),re(e),t}function oe(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ni,this.gracePeriod=!1}function le(e,t){var r=Qe(e,t.line);if(!r||r.hidden)return null;var n=qn(e.doc,t.line),i=$e(r,n,t.line),o=ni(n),l="left";if(o){var s=so(o,t.ch);l=s%2?"right":"left"}var a=tt(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function se(e,t){return t&&(e.bad=!0),e}function ae(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return se(e.clipPos(Ho(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return ue(o,t,r)}}function ue(e,t,r){function n(t,r,n){for(var i=-1;i<(c?c.length:0);i++)for(var o=0>i?u.map:c[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var a=ei(0>i?e.line:e.rest[i]),h=o[l]+n;return(0>n||s!=t)&&(h=o[l+(n?1:0)]),Ho(a,h)}}}var i=e.text.firstChild,o=!1;if(!t||!Ul(i,t))return se(Ho(ei(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?Wi(e.rest):e.line;return se(Ho(ei(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,h=n(s,a,r);if(h)return se(h,o);for(var f=a.nextSibling,d=s?s.nodeValue.length-r:0;f;f=f.nextSibling){if(h=n(f,f.firstChild,0))return se(Ho(h.line,h.ch-d),o);d+=f.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(h=n(p,p.firstChild,-1))return se(Ho(h.line,h.ch+d),o);d+=f.textContent.length}}function ce(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var c,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(Ho(n,0),Ho(i+1,0),o(+h));return void(f.length&&(c=f[0].find())&&(s+=Zn(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)l(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(a=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;a&&(s+=u,a=!1),s+=p}}for(var s="",a=!1,u=e.doc.lineSeparator();l(t),t!=r;)t=t.nextSibling;return s}function he(e,t){this.ranges=e,this.primIndex=t}function fe(e,t){this.anchor=e,this.head=t}function de(e,t){var r=e[t];e.sort(function(e,t){return Po(e.from(),t.from())}),t=Oi(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(Po(o.to(),i.from())>=0){var l=$(o.from(),i.from()),s=Y(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new fe(a?s:l,a?l:s))}}return new he(e,t)}function pe(e,t){return new he([new fe(e,t||e)],0)}function ge(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ve(e,t){if(t.line<e.first)return Ho(e.first,0);var r=e.first+e.size-1;return t.line>r?Ho(r,qn(e,r).text.length):me(t,qn(e,t.line).text.length)}function me(e,t){var r=e.ch;return null==r||r>t?Ho(e.line,t):0>r?Ho(e.line,0):e}function ye(e,t){return t>=e.first&&t<e.first+e.size}function be(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ve(e,t[n]);return r}function we(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=Po(r,i)<0;o!=Po(n,i)<0?(i=r,r=n):o!=Po(r,n)<0&&(r=n)}return new fe(i,r)}return new fe(n||r,r)}function xe(e,t,r,n){Me(e,new he([we(e,e.sel.primary(),t,r)],0),n)}function Ce(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=we(e,e.sel.ranges[i],t[i],null);var o=de(n,e.sel.primIndex);Me(e,o,r)}function Se(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Me(e,de(i,e.sel.primIndex),n)}function Le(e,t,r,n){Me(e,pe(t,r),n)}function Te(e,t){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new fe(ve(e,t[r].anchor),ve(e,t[r].head))}};return Ml(e,"beforeSelectionChange",e,r),e.cm&&Ml(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?de(r.ranges,r.ranges.length-1):t}function ke(e,t,r){var n=e.history.done,i=Wi(n);i&&i.ranges?(n[n.length-1]=t,Ne(e,t,r)):Me(e,t,r)}function Me(e,t,r){Ne(e,t,r),ci(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Ne(e,t,r){(ki(e,"beforeSelectionChange")||e.cm&&ki(e.cm,"beforeSelectionChange"))&&(t=Te(e,t));var n=r&&r.bias||(Po(t.primary().head,e.sel.primary().head)<0?-1:1);Ae(e,Oe(e,t,n,!0)),r&&r.scroll===!1||!e.cm||Ir(e.cm)}function Ae(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ti(e.cm)),Ci(e,"cursorActivity",e))}function We(e){Ae(e,Oe(e,e.sel,null,!1),Ol)}function Oe(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=De(e,l.anchor,r,n),a=De(e,l.head,r,n);(i||s!=l.anchor||a!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new fe(s,a))}return i?de(i,t.primIndex):t}function De(e,t,r,n){var i=!1,o=t,l=r||1;e.cantEdit=!1;e:for(;;){var s=qn(e,o.line);if(s.markedSpans)for(var a=0;a<s.markedSpans.length;++a){var u=s.markedSpans[a],c=u.marker;if((null==u.from||(c.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(c.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(n&&(Ml(c,"beforeCursorEnter"),c.explicitlyCleared)){if(s.markedSpans){--a;continue}break}if(!c.atomic)continue;var h=c.find(0>l?-1:1);if(0==Po(h,o)&&(h.ch+=l,h.ch<0?h=h.line>e.first?ve(e,Ho(h.line-1)):null:h.ch>s.text.length&&(h=h.line<e.first+e.size-1?Ho(h.line+1,0):null),!h)){if(i)return n?(e.cantEdit=!0,Ho(e.first,0)):De(e,t,r,!0);i=!0,h=t,l=-l}o=h;continue e}}return o}}function He(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Pe(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t!==!1||l!=r.sel.primIndex){var s=r.sel.ranges[l],a=s.empty();(a||e.options.showCursorWhenSelecting)&&Ee(e,s.head,i),a||Ie(e,s,o)}return n}function Ee(e,t,r){var n=ft(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(Bi("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(Bi("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Ie(e,t,r){function n(e,t,r,n){0>t&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(Bi("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ht(e,Ho(t,r),"div",h,n)}var s,a,h=qn(l,t),f=h.text.length;return Qi(ni(h),r||0,null==i?f:i,function(e,t,l){var h,d,p,g=o(e,"left");if(e==t)h=g,d=p=g.left;else{if(h=o(t-1,"right"),"rtl"==l){var v=g;g=h,h=v}d=g.left,p=h.right}null==r&&0==e&&(d=u),h.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottom<h.top&&n(d,g.bottom,null,h.top)),null==i&&t==f&&(p=c),(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g),(!a||h.bottom>a.bottom||h.bottom==a.bottom&&h.right>a.right)&&(a=h),u+1>d&&(d=u),n(d,h.top,p-d,h.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=Ke(e.display),u=a.left,c=Math.max(o.sizerWidth,Xe(e)-o.sizer.offsetLeft)-a.right,h=t.from(),f=t.to();if(h.line==f.line)i(h.line,h.ch,f.ch);else{var d=qn(l,h.line),p=qn(l,f.line),g=mn(d)==mn(p),v=i(h.line,h.ch,g?d.text.length+1:null).end,m=i(f.line,g?0:null,f.ch).start;g&&(v.top<m.top-2?(n(v.right,v.top,null,v.bottom),n(u,m.top,m.left,m.bottom)):n(v.right,v.top,m.left-v.right,v.bottom)),v.bottom<m.top&&n(u,v.bottom,null,m.top)}r.appendChild(s)}function ze(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Fe(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Ii(Re,e))}function Re(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=nl(t.mode,Ge(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength,a=Hn(e,o,s?nl(t.mode,n):n,!0);o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(t.frontier),o.stateAfter=s?n:nl(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&En(e,o.text,n),o.stateAfter=t.frontier%5==0?nl(t.mode,n):null;return++t.frontier,+new Date>r?(Fe(e,e.options.workDelay),!0):void 0}),i.length&&Nt(e,function(){for(var t=0;t<i.length;t++)Et(e,i[t],"text")})}}function Be(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=qn(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Pl(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Ge(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Be(e,t,r),l=o>n.first&&qn(n,o-1).stateAfter;return l=l?nl(n.mode,l):il(n.mode),n.iter(o,t,function(r){En(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=s?nl(n.mode,l):null,++o}),r&&(n.frontier=o),l}function Ue(e){return e.lineSpace.offsetTop}function Ve(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ke(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ui(e.measure,Bi("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function je(e){return Al-e.display.nativeBarWidth}function Xe(e){return e.display.scroller.clientWidth-je(e)-e.display.barWidth}function _e(e){return e.display.scroller.clientHeight-je(e)-e.display.barHeight}function Ye(e,t,r){var n=e.options.lineWrapping,i=n&&Xe(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function $e(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var n=0;n<e.rest.length;n++)if(ei(e.rest[n])>r)return{
map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function qe(e,t){t=mn(t);var r=ei(t),n=e.display.externalMeasured=new Dt(e.doc,t,r);n.lineN=r;var i=n.built=zn(e,n);return n.text=i.pre,Ui(e.display.lineMeasure,i.pre),n}function Ze(e,t,r,n){return et(e,Je(e,t),r,n)}function Qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[zt(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Je(e,t){var r=ei(t),n=Qe(e,r);n&&!n.text?n=null:n&&n.changes&&(E(e,n,r,H(e)),e.curOp.forceUpdate=!0),n||(n=qe(e,t));var i=$e(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function et(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ye(e,t.view,t.rect),t.hasHeights=!0),o=rt(e,t,r,n),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function tt(e,t,r){for(var n,i,o,l,s=0;s<e.length;s+=3){var a=e[s],u=e[s+1];if(a>t?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;s<e.length-3&&e[s+3]==e[s+4]&&!e[s+5].insertLeft;)n=e[(s+=3)+2],l="right";break}}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:u}}function rt(e,t,r,n){var i,o=tt(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;4>c;c++){for(;s&&Ri(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&Ri(t.line.text.charAt(o.coverStart+a));)++a;if(go&&9>vo&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(go&&e.options.lineWrapping){var h=Fl(l,s,a).getClientRects();i=h.length?h["right"==n?h.length-1:0]:Ro}else i=Fl(l,s,a).getBoundingClientRect()||Ro;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}go&&11>vo&&(i=nt(e.display.measure,i))}else{s>0&&(u=n="right");var h;i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(go&&9>vo&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+yt(e.display),top:f.top,bottom:f.bottom}:Ro}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;c<v.length-1&&!(g<v[c]);c++);var m=c?v[c-1]:0,y=v[c],b={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:m,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=d,b.rbottom=p),b}function nt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Zi(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function it(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ot(e){e.display.externalMeasure=null,Gi(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)it(e.display.view[t])}function lt(e){ot(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function at(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Ln(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=ri(t);if("local"==n?l+=Ue(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:at());var a=s.left+("window"==n?0:st());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function ct(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=st(),i-=at();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function ht(e,t,r,n,i){return n||(n=qn(e.doc,t.line)),ut(e,n,Ze(e,n,t.ch,i),r)}function ft(e,t,r,n,i,o){function l(t,l){var s=et(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,ut(e,n,s,r)}function s(e,t){var r=a[t],n=r.level%2;return e==Ji(r)&&t&&r.level<a[t-1].level?(r=a[--t],e=eo(r)-(r.level%2?0:1),n=!0):e==eo(r)&&t<a.length-1&&r.level<a[t+1].level&&(r=a[++t],e=Ji(r)-r.level%2,n=!1),n&&e==r.to&&e>r.from?l(e-1):l(e,n)}n=n||qn(e.doc,t.line),i||(i=Je(e,n));var a=ni(n),u=t.ch;if(!a)return l(u);var c=so(a,u),h=s(u,c);return null!=es&&(h.other=s(u,es)),h}function dt(e,t){var r=0,t=ve(e.doc,t);e.options.lineWrapping||(r=yt(e.display)*t.ch);var n=qn(e.doc,t.line),i=ri(n)+Ue(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function pt(e,t,r,n){var i=Ho(e,t);return i.xRel=n,r&&(i.outside=!0),i}function gt(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return pt(n.first,0,!0,-1);var i=ti(n,r),o=n.first+n.size-1;if(i>o)return pt(n.first+n.size-1,qn(n,o).text.length,!0,1);0>t&&(t=0);for(var l=qn(n,i);;){var s=vt(e,l,i,t,r),a=gn(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=ei(l=u.to.line)}}function vt(e,t,r,n,i){function o(n){var i=ft(e,Ho(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:l<i.top?i.left+a:(s=!1,i.left)}var l=i-ri(t),s=!1,a=2*e.display.wrapper.clientWidth,u=Je(e,t),c=ni(t),h=t.text.length,f=to(t),d=ro(t),p=o(f),g=s,v=o(d),m=s;if(n>v)return pt(r,d,m,1);for(;;){if(c?d==f||d==uo(t,f,1):1>=d-f){for(var y=p>n||v-n>=n-p?f:d,b=n-(y==f?p:v);Ri(t.text.charAt(y));)++y;var w=pt(r,y,y==f?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(h/2),C=f+x;if(c){C=f;for(var S=0;x>S;++S)C=uo(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),h=x):(f=C,p=L,g=s,h-=x)}}function mt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Io){Io=Bi("pre");for(var t=0;49>t;++t)Io.appendChild(document.createTextNode("x")),Io.appendChild(Bi("br"));Io.appendChild(document.createTextNode("x"))}Ui(e.measure,Io);var r=Io.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Gi(e.measure),r||1}function yt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Bi("span","xxxxxxxxxx"),r=Bi("pre",[t]);Ui(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Go},Bo?Bo.ops.push(e.curOp):e.curOp.ownsGroup=Bo={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function xt(e){var t=e.curOp,r=t.ownsGroup;if(r)try{wt(r)}finally{Bo=null;for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;Ct(r)}}function Ct(e){for(var t=e.ops,r=0;r<t.length;r++)St(t[r]);for(var r=0;r<t.length;r++)Lt(t[r]);for(var r=0;r<t.length;r++)Tt(t[r]);for(var r=0;r<t.length;r++)kt(t[r]);for(var r=0;r<t.length;r++)Mt(t[r])}function St(e){var t=e.cm,r=t.display;k(t),e.updateMaxLine&&f(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Tt(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ze(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+je(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Xe(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function kt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&W(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&ze(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),e.focus&&e.focus==Vi()&&q(e.cm)}function Mt(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&N(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-Xe(t),e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,x(t)),e.scrollToPos){var i=Dr(t,ve(n,e.scrollToPos.from),ve(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Or(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||Ml(o[s],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&Ml(l[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ml(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Nt(e,t){if(e.curOp)return t();bt(e);try{return t()}finally{xt(e)}}function At(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bt(e);try{return t.apply(e,arguments)}finally{xt(e)}}}function Wt(e){return function(){if(this.curOp)return e.apply(this,arguments);bt(this);try{return e.apply(this,arguments)}finally{xt(this)}}}function Ot(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bt(t);try{return e.apply(this,arguments)}finally{xt(t)}}}function Dt(e,t,r){this.line=t,this.rest=yn(t),this.size=this.rest?ei(Wi(this.rest))-r+1:1,this.node=this.text=null,this.hidden=xn(e,t)}function Ht(e,t,r){for(var n,i=[],o=t;r>o;o=n){var l=new Dt(e.doc,qn(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Pt(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Do&&bn(e.doc,t)<i.viewTo&&It(e);else if(r<=i.viewFrom)Do&&wn(e.doc,r+n)>i.viewFrom?It(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)It(e);else if(t<=i.viewFrom){var o=Ft(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):It(e)}else if(r>=i.viewTo){var o=Ft(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):It(e)}else{var l=Ft(e,t,t,-1),s=Ft(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Ht(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):It(e)}var a=i.externalMeasured;a&&(r<a.lineN?a.lineN+=n:t<a.lineN+a.size&&(i.externalMeasured=null))}function Et(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[zt(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Oi(l,r)&&l.push(r)}}}function It(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,0>t)return n}function Ft(e,t,r,n){var i,o=zt(e,t),l=e.display.view;if(!Do||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;bn(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Rt(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Ht(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Ht(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(zt(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Ht(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,zt(e,r)))),n.viewTo=r}function Bt(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function Gt(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),l=i.activeTouch,l.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Tl(i.scroller,"mousedown",At(e,Xt)),go&&11>vo?Tl(i.scroller,"dblclick",At(e,function(t){if(!Li(e,t)){var r=jt(e,t);if(r&&!Zt(e,t)&&!Kt(e.display,t)){Cl(t);var n=e.findWordAt(r);xe(e.doc,n.anchor,n.head)}}})):Tl(i.scroller,"dblclick",function(t){Li(e,t)||Cl(t)}),Wo||Tl(i.scroller,"contextmenu",function(t){mr(e,t)});var o,l={end:0};Tl(i.scroller,"touchstart",function(e){if(!r(e)){clearTimeout(o);var t=+new Date;i.activeTouch={start:t,moved:!1,prev:t-l.end<=300?l:null},1==e.touches.length&&(i.activeTouch.left=e.touches[0].pageX,i.activeTouch.top=e.touches[0].pageY)}}),Tl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Tl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Kt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new fe(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new fe(Ho(s.line,0),ve(e.doc,Ho(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Cl(r)}t()}),Tl(i.scroller,"touchcancel",t),Tl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rr(e,i.scroller.scrollTop),nr(e,i.scroller.scrollLeft,!0),Ml(e,"scroll",e))}),Tl(i.scroller,"mousewheel",function(t){ir(e,t)}),Tl(i.scroller,"DOMMouseScroll",function(t){ir(e,t)}),Tl(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Li(e,t)||Ll(t)},over:function(t){Li(e,t)||(er(e,t),Ll(t))},start:function(t){Jt(e,t)},drop:At(e,Qt),leave:function(){tr(e)}};var s=i.input.getField();Tl(s,"keyup",function(t){fr.call(e,t)}),Tl(s,"keydown",At(e,cr)),Tl(s,"keypress",At(e,dr)),Tl(s,"focus",Ii(gr,e)),Tl(s,"blur",Ii(vr,e))}function Ut(t,r,n){var i=n&&n!=e.Init;if(!r!=!i){var o=t.display.dragFunctions,l=r?Tl:kl;l(t.display.scroller,"dragstart",o.start),l(t.display.scroller,"dragenter",o.enter),l(t.display.scroller,"dragover",o.over),l(t.display.scroller,"dragleave",o.leave),l(t.display.scroller,"drop",o.drop)}}function Vt(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Kt(e,t){for(var r=wi(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function jt(e,t,r,n){var i=e.display;if(!r&&"true"==wi(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=gt(e,o,l);if(n&&1==u.xRel&&(a=qn(e.doc,u.line).text).length==u.ch){var c=Pl(a,a.length,e.options.tabSize)-a.length;u=Ho(u.line,Math.max(0,Math.round((o-Ke(e.display).left)/yt(e.display))-c))}return u}function Xt(e){var t=this,r=t.display;if(!(r.activeTouch&&r.input.supportsTouch()||Li(t,e))){if(r.shift=e.shiftKey,Kt(r,e))return void(mo||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Zt(t,e)){var n=jt(t,e);switch(window.focus(),xi(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?_t(t,e,n):wi(e)==r.scroller&&Cl(e);break;case 2:mo&&(t.state.lastMiddleDown=+new Date),n&&xe(t.doc,n),setTimeout(function(){r.input.focus()},20),Cl(e);break;case 3:Wo?mr(t,e):pr(t)}}}}function _t(e,t,r){go?setTimeout(Ii(q,e),0):e.curOp.focus=Vi();var n,i=+new Date;Fo&&Fo.time>i-400&&0==Po(Fo.pos,r)?n="triple":zo&&zo.time>i-400&&0==Po(zo.pos,r)?(n="double",Fo={time:i,pos:r}):(n="single",zo={time:i,pos:r});var o,l=e.doc.sel,s=ko?t.metaKey:t.ctrlKey;e.options.dragDrop&&Yl&&!Z(e)&&"single"==n&&(o=l.contains(r))>-1&&(Po((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(Po(o.to(),r)>0||r.xRel<0)?Yt(e,t,r,s):$t(e,t,r,n,s)}function Yt(e,t,r,n){var i=e.display,o=+new Date,l=At(e,function(s){mo&&(i.scroller.draggable=!1),e.state.draggingText=!1,kl(document,"mouseup",l),kl(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Cl(s),!n&&+new Date-200<o&&xe(e.doc,r),mo||go&&9==vo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});mo&&(i.scroller.draggable=!0),e.state.draggingText=l,i.scroller.dragDrop&&i.scroller.dragDrop(),Tl(document,"mouseup",l),Tl(i.scroller,"drop",l)}function $t(e,t,r,n,i){function o(t){if(0!=Po(v,t))if(v=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=Pl(qn(u,r.line).text,r.ch,o),s=Pl(qn(u,t.line).text,t.ch,o),a=Math.min(l,s),d=Math.max(l,s),p=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));g>=p;p++){var m=qn(u,p).text,y=El(m,a,o);a==d?i.push(new fe(Ho(p,y),Ho(p,y))):m.length>y&&i.push(new fe(Ho(p,y),Ho(p,El(m,d,o))))}i.length||i.push(new fe(r,r)),Me(u,de(f.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new fe(Ho(t.line,0),ve(u,Ho(t.line+1,0)));Po(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=Y(b.to(),C.head))}var i=f.ranges.slice(0);i[h]=new fe(ve(u,w),x),Me(u,de(i,h),Dl)}}function l(t){var r=++y,i=jt(e,t,!0,"rect"==n);if(i)if(0!=Po(i,v)){e.curOp.focus=Vi(),o(i);var s=w(a,u);(i.line>=s.to||i.line<s.from)&&setTimeout(At(e,function(){y==r&&l(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(At(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,Cl(t),a.input.focus(),kl(document,"mousemove",b),kl(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;Cl(t);var c,h,f=u.sel,d=f.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),c=h>-1?d[h]:new fe(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),t.altKey)n="rect",i||(c=new fe(r,r)),r=jt(e,t,!0,!0),h=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?we(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new fe(Ho(r.line,0),ve(u,Ho(r.line+1,0)));c=e.display.shift||u.extend?we(u,c,g.anchor,g.head):g}else c=we(u,c,r);i?-1==h?(h=d.length,Me(u,de(d.concat([c]),h),{scroll:!1,origin:"*mouse"})):d.length>1&&d[h].empty()&&"single"==n&&!t.shiftKey?(Me(u,de(d.slice(0,h).concat(d.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),f=u.sel):Se(u,h,c,Dl):(h=0,Me(u,new he([c],0),Dl),f=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=At(e,function(e){xi(e)?l(e):s(e)}),x=At(e,s);e.state.selectingText=x,Tl(document,"mousemove",b),Tl(document,"mouseup",x)}function qt(e,t,r,n,i){try{var o=t.clientX,l=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Cl(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(l>a.bottom||!ki(e,r))return bi(t);l-=a.top-s.viewOffset;for(var u=0;u<e.options.gutters.length;++u){var c=s.gutters.childNodes[u];if(c&&c.getBoundingClientRect().right>=o){var h=ti(e.doc,l),f=e.options.gutters[u];return i(e,r,e,h,f,t),bi(t)}}}function Zt(e,t){return qt(e,t,"gutterClick",!0,Ci)}function Qt(e){var t=this;if(tr(t),!Li(t,e)&&!Kt(t.display,e)){Cl(e),go&&(Uo=+new Date);var r=jt(t,e,!0),n=e.dataTransfer.files;if(r&&!Z(t))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){var s=new FileReader;s.onload=At(t,function(){if(o[n]=s.result,++l==i){r=ve(t.doc,r);var e={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Lr(t.doc,e),ke(t.doc,pe(r,Yo(e)))}}),s.readAsText(e)},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(ko?e.altKey:e.ctrlKey))var u=t.listSelections();if(Ne(t.doc,pe(r,r)),u)for(var a=0;a<u.length;++a)Wr(t.doc,"",u[a].anchor,u[a].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Jt(e,t){if(go&&(!e.state.draggingText||+new Date-Uo<100))return void Ll(t);if(!Li(e,t)&&!Kt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!xo)){var r=Bi("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",wo&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),wo&&r.parentNode.removeChild(r)}}function er(e,t){var r=jt(e,t);if(r){var n=document.createDocumentFragment();Ee(e,r,n),e.display.dragCursor||(e.display.dragCursor=Bi("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ui(e.display.dragCursor,n)}}function tr(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function rr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,ho||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),ho&&A(e),Fe(e,100))}function nr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ir(e,t){var r=jo(t),n=r.x,i=r.y,o=e.display,l=o.scroller;if(n&&l.scrollWidth>l.clientWidth||i&&l.scrollHeight>l.clientHeight){if(i&&ko&&mo)e:for(var s=t.target,a=o.view;s!=l;s=s.parentNode)for(var u=0;u<a.length;u++)if(a[u].node==s){e.display.currentWheelTarget=s;break e}if(n&&!ho&&!wo&&null!=Ko)return i&&rr(e,Math.max(0,Math.min(l.scrollTop+i*Ko,l.scrollHeight-l.clientHeight))),nr(e,Math.max(0,Math.min(l.scrollLeft+n*Ko,l.scrollWidth-l.clientWidth))),Cl(t),void(o.wheelStartX=null);if(i&&null!=Ko){var c=i*Ko,h=e.doc.scrollTop,f=h+o.wrapper.clientHeight;0>c?h=Math.max(0,h+c-50):f=Math.min(e.doc.height,f+c+50),A(e,{top:h,bottom:f})}20>Vo&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Ko=(Ko*Vo+r)/(Vo+1),++Vo)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function or(e,t,r){if("string"==typeof t&&(t=ol[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{Z(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Wl}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function lr(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=sl(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&sl(t,e.options.extraKeys,r,e)||sl(t,e.options.keyMap,r,e)}function sr(e,t,r,n){var i=e.state.keySeq;if(i){if(al(t))return"handled";Xo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=lr(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ci(e,"keyHandled",e,t,r),("handled"==o||"multi"==o)&&(Cl(r),ze(e)),i&&!o&&/\'$/.test(t)?(Cl(r),!0):!!o}function ar(e,t){var r=ul(t,!0);return r?t.shiftKey&&!e.state.keySeq?sr(e,"Shift-"+r,t,function(t){return or(e,t,!0)})||sr(e,r,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?or(e,t):void 0}):sr(e,r,t,function(t){return or(e,t)}):!1}function ur(e,t,r){return sr(e,"'"+r+"'",t,function(t){return or(e,t,!0)})}function cr(e){var t=this;if(t.curOp.focus=Vi(),!Li(t,e)){go&&11>vo&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ar(t,e);wo&&(_o=n?r:null,!n&&88==r&&!Zl&&(ko?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||hr(t)}}function hr(e){function t(e){18!=e.keyCode&&e.altKey||(jl(r,"CodeMirror-crosshair"),kl(document,"keyup",t),kl(document,"mouseover",t))}var r=e.display.lineDiv;Xl(r,"CodeMirror-crosshair"),Tl(document,"keyup",t),Tl(document,"mouseover",t)}function fr(e){16==e.keyCode&&(this.doc.sel.shift=!1),Li(this,e)}function dr(e){var t=this;if(!(Kt(t.display,e)||Li(t,e)||e.ctrlKey&&!e.altKey||ko&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(wo&&r==_o)return _o=null,void Cl(e);if(!wo||e.which&&!(e.which<10)||!ar(t,e)){var i=String.fromCharCode(null==n?r:n);ur(t,e,i)||t.display.input.onKeyPress(e)}}}function pr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vr(e))},100)}function gr(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ml(e,"focus",e),e.state.focused=!0,Xl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),mo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ze(e))}function vr(e){e.state.delayingBlurEvent||(e.state.focused&&(Ml(e,"blur",e),e.state.focused=!1,jl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function mr(e,t){Kt(e.display,t)||yr(e,t)||e.display.input.onContextMenu(t)}function yr(e,t){return ki(e,"gutterContextMenu")?qt(e,t,"gutterContextMenu",!1,Ml):!1}function br(e,t){if(Po(e,t.from)<0)return e;if(Po(e,t.to)<=0)return Yo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Yo(t).ch-t.to.ch),Ho(r,n)}function wr(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new fe(br(i.anchor,t),br(i.head,t)))}return de(r,e.sel.primIndex)}function xr(e,t,r){return e.line==t.line?Ho(r.line,e.ch-t.ch+r.ch):Ho(r.line+(e.line-t.line),e.ch)}function Cr(e,t,r){for(var n=[],i=Ho(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=xr(s.from,i,o),u=xr(Yo(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=Po(c.head,c.anchor)<0;n[l]=new fe(h?u:a,h?a:u)}else n[l]=new fe(a,a)}return new he(n,e.sel.primIndex)}function Sr(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(n.update=function(t,r,n,i){t&&(this.from=ve(e,t)),r&&(this.to=ve(e,r)),n&&(this.text=n),void 0!==i&&(this.origin=i)}),Ml(e,"beforeChange",e,n),e.cm&&Ml(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Lr(e,t,r){if(e.cm){if(!e.cm.curOp)return At(e.cm,Lr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ki(e,"beforeChange")||e.cm&&ki(e.cm,"beforeChange"))||(t=Sr(e,t,!0))){var n=Oo&&!r&&sn(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Tr(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Tr(e,t)}}function Tr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Po(t.from,t.to)){var r=wr(e,t);ai(e,t,r,e.cm?e.cm.curOp.id:NaN),Nr(e,t,r,nn(e,t));var n=[];Yn(e,function(e,r){r||-1!=Oi(n,e.history)||(yi(e.history,t),n.push(e.history)),Nr(e,t,null,nn(e,t))})}}function kr(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(n=l[a],r?!n.ranges||n.equals(e.sel):n.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;n=l.pop(),n.ranges;){if(hi(n,s),r&&!n.equals(e.sel))return void Me(e,n,{clearRedo:!1});o=n}var u=[];hi(o,s),s.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var c=ki(e,"beforeChange")||e.cm&&ki(e.cm,"beforeChange"),a=n.changes.length-1;a>=0;--a){var h=n.changes[a];if(h.origin=t,c&&!Sr(e,h,!1))return void(l.length=0);u.push(oi(e,h));var f=a?wr(e,h):Wi(l);Nr(e,h,f,ln(e,h)),!a&&e.cm&&e.cm.scrollIntoView({from:h.from,to:Yo(h)});var d=[];Yn(e,function(e,t){t||-1!=Oi(d,e.history)||(yi(e.history,h),d.push(e.history)),Nr(e,h,null,ln(e,h))})}}}}function Mr(e,t){if(0!=t&&(e.first+=t,e.sel=new he(Di(e.sel.ranges,function(e){return new fe(Ho(e.anchor.line+t,e.anchor.ch),Ho(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Pt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Et(e.cm,n,"gutter")}}function Nr(e,t,r,n){if(e.cm&&!e.cm.curOp)return At(e.cm,Nr)(e,t,r,n);if(t.to.line<e.first)return void Mr(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Mr(e,i),t={from:Ho(e.first,0),to:Ho(t.to.line+i,t.to.ch),text:[Wi(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Ho(o,qn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zn(e,t.from,t.to),r||(r=wr(e,t)),e.cm?Ar(e.cm,t,n):jn(e,t,n),Ne(e,r,Ol)}}function Ar(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=ei(mn(qn(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&Ti(e),jn(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=h(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),Fe(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Pt(e):l.line!=s.line||1!=t.text.length||Kn(e.doc,t)?Pt(e,l.line,s.line+1,c):Et(e,l.line,"text");var f=ki(e,"changes"),d=ki(e,"change");if(d||f){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&Ci(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function Wr(e,t,r,n,i){if(n||(n=r),Po(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Lr(e,{from:r,to:n,text:t,origin:i})}function Or(e,t){if(!Li(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!So){var o=Bi("div","",null,"position: absolute; top: "+(t.top-r.viewOffset-Ue(e.display))+"px; height: "+(t.bottom-t.top+je(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Dr(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=ft(e,t),s=r&&r!=t?ft(e,r):l,a=Pr(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(rr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(nr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function Hr(e,t,r,n,i){var o=Pr(e,t,r,n,i);null!=o.scrollTop&&rr(e,o.scrollTop),null!=o.scrollLeft&&nr(e,o.scrollLeft)}function Pr(e,t,r,n,i){
var o=e.display,l=mt(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=_e(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Ve(o),h=l>r,f=i>c-l;if(s>r)u.scrollTop=h?0:r;else if(i>s+a){var d=Math.min(r,(f?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Xe(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Er(e,t,r){(null!=t||null!=r)&&zr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Ir(e){zr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Ho(t.line,t.ch-1):t,n=Ho(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function zr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=dt(e,t.from),n=dt(e,t.to),i=Pr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ge(e,t):r="prev");var l=e.options.tabSize,s=qn(o,t),a=Pl(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==Wl||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Pl(qn(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+=" ";if(u>f&&(h+=Ai(u-f)),h!=c)return Wr(o,h,Ho(t,0),Ho(t,c.length),"+input"),s.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==t&&p.head.ch<c.length){var f=Ho(t,c.length);Se(o,d,new fe(f,f));break}}}function Rr(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=qn(e,ge(e,t)):i=ei(t),null==i?null:(n(o,i)&&e.cm&&Et(e.cm,i,r),o)}function Br(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&Po(o.from,Wi(n).to)<=0;){var l=n.pop();if(Po(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Nt(e,function(){for(var t=n.length-1;t>=0;t--)Wr(e.doc,"",n[t].from,n[t].to,"+delete");Ir(e)})}function Gr(e,t,r,n,i){function o(){var t=s+r;return t<e.first||t>=e.first+e.size?h=!1:(s=t,c=qn(e,t))}function l(e){var t=(i?uo:co)(c,a,r,!0);if(null==t){if(e||!o())return h=!1;a=i?(0>r?ro:to)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=qn(e,s),h=!0;if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var f=null,d="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(0>r)||l(!g);g=!1){var v=c.text.charAt(a)||"\n",m=zi(v,p)?"w":d&&"\n"==v?"n":!d||/\s/.test(v)?null:"p";if(!d||g||m||(m="s"),f&&f!=m){0>r&&(r=1,l());break}if(m&&(f=m),r>0&&!l(!g))break}var y=De(e,Ho(s,a),u,!0);return h||(y.hitSide=!0),y}function Ur(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*mt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=gt(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Vr(t,r,n,i){e.defaults[t]=r,n&&(qo[t]=i?function(e,t,r){r!=Zo&&n(e,t,r)}:n)}function Kr(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function jr(e){return"string"==typeof e?ll[e]:e}function Xr(e,t,r,n,i){if(n&&n.shared)return _r(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return At(e.cm,Xr)(e,t,r,n,i);var o=new fl(e,i),l=Po(t,r);if(n&&Ei(n,o,!1),l>0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Bi("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vn(e,t.line,t,r,o)||t.line!=r.line&&vn(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Do=!0}o.addToHistory&&ai(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&mn(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&Jn(e,0),en(e,new Zr(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){xn(e,t)&&Jn(t,0)}),o.clearOnEnter&&Tl(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Oo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++hl,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Pt(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)Et(u,c,"text");o.atomic&&We(u.doc),Ci(u,"markerAdded",u,o)}return o}function _r(e,t,r,n,i){n=Ei(n),n.shared=!1;var o=[Xr(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Yn(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Xr(e,ve(e,t),ve(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=Wi(o)}),new dl(o,l)}function Yr(e){return e.findMarks(Ho(e.first,0),e.clipPos(Ho(e.lastLine())),function(e){return e.parent})}function $r(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(Po(o,l)){var s=Xr(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function qr(e){for(var t=0;t<e.length;t++){var r=e[t],n=[r.primary.doc];Yn(r.primary.doc,function(e){n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==Oi(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}}function Zr(e,t,r){this.marker=e,this.from=t,this.to=r}function Qr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Jr(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function en(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function tn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Zr(l,o.from,a?null:o.to))}}return n}function rn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Zr(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}function nn(e,t){if(t.full)return null;var r=ye(e,t.from.line)&&qn(e,t.from.line).markedSpans,n=ye(e,t.to.line)&&qn(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==Po(t.from,t.to),s=tn(r,i,l),a=rn(n,o,l),u=1==t.text.length,c=Wi(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Qr(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var h=0;h<a.length;++h){var f=a[h];if(null!=f.to&&(f.to+=c),null==f.from){var d=Qr(s,f.marker);d||(f.from=c,u&&(s||(s=[])).push(f))}else f.from+=c,u&&(s||(s=[])).push(f)}s&&(s=on(s)),a&&a!=s&&(a=on(a));var p=[s];if(!u){var g,v=t.text.length-2;if(v>0&&s)for(var h=0;h<s.length;++h)null==s[h].to&&(g||(g=[])).push(new Zr(s[h].marker,null,null));for(var h=0;v>h;++h)p.push(g);p.push(a)}return p}function on(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ln(e,t){var r=pi(e,t),n=nn(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function sn(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=Oi(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(Po(u.to,s.from)<0||Po(u.from,s.to)>0)){var c=[a,1],h=Po(u.from,s.from),f=Po(u.to,s.to);(0>h||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function an(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function un(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function cn(e){return e.inclusiveLeft?-1:0}function hn(e){return e.inclusiveRight?1:0}function fn(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=Po(n.from,i.from)||cn(e)-cn(t);if(o)return-o;var l=Po(n.to,i.to)||hn(e)-hn(t);return l?l:t.id-e.id}function dn(e,t){var r,n=Do&&e.markedSpans;if(n)for(var i,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||fn(r,i.marker)<0)&&(r=i.marker);return r}function pn(e){return dn(e,!0)}function gn(e){return dn(e,!1)}function vn(e,t,r,n,i){var o=qn(e,t),l=Do&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=Po(u.from,r)||cn(a.marker)-cn(i),h=Po(u.to,n)||hn(a.marker)-hn(i);if(!(c>=0&&0>=h||0>=c&&h>=0)&&(0>=c&&(Po(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Po(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function mn(e){for(var t;t=pn(e);)e=t.find(-1,!0).line;return e}function yn(e){for(var t,r;t=gn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function bn(e,t){var r=qn(e,t),n=mn(r);return r==n?t:ei(n)}function wn(e,t){if(t>e.lastLine())return t;var r,n=qn(e,t);if(!xn(e,n))return t;for(;r=gn(n);)n=r.find(1,!0).line;return ei(n)+1}function xn(e,t){var r=Do&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Cn(e,t,n))return!0}}function Cn(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Cn(e,n.line,Qr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Cn(e,t,i))return!0}function Sn(e,t,r){ri(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Er(e,null,r)}function Ln(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Ul(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Ui(t.display.measure,Bi("div",[e.node],null,r))}return e.height=e.node.offsetHeight}function Tn(e,t,r,n){var i=new pl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Rr(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!xn(e,t)){var n=ri(t)<e.scrollTop;Jn(t,t.height+Ln(i)),n&&Er(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function kn(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),an(e),un(e,r);var i=n?n(e):1;i!=e.height&&Jn(e,i)}function Mn(e){e.parent=null,an(e)}function Nn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function An(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var n=e.innerMode(t,r);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Wn(t,r,n,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function On(e,t,r,n){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?nl(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=ve(l,t);var a,u=qn(l,t.line),c=Ge(e,t.line,r),h=new cl(u.text,e.options.tabSize);for(n&&(a=[]);(n||h.pos<t.ch)&&!h.eol();)h.start=h.pos,o=Wn(s,h,c),n&&a.push(i(!0));return n?a:i()}function Dn(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new cl(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&Nn(An(r,n),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&En(e,t,n,h.pos),h.pos=t.length,a=null):a=Nn(Wn(r,h,n,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)u=Math.min(h.start,u+5e4),i(u,c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e4);i(p,c),u=p}}function Hn(e,t,r,n){var i=[e.state.modeGen],o={};Dn(e,t.text,e.doc.mode,r,function(e,t){i.push(e,t)},o,n);for(var l=0;l<e.state.overlays.length;++l){var s=e.state.overlays[l],a=1,u=0;Dn(e,t.text,s.mode,!0,function(e,t){for(var r=a;e>u;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Pn(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ge(e,ei(t)),i=Hn(e,t,t.text.length>e.options.maxHighlightLength?nl(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function En(e,t,r,n){var i=e.doc.mode,o=new cl(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&An(i,r);!o.eol();)Wn(i,o,r),o.start=o.pos}function In(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ml:vl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function zn(e,t){var r=Bi("span",null,null,mo?"padding-right: .1px":null),n={pre:Bi("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,splitSpaces:(go||mo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Rn,qi(e.display.measure)&&(o=ni(l))&&(n.addToken=Gn(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&ei(l);Vn(l,n,Pn(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=ji(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=ji(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild($i(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return mo&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Ml(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=ji(n.pre.className,n.textClass||"")),n}function Fn(e){var t=Bi("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Rn(e,t,r,n,i,o,l){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Bn):t,a=e.cm.state.specialChars,u=!1;if(a.test(t))for(var c=document.createDocumentFragment(),h=0;;){a.lastIndex=h;var f=a.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(s.slice(h,h+d));go&&9>vo?c.appendChild(Bi("span",[p])):c.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;if(h+=d+1," "==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g,p=c.appendChild(Bi("span",Ai(v),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=v}else if("\r"==f[0]||"\n"==f[0]){var p=c.appendChild(Bi("span","\r"==f[0]?"␍":"","cm-invalidchar"));p.setAttribute("cm-text",f[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(f[0]);p.setAttribute("cm-text",f[0]),go&&9>vo?c.appendChild(Bi("span",[p])):c.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),go&&9>vo&&(u=!0),e.pos+=t.length}if(r||n||i||u||l){var m=r||"";n&&(m+=n),i&&(m+=i);var y=Bi("span",[c],m,l);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(c)}}function Bn(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+=" "}function Gn(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=0;h<t.length;h++){var f=t[h];if(f.to>u&&f.from<=u)break}if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function Un(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Vn(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y=[],b=0;b<n.length;++b){var w=n[b],x=w.marker;"bookmark"==x.type&&w.from==p&&x.widgetNode?y.push(x):w.from<=p&&(null==w.to||w.to>p||x.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&m>w.to&&(m=w.to,u=""),x.className&&(a+=" "+x.className),x.css&&(s=x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==m&&(u+=" "+x.endStyle),x.title&&!h&&(h=x.title),x.collapsed&&(!f||fn(f.marker,x)<0)&&(f=w)):w.from>p&&m>w.from&&(m=w.from)}if(f&&(f.from||0)==p){if(Un(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}if(!f&&y.length)for(var b=0;b<y.length;++b)Un(t,0,y[b])}if(p>=d)break;for(var C=Math.min(d,m);;){if(v){var S=p+v.length;if(!f){var L=S>C?v.slice(0,C-p):v;t.addToken(t,L,l?l+a:a,c,p+L.length==m?u:"",h,s)}if(S>=C){v=v.slice(C-p),p=C;break}p=S,c=""}v=i.slice(o,o=r[g++]),l=In(r[g++],t.cm.options)}}else for(var g=1;g<r.length;g+=2)t.addToken(t,i.slice(o,o=r[g]),In(r[g+1],t.cm.options))}function Kn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Wi(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function jn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){kn(e,r,i,n),Ci(e,"change",e,t)}function l(e,t){for(var r=e,o=[];t>r;++r)o.push(new gl(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=qn(e,s.line),h=qn(e,a.line),f=Wi(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Kn(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new gl(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}Ci(e,"change",e,t)}function Xn(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function _n(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}function Yn(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var s=e.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;(!r||a)&&(t(s.doc,a),n(s.doc,e,a))}}}n(e,null,!0)}function $n(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,l(e),r(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,Pt(e)}function qn(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function Zn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Qn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function Jn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function ei(e){if(null==e.parent)return null;for(var t=e.parent,r=Oi(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ti(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(o>t){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;n<e.lines.length;++n){var l=e.lines[n],s=l.height;if(s>t)break;t-=s}return r+n}function ri(e){e=mn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var n=0;n<o.children.length;++n){var l=o.children[n];if(l==r)break;t+=l.height}return t}function ni(e){var t=e.order;return null==t&&(t=e.order=ts(e.text)),t}function ii(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function oi(e,t){var r={from:_(t.from),to:Yo(t),text:Zn(e,t.from,t.to)};return fi(e,r,t.from.line,t.to.line+1),Yn(e,function(e){fi(e,r,t.from.line,t.to.line+1)},!0),r}function li(e){for(;e.length;){var t=Wi(e);if(!t.ranges)break;e.pop()}}function si(e,t){return t?(li(e.done),Wi(e.done)):e.done.length&&!Wi(e.done).ranges?Wi(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Wi(e.done)):void 0}function ai(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=si(i,i.lastOp==n))){var s=Wi(o.changes);0==Po(t.from,t.to)&&0==Po(t.from,s.to)?s.to=Yo(t):o.changes.push(oi(e,t))}else{var a=Wi(i.done);for(a&&a.ranges||hi(e.sel,i.done),o={changes:[oi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Ml(e,"historyAdded")}function ui(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ci(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ui(e,o,Wi(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&li(i.undone)}function hi(e,t){var r=Wi(t);r&&r.ranges&&r.equals(e)||t.push(e)}function fi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function di(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function pi(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=0,i=[];n<t.text.length;++n)i.push(di(r[n]));return i}function gi(e,t,r){for(var n=0,i=[];n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?he.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];i.push({changes:s});for(var a=0;a<l.length;++a){var u,c=l[a];if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&Oi(t,Number(u[1]))>-1&&(Wi(s)[h]=c[h],delete c[h])}}}return i}function vi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function mi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)vi(o.ranges[s].anchor,t,r,n),vi(o.ranges[s].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var a=o.changes[s];if(r<a.from.line)a.from=Ho(a.from.line+n,a.from.ch),a.to=Ho(a.to.line+n,a.to.ch);else if(t<=a.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function yi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;mi(e.done,r,n,i),mi(e.undone,r,n,i)}function bi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function wi(e){return e.target||e.srcElement}function xi(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ko&&e.ctrlKey&&1==t&&(t=3),t}function Ci(e,t){function r(e){return function(){e.apply(null,o)}}var n=e._handlers&&e._handlers[t];if(n){var i,o=Array.prototype.slice.call(arguments,2);Bo?i=Bo.delayedCallbacks:Nl?i=Nl:(i=Nl=[],setTimeout(Si,0));for(var l=0;l<n.length;++l)i.push(r(n[l]))}}function Si(){var e=Nl;Nl=null;for(var t=0;t<e.length;++t)e[t]()}function Li(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ml(e,r||t.type,e,t),bi(t)||t.codemirrorIgnore}function Ti(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==Oi(r,t[n])&&r.push(t[n])}function ki(e,t){var r=e._handlers&&e._handlers[t];return r&&r.length>0}function Mi(e){e.prototype.on=function(e,t){Tl(this,e,t)},e.prototype.off=function(e,t){kl(this,e,t)}}function Ni(){this.id=null}function Ai(e){for(;Il.length<=e;)Il.push(Wi(Il)+" ");return Il[e]}function Wi(e){return e[e.length-1]}function Oi(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function Di(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Hi(){}function Pi(e,t){var r;return Object.create?r=Object.create(e):(Hi.prototype=e,r=new Hi),t&&Ei(t,r),r}function Ei(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function Ii(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function zi(e,t){return t?t.source.indexOf("\\w")>-1&&Bl(e)?!0:t.test(e):Bl(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Ri(e){return e.charCodeAt(0)>=768&&Gl.test(e)}function Bi(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Gi(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ui(e,t){return Gi(e).appendChild(t)}function Vi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Ki(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function ji(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Ki(r[n]).test(t)&&(t+=" "+r[n]);return t}function Xi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function _i(){_l||(Yi(),_l=!0)}function Yi(){var e;Tl(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Xi(Vt)},100))}),Tl(window,"blur",function(){Xi(vr)})}function $i(e){if(null==Vl){var t=Bi("span","");Ui(e,Bi("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Vl=t.offsetWidth<=1&&t.offsetHeight>2&&!(go&&8>vo))}var r=Vl?Bi("span",""):Bi("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function qi(e){if(null!=Kl)return Kl;var t=Ui(e,document.createTextNode("AخA")),r=Fl(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Fl(t,1,2).getBoundingClientRect();return Kl=n.right-r.right<3}function Zi(e){if(null!=Ql)return Ql;var t=Ui(e,Bi("span","x")),r=t.getBoundingClientRect(),n=Fl(t,0,1).getBoundingClientRect();return Ql=Math.abs(r.left-n.left)>1}function Qi(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function Ji(e){return e.level%2?e.to:e.from}function eo(e){return e.level%2?e.from:e.to}function to(e){var t=ni(e);return t?Ji(t[0]):0}function ro(e){var t=ni(e);return t?eo(Wi(t)):e.text.length}function no(e,t){var r=qn(e.doc,t),n=mn(r);n!=r&&(t=ei(n));var i=ni(n),o=i?i[0].level%2?ro(n):to(n):0;return Ho(t,o)}function io(e,t){for(var r,n=qn(e.doc,t);r=gn(n);)n=r.find(1,!0).line,t=null;var i=ni(n),o=i?i[0].level%2?to(n):ro(n):n.text.length;return Ho(null==t?ei(n):t,o)}function oo(e,t){var r=no(e,t.line),n=qn(e.doc,r.line),i=ni(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return Ho(r.line,l?0:o)}return r}function lo(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function so(e,t){es=null;for(var r,n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return lo(e,i.level,e[r].level)?(i.from!=i.to&&(es=r),n):(i.from!=i.to&&(es=n),r);r=n}}return r}function ao(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Ri(e.text.charAt(t)));return t}function uo(e,t,r,n){var i=ni(e);if(!i)return co(e,t,r,n);for(var o=so(i,t),l=i[o],s=ao(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s<l.to)return s;if(s==l.from||s==l.to)return so(i,s)==o?s:(l=i[o+=r],r>0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?ao(e,l.to,-1,n):ao(e,l.from,1,n)}}function co(e,t,r,n){var i=t+r;if(n)for(;i>0&&Ri(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var ho=/gecko\/\d/i.test(navigator.userAgent),fo=/MSIE \d/.test(navigator.userAgent),po=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),go=fo||po,vo=go&&(fo?document.documentMode||6:po[1]),mo=/WebKit\//.test(navigator.userAgent),yo=mo&&/Qt\/\d+\.\d+/.test(navigator.userAgent),bo=/Chrome\//.test(navigator.userAgent),wo=/Opera\//.test(navigator.userAgent),xo=/Apple Computer/.test(navigator.vendor),Co=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),So=/PhantomJS/.test(navigator.userAgent),Lo=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),To=Lo||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ko=Lo||/Mac/.test(navigator.platform),Mo=/win/i.test(navigator.platform),No=wo&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);No&&(No=Number(No[1])),No&&No>=15&&(wo=!1,mo=!0);var Ao=ko&&(yo||wo&&(null==No||12.11>No)),Wo=ho||go&&vo>=9,Oo=!1,Do=!1;g.prototype=Ei({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},
overlayHack:function(){var e=ko&&!Co?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,r=function(e){wi(e)!=t.vert&&wi(e)!=t.horiz&&At(t.cm,Xt)(e)};Tl(this.vert,"mousedown",r),Tl(this.horiz,"mousedown",r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=Ei({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={native:g,null:v},T.prototype.signal=function(e,t){ki(e,t)&&this.events.push(arguments)},T.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ml.apply(null,this.events[e])};var Ho=e.Pos=function(e,t){return this instanceof Ho?(this.line=e,void(this.ch=t)):new Ho(e,t)},Po=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Eo=null;ne.prototype=Ei({init:function(e){function t(e){if(n.somethingSelected())Eo=n.getSelections(),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=Eo.join("\n"),zl(o));else{if(!n.options.lineWiseCopyCut)return;var t=te(n);Eo=t.text,"cut"==e.type?n.setSelections(t.ranges,null,Ol):(r.prevInput="",o.value=t.text.join("\n"),zl(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}var r=this,n=this.cm,i=this.wrapper=ie(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),Lo&&(o.style.width="0px"),Tl(o,"input",function(){go&&vo>=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),Tl(o,"paste",function(e){return J(e,n)?!0:(n.state.pasteIncoming=!0,void r.fastPoll())}),Tl(o,"cut",t),Tl(o,"copy",t),Tl(e.scroller,"paste",function(t){Kt(e,t)||(n.state.pasteIncoming=!0,r.focus())}),Tl(e.lineSpace,"selectstart",function(t){Kt(e,t)||Cl(t)}),Tl(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Tl(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Pe(e);if(e.options.moveInputWithCursor){var i=ft(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Ui(r.cursorDiv,e.cursors),Ui(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Zl&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&zl(this.textarea),go&&vo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",go&&vo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!To||Vi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||ql(t)&&!r&&!this.composing||Z(e)||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(go&&vo>=9&&this.hasSelection===n||ko&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,n.length);l>o&&r.charCodeAt(o)==n.charCodeAt(o);)++o;var s=this;return Nt(e,function(){Q(e,n.slice(o),r.length-o,null,s.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=n,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){go&&vo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t=""+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",l.style.cssText=c,go&&9>vo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!go||go&&9>vo)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&""==n.prevInput?At(i,ol.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=jt(i,e),a=o.scroller.scrollTop;if(s&&!wo){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&At(i,Me)(i.doc,pe(s),Ol);var c=l.style.cssText;if(n.wrapper.style.position="absolute",l.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(go?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",mo)var h=window.scrollY;if(o.input.focus(),mo&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),go&&vo>=9&&t(),Wo){Ll(e);var f=function(){kl(window,"mouseup",f),setTimeout(r,20)};Tl(window,"mouseup",f)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Hi,needsContentAttribute:!1},ne.prototype),oe.prototype=Ei({init:function(e){function t(e){if(n.somethingSelected())Eo=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=te(n);Eo=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Ol),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Lo)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Eo.join("\n"));else{var r=ie(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Eo.join("\n");var o=document.activeElement;zl(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}var r=this,n=r.cm,i=r.div=e.lineDiv;re(i),Tl(i,"paste",function(e){J(e,n)}),Tl(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=pe(Ho(i.head.line,l),Ho(i.head.line,l+t.length)))}}),Tl(i,"compositionupdate",function(e){r.composing.data=e.data}),Tl(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Tl(i,"touchstart",function(){r.forceCompositionEnd()}),Tl(i,"input",function(){r.composing||(Z(n)||!r.pollContent())&&Nt(r.cm,function(){Pt(n)})}),Tl(i,"copy",t),Tl(i,"cut",t)},prepareSelection:function(){var e=Pe(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=ae(this.cm,e.anchorNode,e.anchorOffset),n=ae(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Po($(r,n),t.from())||0!=Po(Y(r,n),t.to())){var i=le(this.cm,t.from()),o=le(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Fl(i.node,i.offset,o.offset,o.node)}catch(h){}c&&(e.removeAllRanges(),e.addRange(c),s&&null==e.anchorNode?e.addRange(s):ho&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ui(this.cm.display.cursorDiv,e.cursors),Ui(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ul(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Nt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=ae(t,e.anchorNode,e.anchorOffset),n=ae(t,e.focusNode,e.focusOffset);r&&n&&Nt(t,function(){Me(t.doc,pe(r,n),Ol),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=zt(e,n.line)))var l=ei(t.view[0].line),s=t.view[0].node;else var l=ei(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=zt(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.lineDiv.lastChild;else var u=ei(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var h=e.doc.splitLines(ce(e,s,c,l,u)),f=Zn(e.doc,Ho(l,0),Ho(u,qn(e.doc,u).text.length));h.length>1&&f.length>1;)if(Wi(h)==Wi(f))h.pop(),f.pop(),u--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),l++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=Wi(h),b=Wi(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;h[h.length-1]=y.slice(0,y.length-p),h[0]=h[0].slice(d);var x=Ho(l,d),C=Ho(u,f.length?Wi(f).length-p:0);return h.length>1||h[0]||Po(x,C)?(Wr(e.doc,h,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){Z(this.cm)?At(this.cm,Pt)(this.cm):e.data&&e.data!=e.startData&&At(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),Z(this.cm)||At(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Hi,resetPosition:Hi,needsContentAttribute:!0},oe.prototype),e.inputStyles={textarea:ne,contenteditable:oe},he.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(0!=Po(r.anchor,n.anchor)||0!=Po(r.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fe(_(this.ranges[t].anchor),_(this.ranges[t].head));return new he(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Po(t,n.from())>=0&&Po(e,n.to())<=0)return r}return-1}},fe.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Io,zo,Fo,Ro={left:0,right:0,top:0,bottom:0},Bo=null,Go=0,Uo=0,Vo=0,Ko=null;go?Ko=-.53:ho?Ko=15:bo?Ko=-.7:xo&&(Ko=-1/3);var jo=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=jo(e);return t.x*=Ko,t.y*=Ko,t};var Xo=new Ni,_o=null,Yo=e.changeEnd=function(e){return e.text?Ho(e.from.line+e.text.length-1,Wi(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,qo.hasOwnProperty(e)&&At(this,qo[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](jr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Wt(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:t,opaque:r&&r.opaque}),this.state.modeGen++,Pt(this)}),removeOverlay:Wt(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Pt(this)}}),indentLine:Wt(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ye(this.doc,e)&&Fr(this,e,t,r)}),indentSelection:Wt(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Fr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Ir(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Fr(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&Se(this.doc,n,new fe(o,u[n].to()),Ol)}}}),getTokenAt:function(e,t){return On(this,e,t)},getLineTokens:function(e,t){return On(this,Ho(e),t,!0)},getTokenTypeAt:function(e){e=ve(this.doc,e);var t,r=Pn(this,qn(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("cm-overlay "):-1;return 0>s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!rl.hasOwnProperty(t))return r;var n=rl[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var l=n[i[t][o]];l&&r.push(l)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var o=0;o<n._global.length;o++){var s=n._global[o];s.pred(i,this)&&-1==Oi(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return e=ge(r,null==e?r.first+r.size-1:e),Ge(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?ve(this.doc,e):e?n.from():n.to(),ft(this,r,t||"page")},charCoords:function(e,t){return ht(this,ve(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ct(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ct(this,{top:e,left:0},t||"page").top,ti(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=qn(this.doc,e)}else r=e;return ut(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ri(r):0)},defaultTextHeight:function(){return mt(this.display)},defaultCharWidth:function(){return yt(this.display)},setGutterMarker:Wt(function(e,t,r){return Rr(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Fi(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Wt(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,Et(t,n,"gutter"),Fi(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!ye(this.doc,e))return null;var t=e;if(e=qn(this.doc,e),!e)return null}else{var t=ei(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ft(this,ve(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&Hr(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Wt(cr),triggerOnKeyPress:Wt(dr),triggerOnKeyUp:fr,execCommand:function(e){return ol.hasOwnProperty(e)?ol[e].call(null,this):void 0},triggerElectric:Wt(function(e){ee(this,e)}),findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=ve(this.doc,e);t>o&&(l=Gr(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Wt(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Gr(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},Hl)}),deleteH:Wt(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Br(this,function(r){var i=Gr(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=ve(this.doc,e);t>l;++l){var a=ft(this,s,"div");if(null==o?o=a.left:a.left=o,s=Ur(this,a,i,r),s.hitSide)break}return s},moveV:Wt(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=ft(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Ur(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Er(r,null,ht(r,a,"div").top-s.top),a},Hl),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=this.doc,r=qn(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==r.length)&&n?--n:++i;for(var l=r.charAt(n),s=zi(l,o)?function(e){return zi(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!zi(e)};n>0&&s(r.charAt(n-1));)--n;for(;i<r.length&&s(r.charAt(i));)++i}return new fe(Ho(e.line,n),Ho(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Xl(this.display.cursorDiv,"CodeMirror-overwrite"):jl(this.display.cursorDiv,"CodeMirror-overwrite"),Ml(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Vi()},scrollTo:Wt(function(e,t){(null!=e||null!=t)&&zr(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-je(this)-this.display.barHeight,width:e.scrollWidth-je(this)-this.display.barWidth,clientHeight:_e(this),clientWidth:Xe(this)}},scrollIntoView:Wt(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Ho(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)zr(this),this.curOp.scrollToPos=e;else{var r=Pr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:Wt(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(n.display.wrapper.style.width=r(e)),null!=t&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&ot(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Et(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,Ml(n,"refresh",this)}),operation:function(e){return Nt(this,e)},refresh:Wt(function(){var e=this.display.cachedTextHeight;Pt(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),c(this),(null==e||Math.abs(e-mt(this.display))>.5)&&l(this),Ml(this,"refresh",this)}),swapDoc:Wt(function(e){var t=this.doc;return t.cm=null,$n(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ci(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Mi(e);var $o=e.defaults={},qo=e.optionHandlers={},Zo=e.Init={toString:function(){return"CodeMirror.Init"}};Vr("value","",function(e,t){e.setValue(t)},!0),Vr("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Vr("indentUnit",2,r,!0),Vr("indentWithTabs",!1),Vr("smartIndent",!0),Vr("tabSize",4,function(e){n(e),lt(e),Pt(e)},!0),Vr("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(Ho(n,o))}n++});for(var i=r.length-1;i>=0;i--)Wr(e.doc,t,r[i],Ho(r[i].line,r[i].ch+t.length))}}),Vr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),n!=e.Init&&t.refresh()}),Vr("specialCharPlaceholder",Fn,function(e){e.refresh()},!0),Vr("electricChars",!0),Vr("inputStyle",To?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Vr("rtlMoveVisually",!Mo),Vr("wholeLineUpdateBefore",!0),Vr("theme","default",function(e){s(e),a(e)},!0),Vr("keyMap","default",function(t,r,n){var i=jr(r),o=n!=e.Init&&jr(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Vr("extraKeys",null),Vr("lineWrapping",!1,i,!0),Vr("gutters",[],function(e){d(e.options),a(e)},!0),Vr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Vr("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Vr("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Vr("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Vr("firstLineNumber",1,a,!0),Vr("lineNumberFormatter",function(e){return e},a,!0),Vr("showCursorWhenSelecting",!1,He,!0),Vr("resetSelectionOnContextMenu",!0),Vr("lineWiseCopyCut",!0),Vr("readOnly",!1,function(e,t){"nocursor"==t?(vr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Vr("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Vr("dragDrop",!0,Ut),Vr("cursorBlinkRate",530),Vr("cursorScrollMargin",0),Vr("cursorHeight",1,He,!0),Vr("singleCursorHeightPerLine",!0,He,!0),Vr("workTime",100),Vr("workDelay",100),Vr("flattenSpans",!0,n,!0),Vr("addModeClass",!1,n,!0),Vr("pollInterval",100),Vr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Vr("historyEventDelay",1250),Vr("viewportMargin",10,function(e){e.refresh()},!0),Vr("maxHighlightLength",1e4,n,!0),Vr("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Vr("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Vr("autofocus",null);var Qo=e.modes={},Jo=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),Qo[t]=r},e.defineMIME=function(e,t){Jo[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Jo.hasOwnProperty(t))t=Jo[t];else if(t&&"string"==typeof t.name&&Jo.hasOwnProperty(t.name)){var r=Jo[t.name];"string"==typeof r&&(r={name:r}),t=Pi(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=Qo[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(el.hasOwnProperty(r.name)){var o=el[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var el=e.modeExtensions={};e.extendMode=function(e,t){var r=el.hasOwnProperty(e)?el[e]:el[e]={};Ei(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){bl.prototype[e]=t},e.defineOption=Vr;var tl=[];e.defineInitHook=function(e){tl.push(e)};var rl=e.helpers={};e.registerHelper=function(t,r,n){rl.hasOwnProperty(t)||(rl[t]=e[t]={_global:[]}),rl[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),rl[t]._global.push({pred:n,val:i})};var nl=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},il=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var ol=e.commands={selectAll:function(e){e.setSelection(Ho(e.firstLine(),0),Ho(e.lastLine()),Ol)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ol)},killLine:function(e){Br(e,function(t){if(t.empty()){var r=qn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ho(t.head.line+1,0)}:{from:t.head,to:Ho(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Br(e,function(t){return{from:Ho(t.from().line,0),to:ve(e.doc,Ho(t.to().line+1,0))}})},delLineLeft:function(e){Br(e,function(e){return{from:Ho(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Br(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){Br(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Ho(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Ho(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return no(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return io(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Hl)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Hl)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?oo(e,t.head):n},Hl)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=Pl(e.getLine(o.line),o.ch,n);t.push(new Array(n-l%n+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Nt(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n].head,o=qn(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Ho(i.line,i.ch-1)),i.ch>0)i=new Ho(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Ho(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=qn(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ho(i.line-1,l.length-1),Ho(i.line,1),"+transpose")}r.push(new fe(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Nt(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange(e.doc.lineSeparator(),n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0),Ir(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},ll=e.keyMap={};ll.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",
End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ll.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ll.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ll.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ll.default=ko?ll.macDefault:ll.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Di(r.split(" "),Kr),o=0;o<i.length;o++){var l,s;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e};var sl=e.lookupKey=function(e,t,r,n){t=jr(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return sl(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=sl(e,t.fallthrough[o],r,n);if(l)return l}}},al=e.isModifierKey=function(e){var t="string"==typeof e?e:Jl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},ul=e.keyName=function(e,t){if(wo&&34==e.keyCode&&e.char)return!1;var r=Jl[e.keyCode],n=r;return null==n||e.altGraphKey?!1:(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(Ao?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(Ao?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)};e.fromTextArea=function(t,r){function n(){t.value=u.getValue()}if(r=r?Ei(r):{},r.value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),null==r.autofocus){var i=Vi();r.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Tl(t.form,"submit",n),!r.leaveSubmitMethodAlone)){var o=t.form,l=o.submit;try{var s=o.submit=function(){n(),o.submit=l,o.submit(),o.submit=s}}catch(a){}}r.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(kl(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=l))}},t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},r);return u};var cl=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};cl.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else var r=t&&(e.test?e.test(t):e(t));return r?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Pl(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Pl(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Pl(this.string,null,this.tabSize)-(this.lineStart?Pl(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var hl=0,fl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++hl};Mi(fl),fl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),ki(this,"clear")){var r=this.find();r&&Ci(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Qr(l.markedSpans,this);e&&!this.collapsed?Et(e,ei(l),"text"):e&&(null!=s.to&&(i=ei(l)),null!=s.from&&(n=ei(l))),l.markedSpans=Jr(l.markedSpans,s),null==s.from&&this.collapsed&&!xn(this.doc,l)&&e&&Jn(l,mt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var a=mn(this.lines[o]),u=h(a);u>e.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Pt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&We(e.doc)),e&&Ci(e,"markerCleared",e,this),t&&xt(e),this.parent&&this.parent.clear()}},fl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],l=Qr(o.markedSpans,this);if(null!=l.from&&(r=Ho(t?o:ei(o),l.from),-1==e))return r;if(null!=l.to&&(n=Ho(t?o:ei(o),l.to),1==e))return n}return r&&{from:r,to:n}},fl.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&Nt(r,function(){var n=e.line,i=ei(e.line),o=Qe(r,i);if(o&&(it(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!xn(t.doc,n)&&null!=t.height){var l=t.height;t.height=null;var s=Ln(t)-l;s&&Jn(n,n.height+s)}})},fl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Oi(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},fl.prototype.detachLine=function(e){if(this.lines.splice(Oi(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var hl=0,dl=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Mi(dl),dl.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ci(this,"clear")}},dl.prototype.find=function(e,t){return this.primary.find(e,t)};var pl=e.LineWidget=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Mi(pl),pl.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=ei(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Ln(this);Jn(r,Math.max(0,r.height-o)),e&&Nt(e,function(){Sn(e,r,-o),Et(e,n,"widget")})}},pl.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=Ln(this)-e;n&&(Jn(r,r.height+n),t&&Nt(t,function(){t.curOp.forceUpdate=!0,Sn(t,r,n)}))};var gl=e.Line=function(e,t,r){this.text=e,un(this,t),this.height=r?r(this):1};Mi(gl),gl.prototype.lineNo=function(){return ei(this)};var vl={},ml={};Xn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;n>r;++r){var i=this.lines[r];this.height-=i.height,Mn(i),Ci(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;n>e;++e)if(r(this.lines[e]))return!0}},_n.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(i>e){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Xn))){var s=[];this.collapse(s),this.children=[new Xn(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Xn(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new _n(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Oi(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new _n(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>e){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var yl=0,bl=e.Doc=function(e,t,r,n){if(!(this instanceof bl))return new bl(e,t,r,n);null==r&&(r=0),_n.call(this,[new Xn([new gl("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=Ho(r,0);this.sel=pe(i),this.history=new ii(null),this.id=++yl,this.modeOption=t,this.lineSep=n,"string"==typeof e&&(e=this.splitLines(e)),jn(this,{from:i,to:i,text:e}),Me(this,pe(i),Ol)};bl.prototype=Pi(_n.prototype,{constructor:bl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ot(function(e){var t=Ho(this.first,0),r=this.first+this.size-1;Lr(this,{from:t,to:Ho(r,qn(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Me(this,pe(t))}),replaceRange:function(e,t,r,n){t=ve(this,t),r=r?ve(this,r):t,Wr(this,e,t,r,n)},getRange:function(e,t,r){var n=Zn(this,ve(this,e),ve(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ye(this,e)?qn(this,e):void 0},getLineNumber:function(e){return ei(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=qn(this,e)),mn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ve(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ot(function(e,t,r){Le(this,ve(this,"number"==typeof e?Ho(e,t||0):e),null,r)}),setSelection:Ot(function(e,t,r){Le(this,ve(this,e),ve(this,t||e),r)}),extendSelection:Ot(function(e,t,r){xe(this,ve(this,e),t&&ve(this,t),r)}),extendSelections:Ot(function(e,t){Ce(this,be(this,e,t))}),extendSelectionsBy:Ot(function(e,t){Ce(this,Di(this.sel.ranges,e),t)}),setSelections:Ot(function(e,t,r){if(e.length){for(var n=0,i=[];n<e.length;n++)i[n]=new fe(ve(this,e[n].anchor),ve(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Me(this,de(i,t),r)}}),addSelection:Ot(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new fe(ve(this,e),ve(this,t||e))),Me(this,de(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Zn(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Zn(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Ot(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&Cr(this,n,t),o=n.length-1;o>=0;o--)Lr(this,n[o]);s?ke(this,s):this.cm&&Ir(this.cm)}),undo:Ot(function(){kr(this,"undo")}),redo:Ot(function(){kr(this,"redo")}),undoSelection:Ot(function(){kr(this,"undo",!0)}),redoSelection:Ot(function(){kr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new ii(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:gi(this.history.done),undone:gi(this.history.undone)}},setHistory:function(e){var t=this.history=new ii(this.history.maxGeneration);t.done=gi(e.done.slice(0),null,!0),t.undone=gi(e.undone.slice(0),null,!0)},addLineClass:Ot(function(e,t,r){return Rr(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(Ki(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:Ot(function(e,t,r){return Rr(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(Ki(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:Ot(function(e,t,r){return Tn(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Xr(this,ve(this,e),ve(this,t),r,"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ve(this,e),Xr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=ve(this,e);var t=[],r=qn(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ve(this,e),t=ve(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];i==e.line&&e.ch>a.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first;return this.iter(function(n){var i=n.text.length+1;return i>e?(t=e,!0):(e-=i,void++r)}),ve(this,Ho(r,t))},indexFromPos:function(e){e=ve(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new bl(Qn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new bl(Qn(this,t,r),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],$r(n,Yr(this)),n},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=this.linked[r];if(n.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),qr(Yr(this));break}}if(t.history==this.history){var i=[t.id];Yn(t,function(e){i.push(e.id)},!0),t.history=new ii(null),t.history.done=gi(this.history.done,i),t.history.undone=gi(this.history.undone,i)}},iterLinkedDocs:function(e){Yn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$l(e)},lineSeparator:function(){return this.lineSep||"\n"}}),bl.prototype.eachLine=bl.prototype.iter;var wl="iter insert remove copy getEditor constructor".split(" ");for(var xl in bl.prototype)bl.prototype.hasOwnProperty(xl)&&Oi(wl,xl)<0&&(e.prototype[xl]=function(e){return function(){return e.apply(this.doc,arguments)}}(bl.prototype[xl]));Mi(bl);var Cl=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Sl=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Ll=e.e_stop=function(e){Cl(e),Sl(e)},Tl=e.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={}),i=n[t]||(n[t]=[]);i.push(r)}},kl=e.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers&&e._handlers[t];if(!n)return;for(var i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}}},Ml=e.signal=function(e,t){var r=e._handlers&&e._handlers[t];if(r)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)},Nl=null,Al=30,Wl=e.Pass={toString:function(){return"CodeMirror.Pass"}},Ol={scroll:!1},Dl={origin:"*mouse"},Hl={origin:"+move"};Ni.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Pl=e.countColumn=function(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=n||0,l=i||0;;){var s=e.indexOf(" ",o);if(0>s||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},El=e.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}},Il=[""],zl=function(e){e.select()};Lo?zl=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:go&&(zl=function(e){try{e.select()}catch(t){}});var Fl,Rl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Bl=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Rl.test(e))},Gl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Fl=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Ul=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};go&&11>vo&&(Vi=function(){try{return document.activeElement}catch(e){return document.body}});var Vl,Kl,jl=e.rmClass=function(e,t){var r=e.className,n=Ki(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Xl=e.addClass=function(e,t){var r=e.className;Ki(t).test(r)||(e.className+=(r?" ":"")+t)},_l=!1,Yl=function(){if(go&&9>vo)return!1;var e=Bi("div");return"draggable"in e||"dragDrop"in e}(),$l=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ql=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Zl=function(){var e=Bi("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ql=null,Jl=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)Jl[e+48]=Jl[e+96]=String(e);for(var e=65;90>=e;e++)Jl[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Jl[e+111]=Jl[e+63235]="F"+e}();var es,ts=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,h=[],f=0;c>f;++f)h.push(n=e(r.charCodeAt(f)));for(var f=0,d=u;c>f;++f){var n=h[f];"m"==n?h[f]=d:d=n}for(var f=0,p=u;c>f;++f){var n=h[f];"1"==n&&"r"==p?h[f]="n":l.test(n)&&(p=n,"r"==n&&(h[f]="R"))}for(var f=1,d=h[0];c-1>f;++f){var n=h[f];"+"==n&&"1"==d&&"1"==h[f+1]?h[f]="1":","!=n||d!=h[f+1]||"1"!=d&&"n"!=d||(h[f]=d),d=n}for(var f=0;c>f;++f){var n=h[f];if(","==n)h[f]="N";else if("%"==n){for(var g=f+1;c>g&&"%"==h[g];++g);for(var v=f&&"!"==h[f-1]||c>g&&"1"==h[g]?"1":"N",m=f;g>m;++m)h[m]=v;f=g-1}}for(var f=0,p=u;c>f;++f){var n=h[f];"L"==p&&"1"==n?h[f]="L":l.test(n)&&(p=n)}for(var f=0;c>f;++f)if(o.test(h[f])){for(var g=f+1;c>g&&o.test(h[g]);++g);for(var y="L"==(f?h[f-1]:u),b="L"==(c>g?h[g]:u),v=y||b?"L":"R",m=f;g>m;++m)h[m]=v;f=g-1}for(var w,x=[],f=0;c>f;)if(s.test(h[f])){var C=f;for(++f;c>f&&s.test(h[f]);++f);x.push(new t(0,C,f))}else{var S=f,L=x.length;for(++f;c>f&&"L"!=h[f];++f);for(var m=S;f>m;)if(a.test(h[m])){m>S&&x.splice(L,0,new t(1,S,m));var T=m;for(++m;f>m&&a.test(h[m]);++m);x.splice(L,0,new t(2,T,m)),S=m}else++m;f>S&&x.splice(L,0,new t(1,S,f))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==Wi(x).level&&(w=r.match(/\s+$/))&&(Wi(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),2==x[0].level&&x.unshift(new t(1,x[0].to,x[0].to)),x[0].level!=Wi(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.7.0",e})},{}],26:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function a(e,t,r){return ye=e,ke=r,t}function i(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),a("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=c,c(e,t)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(Ve),a("operator","operator",e.current()));if("`"==r)return t.tokenize=u,u(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(Ve.test(r))return e.eatWhile(Ve),a("operator","operator",e.current());if(je.test(r)){e.eatWhile(je);var i=e.current(),l=Me.propertyIsEnumerable(i)&&Me[i];return l&&"."!=t.lastType?a(l.type,l.style,i):a("variable","variable",i)}}function o(e){return function(t,r){var n,o=!1;if(he&&"@"==t.peek()&&t.match(Ee))return r.tokenize=i,a("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(r.tokenize=i),a("string","string")}}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=i;break}n="*"==r}return a("comment","comment")}function u(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=i;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function l(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=Ie.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(je.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function s(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,a){var i=e.cc;for(Te.state=e,Te.stream=a,Te.marked=null,Te.cc=i,Te.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():ge?w:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Te.marked?Te.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)Te.cc.push(arguments[e])}function v(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=Te.state;if(n.context){if(Te.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){Te.state.context={prev:Te.state.context,vars:Te.state.localVars},Te.state.localVars=Ae}function k(){Te.state.localVars=Te.state.context.vars,Te.state.context=Te.state.context.prev}function b(e,t){var r=function(){var r=Te.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new s(n,Te.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=Te.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(e){function t(r){return r==e?v():";"==e?p():v(t)}return t}function g(e,t){return"var"==e?v(b("vardef",t.length),G,h(";"),x):"keyword a"==e?v(b("form"),w,g,x):"keyword b"==e?v(b("form"),g,x):"{"==e?v(b("}"),H,x):";"==e?v():"if"==e?("else"==Te.state.lexical.info&&Te.state.cc[Te.state.cc.length-1]==x&&Te.state.cc.pop()(),v(b("form"),w,g,x,R)):"function"==e?v(te):"for"==e?v(b("form"),X,g,x):"variable"==e?v(b("stat"),$):"switch"==e?v(b("form"),w,b("}","switch"),h("{"),H,x,x):"case"==e?v(w,h(":")):"default"==e?v(h(":")):"catch"==e?v(b("form"),y,h("("),re,h(")"),g,x,k):"class"==e?v(b("form"),ne,x):"export"==e?v(b("stat"),ce,x):"import"==e?v(b("stat"),ue,x):p(b("stat"),w,h(";"),x);
}function w(e){return M(e,!1)}function j(e){return M(e,!0)}function M(e,t){if(Te.state.fatArrowAt==Te.stream.start){var r=t?W:C;if("("==e)return v(y,b(")"),N(J,")"),x,h("=>"),r,k);if("variable"==e)return p(y,J,h("=>"),r,k)}var n=t?z:I;return ze.hasOwnProperty(e)?v(n):"async"==e?v(w):"function"==e?v(te,n):"keyword c"==e?v(t?E:V):"("==e?v(b(")"),V,ve,h(")"),x,n):"operator"==e||"spread"==e?v(t?j:w):"["==e?v(b("]"),de,x,n):"{"==e?B(O,"}",null,n):"quasi"==e?p(T,n):v()}function V(e){return e.match(/[;\}\)\],]/)?p():p(w)}function E(e){return e.match(/[;\}\)\],]/)?p():p(j)}function I(e,t){return","==e?v(w):z(e,t,!1)}function z(e,t,r){var n=0==r?I:z,a=0==r?w:j;return"=>"==e?v(y,r?W:C,k):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(w,h(":"),a):v(a):"quasi"==e?p(T,n):";"!=e?"("==e?B(j,")","call",n):"."==e?v(q,n):"["==e?v(b("]"),V,h("]"),x,n):void 0:void 0}function T(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?v(T):v(w,A)}function A(e){return"}"==e?(Te.marked="string-2",Te.state.tokenize=u,v(T)):void 0}function C(e){return l(Te.stream,Te.state),p("{"==e?g:w)}function W(e){return l(Te.stream,Te.state),p("{"==e?g:j)}function $(e){return":"==e?v(x,g):p(I,h(";"),x)}function q(e){return"variable"==e?(Te.marked="property",v()):void 0}function O(e,t){return"async"==e?v(O):"variable"==e||"keyword"==Te.style?(Te.marked="property",v("get"==t||"set"==t?P:S)):"number"==e||"string"==e?(Te.marked=he?"property":Te.style+" property",v(S)):"jsonld-keyword"==e?v(S):"["==e?v(w,h("]"),S):void 0}function P(e){return"variable"!=e?p(S):(Te.marked="property",v(te))}function S(e){return":"==e?v(j):"("==e?p(te):void 0}function N(e,t){function r(n){if(","==n){var a=Te.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(h(t))}return function(n){return n==t?v():p(e,r)}}function B(e,t,r){for(var n=3;n<arguments.length;n++)Te.cc.push(arguments[n]);return v(b(t,r),N(e,t),x)}function H(e){return"}"==e?v():p(g,H)}function U(e){return we&&":"==e?v(F):void 0}function D(e,t){return"="==t?v(j):void 0}function F(e){return"variable"==e?(Te.marked="variable-3",v()):void 0}function G(){return p(J,U,L,Q)}function J(e,t){return"variable"==e?(m(t),v()):"["==e?B(J,"]"):"{"==e?B(K,"}"):void 0}function K(e,t){return"variable"!=e||Te.stream.match(/^\s*:/,!1)?("variable"==e&&(Te.marked="property"),v(h(":"),J,L)):(m(t),v(L))}function L(e,t){return"="==t?v(j):void 0}function Q(e){return","==e?v(G):void 0}function R(e,t){return"keyword b"==e&&"else"==t?v(b("form","else"),g,x):void 0}function X(e){return"("==e?v(b(")"),Y,h(")"),x):void 0}function Y(e){return"var"==e?v(G,h(";"),_):";"==e?v(_):"variable"==e?v(Z):p(w,h(";"),_)}function Z(e,t){return"in"==t||"of"==t?(Te.marked="keyword",v(w)):v(I,_)}function _(e,t){return";"==e?v(ee):"in"==t||"of"==t?(Te.marked="keyword",v(w)):p(w,h(";"),ee)}function ee(e){")"!=e&&v(w)}function te(e,t){return"*"==t?(Te.marked="keyword",v(te)):"variable"==e?(m(t),v(te)):"("==e?v(y,b(")"),N(re,")"),x,g,k):void 0}function re(e){return"spread"==e?v(re):p(J,U,D)}function ne(e,t){return"variable"==e?(m(t),v(ae)):void 0}function ae(e,t){return"extends"==t?v(w,ae):"{"==e?v(b("}"),ie,x):void 0}function ie(e,t){return"variable"==e||"keyword"==Te.style?"static"==t?(Te.marked="keyword",v(ie)):(Te.marked="property","get"==t||"set"==t?v(oe,te,ie):v(te,ie)):"*"==t?(Te.marked="keyword",v(ie)):";"==e?v(ie):"}"==e?v():void 0}function oe(e){return"variable"!=e?p():(Te.marked="property",v())}function ce(e,t){return"*"==t?(Te.marked="keyword",v(fe,h(";"))):"default"==t?(Te.marked="keyword",v(w,h(";"))):p(g)}function ue(e){return"string"==e?v():p(le,fe)}function le(e,t){return"{"==e?B(le,"}"):("variable"==e&&m(t),"*"==t&&(Te.marked="keyword"),v(se))}function se(e,t){return"as"==t?(Te.marked="keyword",v(le)):void 0}function fe(e,t){return"from"==t?(Te.marked="keyword",v(w)):void 0}function de(e){return"]"==e?v():p(j,pe)}function pe(e){return"for"==e?p(ve,h("]")):","==e?v(N(E,"]")):p(N(j,"]"))}function ve(e){return"for"==e?v(X,ve):"if"==e?v(w,ve):void 0}function me(e,t){return"operator"==e.lastType||","==e.lastType||Ve.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var ye,ke,be=t.indentUnit,xe=r.statementIndent,he=r.jsonld,ge=r.json||he,we=r.typescript,je=r.wordCharacters||/[\w$\xa1-\uffff]/,Me=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:n,delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),async:e("async"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),await:n,yield:n,export:e("export"),import:e("import"),extends:n};if(we){var c={type:"variable",style:"variable-3"},u={interface:e("interface"),extends:e("extends"),constructor:e("constructor"),public:e("public"),private:e("private"),protected:e("protected"),static:e("static"),string:c,number:c,bool:c,any:c};for(var l in u)o[l]=u[l]}return o}(),Ve=/[+\-*&%=<>!?|~^]/,Ee=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ie="([{}])",ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Te={state:null,column:null,marked:null,cc:null},Ae={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:i,lastType:"sof",cc:[],lexical:new s((e||0)-be,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),l(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==ye?r:(t.lastType="operator"!=ye||"++"!=ke&&"--"!=ke?ye:"incdec",d(t,r,ye,ke,e))},indent:function(t,n){if(t.tokenize==c)return e.Pass;if(t.tokenize!=i)return 0;var a=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var l=t.cc[u];if(l==x)o=o.prev;else if(l!=R)break}"stat"==o.type&&"}"==a&&(o=o.prev),xe&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var s=o.type,f=a==s;return"vardef"==s?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==s&&"{"==a?o.indented:"form"==s?o.indented+be:"stat"==s?o.indented+(me(t,n)?xe||be:0):"switch"!=o.info||f||0==r.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:be):o.indented+(/^(?:case|default)\b/.test(n)?be:2*be)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ge?null:"/*",blockCommentEnd:ge?null:"*/",lineComment:ge?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ge?"json":"javascript",jsonldMode:he,jsonMode:ge}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":25}],27:[function(require,module,exports){"use strict";var _get=require("babel-runtime/helpers/get").default,_inherits=require("babel-runtime/helpers/inherits").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _language=require("../language"),GraphQLError=function(e){function r(e,t,i,n,o){_classCallCheck(this,r),_get(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,e),this.message=e,Object.defineProperty(this,"stack",{value:i||e}),Object.defineProperty(this,"nodes",{value:t}),Object.defineProperty(this,"source",{get:function(){if(n)return n;if(t&&t.length>0){var e=t[0];return e&&e.loc&&e.loc.source}}}),Object.defineProperty(this,"positions",{get:function(){if(o)return o;if(t){var e=t.map(function(e){return e.loc&&e.loc.start});if(e.some(function(e){return e}))return e}}}),Object.defineProperty(this,"locations",{get:function(){var e=this;return this.positions&&this.source?this.positions.map(function(r){return _language.getLocation(e.source,r)}):void 0}})}return _inherits(r,e),r}(Error);exports.GraphQLError=GraphQLError},{"../language":38,"babel-runtime/helpers/class-call-check":56,"babel-runtime/helpers/get":59,"babel-runtime/helpers/inherits":60}],28:[function(require,module,exports){"use strict";function formatError(e){return _jsutilsInvariant2.default(e,"Received null or undefined error."),{message:e.message,locations:e.locations}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatError=formatError;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant)},{"../jsutils/invariant":33,"babel-runtime/helpers/interop-require-default":61}],29:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _GraphQLError=require("./GraphQLError");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _GraphQLError.GraphQLError}});var _syntaxError=require("./syntaxError");Object.defineProperty(exports,"syntaxError",{enumerable:!0,get:function(){return _syntaxError.syntaxError}});var _locatedError=require("./locatedError");Object.defineProperty(exports,"locatedError",{enumerable:!0,get:function(){return _locatedError.locatedError}});var _formatError=require("./formatError");Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _formatError.formatError}})},{"./GraphQLError":27,"./formatError":28,"./locatedError":30,"./syntaxError":31}],30:[function(require,module,exports){"use strict";function locatedError(r,e){var o=r?r.message||String(r):"An unknown error occurred.",t=r?r.stack:null;return new _GraphQLError.GraphQLError(o,e,t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.locatedError=locatedError;var _GraphQLError=require("./GraphQLError")},{"./GraphQLError":27}],31:[function(require,module,exports){"use strict";function syntaxError(r,n,o){var t=_languageLocation.getLocation(r,n),a=new _GraphQLError.GraphQLError("Syntax Error "+r.name+" ("+t.line+":"+t.column+") "+o+"\n\n"+highlightSourceAtLocation(r,t),void 0,void 0,r,[n]);return a}function highlightSourceAtLocation(r,n){var o=n.line,t=(o-1).toString(),a=o.toString(),e=(o+1).toString(),i=e.length,l=r.body.split(/\r\n|[\n\r\u2028\u2029]/g);return(o>=2?lpad(i,t)+": "+l[o-2]+"\n":"")+lpad(i,a)+": "+l[o-1]+"\n"+Array(2+i+n.column).join(" ")+"^\n"+(o<l.length?lpad(i,e)+": "+l[o]+"\n":"")}function lpad(r,n){return Array(r-n.length+1).join(" ")+n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.syntaxError=syntaxError;var _languageLocation=require("../language/location"),_GraphQLError=require("./GraphQLError")},{"../language/location":41,"./GraphQLError":27}],32:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=find,module.exports=exports.default},{}],33:[function(require,module,exports){"use strict";function invariant(e,t){if(!e)throw new Error(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=invariant,module.exports=exports.default},{}],34:[function(require,module,exports){"use strict";function isNullish(e){return null===e||void 0===e||e!==e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isNullish,module.exports=exports.default},{}],35:[function(require,module,exports){"use strict";function keyMap(e,t){return e.reduce(function(e,r){return e[t(r)]=r,e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=keyMap,module.exports=exports.default},{}],36:[function(require,module,exports){"use strict";function keyValMap(e,t,r){return e.reduce(function(e,u){return e[t(u)]=r(u),e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=keyValMap,module.exports=exports.default},{}],37:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0})},{}],38:[function(require,module,exports){"use strict";var _interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0});var _kinds=require("./kinds"),Kind=_interopRequireWildcard(_kinds),_location=require("./location");Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _location.getLocation}}),exports.Kind=Kind;var _lexer=require("./lexer");Object.defineProperty(exports,"lex",{enumerable:!0,get:function(){return _lexer.lex}});var _parser=require("./parser");Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _parser.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _parser.parseValue}});var _printer=require("./printer");Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _printer.print}});var _source=require("./source");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _source.Source}});var _visitor=require("./visitor");Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _visitor.visit}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _visitor.BREAK}})},{"./kinds":39,"./lexer":40,"./location":41,"./parser":42,"./printer":43,"./source":44,"./visitor":45,"babel-runtime/helpers/interop-require-wildcard":62}],39:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var NAME="Name";exports.NAME=NAME;var DOCUMENT="Document";exports.DOCUMENT=DOCUMENT;var OPERATION_DEFINITION="OperationDefinition";exports.OPERATION_DEFINITION=OPERATION_DEFINITION;var VARIABLE_DEFINITION="VariableDefinition";exports.VARIABLE_DEFINITION=VARIABLE_DEFINITION;var VARIABLE="Variable";exports.VARIABLE=VARIABLE;var SELECTION_SET="SelectionSet";exports.SELECTION_SET=SELECTION_SET;var FIELD="Field";exports.FIELD=FIELD;var ARGUMENT="Argument";exports.ARGUMENT=ARGUMENT;var FRAGMENT_SPREAD="FragmentSpread";exports.FRAGMENT_SPREAD=FRAGMENT_SPREAD;var INLINE_FRAGMENT="InlineFragment";exports.INLINE_FRAGMENT=INLINE_FRAGMENT;var FRAGMENT_DEFINITION="FragmentDefinition";exports.FRAGMENT_DEFINITION=FRAGMENT_DEFINITION;var INT="IntValue";exports.INT=INT;var FLOAT="FloatValue";exports.FLOAT=FLOAT;var STRING="StringValue";exports.STRING=STRING;var BOOLEAN="BooleanValue";exports.BOOLEAN=BOOLEAN;var ENUM="EnumValue";exports.ENUM=ENUM;var LIST="ListValue";exports.LIST=LIST;var OBJECT="ObjectValue";exports.OBJECT=OBJECT;var OBJECT_FIELD="ObjectField";exports.OBJECT_FIELD=OBJECT_FIELD;var DIRECTIVE="Directive";exports.DIRECTIVE=DIRECTIVE;var NAMED_TYPE="NamedType";exports.NAMED_TYPE=NAMED_TYPE;var LIST_TYPE="ListType";exports.LIST_TYPE=LIST_TYPE;var NON_NULL_TYPE="NonNullType";exports.NON_NULL_TYPE=NON_NULL_TYPE;var OBJECT_TYPE_DEFINITION="ObjectTypeDefinition";exports.OBJECT_TYPE_DEFINITION=OBJECT_TYPE_DEFINITION;var FIELD_DEFINITION="FieldDefinition";exports.FIELD_DEFINITION=FIELD_DEFINITION;var INPUT_VALUE_DEFINITION="InputValueDefinition";exports.INPUT_VALUE_DEFINITION=INPUT_VALUE_DEFINITION;var INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition";exports.INTERFACE_TYPE_DEFINITION=INTERFACE_TYPE_DEFINITION;var UNION_TYPE_DEFINITION="UnionTypeDefinition";exports.UNION_TYPE_DEFINITION=UNION_TYPE_DEFINITION;var SCALAR_TYPE_DEFINITION="ScalarTypeDefinition";exports.SCALAR_TYPE_DEFINITION=SCALAR_TYPE_DEFINITION;var ENUM_TYPE_DEFINITION="EnumTypeDefinition";exports.ENUM_TYPE_DEFINITION=ENUM_TYPE_DEFINITION;var ENUM_VALUE_DEFINITION="EnumValueDefinition";exports.ENUM_VALUE_DEFINITION=ENUM_VALUE_DEFINITION;var INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition";exports.INPUT_OBJECT_TYPE_DEFINITION=INPUT_OBJECT_TYPE_DEFINITION;var TYPE_EXTENSION_DEFINITION="TypeExtensionDefinition";exports.TYPE_EXTENSION_DEFINITION=TYPE_EXTENSION_DEFINITION},{}],40:[function(require,module,exports){"use strict";function lex(e){var n=0;return function(r){var a=readToken(e,void 0===r?n:r);return n=a.end,a}}function getTokenDesc(e){return e.value?getTokenKindDesc(e.kind)+' "'+e.value+'"':getTokenKindDesc(e.kind)}function getTokenKindDesc(e){return tokenDescription[e]}function makeToken(e,n,r,a){return{kind:e,start:n,end:r,value:a}}function readToken(e,n){var r=e.body,a=r.length,o=positionAfterWhitespace(r,n),c=charCodeAt.call(r,o);if(o>=a)return makeToken(TokenKind.EOF,o,o);switch(c){case 33:return makeToken(TokenKind.BANG,o,o+1);case 36:return makeToken(TokenKind.DOLLAR,o,o+1);case 40:return makeToken(TokenKind.PAREN_L,o,o+1);case 41:return makeToken(TokenKind.PAREN_R,o,o+1);case 46:if(46===charCodeAt.call(r,o+1)&&46===charCodeAt.call(r,o+2))return makeToken(TokenKind.SPREAD,o,o+3);break;case 58:return makeToken(TokenKind.COLON,o,o+1);case 61:return makeToken(TokenKind.EQUALS,o,o+1);case 64:return makeToken(TokenKind.AT,o,o+1);case 91:return makeToken(TokenKind.BRACKET_L,o,o+1);case 93:return makeToken(TokenKind.BRACKET_R,o,o+1);case 123:return makeToken(TokenKind.BRACE_L,o,o+1);case 124:return makeToken(TokenKind.PIPE,o,o+1);case 125:return makeToken(TokenKind.BRACE_R,o,o+1);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return readName(e,o);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(e,o,c);case 34:return readString(e,o)}throw _error.syntaxError(e,o,'Unexpected character "'+fromCharCode(c)+'".')}function positionAfterWhitespace(e,n){for(var r=e.length,a=n;r>a;){var o=charCodeAt.call(e,a);if(32===o||44===o||160===o||8232===o||8233===o||o>8&&14>o)++a;else{if(35!==o)break;for(++a;r>a&&(o=charCodeAt.call(e,a))&&10!==o&&13!==o&&8232!==o&&8233!==o;)++a}}return a}function readNumber(e,n,r){var a=r,o=e.body,c=n,t=!1;if(45===a&&(a=charCodeAt.call(o,++c)),48===a){if(a=charCodeAt.call(o,++c),a>=48&&57>=a)throw _error.syntaxError(e,c,'Invalid number, unexpected digit after 0: "'+fromCharCode(a)+'".')}else c=readDigits(e,c,a),a=charCodeAt.call(o,c);return 46===a&&(t=!0,a=charCodeAt.call(o,++c),c=readDigits(e,c,a),a=charCodeAt.call(o,c)),(69===a||101===a)&&(t=!0,a=charCodeAt.call(o,++c),(43===a||45===a)&&(a=charCodeAt.call(o,++c)),c=readDigits(e,c,a)),makeToken(t?TokenKind.FLOAT:TokenKind.INT,n,c,slice.call(o,n,c))}function readDigits(e,n,r){var a=e.body,o=n,c=r;if(c>=48&&57>=c){do c=charCodeAt.call(a,++o);while(c>=48&&57>=c);return o}throw _error.syntaxError(e,o,"Invalid number, expected digit but got: "+(c?'"'+fromCharCode(c)+'"':"EOF")+".")}function readString(e,n){for(var r,a=e.body,o=n+1,c=o,t="";o<a.length&&(r=charCodeAt.call(a,o))&&34!==r&&10!==r&&13!==r&&8232!==r&&8233!==r;)if(++o,92===r){switch(t+=slice.call(a,c,o-1),r=charCodeAt.call(a,o)){case 34:t+='"';break;case 47:t+="/";break;case 92:t+="\\";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+=" ";break;case 117:var i=uniCharCode(charCodeAt.call(a,o+1),charCodeAt.call(a,o+2),charCodeAt.call(a,o+3),charCodeAt.call(a,o+4));if(0>i)throw _error.syntaxError(e,o,"Bad character escape sequence.");t+=fromCharCode(i),o+=4;break;default:throw _error.syntaxError(e,o,"Bad character escape sequence.")}++o,c=o}if(34!==r)throw _error.syntaxError(e,o,"Unterminated string.");return t+=slice.call(a,c,o),makeToken(TokenKind.STRING,n,o+1,t)}function uniCharCode(e,n,r,a){return char2hex(e)<<12|char2hex(n)<<8|char2hex(r)<<4|char2hex(a)}function char2hex(e){return e>=48&&57>=e?e-48:e>=65&&70>=e?e-55:e>=97&&102>=e?e-87:-1}function readName(e,n){for(var r,a=e.body,o=a.length,c=n+1;c!==o&&(r=charCodeAt.call(a,c))&&(95===r||r>=48&&57>=r||r>=65&&90>=r||r>=97&&122>=r);)++c;return makeToken(TokenKind.NAME,n,c,slice.call(a,n,c))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.lex=lex,exports.getTokenDesc=getTokenDesc,exports.getTokenKindDesc=getTokenKindDesc;var _error=require("../error"),TokenKind={EOF:1,BANG:2,DOLLAR:3,PAREN_L:4,PAREN_R:5,SPREAD:6,COLON:7,EQUALS:8,AT:9,BRACKET_L:10,BRACKET_R:11,BRACE_L:12,PIPE:13,BRACE_R:14,NAME:15,VARIABLE:16,INT:17,FLOAT:18,STRING:19};exports.TokenKind=TokenKind;var tokenDescription={};tokenDescription[TokenKind.EOF]="EOF",tokenDescription[TokenKind.BANG]="!",tokenDescription[TokenKind.DOLLAR]="$",tokenDescription[TokenKind.PAREN_L]="(",tokenDescription[TokenKind.PAREN_R]=")",tokenDescription[TokenKind.SPREAD]="...",tokenDescription[TokenKind.COLON]=":",tokenDescription[TokenKind.EQUALS]="=",tokenDescription[TokenKind.AT]="@",tokenDescription[TokenKind.BRACKET_L]="[",tokenDescription[TokenKind.BRACKET_R]="]",tokenDescription[TokenKind.BRACE_L]="{",tokenDescription[TokenKind.PIPE]="|",tokenDescription[TokenKind.BRACE_R]="}",tokenDescription[TokenKind.NAME]="Name",tokenDescription[TokenKind.VARIABLE]="Variable",tokenDescription[TokenKind.INT]="Int",tokenDescription[TokenKind.FLOAT]="Float",tokenDescription[TokenKind.STRING]="String";var charCodeAt=String.prototype.charCodeAt,fromCharCode=String.fromCharCode,slice=String.prototype.slice},{"../error":29}],41:[function(require,module,exports){"use strict";function getLocation(e,t){for(var n,o=1,r=t+1,i=/\r\n|[\n\r\u2028\u2029]/g;(n=i.exec(e.body))&&n.index<t;)o+=1,r=t+1-(n.index+n[0].length);return{line:o,column:r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLocation=getLocation},{}],42:[function(require,module,exports){"use strict";function parse(e,n){var r=e instanceof _source.Source?e:new _source.Source(e),t=makeParser(r,n||{});return parseDocument(t)}function parseValue(e,n){var r=e instanceof _source.Source?e:new _source.Source(e),t=makeParser(r,n||{});return parseValueLiteral(t)}function parseName(e){var n=expect(e,_lexer.TokenKind.NAME);return{kind:_kinds.NAME,value:n.value,loc:loc(e,n.start)}}function parseDocument(e){var n=e.token.start,r=[];do r.push(parseDefinition(e));while(!skip(e,_lexer.TokenKind.EOF));return{kind:_kinds.DOCUMENT,definitions:r,loc:loc(e,n)}}function parseDefinition(e){if(peek(e,_lexer.TokenKind.BRACE_L))return parseOperationDefinition(e);if(peek(e,_lexer.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return parseOperationDefinition(e);case"fragment":return parseFragmentDefinition(e);case"type":case"interface":case"union":case"scalar":case"enum":case"input":case"extend":return parseTypeDefinition(e)}throw unexpected(e)}function parseOperationDefinition(e){var n=e.token.start;if(peek(e,_lexer.TokenKind.BRACE_L))return{kind:_kinds.OPERATION_DEFINITION,operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:parseSelectionSet(e),loc:loc(e,n)};var r=expect(e,_lexer.TokenKind.NAME),t=r.value;return{kind:_kinds.OPERATION_DEFINITION,operation:t,name:parseName(e),variableDefinitions:parseVariableDefinitions(e),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseVariableDefinitions(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseVariableDefinition,_lexer.TokenKind.PAREN_R):[]}function parseVariableDefinition(e){var n=e.token.start;return{kind:_kinds.VARIABLE_DEFINITION,variable:parseVariable(e),type:(expect(e,_lexer.TokenKind.COLON),parseType(e)),defaultValue:skip(e,_lexer.TokenKind.EQUALS)?parseValueLiteral(e,!0):null,loc:loc(e,n)}}function parseVariable(e){var n=e.token.start;return expect(e,_lexer.TokenKind.DOLLAR),{kind:_kinds.VARIABLE,name:parseName(e),loc:loc(e,n)}}function parseSelectionSet(e){var n=e.token.start;return{kind:_kinds.SELECTION_SET,selections:many(e,_lexer.TokenKind.BRACE_L,parseSelection,_lexer.TokenKind.BRACE_R),loc:loc(e,n)}}function parseSelection(e){return peek(e,_lexer.TokenKind.SPREAD)?parseFragment(e):parseField(e)}function parseField(e){var n,r,t=e.token.start,a=parseName(e);return skip(e,_lexer.TokenKind.COLON)?(n=a,r=parseName(e)):(n=null,r=a),{kind:_kinds.FIELD,alias:n,name:r,arguments:parseArguments(e),directives:parseDirectives(e),selectionSet:peek(e,_lexer.TokenKind.BRACE_L)?parseSelectionSet(e):null,loc:loc(e,t)}}function parseArguments(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseArgument,_lexer.TokenKind.PAREN_R):[]}function parseArgument(e){var n=e.token.start;return{kind:_kinds.ARGUMENT,name:parseName(e),value:(expect(e,_lexer.TokenKind.COLON),parseValueLiteral(e,!1)),loc:loc(e,n)}}function parseFragment(e){var n=e.token.start;return expect(e,_lexer.TokenKind.SPREAD),"on"===e.token.value?(advance(e),{kind:_kinds.INLINE_FRAGMENT,typeCondition:parseNamedType(e),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}):{kind:_kinds.FRAGMENT_SPREAD,name:parseFragmentName(e),directives:parseDirectives(e),loc:loc(e,n)}}function parseFragmentDefinition(e){var n=e.token.start;return expectKeyword(e,"fragment"),{kind:_kinds.FRAGMENT_DEFINITION,name:parseFragmentName(e),typeCondition:(expectKeyword(e,"on"),parseNamedType(e)),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseFragmentName(e){if("on"===e.token.value)throw unexpected(e);return parseName(e)}function parseValueLiteral(e,n){var r=e.token;switch(r.kind){case _lexer.TokenKind.BRACKET_L:return parseList(e,n);case _lexer.TokenKind.BRACE_L:return parseObject(e,n);case _lexer.TokenKind.INT:return advance(e),{kind:_kinds.INT,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.FLOAT:return advance(e),{kind:_kinds.FLOAT,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.STRING:return advance(e),{kind:_kinds.STRING,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.NAME:if("true"===r.value||"false"===r.value)return advance(e),{kind:_kinds.BOOLEAN,value:"true"===r.value,loc:loc(e,r.start)};if("null"!==r.value)return advance(e),{kind:_kinds.ENUM,value:r.value,loc:loc(e,r.start)};break;case _lexer.TokenKind.DOLLAR:if(!n)return parseVariable(e)}throw unexpected(e)}function parseConstValue(e){return parseValueLiteral(e,!0)}function parseValueValue(e){return parseValueLiteral(e,!1)}function parseList(e,n){var r=e.token.start,t=n?parseConstValue:parseValueValue;return{kind:_kinds.LIST,values:any(e,_lexer.TokenKind.BRACKET_L,t,_lexer.TokenKind.BRACKET_R),loc:loc(e,r)}}function parseObject(e,n){var r=e.token.start;expect(e,_lexer.TokenKind.BRACE_L);for(var t={},a=[];!skip(e,_lexer.TokenKind.BRACE_R);)a.push(parseObjectField(e,n,t));return{kind:_kinds.OBJECT,fields:a,loc:loc(e,r)}}function parseObjectField(e,n,r){var t=e.token.start,a=parseName(e);if(r.hasOwnProperty(a.value))throw _error.syntaxError(e.source,t,"Duplicate input object field "+a.value+".");return r[a.value]=!0,{kind:_kinds.OBJECT_FIELD,name:a,value:(expect(e,_lexer.TokenKind.COLON),parseValueLiteral(e,n)),loc:loc(e,t)}}function parseDirectives(e){for(var n=[];peek(e,_lexer.TokenKind.AT);)n.push(parseDirective(e));return n}function parseDirective(e){var n=e.token.start;return expect(e,_lexer.TokenKind.AT),{kind:_kinds.DIRECTIVE,name:parseName(e),arguments:parseArguments(e),loc:loc(e,n)}}function parseType(e){var n,r=e.token.start;return skip(e,_lexer.TokenKind.BRACKET_L)?(n=parseType(e),expect(e,_lexer.TokenKind.BRACKET_R),n={kind:_kinds.LIST_TYPE,type:n,loc:loc(e,r)}):n=parseNamedType(e),skip(e,_lexer.TokenKind.BANG)?{kind:_kinds.NON_NULL_TYPE,type:n,loc:loc(e,r)}:n}function parseNamedType(e){var n=e.token.start;return{kind:_kinds.NAMED_TYPE,name:parseName(e),loc:loc(e,n)}}function parseTypeDefinition(e){if(!peek(e,_lexer.TokenKind.NAME))throw unexpected(e);switch(e.token.value){case"type":return parseObjectTypeDefinition(e);case"interface":return parseInterfaceTypeDefinition(e);case"union":return parseUnionTypeDefinition(e);case"scalar":return parseScalarTypeDefinition(e);case"enum":return parseEnumTypeDefinition(e);case"input":return parseInputObjectTypeDefinition(e);case"extend":return parseTypeExtensionDefinition(e);default:throw unexpected(e)}}function parseObjectTypeDefinition(e){var n=e.token.start;expectKeyword(e,"type");var r=parseName(e),t=parseImplementsInterfaces(e),a=any(e,_lexer.TokenKind.BRACE_L,parseFieldDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.OBJECT_TYPE_DEFINITION,name:r,interfaces:t,fields:a,loc:loc(e,n)}}function parseImplementsInterfaces(e){var n=[];if("implements"===e.token.value){advance(e);do n.push(parseNamedType(e));while(!peek(e,_lexer.TokenKind.BRACE_L))}return n}function parseFieldDefinition(e){var n=e.token.start,r=parseName(e),t=parseArgumentDefs(e);expect(e,_lexer.TokenKind.COLON);var a=parseType(e);return{kind:_kinds.FIELD_DEFINITION,name:r,arguments:t,type:a,loc:loc(e,n)}}function parseArgumentDefs(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseInputValueDef,_lexer.TokenKind.PAREN_R):[]}function parseInputValueDef(e){var n=e.token.start,r=parseName(e);expect(e,_lexer.TokenKind.COLON);var t=parseType(e,!1),a=null;return skip(e,_lexer.TokenKind.EQUALS)&&(a=parseConstValue(e)),{kind:_kinds.INPUT_VALUE_DEFINITION,name:r,type:t,defaultValue:a,loc:loc(e,n)}}function parseInterfaceTypeDefinition(e){var n=e.token.start;expectKeyword(e,"interface");var r=parseName(e),t=any(e,_lexer.TokenKind.BRACE_L,parseFieldDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.INTERFACE_TYPE_DEFINITION,name:r,fields:t,loc:loc(e,n)}}function parseUnionTypeDefinition(e){var n=e.token.start;expectKeyword(e,"union");var r=parseName(e);expect(e,_lexer.TokenKind.EQUALS);var t=parseUnionMembers(e);return{kind:_kinds.UNION_TYPE_DEFINITION,name:r,types:t,loc:loc(e,n)}}function parseUnionMembers(e){var n=[];do n.push(parseNamedType(e));while(skip(e,_lexer.TokenKind.PIPE));return n}function parseScalarTypeDefinition(e){var n=e.token.start;expectKeyword(e,"scalar");var r=parseName(e);return{kind:_kinds.SCALAR_TYPE_DEFINITION,name:r,loc:loc(e,n)}}function parseEnumTypeDefinition(e){var n=e.token.start;expectKeyword(e,"enum");var r=parseName(e),t=many(e,_lexer.TokenKind.BRACE_L,parseEnumValueDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.ENUM_TYPE_DEFINITION,name:r,values:t,loc:loc(e,n)}}function parseEnumValueDefinition(e){var n=e.token.start,r=parseName(e);return{kind:_kinds.ENUM_VALUE_DEFINITION,name:r,loc:loc(e,n)}}function parseInputObjectTypeDefinition(e){var n=e.token.start;expectKeyword(e,"input");var r=parseName(e),t=any(e,_lexer.TokenKind.BRACE_L,parseInputValueDef,_lexer.TokenKind.BRACE_R);return{kind:_kinds.INPUT_OBJECT_TYPE_DEFINITION,name:r,fields:t,loc:loc(e,n)}}function parseTypeExtensionDefinition(e){var n=e.token.start;expectKeyword(e,"extend");var r=parseObjectTypeDefinition(e);return{kind:_kinds.TYPE_EXTENSION_DEFINITION,definition:r,loc:loc(e,n)}}function makeParser(e,n){var r=_lexer.lex(e);return{_lexToken:r,source:e,options:n,prevEnd:0,token:r()}}function loc(e,n){return e.options.noLocation?null:e.options.noSource?{start:n,end:e.prevEnd}:{start:n,end:e.prevEnd,source:e.source}}function advance(e){var n=e.token.end;e.prevEnd=n,e.token=e._lexToken(n)}function peek(e,n){return e.token.kind===n}function skip(e,n){var r=e.token.kind===n;return r&&advance(e),r}function expect(e,n){
var r=e.token;if(r.kind===n)return advance(e),r;throw _error.syntaxError(e.source,r.start,"Expected "+_lexer.getTokenKindDesc(n)+", found "+_lexer.getTokenDesc(r))}function expectKeyword(e,n){var r=e.token;if(r.kind===_lexer.TokenKind.NAME&&r.value===n)return advance(e),r;throw _error.syntaxError(e.source,r.start,'Expected "'+n+'", found '+_lexer.getTokenDesc(r))}function unexpected(e,n){var r=n||e.token;return _error.syntaxError(e.source,r.start,"Unexpected "+_lexer.getTokenDesc(r))}function any(e,n,r,t){expect(e,n);for(var a=[];!skip(e,t);)a.push(r(e));return a}function many(e,n,r,t){expect(e,n);for(var a=[r(e)];!skip(e,t);)a.push(r(e));return a}Object.defineProperty(exports,"__esModule",{value:!0}),exports.parse=parse,exports.parseValue=parseValue,exports.parseConstValue=parseConstValue,exports.parseType=parseType,exports.parseNamedType=parseNamedType;var _source=require("./source"),_error=require("../error"),_lexer=require("./lexer"),_kinds=require("./kinds")},{"../error":29,"./kinds":39,"./lexer":40,"./source":44}],43:[function(require,module,exports){"use strict";function print(n){return _visitor.visit(n,{leave:printDocASTReducer})}function join(n,e){return n?n.filter(function(n){return n}).join(e||""):""}function block(n){return length(n)?indent("{\n"+join(n,"\n"))+"\n}":""}function wrap(n,e,i){return e?n+e+(i||""):""}function indent(n){return n&&n.replace(/\n/g,"\n ")}function length(n){return n?n.length:0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.print=print;var _visitor=require("./visitor"),printDocASTReducer={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return join(n.definitions,"\n\n")+"\n"},OperationDefinition:function(n){var e=n.operation,i=n.name,t=wrap("(",join(n.variableDefinitions,", "),")"),r=join(n.directives," "),u=n.selectionSet;return i?join([e,join([i,t]),r,u]," "):u},VariableDefinition:function(n){var e=n.variable,i=n.type,t=n.defaultValue;return e+": "+i+wrap(" = ",t)},SelectionSet:function(n){var e=n.selections;return block(e)},Field:function(n){var e=n.alias,i=n.name,t=n.arguments,r=n.directives,u=n.selectionSet;return join([wrap("",e,": ")+i+wrap("(",join(t,", "),")"),join(r," "),u]," ")},Argument:function(n){var e=n.name,i=n.value;return e+": "+i},FragmentSpread:function(n){var e=n.name,i=n.directives;return"..."+e+wrap(" ",join(i," "))},InlineFragment:function(n){var e=n.typeCondition,i=n.directives,t=n.selectionSet;return"... on "+e+" "+wrap("",join(i," ")," ")+t},FragmentDefinition:function(n){var e=n.name,i=n.typeCondition,t=n.directives,r=n.selectionSet;return"fragment "+e+" on "+i+" "+wrap("",join(t," ")," ")+r},IntValue:function(n){var e=n.value;return e},FloatValue:function(n){var e=n.value;return e},StringValue:function(n){var e=n.value;return JSON.stringify(e)},BooleanValue:function(n){var e=n.value;return JSON.stringify(e)},EnumValue:function(n){var e=n.value;return e},ListValue:function(n){var e=n.values;return"["+join(e,", ")+"]"},ObjectValue:function(n){var e=n.fields;return"{"+join(e,", ")+"}"},ObjectField:function(n){var e=n.name,i=n.value;return e+": "+i},Directive:function(n){var e=n.name,i=n.arguments;return"@"+e+wrap("(",join(i,", "),")")},NamedType:function(n){var e=n.name;return e},ListType:function(n){var e=n.type;return"["+e+"]"},NonNullType:function(n){var e=n.type;return e+"!"},ObjectTypeDefinition:function(n){var e=n.name,i=n.interfaces,t=n.fields;return"type "+e+" "+wrap("implements ",join(i,", ")," ")+block(t)},FieldDefinition:function(n){var e=n.name,i=n.arguments,t=n.type;return e+wrap("(",join(i,", "),")")+": "+t},InputValueDefinition:function(n){var e=n.name,i=n.type,t=n.defaultValue;return e+": "+i+wrap(" = ",t)},InterfaceTypeDefinition:function(n){var e=n.name,i=n.fields;return"interface "+e+" "+block(i)},UnionTypeDefinition:function(n){var e=n.name,i=n.types;return"union "+e+" = "+join(i," | ")},ScalarTypeDefinition:function(n){var e=n.name;return"scalar "+e},EnumTypeDefinition:function(n){var e=n.name,i=n.values;return"enum "+e+" "+block(i)},EnumValueDefinition:function(n){var e=n.name;return e},InputObjectTypeDefinition:function(n){var e=n.name,i=n.fields;return"input "+e+" "+block(i)},TypeExtensionDefinition:function(n){var e=n.definition;return"extend "+e}}},{"./visitor":45}],44:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var Source=function e(r,s){_classCallCheck(this,e),this.body=r,this.name=s||"GraphQL"};exports.Source=Source},{"babel-runtime/helpers/class-call-check":56}],45:[function(require,module,exports){"use strict";function visit(e,i,n){var t,r,a=n||QueryDocumentKeys,o=Array.isArray(e),s=[e],l=-1,u=[],f=[],p=[],y=e;do{l++;var d,v,c=l===s.length,m=c&&0!==u.length;if(c){if(d=0===p.length?void 0:f.pop(),v=r,r=p.pop(),m){if(o)v=v.slice();else{var D={};for(var g in v)v.hasOwnProperty(g)&&(D[g]=v[g]);v=D}for(var V=0,A=0;A<u.length;A++){var h=_slicedToArray(u[A],2),T=h[0],b=h[1];o&&(T-=V),o&&null===b?(v.splice(T,1),V++):v[T]=b}}l=t.index,s=t.keys,u=t.edits,o=t.inArray,t=t.prev}else{if(d=r?o?l:s[l]:void 0,v=r?r[d]:y,null===v||void 0===v)continue;r&&f.push(d)}var F=void 0;if(!Array.isArray(v)){if(!isNode(v))throw new Error("Invalid AST Node: "+JSON.stringify(v));var S=getVisitFn(i,c,v.kind);if(S){if(F=S.call(i,v,d,r,f,p),F===BREAK)break;if(F===!1){if(!c){f.pop();continue}}else if(void 0!==F&&(u.push([d,F]),!c)){if(!isNode(F)){f.pop();continue}v=F}}}void 0===F&&m&&u.push([d,v]),c||(t={inArray:o,index:l,keys:s,edits:u,prev:t},o=Array.isArray(v),s=o?v:a[v.kind]||[],l=-1,u=[],r&&p.push(r),r=v)}while(void 0!==t);return 0!==u.length&&(y=u[0][1]),y}function isNode(e){return e&&"string"==typeof e.kind}function getVisitFn(e,i,n){var t=e[n];if(t){if(!i&&"function"==typeof t)return t;var r=i?t.leave:t.enter;if("function"==typeof r)return r}else{var a=i?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[n];if("function"==typeof o)return o}}}var _slicedToArray=require("babel-runtime/helpers/sliced-to-array").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.visit=visit,exports.getVisitFn=getVisitFn;var QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],ObjectTypeDefinition:["name","interfaces","fields"],FieldDefinition:["name","arguments","type"],InputValueDefinition:["name","type","defaultValue"],InterfaceTypeDefinition:["name","fields"],UnionTypeDefinition:["name","types"],ScalarTypeDefinition:["name"],EnumTypeDefinition:["name","values"],EnumValueDefinition:["name"],InputObjectTypeDefinition:["name","fields"],TypeExtensionDefinition:["definition"]};exports.QueryDocumentKeys=QueryDocumentKeys;var BREAK={};exports.BREAK=BREAK},{"babel-runtime/helpers/sliced-to-array":63}],46:[function(require,module,exports){module.exports={default:require("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":64}],47:[function(require,module,exports){module.exports={default:require("core-js/library/fn/is-iterable"),__esModule:!0}},{"core-js/library/fn/is-iterable":65}],48:[function(require,module,exports){module.exports={default:require("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":66}],49:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":67}],50:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":68}],51:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":69}],52:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/get-own-property-descriptor"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-descriptor":70}],53:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":71}],54:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/set-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/set-prototype-of":72}],55:[function(require,module,exports){module.exports={default:require("core-js/library/fn/set"),__esModule:!0}},{"core-js/library/fn/set":73}],56:[function(require,module,exports){"use strict";exports.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},exports.__esModule=!0},{}],57:[function(require,module,exports){"use strict";var _Object$defineProperty=require("babel-runtime/core-js/object/define-property").default;exports.default=function(){function e(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,n.key,n)}}return function(r,t,n){return t&&e(r.prototype,t),n&&e(r,n),r}}(),exports.__esModule=!0},{"babel-runtime/core-js/object/define-property":51}],58:[function(require,module,exports){"use strict";var _Object$assign=require("babel-runtime/core-js/object/assign").default;exports.default=_Object$assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},exports.__esModule=!0},{"babel-runtime/core-js/object/assign":49}],59:[function(require,module,exports){"use strict";var _Object$getOwnPropertyDescriptor=require("babel-runtime/core-js/object/get-own-property-descriptor").default;exports.default=function(e,r,t){for(var o=!0;o;){var i=e,u=r,n=t;v=c=a=void 0,o=!1,null===i&&(i=Function.prototype);var v=_Object$getOwnPropertyDescriptor(i,u);if(void 0!==v){if("value"in v)return v.value;var a=v.get;return void 0===a?void 0:a.call(n)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,r=u,t=n,o=!0}},exports.__esModule=!0},{"babel-runtime/core-js/object/get-own-property-descriptor":52}],60:[function(require,module,exports){"use strict";var _Object$create=require("babel-runtime/core-js/object/create").default,_Object$setPrototypeOf=require("babel-runtime/core-js/object/set-prototype-of").default;exports.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(_Object$setPrototypeOf?_Object$setPrototypeOf(e,t):e.__proto__=t)},exports.__esModule=!0},{"babel-runtime/core-js/object/create":50,"babel-runtime/core-js/object/set-prototype-of":54}],61:[function(require,module,exports){"use strict";exports.default=function(e){return e&&e.__esModule?e:{default:e}},exports.__esModule=!0},{}],62:[function(require,module,exports){"use strict";exports.default=function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r},exports.__esModule=!0},{}],63:[function(require,module,exports){"use strict";var _getIterator=require("babel-runtime/core-js/get-iterator").default,_isIterable=require("babel-runtime/core-js/is-iterable").default;exports.default=function(){function r(r,e){var t=[],n=!0,a=!1,i=void 0;try{for(var u,o=_getIterator(r);!(n=(u=o.next()).done)&&(t.push(u.value),!e||t.length!==e);n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return&&o.return()}finally{if(a)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(_isIterable(Object(e)))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),exports.__esModule=!0},{"babel-runtime/core-js/get-iterator":46,"babel-runtime/core-js/is-iterable":47}],64:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.get-iterator")},{"../modules/core.get-iterator":121,"../modules/es6.string.iterator":131,"../modules/web.dom.iterable":134}],65:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.is-iterable")},{"../modules/core.is-iterable":122,"../modules/es6.string.iterator":131,"../modules/web.dom.iterable":134}],66:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.map"),require("../modules/es7.map.to-json"),module.exports=require("../modules/$.core").Map},{"../modules/$.core":82,"../modules/es6.map":124,"../modules/es6.object.to-string":129,"../modules/es6.string.iterator":131,"../modules/es7.map.to-json":132,"../modules/web.dom.iterable":134}],67:[function(require,module,exports){require("../../modules/es6.object.assign"),module.exports=require("../../modules/$.core").Object.assign},{"../../modules/$.core":82,"../../modules/es6.object.assign":125}],68:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r){return $.create(e,r)}},{"../../modules/$":100}],69:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r,u){return $.setDesc(e,r,u)}},{"../../modules/$":100}],70:[function(require,module,exports){var $=require("../../modules/$");require("../../modules/es6.object.get-own-property-descriptor"),module.exports=function(e,r){return $.getDesc(e,r)}},{"../../modules/$":100,"../../modules/es6.object.get-own-property-descriptor":126}],71:[function(require,module,exports){require("../../modules/es6.object.keys"),module.exports=require("../../modules/$.core").Object.keys},{"../../modules/$.core":82,"../../modules/es6.object.keys":127}],72:[function(require,module,exports){require("../../modules/es6.object.set-prototype-of"),module.exports=require("../../modules/$.core").Object.setPrototypeOf},{"../../modules/$.core":82,"../../modules/es6.object.set-prototype-of":128}],73:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.set"),require("../modules/es7.set.to-json"),module.exports=require("../modules/$.core").Set},{"../modules/$.core":82,"../modules/es6.object.to-string":129,"../modules/es6.set":130,"../modules/es6.string.iterator":131,"../modules/es7.set.to-json":133,"../modules/web.dom.iterable":134}],74:[function(require,module,exports){module.exports=function(o){if("function"!=typeof o)throw TypeError(o+" is not a function!");return o}},{}],75:[function(require,module,exports){var isObject=require("./$.is-object");module.exports=function(e){if(!isObject(e))throw TypeError(e+" is not an object!");return e}},{"./$.is-object":94}],76:[function(require,module,exports){var toObject=require("./$.to-object"),IObject=require("./$.iobject"),enumKeys=require("./$.enum-keys");module.exports=require("./$.fails")(function(){return Symbol()in Object.assign({})})?function(e,r){for(var t=toObject(e),n=arguments.length,u=1;n>u;)for(var o,i=IObject(arguments[u++]),s=enumKeys(i),c=s.length,b=0;c>b;)t[o=s[b++]]=i[o];return t}:Object.assign},{"./$.enum-keys":86,"./$.fails":87,"./$.iobject":92,"./$.to-object":116}],77:[function(require,module,exports){var cof=require("./$.cof"),TAG=require("./$.wks")("toStringTag"),ARG="Arguments"==cof(function(){return arguments}());module.exports=function(e){var n,r,t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=(n=Object(e))[TAG])?r:ARG?cof(n):"Object"==(t=cof(n))&&"function"==typeof n.callee?"Arguments":t}},{"./$.cof":78,"./$.wks":119}],78:[function(require,module,exports){var toString={}.toString;module.exports=function(t){return toString.call(t).slice(8,-1)}},{}],79:[function(require,module,exports){"use strict";var $=require("./$"),hide=require("./$.hide"),ctx=require("./$.ctx"),species=require("./$.species"),strictNew=require("./$.strict-new"),defined=require("./$.defined"),forOf=require("./$.for-of"),step=require("./$.iter-step"),ID=require("./$.uid")("id"),$has=require("./$.has"),isObject=require("./$.is-object"),isExtensible=Object.isExtensible||isObject,SUPPORT_DESC=require("./$.support-desc"),SIZE=SUPPORT_DESC?"_s":"size",id=0,fastKey=function(e,t){if(!isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!$has(e,ID)){if(!isExtensible(e))return"F";if(!t)return"E";hide(e,ID,++id)}return"O"+e[ID]},getEntry=function(e,t){var r,i=fastKey(t);if("F"!==i)return e._i[i];for(r=e._f;r;r=r.n)if(r.k==t)return r};module.exports={getConstructor:function(e,t,r,i){var n=e(function(e,s){strictNew(e,n,t),e._i=$.create(null),e._f=void 0,e._l=void 0,e[SIZE]=0,void 0!=s&&forOf(s,r,e[i],e)});return require("./$.mix")(n.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[SIZE]=0},delete:function(e){var t=this,r=getEntry(t,e);if(r){var i=r.n,n=r.p;delete t._i[r.i],r.r=!0,n&&(n.n=i),i&&(i.p=n),t._f==r&&(t._f=i),t._l==r&&(t._l=n),t[SIZE]--}return!!r},forEach:function(e){for(var t,r=ctx(e,arguments[1],3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!getEntry(this,e)}}),SUPPORT_DESC&&$.setDesc(n.prototype,"size",{get:function(){return defined(this[SIZE])}}),n},def:function(e,t,r){var i,n,s=getEntry(e,t);return s?s.v=r:(e._l=s={i:n=fastKey(t,!0),k:t,v:r,p:i=e._l,n:void 0,r:!1},e._f||(e._f=s),i&&(i.n=s),e[SIZE]++,"F"!==n&&(e._i[n]=s)),e},getEntry:getEntry,setStrong:function(e,t,r){require("./$.iter-define")(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?step(0,r.k):"values"==t?step(0,r.v):step(0,[r.k,r.v]):(e._t=void 0,step(1))},r?"entries":"values",!r,!0),species(e),species(require("./$.core")[t])}}},{"./$":100,"./$.core":82,"./$.ctx":83,"./$.defined":85,"./$.for-of":88,"./$.has":90,"./$.hide":91,"./$.is-object":94,"./$.iter-define":97,"./$.iter-step":98,"./$.mix":102,"./$.species":108,"./$.strict-new":109,"./$.support-desc":111,"./$.uid":117}],80:[function(require,module,exports){var forOf=require("./$.for-of"),classof=require("./$.classof");module.exports=function(r){return function(){if(classof(this)!=r)throw TypeError(r+"#toJSON isn't generic");var o=[];return forOf(this,!1,o.push,o),o}}},{"./$.classof":77,"./$.for-of":88}],81:[function(require,module,exports){"use strict";var $=require("./$"),$def=require("./$.def"),hide=require("./$.hide"),forOf=require("./$.for-of"),strictNew=require("./$.strict-new");module.exports=function(e,r,t,i,o,s){var n=require("./$.global")[e],u=n,c=o?"set":"add",f=u&&u.prototype,d={};return require("./$.support-desc")&&"function"==typeof u&&(s||f.forEach&&!require("./$.fails")(function(){(new u).entries().next()}))?(u=r(function(r,t){strictNew(r,u,e),r._c=new n,void 0!=t&&forOf(t,o,r[c],r)}),$.each.call("add,clear,delete,forEach,get,has,set,keys,values,entries".split(","),function(e){var r="add"==e||"set"==e;e in f&&(!s||"clear"!=e)&&hide(u.prototype,e,function(t,i){var o=this._c[e](0===t?0:t,i);return r?this:o})}),"size"in f&&$.setDesc(u.prototype,"size",{get:function(){return this._c.size}})):(u=i.getConstructor(r,e,o,c),require("./$.mix")(u.prototype,t)),require("./$.tag")(u,e),d[e]=u,$def($def.G+$def.W+$def.F,d),s||i.setStrong(u,e,o),u}},{"./$":100,"./$.def":84,"./$.fails":87,"./$.for-of":88,"./$.global":89,"./$.hide":91,"./$.mix":102,"./$.strict-new":109,"./$.support-desc":111,"./$.tag":112}],82:[function(require,module,exports){var core=module.exports={};"number"==typeof __e&&(__e=core)},{}],83:[function(require,module,exports){var aFunction=require("./$.a-function");module.exports=function(n,r,t){if(aFunction(n),void 0===r)return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,u){return n.call(r,t,u)};case 3:return function(t,u,e){return n.call(r,t,u,e)}}return function(){return n.apply(r,arguments)}}},{"./$.a-function":74}],84:[function(require,module,exports){var global=require("./$.global"),core=require("./$.core"),PROTOTYPE="prototype",ctx=function(e,o){return function(){return e.apply(o,arguments)}},$def=function(e,o,n){var f,t,r,c,l=e&$def.G,$=e&$def.P,d=l?global:e&$def.S?global[o]:(global[o]||{})[PROTOTYPE],i=l?core:core[o]||(core[o]={});l&&(n=o);for(f in n)t=!(e&$def.F)&&d&&f in d,t&&f in i||(r=t?d[f]:n[f],l&&"function"!=typeof d[f]?c=n[f]:e&$def.B&&t?c=ctx(r,global):e&$def.W&&d[f]==r?!function(e){c=function(o){return this instanceof e?new e(o):e(o)},c[PROTOTYPE]=e[PROTOTYPE]}(r):c=$&&"function"==typeof r?ctx(Function.call,r):r,i[f]=c,$&&((i[PROTOTYPE]||(i[PROTOTYPE]={}))[f]=r))};$def.F=1,$def.G=2,$def.S=4,$def.P=8,$def.B=16,$def.W=32,module.exports=$def},{"./$.core":82,"./$.global":89}],85:[function(require,module,exports){module.exports=function(o){if(void 0==o)throw TypeError("Can't call method on "+o);return o}},{}],86:[function(require,module,exports){var $=require("./$");module.exports=function(e){var r=$.getKeys(e),t=$.getSymbols;if(t)for(var u,l=t(e),n=$.isEnum,o=0;l.length>o;)n.call(e,u=l[o++])&&r.push(u);return r}},{"./$":100}],87:[function(require,module,exports){module.exports=function(r){try{return!!r()}catch(t){return!0}}},{}],88:[function(require,module,exports){var ctx=require("./$.ctx"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),anObject=require("./$.an-object"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");module.exports=function(e,r,t,i){var o,a,n,l=getIterFn(e),c=ctx(t,i,r?2:1),u=0;if("function"!=typeof l)throw TypeError(e+" is not iterable!");if(isArrayIter(l))for(o=toLength(e.length);o>u;u++)r?c(anObject(a=e[u])[0],a[1]):c(e[u]);else for(n=l.call(e);!(a=n.next()).done;)call(n,c,a.value,r)}},{"./$.an-object":75,"./$.ctx":83,"./$.is-array-iter":93,"./$.iter-call":95,"./$.to-length":115,"./core.get-iterator-method":120}],89:[function(require,module,exports){var UNDEFINED="undefined",global=module.exports=typeof window!=UNDEFINED&&window.Math==Math?window:typeof self!=UNDEFINED&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},{}],90:[function(require,module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(r,e){return hasOwnProperty.call(r,e)}},{}],91:[function(require,module,exports){var $=require("./$"),createDesc=require("./$.property-desc");module.exports=require("./$.support-desc")?function(e,r,t){return $.setDesc(e,r,createDesc(1,t))}:function(e,r,t){return e[r]=t,e}},{"./$":100,"./$.property-desc":104,"./$.support-desc":111}],92:[function(require,module,exports){var cof=require("./$.cof");module.exports=0 in Object("z")?Object:function(e){return"String"==cof(e)?e.split(""):Object(e)}},{"./$.cof":78}],93:[function(require,module,exports){var Iterators=require("./$.iterators"),ITERATOR=require("./$.wks")("iterator");module.exports=function(r){return(Iterators.Array||Array.prototype[ITERATOR])===r}},{"./$.iterators":99,"./$.wks":119}],94:[function(require,module,exports){module.exports=function(o){return null!==o&&("object"==typeof o||"function"==typeof o)}},{}],95:[function(require,module,exports){var anObject=require("./$.an-object");module.exports=function(r,t,e,a){try{return a?t(anObject(e)[0],e[1]):t(e)}catch(c){var n=r.return;throw void 0!==n&&anObject(n.call(r)),c}}},{"./$.an-object":75}],96:[function(require,module,exports){"use strict";var $=require("./$"),IteratorPrototype={};require("./$.hide")(IteratorPrototype,require("./$.wks")("iterator"),function(){return this}),module.exports=function(r,e,t){r.prototype=$.create(IteratorPrototype,{next:require("./$.property-desc")(1,t)}),require("./$.tag")(r,e+" Iterator")}},{"./$":100,"./$.hide":91,"./$.property-desc":104,"./$.tag":112,"./$.wks":119}],97:[function(require,module,exports){"use strict";var LIBRARY=require("./$.library"),$def=require("./$.def"),$redef=require("./$.redef"),hide=require("./$.hide"),has=require("./$.has"),SYMBOL_ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this};module.exports=function(e,r,t,i,n,s,u){require("./$.iter-create")(t,r,i);var a,o,R=function(e){switch(e){case KEYS:return function(){return new t(this,e)};case VALUES:return function(){return new t(this,e)}}return function(){return new t(this,e)}},f=r+" Iterator",T=e.prototype,$=T[SYMBOL_ITERATOR]||T[FF_ITERATOR]||n&&T[n],h=$||R(n);if($){var A=require("./$").getProto(h.call(new e));require("./$.tag")(A,f,!0),!LIBRARY&&has(T,FF_ITERATOR)&&hide(A,SYMBOL_ITERATOR,returnThis)}if((!LIBRARY||u)&&hide(T,SYMBOL_ITERATOR,h),Iterators[r]=h,Iterators[f]=returnThis,n)if(a={keys:s?h:R(KEYS),values:n==VALUES?h:R(VALUES),entries:n!=VALUES?h:R("entries")},u)for(o in a)o in T||$redef(T,o,a[o]);else $def($def.P+$def.F*BUGGY,r,a)}},{"./$":100,"./$.def":84,"./$.has":90,"./$.hide":91,"./$.iter-create":96,"./$.iterators":99,"./$.library":101,"./$.redef":105,"./$.tag":112,"./$.wks":119}],98:[function(require,module,exports){module.exports=function(e,n){return{value:n,done:!!e}}},{}],99:[function(require,module,exports){module.exports={}},{}],100:[function(require,module,exports){var $Object=Object;module.exports={create:$Object.create,getProto:$Object.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:$Object.getOwnPropertyDescriptor,setDesc:$Object.defineProperty,setDescs:$Object.defineProperties,getKeys:$Object.keys,getNames:$Object.getOwnPropertyNames,getSymbols:$Object.getOwnPropertySymbols,each:[].forEach}},{}],101:[function(require,module,exports){module.exports=!0},{}],102:[function(require,module,exports){var $redef=require("./$.redef");module.exports=function(e,r){for(var f in r)$redef(e,f,r[f]);return e}},{"./$.redef":105}],103:[function(require,module,exports){module.exports=function(e,r){var c=require("./$.def"),i=(require("./$.core").Object||{})[e]||Object[e],t={};t[e]=r(i),c(c.S+c.F*require("./$.fails")(function(){i(1)}),"Object",t)}},{"./$.core":82,"./$.def":84,"./$.fails":87}],104:[function(require,module,exports){module.exports=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}}},{}],105:[function(require,module,exports){module.exports=require("./$.hide")},{"./$.hide":91}],106:[function(require,module,exports){var getDesc=require("./$").getDesc,isObject=require("./$.is-object"),anObject=require("./$.an-object"),check=function(e,t){if(anObject(e),!isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t){try{(t=require("./$.ctx")(Function.call,getDesc(Object.prototype,"__proto__").set,2))({},[])}catch(c){e=!0}return function(c,r){return check(c,r),e?c.__proto__=r:t(c,r),c}}():void 0),check:check}},{"./$":100,"./$.an-object":75,"./$.ctx":83,"./$.is-object":94}],107:[function(require,module,exports){var global=require("./$.global"),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(o){return store[o]||(store[o]={})}},{"./$.global":89}],108:[function(require,module,exports){"use strict";var $=require("./$"),SPECIES=require("./$.wks")("species");module.exports=function(e){!require("./$.support-desc")||SPECIES in e||$.setDesc(e,SPECIES,{configurable:!0,get:function(){return this}})}},{"./$":100,"./$.support-desc":111,"./$.wks":119}],109:[function(require,module,exports){module.exports=function(e,r,o){if(!(e instanceof r))throw TypeError(o+": use the 'new' operator!");return e}},{}],110:[function(require,module,exports){var toInteger=require("./$.to-integer"),defined=require("./$.defined");module.exports=function(e){return function(r,t){var n,i,d=String(defined(r)),o=toInteger(t),u=d.length;return 0>o||o>=u?e?"":void 0:(n=d.charCodeAt(o),55296>n||n>56319||o+1===u||(i=d.charCodeAt(o+1))<56320||i>57343?e?d.charAt(o):n:e?d.slice(o,o+2):(n-55296<<10)+(i-56320)+65536)}}},{"./$.defined":85,"./$.to-integer":113}],111:[function(require,module,exports){module.exports=!require("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":87}],112:[function(require,module,exports){var has=require("./$.has"),hide=require("./$.hide"),TAG=require("./$.wks")("toStringTag");module.exports=function(e,r,i){e&&!has(e=i?e:e.prototype,TAG)&&hide(e,TAG,r)}},{"./$.has":90,"./$.hide":91,"./$.wks":119}],113:[function(require,module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(o){return isNaN(o=+o)?0:(o>0?floor:ceil)(o)}},{}],114:[function(require,module,exports){var IObject=require("./$.iobject"),defined=require("./$.defined");module.exports=function(e){return IObject(defined(e))}},{"./$.defined":85,"./$.iobject":92}],115:[function(require,module,exports){var toInteger=require("./$.to-integer"),min=Math.min;module.exports=function(e){return e>0?min(toInteger(e),9007199254740991):0}},{"./$.to-integer":113}],116:[function(require,module,exports){var defined=require("./$.defined");module.exports=function(e){return Object(defined(e))}},{"./$.defined":85}],117:[function(require,module,exports){var id=0,px=Math.random();module.exports=function(o){return"Symbol(".concat(void 0===o?"":o,")_",(++id+px).toString(36))}},{}],118:[function(require,module,exports){module.exports=function(){}},{}],119:[function(require,module,exports){var store=require("./$.shared")("wks"),Symbol=require("./$.global").Symbol;module.exports=function(r){return store[r]||(store[r]=Symbol&&Symbol[r]||(Symbol||require("./$.uid"))("Symbol."+r))}},{"./$.global":89,"./$.shared":107,"./$.uid":117}],120:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").getIteratorMethod=function(r){return void 0!=r?r[ITERATOR]||r["@@iterator"]||Iterators[classof(r)]:void 0}},{"./$.classof":77,"./$.core":82,"./$.iterators":99,"./$.wks":119}],121:[function(require,module,exports){var anObject=require("./$.an-object"),get=require("./core.get-iterator-method");module.exports=require("./$.core").getIterator=function(e){var r=get(e);if("function"!=typeof r)throw TypeError(e+" is not iterable!");return anObject(r.call(e))}},{"./$.an-object":75,"./$.core":82,"./core.get-iterator-method":120}],122:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").isIterable=function(r){var e=Object(r);return ITERATOR in e||"@@iterator"in e||Iterators.hasOwnProperty(classof(e))}},{"./$.classof":77,"./$.core":82,"./$.iterators":99,"./$.wks":119}],123:[function(require,module,exports){"use strict";var setUnscope=require("./$.unscope"),step=require("./$.iter-step"),Iterators=require("./$.iterators"),toIObject=require("./$.to-iobject");require("./$.iter-define")(Array,"Array",function(e,t){this._t=toIObject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,s=this._i++;return!e||s>=e.length?(this._t=void 0,step(1)):"keys"==t?step(0,s):"values"==t?step(0,e[s]):step(0,[s,e[s]])},"values"),Iterators.Arguments=Iterators.Array,setUnscope("keys"),
setUnscope("values"),setUnscope("entries")},{"./$.iter-define":97,"./$.iter-step":98,"./$.iterators":99,"./$.to-iobject":114,"./$.unscope":118}],124:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Map",function(t){return function(){return t(this,arguments[0])}},{get:function(t){var r=strong.getEntry(this,t);return r&&r.v},set:function(t,r){return strong.def(this,0===t?0:t,r)}},strong,!0)},{"./$.collection":81,"./$.collection-strong":79}],125:[function(require,module,exports){var $def=require("./$.def");$def($def.S+$def.F,"Object",{assign:require("./$.assign")})},{"./$.assign":76,"./$.def":84}],126:[function(require,module,exports){var toIObject=require("./$.to-iobject");require("./$.object-sap")("getOwnPropertyDescriptor",function(t){return function(e,r){return t(toIObject(e),r)}})},{"./$.object-sap":103,"./$.to-iobject":114}],127:[function(require,module,exports){var toObject=require("./$.to-object");require("./$.object-sap")("keys",function(e){return function(t){return e(toObject(t))}})},{"./$.object-sap":103,"./$.to-object":116}],128:[function(require,module,exports){var $def=require("./$.def");$def($def.S,"Object",{setPrototypeOf:require("./$.set-proto").set})},{"./$.def":84,"./$.set-proto":106}],129:[function(require,module,exports){},{}],130:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Set",function(t){return function(){return t(this,arguments[0])}},{add:function(t){return strong.def(this,t=0===t?0:t,t)}},strong)},{"./$.collection":81,"./$.collection-strong":79}],131:[function(require,module,exports){"use strict";var $at=require("./$.string-at")(!0);require("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,i=this._t,e=this._i;return e>=i.length?{value:void 0,done:!0}:(t=$at(i,e),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":97,"./$.string-at":110}],132:[function(require,module,exports){var $def=require("./$.def");$def($def.P,"Map",{toJSON:require("./$.collection-to-json")("Map")})},{"./$.collection-to-json":80,"./$.def":84}],133:[function(require,module,exports){var $def=require("./$.def");$def($def.P,"Set",{toJSON:require("./$.collection-to-json")("Set")})},{"./$.collection-to-json":80,"./$.def":84}],134:[function(require,module,exports){require("./es6.array.iterator");var Iterators=require("./$.iterators");Iterators.NodeList=Iterators.HTMLCollection=Iterators.Array},{"./$.iterators":99,"./es6.array.iterator":123}],135:[function(require,module,exports){"use strict";function isType(e){return e instanceof GraphQLScalarType||e instanceof GraphQLObjectType||e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType||e instanceof GraphQLEnumType||e instanceof GraphQLInputObjectType||e instanceof GraphQLList||e instanceof GraphQLNonNull}function isInputType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLEnumType||t instanceof GraphQLInputObjectType}function isOutputType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLObjectType||t instanceof GraphQLInterfaceType||t instanceof GraphQLUnionType||t instanceof GraphQLEnumType}function isLeafType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLEnumType}function isCompositeType(e){return e instanceof GraphQLObjectType||e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType}function isAbstractType(e){return e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType}function getNullableType(e){return e instanceof GraphQLNonNull?e.ofType:e}function getNamedType(e){for(var t=e;t instanceof GraphQLList||t instanceof GraphQLNonNull;)t=t.ofType;return t}function resolveMaybeThunk(e){return"function"==typeof e?e():e}function defineInterfaces(e,t){var n=resolveMaybeThunk(t);return n?(_jsutilsInvariant2.default(Array.isArray(n),e+" interfaces must be an Array or a function which returns an Array."),n.forEach(function(t){_jsutilsInvariant2.default(t instanceof GraphQLInterfaceType,e+" may only implement Interface types, it cannot "+("implement: "+t+".")),"function"!=typeof t.resolveType&&_jsutilsInvariant2.default("function"==typeof e.isTypeOf,"Interface Type "+t+' does not provide a "resolveType" function '+("and implementing Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this implementing type during execution.")}),n):[]}function defineFieldMap(e,t){var n=resolveMaybeThunk(t);_jsutilsInvariant2.default(isPlainObj(n),e+" fields must be an object with field names as keys or a function which returns such an object.");var a=_Object$keys(n);_jsutilsInvariant2.default(a.length>0,e+" fields must be an object with field names as keys or a function which returns such an object.");var s={};return a.forEach(function(t){assertValidName(t);var a=_extends({},n[t],{name:t});_jsutilsInvariant2.default(isOutputType(a.type),e+"."+t+" field type must be Output Type but "+("got: "+a.type+".")),a.args?(_jsutilsInvariant2.default(isPlainObj(a.args),e+"."+t+" args must be an object with argument names as keys."),a.args=_Object$keys(a.args).map(function(n){assertValidName(n);var s=a.args[n];return _jsutilsInvariant2.default(isInputType(s.type),e+"."+t+"("+n+":) argument type must be "+("Input Type but got: "+s.type+".")),{name:n,description:void 0===s.description?null:s.description,type:s.type,defaultValue:void 0===s.defaultValue?null:s.defaultValue}})):a.args=[],s[t]=a}),s}function isPlainObj(e){return e&&"object"==typeof e&&!Array.isArray(e)}function addImplementationToInterfaces(e){e.getInterfaces().forEach(function(t){t._implementations.push(e)})}function getTypeOf(e,t,n){for(var a=n.getPossibleTypes(),s=0;s<a.length;s++){var i=a[s];if("function"==typeof i.isTypeOf&&i.isTypeOf(e,t))return i}}function defineEnumValues(e,t){_jsutilsInvariant2.default(isPlainObj(t),e+" values must be an object with value names as keys.");var n=_Object$keys(t);return _jsutilsInvariant2.default(n.length>0,e+" values must be an object with value names as keys."),n.map(function(n){assertValidName(n);var a=t[n];return _jsutilsInvariant2.default(isPlainObj(a),e+"."+n+' must refer to an object with a "value" key '+("representing an internal value but got: "+a+".")),a.name=n,_jsutilsIsNullish2.default(a.value)&&(a.value=n),a})}function assertValidName(e){_jsutilsInvariant2.default(NAME_RX.test(e),'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'+e+'" does not.')}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_extends=require("babel-runtime/helpers/extends").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Object$create=require("babel-runtime/core-js/object/create").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isType=isType,exports.isInputType=isInputType,exports.isOutputType=isOutputType,exports.isLeafType=isLeafType,exports.isCompositeType=isCompositeType,exports.isAbstractType=isAbstractType,exports.getNullableType=getNullableType,exports.getNamedType=getNamedType;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_languageKinds=require("../language/kinds"),GraphQLScalarType=function(){function e(t){_classCallCheck(this,e),_jsutilsInvariant2.default(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,_jsutilsInvariant2.default("function"==typeof t.serialize,this+' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),(t.parseValue||t.parseLiteral)&&_jsutilsInvariant2.default("function"==typeof t.parseValue&&"function"==typeof t.parseLiteral,this+' must provide both "parseValue" and "parseLiteral" functions.'),this._scalarConfig=t}return _createClass(e,[{key:"serialize",value:function(e){var t=this._scalarConfig.serialize;return t(e)}},{key:"parseValue",value:function(e){var t=this._scalarConfig.parseValue;return t?t(e):null}},{key:"parseLiteral",value:function(e){var t=this._scalarConfig.parseLiteral;return t?t(e):null}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLScalarType=GraphQLScalarType;var GraphQLObjectType=function(){function e(t){_classCallCheck(this,e),_jsutilsInvariant2.default(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.isTypeOf&&_jsutilsInvariant2.default("function"==typeof t.isTypeOf,this+' must provide "isTypeOf" as a function.'),this.isTypeOf=t.isTypeOf,this._typeConfig=t,addImplementationToInterfaces(this)}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getInterfaces",value:function(){return this._interfaces||(this._interfaces=defineInterfaces(this,this._typeConfig.interfaces))}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLObjectType=GraphQLObjectType;var GraphQLInterfaceType=function(){function e(t){_classCallCheck(this,e),_jsutilsInvariant2.default(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&_jsutilsInvariant2.default("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,this._typeConfig=t,this._implementations=[]}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getPossibleTypes",value:function(){return this._implementations}},{key:"isPossibleType",value:function(e){var t=this._possibleTypes||(this._possibleTypes=_jsutilsKeyMap2.default(this.getPossibleTypes(),function(e){return e.name}));return Boolean(t[e.name])}},{key:"getObjectType",value:function(e,t){var n=this.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInterfaceType=GraphQLInterfaceType;var GraphQLUnionType=function(){function e(t){var n=this;_classCallCheck(this,e),_jsutilsInvariant2.default(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&_jsutilsInvariant2.default("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,_jsutilsInvariant2.default(Array.isArray(t.types)&&t.types.length>0,"Must provide Array of types for Union "+t.name+"."),t.types.forEach(function(e){_jsutilsInvariant2.default(e instanceof GraphQLObjectType,n+" may only contain Object types, it cannot contain: "+e+"."),"function"!=typeof n.resolveType&&_jsutilsInvariant2.default("function"==typeof e.isTypeOf,"Union Type "+n+' does not provide a "resolveType" function '+("and possible Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this possible type during execution.")}),this._types=t.types,this._typeConfig=t}return _createClass(e,[{key:"getPossibleTypes",value:function(){return this._types}},{key:"isPossibleType",value:function(e){var t=this._possibleTypeNames;return t||(this._possibleTypeNames=t=this.getPossibleTypes().reduce(function(e,t){return e[t.name]=!0,e},{})),t[e.name]===!0}},{key:"getObjectType",value:function(e,t){var n=this._typeConfig.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLUnionType=GraphQLUnionType;var GraphQLEnumType=function(){function e(t){_classCallCheck(this,e),this.name=t.name,assertValidName(t.name),this.description=t.description,this._values=defineEnumValues(this,t.values),this._enumConfig=t}return _createClass(e,[{key:"getValues",value:function(){return this._values}},{key:"serialize",value:function(e){var t=this._getValueLookup().get(e);return t?t.name:null}},{key:"parseValue",value:function(e){var t=this._getNameLookup()[e];return t?t.value:void 0}},{key:"parseLiteral",value:function(e){if(e.kind===_languageKinds.ENUM){var t=this._getNameLookup()[e.value];if(t)return t.value}}},{key:"_getValueLookup",value:function(){if(!this._valueLookup){var e=new _Map;this.getValues().forEach(function(t){e.set(t.value,t)}),this._valueLookup=e}return this._valueLookup}},{key:"_getNameLookup",value:function(){if(!this._nameLookup){var e=_Object$create(null);this.getValues().forEach(function(t){e[t.name]=t}),this._nameLookup=e}return this._nameLookup}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLEnumType=GraphQLEnumType;var GraphQLInputObjectType=function(){function e(t){_classCallCheck(this,e),_jsutilsInvariant2.default(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,this._typeConfig=t}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=this._defineFieldMap())}},{key:"_defineFieldMap",value:function(){var e=this,t=resolveMaybeThunk(this._typeConfig.fields);_jsutilsInvariant2.default(isPlainObj(t),this+" fields must be an object with field names as keys or a function which returns such an object.");var n=_Object$keys(t);_jsutilsInvariant2.default(n.length>0,this+" fields must be an object with field names as keys or a function which returns such an object.");var a={};return n.forEach(function(n){assertValidName(n);var s=_extends({},t[n],{name:n});_jsutilsInvariant2.default(isInputType(s.type),e+"."+n+" field type must be Input Type but "+("got: "+s.type+".")),a[n]=s}),a}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInputObjectType=GraphQLInputObjectType;var GraphQLList=function(){function e(t){_classCallCheck(this,e),_jsutilsInvariant2.default(isType(t),"Can only create List of a GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return"["+String(this.ofType)+"]"}}]),e}();exports.GraphQLList=GraphQLList;var GraphQLNonNull=function(){function e(t){_classCallCheck(this,e),_jsutilsInvariant2.default(isType(t)&&!(t instanceof e),"Can only create NonNull of a Nullable GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return this.ofType.toString()+"!"}}]),e}();exports.GraphQLNonNull=GraphQLNonNull;var NAME_RX=/^[_a-zA-Z][_a-zA-Z0-9]*$/},{"../jsutils/invariant":33,"../jsutils/isNullish":34,"../jsutils/keyMap":35,"../language/kinds":39,"babel-runtime/core-js/map":48,"babel-runtime/core-js/object/create":50,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/class-call-check":56,"babel-runtime/helpers/create-class":57,"babel-runtime/helpers/extends":58,"babel-runtime/helpers/interop-require-default":61}],136:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_scalars=require("./scalars"),GraphQLDirective=function e(i){_classCallCheck(this,e),this.name=i.name,this.description=i.description,this.args=i.args,this.onOperation=i.onOperation,this.onFragment=i.onFragment,this.onField=i.onField};exports.GraphQLDirective=GraphQLDirective;var GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Included when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLIncludeDirective=GraphQLIncludeDirective;var GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Skipped when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLSkipDirective=GraphQLSkipDirective},{"./definition":135,"./scalars":139,"babel-runtime/helpers/class-call-check":56}],137:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _schema=require("./schema");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _schema.GraphQLSchema}});var _definition=require("./definition");Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _definition.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _definition.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _definition.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _definition.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _definition.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _definition.isAbstractType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _definition.getNullableType}}),Object.defineProperty(exports,"getNamedType",{enumerable:!0,get:function(){return _definition.getNamedType}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _definition.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _definition.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _definition.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _definition.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _definition.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _definition.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _definition.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _definition.GraphQLNonNull}});var _scalars=require("./scalars");Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _scalars.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _scalars.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _scalars.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _scalars.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _scalars.GraphQLID}})},{"./definition":135,"./scalars":139,"./schema":140}],138:[function(require,module,exports){"use strict";var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_definition=require("./definition"),_scalars=require("./scalars"),__Schema=new _definition.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query and mutation operations.",fields:function(){return{types:{description:"A list of all types supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type))),resolve:function(e){var n=e.getTypeMap();return _Object$keys(n).map(function(e){return n[e]})}},queryType:{description:"The type that query operations will be rooted at.",type:new _definition.GraphQLNonNull(__Type),resolve:function(e){return e.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:function(e){return e.getMutationType()}},directives:{description:"A list of all directives supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Directive))),resolve:function(e){return e.getDirectives()}}}}});exports.__Schema=__Schema;var __Directive=new _definition.GraphQLObjectType({name:"__Directive",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},onOperation:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onFragment:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onField:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)}}}}),__Type=new _definition.GraphQLObjectType({name:"__Type",fields:function(){return{kind:{type:new _definition.GraphQLNonNull(__TypeKind),resolve:function(e){if(e instanceof _definition.GraphQLScalarType)return TypeKind.SCALAR;if(e instanceof _definition.GraphQLObjectType)return TypeKind.OBJECT;if(e instanceof _definition.GraphQLInterfaceType)return TypeKind.INTERFACE;if(e instanceof _definition.GraphQLUnionType)return TypeKind.UNION;if(e instanceof _definition.GraphQLEnumType)return TypeKind.ENUM;if(e instanceof _definition.GraphQLInputObjectType)return TypeKind.INPUT_OBJECT;if(e instanceof _definition.GraphQLList)return TypeKind.LIST;if(e instanceof _definition.GraphQLNonNull)return TypeKind.NON_NULL;throw new Error("Unknown kind of type: "+e)}},name:{type:_scalars.GraphQLString},description:{type:_scalars.GraphQLString},fields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Field)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,n){var i=n.includeDeprecated;if(e instanceof _definition.GraphQLObjectType||e instanceof _definition.GraphQLInterfaceType){var t=e.getFields(),r=_Object$keys(t).map(function(e){return t[e]});return i||(r=r.filter(function(e){return!e.deprecationReason})),r}return null}},interfaces:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLObjectType?e.getInterfaces():void 0}},possibleTypes:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLInterfaceType||e instanceof _definition.GraphQLUnionType?e.getPossibleTypes():void 0}},enumValues:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,n){var i=n.includeDeprecated;if(e instanceof _definition.GraphQLEnumType){var t=e.getValues();return i||(t=t.filter(function(e){return!e.deprecationReason})),t}}},inputFields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)),resolve:function(e){if(e instanceof _definition.GraphQLInputObjectType){var n=e.getFields();return _Object$keys(n).map(function(e){return n[e]})}}},ofType:{type:__Type}}}}),__Field=new _definition.GraphQLObjectType({name:"__Field",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},type:{type:new _definition.GraphQLNonNull(__Type)},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!_jsutilsIsNullish2.default(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),__InputValue=new _definition.GraphQLObjectType({name:"__InputValue",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},type:{type:new _definition.GraphQLNonNull(__Type)},defaultValue:{type:_scalars.GraphQLString,resolve:function(e){return null==e.defaultValue?null:_languagePrinter.print(_utilitiesAstFromValue.astFromValue(e.defaultValue,e))}}}}}),__EnumValue=new _definition.GraphQLObjectType({name:"__EnumValue",fields:{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!_jsutilsIsNullish2.default(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}),TypeKind={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"};exports.TypeKind=TypeKind;var __TypeKind=new _definition.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given __Type is",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),SchemaMetaFieldDef={name:"__schema",type:new _definition.GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:function(e,n,i){var t=i.schema;return t}};exports.SchemaMetaFieldDef=SchemaMetaFieldDef;var TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",type:new _definition.GraphQLNonNull(_scalars.GraphQLString)}],resolve:function(e,n,i){var t=n.name,r=i.schema;return r.getType(t)}};exports.TypeMetaFieldDef=TypeMetaFieldDef;var TypeNameMetaFieldDef={name:"__typename",type:new _definition.GraphQLNonNull(_scalars.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(e,n,i){var t=i.parentType;return t.name}};exports.TypeNameMetaFieldDef=TypeNameMetaFieldDef},{"../jsutils/isNullish":34,"../language/printer":43,"../utilities/astFromValue":142,"./definition":135,"./scalars":139,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/interop-require-default":61}],139:[function(require,module,exports){"use strict";function coerceInt(e){var a=Number(e);return a===a&&MAX_INT>=a&&a>=MIN_INT?(0>a?Math.ceil:Math.floor)(a):null}function coerceFloat(e){var a=Number(e);return a===a?a:null}Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_language=require("../language"),MAX_INT=9007199254740991,MIN_INT=-9007199254740991,GraphQLInt=new _definition.GraphQLScalarType({name:"Int",serialize:coerceInt,parseValue:coerceInt,parseLiteral:function(e){if(e.kind===_language.Kind.INT){var a=parseInt(e.value,10);if(MAX_INT>=a&&a>=MIN_INT)return a}return null}});exports.GraphQLInt=GraphQLInt;var GraphQLFloat=new _definition.GraphQLScalarType({name:"Float",serialize:coerceFloat,parseValue:coerceFloat,parseLiteral:function(e){return e.kind===_language.Kind.FLOAT||e.kind===_language.Kind.INT?parseFloat(e.value):null}});exports.GraphQLFloat=GraphQLFloat;var GraphQLString=new _definition.GraphQLScalarType({name:"String",serialize:String,parseValue:String,parseLiteral:function(e){return e.kind===_language.Kind.STRING?e.value:null}});exports.GraphQLString=GraphQLString;var GraphQLBoolean=new _definition.GraphQLScalarType({name:"Boolean",serialize:Boolean,parseValue:Boolean,parseLiteral:function(e){return e.kind===_language.Kind.BOOLEAN?e.value:null}});exports.GraphQLBoolean=GraphQLBoolean;var GraphQLID=new _definition.GraphQLScalarType({name:"ID",serialize:String,parseValue:String,parseLiteral:function(e){return e.kind===_language.Kind.STRING||e.kind===_language.Kind.INT?e.value:null}});exports.GraphQLID=GraphQLID},{"../language":38,"./definition":135}],140:[function(require,module,exports){"use strict";function typeMapReducer(e,t){for(var i=!0;i;){var n=e,a=t;if(r=s=void 0,i=!1,!a)return n;if(!(a instanceof _definition.GraphQLList||a instanceof _definition.GraphQLNonNull)){if(n[a.name])return _jsutilsInvariant2.default(n[a.name]===a,"Schema must contain unique named types but contains multiple "+('types named "'+a+'".')),n;n[a.name]=a;var r=n;if((a instanceof _definition.GraphQLUnionType||a instanceof _definition.GraphQLInterfaceType)&&(r=a.getPossibleTypes().reduce(typeMapReducer,r)),a instanceof _definition.GraphQLObjectType&&(r=a.getInterfaces().reduce(typeMapReducer,r)),a instanceof _definition.GraphQLObjectType||a instanceof _definition.GraphQLInterfaceType||a instanceof _definition.GraphQLInputObjectType){var s=a.getFields();_Object$keys(s).forEach(function(e){var t=s[e];if(t.args){var i=t.args.map(function(e){return e.type});r=i.reduce(typeMapReducer,r)}r=typeMapReducer(r,t.type)})}return r}e=n,t=a.ofType,i=!0}}function assertObjectImplementsInterface(e,t){var i=e.getFields(),n=t.getFields();_Object$keys(n).forEach(function(a){var r=i[a],s=n[a];_jsutilsInvariant2.default(r,'"'+t+'" expects field "'+a+'" but "'+e+'" does not provide it.'),_jsutilsInvariant2.default(isEqualType(s.type,r.type),t+"."+a+' expects type "'+s.type+'" but '+(e+"."+a+' provides type "'+r.type+'".')),s.args.forEach(function(i){var n=i.name,s=_jsutilsFind2.default(r.args,function(e){return e.name===n});_jsutilsInvariant2.default(s,t+"."+a+' expects argument "'+n+'" but '+(e+"."+a+" does not provide it.")),_jsutilsInvariant2.default(isEqualType(i.type,s.type),t+"."+a+"("+n+':) expects type "'+i.type+'" '+("but "+e+"."+a+"("+n+":) provides ")+('type "'+s.type+'".'))}),r.args.forEach(function(i){var n=i.name,r=_jsutilsFind2.default(s.args,function(e){return e.name===n});_jsutilsInvariant2.default(r,t+"."+a+' does not define argument "'+n+'" but '+(e+"."+a+" provides it."))})})}function isEqualType(e,t){for(var i=!0;i;){var n=e,a=t;if(i=!1,n instanceof _definition.GraphQLNonNull&&a instanceof _definition.GraphQLNonNull)e=n.ofType,t=a.ofType,i=!0;else{if(!(n instanceof _definition.GraphQLList&&a instanceof _definition.GraphQLList))return n===a;e=n.ofType,t=a.ofType,i=!0}}}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_directives=require("./directives"),_introspection=require("./introspection"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),GraphQLSchema=function(){
function e(t){var i=this;_classCallCheck(this,e),_jsutilsInvariant2.default("object"==typeof t,"Must provide configuration object."),_jsutilsInvariant2.default(t.query instanceof _definition.GraphQLObjectType,"Schema query must be Object Type but got: "+t.query+"."),_jsutilsInvariant2.default(!t.mutation||t.mutation instanceof _definition.GraphQLObjectType,"Schema mutation must be Object Type if provided but "+("got: "+t.mutation+".")),this._schemaConfig=t,this._typeMap=[this.getQueryType(),this.getMutationType(),_introspection.__Schema].reduce(typeMapReducer,{}),_Object$keys(this._typeMap).forEach(function(e){var t=i._typeMap[e];t instanceof _definition.GraphQLObjectType&&t.getInterfaces().forEach(function(e){return assertObjectImplementsInterface(t,e)})})}return _createClass(e,[{key:"getQueryType",value:function(){return this._schemaConfig.query}},{key:"getMutationType",value:function(){return this._schemaConfig.mutation}},{key:"getTypeMap",value:function(){return this._typeMap}},{key:"getType",value:function(e){return this.getTypeMap()[e]}},{key:"getDirectives",value:function(){return this._directives||(this._directives=[_directives.GraphQLIncludeDirective,_directives.GraphQLSkipDirective])}},{key:"getDirective",value:function(e){return _jsutilsFind2.default(this.getDirectives(),function(t){return t.name===e})}}]),e}();exports.GraphQLSchema=GraphQLSchema},{"../jsutils/find":32,"../jsutils/invariant":33,"./definition":135,"./directives":136,"./introspection":138,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/class-call-check":56,"babel-runtime/helpers/create-class":57,"babel-runtime/helpers/interop-require-default":61}],141:[function(require,module,exports){"use strict";function getFieldDef(e,t,i){var n=i.name.value;return n===_typeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.SchemaMetaFieldDef:n===_typeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.TypeMetaFieldDef:n===_typeIntrospection.TypeNameMetaFieldDef.name&&(t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType||t instanceof _typeDefinition.GraphQLUnionType)?_typeIntrospection.TypeNameMetaFieldDef:t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType?t.getFields()[n]:void 0}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition"),_typeIntrospection=require("../type/introspection"),_typeFromAST=require("./typeFromAST"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),TypeInfo=function(){function e(t){_classCallCheck(this,e),this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._directive=null,this._argument=null}return _createClass(e,[{key:"getType",value:function(){return this._typeStack.length>0?this._typeStack[this._typeStack.length-1]:void 0}},{key:"getParentType",value:function(){return this._parentTypeStack.length>0?this._parentTypeStack[this._parentTypeStack.length-1]:void 0}},{key:"getInputType",value:function(){return this._inputTypeStack.length>0?this._inputTypeStack[this._inputTypeStack.length-1]:void 0}},{key:"getFieldDef",value:function(){return this._fieldDefStack.length>0?this._fieldDefStack[this._fieldDefStack.length-1]:void 0}},{key:"getDirective",value:function(){return this._directive}},{key:"getArgument",value:function(){return this._argument}},{key:"enter",value:function(e){var t,i=this._schema;switch(e.kind){case Kind.SELECTION_SET:var n,a=_typeDefinition.getNamedType(this.getType());_typeDefinition.isCompositeType(a)&&(n=a),this._parentTypeStack.push(n);break;case Kind.FIELD:var p,r=this.getParentType();r&&(p=getFieldDef(i,r,e)),this._fieldDefStack.push(p),this._typeStack.push(p&&p.type);break;case Kind.DIRECTIVE:this._directive=i.getDirective(e.name.value);break;case Kind.OPERATION_DEFINITION:"query"===e.operation?t=i.getQueryType():"mutation"===e.operation&&(t=i.getMutationType()),this._typeStack.push(t);break;case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:t=_typeFromAST.typeFromAST(i,e.typeCondition),this._typeStack.push(t);break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.push(_typeFromAST.typeFromAST(i,e.type));break;case Kind.ARGUMENT:var s,c,u=this.getDirective()||this.getFieldDef();u&&(s=_jsutilsFind2.default(u.args,function(t){return t.name===e.name.value}),s&&(c=s.type)),this._argument=s,this._inputTypeStack.push(c);break;case Kind.LIST:var y=_typeDefinition.getNullableType(this.getInputType());this._inputTypeStack.push(y instanceof _typeDefinition.GraphQLList?y.ofType:void 0);break;case Kind.OBJECT_FIELD:var o,_=_typeDefinition.getNamedType(this.getInputType());if(_ instanceof _typeDefinition.GraphQLInputObjectType){var l=_.getFields()[e.name.value];o=l?l.type:void 0}this._inputTypeStack.push(o)}}},{key:"leave",value:function(e){switch(e.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._inputTypeStack.pop()}}}]),e}();exports.TypeInfo=TypeInfo},{"../jsutils/find":32,"../language/kinds":39,"../type/definition":135,"../type/introspection":138,"./typeFromAST":150,"babel-runtime/helpers/class-call-check":56,"babel-runtime/helpers/create-class":57,"babel-runtime/helpers/interop-require-default":61,"babel-runtime/helpers/interop-require-wildcard":62}],142:[function(require,module,exports){"use strict";function astFromValue(e,i){for(var a=!0;a;){var n=e,t=i;if(r=u=s=l=void 0,a=!1,t instanceof _typeDefinition.GraphQLNonNull)e=n,i=t.ofType,a=!0;else{if(_jsutilsIsNullish2.default(n))return null;if(Array.isArray(n)){var r=t instanceof _typeDefinition.GraphQLList?t.ofType:null;return{kind:_languageKinds.LIST,values:n.map(function(e){return astFromValue(e,r)})}}if(!(t instanceof _typeDefinition.GraphQLList)){if("boolean"==typeof n)return{kind:_languageKinds.BOOLEAN,value:n};if("number"==typeof n){var u=String(n),s=/^[0-9]+$/.test(u);return s?t===_typeScalars.GraphQLFloat?{kind:_languageKinds.FLOAT,value:u+".0"}:{kind:_languageKinds.INT,value:u}:{kind:_languageKinds.FLOAT,value:u}}if("string"==typeof n)return t instanceof _typeDefinition.GraphQLEnumType&&/^[_a-zA-Z][_a-zA-Z0-9]*$/.test(n)?{kind:_languageKinds.ENUM,value:n}:{kind:_languageKinds.STRING,value:JSON.stringify(n).slice(1,-1)};_jsutilsInvariant2.default("object"==typeof n);var l=[];return _Object$keys(n).forEach(function(e){var i;if(t instanceof _typeDefinition.GraphQLInputObjectType){var a=t.getFields()[e];i=a&&a.type}var r=astFromValue(n[e],i);r&&l.push({kind:_languageKinds.OBJECT_FIELD,name:{kind:_languageKinds.NAME,value:e},value:r})}),{kind:_languageKinds.OBJECT,fields:l}}e=n,i=t.ofType,a=!0}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.astFromValue=astFromValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars")},{"../jsutils/invariant":33,"../jsutils/isNullish":34,"../language/kinds":39,"../type/definition":135,"../type/scalars":139,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/interop-require-default":61}],143:[function(require,module,exports){"use strict";function buildWrappedType(e,n){return n.kind===_languageKinds.LIST_TYPE?new _type.GraphQLList(buildWrappedType(e,n.type)):n.kind===_languageKinds.NON_NULL_TYPE?new _type.GraphQLNonNull(buildWrappedType(e,n.type)):e}function getInnerTypeName(e){for(var n=!0;n;){var u=e;if(n=!1,u.kind!==_languageKinds.LIST_TYPE&&u.kind!==_languageKinds.NON_NULL_TYPE)return u.name.value;e=u.type,n=!0}}function buildASTSchema(e,n,u){function t(){var e={String:_type.GraphQLString,Int:_type.GraphQLInt,Float:_type.GraphQLFloat,Boolean:_type.GraphQLBoolean,ID:_type.GraphQLID};return function(n){var u=getInnerTypeName(n);if(!_jsutilsIsNullish2.default(e[u]))return buildWrappedType(e[u],n);if(_jsutilsIsNullish2.default(I[u]))throw new Error("Type "+u+" not found in document");var t=r(I[u]);if(_jsutilsIsNullish2.default(t))throw new Error("Nothing constructed for "+u);return e[u]=t,buildWrappedType(t,n)}}function r(e){if(_jsutilsIsNullish2.default(e))throw new Error("def must be defined");switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:return a(e);case _languageKinds.INTERFACE_TYPE_DEFINITION:return p(e);case _languageKinds.ENUM_TYPE_DEFINITION:return _(e);case _languageKinds.UNION_TYPE_DEFINITION:return o(e);case _languageKinds.SCALAR_TYPE_DEFINITION:return f(e);case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return d(e);default:throw new Error(e.kind+" not supported")}}function a(e){var n=e.name.value,u={name:n,fields:function(){return i(e)},interfaces:function(){return l(e)}};return new _type.GraphQLObjectType(u)}function i(e){return _jsutilsKeyValMap2.default(e.fields,function(e){return e.name.value},function(e){return{type:y(e.type),args:s(e.arguments)}})}function l(e){return e.interfaces.map(function(e){return y(e)})}function s(e){return _jsutilsKeyValMap2.default(e,function(e){return e.name.value},function(e){var n=y(e.type);return{type:n,defaultValue:_valueFromAST.valueFromAST(e.defaultValue,n)}})}function p(e){var n=e.name.value,u={name:n,resolveType:function(){return null},fields:function(){return i(e)}};return new _type.GraphQLInterfaceType(u)}function _(e){var n=new _type.GraphQLEnumType({name:e.name.value,values:_jsutilsKeyValMap2.default(e.values,function(e){return e.name.value},function(){return{}})});return n}function o(e){return new _type.GraphQLUnionType({name:e.name.value,resolveType:function(){return null},types:e.types.map(function(e){return y(e)})})}function f(e){return new _type.GraphQLScalarType({name:e.name.value,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function d(e){return new _type.GraphQLInputObjectType({name:e.name.value,fields:function(){return s(e.fields)}})}if(_jsutilsIsNullish2.default(e))throw new Error("must pass in ast");if(_jsutilsIsNullish2.default(n))throw new Error("must pass in query type");var c=e.definitions.filter(function(e){switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:case _languageKinds.INTERFACE_TYPE_DEFINITION:case _languageKinds.ENUM_TYPE_DEFINITION:case _languageKinds.UNION_TYPE_DEFINITION:case _languageKinds.SCALAR_TYPE_DEFINITION:case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return!0}}),I=_jsutilsKeyMap2.default(c,function(e){return e.name.value});if(_jsutilsIsNullish2.default(I[n]))throw new Error("Specified query type "+n+" not found in document.");if(!_jsutilsIsNullish2.default(u)&&_jsutilsIsNullish2.default(I[u]))throw new Error("Specified mutation type "+u+" not found in document.");var y=t(e);e.definitions.forEach(y);var T,N=y(I[n]);return T=_jsutilsIsNullish2.default(u)?new _type.GraphQLSchema({query:N}):new _type.GraphQLSchema({query:N,mutation:y(I[u])})}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildASTSchema=buildASTSchema;var _jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_languageKinds=require("../language/kinds"),_type=(require("../language/ast"),require("../type"))},{"../jsutils/isNullish":34,"../jsutils/keyMap":35,"../jsutils/keyValMap":36,"../language/ast":37,"../language/kinds":39,"../type":137,"./valueFromAST":151,"babel-runtime/helpers/interop-require-default":61}],144:[function(require,module,exports){"use strict";function buildClientSchema(e){function n(e){if(e.kind===_typeIntrospection.TypeKind.LIST){var r=e.ofType;if(!r)throw new Error("Decorated type deeper than introspection query.");return new _typeDefinition.GraphQLList(n(r))}if(e.kind===_typeIntrospection.TypeKind.NON_NULL){var i=e.ofType;if(!i)throw new Error("Decorated type deeper than introspection query.");return new _typeDefinition.GraphQLNonNull(n(i))}return t(e.name)}function t(e){if(v[e])return v[e];var n=h[e];if(!n)throw new Error("Invalid or incomplete schema, unknown type: "+e+". Ensure that a full introspection query is used in order to build a client schema.");var t=o(n);return v[e]=t,t}function r(e){var t=n(e);return _jsutilsInvariant2.default(_typeDefinition.isInputType(t),"Introspection must provide input type for arguments."),t}function i(e){var t=n(e);return _jsutilsInvariant2.default(_typeDefinition.isOutputType(t),"Introspection must provide output type for fields."),t}function a(e){var t=n(e);return _jsutilsInvariant2.default(t instanceof _typeDefinition.GraphQLObjectType,"Introspection must provide object type for possibleTypes."),t}function u(e){var t=n(e);return _jsutilsInvariant2.default(t instanceof _typeDefinition.GraphQLInterfaceType,"Introspection must provide interface type for interfaces."),t}function o(e){switch(e.kind){case _typeIntrospection.TypeKind.SCALAR:return p(e);case _typeIntrospection.TypeKind.OBJECT:return s(e);case _typeIntrospection.TypeKind.INTERFACE:return c(e);case _typeIntrospection.TypeKind.UNION:return l(e);case _typeIntrospection.TypeKind.ENUM:return f(e);case _typeIntrospection.TypeKind.INPUT_OBJECT:return y(e);default:throw new Error("Invalid or incomplete schema, unknown kind: "+e.kind+". Ensure that a full introspection query is used in order to build a client schema.")}}function p(e){return new _typeDefinition.GraphQLScalarType({name:e.name,description:e.description,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function s(e){return new _typeDefinition.GraphQLObjectType({name:e.name,description:e.description,interfaces:e.interfaces.map(u),fields:function(){return d(e)}})}function c(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return d(e)},resolveType:function(){throw new Error("Client Schema cannot be used for execution.")}})}function l(e){return new _typeDefinition.GraphQLUnionType({name:e.name,description:e.description,types:e.possibleTypes.map(a),resolveType:function(){throw new Error("Client Schema cannot be used for execution.")}})}function f(e){return new _typeDefinition.GraphQLEnumType({name:e.name,description:e.description,values:_jsutilsKeyValMap2.default(e.enumValues,function(e){return e.name},function(e){return{description:e.description}})})}function y(e){return new _typeDefinition.GraphQLInputObjectType({name:e.name,description:e.description,fields:function(){return _(e.inputFields)}})}function d(e){return _jsutilsKeyValMap2.default(e.fields,function(e){return e.name},function(e){return{description:e.description,type:i(e.type),args:_(e.args),resolve:function(){throw new Error("Client Schema cannot be used for execution.")}}})}function _(e){return _jsutilsKeyValMap2.default(e,function(e){return e.name},function(e){var n=e.description,t=r(e.type),i=e.defaultValue?_valueFromAST.valueFromAST(_languageParser.parseValue(e.defaultValue),t):null;return{description:n,type:t,defaultValue:i}})}var m=e.__schema,h=_jsutilsKeyMap2.default(m.types,function(e){return e.name}),v={String:_typeScalars.GraphQLString,Int:_typeScalars.GraphQLInt,Float:_typeScalars.GraphQLFloat,Boolean:_typeScalars.GraphQLBoolean,ID:_typeScalars.GraphQLID};m.types.forEach(function(e){return t(e.name)});var T=n(m.queryType),I=m.mutationType?n(m.mutationType):null,w=new _typeSchema.GraphQLSchema({query:T,mutation:I});return w}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildClientSchema=buildClientSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_languageParser=require("../language/parser"),_typeSchema=require("../type/schema"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars"),_typeIntrospection=require("../type/introspection")},{"../jsutils/invariant":33,"../jsutils/keyMap":35,"../jsutils/keyValMap":36,"../language/parser":42,"../type/definition":135,"../type/introspection":138,"../type/scalars":139,"../type/schema":140,"./valueFromAST":151,"babel-runtime/helpers/interop-require-default":61}],145:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _introspectionQuery=require("./introspectionQuery");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _introspectionQuery.introspectionQuery}});var _buildClientSchema=require("./buildClientSchema");Object.defineProperty(exports,"buildClientSchema",{enumerable:!0,get:function(){return _buildClientSchema.buildClientSchema}});var _buildASTSchema=require("./buildASTSchema");Object.defineProperty(exports,"buildASTSchema",{enumerable:!0,get:function(){return _buildASTSchema.buildASTSchema}});var _schemaPrinter=require("./schemaPrinter");Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _schemaPrinter.printSchema}}),Object.defineProperty(exports,"printIntrospectionSchema",{enumerable:!0,get:function(){return _schemaPrinter.printIntrospectionSchema}});var _typeFromAST=require("./typeFromAST");Object.defineProperty(exports,"typeFromAST",{enumerable:!0,get:function(){return _typeFromAST.typeFromAST}});var _valueFromAST=require("./valueFromAST");Object.defineProperty(exports,"valueFromAST",{enumerable:!0,get:function(){return _valueFromAST.valueFromAST}});var _astFromValue=require("./astFromValue");Object.defineProperty(exports,"astFromValue",{enumerable:!0,get:function(){return _astFromValue.astFromValue}});var _TypeInfo=require("./TypeInfo");Object.defineProperty(exports,"TypeInfo",{enumerable:!0,get:function(){return _TypeInfo.TypeInfo}});var _isValidJSValue=require("./isValidJSValue");Object.defineProperty(exports,"isValidJSValue",{enumerable:!0,get:function(){return _isValidJSValue.isValidJSValue}});var _isValidLiteralValue=require("./isValidLiteralValue");Object.defineProperty(exports,"isValidLiteralValue",{enumerable:!0,get:function(){return _isValidLiteralValue.isValidLiteralValue}})},{"./TypeInfo":141,"./astFromValue":142,"./buildASTSchema":143,"./buildClientSchema":144,"./introspectionQuery":146,"./isValidJSValue":147,"./isValidLiteralValue":148,"./schemaPrinter":149,"./typeFromAST":150,"./valueFromAST":151}],146:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var introspectionQuery="\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n args {\n ...InputValue\n }\n onOperation\n onFragment\n onField\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n fields {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n";exports.introspectionQuery=introspectionQuery},{}],147:[function(require,module,exports){"use strict";function isValidJSValue(e,i){for(var t=!0;t;){var r=e,u=i;if(s=l=n=void 0,t=!1,u instanceof _typeDefinition.GraphQLNonNull){if(_jsutilsIsNullish2.default(r))return!1;var s=u.ofType;e=r,i=s,t=!0}else{if(_jsutilsIsNullish2.default(r))return!0;if(!(u instanceof _typeDefinition.GraphQLList)){if(u instanceof _typeDefinition.GraphQLInputObjectType){if("object"!=typeof r)return!1;var n=u.getFields();return _Object$keys(r).some(function(e){return!n[e]})?!1:_Object$keys(n).every(function(e){return isValidJSValue(r[e],n[e].type)})}return _jsutilsInvariant2.default(u instanceof _typeDefinition.GraphQLScalarType||u instanceof _typeDefinition.GraphQLEnumType,"Must be input type"),!_jsutilsIsNullish2.default(u.parseValue(r))}var l=u.ofType;if(Array.isArray(r))return r.every(function(e){return isValidJSValue(e,l)});e=r,i=l,t=!0}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidJSValue=isValidJSValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":33,"../jsutils/isNullish":34,"../type/definition":135,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/interop-require-default":61}],148:[function(require,module,exports){"use strict";function isValidLiteralValue(e,i){for(var t=!0;t;){var r=e,n=i;if(u=f=a=s=l=void 0,t=!1,r instanceof _typeDefinition.GraphQLNonNull){if(!n)return!1;var u=r.ofType;e=u,i=n,t=!0}else{if(!n)return!0;if(n.kind===_languageKinds.VARIABLE)return!0;if(!(r instanceof _typeDefinition.GraphQLList)){if(r instanceof _typeDefinition.GraphQLInputObjectType){if(n.kind!==_languageKinds.OBJECT)return!1;var a=r.getFields(),s=n.fields;if(s.some(function(e){return!a[e.name.value]}))return!1;var l=_jsutilsKeyMap2.default(s,function(e){return e.name.value});return _Object$keys(a).every(function(e){return isValidLiteralValue(a[e].type,l[e]&&l[e].value)})}return _jsutilsInvariant2.default(r instanceof _typeDefinition.GraphQLScalarType||r instanceof _typeDefinition.GraphQLEnumType,"Must be input type"),!_jsutilsIsNullish2.default(r.parseLiteral(n))}var f=r.ofType;if(n.kind===_languageKinds.LIST)return n.values.every(function(e){return isValidLiteralValue(f,e)});e=f,i=n,t=!0}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidLiteralValue=isValidLiteralValue;var _languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish)},{"../jsutils/invariant":33,"../jsutils/isNullish":34,"../jsutils/keyMap":35,"../language/kinds":39,"../type/definition":135,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/interop-require-default":61}],149:[function(require,module,exports){"use strict";function printSchema(n){return printFilteredSchema(n,isDefinedType)}function printIntrospectionSchema(n){return printFilteredSchema(n,isIntrospectionType)}function isDefinedType(n){return!isIntrospectionType(n)&&!isBuiltInScalar(n)}function isIntrospectionType(n){return 0===n.indexOf("__")}function isBuiltInScalar(n){return"String"===n||"Boolean"===n||"Int"===n||"Float"===n||"ID"===n}function printFilteredSchema(n,e){var t=n.getTypeMap(),i=_Object$keys(t).filter(e).sort(function(n,e){return n.localeCompare(e)}).map(function(n){return t[n]});return i.map(printType).join("\n\n")+"\n"}function printType(n){return n instanceof _typeDefinition.GraphQLScalarType?printScalar(n):n instanceof _typeDefinition.GraphQLObjectType?printObject(n):n instanceof _typeDefinition.GraphQLInterfaceType?printInterface(n):n instanceof _typeDefinition.GraphQLUnionType?printUnion(n):n instanceof _typeDefinition.GraphQLEnumType?printEnum(n):(_jsutilsInvariant2.default(n instanceof _typeDefinition.GraphQLInputObjectType),printInputObject(n))}function printScalar(n){return"scalar "+n.name}function printObject(n){var e=n.getInterfaces(),t=e.length?" implements "+e.map(function(n){return n.name}).join(", "):"";return"type "+n.name+t+" {\n"+printFields(n)+"\n}"}function printInterface(n){return"interface "+n.name+" {\n"+printFields(n)+"\n}"}function printUnion(n){return"union "+n.name+" = "+n.getPossibleTypes().join(" | ")}function printEnum(n){var e=n.getValues();return"enum "+n.name+" {\n"+e.map(function(n){return" "+n.name}).join("\n")+"\n}"}function printInputObject(n){var e=n.getFields(),t=_Object$keys(e).map(function(n){return e[n]});return"input "+n.name+" {\n"+t.map(function(n){return" "+printInputValue(n)}).join("\n")+"\n}"}function printFields(n){var e=n.getFields(),t=_Object$keys(e).map(function(n){return e[n]});return t.map(function(n){return" "+n.name+printArgs(n)+": "+n.type}).join("\n")}function printArgs(n){return 0===n.args.length?"":"("+n.args.map(printInputValue).join(", ")+")"}function printInputValue(n){var e=n.name+": "+n.type;return _jsutilsIsNullish2.default(n.defaultValue)||(e+=" = "+_languagePrinter.print(_utilitiesAstFromValue.astFromValue(n.defaultValue,n.type))),e}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.printSchema=printSchema,exports.printIntrospectionSchema=printIntrospectionSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":33,"../jsutils/isNullish":34,"../language/printer":43,"../type/definition":135,"../utilities/astFromValue":142,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/interop-require-default":61}],150:[function(require,module,exports){"use strict";function typeFromAST(e,i){var t;return i.kind===_languageKinds.LIST_TYPE?(t=typeFromAST(e,i.type),t&&new _typeDefinition.GraphQLList(t)):i.kind===_languageKinds.NON_NULL_TYPE?(t=typeFromAST(e,i.type),t&&new _typeDefinition.GraphQLNonNull(t)):(_jsutilsInvariant2.default(i.kind===_languageKinds.NAMED_TYPE,"Must be a named type."),e.getType(i.name.value))}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeFromAST=typeFromAST;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":33,"../language/kinds":39,"../type/definition":135,"babel-runtime/helpers/interop-require-default":61}],151:[function(require,module,exports){"use strict";function valueFromAST(e,i,r){for(var t=!0;t;){var u=e,n=i,a=r;if(l=s=f=o=p=d=void 0,t=!1,n instanceof _typeDefinition.GraphQLNonNull){var l=n.ofType;e=u,i=l,r=a,t=!0}else{if(!u)return null;if(u.kind===Kind.VARIABLE){var s=u.name.value;return a&&a.hasOwnProperty(s)?a[s]:null}if(n instanceof _typeDefinition.GraphQLList){var f=n.ofType;return u.kind===Kind.LIST?u.values.map(function(e){return valueFromAST(e,f,a)}):[valueFromAST(u,f,a)]}if(n instanceof _typeDefinition.GraphQLInputObjectType){var o=n.getFields();if(u.kind!==Kind.OBJECT)return null;var p=_jsutilsKeyMap2.default(u.fields,function(e){return e.name.value});return _Object$keys(o).reduce(function(e,i){var r=o[i],t=p[i],u=valueFromAST(t&&t.value,r.type,a);return _jsutilsIsNullish2.default(u)&&(u=r.defaultValue),_jsutilsIsNullish2.default(u)||(e[i]=u),e},{})}_jsutilsInvariant2.default(n instanceof _typeDefinition.GraphQLScalarType||n instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var d=n.parseLiteral(u);if(!_jsutilsIsNullish2.default(d))return d}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.valueFromAST=valueFromAST;var _jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":33,"../jsutils/isNullish":34,"../jsutils/keyMap":35,"../language/kinds":39,"../type/definition":135,"babel-runtime/core-js/object/keys":53,"babel-runtime/helpers/interop-require-default":61,"babel-runtime/helpers/interop-require-wildcard":62}],152:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _validate=require("./validate");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validate.validate}});var _specifiedRules=require("./specifiedRules");Object.defineProperty(exports,"specifiedRules",{enumerable:!0,get:function(){return _specifiedRules.specifiedRules}})},{"./specifiedRules":175,"./validate":176}],153:[function(require,module,exports){"use strict";function badValueMessage(e,r,t){return'Argument "'+e+'" expected type "'+r+'" but got: '+t+"."}function ArgumentsOfCorrectType(e){return{Argument:function(r){var t=e.getArgument();return t&&!_utilitiesIsValidLiteralValue.isValidLiteralValue(t.type,r.value)?new _error.GraphQLError(badValueMessage(r.name.value,t.type,_languagePrinter.print(r.value)),[r.value]):void 0}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badValueMessage=badValueMessage,
exports.ArgumentsOfCorrectType=ArgumentsOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":29,"../../language/printer":43,"../../utilities/isValidLiteralValue":148}],154:[function(require,module,exports){"use strict";function defaultForNonNullArgMessage(e,r,a){return'Variable "$'+e+'" of type "'+r+'" is required and will not '+('use the default value. Perhaps you meant to use type "'+a+'".')}function badValueForDefaultArgMessage(e,r,a){return'Variable "$'+e+'" of type "'+r+'" has invalid default '+("value: "+a+".")}function DefaultValuesOfCorrectType(e){return{VariableDefinition:function(r){var a=r.variable.name.value,t=r.defaultValue,l=e.getInputType();return l instanceof _typeDefinition.GraphQLNonNull&&t?new _error.GraphQLError(defaultForNonNullArgMessage(a,l,l.ofType),[t]):l&&t&&!_utilitiesIsValidLiteralValue.isValidLiteralValue(l,t)?new _error.GraphQLError(badValueForDefaultArgMessage(a,l,_languagePrinter.print(t)),[t]):void 0}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultForNonNullArgMessage=defaultForNonNullArgMessage,exports.badValueForDefaultArgMessage=badValueForDefaultArgMessage,exports.DefaultValuesOfCorrectType=DefaultValuesOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":29,"../../language/printer":43,"../../type/definition":135,"../../utilities/isValidLiteralValue":148}],155:[function(require,module,exports){"use strict";function undefinedFieldMessage(e,r){return'Cannot query field "'+e+'" on "'+r+'".'}function FieldsOnCorrectType(e){return{Field:function(r){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i)return new _error.GraphQLError(undefinedFieldMessage(r.name.value,n.name),[r])}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedFieldMessage=undefinedFieldMessage,exports.FieldsOnCorrectType=FieldsOnCorrectType;var _error=require("../../error")},{"../../error":29}],156:[function(require,module,exports){"use strict";function inlineFragmentOnNonCompositeErrorMessage(e){return'Fragment cannot condition on non composite type "'+e+'".'}function fragmentOnNonCompositeErrorMessage(e,n){return'Fragment "'+e+'" cannot condition on non composite '+('type "'+n+'".')}function FragmentsOnCompositeTypes(e){return{InlineFragment:function(n){var r=e.getType();return r&&!_typeDefinition.isCompositeType(r)?new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage(_languagePrinter.print(n.typeCondition)),[n.typeCondition]):void 0},FragmentDefinition:function(n){var r=e.getType();return r&&!_typeDefinition.isCompositeType(r)?new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(n.name.value,_languagePrinter.print(n.typeCondition)),[n.typeCondition]):void 0}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.inlineFragmentOnNonCompositeErrorMessage=inlineFragmentOnNonCompositeErrorMessage,exports.fragmentOnNonCompositeErrorMessage=fragmentOnNonCompositeErrorMessage,exports.FragmentsOnCompositeTypes=FragmentsOnCompositeTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition")},{"../../error":29,"../../language/printer":43,"../../type/definition":135}],157:[function(require,module,exports){"use strict";function unknownArgMessage(e,n,r){return'Unknown argument "'+e+'" on field "'+n+'" of '+('type "'+r+'".')}function unknownDirectiveArgMessage(e,n){return'Unknown argument "'+e+'" on directive "@'+n+'".'}function KnownArgumentNames(e){return{Argument:function(n,r,i,t,u){var a=u[u.length-1];if("Field"===a.kind){var s=e.getFieldDef();if(s){var o=_jsutilsFind2.default(s.args,function(e){return e.name===n.name.value});if(!o){var l=e.getParentType();return _jsutilsInvariant2.default(l),new _error.GraphQLError(unknownArgMessage(n.name.value,s.name,l.name),[n])}}}else if("Directive"===a.kind){var g=e.getDirective();if(g){var f=_jsutilsFind2.default(g.args,function(e){return e.name===n.name.value});if(!f)return new _error.GraphQLError(unknownDirectiveArgMessage(n.name.value,g.name),[n])}}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownArgMessage=unknownArgMessage,exports.unknownDirectiveArgMessage=unknownDirectiveArgMessage,exports.KnownArgumentNames=KnownArgumentNames;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant)},{"../../error":29,"../../jsutils/find":32,"../../jsutils/invariant":33,"babel-runtime/helpers/interop-require-default":61}],158:[function(require,module,exports){"use strict";function unknownDirectiveMessage(e){return'Unknown directive "'+e+'".'}function misplacedDirectiveMessage(e,r){return'Directive "'+e+'" may not be used on "'+r+'".'}function KnownDirectives(e){return{Directive:function(r,i,n,a,t){var s=_jsutilsFind2.default(e.getSchema().getDirectives(),function(e){return e.name===r.name.value});if(!s)return new _error.GraphQLError(unknownDirectiveMessage(r.name.value),[r]);var u=t[t.length-1];return u.kind!==_languageKinds.OPERATION_DEFINITION||s.onOperation?u.kind!==_languageKinds.FIELD||s.onField?u.kind!==_languageKinds.FRAGMENT_SPREAD&&u.kind!==_languageKinds.INLINE_FRAGMENT&&u.kind!==_languageKinds.FRAGMENT_DEFINITION||s.onFragment?void 0:new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"fragment"),[r]):new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"field"),[r]):new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"operation"),[r])}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownDirectiveMessage=unknownDirectiveMessage,exports.misplacedDirectiveMessage=misplacedDirectiveMessage,exports.KnownDirectives=KnownDirectives;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds")},{"../../error":29,"../../jsutils/find":32,"../../language/kinds":39,"babel-runtime/helpers/interop-require-default":61}],159:[function(require,module,exports){"use strict";function unknownFragmentMessage(e){return'Unknown fragment "'+e+'".'}function KnownFragmentNames(e){return{FragmentSpread:function(n){var r=n.name.value,a=e.getFragment(r);return a?void 0:new _error.GraphQLError(unknownFragmentMessage(r),[n.name])}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownFragmentMessage=unknownFragmentMessage,exports.KnownFragmentNames=KnownFragmentNames;var _error=require("../../error")},{"../../error":29}],160:[function(require,module,exports){"use strict";function unknownTypeMessage(e){return'Unknown type "'+e+'".'}function KnownTypeNames(e){return{NamedType:function(n){var r=n.name.value,o=e.getSchema().getType(r);return o?void 0:new _error.GraphQLError(unknownTypeMessage(r),[n])}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownTypeMessage=unknownTypeMessage,exports.KnownTypeNames=KnownTypeNames;var _error=require("../../error")},{"../../error":29}],161:[function(require,module,exports){"use strict";function anonOperationNotAloneMessage(){return"This anonymous operation must be the only defined operation."}function LoneAnonymousOperation(){var n=0;return{Document:function(e){n=e.definitions.filter(function(n){return"OperationDefinition"===n.kind}).length},OperationDefinition:function(e){return!e.name&&n>1?new _error.GraphQLError(anonOperationNotAloneMessage(),[e]):void 0}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.anonOperationNotAloneMessage=anonOperationNotAloneMessage,exports.LoneAnonymousOperation=LoneAnonymousOperation;var _error=require("../../error")},{"../../error":29}],162:[function(require,module,exports){"use strict";function cycleErrorMessage(e,r){var n=r.length?" via "+r.join(", "):"";return'Cannot spread fragment "'+e+'" within itself'+n+"."}function NoFragmentCycles(e){var r=e.getDocument().definitions,n=r.reduce(function(e,r){return r.kind===_languageKinds.FRAGMENT_DEFINITION&&(e[r.name.value]=gatherSpreads(r)),e},{}),a=new _Set;return{FragmentDefinition:function(e){function r(e){for(var o=n[e],s=0;s<o.length;++s){var c=o[s];if(!a.has(c))if(c.name.value!==i)u.some(function(e){return e===c})||(u.push(c),r(c.name.value),u.pop());else{var g=u.concat(c);g.forEach(function(e){return a.add(e)}),t.push(new _error.GraphQLError(cycleErrorMessage(i,u.map(function(e){return e.name.value})),g))}}}var t=[],i=e.name.value,u=[];return r(i),t.length>0?t:void 0}}}function gatherSpreads(e){var r=[];return _languageVisitor.visit(e,{FragmentSpread:function(e){r.push(e)}}),r}var _Set=require("babel-runtime/core-js/set").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.cycleErrorMessage=cycleErrorMessage,exports.NoFragmentCycles=NoFragmentCycles;var _error=require("../../error"),_languageKinds=require("../../language/kinds"),_languageVisitor=require("../../language/visitor")},{"../../error":29,"../../language/kinds":39,"../../language/visitor":45,"babel-runtime/core-js/set":55}],163:[function(require,module,exports){"use strict";function undefinedVarMessage(e){return'Variable "$'+e+'" is not defined.'}function undefinedVarByOpMessage(e,n){return'Variable "$'+e+'" is not defined by operation "'+n+'".'}function NoUndefinedVariables(){var e,n={},r={};return{visitSpreadFragments:!0,OperationDefinition:function(a){e=a,n={},r={}},VariableDefinition:function(e){r[e.variable.name.value]=!0},Variable:function(n,a,i,d,u){var s=n.name.value;if(r[s]!==!0){var o=u.some(function(e){return e.kind===_languageKinds.FRAGMENT_DEFINITION});return o&&e&&e.name?new _error.GraphQLError(undefinedVarByOpMessage(s,e.name.value),[n,e]):new _error.GraphQLError(undefinedVarMessage(s),[n])}},FragmentSpread:function(e){return n[e.name.value]===!0?!1:void(n[e.name.value]=!0)}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedVarMessage=undefinedVarMessage,exports.undefinedVarByOpMessage=undefinedVarByOpMessage,exports.NoUndefinedVariables=NoUndefinedVariables;var _error=require("../../error"),_languageKinds=require("../../language/kinds")},{"../../error":29,"../../language/kinds":39}],164:[function(require,module,exports){"use strict";function unusedFragMessage(e){return'Fragment "'+e+'" is never used.'}function NoUnusedFragments(){var e=[],r=[],n={},u={};return{OperationDefinition:function(){u={},r.push(u)},FragmentDefinition:function(r){e.push(r),u={},n[r.name.value]=u},FragmentSpread:function(e){u[e.name.value]=!0},Document:{leave:function(){var u={},a=function s(e){var r=_Object$keys(e);r.forEach(function(e){if(u[e]!==!0){u[e]=!0;var r=n[e];r&&s(r)}})};r.forEach(a);var t=e.filter(function(e){return u[e.name.value]!==!0}).map(function(e){return new _error.GraphQLError(unusedFragMessage(e.name.value),[e])});return t.length>0?t:void 0}}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unusedFragMessage=unusedFragMessage,exports.NoUnusedFragments=NoUnusedFragments;var _error=require("../../error")},{"../../error":29,"babel-runtime/core-js/object/keys":53}],165:[function(require,module,exports){"use strict";function unusedVariableMessage(e){return'Variable "$'+e+'" is never used.'}function NoUnusedVariables(){var e={},r=[],a={};return{visitSpreadFragments:!0,OperationDefinition:{enter:function(){e={},r=[],a={}},leave:function(){var e=r.filter(function(e){return a[e.variable.name.value]!==!0}).map(function(e){return new _error.GraphQLError(unusedVariableMessage(e.variable.name.value),[e])});return e.length>0?e:void 0}},VariableDefinition:function(e){return r.push(e),!1},Variable:function(e){a[e.name.value]=!0},FragmentSpread:function(r){return e[r.name.value]===!0?!1:void(e[r.name.value]=!0)}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unusedVariableMessage=unusedVariableMessage,exports.NoUnusedVariables=NoUnusedVariables;var _error=require("../../error")},{"../../error":29}],166:[function(require,module,exports){"use strict";function fieldsConflictMessage(e,r){return'Fields "'+e+'" conflict because '+reasonMessage(r)+"."}function reasonMessage(e){return Array.isArray(e)?e.map(function(e){var r=_slicedToArray(e,2),t=r[0],n=r[1];return'subfields "'+t+'" conflict because '+reasonMessage(n)}).join(" and "):e}function OverlappingFieldsCanBeMerged(e){function r(e){var r=[];return _Object$keys(e).forEach(function(n){var i=e[n];if(i.length>1)for(var a=0;a<i.length;a++)for(var s=a;s<i.length;s++){var u=t(n,i[a],i[s]);u&&r.push(u)}}),r}function t(t,i,a){var s=_slicedToArray(i,2),u=s[0],l=s[1],c=_slicedToArray(a,2),o=c[0],d=c[1];if(u!==o&&!n.has(u,o)){n.add(u,o);var f=u.name.value,g=o.name.value;if(f!==g)return[[t,f+" and "+g+" are different fields"],[u,o]];var p=l&&l.type,v=d&&d.type;if(p&&v&&!sameType(p,v))return[[t,"they return differing types "+p+" and "+v],[u,o]];if(!sameArguments(u.arguments||[],o.arguments||[]))return[[t,"they have differing arguments"],[u,o]];if(!sameDirectives(u.directives||[],o.directives||[]))return[[t,"they have differing directives"],[u,o]];var _=u.selectionSet,m=o.selectionSet;if(_&&m){var y={},h=collectFieldASTsAndDefs(e,_typeDefinition.getNamedType(p),_,y);h=collectFieldASTsAndDefs(e,_typeDefinition.getNamedType(v),m,y,h);var A=r(h);if(A.length>0)return[[t,A.map(function(e){var r=_slicedToArray(e,1),t=r[0];return t})],A.reduce(function(e,r){var t=_slicedToArray(r,2),n=t[1];return e.concat(n)},[u,o])]}}}var n=new PairSet;return{SelectionSet:{leave:function(t){var n=collectFieldASTsAndDefs(e,e.getParentType(),t),i=r(n);return i.length?i.map(function(e){var r=_slicedToArray(e,2),t=_slicedToArray(r[0],2),n=t[0],i=t[1],a=r[1];return new _error.GraphQLError(fieldsConflictMessage(n,i),a)}):void 0}}}}function sameDirectives(e,r){return e.length!==r.length?!1:e.every(function(e){var t=_jsutilsFind2.default(r,function(r){return r.name.value===e.name.value});return t?sameArguments(e.arguments||[],t.arguments||[]):!1})}function sameArguments(e,r){return e.length!==r.length?!1:e.every(function(e){var t=_jsutilsFind2.default(r,function(r){return r.name.value===e.name.value});return t?sameValue(e.value,t.value):!1})}function sameValue(e,r){return!e&&!r||_languagePrinter.print(e)===_languagePrinter.print(r)}function sameType(e,r){return String(e)===String(r)}function collectFieldASTsAndDefs(e,r,t,n,i){for(var a=n||{},s=i||{},u=0;u<t.selections.length;u++){var l=t.selections[u];switch(l.kind){case _languageKinds.FIELD:var c,o=l.name.value;(r instanceof _typeDefinition.GraphQLObjectType||r instanceof _typeDefinition.GraphQLInterfaceType)&&(c=r.getFields()[o]);var d=l.alias?l.alias.value:o;s[d]||(s[d]=[]),s[d].push([l,c]);break;case _languageKinds.INLINE_FRAGMENT:s=collectFieldASTsAndDefs(e,_utilitiesTypeFromAST.typeFromAST(e.getSchema(),l.typeCondition),l.selectionSet,a,s);break;case _languageKinds.FRAGMENT_SPREAD:var f=l.name.value;if(a[f])continue;a[f]=!0;var g=e.getFragment(f);if(!g)continue;s=collectFieldASTsAndDefs(e,_utilitiesTypeFromAST.typeFromAST(e.getSchema(),g.typeCondition),g.selectionSet,a,s)}}return s}function _pairSetAdd(e,r,t){var n=e.get(r);n||(n=new _Set,e.set(r,n)),n.add(t)}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_slicedToArray=require("babel-runtime/helpers/sliced-to-array").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Set=require("babel-runtime/core-js/set").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.fieldsConflictMessage=fieldsConflictMessage,exports.OverlappingFieldsCanBeMerged=OverlappingFieldsCanBeMerged;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST"),PairSet=function(){function e(){_classCallCheck(this,e),this._data=new _Map}return _createClass(e,[{key:"has",value:function(e,r){var t=this._data.get(e);return t&&t.has(r)}},{key:"add",value:function(e,r){_pairSetAdd(this._data,e,r),_pairSetAdd(this._data,r,e)}}]),e}()},{"../../error":29,"../../jsutils/find":32,"../../language/kinds":39,"../../language/printer":43,"../../type/definition":135,"../../utilities/typeFromAST":150,"babel-runtime/core-js/map":48,"babel-runtime/core-js/object/keys":53,"babel-runtime/core-js/set":55,"babel-runtime/helpers/class-call-check":56,"babel-runtime/helpers/create-class":57,"babel-runtime/helpers/interop-require-default":61,"babel-runtime/helpers/sliced-to-array":63}],167:[function(require,module,exports){"use strict";function typeIncompatibleSpreadMessage(e,t,r){return'Fragment "'+e+'" cannot be spread here as objects of '+('type "'+t+'" can never be of type "'+r+'".')}function typeIncompatibleAnonSpreadMessage(e,t){return"Fragment cannot be spread here as objects of "+('type "'+e+'" can never be of type "'+t+'".')}function PossibleFragmentSpreads(e){return{InlineFragment:function(t){var r=e.getType(),n=e.getParentType();return r&&n&&!doTypesOverlap(r,n)?new _error.GraphQLError(typeIncompatibleAnonSpreadMessage(n,r),[t]):void 0},FragmentSpread:function(t){var r=t.name.value,n=getFragmentType(e,r),i=e.getParentType();return n&&i&&!doTypesOverlap(n,i)?new _error.GraphQLError(typeIncompatibleSpreadMessage(r,i,n),[t]):void 0}}}function getFragmentType(e,t){var r=e.getFragment(t);return r&&_utilitiesTypeFromAST.typeFromAST(e.getSchema(),r.typeCondition)}function doTypesOverlap(e,t){if(e===t)return!0;if(e instanceof _typeDefinition.GraphQLObjectType)return t instanceof _typeDefinition.GraphQLObjectType?!1:-1!==t.getPossibleTypes().indexOf(e);if(e instanceof _typeDefinition.GraphQLInterfaceType||e instanceof _typeDefinition.GraphQLUnionType){if(t instanceof _typeDefinition.GraphQLObjectType)return-1!==e.getPossibleTypes().indexOf(t);var r=_jsutilsKeyMap2.default(e.getPossibleTypes(),function(e){return e.name});return t.getPossibleTypes().some(function(e){return r[e.name]})}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeIncompatibleSpreadMessage=typeIncompatibleSpreadMessage,exports.typeIncompatibleAnonSpreadMessage=typeIncompatibleAnonSpreadMessage,exports.PossibleFragmentSpreads=PossibleFragmentSpreads;var _error=require("../../error"),_jsutilsKeyMap=require("../../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_typeDefinition=require("../../type/definition"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":29,"../../jsutils/keyMap":35,"../../type/definition":135,"../../utilities/typeFromAST":150,"babel-runtime/helpers/interop-require-default":61}],168:[function(require,module,exports){"use strict";function missingFieldArgMessage(e,r,i){return'Field "'+e+'" argument "'+r+'" of type "'+i+'" is required but not provided.'}function missingDirectiveArgMessage(e,r,i){return'Directive "@'+e+'" argument "'+r+'" of type '+('"'+i+'" is required but not provided.')}function ProvidedNonNullArguments(e){return{Field:{leave:function(r){var i=e.getFieldDef();if(!i)return!1;var t=[],n=r.arguments||[],s=_jsutilsKeyMap2.default(n,function(e){return e.name.value});return i.args.forEach(function(e){var i=s[e.name];!i&&e.type instanceof _typeDefinition.GraphQLNonNull&&t.push(new _error.GraphQLError(missingFieldArgMessage(r.name.value,e.name,e.type),[r]))}),t.length>0?t:void 0}},Directive:{leave:function(r){var i=e.getDirective();if(!i)return!1;var t=[],n=r.arguments||[],s=_jsutilsKeyMap2.default(n,function(e){return e.name.value});return i.args.forEach(function(e){var i=s[e.name];!i&&e.type instanceof _typeDefinition.GraphQLNonNull&&t.push(new _error.GraphQLError(missingDirectiveArgMessage(r.name.value,e.name,e.type),[r]))}),t.length>0?t:void 0}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.missingFieldArgMessage=missingFieldArgMessage,exports.missingDirectiveArgMessage=missingDirectiveArgMessage,exports.ProvidedNonNullArguments=ProvidedNonNullArguments;var _error=require("../../error"),_jsutilsKeyMap=require("../../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_typeDefinition=require("../../type/definition")},{"../../error":29,"../../jsutils/keyMap":35,"../../type/definition":135,"babel-runtime/helpers/interop-require-default":61}],169:[function(require,module,exports){"use strict";function noSubselectionAllowedMessage(e,r){return'Field "'+e+'" of type "'+r+'" must not have a sub selection.'}function requiredSubselectionMessage(e,r){return'Field "'+e+'" of type "'+r+'" must have a sub selection.'}function ScalarLeafs(e){return{Field:function(r){var s=e.getType();if(s)if(_typeDefinition.isLeafType(s)){if(r.selectionSet)return new _error.GraphQLError(noSubselectionAllowedMessage(r.name.value,s),[r.selectionSet])}else if(!r.selectionSet)return new _error.GraphQLError(requiredSubselectionMessage(r.name.value,s),[r])}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.noSubselectionAllowedMessage=noSubselectionAllowedMessage,exports.requiredSubselectionMessage=requiredSubselectionMessage,exports.ScalarLeafs=ScalarLeafs;var _error=require("../../error"),_typeDefinition=require("../../type/definition")},{"../../error":29,"../../type/definition":135}],170:[function(require,module,exports){"use strict";function duplicateArgMessage(e){return'There can be only one argument named "'+e+'".'}function UniqueArgumentNames(){var e=_Object$create(null);return{Field:function(){e=_Object$create(null)},Directive:function(){e=_Object$create(null)},Argument:function(r){var t=r.name.value;return e[t]?new _error.GraphQLError(duplicateArgMessage(t),[e[t],r.name]):void(e[t]=r.name)}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateArgMessage=duplicateArgMessage,exports.UniqueArgumentNames=UniqueArgumentNames;var _error=require("../../error")},{"../../error":29,"babel-runtime/core-js/object/create":50}],171:[function(require,module,exports){"use strict";function duplicateFragmentNameMessage(e){return'There can only be one fragment named "'+e+'".'}function UniqueFragmentNames(){var e=_Object$create(null);return{FragmentDefinition:function(r){var a=r.name.value;return e[a]?new _error.GraphQLError(duplicateFragmentNameMessage(a),[e[a],r.name]):void(e[a]=r.name)}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateFragmentNameMessage=duplicateFragmentNameMessage,exports.UniqueFragmentNames=UniqueFragmentNames;var _error=require("../../error")},{"../../error":29,"babel-runtime/core-js/object/create":50}],172:[function(require,module,exports){"use strict";function duplicateOperationNameMessage(e){return'There can only be one operation named "'+e+'".'}function UniqueOperationNames(){var e=_Object$create(null);return{OperationDefinition:function(r){var a=r.name;if(a){if(e[a.value])return new _error.GraphQLError(duplicateOperationNameMessage(a.value),[e[a.value],a]);e[a.value]=a}}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateOperationNameMessage=duplicateOperationNameMessage,exports.UniqueOperationNames=UniqueOperationNames;var _error=require("../../error")},{"../../error":29,"babel-runtime/core-js/object/create":50}],173:[function(require,module,exports){"use strict";function nonInputTypeOnVarMessage(e,r){return'Variable "$'+e+'" cannot be non-input type "'+r+'".'}function VariablesAreInputTypes(e){return{VariableDefinition:function(r){var n=_utilitiesTypeFromAST.typeFromAST(e.getSchema(),r.type);if(n&&!_typeDefinition.isInputType(n)){var t=r.variable.name.value;return new _error.GraphQLError(nonInputTypeOnVarMessage(t,_languagePrinter.print(r.type)),[r.type])}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.nonInputTypeOnVarMessage=nonInputTypeOnVarMessage,exports.VariablesAreInputTypes=VariablesAreInputTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":29,"../../language/printer":43,"../../type/definition":135,"../../utilities/typeFromAST":150}],174:[function(require,module,exports){"use strict";function badVarPosMessage(e,i,n){return'Variable "$'+e+'" of type "'+i+'" used in position '+('expecting type "'+n+'".')}function VariablesInAllowedPosition(e){var i={},n={};return{visitSpreadFragments:!0,OperationDefinition:function(){i={},n={}},VariableDefinition:function(e){i[e.variable.name.value]=e},FragmentSpread:function(e){return n[e.name.value]?!1:void(n[e.name.value]=!0)},Variable:function(n){var t=n.name.value,r=i[t],o=r&&_utilitiesTypeFromAST.typeFromAST(e.getSchema(),r.type),a=e.getInputType();return o&&a&&!varTypeAllowedForType(effectiveType(o,r),a)?new _error.GraphQLError(badVarPosMessage(t,o,a),[n]):void 0}}}function effectiveType(e,i){return!i.defaultValue||e instanceof _typeDefinition.GraphQLNonNull?e:new _typeDefinition.GraphQLNonNull(e)}function varTypeAllowedForType(e,i){var n=!0;e:for(;n;){var t=e,r=i;if(n=!1,r instanceof _typeDefinition.GraphQLNonNull){if(t instanceof _typeDefinition.GraphQLNonNull){e=t.ofType,i=r.ofType,n=!0;continue e}return!1}if(t instanceof _typeDefinition.GraphQLNonNull)e=t.ofType,i=r,n=!0;else{if(!(t instanceof _typeDefinition.GraphQLList&&r instanceof _typeDefinition.GraphQLList))return t===r;e=t.ofType,i=r.ofType,n=!0}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badVarPosMessage=badVarPosMessage,exports.VariablesInAllowedPosition=VariablesInAllowedPosition;var _error=require("../../error"),_typeDefinition=require("../../type/definition"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":29,"../../type/definition":135,"../../utilities/typeFromAST":150}],175:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _rulesUniqueOperationNames=require("./rules/UniqueOperationNames"),_rulesLoneAnonymousOperation=require("./rules/LoneAnonymousOperation"),_rulesKnownTypeNames=require("./rules/KnownTypeNames"),_rulesFragmentsOnCompositeTypes=require("./rules/FragmentsOnCompositeTypes"),_rulesVariablesAreInputTypes=require("./rules/VariablesAreInputTypes"),_rulesScalarLeafs=require("./rules/ScalarLeafs"),_rulesFieldsOnCorrectType=require("./rules/FieldsOnCorrectType"),_rulesUniqueFragmentNames=require("./rules/UniqueFragmentNames"),_rulesKnownFragmentNames=require("./rules/KnownFragmentNames"),_rulesNoUnusedFragments=require("./rules/NoUnusedFragments"),_rulesPossibleFragmentSpreads=require("./rules/PossibleFragmentSpreads"),_rulesNoFragmentCycles=require("./rules/NoFragmentCycles"),_rulesNoUndefinedVariables=require("./rules/NoUndefinedVariables"),_rulesNoUnusedVariables=require("./rules/NoUnusedVariables"),_rulesKnownDirectives=require("./rules/KnownDirectives"),_rulesKnownArgumentNames=require("./rules/KnownArgumentNames"),_rulesUniqueArgumentNames=require("./rules/UniqueArgumentNames"),_rulesArgumentsOfCorrectType=require("./rules/ArgumentsOfCorrectType"),_rulesProvidedNonNullArguments=require("./rules/ProvidedNonNullArguments"),_rulesDefaultValuesOfCorrectType=require("./rules/DefaultValuesOfCorrectType"),_rulesVariablesInAllowedPosition=require("./rules/VariablesInAllowedPosition"),_rulesOverlappingFieldsCanBeMerged=require("./rules/OverlappingFieldsCanBeMerged"),specifiedRules=[_rulesUniqueOperationNames.UniqueOperationNames,_rulesLoneAnonymousOperation.LoneAnonymousOperation,_rulesKnownTypeNames.KnownTypeNames,_rulesFragmentsOnCompositeTypes.FragmentsOnCompositeTypes,_rulesVariablesAreInputTypes.VariablesAreInputTypes,_rulesScalarLeafs.ScalarLeafs,_rulesFieldsOnCorrectType.FieldsOnCorrectType,_rulesUniqueFragmentNames.UniqueFragmentNames,_rulesKnownFragmentNames.KnownFragmentNames,_rulesNoUnusedFragments.NoUnusedFragments,_rulesPossibleFragmentSpreads.PossibleFragmentSpreads,_rulesNoFragmentCycles.NoFragmentCycles,_rulesNoUndefinedVariables.NoUndefinedVariables,_rulesNoUnusedVariables.NoUnusedVariables,_rulesKnownDirectives.KnownDirectives,_rulesKnownArgumentNames.KnownArgumentNames,_rulesUniqueArgumentNames.UniqueArgumentNames,_rulesArgumentsOfCorrectType.ArgumentsOfCorrectType,_rulesProvidedNonNullArguments.ProvidedNonNullArguments,_rulesDefaultValuesOfCorrectType.DefaultValuesOfCorrectType,_rulesVariablesInAllowedPosition.VariablesInAllowedPosition,_rulesOverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged];exports.specifiedRules=specifiedRules},{"./rules/ArgumentsOfCorrectType":153,"./rules/DefaultValuesOfCorrectType":154,"./rules/FieldsOnCorrectType":155,"./rules/FragmentsOnCompositeTypes":156,"./rules/KnownArgumentNames":157,"./rules/KnownDirectives":158,"./rules/KnownFragmentNames":159,"./rules/KnownTypeNames":160,"./rules/LoneAnonymousOperation":161,"./rules/NoFragmentCycles":162,"./rules/NoUndefinedVariables":163,"./rules/NoUnusedFragments":164,"./rules/NoUnusedVariables":165,"./rules/OverlappingFieldsCanBeMerged":166,"./rules/PossibleFragmentSpreads":167,"./rules/ProvidedNonNullArguments":168,"./rules/ScalarLeafs":169,"./rules/UniqueArgumentNames":170,"./rules/UniqueFragmentNames":171,"./rules/UniqueOperationNames":172,"./rules/VariablesAreInputTypes":173,"./rules/VariablesInAllowedPosition":174}],176:[function(require,module,exports){"use strict";function validate(e,t,r){return _jsutilsInvariant2.default(e,"Must provide schema"),_jsutilsInvariant2.default(t,"Must provide document"),_jsutilsInvariant2.default(e instanceof _typeSchema.GraphQLSchema,"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory."),visitUsingRules(e,t,r||_specifiedRules.specifiedRules)}function visitUsingRules(e,t,r){function i(e,t){_languageVisitor.visit(e,{enter:function r(e,s){n.enter(e);var l;if(e.kind===Kind.FRAGMENT_DEFINITION&&void 0!==s&&t.visitSpreadFragments)return!1;var r=_languageVisitor.getVisitFn(t,!1,e.kind);if(l=r?r.apply(t,arguments):void 0,l&&isError(l)&&(append(u,l),l=!1),void 0===l&&t.visitSpreadFragments&&e.kind===Kind.FRAGMENT_SPREAD){var o=a.getFragment(e.name.value);o&&i(o,t)}return l===!1&&n.leave(e),l},leave:function s(e){var s=_languageVisitor.getVisitFn(t,!0,e.kind),r=s?s.apply(t,arguments):void 0;return r&&isError(r)&&(append(u,r),r=!1),n.leave(e),r}})}var n=new _utilitiesTypeInfo.TypeInfo(e),a=new ValidationContext(e,t,n),u=[],s=r.map(function(e){return e(a)});return s.forEach(function(e){i(t,e)}),u}function isError(e){return Array.isArray(e)?e.every(function(e){return e instanceof _error.GraphQLError}):e instanceof _error.GraphQLError}function append(e,t){Array.isArray(t)?e.push.apply(e,t):e.push(t)}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;
Object.defineProperty(exports,"__esModule",{value:!0}),exports.validate=validate;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_error=require("../error"),_languageVisitor=require("../language/visitor"),_languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeSchema=require("../type/schema"),_utilitiesTypeInfo=require("../utilities/TypeInfo"),_specifiedRules=require("./specifiedRules"),ValidationContext=function(){function e(t,r,i){_classCallCheck(this,e),this._schema=t,this._ast=r,this._typeInfo=i}return _createClass(e,[{key:"getSchema",value:function(){return this._schema}},{key:"getDocument",value:function(){return this._ast}},{key:"getFragment",value:function(e){var t=this._fragments;return t||(this._fragments=t=this.getDocument().definitions.reduce(function(e,t){return t.kind===Kind.FRAGMENT_DEFINITION&&(e[t.name.value]=t),e},{})),t[e]}},{key:"getType",value:function(){return this._typeInfo.getType()}},{key:"getParentType",value:function(){return this._typeInfo.getParentType()}},{key:"getInputType",value:function(){return this._typeInfo.getInputType()}},{key:"getFieldDef",value:function(){return this._typeInfo.getFieldDef()}},{key:"getDirective",value:function(){return this._typeInfo.getDirective()}},{key:"getArgument",value:function(){return this._typeInfo.getArgument()}}]),e}();exports.ValidationContext=ValidationContext},{"../error":29,"../jsutils/invariant":33,"../language/kinds":39,"../language/visitor":45,"../type/schema":140,"../utilities/TypeInfo":141,"./specifiedRules":175,"babel-runtime/helpers/class-call-check":56,"babel-runtime/helpers/create-class":57,"babel-runtime/helpers/interop-require-default":61,"babel-runtime/helpers/interop-require-wildcard":62}],177:[function(require,module,exports){(function(global){(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function a(t,n,i){if(i||"function"==typeof n){i||(i=n,n=null),n=h({},a.defaults,n||{});var l,o,p=n.highlight,u=0;try{l=e.lex(t,n)}catch(c){return i(c)}o=l.length;var g=function(e){if(e)return n.highlight=p,i(e);var t;try{t=r.parse(l,n)}catch(s){e=s}return n.highlight=p,e?i(e):i(null,t)};if(!p||p.length<3)return g();if(delete n.highlight,!o)return g();for(;u<l.length;u++)!function(e){return"code"!==e.type?--o||g():p(e.text,e.lang,function(t,n){return t?g(t):null==n||n===e.text?--o||g():(e.text=n,e.escaped=!0,void(--o||g()))})}(l[u])}else try{return n&&(n=h({},a.defaults,n)),r.parse(e.lex(t,n),n)}catch(c){if(c.message+="\nPlease report this to https://github.com/chjj/marked.",(n||a.defaults).silent)return"<p>An error occured:</p><pre>"+s(c.message+"",!0)+"</pre>";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<h.align.length;u++)/^ *-+: *$/.test(h.align[u])?h.align[u]="right":/^ *:-+: *$/.test(h.align[u])?h.align[u]="center":/^ *:-+ *$/.test(h.align[u])?h.align[u]="left":h.align[u]=null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].split(/ *\| */);this.tokens.push(h)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<h.align.length;u++)/^ *-+: *$/.test(h.align[u])?h.align[u]="right":/^ *:-+: *$/.test(h.align[u])?h.align[u]="center":/^ *:-+ *$/.test(h.align[u])?h.align[u]="left":h.align[u]=null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(h)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var u={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};u._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,u._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+s(t,!0)+'">'+(n?e:s(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:s(e,!0))+"\n</code></pre>"},n.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},n.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},n.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},n.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},n.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},n.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},n.prototype.strong=function(e){return"<strong>"+e+"</strong>"},n.prototype.em=function(e){return"<em>"+e+"</em>"},n.prototype.codespan=function(e){return"<code>"+e+"</code>"},n.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.prototype.del=function(e){return"<del>"+e+"</del>"},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='<a href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"},n.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",s=0;s<t.length;s++)n+=this.renderer.tablecell(this.inline.output(t[s]),{header:!1,align:this.token.align[s]});l+=this.renderer.tablerow(n)}return this.renderer.table(i,l);case"blockquote_start":for(var l="";"blockquote_end"!==this.next().type;)l+=this.tok();return this.renderer.blockquote(l);case"list_start":for(var l="",o=this.token.ordered;"list_end"!==this.next().type;)l+=this.tok();return this.renderer.list(l,o);case"list_item_start":for(var l="";"list_item_end"!==this.next().type;)l+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(l);case"loose_item_start":for(var l="";"list_item_end"!==this.next().type;)l+=this.tok();return this.renderer.listitem(l);case"html":var h=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(h);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},o.exec=o,a.options=a.setOptions=function(e){return h(a.defaults,e),a},a.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new n,xhtml:!1},a.Parser=r,a.parser=r.parse,a.Renderer=n,a.Lexer=e,a.lexer=e.lex,a.InlineLexer=t,a.inlineLexer=t.output,a.parse=a,"undefined"!=typeof module&&"object"==typeof exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):this.marked=a}).call(function(){return this||("undefined"!=typeof window?window:global)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[9])(9)});
|
src/components/Loading.js
|
kunal-mandalia/reactnd-project-readable
|
import React from 'react'
import Halogen from 'halogen'
import '../styles/Loading.css'
const Loading = () => (
<div className='loading'>
<Halogen.ScaleLoader color='grey' size='32px' />
</div>
)
export default Loading
|
local-cli/generator/templates/index.ios.js
|
jeffchienzabinet/react-native
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
class <%= name %> extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('<%= name %>', () => <%= name %>);
|
src/components/BackgroundImage/BackgroundImage.js
|
Zoomdata/nhtsa-dashboard-2.2
|
import styles from './BackgroundImage.css';
import React, { Component } from 'react';
import image from '../../images/car_background@2x.jpg';
export default class BackgroundImage extends Component {
render() {
return <img src={image} className={styles.root}></img>
}
}
|
bitpig/index.android.js
|
kuncloud/bitcoinHelper
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
export default class bitpig extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Double tap R on your keyboard to reload,{'\n'}
Shake or press menu button for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('bitpig', () => bitpig);
|
admin/canvas/_lib/jquery.min.js
|
PixeloSoft/portobuild
|
/*! jQuery v1.8.3 jquery.com | jquery.org/license */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
|
app/components/Thumbnail/index.js
|
dreamweaver1231/react-project
|
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import Img from 'components/Img/Loadable';
import { getIndex, capitalize } from 'utils/util';
function Thumbnail({ name, url }) {
const imgUrl = getIndex(url);
const capitalName = capitalize(name);
return (
<Link to="/detail" className="col p-2">
<div className="card">
<div className="card-header">{capitalName}</div>
<Img className="card-img-top" src={imgUrl} alt="Card cap" />
</div>
</Link>
);
}
Thumbnail.propTypes = {
name: PropTypes.string,
url: PropTypes.string,
};
export default Thumbnail;
|
app/containers/File-container.js
|
Git-Together/GitTogether
|
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as file from '../actions/file-actions.js';
import * as watch from '../actions/watch-actions.js'
import * as ui from '../actions/ui-actions.js';
import PanelPage from '../components/_shared/Panel-Page/Panel-Page-component.js';
function mapStateToProps(state) {
return {
list: state.repo.repoList,
icon: state.file.icon,
panelMessage: state.file.panelMessageArray[state.file.panelMessagePlayIndex] || 'Your current active repo',
panelMessageArray: state.file.panelMessageArray,
selected: state.file.activeFileId,
uiSelected: state.ui.selected,
currentUi: 'file',
activeUi: state.ui.activeUi
};
}
function mapDispatchToProps(dispatch) {
return {
toggleComponent: bindActionCreators(ui.toggleComponent, dispatch),
changeSelected: bindActionCreators(file.changeActiveFileAsync, dispatch),
addSelected: bindActionCreators(watch.watchFile, dispatch),
removeSelected: bindActionCreators(watch.unwatchFile, dispatch),
// getList: bindActionCreators(file.refreshFiles, dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(PanelPage)
|
webpack/components/SelectOrg/SetOrganization.js
|
adamruzicka/katello
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';
import { Form, Button } from 'patternfly-react';
import { withRouter } from 'react-router-dom';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import Select from '../../move_to_pf/Select/Select';
import * as SelectOrgActions from './SelectOrgAction';
import reducer from './SelectOrgReducer';
import { LoadingState } from '../../move_to_pf/LoadingState';
import './SelectOrg.scss';
class SetOrganization extends Component {
constructor(props) {
super(props);
this.onSelectItem = this.onSelectItem.bind(this);
this.onSend = this.onSend.bind(this);
this.state = { disabled: true };
}
componentDidMount() {
this.props.getOrganiztionsList();
}
onSelectItem(e) {
this.setState({
id: e.target.value,
disabled: false,
});
}
onSend() {
this.setState({
disabled: true,
});
}
render() {
const {
list,
loading,
} = this.props;
const { id } = this.state;
return (
<div id="select-org" className="well col-sm-6 col-sm-offset-3">
<LoadingState loading={loading} loadingText={__('Loading')}>
<Form>
<h1 className="text-center">{__('Select an Organization')}</h1>
<p className="text-center">
{__('The page you are attempting to access requires selecting a specific organization.')}
</p>
<p className="text-center">
{__('Please select one from the list below and you will be redirected.')}
</p>
<div className="form-group">
<div className="col-sm-6 col-sm-offset-3">
<Select
value={this.state.id}
placeholder={__('Select an organization')}
id="organization"
name="organization"
className="form-control"
options={list}
onChange={this.onSelectItem}
/>
</div>
<div className="col-sm-3">
<a href={`/organizations/${id}/select`}>
<Button disabled={this.state.disabled} className="btn btn-primary" onClick={this.onSend}>
{__('Select')}
</Button>
</a>
</div>
</div>
</Form>
</LoadingState>
</div>
);
}
}
SetOrganization.propTypes = {
list: PropTypes.arrayOf(PropTypes.object),
loading: PropTypes.bool.isRequired,
history: PropTypes.shape({
push: PropTypes.func,
}).isRequired,
getOrganiztionsList: PropTypes.func.isRequired,
};
SetOrganization.defaultProps = {
list: [],
};
const mapStateToProps = state => ({
orgId: state.katello.setOrganization.currentId,
list: state.katello.setOrganization.list,
loading: state.katello.setOrganization.loading,
});
export const setOrganization = reducer;
const mapDispatchToProps = dispatch =>
bindActionCreators(SelectOrgActions, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(withRouter(SetOrganization));
|
src/components/ProgressBar/index.js
|
LIQIDTechnology/liqid-react-components
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Utils from '../../utils';
import './styles.scss';
/**
* ProgressBar component
* @param {Object} props The props for the component
* @returns {React.Component} Component to be returned
*/
class ProgressBar extends React.Component {
render() {
const {
now,
min,
max,
className
} = this.props;
const classes = classNames('liq_progress-bar', className);
const normalizedNow = Utils.normalizeProgressNumber(now);
return (
<div
className={classes}
role="progressbar"
aria-valuenow={normalizedNow}
aria-valuemin={min}
aria-valuemax={max}
style={{ width: `${Utils.getProgressPercentage(normalizedNow, min, max)}%`}}
/>
);
}
}
ProgressBar.defaultProps = {
min: 0,
max: 100
};
/**
* @memberof ProgressBar
* @namespace props
* @prop {Object} propTypes
*/
ProgressBar.propTypes = {
/**
* @memberof ProgressBar.props
* @prop {Number} min minimum specefied progress value
*/
min: PropTypes.number,
/**
* @memberof ProgressBar.props
* @prop {Number} max maximum specefied progress value
*/
max: PropTypes.number,
/**
* @memberof ProgressBar.props
* @prop {Number} now current progress value
*/
now: PropTypes.number,
/**
* @memberof ProgressBar.props
* @prop {String} className additional class name
*/
className: PropTypes.string
};
export default ProgressBar;
export { ProgressBar };
|
client/routes.js
|
tinycode2333/Bucket
|
import React from 'react';
import {Route} from 'react-router';
import App from './components/App';
import Home from './components/Home';
import Register from './components/Register';
import Login from './components/Login';
import Plan from './components/Plan';
import Emotion from './components/Emotion';
import Work from './components/Work';
import Health from './components/Health';
import BMI from './components/BMI';
import Food from './components/Food';
import Sport from './components/Sport';
export default (
<Route component={App}>
<Route path='/' component={Home} />
<Route path='/register' component={Register} />
<Route path='/login' component={Login} />
<Route path='/plan' component={Plan} />
<Route path='/emotion' component={Emotion} />
<Route path='/work' component={Work} />
<Route path='/health' component={Health} />
<Route path='/health/BMI' component={BMI} />
<Route path='/health/food' component={Food} />
<Route path='/health/sport' component={Sport} />
</Route>
);
|
user_guide/_static/jquery.js
|
itzedu/ci3_with_htaccess
|
/*! jQuery v1.8.3 jquery.com | jquery.org/license */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
|
packages/material-ui/src/Slide/Slide.js
|
Kagami/material-ui
|
// @inheritedComponent Transition
import React from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import EventListener from 'react-event-listener';
import debounce from 'debounce'; // < 1kb payload overhead when lodash/debounce is > 3kb.
import Transition from 'react-transition-group/Transition';
import ownerWindow from '../utils/ownerWindow';
import withTheme from '../styles/withTheme';
import { duration } from '../styles/transitions';
import { reflow, getTransitionProps } from '../transitions/utils';
const GUTTER = 24;
// Translate the node so he can't be seen on the screen.
// Later, we gonna translate back the node to his original location
// with `translate3d(0, 0, 0)`.`
function getTranslateValue(props, node) {
const { direction } = props;
const rect = node.getBoundingClientRect();
let transform;
if (node.fakeTransform) {
transform = node.fakeTransform;
} else {
const computedStyle = ownerWindow(node).getComputedStyle(node);
transform =
computedStyle.getPropertyValue('-webkit-transform') ||
computedStyle.getPropertyValue('transform');
}
let offsetX = 0;
let offsetY = 0;
if (transform && transform !== 'none' && typeof transform === 'string') {
const transformValues = transform
.split('(')[1]
.split(')')[0]
.split(',');
offsetX = parseInt(transformValues[4], 10);
offsetY = parseInt(transformValues[5], 10);
}
if (direction === 'left') {
return `translateX(100vw) translateX(-${rect.left - offsetX}px)`;
}
if (direction === 'right') {
return `translateX(-${rect.left + rect.width + GUTTER - offsetX}px)`;
}
if (direction === 'up') {
return `translateY(100vh) translateY(-${rect.top - offsetY}px)`;
}
// direction === 'down'
return `translateY(-${rect.top + rect.height + GUTTER - offsetY}px)`;
}
export function setTranslateValue(props, node) {
const transform = getTranslateValue(props, node);
if (transform) {
node.style.webkitTransform = transform;
node.style.transform = transform;
}
}
/**
* The Slide transition is used by the [Snackbar](/demos/snackbars/) component.
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
*/
class Slide extends React.Component {
mounted = false;
constructor() {
super();
if (typeof window !== 'undefined') {
this.handleResize = debounce(() => {
// Skip configuration where the position is screen size invariant.
if (this.props.in || this.props.direction === 'down' || this.props.direction === 'right') {
return;
}
if (this.transitionRef) {
setTranslateValue(this.props, this.transitionRef);
}
}, 166); // Corresponds to 10 frames at 60 Hz.
}
}
componentDidMount() {
this.mounted = true;
// state.mounted handle SSR, once the component is mounted, we need
// to properly hide it.
if (!this.props.in) {
// We need to set initial translate values of transition element
// otherwise component will be shown when in=false.
this.updatePosition();
}
}
componentDidUpdate(prevProps) {
if (prevProps.direction !== this.props.direction && !this.props.in) {
// We need to update the position of the drawer when the direction change and
// when it's hidden.
this.updatePosition();
}
}
componentWillUnmount() {
this.handleResize.clear();
}
handleEnter = node => {
setTranslateValue(this.props, node);
reflow(node);
if (this.props.onEnter) {
this.props.onEnter(node);
}
};
handleEntering = node => {
const { theme } = this.props;
const transitionProps = getTransitionProps(this.props, {
mode: 'enter',
});
node.style.webkitTransition = theme.transitions.create('-webkit-transform', {
...transitionProps,
easing: theme.transitions.easing.easeOut,
});
node.style.transition = theme.transitions.create('transform', {
...transitionProps,
easing: theme.transitions.easing.easeOut,
});
node.style.webkitTransform = 'translate(0, 0)';
node.style.transform = 'translate(0, 0)';
if (this.props.onEntering) {
this.props.onEntering(node);
}
};
handleExit = node => {
const { theme } = this.props;
const transitionProps = getTransitionProps(this.props, {
mode: 'exit',
});
node.style.webkitTransition = theme.transitions.create('-webkit-transform', {
...transitionProps,
easing: theme.transitions.easing.sharp,
});
node.style.transition = theme.transitions.create('transform', {
...transitionProps,
easing: theme.transitions.easing.sharp,
});
setTranslateValue(this.props, node);
if (this.props.onExit) {
this.props.onExit(node);
}
};
handleExited = node => {
// No need for transitions when the component is hidden
node.style.webkitTransition = '';
node.style.transition = '';
if (this.props.onExited) {
this.props.onExited(node);
}
};
updatePosition() {
if (this.transitionRef) {
this.transitionRef.style.visibility = 'inherit';
setTranslateValue(this.props, this.transitionRef);
}
}
render() {
const {
children,
direction,
onEnter,
onEntering,
onExit,
onExited,
style: styleProp,
theme,
...other
} = this.props;
let style = {};
// We use this state to handle the server-side rendering.
// We don't know the width of the children ahead of time.
// We need to render it.
if (!this.props.in && !this.mounted) {
style.visibility = 'hidden';
}
style = {
...style,
...styleProp,
...(React.isValidElement(children) ? children.props.style : {}),
};
return (
<EventListener target="window" onResize={this.handleResize}>
<Transition
onEnter={this.handleEnter}
onEntering={this.handleEntering}
onExit={this.handleExit}
onExited={this.handleExited}
appear
style={style}
ref={ref => {
this.transitionRef = ReactDOM.findDOMNode(ref);
}}
{...other}
>
{children}
</Transition>
</EventListener>
);
}
}
Slide.propTypes = {
/**
* A single child content element.
*/
children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
/**
* Direction the child node will enter from.
*/
direction: PropTypes.oneOf(['left', 'right', 'up', 'down']),
/**
* If `true`, show the component; triggers the enter or exit animation.
*/
in: PropTypes.bool,
/**
* @ignore
*/
onEnter: PropTypes.func,
/**
* @ignore
*/
onEntering: PropTypes.func,
/**
* @ignore
*/
onExit: PropTypes.func,
/**
* @ignore
*/
onExited: PropTypes.func,
/**
* @ignore
*/
style: PropTypes.object,
/**
* @ignore
*/
theme: PropTypes.object.isRequired,
/**
* The duration for the transition, in milliseconds.
* You may specify a single timeout for all transitions, or individually with an object.
*/
timeout: PropTypes.oneOfType([
PropTypes.number,
PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number }),
]),
};
Slide.defaultProps = {
direction: 'down',
timeout: {
enter: duration.enteringScreen,
exit: duration.leavingScreen,
},
};
export default withTheme()(Slide);
|
views/huge-app/index.js
|
FeifeiyuM/koa2-boilerplate-yu
|
/*eslint-disable no-unused-vars */
import React from 'react'
import { render } from 'react-dom'
import { Router, browserHistory } from 'react-router'
import stubbedCourses from './stubs/COURSES'
const rootRoute = {
component: 'div',
childRoutes: [ {
path: '/',
component: require('./components/App'),
childRoutes: [
require('./routes/Calendar'),
require('./routes/Course'),
require('./routes/Grades'),
require('./routes/Messages'),
require('./routes/Profile')
]
} ]
}
render(
<Router history={browserHistory} routes={rootRoute} />,
document.getElementById('example')
)
// I've unrolled the recursive directory loop that is happening above to get a
// better idea of just what this huge-apps Router looks like, or just look at the
// file system :)
//
// import { Route } from 'react-router'
// import App from './components/App'
// import Course from './routes/Course/components/Course'
// import AnnouncementsSidebar from './routes/Course/routes/Announcements/components/Sidebar'
// import Announcements from './routes/Course/routes/Announcements/components/Announcements'
// import Announcement from './routes/Course/routes/Announcements/routes/Announcement/components/Announcement'
// import AssignmentsSidebar from './routes/Course/routes/Assignments/components/Sidebar'
// import Assignments from './routes/Course/routes/Assignments/components/Assignments'
// import Assignment from './routes/Course/routes/Assignments/routes/Assignment/components/Assignment'
// import CourseGrades from './routes/Course/routes/Grades/components/Grades'
// import Calendar from './routes/Calendar/components/Calendar'
// import Grades from './routes/Grades/components/Grades'
// import Messages from './routes/Messages/components/Messages'
// render(
// <Router>
// <Route path="/" component={App}>
// <Route path="calendar" component={Calendar} />
// <Route path="course/:courseId" component={Course}>
// <Route path="announcements" components={{
// sidebar: AnnouncementsSidebar,
// main: Announcements
// }}>
// <Route path=":announcementId" component={Announcement} />
// </Route>
// <Route path="assignments" components={{
// sidebar: AssignmentsSidebar,
// main: Assignments
// }}>
// <Route path=":assignmentId" component={Assignment} />
// </Route>
// <Route path="grades" component={CourseGrades} />
// </Route>
// <Route path="grades" component={Grades} />
// <Route path="messages" component={Messages} />
// <Route path="profile" component={Calendar} />
// </Route>
// </Router>,
// document.getElementById('example')
// )
|
src/App.js
|
dennisdijkstra/tic-tac-toe
|
import React from 'react';
import GameModel from './models/GameModel';
import GameListComponent from './components/gamelistcomponent';
import NewGameComponent from './components/newgamecomponent';
import NewPlayerComponent from './components/newplayercomponent';
import Gameboard from './containers/gameboard';
import Scoreboard from './containers/scoreboard';
import Utils from './lib/Utils';
require("style!css!./styles/site.css");
const container = {
display: 'flex',
justifyContent: 'center',
marginTop: 60,
};
const header = {
fontSize: 60,
marginBottom: 0
};
const subheader = {
fontSize: 20,
marginTop: 0
};
const flex1 = {
borderTopStyle: 'solid',
borderTopColor: 'black',
borderTopWidth: 5,
paddingTop: 60,
flex: 1,
marginRight:40
};
const flex2 = {
borderTopStyle: 'solid',
borderTopColor: 'black',
borderTopWidth: 5,
paddingTop: 60,
flex: 2,
marginRight:40,
minWidth: 250
};
const flex3 = {
borderTopStyle: 'solid',
borderTopColor: 'black',
borderTopWidth: 5,
paddingTop: 60,
flex: 2,
minWidth: 250
};
const hello = {
marginTop: 260,
fontSize: 25,
};
class App extends React.Component {
constructor() {
super();
this.games = new GameModel();
this.games.subscribe(this.updateList.bind(this));
this.utils = new Utils();
let playerStorage = this.utils.store("tictactoe.player");
if (playerStorage.length === 0) {
playerStorage = null;
}
this.state = {
x: 0,
o: 0,
winner: "",
currentPlayer: playerStorage,
games: [],
currentGame: null,
tiles: [
'', '', '',
'', '', '',
'', '', ''
]
};
}
createGame() {
this.games.addResource({
playerOne: this.state.currentPlayer,
tiles: this.state.tiles
});
}
joinGame(game) {
console.log("Joining game...");
if (game.playerOne === this.state.currentPlayer || game.playerTwo === this.state.currentPlayer || game.playerTwo === null) {
if (game.playerOne !== this.state.currentPlayer && game.playerTwo !== this.state.currentPlayer) {
console.log("Joining game as player two...");
this.games.save(game, { playerTwo: this.state.currentPlayer });
}
this.setState({
currentGame: game
});
} else {
window.alert("Can't touch this dung dung dung dung");
}
}
updateList() {
this.setState({
games: this.games.resources
});
}
resetWinner(){
this.setState({
winner: ""
})
}
setScore(player) {
console.log("Yeay you win!");
var x = this.state.x;
var o = this.state.o;
if (player === "x") {
x++;
}
else {
o++ ;
}
this.setState({
x: x,
o: o,
winner: player
});
}
setPlayer(player) {
console.log('setPlayer is Called!')
this.setState({
currentPlayer: player
});
this.utils.store("tictactoe.player", player);
}
render() {
let component = this;
return (
<div>
<h1 style={header}>tic tac toe</h1>
<h2 style={subheader}>a react.js game</h2>
<div style={container}>
<div style={flex1}>
<NewPlayerComponent onCreate={this.setPlayer.bind(this)}/>
{ this.state.currentPlayer !== null &&
<p style={hello}>Hi, {this.state.currentPlayer}</p> }
</div>
{ this.state.currentPlayer && <div style={flex2}>
<NewGameComponent onCreate={this.createGame.bind(this)} currentPlayer={this.state.currentPlayer} onSelect={this.joinGame.bind(this)}/>
<GameListComponent games={this.state.games} currentPlayer={this.state.currentPlayer} onSelect={this.joinGame.bind(this)}/>
</div> }
<div>
{ this.state.currentGame !== null && <div style={flex3}>
<Gameboard setScore={this.setScore.bind(this)} resetWinner={this.resetWinner.bind(this)} winner={this.state.winner} />
<Scoreboard player1={this.state.currentGame.playerOne} player2={this.state.currentGame.playerTwo} x={this.state.x} o={this.state.o} winner={this.state.winner} />
</div> }
</div>
</div>
</div>
);
}
}
export default App;
|
app/containers/LanguageProvider/index.js
|
7ruth/PadStats2
|
/*
*
* LanguageProvider
*
* this component connects the redux state language locale to the
* IntlProvider component and i18n messages (loaded from `app/translations`)
*/
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { IntlProvider } from 'react-intl';
import { makeSelectLocale } from './selectors';
export class LanguageProvider extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
render() {
return (
<IntlProvider locale={this.props.locale} key={this.props.locale} messages={this.props.messages[this.props.locale]}>
{React.Children.only(this.props.children)}
</IntlProvider>
);
}
}
LanguageProvider.propTypes = {
locale: React.PropTypes.string,
messages: React.PropTypes.object,
children: React.PropTypes.element.isRequired,
};
const mapStateToProps = createSelector(
makeSelectLocale(),
(locale) => ({ locale })
);
export default connect(mapStateToProps)(LanguageProvider);
|
desktop-application/app/components/home.js
|
santosh-surya/pcb-cnc-machine
|
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import IconMenu from 'material-ui/lib/menus/icon-menu';
import IconButton from 'material-ui/lib/icon-button';
import FontIcon from 'material-ui/lib/font-icon';
import NavigationExpandMoreIcon from 'material-ui/lib/svg-icons/navigation/expand-more';
import MenuItem from 'material-ui/lib/menus/menu-item';
import AppBar from 'material-ui/lib/app-bar';
import DropDownMenu from 'material-ui/lib/DropDownMenu';
import RaisedButton from 'material-ui/lib/raised-button';
import Toolbar from 'material-ui/lib/toolbar/toolbar';
import ToolbarGroup from 'material-ui/lib/toolbar/toolbar-group';
import ToolbarSeparator from 'material-ui/lib/toolbar/toolbar-separator';
import ToolbarTitle from 'material-ui/lib/toolbar/toolbar-title';
import TextField from 'material-ui/lib/text-field';
import SerialMonitor from './serialmonitor';
import GridList from 'material-ui/lib/grid-list/grid-list';
import GridTile from 'material-ui/lib/grid-list/grid-tile';
import List from 'material-ui/lib/lists/list';
import ListItem from 'material-ui/lib/lists/list-item';
var dateFormat = require('dateformat');
export default class Home extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
if (["home"].indexOf(this.props.home.state.menu.page)<0) return (null);
return (
<div>
<List>
{this.props.home.state.logs.map( (log, index) => {
return (
<ListItem innerDivStyle={{paddingTop: 0, paddingBottom: 5, color: log.error?"red" : 'black'}} key={index} primaryText={log.from + " " + dateFormat(log.date,"dd/mm/yyyy HH:MM:ss") + ": "+log.message}/>
)
})}
</List>
</div>
);
}
}
|
draft-js-anchor-plugin/src/components/LinkButton/AddLinkForm.js
|
dagopert/draft-js-plugins
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import unionClassNames from 'union-class-names';
import URLUtils from '../../utils/URLUtils';
import EditorUtils from '../../utils/EditorUtils';
export default class AddLinkForm extends Component {
static propTypes = {
getEditorState: PropTypes.func.isRequired,
setEditorState: PropTypes.func.isRequired,
onOverrideContent: PropTypes.func.isRequired,
theme: PropTypes.object.isRequired,
placeholder: PropTypes.string
};
static defaultProps = {
placeholder: 'Enter a URL and press enter'
};
state = {
value: '',
isInvalid: false
};
componentDidMount() {
this.input.focus();
}
onRef = (node) => { this.input = node; }
onChange = ({ target: { value } }) => {
const nextState = { value };
if (this.state.isInvalid && URLUtils.isUrl(URLUtils.normalizeUrl(value))) {
nextState.isInvalid = false;
}
this.setState(nextState);
};
onClose = () =>
this.props.onOverrideContent(undefined);
onKeyDown = (e) => {
if (e.key === 'Enter') {
e.preventDefault();
this.submit();
} else if (e.key === 'Escape') {
e.preventDefault();
this.onClose();
}
}
submit() {
const { getEditorState, setEditorState } = this.props;
let { value: url } = this.state;
url = URLUtils.normalizeUrl(url);
if (!URLUtils.isUrl(url)) {
this.setState({ isInvalid: true });
} else {
setEditorState(EditorUtils.createLinkAtSelection(getEditorState(), url));
this.input.blur();
this.onClose();
}
}
render() {
const {
theme,
placeholder
} = this.props;
const { value, isInvalid } = this.state;
const className = isInvalid
? unionClassNames(theme.input, theme.inputInvalid)
: theme.input;
return (
<input
className={className}
onBlur={this.onClose}
onChange={this.onChange}
onKeyDown={this.onKeyDown}
placeholder={placeholder}
ref={this.onRef}
type="text"
value={value}
/>
);
}
}
|
src/DataTable/TableHeader.js
|
react-mdl/react-mdl
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Tooltip from '../Tooltip';
const propTypes = {
cellFormatter: PropTypes.func, // Used by the Table component to format the cell content for this "column"
className: PropTypes.string,
name: PropTypes.string.isRequired,
numeric: PropTypes.bool,
onClick: PropTypes.func,
nosort: PropTypes.bool,
sortFn: PropTypes.func, // Used by the Sortable component
tooltip: PropTypes.node
};
const TableHeader = props => {
const { className, name, numeric, onClick,
nosort, tooltip, children, ...otherProps } = props;
// remove unwanted props
// see https://github.com/Hacker0x01/react-datepicker/issues/517#issuecomment-230171426
delete otherProps.cellFormatter;
delete otherProps.sortFn;
const classes = classNames({
'mdl-data-table__cell--non-numeric': !numeric
}, className);
const clickFn = !nosort && onClick
? (e) => onClick(e, name)
: null;
return (
<th className={classes} onClick={clickFn} {...otherProps}>
{!!tooltip ? (
<Tooltip label={tooltip}>{children}</Tooltip>
) : children}
</th>
);
};
TableHeader.propTypes = propTypes;
export default TableHeader;
|
Examples/UIExplorer/AnimatedGratuitousApp/AnExApp.js
|
corbt/react-native
|
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @providesModule AnExApp
* @flow
*/
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {
Animated,
LayoutAnimation,
PanResponder,
StyleSheet,
View,
} = ReactNative;
var AnExSet = require('AnExSet');
var CIRCLE_SIZE = 80;
var CIRCLE_MARGIN = 18;
var NUM_CIRCLES = 30;
class Circle extends React.Component {
state: any;
props: any;
longTimer: number;
_onLongPress: () => void;
_toggleIsActive: () => void;
constructor(props: Object): void {
super();
this._onLongPress = this._onLongPress.bind(this);
this._toggleIsActive = this._toggleIsActive.bind(this);
this.state = {
isActive: false,
pan: new Animated.ValueXY(), // Vectors reduce boilerplate. (step1: uncomment)
pop: new Animated.Value(0), // Initial value. (step2a: uncomment)
};
}
_onLongPress(): void {
var config = {tension: 40, friction: 3};
this.state.pan.addListener((value) => { // Async listener for state changes (step1: uncomment)
this.props.onMove && this.props.onMove(value);
});
Animated.spring(this.state.pop, {
toValue: 1, // Pop to larger size. (step2b: uncomment)
...config, // Reuse config for convenient consistency (step2b: uncomment)
}).start();
this.setState({panResponder: PanResponder.create({
onPanResponderMove: Animated.event([
null, // native event - ignore (step1: uncomment)
{dx: this.state.pan.x, dy: this.state.pan.y}, // links pan to gestureState (step1: uncomment)
]),
onPanResponderRelease: (e, gestureState) => {
LayoutAnimation.easeInEaseOut(); // @flowfixme animates layout update as one batch (step3: uncomment)
Animated.spring(this.state.pop, {
toValue: 0, // Pop back to 0 (step2c: uncomment)
...config,
}).start();
this.setState({panResponder: undefined});
this.props.onMove && this.props.onMove({
x: gestureState.dx + this.props.restLayout.x,
y: gestureState.dy + this.props.restLayout.y,
});
this.props.onDeactivate();
},
})}, () => {
this.props.onActivate();
});
}
render(): ReactElement<any> {
if (this.state.panResponder) {
var handlers = this.state.panResponder.panHandlers;
var dragStyle = { // Used to position while dragging
position: 'absolute', // Hoist out of layout (step1: uncomment)
...this.state.pan.getLayout(), // Convenience converter (step1: uncomment)
};
} else {
handlers = {
onStartShouldSetResponder: () => !this.state.isActive,
onResponderGrant: () => {
this.state.pan.setValue({x: 0, y: 0}); // reset (step1: uncomment)
this.state.pan.setOffset(this.props.restLayout); // offset from onLayout (step1: uncomment)
this.longTimer = setTimeout(this._onLongPress, 300);
},
onResponderRelease: () => {
if (!this.state.panResponder) {
clearTimeout(this.longTimer);
this._toggleIsActive();
}
}
};
}
var animatedStyle: Object = {
shadowOpacity: this.state.pop, // no need for interpolation (step2d: uncomment)
transform: [
{scale: this.state.pop.interpolate({
inputRange: [0, 1],
outputRange: [1, 1.3] // scale up from 1 to 1.3 (step2d: uncomment)
})},
],
};
var openVal = this.props.openVal;
if (this.props.dummy) {
animatedStyle.opacity = 0;
} else if (this.state.isActive) {
var innerOpenStyle = [styles.open, { // (step4: uncomment)
left: openVal.interpolate({inputRange: [0, 1], outputRange: [this.props.restLayout.x, 0]}),
top: openVal.interpolate({inputRange: [0, 1], outputRange: [this.props.restLayout.y, 0]}),
width: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_SIZE, this.props.containerLayout.width]}),
height: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_SIZE, this.props.containerLayout.height]}),
margin: openVal.interpolate({inputRange: [0, 1], outputRange: [CIRCLE_MARGIN, 0]}),
borderRadius: openVal.interpolate({inputRange: [-0.15, 0, 0.5, 1], outputRange: [0, CIRCLE_SIZE / 2, CIRCLE_SIZE * 1.3, 0]}),
}];
}
return (
<Animated.View
onLayout={this.props.onLayout}
style={[styles.dragView, dragStyle, animatedStyle, this.state.isActive ? styles.open : null]}
{...handlers}>
<Animated.View style={[styles.circle, innerOpenStyle]}>
<AnExSet
containerLayout={this.props.containerLayout}
id={this.props.id}
isActive={this.state.isActive}
openVal={this.props.openVal}
onDismiss={this._toggleIsActive}
/>
</Animated.View>
</Animated.View>
);
}
_toggleIsActive(velocity) {
var config = {tension: 30, friction: 7};
if (this.state.isActive) {
Animated.spring(this.props.openVal, {toValue: 0, ...config}).start(() => { // (step4: uncomment)
this.setState({isActive: false}, this.props.onDeactivate);
}); // (step4: uncomment)
} else {
this.props.onActivate();
this.setState({isActive: true, panResponder: undefined}, () => {
// this.props.openVal.setValue(1); // (step4: comment)
Animated.spring(this.props.openVal, {toValue: 1, ...config}).start(); // (step4: uncomment)
});
}
}
}
class AnExApp extends React.Component {
state: any;
props: any;
static title = 'Animated - Gratuitous App';
static description = 'Bunch of Animations - tap a circle to ' +
'open a view with more animations, or longPress and drag to reorder circles.';
_onMove: (position: Point) => void;
constructor(props: any): void {
super(props);
var keys = [];
for (var idx = 0; idx < NUM_CIRCLES; idx++) {
keys.push('E' + idx);
}
this.state = {
keys,
restLayouts: [],
openVal: new Animated.Value(0),
};
this._onMove = this._onMove.bind(this);
}
render(): ReactElement<any> {
var circles = this.state.keys.map((key, idx) => {
if (key === this.state.activeKey) {
return <Circle key={key + 'd'} dummy={true} />;
} else {
if (!this.state.restLayouts[idx]) {
var onLayout = function(index, e) {
var layout = e.nativeEvent.layout;
this.setState((state) => {
state.restLayouts[index] = layout;
return state;
});
}.bind(this, idx);
}
return (
<Circle
key={key}
id={key}
openVal={this.state.openVal}
onLayout={onLayout}
restLayout={this.state.restLayouts[idx]}
onActivate={this.setState.bind(this, {
activeKey: key,
activeInitialLayout: this.state.restLayouts[idx],
})}
/>
);
}
});
if (this.state.activeKey) {
circles.push(
<Animated.View key="dark" style={[styles.darkening, {opacity: this.state.openVal}]} />
);
circles.push(
<Circle
openVal={this.state.openVal}
key={this.state.activeKey}
id={this.state.activeKey}
restLayout={this.state.activeInitialLayout}
containerLayout={this.state.layout}
onMove={this._onMove}
onDeactivate={() => { this.setState({activeKey: undefined}); }}
/>
);
}
return (
<View style={styles.container}>
<View style={styles.grid} onLayout={(e) => this.setState({layout: e.nativeEvent.layout})}>
{circles}
</View>
</View>
);
}
_onMove(position: Point): void {
var newKeys = moveToClosest(this.state, position);
if (newKeys !== this.state.keys) {
LayoutAnimation.easeInEaseOut(); // animates layout update as one batch (step3: uncomment)
this.setState({keys: newKeys});
}
}
}
type Point = {x: number, y: number};
function distance(p1: Point, p2: Point): number {
var dx = p1.x - p2.x;
var dy = p1.y - p2.y;
return dx * dx + dy * dy;
}
function moveToClosest({activeKey, keys, restLayouts}, position) {
var activeIdx = -1;
var closestIdx = activeIdx;
var minDist = Infinity;
var newKeys = [];
keys.forEach((key, idx) => {
var dist = distance(position, restLayouts[idx]);
if (key === activeKey) {
idx = activeIdx;
} else {
newKeys.push(key);
}
if (dist < minDist) {
minDist = dist;
closestIdx = idx;
}
});
if (closestIdx === activeIdx) {
return keys; // nothing changed
} else {
newKeys.splice(closestIdx, 0, activeKey);
return newKeys;
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
},
grid: {
flex: 1,
justifyContent: 'center',
flexDirection: 'row',
flexWrap: 'wrap',
backgroundColor: 'transparent',
},
circle: {
width: CIRCLE_SIZE,
height: CIRCLE_SIZE,
borderRadius: CIRCLE_SIZE / 2,
borderWidth: 1,
borderColor: 'black',
margin: CIRCLE_MARGIN,
overflow: 'hidden',
},
dragView: {
shadowRadius: 10,
shadowColor: 'rgba(0,0,0,0.7)',
shadowOffset: {height: 8},
alignSelf: 'flex-start',
backgroundColor: 'transparent',
},
open: {
position: 'absolute',
left: 0,
top: 0,
right: 0,
bottom: 0,
width: undefined, // unset value from styles.circle
height: undefined, // unset value from styles.circle
borderRadius: 0, // unset value from styles.circle
},
darkening: {
backgroundColor: 'black',
position: 'absolute',
left: 0,
top: 0,
right: 0,
bottom: 0,
},
});
module.exports = AnExApp;
|
src/components/Navigation.js
|
r-portas/robogals-brisbane-pwa
|
import React, { Component } from 'react';
import { Route } from 'react-router-dom';
import ReactGA from 'react-ga';
import Page from './Page';
import PartnersPage from './PartnersPage';
import ExecutivesPage from './ExecutivesPage'
class Navigation extends Component {
constructor(props) {
super(props);
this.renderFrontpage = this.renderFrontpage.bind(this);
this.renderPage = this.renderPage.bind(this);
ReactGA.initialize('UA-79288806-4', {
debug: true
});
}
/**
* Logs all routes to Google Analytics
*/
logPageView() {
ReactGA.set({ page: window.location.pathname + window.location.search });
ReactGA.pageview(window.location.pathname + window.location.search);
}
/**
* Renders the frontpage of the application
*/
renderFrontpage() {
this.logPageView();
const title = '<b>Inspire</b>, <b>engage</b> and <b>empower</b> young women into engineering related fields';
return <Page title={title} slug={'about-us'} isQuote={true}/>;
}
/**
* Render a page
*
* The props is a instance from the React Router
*/
renderPage(props) {
this.logPageView();
const slug = props.match.params.page_slug;
switch (slug) {
case 'executive-team':
return <ExecutivesPage />;
case 'partners':
return <PartnersPage />;
case 'volunteer-events':
return <Page slug={slug} isVolunteerEvents={true}/>;
case 'partner-events':
return <Page slug={slug} isPartnerEvents={true}/>;
case 'about-us':
return this.renderFrontpage();
default:
return <Page slug={slug} />;
}
}
render() {
return (
<div>
<Route exact strict path="/" render={this.renderFrontpage}/>
<Route path="/:page_slug" render={this.renderPage} />
</div>
);
}
}
export default Navigation;
|
src/svg-icons/device/battery-charging-30.js
|
andrejunges/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceBatteryCharging30 = (props) => (
<SvgIcon {...props}>
<path fillOpacity=".3" d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v9.17h2L13 7v5.5h2l-1.07 2H17V5.33C17 4.6 16.4 4 15.67 4z"/><path d="M11 20v-5.5H7v6.17C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V14.5h-3.07L11 20z"/>
</SvgIcon>
);
DeviceBatteryCharging30 = pure(DeviceBatteryCharging30);
DeviceBatteryCharging30.displayName = 'DeviceBatteryCharging30';
DeviceBatteryCharging30.muiName = 'SvgIcon';
export default DeviceBatteryCharging30;
|
ajax/libs/jquery-tools/1.2.7/jquery.tools.min.js
|
iwdmb/cdnjs
|
/*!
* jQuery Tools v1.2.7 - The missing UI library for the Web
*
* dateinput/dateinput.js
* overlay/overlay.js
* overlay/overlay.apple.js
* rangeinput/rangeinput.js
* scrollable/scrollable.js
* scrollable/scrollable.autoscroll.js
* scrollable/scrollable.navigator.js
* tabs/tabs.js
* tabs/tabs.slideshow.js
* toolbox/toolbox.expose.js
* toolbox/toolbox.flashembed.js
* toolbox/toolbox.history.js
* toolbox/toolbox.mousewheel.js
* tooltip/tooltip.js
* tooltip/tooltip.dynamic.js
* tooltip/tooltip.slide.js
* validator/validator.js
*
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
*
* http://flowplayer.org/tools/
*
* jquery.event.wheel.js - rev 1
* Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
* Liscensed under the MIT License (MIT-LICENSE.txt)
* http://www.opensource.org/licenses/mit-license.php
* Created: 2008-07-01 | Updated: 2008-07-14
*
* -----
*
*/
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
(function(d,D){function M(b,a){b=""+b;for(a=a||2;b.length<a;)b="0"+b;return b}function N(b,a,d,g){var f=a.getDate(),l=a.getDay(),k=a.getMonth(),c=a.getFullYear(),f={d:f,dd:M(f),ddd:r[g].shortDays[l],dddd:r[g].days[l],m:k+1,mm:M(k+1),mmm:r[g].shortMonths[k],mmmm:r[g].months[k],yy:(""+c).slice(2),yyyy:c},b=O[b](d,a,f,g);return S.html(b).html()}function l(b){return parseInt(b,10)}function P(b,a){return b.getFullYear()===a.getFullYear()&&b.getMonth()==a.getMonth()&&b.getDate()==a.getDate()}function w(b){if(b!==
D){if(b.constructor==Date)return b;if("string"==typeof b){var a=b.split("-");if(3==a.length)return new Date(l(a[0]),l(a[1])-1,l(a[2]));if(!/^-?\d+$/.test(b))return;b=l(b)}a=new Date;a.setDate(a.getDate()+b);return a}}function T(b,a){function j(a,t,c){o=a;z=a.getFullYear();B=a.getMonth();A=a.getDate();c||(c=d.Event("api"));"click"==c.type&&!d.browser.msie&&b.focus();c.type="beforeChange";C.trigger(c,[a]);c.isDefaultPrevented()||(b.val(N(t.formatter,a,t.format,t.lang)),c.type="change",C.trigger(c),
b.data("date",a),f.hide(c))}function g(a){a.type="onShow";C.trigger(a);d(document).on("keydown.d",function(a){if(a.ctrlKey)return!0;var e=a.keyCode;if(8==e||46==e)return b.val(""),f.hide(a);if(27==e||9==e)return f.hide(a);if(0<=d(Q).index(e)){if(!u)return f.show(a),a.preventDefault();var h=d("#"+c.weeks+" a"),j=d("."+c.focus),g=h.index(j);j.removeClass(c.focus);if(74==e||40==e)g+=7;else if(75==e||38==e)g-=7;else if(76==e||39==e)g+=1;else if(72==e||37==e)g-=1;41<g?(f.addMonth(),j=d("#"+c.weeks+" a:eq("+
(g-42)+")")):0>g?(f.addMonth(-1),j=d("#"+c.weeks+" a:eq("+(g+42)+")")):j=h.eq(g);j.addClass(c.focus);return a.preventDefault()}if(34==e)return f.addMonth();if(33==e)return f.addMonth(-1);if(36==e)return f.today();13==e&&(d(a.target).is("select")||d("."+c.focus).click());return 0<=d([16,17,18,9]).index(e)});d(document).on("click.d",function(a){var e=a.target;!d(e).parents("#"+c.root).length&&e!=b[0]&&(!E||e!=E[0])&&f.hide(a)})}var f=this,q=new Date,k=q.getFullYear(),c=a.css,F=r[a.lang],i=d("#"+c.root),
K=i.find("#"+c.title),E,G,H,z,B,A,o=b.attr("data-value")||a.value||b.val(),n=b.attr("min")||a.min,p=b.attr("max")||a.max,u,I;0===n&&(n="0");o=w(o)||q;n=w(n||new Date(k+a.yearRange[0],1,1));p=w(p||new Date(k+a.yearRange[1]+1,1,-1));if(!F)throw"Dateinput: invalid language: "+a.lang;"date"==b.attr("type")&&(I=b.clone(),k=I.wrap("<div/>").parent().html(),k=d(k.replace(/type/i,"type=text data-orig-type")),a.value&&k.val(a.value),b.replaceWith(k),b=k);b.addClass(c.input);var C=b.add(f);if(!i.length){i=
d("<div><div><a/><div/><a/></div><div><div/><div/></div></div>").hide().css({position:"absolute"}).attr("id",c.root);i.children().eq(0).attr("id",c.head).end().eq(1).attr("id",c.body).children().eq(0).attr("id",c.days).end().eq(1).attr("id",c.weeks).end().end().end().find("a").eq(0).attr("id",c.prev).end().eq(1).attr("id",c.next);K=i.find("#"+c.head).find("div").attr("id",c.title);if(a.selectors){var x=d("<select/>").attr("id",c.month),y=d("<select/>").attr("id",c.year);K.html(x.add(y))}for(var k=
i.find("#"+c.days),L=0;7>L;L++)k.append(d("<span/>").text(F.shortDays[(L+a.firstDay)%7]));d("body").append(i)}a.trigger&&(E=d("<a/>").attr("href","#").addClass(c.trigger).click(function(e){a.toggle?f.toggle():f.show();return e.preventDefault()}).insertAfter(b));var J=i.find("#"+c.weeks),y=i.find("#"+c.year),x=i.find("#"+c.month);d.extend(f,{show:function(e){if(!b.attr("readonly")&&!b.attr("disabled")&&!u){e=e||d.Event();e.type="onBeforeShow";C.trigger(e);if(!e.isDefaultPrevented()){d.each(R,function(){this.hide()});
u=true;x.off("change").change(function(){f.setValue(l(y.val()),l(d(this).val()))});y.off("change").change(function(){f.setValue(l(d(this).val()),l(x.val()))});G=i.find("#"+c.prev).off("click").click(function(){G.hasClass(c.disabled)||f.addMonth(-1);return false});H=i.find("#"+c.next).off("click").click(function(){H.hasClass(c.disabled)||f.addMonth();return false});f.setValue(o);var t=b.offset();if(/iPad/i.test(navigator.userAgent))t.top=t.top-d(window).scrollTop();i.css({top:t.top+b.outerHeight({margins:true})+
a.offset[0],left:t.left+a.offset[1]});if(a.speed)i.show(a.speed,function(){g(e)});else{i.show();g(e)}return f}}},setValue:function(e,b,g){var h=l(b)>=-1?new Date(l(e),l(b),l(g==D||isNaN(g)?1:g)):e||o;h<n?h=n:h>p&&(h=p);typeof e=="string"&&(h=w(e));e=h.getFullYear();b=h.getMonth();g=h.getDate();if(b==-1){b=11;e--}else if(b==12){b=0;e++}if(!u){j(h,a);return f}B=b;z=e;A=g;var g=(new Date(e,b,1-a.firstDay)).getDay(),i=(new Date(e,b+1,0)).getDate(),k=(new Date(e,b-1+1,0)).getDate(),r;if(a.selectors){x.empty();
d.each(F.months,function(a,b){n<new Date(e,a+1,1)&&p>new Date(e,a,0)&&x.append(d("<option/>").html(b).attr("value",a))});y.empty();for(var h=q.getFullYear(),m=h+a.yearRange[0];m<h+a.yearRange[1];m++)n<new Date(m+1,0,1)&&p>new Date(m,0,0)&&y.append(d("<option/>").text(m));x.val(b);y.val(e)}else K.html(F.months[b]+" "+e);J.empty();G.add(H).removeClass(c.disabled);for(var m=!g?-7:0,s,v;m<(!g?35:42);m++){s=d("<a/>");if(m%7===0){r=d("<div/>").addClass(c.week);J.append(r)}if(m<g){s.addClass(c.off);v=k-
g+m+1;h=new Date(e,b-1,v)}else if(m>=g+i){s.addClass(c.off);v=m-i-g+1;h=new Date(e,b+1,v)}else{v=m-g+1;h=new Date(e,b,v);P(o,h)?s.attr("id",c.current).addClass(c.focus):P(q,h)&&s.attr("id",c.today)}n&&h<n&&s.add(G).addClass(c.disabled);p&&h>p&&s.add(H).addClass(c.disabled);s.attr("href","#"+v).text(v).data("date",h);r.append(s)}J.find("a").click(function(b){var e=d(this);if(!e.hasClass(c.disabled)){d("#"+c.current).removeAttr("id");e.attr("id",c.current);j(e.data("date"),a,b)}return false});c.sunday&&
J.find("."+c.week).each(function(){var b=a.firstDay?7-a.firstDay:0;d(this).children().slice(b,b+1).addClass(c.sunday)});return f},setMin:function(a,b){n=w(a);b&&o<n&&f.setValue(n);return f},setMax:function(a,b){p=w(a);b&&o>p&&f.setValue(p);return f},today:function(){return f.setValue(q)},addDay:function(a){return this.setValue(z,B,A+(a||1))},addMonth:function(a){var a=B+(a||1),b=(new Date(z,a+1,0)).getDate();return this.setValue(z,a,A<=b?A:b)},addYear:function(a){return this.setValue(z+(a||1),B,A)},
destroy:function(){b.add(document).off("click.d keydown.d");i.add(E).remove();b.removeData("dateinput").removeClass(c.input);I&&b.replaceWith(I)},hide:function(a){if(u){a=d.Event();a.type="onHide";C.trigger(a);if(a.isDefaultPrevented())return;d(document).off("click.d keydown.d");i.hide();u=false}return f},toggle:function(){return f.isOpen()?f.hide():f.show()},getConf:function(){return a},getInput:function(){return b},getCalendar:function(){return i},getValue:function(b){return b?N(a.formatter,o,b,
a.lang):o},isOpen:function(){return u}});d.each(["onBeforeShow","onShow","change","onHide"],function(b,c){if(d.isFunction(a[c]))d(f).on(c,a[c]);f[c]=function(a){if(a)d(f).on(c,a);return f}});a.editable||b.on("focus.d click.d",f.show).keydown(function(a){var c=a.keyCode;if(!u&&d(Q).index(c)>=0){f.show(a);return a.preventDefault()}(c==8||c==46)&&b.val("");return a.shiftKey||a.ctrlKey||a.altKey||c==9?true:a.preventDefault()});w(b.val())&&j(o,a)}d.tools=d.tools||{version:"@VERSION"};var R=[],O={},q,Q=
[75,76,38,39,74,72,40,37],r={};q=d.tools.dateinput={conf:{format:"mm/dd/yy",formatter:"default",selectors:!1,yearRange:[-5,5],lang:"en",offset:[0,0],speed:0,firstDay:0,min:D,max:D,trigger:0,toggle:0,editable:0,css:{prefix:"cal",input:"date",root:0,head:0,title:0,prev:0,next:0,month:0,year:0,days:0,body:0,weeks:0,today:0,current:0,week:0,off:0,sunday:0,focus:0,disabled:0,trigger:0}},addFormatter:function(b,a){O[b]=a},localize:function(b,a){d.each(a,function(b,d){a[b]=d.split(",")});r[b]=a}};q.localize("en",
{months:"January,February,March,April,May,June,July,August,September,October,November,December",shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",days:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",shortDays:"Sun,Mon,Tue,Wed,Thu,Fri,Sat"});var S=d("<a/>");q.addFormatter("default",function(b,a,d){return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*'/g,function(a){return a in d?d[a]:a})});q.addFormatter("prefixed",function(b,a,d){return b.replace(/%(d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*')/g,
function(a,b){return b in d?d[b]:a})});d.expr[":"].date=function(b){var a=b.getAttribute("type");return a&&"date"==a||!!d(b).data("dateinput")};d.fn.dateinput=function(b){if(this.data("dateinput"))return this;b=d.extend(!0,{},q.conf,b);d.each(b.css,function(a,d){!d&&"prefix"!=a&&(b.css[a]=(b.css.prefix||"")+(d||a))});var a;this.each(function(){var j=new T(d(this),b);R.push(j);j=j.getInput().data("dateinput",j);a=a?a.add(j):j});return a?a:this}})(jQuery);(function(b){function m(a,c){var d=this,h=a.add(d),n=b(window),e,f,k,g=b.tools.expose&&(c.mask||c.expose),l=Math.random().toString().slice(10);g&&("string"==typeof g&&(g={color:g}),g.closeOnClick=g.closeOnEsc=!1);var i=c.target||a.attr("rel");f=i?b(i):a;if(!f.length)throw"Could not find Overlay: "+i;a&&-1==a.index(f)&&a.click(function(b){d.load(b);return b.preventDefault()});b.extend(d,{load:function(a){if(d.isOpened())return d;var p=o[c.effect];if(!p)throw'Overlay: cannot find effect : "'+c.effect+
'"';c.oneInstance&&b.each(q,function(){this.close(a)});a=a||b.Event();a.type="onBeforeLoad";h.trigger(a);if(a.isDefaultPrevented())return d;k=true;g&&b(f).expose(g);var j=c.top,e=c.left,i=f.outerWidth({margin:true}),m=f.outerHeight({margin:true});typeof j=="string"&&(j=j=="center"?Math.max((n.height()-m)/2,0):parseInt(j,10)/100*n.height());e=="center"&&(e=Math.max((n.width()-i)/2,0));p[0].call(d,{top:j,left:e},function(){if(k){a.type="onLoad";h.trigger(a)}});if(g&&c.closeOnClick)b.mask.getMask().one("click",
d.close);if(c.closeOnClick)b(document).on("click."+l,function(a){b(a.target).parents(f).length||d.close(a)});if(c.closeOnEsc)b(document).on("keydown."+l,function(a){a.keyCode==27&&d.close(a)});return d},close:function(a){if(!d.isOpened())return d;a=a||b.Event();a.type="onBeforeClose";h.trigger(a);if(!a.isDefaultPrevented()){k=false;o[c.effect][1].call(d,function(){a.type="onClose";h.trigger(a)});b(document).off("click."+l+" keydown."+l);g&&b.mask.close();return d}},getOverlay:function(){return f},
getTrigger:function(){return a},getClosers:function(){return e},isOpened:function(){return k},getConf:function(){return c}});b.each(["onBeforeLoad","onStart","onLoad","onBeforeClose","onClose"],function(a,e){if(b.isFunction(c[e]))b(d).on(e,c[e]);d[e]=function(a){if(a)b(d).on(e,a);return d}});e=f.find(c.close||".close");!e.length&&!c.close&&(e=b('<a class="close"></a>'),f.prepend(e));e.click(function(a){d.close(a)});c.load&&d.load()}b.tools=b.tools||{version:"@VERSION"};b.tools.overlay={addEffect:function(a,
b,d){o[a]=[b,d]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",fixed:!b.browser.msie||6<b.browser.version,left:"center",load:!1,mask:null,oneInstance:!0,speed:"normal",target:null,top:"10%"}};var q=[],o={};b.tools.overlay.addEffect("default",function(a,c){var d=this.getConf(),h=b(window);d.fixed||(a.top+=h.scrollTop(),a.left+=h.scrollLeft());a.position=d.fixed?"fixed":"absolute";this.getOverlay().css(a).fadeIn(d.speed,c)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,
a)});b.fn.overlay=function(a){var c=this.data("overlay");if(c)return c;b.isFunction(a)&&(a={onBeforeLoad:a});a=b.extend(!0,{},b.tools.overlay.conf,a);this.each(function(){c=new m(b(this),a);q.push(c);b(this).data("overlay",c)});return a.api?c:this}})(jQuery);(function(h){function l(a){var e=a.offset();return{top:e.top+a.height()/2,left:e.left+a.width()/2}}var i=h.tools.overlay,f=h(window);h.extend(i.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});i.addEffect("apple",function(a,e){var b=this.getOverlay(),d=this.getConf(),g=this.getTrigger(),i=this,m=b.outerWidth({margin:!0}),c=b.data("img"),n=d.fixed?"fixed":"absolute";if(!c){c=b.css("backgroundImage");if(!c)throw"background-image CSS property not set for overlay";c=c.slice(c.indexOf("(")+
1,c.indexOf(")")).replace(/\"/g,"");b.css("backgroundImage","none");c=h('<img src="'+c+'"/>');c.css({border:0,display:"none"}).width(m);h("body").append(c);b.data("img",c)}var j=d.start.top||Math.round(f.height()/2),k=d.start.left||Math.round(f.width()/2);g&&(g=l(g),j=g.top,k=g.left);d.fixed?(j-=f.scrollTop(),k-=f.scrollLeft()):(a.top+=f.scrollTop(),a.left+=f.scrollLeft());c.css({position:"absolute",top:j,left:k,width:0,zIndex:d.zIndex}).show();a.position=n;b.css(a);c.animate({top:a.top,left:a.left,
width:m},d.speed,function(){b.css("zIndex",d.zIndex+1).fadeIn(d.fadeInSpeed,function(){i.isOpened()&&!h(this).index(b)?e.call():b.hide()})}).css("position",n)},function(a){var e=this.getOverlay().hide(),b=this.getConf(),d=this.getTrigger(),e=e.data("img"),g={top:b.start.top,left:b.start.left,width:0};d&&h.extend(g,l(d));b.fixed&&e.css({position:"absolute"}).animate({top:"+="+f.scrollTop(),left:"+="+f.scrollLeft()},0);e.animate(g,b.closeSpeed,a)})})(jQuery);(function(a){function z(c,b){var a=Math.pow(10,b);return Math.round(c*a)/a}function m(c,b){var a=parseInt(c.css(b),10);return a?a:(a=c[0].currentStyle)&&a.width&&parseInt(a.width,10)}function y(a){return(a=a.data("events"))&&a.onSlide}function A(c,b){function e(a,d,f,e){void 0===f?f=d/i*v:e&&(f-=b.min);s&&(f=Math.round(f/s)*s);if(void 0===d||s)d=f*i/v;if(isNaN(f))return g;d=Math.max(0,Math.min(d,i));f=d/i*v;if(e||!n)f+=b.min;n&&(e?d=i-d:f=b.max-f);var f=z(f,r),h="click"==a.type;if(u&&void 0!==k&&
!h&&(a.type="onSlide",w.trigger(a,[f,d]),a.isDefaultPrevented()))return g;e=h?b.speed:0;h=h?function(){a.type="change";w.trigger(a,[f])}:null;n?(j.animate({top:d},e,h),b.progress&&x.animate({height:i-d+j.height()/2},e)):(j.animate({left:d},e,h),b.progress&&x.animate({width:d+j.width()/2},e));k=f;c.val(f);return g}function o(){(n=b.vertical||m(h,"height")>m(h,"width"))?(i=m(h,"height")-m(j,"height"),l=h.offset().top+i):(i=m(h,"width")-m(j,"width"),l=h.offset().left)}function q(){o();g.setValue(void 0!==
b.value?b.value:b.min)}var g=this,p=b.css,h=a("<div><div/><a href='#'/></div>").data("rangeinput",g),n,k,l,i;c.before(h);var j=h.addClass(p.slider).find("a").addClass(p.handle),x=h.find("div").addClass(p.progress);a.each(["min","max","step","value"],function(a,d){var f=c.attr(d);parseFloat(f)&&(b[d]=parseFloat(f,10))});var v=b.max-b.min,s="any"==b.step?0:b.step,r=b.precision;void 0===r&&(r=s.toString().split("."),r=2===r.length?r[1].length:0);if("range"==c.attr("type")){var t=c.clone().wrap("<div/>").parent().html(),
t=a(t.replace(/type/i,"type=text data-orig-type"));t.val(b.value);c.replaceWith(t);c=t}c.addClass(p.input);var w=a(g).add(c),u=!0;a.extend(g,{getValue:function(){return k},setValue:function(b,d){o();return e(d||a.Event("api"),void 0,b,true)},getConf:function(){return b},getProgress:function(){return x},getHandle:function(){return j},getInput:function(){return c},step:function(c,d){d=d||a.Event();g.setValue(k+(b.step=="any"?1:b.step)*(c||1),d)},stepUp:function(a){return g.step(a||1)},stepDown:function(a){return g.step(-a||
-1)}});a.each(["onSlide","change"],function(c,d){if(a.isFunction(b[d]))a(g).on(d,b[d]);g[d]=function(b){if(b)a(g).on(d,b);return g}});j.drag({drag:!1}).on("dragStart",function(){o();u=y(a(g))||y(c)}).on("drag",function(a,b,f){if(c.is(":disabled"))return false;e(a,n?b:f)}).on("dragEnd",function(a){if(!a.isDefaultPrevented()){a.type="change";w.trigger(a,[k])}}).click(function(a){return a.preventDefault()});h.click(function(a){if(c.is(":disabled")||a.target==j[0])return a.preventDefault();o();var b=
n?j.height()/2:j.width()/2;e(a,n?i-l-b+a.pageY:a.pageX-l-b)});b.keyboard&&c.keydown(function(b){if(!c.attr("readonly")){var d=b.keyCode,f=a([75,76,38,33,39]).index(d)!=-1,e=a([74,72,40,34,37]).index(d)!=-1;if((f||e)&&!b.shiftKey&&!b.altKey&&!b.ctrlKey){f?g.step(d==33?10:1,b):e&&g.step(d==34?-10:-1,b);return b.preventDefault()}}});c.blur(function(b){var c=a(this).val();c!==k&&g.setValue(c,b)});a.extend(c[0],{stepUp:g.stepUp,stepDown:g.stepDown});q();i||a(window).load(q)}a.tools=a.tools||{version:"@VERSION"};
var u;u=a.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:void 0,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var q,l;a.fn.drag=function(c){document.ondragstart=function(){return!1};c=a.extend({x:!0,y:!0,drag:!0},c);q=q||a(document).on("mousedown mouseup",function(b){var e=a(b.target);if("mousedown"==b.type&&e.data("drag")){var o=e.position(),m=b.pageX-o.left,g=b.pageY-o.top,p=!0;q.on("mousemove.drag",
function(a){var b=a.pageX-m,a=a.pageY-g,k={};c.x&&(k.left=b);c.y&&(k.top=a);p&&(e.trigger("dragStart"),p=!1);c.drag&&e.css(k);e.trigger("drag",[a,b]);l=e});b.preventDefault()}else try{l&&l.trigger("dragEnd")}finally{q.off("mousemove.drag"),l=null}});return this.data("drag",!0)};a.expr[":"].range=function(c){var b=c.getAttribute("type");return b&&"range"==b||!!a(c).filter("input").data("rangeinput")};a.fn.rangeinput=function(c){if(this.data("rangeinput"))return this;var c=a.extend(!0,{},u.conf,c),
b;this.each(function(){var e=new A(a(this),a.extend(!0,{},c)),e=e.getInput().data("rangeinput",e);b=b?b.add(e):e});return b?b:this}})(jQuery);(function(d){function p(f,b){var c=d(b);return 2>c.length?c:f.parent().find(b)}function u(f,b){var c=this,n=f.add(c),g=f.children(),l=0,j=b.vertical;k||(k=c);1<g.length&&(g=d(b.items,f));1<b.size&&(b.circular=!1);d.extend(c,{getConf:function(){return b},getIndex:function(){return l},getSize:function(){return c.getItems().size()},getNaviButtons:function(){return h.add(m)},getRoot:function(){return f},getItemWrap:function(){return g},getItems:function(){return g.find(b.item).not("."+b.clonedClass)},
move:function(a,b){return c.seekTo(l+a,b)},next:function(a){return c.move(b.size,a)},prev:function(a){return c.move(-b.size,a)},begin:function(a){return c.seekTo(0,a)},end:function(a){return c.seekTo(c.getSize()-1,a)},focus:function(){return k=c},addItem:function(a){a=d(a);if(b.circular){g.children().last().before(a);g.children().first().replaceWith(a.clone().addClass(b.clonedClass))}else{g.append(a);m.removeClass("disabled")}n.trigger("onAddItem",[a]);return c},seekTo:function(a,e,f){a.jquery||(a=
a*1);if(b.circular&&a===0&&l==-1&&e!==0||!b.circular&&a<0||a>c.getSize()||a<-1)return c;var i=a;a.jquery?a=c.getItems().index(a):i=c.getItems().eq(a);var h=d.Event("onBeforeSeek");if(!f){n.trigger(h,[a,e]);if(h.isDefaultPrevented()||!i.length)return c}i=j?{top:-i.position().top}:{left:-i.position().left};l=a;k=c;if(e===void 0)e=b.speed;g.animate(i,e,b.easing,f||function(){n.trigger("onSeek",[a])});return c}});d.each(["onBeforeSeek","onSeek","onAddItem"],function(a,e){if(d.isFunction(b[e]))d(c).on(e,
b[e]);c[e]=function(a){if(a)d(c).on(e,a);return c}});if(b.circular){var q=c.getItems().slice(-1).clone().prependTo(g),r=c.getItems().eq(1).clone().appendTo(g);q.add(r).addClass(b.clonedClass);c.onBeforeSeek(function(a,b,d){if(!a.isDefaultPrevented()){if(b==-1){c.seekTo(q,d,function(){c.end(0)});return a.preventDefault()}b==c.getSize()&&c.seekTo(r,d,function(){c.begin(0)})}});var o=f.parents().add(f).filter(function(){if(d(this).css("display")==="none")return true});o.length?(o.show(),c.seekTo(0,0,
function(){}),o.hide()):c.seekTo(0,0,function(){})}var h=p(f,b.prev).click(function(a){a.stopPropagation();c.prev()}),m=p(f,b.next).click(function(a){a.stopPropagation();c.next()});b.circular||(c.onBeforeSeek(function(a,e){setTimeout(function(){if(!a.isDefaultPrevented()){h.toggleClass(b.disabledClass,e<=0);m.toggleClass(b.disabledClass,e>=c.getSize()-1)}},1)}),b.initialIndex||h.addClass(b.disabledClass));2>c.getSize()&&h.add(m).addClass(b.disabledClass);b.mousewheel&&d.fn.mousewheel&&f.mousewheel(function(a,
e){if(b.mousewheel){c.move(e<0?1:-1,b.wheelSpeed||50);return false}});if(b.touch){var s,t;g[0].ontouchstart=function(a){a=a.touches[0];s=a.clientX;t=a.clientY};g[0].ontouchmove=function(a){if(a.touches.length==1&&!g.is(":animated")){var b=a.touches[0],d=s-b.clientX,b=t-b.clientY;c[j&&b>0||!j&&d>0?"next":"prev"]();a.preventDefault()}}}if(b.keyboard)d(document).on("keydown.scrollable",function(a){if(b.keyboard&&!a.altKey&&!a.ctrlKey&&!a.metaKey&&!d(a.target).is(":input")&&!(b.keyboard!="static"&&k!=
c)){var e=a.keyCode;if(j&&(e==38||e==40)){c.move(e==38?-1:1);return a.preventDefault()}if(!j&&(e==37||e==39)){c.move(e==37?-1:1);return a.preventDefault()}}});b.initialIndex&&c.seekTo(b.initialIndex,0,function(){})}d.tools=d.tools||{version:"@VERSION"};d.tools.scrollable={conf:{activeClass:"active",circular:!1,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:"> *",items:".items",keyboard:!0,mousewheel:!1,next:".next",prev:".prev",size:1,speed:400,vertical:!1,touch:!0,
wheelSpeed:0}};var k;d.fn.scrollable=function(f){var b=this.data("scrollable");if(b)return b;f=d.extend({},d.tools.scrollable.conf,f);this.each(function(){b=new u(d(this),f);d(this).data("scrollable",b)});return f.api?b:this}})(jQuery);(function(d){var h=d.tools.scrollable;h.autoscroll={conf:{autoplay:!0,interval:3E3,autopause:!0}};d.fn.autoscroll=function(b){"number"==typeof b&&(b={interval:b});var e=d.extend({},h.autoscroll.conf,b),i;this.each(function(){function b(){c&&clearTimeout(c);c=setTimeout(function(){a.next()},e.interval)}var a=d(this).data("scrollable"),f=a.getRoot(),c,g=!1;a&&(i=a);a.play=function(){c||(g=!1,f.on("onSeek",b),b())};a.pause=function(){c=clearTimeout(c);f.off("onSeek",b)};a.resume=function(){g||a.play()};
a.stop=function(){g=!0;a.pause()};e.autopause&&f.add(a.getNaviButtons()).hover(a.pause,a.resume);e.autoplay&&a.play()});return e.api?i:this}})(jQuery);(function(b){function m(a,f){var d=b(f);return 2>d.length?d:a.parent().find(f)}var g=b.tools.scrollable;g.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:!1,idPrefix:null,history:!1}};b.fn.navigator=function(a){"string"==typeof a&&(a={navi:a});var a=b.extend({},g.navigator.conf,a),f;this.each(function(){function d(){return i.find(a.naviItem||"> *")}function g(h){var e=b("<"+(a.naviItem||"a")+"/>").click(function(a){b(this);c.seekTo(h);a.preventDefault();j&&history.pushState({i:h},
"")});0===h&&e.addClass(k);a.indexed&&e.text(h+1);a.idPrefix&&e.attr("id",a.idPrefix+h);return e.appendTo(i)}var c=b(this).data("scrollable"),i=a.navi.jquery?a.navi:m(c.getRoot(),a.navi),n=c.getNaviButtons(),k=a.activeClass,j=a.history&&!!history.pushState,l=c.getConf().size;c&&(f=c);c.getNaviButtons=function(){return n.add(i)};j&&(history.pushState({i:0},""),b(window).on("popstate",function(a){(a=a.originalEvent.state)&&c.seekTo(a.i)}));d().length?d().each(function(a){b(this).click(function(e){b(this);
c.seekTo(a);e.preventDefault();j&&history.pushState({i:a},"")})}):b.each(c.getItems(),function(a){a%l==0&&g(a)});c.onBeforeSeek(function(a,c){setTimeout(function(){if(!a.isDefaultPrevented()){var b=c/l;d().eq(b).length&&d().removeClass(k).eq(b).addClass(k)}},1)});c.onAddItem(function(a,b){var d=c.getItems().index(b);d%l==0&&g(d)})});return a.api?f:this}})(jQuery);(function(d){function n(c,a,b){var e=this,l=c.add(this),g=c.find(b.tabs),f=a.jquery?a:c.children(a),i;g.length||(g=c.children());f.length||(f=c.parent().find(a));f.length||(f=d(a));d.extend(this,{click:function(a,h){var f=g.eq(a),j=!c.data("tabs");"string"==typeof a&&a.replace("#","")&&(f=g.filter('[href*="'+a.replace("#","")+'"]'),a=Math.max(g.index(f),0));if(b.rotate){var k=g.length-1;if(0>a)return e.click(k,h);if(a>k)return e.click(0,h)}if(!f.length){if(0<=i)return e;a=b.initialIndex;f=g.eq(a)}if(a===
i)return e;h=h||d.Event();h.type="onBeforeClick";l.trigger(h,[a]);if(!h.isDefaultPrevented())return m[j?b.initialEffect&&b.effect||"default":b.effect].call(e,a,function(){i=a;h.type="onClick";l.trigger(h,[a])}),g.removeClass(b.current),f.addClass(b.current),e},getConf:function(){return b},getTabs:function(){return g},getPanes:function(){return f},getCurrentPane:function(){return f.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-
1)},destroy:function(){g.off(b.event).removeClass(b.current);f.find('a[href^="#"]').off("click.T");return e}});d.each(["onBeforeClick","onClick"],function(a,c){if(d.isFunction(b[c]))d(e).on(c,b[c]);e[c]=function(a){if(a)d(e).on(c,a);return e}});b.history&&d.fn.history&&(d.tools.history.init(g),b.event="history");g.each(function(a){d(this).on(b.event,function(b){e.click(a,b);return b.preventDefault()})});f.find('a[href^="#"]').on("click.T",function(a){e.click(d(this).attr("href"),a)});location.hash&&
"a"==b.tabs&&c.find('[href="'+location.hash+'"]').length?e.click(location.hash):(0===b.initialIndex||0<b.initialIndex)&&e.click(b.initialIndex)}d.tools=d.tools||{version:"@VERSION"};d.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialEffect:!1,initialIndex:0,event:"click",rotate:!1,slideUpSpeed:400,slideDownSpeed:400,history:!1},addEffect:function(c,a){m[c]=a}};var m={"default":function(c,a){this.getPanes().hide().eq(c).show();a.call()},fade:function(c,
a){var b=this.getConf(),e=b.fadeOutSpeed,d=this.getPanes();e?d.fadeOut(e):d.hide();d.eq(c).fadeIn(b.fadeInSpeed,a)},slide:function(c,a){var b=this.getConf();this.getPanes().slideUp(b.slideUpSpeed);this.getPanes().eq(c).slideDown(b.slideDownSpeed,a)},ajax:function(c,a){this.getPanes().eq(0).load(this.getTabs().eq(c).attr("href"),a)}},j,k;d.tools.tabs.addEffect("horizontal",function(c,a){if(!j){var b=this.getPanes().eq(c),e=this.getCurrentPane();k||(k=this.getPanes().eq(0).width());j=!0;b.show();e.animate({width:0},
{step:function(a){b.css("width",k-a)},complete:function(){d(this).hide();a.call();j=!1}});e.length||(a.call(),j=!1)}});d.fn.tabs=function(c,a){var b=this.data("tabs");b&&(b.destroy(),this.removeData("tabs"));d.isFunction(a)&&(a={onBeforeClick:a});a=d.extend({},d.tools.tabs.conf,a);this.each(function(){b=new n(d(this),c,a);d(this).data("tabs",b)});return a.api?b:this}})(jQuery);(function(d){function n(c,a){function h(a){var b=d(a);return 2>b.length?b:c.parent().find(a)}function i(){g=setTimeout(function(){e.next()},a.interval)}var b=this,f=c.add(this),e=c.data("tabs"),g,j=!0,m=h(a.next).click(function(){e.next()}),k=h(a.prev).click(function(){e.prev()});d.extend(b,{getTabs:function(){return e},getConf:function(){return a},play:function(){if(g)return b;var a=d.Event("onBeforePlay");f.trigger(a);if(a.isDefaultPrevented())return b;j=!1;f.trigger("onPlay");f.on("onClick",i);
i();return b},pause:function(){if(!g)return b;var a=d.Event("onBeforePause");f.trigger(a);if(a.isDefaultPrevented())return b;g=clearTimeout(g);f.trigger("onPause");f.off("onClick",i);return b},resume:function(){j||b.play()},stop:function(){b.pause();j=!0}});d.each(["onBeforePlay","onPlay","onBeforePause","onPause"],function(e,c){if(d.isFunction(a[c]))d(b).on(c,a[c]);b[c]=function(a){return d(b).on(c,a)}});a.autopause&&e.getTabs().add(m).add(k).add(e.getPanes()).hover(b.pause,b.resume);a.autoplay&&
b.play();a.clickable&&e.getPanes().click(function(){e.next()});if(!e.getConf().rotate){var l=a.disabledClass;e.getIndex()||k.addClass(l);e.onBeforeClick(function(a,b){k.toggleClass(l,!b);m.toggleClass(l,b==e.getTabs().length-1)})}}var h;h=d.tools.tabs.slideshow={conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:!1,autopause:!0,interval:3E3,clickable:!0,api:!1}};d.fn.slideshow=function(c){var a=this.data("slideshow");if(a)return a;c=d.extend({},h.conf,c);this.each(function(){a=
new n(d(this),c);d(this).data("slideshow",a)});return c.api?a:this}})(jQuery);(function(b){function j(){if(b.browser.msie){var a=b(document).height(),c=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,20>a-c?c:a]}return[b(document).width(),b(document).height()]}function g(a){if(a)return a.call(b.mask)}b.tools=b.tools||{version:"@VERSION"};var k;k=b.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,
onClose:null}};var c,h,d,e,i;b.mask={load:function(a,f){if(d)return this;"string"==typeof a&&(a={color:a});a=a||e;e=a=b.extend(b.extend({},k.conf),a);c=b("#"+a.maskId);c.length||(c=b("<div/>").attr("id",a.maskId),b("body").append(c));var l=j();c.css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:a.startOpacity,zIndex:a.zIndex});a.color&&c.css("backgroundColor",a.color);if(!1===g(a.onBeforeLoad))return this;if(a.closeOnEsc)b(document).on("keydown.mask",function(a){a.keyCode==
27&&b.mask.close(a)});if(a.closeOnClick)c.on("click.mask",function(a){b.mask.close(a)});b(window).on("resize.mask",function(){b.mask.fit()});f&&f.length&&(i=f.eq(0).css("zIndex"),b.each(f,function(){var a=b(this);/relative|absolute|fixed/i.test(a.css("position"))||a.css("position","relative")}),h=f.css({zIndex:Math.max(a.zIndex+1,"auto"==i?0:i)}));c.css({display:"block"}).fadeTo(a.loadSpeed,a.opacity,function(){b.mask.fit();g(a.onLoad);d="full"});d=!0;return this},close:function(){if(d){if(!1===g(e.onBeforeClose))return this;
c.fadeOut(e.closeSpeed,function(){g(e.onClose);h&&h.css({zIndex:i});d=!1});b(document).off("keydown.mask");c.off("click.mask");b(window).off("resize.mask")}return this},fit:function(){if(d){var a=j();c.css({width:a[0],height:a[1]})}},getMask:function(){return c},isLoaded:function(a){return a?"full"==d:d},getConf:function(){return e},getExposed:function(){return h}};b.fn.mask=function(a){b.mask.load(a);return this};b.fn.expose=function(a){b.mask.load(a,this);return this}})(jQuery);(function(){function h(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function k(a,b){var c=[],d;for(d in a)a.hasOwnProperty(d)&&(c[d]=b(a[d]));return c}function l(a,b,c){if(e.isSupported(b.version))a.innerHTML=e.getHTML(b,c);else if(b.expressInstall&&e.isSupported([6,65]))a.innerHTML=e.getHTML(h(b,{src:b.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title});else if(a.innerHTML.replace(/\s/g,"")||(a.innerHTML="<h2>Flash version "+b.version+
" or greater is required</h2><h3>"+(0<f[0]?"Your version is "+f:"You have no flash plugin installed")+"</h3>"+("A"==a.tagName?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+j+"'>here</a></p>"),"A"==a.tagName&&(a.onclick=function(){location.href=j})),b.onFail){var d=b.onFail.call(this);"string"==typeof d&&(a.innerHTML=d)}i&&(window[b.id]=document.getElementById(b.id));h(this,{getRoot:function(){return a},getOptions:function(){return b},getConf:function(){return c},
getApi:function(){return a.firstChild}})}var i=document.all,j="http://www.adobe.com/go/getflashplayer",m="function"==typeof jQuery,n=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,g={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:!0,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:!1,cachebusting:!1};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}});
window.flashembed=function(a,b,c){"string"==typeof a&&(a=document.getElementById(a.replace("#","")));if(a)return"string"==typeof b&&(b={src:b}),new l(a,h(h({},g),b),c)};var e=h(window.flashembed,{conf:g,getVersion:function(){var a,b;try{b=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(c){try{b=(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"))&&a.GetVariable("$version")}catch(d){try{b=(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"))&&a.GetVariable("$version")}catch(e){}}}return(b=
n.exec(b))?[b[1],b[3]]:[0,0]},asString:function(a){if(null===a||void 0===a)return null;var b=typeof a;"object"==b&&a.push&&(b="array");switch(b){case "string":return a=a.replace(RegExp('(["\\\\])',"g"),"\\$1"),a=a.replace(/^\s?(\d+\.?\d*)%/,"$1pct"),'"'+a+'"';case "array":return"["+k(a,function(a){return e.asString(a)}).join(",")+"]";case "function":return'"function()"';case "object":var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push('"'+c+'":'+e.asString(a[c]));return"{"+b.join(",")+"}"}return(""+
a).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(a,b){var a=h({},a),c='<object width="'+a.width+'" height="'+a.height+'" id="'+a.id+'" name="'+a.id+'"';a.cachebusting&&(a.src+=(-1!=a.src.indexOf("?")?"&":"?")+Math.random());c=a.w3c||!i?c+(' data="'+a.src+'" type="application/x-shockwave-flash"'):c+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';c+=">";if(a.w3c||i)c+='<param name="movie" value="'+a.src+'" />';a.width=a.height=a.id=a.w3c=a.src=null;a.onFail=a.version=a.expressInstall=
null;for(var d in a)a[d]&&(c+='<param name="'+d+'" value="'+a[d]+'" />');d="";if(b){for(var f in b)if(b[f]){var g=b[f];d+=f+"="+encodeURIComponent(/function|object/.test(typeof g)?e.asString(g):g)+"&"}d=d.slice(0,-1);c+='<param name="flashvars" value=\''+d+"' />"}return c+"</object>"},isSupported:function(a){return f[0]>a[0]||f[0]==a[0]&&f[1]>=a[1]}}),f=e.getVersion();m&&(jQuery.tools=jQuery.tools||{version:"@VERSION"},jQuery.tools.flashembed={conf:g},jQuery.fn.flashembed=function(a,b){return this.each(function(){jQuery(this).data("flashembed",
flashembed(this,a,b))})})})();(function(a){function g(a){if(a){var b=d.contentWindow.document;b.open().close();b.location.hash=a}}var f,d,e,h;a.tools=a.tools||{version:"@VERSION"};a.tools.history={init:function(c){h||(a.browser.msie&&"8">a.browser.version?d||(d=a("<iframe/>").attr("src","javascript:false;").hide().get(0),a("body").append(d),setInterval(function(){var b=d.contentWindow.document.location.hash;f!==b&&a(window).trigger("hash",b)},100),g(location.hash||"#")):setInterval(function(){var b=location.hash;b!==f&&a(window).trigger("hash",
b)},100),e=!e?c:e.add(c),c.click(function(b){var c=a(this).attr("href");d&&g(c);if(c.slice(0,1)!="#"){location.href="#"+c;return b.preventDefault()}}),h=!0)}};a(window).on("hash",function(c,b){b?e.filter(function(){var c=a(this).attr("href");return c==b||c==b.replace("#","")}).trigger("history",[b]):e.eq(0).trigger("history",[b]);f=b});a.fn.history=function(c){a.tools.history.init(this);return this.on("history",c)}})(jQuery);(function(b){function c(a){switch(a.type){case "mousemove":return b.extend(a.data,{clientX:a.clientX,clientY:a.clientY,pageX:a.pageX,pageY:a.pageY});case "DOMMouseScroll":b.extend(a,a.data);a.delta=-a.detail/3;break;case "mousewheel":a.delta=a.wheelDelta/120}a.type="wheel";return b.event.handle.call(this,a,a.delta)}b.fn.mousewheel=function(a){return this[a?"on":"trigger"]("wheel",a)};b.event.special.wheel={setup:function(){b.event.add(this,d,c,{})},teardown:function(){b.event.remove(this,d,c)}};var d=
!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+("1.9">b.browser.version?" mousemove":"")})(jQuery);(function(e){function p(a,b,d){var f=d.relative?a.position().top:a.offset().top,c=d.relative?a.position().left:a.offset().left,h=d.position[0],f=f-(b.outerHeight()-d.offset[0]),c=c+(a.outerWidth()+d.offset[1]);/iPad/i.test(navigator.userAgent)&&(f-=e(window).scrollTop());var i=b.outerHeight()+a.outerHeight();"center"==h&&(f+=i/2);"bottom"==h&&(f+=i);h=d.position[1];a=b.outerWidth()+a.outerWidth();"center"==h&&(c-=a/2);"left"==h&&(c-=a);return{top:f,left:c}}function n(a,b){var d=this,f=a.add(d),c,
h=0,i=0,m=a.attr("title"),q=a.attr("data-tooltip"),r=o[b.effect],l,s=a.is(":input"),n=s&&a.is(":checkbox, :radio, select, :button, :submit"),t=a.attr("type"),j=b.events[t]||b.events[s?n?"widget":"input":"def"];if(!r)throw'Nonexistent effect "'+b.effect+'"';j=j.split(/,\s*/);if(2!=j.length)throw"Tooltip: bad events configuration for "+t;a.on(j[0],function(a){clearTimeout(h);b.predelay?i=setTimeout(function(){d.show(a)},b.predelay):d.show(a)}).on(j[1],function(a){clearTimeout(i);b.delay?h=setTimeout(function(){d.hide(a)},
b.delay):d.hide(a)});m&&b.cancelDefault&&(a.removeAttr("title"),a.data("title",m));e.extend(d,{show:function(k){if(!c){if(q)c=e(q);else if(b.tip)c=e(b.tip).eq(0);else if(m)c=e(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);else{c=a.next();c.length||(c=a.parent().next())}if(!c.length)throw"Cannot find tooltip for "+a;}if(d.isShown())return d;c.stop(true,true);var g=p(a,c,b);b.tip&&c.html(a.data("title"));k=e.Event();k.type="onBeforeShow";f.trigger(k,[g]);if(k.isDefaultPrevented())return d;
g=p(a,c,b);c.css({position:"absolute",top:g.top,left:g.left});l=true;r[0].call(d,function(){k.type="onShow";l="full";f.trigger(k)});g=b.events.tooltip.split(/,\s*/);if(!c.data("__set")){c.off(g[0]).on(g[0],function(){clearTimeout(h);clearTimeout(i)});if(g[1]&&!a.is("input:not(:checkbox, :radio), textarea"))c.off(g[1]).on(g[1],function(b){b.relatedTarget!=a[0]&&a.trigger(j[1].split(" ")[0])});b.tip||c.data("__set",true)}return d},hide:function(a){if(!c||!d.isShown())return d;a=e.Event();a.type="onBeforeHide";
f.trigger(a);if(!a.isDefaultPrevented()){l=false;o[b.effect][1].call(d,function(){a.type="onHide";f.trigger(a)});return d}},isShown:function(a){return a?l=="full":l},getConf:function(){return b},getTip:function(){return c},getTrigger:function(){return a}});e.each(["onHide","onBeforeShow","onShow","onBeforeHide"],function(a,c){if(e.isFunction(b[c]))e(d).on(c,b[c]);d[c]=function(a){if(a)e(d).on(c,a);return d}})}e.tools=e.tools||{version:"@VERSION"};e.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",
predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,b,d){o[a]=[b,d]}};var o={toggle:[function(a){var b=this.getConf(),d=this.getTip(),b=b.opacity;1>b&&d.css({opacity:b});d.show();a.call()},function(a){this.getTip().hide();a.call()}],fade:[function(a){var b=
this.getConf();!e.browser.msie||b.fadeIE?this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a):(this.getTip().show(),a())},function(a){var b=this.getConf();!e.browser.msie||b.fadeIE?this.getTip().fadeOut(b.fadeOutSpeed,a):(this.getTip().hide(),a())}]};e.fn.tooltip=function(a){var b=this.data("tooltip");if(b)return b;a=e.extend(!0,{},e.tools.tooltip.conf,a);"string"==typeof a.position&&(a.position=a.position.split(/,?\s/));this.each(function(){b=new n(e(this),a);e(this).data("tooltip",b)});return a.api?
b:this}})(jQuery);(function(c){var i=c.tools.tooltip;i.dynamic={conf:{classNames:"top right bottom left"}};c.fn.dynamic=function(f){"number"==typeof f&&(f={speed:f});var f=c.extend({},i.dynamic.conf,f),l=c.extend(!0,{},f),j=f.classNames.split(/\s/),e;this.each(function(){var h=c(this).tooltip().onBeforeShow(function(f,h){var d=this.getTip(),a=this.getConf();e||(e=[a.position[0],a.position[1],a.offset[0],a.offset[1],c.extend({},a)]);c.extend(a,e[4]);a.position=[e[0],e[1]];a.offset=[e[2],e[3]];d.css({visibility:"hidden",
position:"absolute",top:h.top,left:h.left}).show();var k=c.extend(!0,{},l),b;b=c(window);var g=b.width()+b.scrollLeft(),i=b.height()+b.scrollTop();b=[d.offset().top<=b.scrollTop(),g<=d.offset().left+d.width(),i<=d.offset().top+d.height(),b.scrollLeft()>=d.offset().left];a:{for(g=b.length;g--;)if(b[g]){g=!1;break a}g=!0}if(!g){b[2]&&(c.extend(a,k.top),a.position[0]="top",d.addClass(j[0]));b[3]&&(c.extend(a,k.right),a.position[1]="right",d.addClass(j[1]));b[0]&&(c.extend(a,k.bottom),a.position[0]="bottom",
d.addClass(j[2]));b[1]&&(c.extend(a,k.left),a.position[1]="left",d.addClass(j[3]));if(b[0]||b[2])a.offset[0]*=-1;if(b[1]||b[3])a.offset[1]*=-1}d.css({visibility:"visible"}).hide()});h.onBeforeShow(function(){var c=this.getConf();this.getTip();setTimeout(function(){c.position=[e[0],e[1]];c.offset=[e[2],e[3]]},0)});h.onHide(function(){this.getTip().removeClass(f.classNames)});ret=h});return f.api?ret:this}})(jQuery);(function(b){var e=b.tools.tooltip;b.extend(e.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var f={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};e.addEffect("slide",function(b){var a=this.getConf(),g=this.getTip(),c=a.slideFade?{opacity:a.opacity}:{},d=f[a.direction]||f.up;c[d[1]]=d[0]+"="+a.slideOffset;a.slideFade&&g.css({opacity:0});g.show().animate(c,a.slideInSpeed,b)},function(e){var a=this.getConf(),g=a.slideOffset,
c=a.slideFade?{opacity:0}:{},d=f[a.direction]||f.up,h=""+d[0];a.bounce&&(h="+"==h?"-":"+");c[d[1]]=h+"="+g;this.getTip().animate(c,a.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);(function(c){function i(b,a,f){var a=c(a).first()||a,d=b.offset().top,e=b.offset().left,g=f.position.split(/,?\s+/),j=g[0],g=g[1],d=d-(a.outerHeight()-f.offset[0]),e=e+(b.outerWidth()+f.offset[1]);/iPad/i.test(navigator.userAgent)&&(d-=c(window).scrollTop());f=a.outerHeight()+b.outerHeight();"center"==j&&(d+=f/2);"bottom"==j&&(d+=f);b=b.outerWidth();"center"==g&&(e-=(b+a.outerWidth())/2);"left"==g&&(e-=b);return{top:d,left:e}}function q(b){function a(){return this.getAttribute("type")==b}a.key='[type="'+
b+'"]';return a}function n(b,a,f){function p(a,b,e){if(f.grouped||!a.length){var g;!1===e||c.isArray(e)?(g=d.messages[b.key||b]||d.messages["*"],g=g[f.lang]||d.messages["*"].en,(b=g.match(/\$\d/g))&&c.isArray(e)&&c.each(b,function(a){g=g.replace(this,e[a])})):g=e[f.lang]||e;a.push(g)}}var e=this,g=a.add(e),b=b.not(":button, :image, :reset, :submit");a.attr("novalidate","novalidate");c.extend(e,{getConf:function(){return f},getForm:function(){return a},getInputs:function(){return b},reflow:function(){b.each(function(){var a=
c(this),b=a.data("msg.el");b&&(a=i(a,b,f),b.css({top:a.top,left:a.left}))});return e},invalidate:function(a,h){if(!h){var d=[];c.each(a,function(a,f){var c=b.filter("[name='"+a+"']");c.length&&(c.trigger("OI",[f]),d.push({input:c,messages:[f]}))});a=d;h=c.Event()}h.type="onFail";g.trigger(h,[a]);h.isDefaultPrevented()||l[f.effect][0].call(e,a,h);return e},reset:function(a){a=a||b;a.removeClass(f.errorClass).each(function(){var a=c(this).data("msg.el");a&&(a.remove(),c(this).data("msg.el",null))}).off(f.errorInputEvent+
".v"||"");return e},destroy:function(){a.off(f.formEvent+".V reset.V");b.off(f.inputEvent+".V change.V");return e.reset()},checkValidity:function(a,h){var a=a||b,a=a.not(":disabled"),d={},a=a.filter(function(){var a=c(this).attr("name");if(!d[a])return d[a]=!0,c(this)});if(!a.length)return!0;h=h||c.Event();h.type="onBeforeValidate";g.trigger(h,[a]);if(h.isDefaultPrevented())return h.result;var k=[];a.each(function(){var a=[],b=c(this).data("messages",a),d=m&&b.is(":date")?"onHide.v":f.errorInputEvent+
".v";b.off(d);c.each(o,function(){var c=this[0];if(b.filter(c).length){var d=this[1].call(e,b,b.val());if(!0!==d){h.type="onBeforeFail";g.trigger(h,[b,c]);if(h.isDefaultPrevented())return!1;var j=b.attr(f.messageAttr);if(j)return a=[j],!1;p(a,c,d)}}});if(a.length&&(k.push({input:b,messages:a}),b.trigger("OI",[a]),f.errorInputEvent))b.on(d,function(a){e.checkValidity(b,a)});if(f.singleError&&k.length)return!1});var i=l[f.effect];if(!i)throw'Validator: cannot find effect "'+f.effect+'"';if(k.length)return e.invalidate(k,
h),!1;i[1].call(e,a,h);h.type="onSuccess";g.trigger(h,[a]);a.off(f.errorInputEvent+".v");return!0}});c.each(["onBeforeValidate","onBeforeFail","onFail","onSuccess"],function(a,b){if(c.isFunction(f[b]))c(e).on(b,f[b]);e[b]=function(a){if(a)c(e).on(b,a);return e}});if(f.formEvent)a.on(f.formEvent+".V",function(b){if(!e.checkValidity(null,b))return b.preventDefault();b.target=a;b.type=f.formEvent});a.on("reset.V",function(){e.reset()});b[0]&&b[0].validity&&b.each(function(){this.oninvalid=function(){return!1}});
a[0]&&(a[0].checkValidity=e.checkValidity);if(f.inputEvent)b.on(f.inputEvent+".V",function(a){e.checkValidity(c(this),a)});b.filter(":checkbox, select").filter("[required]").on("change.V",function(a){var b=c(this);(this.checked||b.is("select")&&c(this).val())&&l[f.effect][1].call(e,b,a)});b.filter(":radio[required]").on("change.V",function(a){var b=c("[name='"+c(a.srcElement).attr("name")+"']");b!=null&&b.length!=0&&e.checkValidity(b,a)});c(window).resize(function(){e.reflow()})}c.tools=c.tools||
{version:"@VERSION"};var r=/\[type=([a-z]+)\]/,s=/^-?[0-9]*(\.[0-9]+)?$/,m=c.tools.dateinput,t=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,u=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,d;d=c.tools.validator={conf:{grouped:!1,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"<div/>",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:!1,speed:"normal"},messages:{"*":{en:"Please correct this value"}},
localize:function(b,a){c.each(a,function(a,c){d.messages[a]=d.messages[a]||{};d.messages[a][b]=c})},localizeFn:function(b,a){d.messages[b]=d.messages[b]||{};c.extend(d.messages[b],a)},fn:function(b,a,f){c.isFunction(a)?f=a:("string"==typeof a&&(a={en:a}),this.messages[b.key||b]=a);(a=r.exec(b))&&(b=q(a[1]));o.push([b,f])},addEffect:function(b,a,f){l[b]=[a,f]}};var o=[],l={"default":[function(b){var a=this.getConf();c.each(b,function(b,d){var e=d.input;e.addClass(a.errorClass);var g=e.data("msg.el");
g||(g=c(a.message).addClass(a.messageClass).appendTo(document.body),e.data("msg.el",g));g.css({visibility:"hidden"}).find("p").remove();c.each(d.messages,function(a,b){c("<p/>").html(b).appendTo(g)});g.outerWidth()==g.parent().width()&&g.add(g.find("p")).css({display:"inline"});e=i(e,g,a);g.css({visibility:"visible",position:"absolute",top:e.top,left:e.left}).fadeIn(a.speed)})},function(b){var a=this.getConf();b.removeClass(a.errorClass).each(function(){var a=c(this).data("msg.el");a&&a.css({visibility:"hidden"})})}]};
c.each(["email","url","number"],function(b,a){c.expr[":"][a]=function(b){return b.getAttribute("type")===a}});c.fn.oninvalid=function(b){return this[b?"on":"trigger"]("OI",b)};d.fn(":email","Please enter a valid email address",function(b,a){return!a||t.test(a)});d.fn(":url","Please enter a valid URL",function(b,a){return!a||u.test(a)});d.fn(":number","Please enter a numeric value.",function(b,a){return s.test(a)});d.fn("[max]","Please enter a value no larger than $1",function(b,a){if(""===a||m&&b.is(":date"))return!0;
var c=b.attr("max");return parseFloat(a)<=parseFloat(c)?!0:[c]});d.fn("[min]","Please enter a value of at least $1",function(b,a){if(""===a||m&&b.is(":date"))return!0;var c=b.attr("min");return parseFloat(a)>=parseFloat(c)?!0:[c]});d.fn("[required]","Please complete this mandatory field.",function(b,a){return b.is(":checkbox")?b.is(":checked"):!!a});d.fn("[pattern]",function(b,a){return""===a||RegExp("^"+b.attr("pattern")+"$").test(a)});d.fn(":radio","Please select an option.",function(b){var a=!1;
c("[name='"+b.attr("name")+"']").each(function(b,d){c(d).is(":checked")&&(a=!0)});return a?!0:!1});c.fn.validator=function(b){var a=this.data("validator");a&&(a.destroy(),this.removeData("validator"));b=c.extend(!0,{},d.conf,b);if(this.is("form"))return this.each(function(){var d=c(this);a=new n(d.find(":input"),d,b);d.data("validator",a)});a=new n(this,this.eq(0).closest("form"),b);return this.data("validator",a)}})(jQuery);
|
ajax/libs/reflux/5.0.3/reflux.js
|
kiwi89/cdnjs
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Reflux = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var has = Object.prototype.hasOwnProperty;
//
// We store our EE objects in a plain object whose properties are event names.
// If `Object.create(null)` is not supported we prefix the event names with a
// `~` to make sure that the built-in object properties are not overridden or
// used as an attack vector.
// We also assume that `Object.create(null)` is available when the event name
// is an ES6 Symbol.
//
var prefix = typeof Object.create !== 'function' ? '~' : false;
/**
* Representation of a single EventEmitter function.
*
* @param {Function} fn Event handler to be called.
* @param {Mixed} context Context for function execution.
* @param {Boolean} [once=false] Only emit once
* @api private
*/
function EE(fn, context, once) {
this.fn = fn;
this.context = context;
this.once = once || false;
}
/**
* Minimal EventEmitter interface that is molded against the Node.js
* EventEmitter interface.
*
* @constructor
* @api public
*/
function EventEmitter() { /* Nothing to set */ }
/**
* Hold the assigned EventEmitters by name.
*
* @type {Object}
* @private
*/
EventEmitter.prototype._events = undefined;
/**
* Return an array listing the events for which the emitter has registered
* listeners.
*
* @returns {Array}
* @api public
*/
EventEmitter.prototype.eventNames = function eventNames() {
var events = this._events
, names = []
, name;
if (!events) return names;
for (name in events) {
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
}
if (Object.getOwnPropertySymbols) {
return names.concat(Object.getOwnPropertySymbols(events));
}
return names;
};
/**
* Return a list of assigned event listeners.
*
* @param {String} event The events that should be listed.
* @param {Boolean} exists We only need to know if there are listeners.
* @returns {Array|Boolean}
* @api public
*/
EventEmitter.prototype.listeners = function listeners(event, exists) {
var evt = prefix ? prefix + event : event
, available = this._events && this._events[evt];
if (exists) return !!available;
if (!available) return [];
if (available.fn) return [available.fn];
for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
ee[i] = available[i].fn;
}
return ee;
};
/**
* Emit an event to all registered event listeners.
*
* @param {String} event The name of the event.
* @returns {Boolean} Indication if we've emitted an event.
* @api public
*/
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
var evt = prefix ? prefix + event : event;
if (!this._events || !this._events[evt]) return false;
var listeners = this._events[evt]
, len = arguments.length
, args
, i;
if ('function' === typeof listeners.fn) {
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
switch (len) {
case 1: return listeners.fn.call(listeners.context), true;
case 2: return listeners.fn.call(listeners.context, a1), true;
case 3: return listeners.fn.call(listeners.context, a1, a2), true;
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
}
for (i = 1, args = new Array(len -1); i < len; i++) {
args[i - 1] = arguments[i];
}
listeners.fn.apply(listeners.context, args);
} else {
var length = listeners.length
, j;
for (i = 0; i < length; i++) {
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
switch (len) {
case 1: listeners[i].fn.call(listeners[i].context); break;
case 2: listeners[i].fn.call(listeners[i].context, a1); break;
case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
default:
if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
args[j - 1] = arguments[j];
}
listeners[i].fn.apply(listeners[i].context, args);
}
}
}
return true;
};
/**
* Register a new EventListener for the given event.
*
* @param {String} event Name of the event.
* @param {Function} fn Callback function.
* @param {Mixed} [context=this] The context of the function.
* @api public
*/
EventEmitter.prototype.on = function on(event, fn, context) {
var listener = new EE(fn, context || this)
, evt = prefix ? prefix + event : event;
if (!this._events) this._events = prefix ? {} : Object.create(null);
if (!this._events[evt]) this._events[evt] = listener;
else {
if (!this._events[evt].fn) this._events[evt].push(listener);
else this._events[evt] = [
this._events[evt], listener
];
}
return this;
};
/**
* Add an EventListener that's only called once.
*
* @param {String} event Name of the event.
* @param {Function} fn Callback function.
* @param {Mixed} [context=this] The context of the function.
* @api public
*/
EventEmitter.prototype.once = function once(event, fn, context) {
var listener = new EE(fn, context || this, true)
, evt = prefix ? prefix + event : event;
if (!this._events) this._events = prefix ? {} : Object.create(null);
if (!this._events[evt]) this._events[evt] = listener;
else {
if (!this._events[evt].fn) this._events[evt].push(listener);
else this._events[evt] = [
this._events[evt], listener
];
}
return this;
};
/**
* Remove event listeners.
*
* @param {String} event The event we want to remove.
* @param {Function} fn The listener that we need to find.
* @param {Mixed} context Only remove listeners matching this context.
* @param {Boolean} once Only remove once listeners.
* @api public
*/
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
var evt = prefix ? prefix + event : event;
if (!this._events || !this._events[evt]) return this;
var listeners = this._events[evt]
, events = [];
if (fn) {
if (listeners.fn) {
if (
listeners.fn !== fn
|| (once && !listeners.once)
|| (context && listeners.context !== context)
) {
events.push(listeners);
}
} else {
for (var i = 0, length = listeners.length; i < length; i++) {
if (
listeners[i].fn !== fn
|| (once && !listeners[i].once)
|| (context && listeners[i].context !== context)
) {
events.push(listeners[i]);
}
}
}
}
//
// Reset the array, or remove it completely if we have no more listeners.
//
if (events.length) {
this._events[evt] = events.length === 1 ? events[0] : events;
} else {
delete this._events[evt];
}
return this;
};
/**
* Remove all listeners or only the listeners for the specified event.
*
* @param {String} event The event want to remove all listeners for.
* @api public
*/
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
if (!this._events) return this;
if (event) delete this._events[prefix ? prefix + event : event];
else this._events = prefix ? {} : Object.create(null);
return this;
};
//
// Alias methods names because people roll like that.
//
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
//
// This function doesn't apply anymore.
//
EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
return this;
};
//
// Expose the prefix.
//
EventEmitter.prefixed = prefix;
//
// Expose the module.
//
if ('undefined' !== typeof module) {
module.exports = EventEmitter;
}
},{}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
},{}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
// this needs to be set to true before Keep.js starts storing, done via useKeep
var use = false;
var createdStores = [];
var createdActions = [];
function useKeep() {
var bool = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
use = bool;
}
function addStore(str) {
if (use) {
createdStores.push(str);
}
}
function addAction(act) {
if (use) {
createdActions.push(act);
}
}
function reset() {
while (createdStores.length) {
createdStores.pop();
}
while (createdActions.length) {
createdActions.pop();
}
}
exports.useKeep = useKeep;
exports.addStore = addStore;
exports.addAction = addAction;
exports.createdStores = createdStores;
exports.createdActions = createdActions;
exports.reset = reset;
},{}],4:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.joinStrict = exports.joinConcat = exports.joinLeading = exports.joinTrailing = exports.fetchInitialState = exports.stopListeningToAll = exports.stopListeningTo = exports.listenTo = exports.validateListening = exports.listenToMany = exports.hasListener = undefined;
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
var _joins = require("./joins");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/**
* Extract child listenables from a parent from their
* children property and return them in a keyed Object
*
* @param {Object} listenable The parent listenable
*/
var mapChildListenables = function mapChildListenables(listenable) {
var i = 0,
children = {},
childName;
for (; i < (listenable.children || []).length; ++i) {
childName = listenable.children[i];
if (listenable[childName]) {
children[childName] = listenable[childName];
}
}
return children;
};
/**
* Make a flat dictionary of all listenables including their
* possible children (recursively), concatenating names in camelCase.
*
* @param {Object} listenables The top-level listenables
*/
var flattenListenables = function flattenListenables(listenables) {
var flattened = {};
for (var key in listenables) {
var listenable = listenables[key];
var childMap = mapChildListenables(listenable);
// recursively flatten children
var children = flattenListenables(childMap);
// add the primary listenable and chilren
flattened[key] = listenable;
for (var childKey in children) {
var childListenable = children[childKey];
flattened[key + _.capitalize(childKey)] = childListenable;
}
}
return flattened;
};
/**
* An internal utility function used by `validateListening`
*
* @param {Action|Store} listenable The listenable we want to search for
* @returns {Boolean} The result of a recursive search among `this.subscriptions`
*/
var hasListener = exports.hasListener = function hasListener(listenable) {
var i = 0,
j,
listener,
listenables;
for (; i < (this.subscriptions || []).length; ++i) {
listenables = [].concat(this.subscriptions[i].listenable);
for (j = 0; j < listenables.length; j++) {
listener = listenables[j];
if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) {
return true;
}
}
}
return false;
};
/**
* A convenience method that listens to all listenables in the given object.
*
* @param {Object} listenables An object of listenables. Keys will be used as callback method names.
*/
var listenToMany = exports.listenToMany = function listenToMany(listenables) {
var allListenables = flattenListenables(listenables);
for (var key in allListenables) {
var cbname = _.callbackName(key),
localname = this[cbname] ? cbname : this[key] ? key : undefined;
if (localname) {
this.listenTo(allListenables[key], localname, this[cbname + "Default"] || this[localname + "Default"] || localname);
}
}
};
/**
* Checks if the current context can listen to the supplied listenable
*
* @param {Action|Store} listenable An Action or Store that should be
* listened to.
* @returns {String|Undefined} An error message, or undefined if there was no problem.
*/
var validateListening = exports.validateListening = function validateListening(listenable) {
if (listenable === this) {
return "Listener is not able to listen to itself";
}
if (!_.isFunction(listenable.listen)) {
return listenable + " is missing a listen method";
}
if (listenable.hasListener && listenable.hasListener(this)) {
return "Listener cannot listen to this listenable because of circular loop";
}
};
/**
* Sets up a subscription to the given listenable for the context object
*
* @param {Action|Store} listenable An Action or Store that should be
* listened to.
* @param {Function|String} callback The callback to register as event handler
* @param {Function|String} defaultCallback The callback to register as default handler
* @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to
*/
var listenTo = exports.listenTo = function listenTo(listenable, callback, defaultCallback) {
var desub,
unsubscriber,
subscriptionobj,
subs = this.subscriptions = this.subscriptions || [];
_.throwIf(this.validateListening(listenable));
this.fetchInitialState(listenable, defaultCallback);
desub = listenable.listen(this[callback] || callback, this);
unsubscriber = function unsubscriber() {
var index = subs.indexOf(subscriptionobj);
_.throwIf(index === -1, "Tried to remove listen already gone from subscriptions list!");
subs.splice(index, 1);
desub();
};
subscriptionobj = {
stop: unsubscriber,
listenable: listenable
};
subs.push(subscriptionobj);
return subscriptionobj;
};
/**
* Stops listening to a single listenable
*
* @param {Action|Store} listenable The action or store we no longer want to listen to
* @returns {Boolean} True if a subscription was found and removed, otherwise false.
*/
var stopListeningTo = exports.stopListeningTo = function stopListeningTo(listenable) {
var sub,
i = 0,
subs = this.subscriptions || [];
for (; i < subs.length; i++) {
sub = subs[i];
if (sub.listenable === listenable) {
sub.stop();
_.throwIf(subs.indexOf(sub) !== -1, "Failed to remove listen from subscriptions list!");
return true;
}
}
return false;
};
/**
* Stops all subscriptions and empties subscriptions array
*/
var stopListeningToAll = exports.stopListeningToAll = function stopListeningToAll() {
var remaining,
subs = this.subscriptions || [];
while (remaining = subs.length) {
subs[0].stop();
_.throwIf(subs.length !== remaining - 1, "Failed to remove listen from subscriptions list!");
}
};
/**
* Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method.
* @param {Action|Store} listenable The publisher we want to get initial state from
* @param {Function|String} defaultCallback The method to receive the data
*/
var fetchInitialState = exports.fetchInitialState = function fetchInitialState(listenable, defaultCallback) {
defaultCallback = defaultCallback && this[defaultCallback] || defaultCallback;
var me = this;
if (_.isFunction(defaultCallback) && _.isFunction(listenable.getInitialState)) {
var data = listenable.getInitialState();
if (data && _.isFunction(data.then)) {
data.then(function () {
defaultCallback.apply(me, arguments);
});
} else {
defaultCallback.call(this, data);
}
}
};
/**
* The callback will be called once all listenables have triggered at least once.
* It will be invoked with the last emission from each listenable.
* @param {...Publishers} publishers Publishers that should be tracked.
* @param {Function|String} callback The method to call when all publishers have emitted
* @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
*/
var joinTrailing = exports.joinTrailing = (0, _joins.instanceJoinCreator)("last");
/**
* The callback will be called once all listenables have triggered at least once.
* It will be invoked with the first emission from each listenable.
* @param {...Publishers} publishers Publishers that should be tracked.
* @param {Function|String} callback The method to call when all publishers have emitted
* @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
*/
var joinLeading = exports.joinLeading = (0, _joins.instanceJoinCreator)("first");
/**
* The callback will be called once all listenables have triggered at least once.
* It will be invoked with all emission from each listenable.
* @param {...Publishers} publishers Publishers that should be tracked.
* @param {Function|String} callback The method to call when all publishers have emitted
* @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
*/
var joinConcat = exports.joinConcat = (0, _joins.instanceJoinCreator)("all");
/**
* The callback will be called once all listenables have triggered.
* If a callback triggers twice before that happens, an error is thrown.
* @param {...Publishers} publishers Publishers that should be tracked.
* @param {Function|String} callback The method to call when all publishers have emitted
* @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
*/
var joinStrict = exports.joinStrict = (0, _joins.instanceJoinCreator)("strict");
},{"./joins":11,"./utils":13}],5:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deferWith = exports.triggerAsync = exports.trigger = exports.listen = exports.shouldEmit = exports.preEmit = undefined;
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/**
* A module of methods for object that you want to be able to listen to.
* This module is consumed by `createStore` and `createAction`
*/
/**
* Hook used by the publisher that is invoked before emitting
* and before `shouldEmit`. The arguments are the ones that the action
* is invoked with. If this function returns something other than
* undefined, that will be passed on as arguments for shouldEmit and
* emission.
*/
var preEmit = exports.preEmit = function preEmit() {};
/**
* Hook used by the publisher after `preEmit` to determine if the
* event should be emitted with given arguments. This may be overridden
* in your application, default implementation always returns true.
*
* @returns {Boolean} true if event should be emitted
*/
var shouldEmit = exports.shouldEmit = function shouldEmit() {
return true;
};
/**
* Subscribes the given callback for action triggered
*
* @param {Function} callback The callback to register as event handler
* @param {Mixed} [optional] bindContext The context to bind the callback with
* @returns {Function} Callback that unsubscribes the registered event handler
*/
var listen = exports.listen = function listen(callback, bindContext) {
bindContext = bindContext || this;
var eventHandler = function eventHandler(args) {
if (aborted) {
return;
}
callback.apply(bindContext, args);
},
me = this,
aborted = false;
this.emitter.addListener(this.eventLabel, eventHandler);
return function () {
aborted = true;
me.emitter.removeListener(me.eventLabel, eventHandler);
};
};
/**
* Publishes an event using `this.emitter` (if `shouldEmit` agrees)
*/
var trigger = exports.trigger = function trigger() {
var args = arguments,
pre = this.preEmit.apply(this, args);
args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre);
if (this.shouldEmit.apply(this, args)) {
this.emitter.emit(this.eventLabel, args);
}
};
/**
* Tries to publish the event on the next tick
*/
var triggerAsync = exports.triggerAsync = function triggerAsync() {
var args = arguments,
me = this;
_.nextTick(function () {
me.trigger.apply(me, args);
});
};
/**
* Wraps the trigger mechanism with a deferral function.
*
* @param {Function} callback the deferral function,
* first argument is the resolving function and the
* rest are the arguments provided from the previous
* trigger invocation
*/
var deferWith = exports.deferWith = function deferWith(callback) {
var oldTrigger = this.trigger,
ctx = this,
resolver = function resolver() {
oldTrigger.apply(ctx, arguments);
};
this.trigger = function () {
callback.apply(ctx, [resolver].concat([].splice.call(arguments, 0)));
};
};
},{"./utils":13}],6:[function(require,module,exports){
arguments[4][2][0].apply(exports,arguments)
},{"dup":2}],7:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bindMethods = bindMethods;
function bindMethods(store, definition) {
for (var name in definition) {
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name);
if (!propertyDescriptor.value || typeof propertyDescriptor.value !== "function" || !definition.hasOwnProperty(name)) {
continue;
}
store[name] = definition[name].bind(store);
} else {
var property = definition[name];
if (typeof property !== "function" || !definition.hasOwnProperty(name)) {
continue;
}
store[name] = property.bind(store);
}
}
return store;
}
},{}],8:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createAction = createAction;
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
var _ActionMethods = require("./ActionMethods");
var ActionMethods = _interopRequireWildcard(_ActionMethods);
var _PublisherMethods = require("./PublisherMethods");
var PublisherMethods = _interopRequireWildcard(_PublisherMethods);
var _Keep = require("./Keep");
var Keep = _interopRequireWildcard(_Keep);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var allowed = { preEmit: 1, shouldEmit: 1 };
/**
* Creates an action functor object. It is mixed in with functions
* from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may
* be overridden in the definition object.
*
* @param {Object} definition The action object definition
*/
function createAction(definition) {
definition = definition || {};
if (!_.isObject(definition)) {
definition = { actionName: definition };
}
for (var a in ActionMethods) {
if (!allowed[a] && PublisherMethods[a]) {
throw new Error("Cannot override API method " + a + " in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");
}
}
for (var d in definition) {
if (!allowed[d] && PublisherMethods[d]) {
throw new Error("Cannot override API method " + d + " in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");
}
}
definition.children = definition.children || [];
if (definition.asyncResult) {
definition.children = definition.children.concat(["completed", "failed"]);
}
var i = 0,
childActions = {};
for (; i < definition.children.length; i++) {
var name = definition.children[i];
childActions[name] = createAction(name);
}
var context = _.extend({
eventLabel: "action",
emitter: new _.EventEmitter(),
_isAction: true
}, PublisherMethods, ActionMethods, definition);
var functor = function functor() {
var triggerType = functor.sync ? "trigger" : "triggerAsync";
return functor[triggerType].apply(functor, arguments);
};
_.extend(functor, childActions, context);
Keep.addAction(functor);
return functor;
}
},{"./ActionMethods":2,"./Keep":3,"./PublisherMethods":5,"./utils":13}],9:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createStore = createStore;
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
var _Keep = require("./Keep");
var Keep = _interopRequireWildcard(_Keep);
var _mixer = require("./mixer");
var _bindMethods = require("./bindMethods");
var _StoreMethods = require("./StoreMethods");
var StoreMethods = _interopRequireWildcard(_StoreMethods);
var _PublisherMethods = require("./PublisherMethods");
var PublisherMethods = _interopRequireWildcard(_PublisherMethods);
var _ListenerMethods = require("./ListenerMethods");
var ListenerMethods = _interopRequireWildcard(_ListenerMethods);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var allowed = { preEmit: 1, shouldEmit: 1 };
/**
* Creates an event emitting Data Store. It is mixed in with functions
* from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit`
* and `shouldEmit` may be overridden in the definition object.
*
* @param {Object} definition The data store object definition
* @returns {Store} A data store instance
*/
function createStore(definition) {
definition = definition || {};
for (var a in StoreMethods) {
if (!allowed[a] && (PublisherMethods[a] || ListenerMethods[a])) {
throw new Error("Cannot override API method " + a + " in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");
}
}
for (var d in definition) {
if (!allowed[d] && (PublisherMethods[d] || ListenerMethods[d])) {
throw new Error("Cannot override API method " + d + " in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");
}
}
definition = (0, _mixer.mix)(definition);
function Store() {
var i = 0,
arr;
this.subscriptions = [];
this.emitter = new _.EventEmitter();
this.eventLabel = "change";
(0, _bindMethods.bindMethods)(this, definition);
if (this.init && _.isFunction(this.init)) {
this.init();
}
if (this.listenables) {
arr = [].concat(this.listenables);
for (; i < arr.length; i++) {
this.listenToMany(arr[i]);
}
}
}
_.extend(Store.prototype, ListenerMethods, PublisherMethods, StoreMethods, definition);
var store = new Store();
Keep.addStore(store);
return store;
}
},{"./Keep":3,"./ListenerMethods":4,"./PublisherMethods":5,"./StoreMethods":6,"./bindMethods":7,"./mixer":12,"./utils":13}],10:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__keep = exports.joinConcat = exports.joinStrict = exports.joinLeading = exports.all = exports.joinTrailing = exports.use = exports.nextTick = exports.setEventEmitter = exports.createActions = exports.createStore = exports.createAction = exports.utils = exports.StoreMethods = exports.PublisherMethods = exports.ListenerMethods = exports.ActionMethods = exports.version = undefined;
var _ActionMethods = require("./ActionMethods");
var ActionMethods = _interopRequireWildcard(_ActionMethods);
var _ListenerMethods = require("./ListenerMethods");
var ListenerMethods = _interopRequireWildcard(_ListenerMethods);
var _PublisherMethods = require("./PublisherMethods");
var PublisherMethods = _interopRequireWildcard(_PublisherMethods);
var _StoreMethods = require("./StoreMethods");
var StoreMethods = _interopRequireWildcard(_StoreMethods);
var _joins = require("./joins");
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
var _createAction = require("./createAction");
var _createStore = require("./createStore");
var _Keep = require("./Keep");
var __keep = _interopRequireWildcard(_Keep);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var version = {
"reflux-core": "0.4.2"
};
var joinTrailing = (0, _joins.staticJoinCreator)("last");
var all = joinTrailing; // Reflux.all alias for backward compatibility
var joinLeading = (0, _joins.staticJoinCreator)("first");
var joinStrict = (0, _joins.staticJoinCreator)("strict");
var joinConcat = (0, _joins.staticJoinCreator)("all");
var utils = _;
/**
* Convenience function for creating a set of actions
*
* @param definitions the definitions for the actions to be created
* @returns an object with actions of corresponding action names
*/
var createActions = function () {
var reducer = function reducer(definitions, actions) {
Object.keys(definitions).forEach(function (actionName) {
var val = definitions[actionName];
actions[actionName] = (0, _createAction.createAction)(val);
});
};
return function (definitions) {
var actions = {};
if (definitions instanceof Array) {
definitions.forEach(function (val) {
if (_.isObject(val)) {
reducer(val, actions);
} else {
actions[val] = (0, _createAction.createAction)(val);
}
});
} else {
reducer(definitions, actions);
}
return actions;
};
}();
/**
* Sets the eventmitter that Reflux uses
*/
function setEventEmitter(ctx) {
_.EventEmitter = ctx;
}
/**
* Sets the method used for deferring actions and stores
*/
function nextTick(nextTick) {
_.nextTick = nextTick;
}
function use(pluginCb) {
pluginCb(this);
}
/**
* Provides the set of created actions and stores for introspection
*/
/*eslint-disable no-underscore-dangle*/
// export in format that supports syntax: var Reflux = require('reflux-core');
exports.version = version;
exports.ActionMethods = ActionMethods;
exports.ListenerMethods = ListenerMethods;
exports.PublisherMethods = PublisherMethods;
exports.StoreMethods = StoreMethods;
exports.utils = utils;
exports.createAction = _createAction.createAction;
exports.createStore = _createStore.createStore;
exports.createActions = createActions;
exports.setEventEmitter = setEventEmitter;
exports.nextTick = nextTick;
exports.use = use;
exports.joinTrailing = joinTrailing;
exports.all = all;
exports.joinLeading = joinLeading;
exports.joinStrict = joinStrict;
exports.joinConcat = joinConcat;
exports.__keep = __keep;
/*eslint-enable no-underscore-dangle*/
// export in format that supports syntax: import Reflux from 'reflux-core';
Object.defineProperty(exports, "default", {
get: function get() {
return exports;
}
});
/**
* Warn if Function.prototype.bind not available
*/
if (!Function.prototype.bind) {
console.error("Function.prototype.bind not available. " + "ES5 shim required. " + "https://github.com/spoike/refluxjs#es5");
}
},{"./ActionMethods":2,"./Keep":3,"./ListenerMethods":4,"./PublisherMethods":5,"./StoreMethods":6,"./createAction":8,"./createStore":9,"./joins":11,"./utils":13}],11:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.staticJoinCreator = staticJoinCreator;
exports.instanceJoinCreator = instanceJoinCreator;
var _createStore = require("./createStore");
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/**
* Internal module used to create static and instance join methods
*/
var slice = Array.prototype.slice,
strategyMethodNames = {
strict: "joinStrict",
first: "joinLeading",
last: "joinTrailing",
all: "joinConcat"
};
/**
* Used in `index.js` to create the static join methods
* @param {String} strategy Which strategy to use when tracking listenable trigger arguments
* @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy
*/
function staticJoinCreator(strategy) {
return function () /* listenables... */{
var listenables = slice.call(arguments);
return (0, _createStore.createStore)({
init: function init() {
this[strategyMethodNames[strategy]].apply(this, listenables.concat("triggerAsync"));
}
});
};
}
/**
* Used in `ListenerMethods.js` to create the instance join methods
* @param {String} strategy Which strategy to use when tracking listenable trigger arguments
* @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy
*/
function instanceJoinCreator(strategy) {
return function () /* listenables..., callback*/{
_.throwIf(arguments.length < 2, "Cannot create a join with less than 2 listenables!");
var listenables = slice.call(arguments),
callback = listenables.pop(),
numberOfListenables = listenables.length,
join = {
numberOfListenables: numberOfListenables,
callback: this[callback] || callback,
listener: this,
strategy: strategy
},
i,
cancels = [],
subobj;
for (i = 0; i < numberOfListenables; i++) {
_.throwIf(this.validateListening(listenables[i]));
}
for (i = 0; i < numberOfListenables; i++) {
cancels.push(listenables[i].listen(newListener(i, join), this));
}
reset(join);
subobj = { listenable: listenables };
subobj.stop = makeStopper(subobj, cancels, this);
this.subscriptions = (this.subscriptions || []).concat(subobj);
return subobj;
};
}
// ---- internal join functions ----
function makeStopper(subobj, cancels, context) {
return function () {
var i,
subs = context.subscriptions,
index = subs ? subs.indexOf(subobj) : -1;
_.throwIf(index === -1, "Tried to remove join already gone from subscriptions list!");
for (i = 0; i < cancels.length; i++) {
cancels[i]();
}
subs.splice(index, 1);
};
}
function reset(join) {
join.listenablesEmitted = new Array(join.numberOfListenables);
join.args = new Array(join.numberOfListenables);
}
function newListener(i, join) {
return function () {
var callargs = slice.call(arguments);
if (join.listenablesEmitted[i]) {
switch (join.strategy) {
case "strict":
throw new Error("Strict join failed because listener triggered twice.");
case "last":
join.args[i] = callargs;break;
case "all":
join.args[i].push(callargs);
}
} else {
join.listenablesEmitted[i] = true;
join.args[i] = join.strategy === "all" ? [callargs] : callargs;
}
emitIfAllListenablesEmitted(join);
};
}
function emitIfAllListenablesEmitted(join) {
for (var i = 0; i < join.numberOfListenables; i++) {
if (!join.listenablesEmitted[i]) {
return;
}
}
join.callback.apply(join.listener, join.args);
reset(join);
}
},{"./createStore":9,"./utils":13}],12:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mix = mix;
var _utils = require("./utils");
var _ = _interopRequireWildcard(_utils);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function mix(def) {
var composed = {
init: [],
preEmit: [],
shouldEmit: []
};
var updated = function mixDef(mixin) {
var mixed = {};
if (mixin.mixins) {
mixin.mixins.forEach(function (subMixin) {
_.extend(mixed, mixDef(subMixin));
});
}
_.extend(mixed, mixin);
Object.keys(composed).forEach(function (composable) {
if (mixin.hasOwnProperty(composable)) {
composed[composable].push(mixin[composable]);
}
});
return mixed;
}(def);
if (composed.init.length > 1) {
updated.init = function () {
var args = arguments;
composed.init.forEach(function (init) {
init.apply(this, args);
}, this);
};
}
if (composed.preEmit.length > 1) {
updated.preEmit = function () {
return composed.preEmit.reduce(function (args, preEmit) {
var newValue = preEmit.apply(this, args);
return newValue === undefined ? args : [newValue];
}.bind(this), arguments);
};
}
if (composed.shouldEmit.length > 1) {
updated.shouldEmit = function () {
var args = arguments;
return !composed.shouldEmit.some(function (shouldEmit) {
return !shouldEmit.apply(this, args);
}, this);
};
}
Object.keys(composed).forEach(function (composable) {
if (composed[composable].length === 1) {
updated[composable] = composed[composable][0];
}
});
return updated;
}
},{"./utils":13}],13:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.capitalize = capitalize;
exports.callbackName = callbackName;
exports.isObject = isObject;
exports.extend = extend;
exports.isFunction = isFunction;
exports.nextTick = nextTick;
exports.object = object;
exports.isArguments = isArguments;
exports.throwIf = throwIf;
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function callbackName(string, prefix) {
prefix = prefix || "on";
return prefix + exports.capitalize(string);
}
/*
* isObject, extend, isFunction, isArguments are taken from underscore/lodash in
* order to remove the dependency
*/
function isObject(obj) {
var type = typeof obj === "undefined" ? "undefined" : _typeof(obj);
return type === "function" || type === "object" && !!obj;
}
function extend(obj) {
if (!isObject(obj)) {
return obj;
}
var source, keys, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
keys = Object.keys(source);
for (var j = 0; j < keys.length; j++) {
prop = keys[j];
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
var propertyDescriptor = Object.getOwnPropertyDescriptor(source, prop);
Object.defineProperty(obj, prop, propertyDescriptor);
} else {
obj[prop] = source[prop];
}
}
}
return obj;
}
function isFunction(value) {
return typeof value === "function";
}
exports.EventEmitter = require("eventemitter3");
function nextTick(callback) {
setTimeout(callback, 0);
}
function object(keys, vals) {
var o = {},
i = 0;
for (; i < keys.length; i++) {
o[keys[i]] = vals[i];
}
return o;
}
function isArguments(value) {
return (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" && "callee" in value && typeof value.length === "number";
}
function throwIf(val, msg) {
if (val) {
throw Error(msg || val);
}
}
},{"eventemitter3":1}],14:[function(require,module,exports){
var _ = require('reflux-core/lib/utils'),
ListenerMethods = require('reflux-core/lib/ListenerMethods');
/**
* A module meant to be consumed as a mixin by a React component. Supplies the methods from
* `ListenerMethods` mixin and takes care of teardown of subscriptions.
* Note that if you're using the `connect` mixin you don't need this mixin, as connect will
* import everything this mixin contains!
*/
module.exports = _.extend({
/**
* Cleans up all listener previously registered.
*/
componentWillUnmount: ListenerMethods.stopListeningToAll
}, ListenerMethods);
},{"reflux-core/lib/ListenerMethods":4,"reflux-core/lib/utils":13}],15:[function(require,module,exports){
/* globals React: false */
var Reflux = require('reflux-core');
Reflux.defineReact = require('./defineReact');
// first try to see if there's a global React var and use it
if (typeof React !== 'undefined' && React) {
Reflux.defineReact(React);
// otherwise we're gonna resort to 'try' stuff in case of other environments
} else {
try {
var R = require("react"); // we ignore this in browserify manually (see grunt file), so it's more of a doublecheck for in node
Reflux.defineReact(R);
} catch (e) {}
}
},{"./defineReact":18,"react":undefined,"reflux-core":10}],16:[function(require,module,exports){
var ListenerMethods = require('reflux-core/lib/ListenerMethods'),
ListenerMixin = require('./ListenerMixin'),
_ = require('reflux-core/lib/utils');
module.exports = function(listenable, key) {
_.throwIf(typeof(key) === 'undefined', 'Reflux.connect() requires a key.');
return {
getInitialState: function() {
if (!_.isFunction(listenable.getInitialState)) {
return {};
}
return _.object([key],[listenable.getInitialState()]);
},
componentDidMount: function() {
var me = this;
_.extend(me, ListenerMethods);
this.listenTo(listenable, function(v) {
me.setState(_.object([key],[v]));
});
},
componentWillUnmount: ListenerMixin.componentWillUnmount
};
};
},{"./ListenerMixin":14,"reflux-core/lib/ListenerMethods":4,"reflux-core/lib/utils":13}],17:[function(require,module,exports){
var ListenerMethods = require('reflux-core/lib/ListenerMethods'),
ListenerMixin = require('./ListenerMixin'),
_ = require('reflux-core/lib/utils');
module.exports = function(listenable, key, filterFunc) {
_.throwIf(_.isFunction(key), 'Reflux.connectFilter() requires a key.');
return {
getInitialState: function() {
if (!_.isFunction(listenable.getInitialState)) {
return {};
}
// Filter initial payload from store.
var result = filterFunc.call(this, listenable.getInitialState());
if (typeof(result) !== 'undefined') {
return _.object([key], [result]);
} else {
return {};
}
},
componentDidMount: function() {
var me = this;
_.extend(this, ListenerMethods);
this.listenTo(listenable, function(value) {
var result = filterFunc.call(me, value);
me.setState(_.object([key], [result]));
});
},
componentWillUnmount: ListenerMixin.componentWillUnmount
};
};
},{"./ListenerMixin":14,"reflux-core/lib/ListenerMethods":4,"reflux-core/lib/utils":13}],18:[function(require,module,exports){
/* globals React: false */
var Reflux = require('reflux-core');
/**
* Reflux.defineReact function where you can manually supply
* the React object in order to create in case Reflux needs to load before
* React or there is a modular environment where there won't be a global
* React variable.
* @note The third param is for internal usage only.
*/
var _react, _defined = false;
function defineReact(react, noLongerUsed, extend)
{
var proto, _extend;
// if no Reflux object is yet available then return and just wait until defineReact is called manually with it
try {
_react = react || _react || React;
_extend = extend || _react.Component;
} catch (e) {
return;
}
// if Reflux and React aren't present then ignore, wait until they are properly present
// also ignore if it's been called before UNLESS there's manual extending happening
if (!_react || !_extend || (_defined && !extend)) {
return;
}
// ----------- BEGIN Reflux.Component ------------
/**
* Reflux.Component:
* An implementation for idiomatic React.js classes that mix with
* Reflux stores. To utilize extend Reflux.Component instead of
* React.Component. Then you may hook any Reflux store that has a
* `this.state` property containing its state values to the component
* via `this.store` or an Array of Reflux stores via `this.stores` in
* the component's constructor (similar to how you assign initial state
* in the constructor in ES6 style React). The default values of the
* stores will automatically reflect in the component's state, and any
* further `trigger` calls from that store will update properties passed
* in the trigger into the component automatically.
*/
var RefluxComponent = function(props) {
_extend.call(this, props);
};
// equivalent of `extends React.Component` or other class if provided via `extend` param
ext(RefluxComponent, _extend);
proto = RefluxComponent.prototype;
/**
* this.storeKeys
* When this is a falsey value (null by default) the component mixes in
* all properties from the stores attached to it and updates on changes
* from all of them. When set to an array of string keys it will only
* utilized state property names of those keys in any store attached. This
* lets you choose which parts of stores update the component on a component-
* by-component basis. If using this it is best set in the constructor.
*/
proto.storeKeys = null;
// on the mounting of the component that is where the store/stores are attached and initialized if needed
proto.componentWillMount = function () {
// if there is a this.store then simply push it onto the this.stores array or make one if needed
if (this.store) {
if (Array.isArray(this.stores)) {
this.stores.unshift(this.store);
} else {
this.stores = [this.store];
}
}
if (this.stores) {
this.__storeunsubscribes__ = this.__storeunsubscribes__ || [];
var sS = this.setState.bind(this);
// this handles the triggering of a store, checking what's updated if proto.storeKeys is utilized
var onStoreTrigger = function(obj){
var updateObj = filterByStoreKeys(this.storeKeys, obj);
if (updateObj) {
sS(updateObj);
}
}.bind(this);
// for each store in this.stores...
for (var i = 0, ii = this.stores.length; i < ii; i++) {
var str = this.stores[i];
// if it has the .isES6Store property then we know it's a class getting passed, not an instance
if (str.isES6Store) {
var storeId = str.id;
// if there is NOT a .singleton property on the store then this store has not been initialized yet, so do so
if (!str.singleton) {
str.singleton = new str();
if (storeId) {
Reflux.stores[storeId] = str.singleton;
}
}
// before we weren't sure if we were working with an instance or class, so now we know an instance is created set it
// to the variables we were using so that we can just continue on knowing it's the instance we're working with
this.stores[i] = str = str.singleton;
// the instance should have an .id property as well if the class does, so set that here
str.id = storeId;
// if there is an id and there is a global state property for this store then merge
// the properties from that global state into the default state of the store AND then
// set the global state to that new state (since it may have previously been partial)
if (storeId && Reflux.GlobalState[storeId]) {
for (var key in Reflux.GlobalState[storeId]) {
str.state[key] = Reflux.GlobalState[storeId][key];
}
Reflux.GlobalState[storeId] = str.state;
// otherwise (if it has an id) set the global state to the default state of the store
} else if (storeId) {
Reflux.GlobalState[storeId] = str.state;
}
// if no id, then no messing with global state
}
// listen/subscribe for the ".trigger()" in the store, and track the unsubscribes so that we can unsubscribe on unmount
this.__storeunsubscribes__.push(str.listen(onStoreTrigger));
// run set state so that it mixes in the props from the store with the component
var updateObj = filterByStoreKeys(this.storeKeys, str.state);
if (updateObj) {
this.setState(updateObj);
}
}
}
// mapStoreToState needs to know if is ready to map or must wait
this.__readytomap__ = true;
// if there are mappings that were delayed, do them now
var dmaps = this.__delayedmaps__;
if (dmaps) {
for (var j=0,jj=dmaps.length; j<jj; j++) {
dmaps[j].func( dmaps[j].state );
}
}
this.__delayedmaps__ = null;
};
// on the unmount phase of the component unsubscribe that which we subscribed earlier to keep our garbage trail clean
proto.componentWillUnmount = function () {
for (var i = 0, ii = this.__storeunsubscribes__.length; i < ii; i++) {
this.__storeunsubscribes__[i]();
}
this.__readytomap__ = false;
};
/**
* this.mapStoreToState
* This function allow you to supply map the state of a store to the
* state of this component manually via your own logic. This method
* is completely separate from this.store/this.stores and/or this.storeKeys.
* Call this function with an ES6 store (class or singleton instance) as the
* first argument and your filter function as the second. Your filter function
* will receive an object of the parts of the ES6 store being updated every
* time its setState is called. Your filter function then returns an object
* which will be merged with the component state (IF it has any properties at all,
* should you return a blank object the component will not rerender).
*/
proto.mapStoreToState = function(store, filterFunc)
{
// make sure we have a proper singleton instance to work with
if (store.isES6Store) {
if (store.singleton) {
store = store.singleton;
} else {
store = Reflux.initStore(store);
}
}
// we need a closure so that the called function can remember the proper filter function to use, so function gets defined here
var self = this;
function onMapStoreTrigger(obj) {
// get an object
var update = filterFunc.call(self, obj);
// if no object returned from filter functions do nothing
if (!update) {
return;
}
// check if the update actually has any mapped props
/*jshint unused: false */
var hasProps = false;
for (var check in update) {
hasProps = true;
break;
}
// if there were props mapped, then update via setState
if (hasProps) {
self.setState(update);
}
}
// add the listener to know when the store is triggered
this.__storeunsubscribes__ = this.__storeunsubscribes__ || [];
this.__storeunsubscribes__.push(store.listen(onMapStoreTrigger));
// now actually run onMapStoreTrigger with the full store state so that we immediately have all store state mapped to component state
if (this.__readytomap__) {
onMapStoreTrigger(store.state);
} else {
this.__delayedmaps__ = this.__delayedmaps__ || [];
this.__delayedmaps__.push({func:onMapStoreTrigger, state:store.state});
}
};
/**
* Reflux.Component.extend(OtherClass)
* This allows you to get classes that extend off of another React.Component
* inheriting class. For example if you're using a third party that uses
* components that allow `class MyComponent extends LibComponent` (where LibComponent
* itself extends React.Component) and you want to use that component with ES6 then
* you can make a class `var MyDualComponent = Reflux.Component.extend(LibComponent);`
* then you can use `class MyComponent extends MyDualComponent` to get the benefits
* of both libraries.
*/
RefluxComponent.extend = function(clss) {
return defineReact(null, null, clss);
};
// if is being manually called with an `extend` argument present then just return the created class
if (extend) {
return RefluxComponent;
}
// otherwise set as Reflux.Component and continue with other normal definitions
Reflux.Component = RefluxComponent;
// ------------ END Reflux.Component ------------
// --------- BEGIN Reflux.Store ------------
/**
* Reflux.Store:
* Also implements optional Reflux.Store class that is idiomatic with
* the React ES6 style. You extend Reflux.Store and then the rest works
* the same as createStore, except the constructor instead of init, and
* it holds state in a state property, and a .setState method is available
* which automatically updates state and does a trigger. Then when using
* with this.store or this.stores in an ES6 component just plass the class,
* it will deal with a singleton instantiation of the class automatically.
*/
var RefluxStore = function() {
// extending doesn't really work well here, so instead we create an internal instance
// and just loop through its properties/methods and make a getter/setter for each
// that will actually be getting and setting on that internal instance.
this.__store__ = Reflux.createStore();
this.state = {};
var self = this;
for (var key in this.__store__) {
/*jshint loopfunc: true */
(function (prop) {
Object.defineProperty(self, prop, {
get: function () { return self.__store__[prop]; },
set: function (v) { self.__store__[prop] = v; }
});
})(key);
}
};
proto = RefluxStore.prototype;
// this defines the listenables property, mostly intended to be set as `this.listenables` in the constructor of the store
// it is essentially a shortcut to the `listenToMany` method
Object.defineProperty(proto, "listenables", {
get: function () {
return this.__listenables__;
},
set: function (v) {
var Combined = {};
if (Array.isArray(v)){
v.forEach(function(obj) {
for (var key in obj) {
Combined[key] = obj[key];
}
});
} else {
Combined = v;
}
this.__listenables__ = Combined;
this.listenToMany(Combined);
},
enumerable: true,
configurable: true
});
// allows simple usage of `this.setState(obj)` within the store to both update the state and trigger the store to update
// components that it is attached to in a simple way that is idiomatic with React
proto.setState = function (obj) {
// Object.assign(this.state, obj); // later turn this to Object.assign and remove loop once support is good enough
for (var key in obj) {
this.state[key] = obj[key];
}
// if there's an id (i.e. it's being tracked by the global state) then make sure to update the global state
if (this.id) {
Reflux.GlobalState[this.id] = this.state;
}
// trigger, because any component it's attached to is listening and will merge the store state into its own on a store trigger
this.trigger(obj);
};
// this is a static property so that other code can identify that this is a Reflux.Store class
Object.defineProperty(RefluxStore, "isES6Store", {
get: function () {
return true;
},
enumerable: true,
configurable: true
});
/* NOTE:
If a Reflux.Store definition is given a static id property and used
properly within a Reflux.Component or with Reflux.initStore then
it will be added to the Reflux.GlobalState object which automatically tracks the
current state of all such defined stores in the program. */
Reflux.Store = RefluxStore;
// ----------- END Reflux.Store -------------
// --------- BEGIN Reflux Static Props/Methods ------------
/**
* Reflux.GlobalState is where data is stored for any Reflux.Store that has a static id property. Each store's
* state will be on the Reflux.GlobalState object with the id as the key. So a store with the id "MyStore" and
* a state {"color":"red"} will end up with a Reflux.GlobalState of {"MyStore":{"color":"red"}}
* Reflux.GlobalState is an accessible part of the API. However, keep in mind that non-primitive properties you
* read off of it will continue to mutate and you can only manually mutate Reflux.GlobalState BEFORE any component
* mounting of components with ES6 stores. For more functionality look to Reflux.setGlobalState to change the global
* state at any point, and Reflux.getGlobalState to return a deep clone of the Reflux.GlobalState object which will
* not continue to mutate as Reflux.GlobalState continues to mutate.
*/
Reflux.GlobalState = Reflux.GlobalState || {};
/**
* Reflux.stores
* All initialized stores that have an id will have a reference to their singleton stored here with the key being the id.
*/
Reflux.stores = {};
/**
* Reflux.getGlobalState takes no arguments, and returns a deep clone of Reflux.GlobalState
* which will not continue to mutate as Reflux.GlobalState does. It can essentially store
* snapshots of the global state as the program goes for saving or for in-app time travel.
*/
Reflux.getGlobalState = function() {
return clone(Reflux.GlobalState);
};
/**
* Reflux.setGlobalState takes one argument that is a representation of the a possible
* global state. It updates all stores in the program to represent data in that given state.
* This includes triggering those stores so that that state is represented in any Reflux.Component
* instances they are attached to. Partial states may be given to it, and only the represented
* stores/state values will be updated.
*/
Reflux.setGlobalState = function(obj) {
for (var storeID in obj) {
if (Reflux.stores[storeID]) {
Reflux.stores[storeID].setState(obj[storeID]);
} else {
Reflux.GlobalState[storeID] = obj[storeID];
}
}
};
/**
* Reflux.initStore takes one argument (a class that extends Reflux.Store) and returns a singleton
* intance of that class. Its main functionality is to be able to mimic what happens to stores attached to
* this.store or this.stores during the mounting phase of a component without having to actually attach the
* store to a component in order to work properly with the global state.
*/
// Reflux.initializeGlobalStore is kept for backwards compatibility, but deprecated since the function is
// now for more broad instantiation of globally stored AND non-globally stored classes
Reflux.initializeGlobalStore = Reflux.initStore = function(str) {
var storeId = str.id;
// if they're initializing something twice then we're done already, return it
if (str.singleton) {
return str.singleton;
}
// if no id then it's easy: just make new instance and set to singleton
if (!storeId) {
str.singleton = new str();
return str.singleton;
}
// create the singleton and assign it to the class's singleton static property
var inst = str.singleton = new str();
// store it on the Reflux.stores array to be accessible later
Reflux.stores[storeId] = inst;
// the singleton instance itself should also have the id property of the class
inst.id = storeId;
// if the global state has something set for this id, copy it to the state and then
// make sure to set the global state to the end result, since it may have only been partial
if (Reflux.GlobalState[storeId]) {
for (var key in Reflux.GlobalState[storeId]) {
inst.state[key] = Reflux.GlobalState[storeId][key];
}
Reflux.GlobalState[storeId] = inst.state;
// otherwise just set the global state to the default state of the class
} else {
Reflux.GlobalState[storeId] = inst.state;
}
// returns the singleton itself, though it will also be accessible as as `MyClass.singleton`
return inst;
};
// --------- END Reflux Static Props/Methods ------------
// so it knows not to redefine Reflux static stuff and stores if called again
_defined = true;
}
// filters a state object by storeKeys array (if it exists)
// if filtering and obj contains no properties to use, returns false to let the component know not to update
function filterByStoreKeys(storeKeys, obj)
{
// if there are not storeKeys defined then simply return the whole original object
if (!storeKeys) {
return obj;
}
// otherwise go through and only update properties that are in the storeKeys array, and return straight false if there are none
var doUpdate = false;
var updateObj = {};
for (var i = 0, ii = storeKeys.length; i < ii; i++) {
var prop = storeKeys[i];
if (obj.hasOwnProperty(prop)) {
doUpdate = true;
updateObj[prop] = obj[prop];
}
}
return doUpdate ? updateObj : false;
}
// used as a well tested way to mimic ES6 class `extends` in ES5 code
function ext(d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) {
d[p] = b[p];
}
}
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
// this is utilized by some of the global state functionality in order to get a clone that will
// not continue to be modified as the GlobalState mutates
function clone(frm, to) {
if (frm === null || typeof frm !== "object") {
return frm;
}
if (frm.constructor !== Object && frm.constructor !== Array) {
return frm;
}
if (frm.constructor === Date || frm.constructor === RegExp || frm.constructor === Function ||
frm.constructor === String || frm.constructor === Number || frm.constructor === Boolean) {
return new frm.constructor(frm);
}
to = to || new frm.constructor();
for (var name in frm) {
to[name] = typeof to[name] === "undefined" ? clone(frm[name], null) : to[name];
}
return to;
}
module.exports = defineReact;
},{"reflux-core":10}],19:[function(require,module,exports){
var Reflux = require('reflux-core');
Reflux.connect = require('./connect');
Reflux.connectFilter = require('./connectFilter');
Reflux.ListenerMixin = require('./ListenerMixin');
Reflux.listenTo = require('./listenTo');
Reflux.listenToMany = require('./listenToMany');
require('./addES6');
module.exports = Reflux;
},{"./ListenerMixin":14,"./addES6":15,"./connect":16,"./connectFilter":17,"./listenTo":20,"./listenToMany":21,"reflux-core":10}],20:[function(require,module,exports){
var ListenerMethods = require('reflux-core/lib/ListenerMethods');
/**
* A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`,
* without having to manually set listeners in the `componentDidMount` method.
*
* @param {Action|Store} listenable An Action or Store that should be
* listened to.
* @param {Function|String} callback The callback to register as event handler
* @param {Function|String} defaultCallback The callback to register as default handler
* @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable.
*/
module.exports = function(listenable,callback,initial){
return {
/**
* Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`
* and then make the call to `listenTo` with the arguments provided to the factory function
*/
componentDidMount: function() {
for(var m in ListenerMethods){
if (this[m] !== ListenerMethods[m]){
if (this[m]){
throw "Can't have other property '"+m+"' when using Reflux.listenTo!";
}
this[m] = ListenerMethods[m];
}
}
this.listenTo(listenable,callback,initial);
},
/**
* Cleans up all listener previously registered.
*/
componentWillUnmount: ListenerMethods.stopListeningToAll
};
};
},{"reflux-core/lib/ListenerMethods":4}],21:[function(require,module,exports){
var ListenerMethods = require('reflux-core/lib/ListenerMethods');
/**
* A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`,
* without having to manually set listeners in the `componentDidMount` method. This version is used
* to automatically set up a `listenToMany` call.
*
* @param {Object} listenables An object of listenables
* @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables.
*/
module.exports = function(listenables){
return {
/**
* Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`
* and then make the call to `listenTo` with the arguments provided to the factory function
*/
componentDidMount: function() {
for(var m in ListenerMethods){
if (this[m] !== ListenerMethods[m]){
if (this[m]){
throw "Can't have other property '"+m+"' when using Reflux.listenToMany!";
}
this[m] = ListenerMethods[m];
}
}
this.listenToMany(listenables);
},
/**
* Cleans up all listener previously registered.
*/
componentWillUnmount: ListenerMethods.stopListeningToAll
};
};
},{"reflux-core/lib/ListenerMethods":4}]},{},[19])(19)
});
|
src/parser/monk/mistweaver/modules/spells/azeritetraits/FontOfLife.js
|
sMteX/WoWAnalyzer
|
import React from 'react';
import { formatNumber, formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS';
import AbilityTracker from 'parser/shared/modules/AbilityTracker';
import HIT_TYPES from 'game/HIT_TYPES';
import SpellLink from 'common/SpellLink';
import StatTracker from 'parser/shared/modules/StatTracker';
import Analyzer from 'parser/core/Analyzer';
import Combatants from 'parser/shared/modules/Combatants';
import AzeritePowerStatistic from 'interface/statistics/AzeritePowerStatistic';
import { MISTWEAVER_HEALING_AURA, ESSENCE_FONT_SPELLPOWER_COEFFICIENT } from '../../../constants';
class FontOfLife extends Analyzer {
static dependencies = {
combatants: Combatants,
statTracker: StatTracker,
abilityTracker: AbilityTracker,
};
getAbility = spellId => this.abilityTracker.getAbility(spellId);
/**
* Your Essence Font's initial heal is increased by 150 and has a chance to reduce the cooldown of Thunder Focus Tea by 1 sec.
*/
constructor(...args) {
super(...args);
this.active = this.selectedCombatant.hasTrait(SPELLS.FONT_OF_LIFE.id);
}
healing = 0;
baseHeal = 0
on_byPlayer_heal(event) {
const spellId = event.ability.guid;
if (event.overheal > 0) { // Exit as spell has overhealed and no need for adding in the additional healing from the trait
return;
}
if (spellId === SPELLS.ESSENCE_FONT_BUFF.id && event.tick !== true) {
const versPerc = this.statTracker.currentVersatilityPercentage;
const mwAura = MISTWEAVER_HEALING_AURA;
const intRating = this.statTracker.currentIntellectRating;
const healAmount = event.amount + (event.absorbed || 0);
this.baseHeal = (intRating * ESSENCE_FONT_SPELLPOWER_COEFFICIENT) * mwAura * (1 + versPerc);
if (event.hitType === HIT_TYPES.CRIT) {
this.baseHeal = this.baseHeal * 2;
}
this.healing += (healAmount - this.baseHeal);
}
}
statistic() {
return (
<AzeritePowerStatistic
size="flexible"
tooltip={`Added a total of ${formatNumber(this.healing)} to your Essence Font Bolts.`}
>
<div className="pad">
<label><SpellLink id={SPELLS.FONT_OF_LIFE.id} /></label>
<div className="value" style={{ marginTop: 15 }}>
<img
src="/img/healing.png"
alt="Healing"
className="icon"
/>
{ formatPercentage(this.healing / this.getAbility(SPELLS.ESSENCE_FONT_BUFF.id).healingEffective)}% <small>of Essence Font Healing</small>
</div>
</div>
</AzeritePowerStatistic>
);
}
}
export default FontOfLife;
|
src/deviceMapping.js
|
aspic/wemo-control
|
import React from 'react';
import { LightDevice, SocketDevice, SensorDevice} from './index.js';
export function mapDevices(devices, control) {
return devices.map(function (device) {
if (device.type === 'light') {
return <LightDevice key={device.id} device={device} valueControl={control}/>;
} else if(device.type === 'socket') {
return <SocketDevice key={device.id} device={device} valueControl={control}/>;
} else if(device.type === 'sensor') {
return <SensorDevice key={device.id} device={device}/>;
}
});
}
|
ajax/libs/highcharts/4.1.2/highcharts.src.js
|
thisispiers/cdnjs
|
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
* @license Highcharts JS v4.1.2 (2015-02-27)
*
* (c) 2009-2014 Torstein Honsi
*
* License: www.highcharts.com/license
*/
// JSLint options:
/*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console, each, grep */
/*jslint ass: true, sloppy: true, forin: true, plusplus: true, nomen: true, vars: true, regexp: true, newcap: true, browser: true, continue: true, white: true */
(function () {
// encapsulated variables
var UNDEFINED,
doc = document,
win = window,
math = Math,
mathRound = math.round,
mathFloor = math.floor,
mathCeil = math.ceil,
mathMax = math.max,
mathMin = math.min,
mathAbs = math.abs,
mathCos = math.cos,
mathSin = math.sin,
mathPI = math.PI,
deg2rad = mathPI * 2 / 360,
// some variables
userAgent = navigator.userAgent,
isOpera = win.opera,
isIE = /(msie|trident)/i.test(userAgent) && !isOpera,
docMode8 = doc.documentMode === 8,
isWebKit = /AppleWebKit/.test(userAgent),
isFirefox = /Firefox/.test(userAgent),
isTouchDevice = /(Mobile|Android|Windows Phone)/.test(userAgent),
SVG_NS = 'http://www.w3.org/2000/svg',
hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect,
hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38
useCanVG = !hasSVG && !isIE && !!doc.createElement('canvas').getContext,
Renderer,
hasTouch,
symbolSizes = {},
idCounter = 0,
garbageBin,
defaultOptions,
dateFormat, // function
globalAnimation,
pathAnim,
timeUnits,
noop = function () { return UNDEFINED; },
charts = [],
chartCount = 0,
PRODUCT = 'Highcharts',
VERSION = '4.1.2',
// some constants for frequently used strings
DIV = 'div',
ABSOLUTE = 'absolute',
RELATIVE = 'relative',
HIDDEN = 'hidden',
PREFIX = 'highcharts-',
VISIBLE = 'visible',
PX = 'px',
NONE = 'none',
M = 'M',
L = 'L',
numRegex = /^[0-9]+$/,
NORMAL_STATE = '',
HOVER_STATE = 'hover',
SELECT_STATE = 'select',
marginNames = ['plotTop', 'marginRight', 'marginBottom', 'plotLeft'],
// Object for extending Axis
AxisPlotLineOrBandExtension,
// constants for attributes
STROKE_WIDTH = 'stroke-width',
// time methods, changed based on whether or not UTC is used
Date, // Allow using a different Date class
makeTime,
timezoneOffset,
getTimezoneOffset,
getMinutes,
getHours,
getDay,
getDate,
getMonth,
getFullYear,
setMinutes,
setHours,
setDate,
setMonth,
setFullYear,
// lookup over the types and the associated classes
seriesTypes = {},
Highcharts;
// The Highcharts namespace
Highcharts = win.Highcharts = win.Highcharts ? error(16, true) : {};
Highcharts.seriesTypes = seriesTypes;
/**
* Extend an object with the members of another
* @param {Object} a The object to be extended
* @param {Object} b The object to add to the first one
*/
var extend = Highcharts.extend = function (a, b) {
var n;
if (!a) {
a = {};
}
for (n in b) {
a[n] = b[n];
}
return a;
};
/**
* Deep merge two or more objects and return a third object. If the first argument is
* true, the contents of the second object is copied into the first object.
* Previously this function redirected to jQuery.extend(true), but this had two limitations.
* First, it deep merged arrays, which lead to workarounds in Highcharts. Second,
* it copied properties from extended prototypes.
*/
function merge() {
var i,
args = arguments,
len,
ret = {},
doCopy = function (copy, original) {
var value, key;
// An object is replacing a primitive
if (typeof copy !== 'object') {
copy = {};
}
for (key in original) {
if (original.hasOwnProperty(key)) {
value = original[key];
// Copy the contents of objects, but not arrays or DOM nodes
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'
&& key !== 'renderTo' && typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value);
// Primitives and arrays are copied over directly
} else {
copy[key] = original[key];
}
}
}
return copy;
};
// If first argument is true, copy into the existing object. Used in setOptions.
if (args[0] === true) {
ret = args[1];
args = Array.prototype.slice.call(args, 2);
}
// For each argument, extend the return
len = args.length;
for (i = 0; i < len; i++) {
ret = doCopy(ret, args[i]);
}
return ret;
}
/**
* Shortcut for parseInt
* @param {Object} s
* @param {Number} mag Magnitude
*/
function pInt(s, mag) {
return parseInt(s, mag || 10);
}
/**
* Check for string
* @param {Object} s
*/
function isString(s) {
return typeof s === 'string';
}
/**
* Check for object
* @param {Object} obj
*/
function isObject(obj) {
return obj && typeof obj === 'object';
}
/**
* Check for array
* @param {Object} obj
*/
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}
/**
* Check for number
* @param {Object} n
*/
function isNumber(n) {
return typeof n === 'number';
}
function log2lin(num) {
return math.log(num) / math.LN10;
}
function lin2log(num) {
return math.pow(10, num);
}
/**
* Remove last occurence of an item from an array
* @param {Array} arr
* @param {Mixed} item
*/
function erase(arr, item) {
var i = arr.length;
while (i--) {
if (arr[i] === item) {
arr.splice(i, 1);
break;
}
}
//return arr;
}
/**
* Returns true if the object is not null or undefined. Like MooTools' $.defined.
* @param {Object} obj
*/
function defined(obj) {
return obj !== UNDEFINED && obj !== null;
}
/**
* Set or get an attribute or an object of attributes. Can't use jQuery attr because
* it attempts to set expando properties on the SVG element, which is not allowed.
*
* @param {Object} elem The DOM element to receive the attribute(s)
* @param {String|Object} prop The property or an abject of key-value pairs
* @param {String} value The value if a single property is set
*/
function attr(elem, prop, value) {
var key,
ret;
// if the prop is a string
if (isString(prop)) {
// set the value
if (defined(value)) {
elem.setAttribute(prop, value);
// get the value
} else if (elem && elem.getAttribute) { // elem not defined when printing pie demo...
ret = elem.getAttribute(prop);
}
// else if prop is defined, it is a hash of key/value pairs
} else if (defined(prop) && isObject(prop)) {
for (key in prop) {
elem.setAttribute(key, prop[key]);
}
}
return ret;
}
/**
* Check if an element is an array, and if not, make it into an array. Like
* MooTools' $.splat.
*/
function splat(obj) {
return isArray(obj) ? obj : [obj];
}
/**
* Return the first value that is defined. Like MooTools' $.pick.
*/
var pick = Highcharts.pick = function () {
var args = arguments,
i,
arg,
length = args.length;
for (i = 0; i < length; i++) {
arg = args[i];
if (arg !== UNDEFINED && arg !== null) {
return arg;
}
}
};
/**
* Set CSS on a given element
* @param {Object} el
* @param {Object} styles Style object with camel case property names
*/
function css(el, styles) {
if (isIE && !hasSVG) { // #2686
if (styles && styles.opacity !== UNDEFINED) {
styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
}
}
extend(el.style, styles);
}
/**
* Utility function to create element with attributes and styles
* @param {Object} tag
* @param {Object} attribs
* @param {Object} styles
* @param {Object} parent
* @param {Object} nopad
*/
function createElement(tag, attribs, styles, parent, nopad) {
var el = doc.createElement(tag);
if (attribs) {
extend(el, attribs);
}
if (nopad) {
css(el, {padding: 0, border: NONE, margin: 0});
}
if (styles) {
css(el, styles);
}
if (parent) {
parent.appendChild(el);
}
return el;
}
/**
* Extend a prototyped class by new members
* @param {Object} parent
* @param {Object} members
*/
function extendClass(parent, members) {
var object = function () { return UNDEFINED; };
object.prototype = new parent();
extend(object.prototype, members);
return object;
}
/**
* Pad a string to a given length by adding 0 to the beginning
* @param {Number} number
* @param {Number} length
*/
function pad(number, length) {
// Create an array of the remaining length +1 and join it with 0's
return new Array((length || 2) + 1 - String(number).length).join(0) + number;
}
/**
* Wrap a method with extended functionality, preserving the original function
* @param {Object} obj The context object that the method belongs to
* @param {String} method The name of the method to extend
* @param {Function} func A wrapper function callback. This function is called with the same arguments
* as the original function, except that the original function is unshifted and passed as the first
* argument.
*/
var wrap = Highcharts.wrap = function (obj, method, func) {
var proceed = obj[method];
obj[method] = function () {
var args = Array.prototype.slice.call(arguments);
args.unshift(proceed);
return func.apply(this, args);
};
};
function getTZOffset(timestamp) {
return ((getTimezoneOffset && getTimezoneOffset(timestamp)) || timezoneOffset || 0) * 60000;
}
/**
* Based on http://www.php.net/manual/en/function.strftime.php
* @param {String} format
* @param {Number} timestamp
* @param {Boolean} capitalize
*/
dateFormat = function (format, timestamp, capitalize) {
if (!defined(timestamp) || isNaN(timestamp)) {
return 'Invalid date';
}
format = pick(format, '%Y-%m-%d %H:%M:%S');
var date = new Date(timestamp - getTZOffset(timestamp)),
key, // used in for constuct below
// get the basic time values
hours = date[getHours](),
day = date[getDay](),
dayOfMonth = date[getDate](),
month = date[getMonth](),
fullYear = date[getFullYear](),
lang = defaultOptions.lang,
langWeekdays = lang.weekdays,
// List all format keys. Custom formats can be added from the outside.
replacements = extend({
// Day
'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'
'A': langWeekdays[day], // Long weekday, like 'Monday'
'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31
'e': dayOfMonth, // Day of the month, 1 through 31
'w': day,
// Week (none implemented)
//'W': weekNumber(),
// Month
'b': lang.shortMonths[month], // Short month, like 'Jan'
'B': lang.months[month], // Long month, like 'January'
'm': pad(month + 1), // Two digit month number, 01 through 12
// Year
'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009
'Y': fullYear, // Four digits year, like 2009
// Time
'H': pad(hours), // Two digits hours in 24h format, 00 through 23
'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11
'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12
'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59
'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM
'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM
'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59
'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby)
}, Highcharts.dateFormats);
// do the replaces
for (key in replacements) {
while (format.indexOf('%' + key) !== -1) { // regex would do it in one line, but this is faster
format = format.replace('%' + key, typeof replacements[key] === 'function' ? replacements[key](timestamp) : replacements[key]);
}
}
// Optionally capitalize the string and return
return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format;
};
/**
* Format a single variable. Similar to sprintf, without the % prefix.
*/
function formatSingle(format, val) {
var floatRegex = /f$/,
decRegex = /\.([0-9])/,
lang = defaultOptions.lang,
decimals;
if (floatRegex.test(format)) { // float
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
val = Highcharts.numberFormat(
val,
decimals,
lang.decimalPoint,
format.indexOf(',') > -1 ? lang.thousandsSep : ''
);
}
} else {
val = dateFormat(format, val);
}
return val;
}
/**
* Format a string according to a subset of the rules of Python's String.format method.
*/
function format(str, ctx) {
var splitter = '{',
isInside = false,
segment,
valueAndFormat,
path,
i,
len,
ret = [],
val,
index;
while ((index = str.indexOf(splitter)) !== -1) {
segment = str.slice(0, index);
if (isInside) { // we're on the closing bracket looking back
valueAndFormat = segment.split(':');
path = valueAndFormat.shift().split('.'); // get first and leave format
len = path.length;
val = ctx;
// Assign deeper paths
for (i = 0; i < len; i++) {
val = val[path[i]];
}
// Format the replacement
if (valueAndFormat.length) {
val = formatSingle(valueAndFormat.join(':'), val);
}
// Push the result and advance the cursor
ret.push(val);
} else {
ret.push(segment);
}
str = str.slice(index + 1); // the rest
isInside = !isInside; // toggle
splitter = isInside ? '}' : '{'; // now look for next matching bracket
}
ret.push(str);
return ret.join('');
}
/**
* Get the magnitude of a number
*/
function getMagnitude(num) {
return math.pow(10, mathFloor(math.log(num) / math.LN10));
}
/**
* Take an interval and normalize it to multiples of 1, 2, 2.5 and 5
* @param {Number} interval
* @param {Array} multiples
* @param {Number} magnitude
* @param {Object} options
*/
function normalizeTickInterval(interval, multiples, magnitude, allowDecimals, preventExceed) {
var normalized,
i,
retInterval = interval;
// round to a tenfold of 1, 2, 2.5 or 5
magnitude = pick(magnitude, 1);
normalized = interval / magnitude;
// multiples for a linear scale
if (!multiples) {
multiples = [1, 2, 2.5, 5, 10];
// the allowDecimals option
if (allowDecimals === false) {
if (magnitude === 1) {
multiples = [1, 2, 5, 10];
} else if (magnitude <= 0.1) {
multiples = [1 / magnitude];
}
}
}
// normalize the interval to the nearest multiple
for (i = 0; i < multiples.length; i++) {
retInterval = multiples[i];
if ((preventExceed && retInterval * magnitude >= interval) || // only allow tick amounts smaller than natural
(!preventExceed && (normalized <= (multiples[i] + (multiples[i + 1] || multiples[i])) / 2))) {
break;
}
}
// multiply back to the correct magnitude
retInterval *= magnitude;
return retInterval;
}
/**
* Utility method that sorts an object array and keeping the order of equal items.
* ECMA script standard does not specify the behaviour when items are equal.
*/
function stableSort(arr, sortFunction) {
var length = arr.length,
sortValue,
i;
// Add index to each item
for (i = 0; i < length; i++) {
arr[i].ss_i = i; // stable sort index
}
arr.sort(function (a, b) {
sortValue = sortFunction(a, b);
return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;
});
// Remove index from items
for (i = 0; i < length; i++) {
delete arr[i].ss_i; // stable sort index
}
}
/**
* Non-recursive method to find the lowest member of an array. Math.min raises a maximum
* call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
* method is slightly slower, but safe.
*/
function arrayMin(data) {
var i = data.length,
min = data[0];
while (i--) {
if (data[i] < min) {
min = data[i];
}
}
return min;
}
/**
* Non-recursive method to find the lowest member of an array. Math.min raises a maximum
* call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
* method is slightly slower, but safe.
*/
function arrayMax(data) {
var i = data.length,
max = data[0];
while (i--) {
if (data[i] > max) {
max = data[i];
}
}
return max;
}
/**
* Utility method that destroys any SVGElement or VMLElement that are properties on the given object.
* It loops all properties and invokes destroy if there is a destroy method. The property is
* then delete'ed.
* @param {Object} The object to destroy properties on
* @param {Object} Exception, do not destroy this property, only delete it.
*/
function destroyObjectProperties(obj, except) {
var n;
for (n in obj) {
// If the object is non-null and destroy is defined
if (obj[n] && obj[n] !== except && obj[n].destroy) {
// Invoke the destroy
obj[n].destroy();
}
// Delete the property from the object.
delete obj[n];
}
}
/**
* Discard an element by moving it to the bin and delete
* @param {Object} The HTML node to discard
*/
function discardElement(element) {
// create a garbage bin element, not part of the DOM
if (!garbageBin) {
garbageBin = createElement(DIV);
}
// move the node and empty bin
if (element) {
garbageBin.appendChild(element);
}
garbageBin.innerHTML = '';
}
/**
* Provide error messages for debugging, with links to online explanation
*/
function error (code, stop) {
var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code;
if (stop) {
throw msg;
}
// else ...
if (win.console) {
console.log(msg);
}
}
/**
* Fix JS round off float errors
* @param {Number} num
*/
function correctFloat(num) {
return parseFloat(
num.toPrecision(14)
);
}
/**
* Set the global animation to either a given value, or fall back to the
* given chart's animation option
* @param {Object} animation
* @param {Object} chart
*/
function setAnimation(animation, chart) {
globalAnimation = pick(animation, chart.animation);
}
/**
* The time unit lookup
*/
timeUnits = {
millisecond: 1,
second: 1000,
minute: 60000,
hour: 3600000,
day: 24 * 3600000,
week: 7 * 24 * 3600000,
month: 28 * 24 * 3600000,
year: 364 * 24 * 3600000
};
/**
* Format a number and return a string based on input settings
* @param {Number} number The input number to format
* @param {Number} decimals The amount of decimals
* @param {String} decPoint The decimal point, defaults to the one given in the lang options
* @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options
*/
Highcharts.numberFormat = function (number, decimals, decPoint, thousandsSep) {
var lang = defaultOptions.lang,
// http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/
n = +number || 0,
c = decimals === -1 ?
mathMin((n.toString().split('.')[1] || '').length, 20) : // Preserve decimals. Not huge numbers (#3793).
(isNaN(decimals = mathAbs(decimals)) ? 2 : decimals),
d = decPoint === undefined ? lang.decimalPoint : decPoint,
t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep,
s = n < 0 ? "-" : "",
i = String(pInt(n = mathAbs(n).toFixed(c))),
j = i.length > 3 ? i.length % 3 : 0;
return (s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) +
(c ? d + mathAbs(n - i).toFixed(c).slice(2) : ""));
};
/**
* Path interpolation algorithm used across adapters
*/
pathAnim = {
/**
* Prepare start and end values so that the path can be animated one to one
*/
init: function (elem, fromD, toD) {
fromD = fromD || '';
var shift = elem.shift,
bezier = fromD.indexOf('C') > -1,
numParams = bezier ? 7 : 3,
endLength,
slice,
i,
start = fromD.split(' '),
end = [].concat(toD), // copy
startBaseLine,
endBaseLine,
sixify = function (arr) { // in splines make move points have six parameters like bezier curves
i = arr.length;
while (i--) {
if (arr[i] === M) {
arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);
}
}
};
if (bezier) {
sixify(start);
sixify(end);
}
// pull out the base lines before padding
if (elem.isArea) {
startBaseLine = start.splice(start.length - 6, 6);
endBaseLine = end.splice(end.length - 6, 6);
}
// if shifting points, prepend a dummy point to the end path
if (shift <= end.length / numParams && start.length === end.length) {
while (shift--) {
end = [].concat(end).splice(0, numParams).concat(end);
}
}
elem.shift = 0; // reset for following animations
// copy and append last point until the length matches the end length
if (start.length) {
endLength = end.length;
while (start.length < endLength) {
//bezier && sixify(start);
slice = [].concat(start).splice(start.length - numParams, numParams);
if (bezier) { // disable first control point
slice[numParams - 6] = slice[numParams - 2];
slice[numParams - 5] = slice[numParams - 1];
}
start = start.concat(slice);
}
}
if (startBaseLine) { // append the base lines for areas
start = start.concat(startBaseLine);
end = end.concat(endBaseLine);
}
return [start, end];
},
/**
* Interpolate each value of the path and return the array
*/
step: function (start, end, pos, complete) {
var ret = [],
i = start.length,
startVal;
if (pos === 1) { // land on the final path without adjustment points appended in the ends
ret = complete;
} else if (i === end.length && pos < 1) {
while (i--) {
startVal = parseFloat(start[i]);
ret[i] =
isNaN(startVal) ? // a letter instruction like M or L
start[i] :
pos * (parseFloat(end[i] - startVal)) + startVal;
}
} else { // if animation is finished or length not matching, land on right value
ret = end;
}
return ret;
}
};
(function ($) {
/**
* The default HighchartsAdapter for jQuery
*/
win.HighchartsAdapter = win.HighchartsAdapter || ($ && {
/**
* Initialize the adapter by applying some extensions to jQuery
*/
init: function (pathAnim) {
// extend the animate function to allow SVG animations
var Fx = $.fx;
/*jslint unparam: true*//* allow unused param x in this function */
$.extend($.easing, {
easeOutQuad: function (x, t, b, c, d) {
return -c * (t /= d) * (t - 2) + b;
}
});
/*jslint unparam: false*/
// extend some methods to check for elem.attr, which means it is a Highcharts SVG object
$.each(['cur', '_default', 'width', 'height', 'opacity'], function (i, fn) {
var obj = Fx.step,
base;
// Handle different parent objects
if (fn === 'cur') {
obj = Fx.prototype; // 'cur', the getter, relates to Fx.prototype
} else if (fn === '_default' && $.Tween) { // jQuery 1.8 model
obj = $.Tween.propHooks[fn];
fn = 'set';
}
// Overwrite the method
base = obj[fn];
if (base) { // step.width and step.height don't exist in jQuery < 1.7
// create the extended function replacement
obj[fn] = function (fx) {
var elem;
// Fx.prototype.cur does not use fx argument
fx = i ? fx : this;
// Don't run animations on textual properties like align (#1821)
if (fx.prop === 'align') {
return;
}
// shortcut
elem = fx.elem;
// Fx.prototype.cur returns the current value. The other ones are setters
// and returning a value has no effect.
return elem.attr ? // is SVG element wrapper
elem.attr(fx.prop, fn === 'cur' ? UNDEFINED : fx.now) : // apply the SVG wrapper's method
base.apply(this, arguments); // use jQuery's built-in method
};
}
});
// Extend the opacity getter, needed for fading opacity with IE9 and jQuery 1.10+
wrap($.cssHooks.opacity, 'get', function (proceed, elem, computed) {
return elem.attr ? (elem.opacity || 0) : proceed.call(this, elem, computed);
});
// Define the setter function for d (path definitions)
this.addAnimSetter('d', function (fx) {
var elem = fx.elem,
ends;
// Normally start and end should be set in state == 0, but sometimes,
// for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped
// in these cases
if (!fx.started) {
ends = pathAnim.init(elem, elem.d, elem.toD);
fx.start = ends[0];
fx.end = ends[1];
fx.started = true;
}
// Interpolate each value of the path
elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD));
});
/**
* Utility for iterating over an array. Parameters are reversed compared to jQuery.
* @param {Array} arr
* @param {Function} fn
*/
this.each = Array.prototype.forEach ?
function (arr, fn) { // modern browsers
return Array.prototype.forEach.call(arr, fn);
} :
function (arr, fn) { // legacy
var i,
len = arr.length;
for (i = 0; i < len; i++) {
if (fn.call(arr[i], arr[i], i, arr) === false) {
return i;
}
}
};
/**
* Register Highcharts as a plugin in the respective framework
*/
$.fn.highcharts = function () {
var constr = 'Chart', // default constructor
args = arguments,
options,
ret,
chart;
if (this[0]) {
if (isString(args[0])) {
constr = args[0];
args = Array.prototype.slice.call(args, 1);
}
options = args[0];
// Create the chart
if (options !== UNDEFINED) {
/*jslint unused:false*/
options.chart = options.chart || {};
options.chart.renderTo = this[0];
chart = new Highcharts[constr](options, args[1]);
ret = this;
/*jslint unused:true*/
}
// When called without parameters or with the return argument, get a predefined chart
if (options === UNDEFINED) {
ret = charts[attr(this[0], 'data-highcharts-chart')];
}
}
return ret;
};
},
/**
* Add an animation setter for a specific property
*/
addAnimSetter: function (prop, setter) {
// jQuery 1.8 style
if ($.Tween) {
$.Tween.propHooks[prop] = {
set: setter
};
// pre 1.8
} else {
$.fx.step[prop] = setter;
}
},
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
getScript: $.getScript,
/**
* Return the index of an item in an array, or -1 if not found
*/
inArray: $.inArray,
/**
* A direct link to jQuery methods. MooTools and Prototype adapters must be implemented for each case of method.
* @param {Object} elem The HTML element
* @param {String} method Which method to run on the wrapped element
*/
adapterRun: function (elem, method) {
return $(elem)[method]();
},
/**
* Filter an array
*/
grep: $.grep,
/**
* Map an array
* @param {Array} arr
* @param {Function} fn
*/
map: function (arr, fn) {
//return jQuery.map(arr, fn);
var results = [],
i = 0,
len = arr.length;
for (; i < len; i++) {
results[i] = fn.call(arr[i], arr[i], i, arr);
}
return results;
},
/**
* Get the position of an element relative to the top left of the page
*/
offset: function (el) {
return $(el).offset();
},
/**
* Add an event listener
* @param {Object} el A HTML element or custom object
* @param {String} event The event type
* @param {Function} fn The event handler
*/
addEvent: function (el, event, fn) {
$(el).bind(event, fn);
},
/**
* Remove event added with addEvent
* @param {Object} el The object
* @param {String} eventType The event type. Leave blank to remove all events.
* @param {Function} handler The function to remove
*/
removeEvent: function (el, eventType, handler) {
// workaround for jQuery issue with unbinding custom events:
// http://forum.jQuery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jQuery-1-4-2
var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent';
if (doc[func] && el && !el[func]) {
el[func] = function () {};
}
$(el).unbind(eventType, handler);
},
/**
* Fire an event on a custom object
* @param {Object} el
* @param {String} type
* @param {Object} eventArguments
* @param {Function} defaultFunction
*/
fireEvent: function (el, type, eventArguments, defaultFunction) {
var event = $.Event(type),
detachedType = 'detached' + type,
defaultPrevented;
// Remove warnings in Chrome when accessing returnValue (#2790), layerX and layerY. Although Highcharts
// never uses these properties, Chrome includes them in the default click event and
// raises the warning when they are copied over in the extend statement below.
//
// To avoid problems in IE (see #1010) where we cannot delete the properties and avoid
// testing if they are there (warning in chrome) the only option is to test if running IE.
if (!isIE && eventArguments) {
delete eventArguments.layerX;
delete eventArguments.layerY;
delete eventArguments.returnValue;
}
extend(event, eventArguments);
// Prevent jQuery from triggering the object method that is named the
// same as the event. For example, if the event is 'select', jQuery
// attempts calling el.select and it goes into a loop.
if (el[type]) {
el[detachedType] = el[type];
el[type] = null;
}
// Wrap preventDefault and stopPropagation in try/catch blocks in
// order to prevent JS errors when cancelling events on non-DOM
// objects. #615.
/*jslint unparam: true*/
$.each(['preventDefault', 'stopPropagation'], function (i, fn) {
var base = event[fn];
event[fn] = function () {
try {
base.call(event);
} catch (e) {
if (fn === 'preventDefault') {
defaultPrevented = true;
}
}
};
});
/*jslint unparam: false*/
// trigger it
$(el).trigger(event);
// attach the method
if (el[detachedType]) {
el[type] = el[detachedType];
el[detachedType] = null;
}
if (defaultFunction && !event.isDefaultPrevented() && !defaultPrevented) {
defaultFunction(event);
}
},
/**
* Extension method needed for MooTools
*/
washMouseEvent: function (e) {
var ret = e.originalEvent || e;
// computed by jQuery, needed by IE8
if (ret.pageX === UNDEFINED) { // #1236
ret.pageX = e.pageX;
ret.pageY = e.pageY;
}
return ret;
},
/**
* Animate a HTML element or SVG element wrapper
* @param {Object} el
* @param {Object} params
* @param {Object} options jQuery-like animation options: duration, easing, callback
*/
animate: function (el, params, options) {
var $el = $(el);
if (!el.style) {
el.style = {}; // #1881
}
if (params.d) {
el.toD = params.d; // keep the array form for paths, used in $.fx.step.d
params.d = 1; // because in jQuery, animating to an array has a different meaning
}
$el.stop();
if (params.opacity !== UNDEFINED && el.attr) {
params.opacity += 'px'; // force jQuery to use same logic as width and height (#2161)
}
el.hasAnim = 1; // #3342
$el.animate(params, options);
},
/**
* Stop running animation
*/
stop: function (el) {
if (el.hasAnim) { // #3342, memory leak on calling $(el) from destroy
$(el).stop();
}
}
});
}(win.jQuery));
// check for a custom HighchartsAdapter defined prior to this file
var globalAdapter = win.HighchartsAdapter,
adapter = globalAdapter || {};
// Initialize the adapter
if (globalAdapter) {
globalAdapter.init.call(globalAdapter, pathAnim);
}
// Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object
// and all the utility functions will be null. In that case they are populated by the
// default adapters below.
var adapterRun = adapter.adapterRun,
getScript = adapter.getScript,
inArray = adapter.inArray,
each = Highcharts.each = adapter.each,
grep = adapter.grep,
offset = adapter.offset,
map = adapter.map,
addEvent = adapter.addEvent,
removeEvent = adapter.removeEvent,
fireEvent = adapter.fireEvent,
washMouseEvent = adapter.washMouseEvent,
animate = adapter.animate,
stop = adapter.stop;
/* ****************************************************************************
* Handle the options *
*****************************************************************************/
defaultOptions = {
colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c',
'#8085e9', '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1'],
symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'],
lang: {
loading: 'Loading...',
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
decimalPoint: '.',
numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'], // SI prefixes used in axis labels
resetZoom: 'Reset zoom',
resetZoomTitle: 'Reset zoom level 1:1',
thousandsSep: ' '
},
global: {
useUTC: true,
//timezoneOffset: 0,
canvasToolsURL: 'http://code.highcharts.com/4.1.2/modules/canvas-tools.js',
VMLRadialGradientURL: 'http://code.highcharts.com/4.1.2/gfx/vml-radial-gradient.png'
},
chart: {
//animation: true,
//alignTicks: false,
//reflow: true,
//className: null,
//events: { load, selection },
//margin: [null],
//marginTop: null,
//marginRight: null,
//marginBottom: null,
//marginLeft: null,
borderColor: '#4572A7',
//borderWidth: 0,
borderRadius: 0,
defaultSeriesType: 'line',
ignoreHiddenSeries: true,
//inverted: false,
//shadow: false,
spacing: [10, 10, 15, 10],
//spacingTop: 10,
//spacingRight: 10,
//spacingBottom: 15,
//spacingLeft: 10,
//style: {
// fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font
// fontSize: '12px'
//},
backgroundColor: '#FFFFFF',
//plotBackgroundColor: null,
plotBorderColor: '#C0C0C0',
//plotBorderWidth: 0,
//plotShadow: false,
//zoomType: ''
resetZoomButton: {
theme: {
zIndex: 20
},
position: {
align: 'right',
x: -10,
//verticalAlign: 'top',
y: 10
}
// relativeTo: 'plot'
}
},
title: {
text: 'Chart title',
align: 'center',
// floating: false,
margin: 15,
// x: 0,
// verticalAlign: 'top',
// y: null,
style: {
color: '#333333',
fontSize: '18px'
}
},
subtitle: {
text: '',
align: 'center',
// floating: false
// x: 0,
// verticalAlign: 'top',
// y: null,
style: {
color: '#555555'
}
},
plotOptions: {
line: { // base series options
allowPointSelect: false,
showCheckbox: false,
animation: {
duration: 1000
},
//connectNulls: false,
//cursor: 'default',
//clip: true,
//dashStyle: null,
//enableMouseTracking: true,
events: {},
//legendIndex: 0,
//linecap: 'round',
lineWidth: 2,
//shadow: false,
// stacking: null,
marker: {
//enabled: true,
//symbol: null,
lineWidth: 0,
radius: 4,
lineColor: '#FFFFFF',
//fillColor: null,
states: { // states for a single point
hover: {
enabled: true,
lineWidthPlus: 1,
radiusPlus: 2
},
select: {
fillColor: '#FFFFFF',
lineColor: '#000000',
lineWidth: 2
}
}
},
point: {
events: {}
},
dataLabels: {
align: 'center',
// defer: true,
// enabled: false,
formatter: function () {
return this.y === null ? '' : Highcharts.numberFormat(this.y, -1);
},
style: {
color: 'contrast',
fontSize: '11px',
fontWeight: 'bold',
textShadow: '0 0 6px contrast, 0 0 3px contrast'
},
verticalAlign: 'bottom', // above singular point
x: 0,
y: 0,
// backgroundColor: undefined,
// borderColor: undefined,
// borderRadius: undefined,
// borderWidth: undefined,
padding: 5
// shadow: false
},
cropThreshold: 300, // draw points outside the plot area when the number of points is less than this
pointRange: 0,
//pointStart: 0,
//pointInterval: 1,
//showInLegend: null, // auto: true for standalone series, false for linked series
states: { // states for the entire series
hover: {
//enabled: false,
lineWidthPlus: 1,
marker: {
// lineWidth: base + 1,
// radius: base + 1
},
halo: {
size: 10,
opacity: 0.25
}
},
select: {
marker: {}
}
},
stickyTracking: true,
//tooltip: {
//pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b>'
//valueDecimals: null,
//xDateFormat: '%A, %b %e, %Y',
//valuePrefix: '',
//ySuffix: ''
//}
turboThreshold: 1000
// zIndex: null
}
},
labels: {
//items: [],
style: {
//font: defaultFont,
position: ABSOLUTE,
color: '#3E576F'
}
},
legend: {
enabled: true,
align: 'center',
//floating: false,
layout: 'horizontal',
labelFormatter: function () {
return this.name;
},
//borderWidth: 0,
borderColor: '#909090',
borderRadius: 0,
navigation: {
// animation: true,
activeColor: '#274b6d',
// arrowSize: 12
inactiveColor: '#CCC'
// style: {} // text styles
},
// margin: 20,
// reversed: false,
shadow: false,
// backgroundColor: null,
/*style: {
padding: '5px'
},*/
itemStyle: {
color: '#333333',
fontSize: '12px',
fontWeight: 'bold'
},
itemHoverStyle: {
//cursor: 'pointer', removed as of #601
color: '#000'
},
itemHiddenStyle: {
color: '#CCC'
},
itemCheckboxStyle: {
position: ABSOLUTE,
width: '13px', // for IE precision
height: '13px'
},
// itemWidth: undefined,
// symbolRadius: 0,
// symbolWidth: 16,
symbolPadding: 5,
verticalAlign: 'bottom',
// width: undefined,
x: 0,
y: 0,
title: {
//text: null,
style: {
fontWeight: 'bold'
}
}
},
loading: {
// hideDuration: 100,
labelStyle: {
fontWeight: 'bold',
position: RELATIVE,
top: '45%'
},
// showDuration: 0,
style: {
position: ABSOLUTE,
backgroundColor: 'white',
opacity: 0.5,
textAlign: 'center'
}
},
tooltip: {
enabled: true,
animation: hasSVG,
//crosshairs: null,
backgroundColor: 'rgba(249, 249, 249, .85)',
borderWidth: 1,
borderRadius: 3,
dateTimeLabelFormats: {
millisecond: '%A, %b %e, %H:%M:%S.%L',
second: '%A, %b %e, %H:%M:%S',
minute: '%A, %b %e, %H:%M',
hour: '%A, %b %e, %H:%M',
day: '%A, %b %e, %Y',
week: 'Week from %A, %b %e, %Y',
month: '%B %Y',
year: '%Y'
},
footerFormat: '',
//formatter: defaultFormatter,
headerFormat: '<span style="font-size: 10px">{point.key}</span><br/>',
pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>',
shadow: true,
//shape: 'callout',
//shared: false,
snap: isTouchDevice ? 25 : 10,
style: {
color: '#333333',
cursor: 'default',
fontSize: '12px',
padding: '8px',
whiteSpace: 'nowrap'
}
//xDateFormat: '%A, %b %e, %Y',
//valueDecimals: null,
//valuePrefix: '',
//valueSuffix: ''
},
credits: {
enabled: true,
text: 'Highcharts.com',
href: 'http://www.highcharts.com',
position: {
align: 'right',
x: -10,
verticalAlign: 'bottom',
y: -5
},
style: {
cursor: 'pointer',
color: '#909090',
fontSize: '9px'
}
}
};
// Series defaults
var defaultPlotOptions = defaultOptions.plotOptions,
defaultSeriesOptions = defaultPlotOptions.line;
// set the default time methods
setTimeMethods();
/**
* Set the time methods globally based on the useUTC option. Time method can be either
* local time or UTC (default).
*/
function setTimeMethods() {
var globalOptions = defaultOptions.global,
useUTC = globalOptions.useUTC,
GET = useUTC ? 'getUTC' : 'get',
SET = useUTC ? 'setUTC' : 'set';
Date = globalOptions.Date || window.Date;
timezoneOffset = useUTC && globalOptions.timezoneOffset;
getTimezoneOffset = useUTC && globalOptions.getTimezoneOffset;
makeTime = function (year, month, date, hours, minutes, seconds) {
var d;
if (useUTC) {
d = Date.UTC.apply(0, arguments);
d += getTZOffset(d);
} else {
d = new Date(
year,
month,
pick(date, 1),
pick(hours, 0),
pick(minutes, 0),
pick(seconds, 0)
).getTime();
}
return d;
};
getMinutes = GET + 'Minutes';
getHours = GET + 'Hours';
getDay = GET + 'Day';
getDate = GET + 'Date';
getMonth = GET + 'Month';
getFullYear = GET + 'FullYear';
setMinutes = SET + 'Minutes';
setHours = SET + 'Hours';
setDate = SET + 'Date';
setMonth = SET + 'Month';
setFullYear = SET + 'FullYear';
}
/**
* Merge the default options with custom options and return the new options structure
* @param {Object} options The new custom options
*/
function setOptions(options) {
// Copy in the default options
defaultOptions = merge(true, defaultOptions, options);
// Apply UTC
setTimeMethods();
return defaultOptions;
}
/**
* Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules
* wasn't enough because the setOptions method created a new object.
*/
function getOptions() {
return defaultOptions;
}
/**
* Handle color operations. The object methods are chainable.
* @param {String} input The input color in either rbga or hex format
*/
var rgbaRegEx = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,
hexRegEx = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
rgbRegEx = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/;
var Color = function (input) {
// declare variables
var rgba = [], result, stops;
/**
* Parse the input color to rgba array
* @param {String} input
*/
function init(input) {
// Gradients
if (input && input.stops) {
stops = map(input.stops, function (stop) {
return Color(stop[1]);
});
// Solid colors
} else {
// rgba
result = rgbaRegEx.exec(input);
if (result) {
rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)];
} else {
// hex
result = hexRegEx.exec(input);
if (result) {
rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1];
} else {
// rgb
result = rgbRegEx.exec(input);
if (result) {
rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), 1];
}
}
}
}
}
/**
* Return the color a specified format
* @param {String} format
*/
function get(format) {
var ret;
if (stops) {
ret = merge(input);
ret.stops = [].concat(ret.stops);
each(stops, function (stop, i) {
ret.stops[i] = [ret.stops[i][0], stop.get(format)];
});
// it's NaN if gradient colors on a column chart
} else if (rgba && !isNaN(rgba[0])) {
if (format === 'rgb') {
ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';
} else if (format === 'a') {
ret = rgba[3];
} else {
ret = 'rgba(' + rgba.join(',') + ')';
}
} else {
ret = input;
}
return ret;
}
/**
* Brighten the color
* @param {Number} alpha
*/
function brighten(alpha) {
if (stops) {
each(stops, function (stop) {
stop.brighten(alpha);
});
} else if (isNumber(alpha) && alpha !== 0) {
var i;
for (i = 0; i < 3; i++) {
rgba[i] += pInt(alpha * 255);
if (rgba[i] < 0) {
rgba[i] = 0;
}
if (rgba[i] > 255) {
rgba[i] = 255;
}
}
}
return this;
}
/**
* Set the color's opacity to a given alpha value
* @param {Number} alpha
*/
function setOpacity(alpha) {
rgba[3] = alpha;
return this;
}
// initialize: parse the input
init(input);
// public methods
return {
get: get,
brighten: brighten,
rgba: rgba,
setOpacity: setOpacity
};
};
/**
* A wrapper object for SVG elements
*/
function SVGElement() {}
SVGElement.prototype = {
// Default base for animation
opacity: 1,
// For labels, these CSS properties are applied to the <text> node directly
textProps: ['fontSize', 'fontWeight', 'fontFamily', 'color',
'lineHeight', 'width', 'textDecoration', 'textShadow'],
/**
* Initialize the SVG renderer
* @param {Object} renderer
* @param {String} nodeName
*/
init: function (renderer, nodeName) {
var wrapper = this;
wrapper.element = nodeName === 'span' ?
createElement(nodeName) :
doc.createElementNS(SVG_NS, nodeName);
wrapper.renderer = renderer;
},
/**
* Animate a given attribute
* @param {Object} params
* @param {Number} options The same options as in jQuery animation
* @param {Function} complete Function to perform at the end of animation
*/
animate: function (params, options, complete) {
var animOptions = pick(options, globalAnimation, true);
stop(this); // stop regardless of animation actually running, or reverting to .attr (#607)
if (animOptions) {
animOptions = merge(animOptions, {}); //#2625
if (complete) { // allows using a callback with the global animation without overwriting it
animOptions.complete = complete;
}
animate(this, params, animOptions);
} else {
this.attr(params);
if (complete) {
complete();
}
}
return this;
},
/**
* Build an SVG gradient out of a common JavaScript configuration object
*/
colorGradient: function (color, prop, elem) {
var renderer = this.renderer,
colorObject,
gradName,
gradAttr,
gradients,
gradientObject,
stops,
stopColor,
stopOpacity,
radialReference,
n,
id,
key = [];
// Apply linear or radial gradients
if (color.linearGradient) {
gradName = 'linearGradient';
} else if (color.radialGradient) {
gradName = 'radialGradient';
}
if (gradName) {
gradAttr = color[gradName];
gradients = renderer.gradients;
stops = color.stops;
radialReference = elem.radialReference;
// Keep < 2.2 kompatibility
if (isArray(gradAttr)) {
color[gradName] = gradAttr = {
x1: gradAttr[0],
y1: gradAttr[1],
x2: gradAttr[2],
y2: gradAttr[3],
gradientUnits: 'userSpaceOnUse'
};
}
// Correct the radial gradient for the radial reference system
if (gradName === 'radialGradient' && radialReference && !defined(gradAttr.gradientUnits)) {
gradAttr = merge(gradAttr, {
cx: (radialReference[0] - radialReference[2] / 2) + gradAttr.cx * radialReference[2],
cy: (radialReference[1] - radialReference[2] / 2) + gradAttr.cy * radialReference[2],
r: gradAttr.r * radialReference[2],
gradientUnits: 'userSpaceOnUse'
});
}
// Build the unique key to detect whether we need to create a new element (#1282)
for (n in gradAttr) {
if (n !== 'id') {
key.push(n, gradAttr[n]);
}
}
for (n in stops) {
key.push(stops[n]);
}
key = key.join(',');
// Check if a gradient object with the same config object is created within this renderer
if (gradients[key]) {
id = gradients[key].attr('id');
} else {
// Set the id and create the element
gradAttr.id = id = PREFIX + idCounter++;
gradients[key] = gradientObject = renderer.createElement(gradName)
.attr(gradAttr)
.add(renderer.defs);
// The gradient needs to keep a list of stops to be able to destroy them
gradientObject.stops = [];
each(stops, function (stop) {
var stopObject;
if (stop[1].indexOf('rgba') === 0) {
colorObject = Color(stop[1]);
stopColor = colorObject.get('rgb');
stopOpacity = colorObject.get('a');
} else {
stopColor = stop[1];
stopOpacity = 1;
}
stopObject = renderer.createElement('stop').attr({
offset: stop[0],
'stop-color': stopColor,
'stop-opacity': stopOpacity
}).add(gradientObject);
// Add the stop element to the gradient
gradientObject.stops.push(stopObject);
});
}
// Set the reference to the gradient object
elem.setAttribute(prop, 'url(' + renderer.url + '#' + id + ')');
}
},
/**
* Apply a polyfill to the text-stroke CSS property, by copying the text element
* and apply strokes to the copy.
*
* docs: update default, document the polyfill and the limitations on hex colors and pixel values, document contrast pseudo-color
* TODO:
* - update defaults
*/
applyTextShadow: function (textShadow) {
var elem = this.element,
tspans,
hasContrast = textShadow.indexOf('contrast') !== -1,
// IE10 and IE11 report textShadow in elem.style even though it doesn't work. Check
// this again with new IE release. In exports, the rendering is passed to PhantomJS.
supports = this.renderer.forExport || (elem.style.textShadow !== UNDEFINED && !isIE);
// When the text shadow is set to contrast, use dark stroke for light text and vice versa
if (hasContrast) {
textShadow = textShadow.replace(/contrast/g, this.renderer.getContrast(elem.style.fill));
}
/* Selective side-by-side testing in supported browser (http://jsfiddle.net/highcharts/73L1ptrh/)
if (elem.textContent.indexOf('2.') === 0) {
elem.style['text-shadow'] = 'none';
supports = false;
}
// */
// No reason to polyfill, we've got native support
if (supports) {
if (hasContrast) { // Apply the altered style
css(elem, {
textShadow: textShadow
});
}
} else {
this.fakeTS = true; // Fake text shadow
// In order to get the right y position of the clones,
// copy over the y setter
this.ySetter = this.xSetter;
tspans = [].slice.call(elem.getElementsByTagName('tspan'));
each(textShadow.split(/\s?,\s?/g), function (textShadow) {
var firstChild = elem.firstChild,
color,
strokeWidth;
textShadow = textShadow.split(' ');
color = textShadow[textShadow.length - 1];
// Approximately tune the settings to the text-shadow behaviour
strokeWidth = textShadow[textShadow.length - 2];
if (strokeWidth) {
each(tspans, function (tspan, y) {
var clone;
// Let the first line start at the correct X position
if (y === 0) {
tspan.setAttribute('x', elem.getAttribute('x'));
y = elem.getAttribute('y');
tspan.setAttribute('y', y || 0);
if (y === null) {
elem.setAttribute('y', 0);
}
}
// Create the clone and apply shadow properties
clone = tspan.cloneNode(1);
attr(clone, {
'class': PREFIX + 'text-shadow',
'fill': color,
'stroke': color,
'stroke-opacity': 1 / mathMax(pInt(strokeWidth), 3),
'stroke-width': strokeWidth,
'stroke-linejoin': 'round'
});
elem.insertBefore(clone, firstChild);
});
}
});
}
},
/**
* Set or get a given attribute
* @param {Object|String} hash
* @param {Mixed|Undefined} val
*/
attr: function (hash, val) {
var key,
value,
element = this.element,
hasSetSymbolSize,
ret = this,
skipAttr;
// single key-value pair
if (typeof hash === 'string' && val !== UNDEFINED) {
key = hash;
hash = {};
hash[key] = val;
}
// used as a getter: first argument is a string, second is undefined
if (typeof hash === 'string') {
ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element);
// setter
} else {
for (key in hash) {
value = hash[key];
skipAttr = false;
if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
if (!hasSetSymbolSize) {
this.symbolAttr(hash);
hasSetSymbolSize = true;
}
skipAttr = true;
}
if (this.rotation && (key === 'x' || key === 'y')) {
this.doTransform = true;
}
if (!skipAttr) {
(this[key + 'Setter'] || this._defaultSetter).call(this, value, key, element);
}
// Let the shadow follow the main element
if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) {
this.updateShadows(key, value);
}
}
// Update transform. Do this outside the loop to prevent redundant updating for batch setting
// of attributes.
if (this.doTransform) {
this.updateTransform();
this.doTransform = false;
}
}
return ret;
},
updateShadows: function (key, value) {
var shadows = this.shadows,
i = shadows.length;
while (i--) {
shadows[i].setAttribute(
key,
key === 'height' ?
mathMax(value - (shadows[i].cutHeight || 0), 0) :
key === 'd' ? this.d : value
);
}
},
/**
* Add a class name to an element
*/
addClass: function (className) {
var element = this.element,
currentClassName = attr(element, 'class') || '';
if (currentClassName.indexOf(className) === -1) {
attr(element, 'class', currentClassName + ' ' + className);
}
return this;
},
/* hasClass and removeClass are not (yet) needed
hasClass: function (className) {
return attr(this.element, 'class').indexOf(className) !== -1;
},
removeClass: function (className) {
attr(this.element, 'class', attr(this.element, 'class').replace(className, ''));
return this;
},
*/
/**
* If one of the symbol size affecting parameters are changed,
* check all the others only once for each call to an element's
* .attr() method
* @param {Object} hash
*/
symbolAttr: function (hash) {
var wrapper = this;
each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR', 'anchorX', 'anchorY'], function (key) {
wrapper[key] = pick(hash[key], wrapper[key]);
});
wrapper.attr({
d: wrapper.renderer.symbols[wrapper.symbolName](
wrapper.x,
wrapper.y,
wrapper.width,
wrapper.height,
wrapper
)
});
},
/**
* Apply a clipping path to this object
* @param {String} id
*/
clip: function (clipRect) {
return this.attr('clip-path', clipRect ? 'url(' + this.renderer.url + '#' + clipRect.id + ')' : NONE);
},
/**
* Calculate the coordinates needed for drawing a rectangle crisply and return the
* calculated attributes
* @param {Number} strokeWidth
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
crisp: function (rect) {
var wrapper = this,
key,
attribs = {},
normalizer,
strokeWidth = rect.strokeWidth || wrapper.strokeWidth || 0;
normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors
// normalize for crisp edges
rect.x = mathFloor(rect.x || wrapper.x || 0) + normalizer;
rect.y = mathFloor(rect.y || wrapper.y || 0) + normalizer;
rect.width = mathFloor((rect.width || wrapper.width || 0) - 2 * normalizer);
rect.height = mathFloor((rect.height || wrapper.height || 0) - 2 * normalizer);
rect.strokeWidth = strokeWidth;
for (key in rect) {
if (wrapper[key] !== rect[key]) { // only set attribute if changed
wrapper[key] = attribs[key] = rect[key];
}
}
return attribs;
},
/**
* Set styles for the element
* @param {Object} styles
*/
css: function (styles) {
var elemWrapper = this,
oldStyles = elemWrapper.styles,
newStyles = {},
elem = elemWrapper.element,
textWidth,
n,
serializedCss = '',
hyphenate,
hasNew = !oldStyles;
// convert legacy
if (styles && styles.color) {
styles.fill = styles.color;
}
// Filter out existing styles to increase performance (#2640)
if (oldStyles) {
for (n in styles) {
if (styles[n] !== oldStyles[n]) {
newStyles[n] = styles[n];
hasNew = true;
}
}
}
if (hasNew) {
textWidth = elemWrapper.textWidth =
(styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width)) ||
elemWrapper.textWidth; // #3501
// Merge the new styles with the old ones
if (oldStyles) {
styles = extend(
oldStyles,
newStyles
);
}
// store object
elemWrapper.styles = styles;
if (textWidth && (useCanVG || (!hasSVG && elemWrapper.renderer.forExport))) {
delete styles.width;
}
// serialize and set style attribute
if (isIE && !hasSVG) {
css(elemWrapper.element, styles);
} else {
/*jslint unparam: true*/
hyphenate = function (a, b) { return '-' + b.toLowerCase(); };
/*jslint unparam: false*/
for (n in styles) {
serializedCss += n.replace(/([A-Z])/g, hyphenate) + ':' + styles[n] + ';';
}
attr(elem, 'style', serializedCss); // #1881
}
// re-build text
if (textWidth && elemWrapper.added) {
elemWrapper.renderer.buildText(elemWrapper);
}
}
return elemWrapper;
},
/**
* Add an event listener
* @param {String} eventType
* @param {Function} handler
*/
on: function (eventType, handler) {
var svgElement = this,
element = svgElement.element;
// touch
if (hasTouch && eventType === 'click') {
element.ontouchstart = function (e) {
svgElement.touchEventFired = Date.now();
e.preventDefault();
handler.call(element, e);
};
element.onclick = function (e) {
if (userAgent.indexOf('Android') === -1 || Date.now() - (svgElement.touchEventFired || 0) > 1100) { // #2269
handler.call(element, e);
}
};
} else {
// simplest possible event model for internal use
element['on' + eventType] = handler;
}
return this;
},
/**
* Set the coordinates needed to draw a consistent radial gradient across
* pie slices regardless of positioning inside the chart. The format is
* [centerX, centerY, diameter] in pixels.
*/
setRadialReference: function (coordinates) {
this.element.radialReference = coordinates;
return this;
},
/**
* Move an object and its children by x and y values
* @param {Number} x
* @param {Number} y
*/
translate: function (x, y) {
return this.attr({
translateX: x,
translateY: y
});
},
/**
* Invert a group, rotate and flip
*/
invert: function () {
var wrapper = this;
wrapper.inverted = true;
wrapper.updateTransform();
return wrapper;
},
/**
* Private method to update the transform attribute based on internal
* properties
*/
updateTransform: function () {
var wrapper = this,
translateX = wrapper.translateX || 0,
translateY = wrapper.translateY || 0,
scaleX = wrapper.scaleX,
scaleY = wrapper.scaleY,
inverted = wrapper.inverted,
rotation = wrapper.rotation,
element = wrapper.element,
transform;
// flipping affects translate as adjustment for flipping around the group's axis
if (inverted) {
translateX += wrapper.attr('width');
translateY += wrapper.attr('height');
}
// Apply translate. Nearly all transformed elements have translation, so instead
// of checking for translate = 0, do it always (#1767, #1846).
transform = ['translate(' + translateX + ',' + translateY + ')'];
// apply rotation
if (inverted) {
transform.push('rotate(90) scale(-1,1)');
} else if (rotation) { // text rotation
transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
// Delete bBox memo when the rotation changes
//delete wrapper.bBox;
}
// apply scale
if (defined(scaleX) || defined(scaleY)) {
transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
}
if (transform.length) {
element.setAttribute('transform', transform.join(' '));
}
},
/**
* Bring the element to the front
*/
toFront: function () {
var element = this.element;
element.parentNode.appendChild(element);
return this;
},
/**
* Break down alignment options like align, verticalAlign, x and y
* to x and y relative to the chart.
*
* @param {Object} alignOptions
* @param {Boolean} alignByTranslate
* @param {String[Object} box The box to align to, needs a width and height. When the
* box is a string, it refers to an object in the Renderer. For example, when
* box is 'spacingBox', it refers to Renderer.spacingBox which holds width, height
* x and y properties.
*
*/
align: function (alignOptions, alignByTranslate, box) {
var align,
vAlign,
x,
y,
attribs = {},
alignTo,
renderer = this.renderer,
alignedObjects = renderer.alignedObjects;
// First call on instanciate
if (alignOptions) {
this.alignOptions = alignOptions;
this.alignByTranslate = alignByTranslate;
if (!box || isString(box)) { // boxes other than renderer handle this internally
this.alignTo = alignTo = box || 'renderer';
erase(alignedObjects, this); // prevent duplicates, like legendGroup after resize
alignedObjects.push(this);
box = null; // reassign it below
}
// When called on resize, no arguments are supplied
} else {
alignOptions = this.alignOptions;
alignByTranslate = this.alignByTranslate;
alignTo = this.alignTo;
}
box = pick(box, renderer[alignTo], renderer);
// Assign variables
align = alignOptions.align;
vAlign = alignOptions.verticalAlign;
x = (box.x || 0) + (alignOptions.x || 0); // default: left align
y = (box.y || 0) + (alignOptions.y || 0); // default: top align
// Align
if (align === 'right' || align === 'center') {
x += (box.width - (alignOptions.width || 0)) /
{ right: 1, center: 2 }[align];
}
attribs[alignByTranslate ? 'translateX' : 'x'] = mathRound(x);
// Vertical align
if (vAlign === 'bottom' || vAlign === 'middle') {
y += (box.height - (alignOptions.height || 0)) /
({ bottom: 1, middle: 2 }[vAlign] || 1);
}
attribs[alignByTranslate ? 'translateY' : 'y'] = mathRound(y);
// Animate only if already placed
this[this.placed ? 'animate' : 'attr'](attribs);
this.placed = true;
this.alignAttr = attribs;
return this;
},
/**
* Get the bounding box (width, height, x and y) for the element
*/
getBBox: function (reload) {
var wrapper = this,
bBox,// = wrapper.bBox,
renderer = wrapper.renderer,
width,
height,
rotation = wrapper.rotation,
element = wrapper.element,
styles = wrapper.styles,
rad = rotation * deg2rad,
textStr = wrapper.textStr,
textShadow,
elemStyle = element.style,
toggleTextShadowShim,
cacheKey;
if (textStr !== UNDEFINED) {
// Properties that affect bounding box
cacheKey = ['', rotation || 0, styles && styles.fontSize, element.style.width].join(',');
// Since numbers are monospaced, and numerical labels appear a lot in a chart,
// we assume that a label of n characters has the same bounding box as others
// of the same length.
if (textStr === '' || numRegex.test(textStr)) {
cacheKey = 'num:' + textStr.toString().length + cacheKey;
// Caching all strings reduces rendering time by 4-5%.
} else {
cacheKey = textStr + cacheKey;
}
}
if (cacheKey && !reload) {
bBox = renderer.cache[cacheKey];
}
// No cache found
if (!bBox) {
// SVG elements
if (element.namespaceURI === SVG_NS || renderer.forExport) {
try { // Fails in Firefox if the container has display: none.
// When the text shadow shim is used, we need to hide the fake shadows
// to get the correct bounding box (#3872)
toggleTextShadowShim = this.fakeTS && function (display) {
each(element.querySelectorAll('.' + PREFIX + 'text-shadow'), function (tspan) {
tspan.style.display = display;
});
};
// Workaround for #3842, Firefox reporting wrong bounding box for shadows
if (isFirefox && elemStyle.textShadow) {
textShadow = elemStyle.textShadow;
elemStyle.textShadow = '';
} else if (toggleTextShadowShim) {
toggleTextShadowShim(NONE);
}
bBox = element.getBBox ?
// SVG: use extend because IE9 is not allowed to change width and height in case
// of rotation (below)
extend({}, element.getBBox()) :
// Canvas renderer and legacy IE in export mode
{
width: element.offsetWidth,
height: element.offsetHeight
};
// #3842
if (textShadow) {
elemStyle.textShadow = textShadow;
} else if (toggleTextShadowShim) {
toggleTextShadowShim('');
}
} catch (e) {}
// If the bBox is not set, the try-catch block above failed. The other condition
// is for Opera that returns a width of -Infinity on hidden elements.
if (!bBox || bBox.width < 0) {
bBox = { width: 0, height: 0 };
}
// VML Renderer or useHTML within SVG
} else {
bBox = wrapper.htmlGetBBox();
}
// True SVG elements as well as HTML elements in modern browsers using the .useHTML option
// need to compensated for rotation
if (renderer.isSVG) {
width = bBox.width;
height = bBox.height;
// Workaround for wrong bounding box in IE9 and IE10 (#1101, #1505, #1669, #2568)
if (isIE && styles && styles.fontSize === '11px' && height.toPrecision(3) === '16.9') {
bBox.height = height = 14;
}
// Adjust for rotated text
if (rotation) {
bBox.width = mathAbs(height * mathSin(rad)) + mathAbs(width * mathCos(rad));
bBox.height = mathAbs(height * mathCos(rad)) + mathAbs(width * mathSin(rad));
}
}
// Cache it
renderer.cache[cacheKey] = bBox;
}
return bBox;
},
/**
* Show the element
*/
show: function (inherit) {
// IE9-11 doesn't handle visibilty:inherit well, so we remove the attribute instead (#2881)
if (inherit && this.element.namespaceURI === SVG_NS) {
this.element.removeAttribute('visibility');
} else {
this.attr({ visibility: inherit ? 'inherit' : VISIBLE });
}
return this;
},
/**
* Hide the element
*/
hide: function () {
return this.attr({ visibility: HIDDEN });
},
fadeOut: function (duration) {
var elemWrapper = this;
elemWrapper.animate({
opacity: 0
}, {
duration: duration || 150,
complete: function () {
elemWrapper.attr({ y: -9999 }); // #3088, assuming we're only using this for tooltips
}
});
},
/**
* Add the element
* @param {Object|Undefined} parent Can be an element, an element wrapper or undefined
* to append the element to the renderer.box.
*/
add: function (parent) {
var renderer = this.renderer,
element = this.element,
inserted;
if (parent) {
this.parentGroup = parent;
}
// mark as inverted
this.parentInverted = parent && parent.inverted;
// build formatted text
if (this.textStr !== undefined) {
renderer.buildText(this);
}
// Mark as added
this.added = true;
// If we're adding to renderer root, or other elements in the group
// have a z index, we need to handle it
if (!parent || parent.handleZ || this.zIndex) {
inserted = this.zIndexSetter();
}
// If zIndex is not handled, append at the end
if (!inserted) {
(parent ? parent.element : renderer.box).appendChild(element);
}
// fire an event for internal hooks
if (this.onAdd) {
this.onAdd();
}
return this;
},
/**
* Removes a child either by removeChild or move to garbageBin.
* Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
*/
safeRemoveChild: function (element) {
var parentNode = element.parentNode;
if (parentNode) {
parentNode.removeChild(element);
}
},
/**
* Destroy the element and element wrapper
*/
destroy: function () {
var wrapper = this,
element = wrapper.element || {},
shadows = wrapper.shadows,
parentToClean = wrapper.renderer.isSVG && element.nodeName === 'SPAN' && wrapper.parentGroup,
grandParent,
key,
i;
// remove events
element.onclick = element.onmouseout = element.onmouseover = element.onmousemove = element.point = null;
stop(wrapper); // stop running animations
if (wrapper.clipPath) {
wrapper.clipPath = wrapper.clipPath.destroy();
}
// Destroy stops in case this is a gradient object
if (wrapper.stops) {
for (i = 0; i < wrapper.stops.length; i++) {
wrapper.stops[i] = wrapper.stops[i].destroy();
}
wrapper.stops = null;
}
// remove element
wrapper.safeRemoveChild(element);
// destroy shadows
if (shadows) {
each(shadows, function (shadow) {
wrapper.safeRemoveChild(shadow);
});
}
// In case of useHTML, clean up empty containers emulating SVG groups (#1960, #2393, #2697).
while (parentToClean && parentToClean.div && parentToClean.div.childNodes.length === 0) {
grandParent = parentToClean.parentGroup;
wrapper.safeRemoveChild(parentToClean.div);
delete parentToClean.div;
parentToClean = grandParent;
}
// remove from alignObjects
if (wrapper.alignTo) {
erase(wrapper.renderer.alignedObjects, wrapper);
}
for (key in wrapper) {
delete wrapper[key];
}
return null;
},
/**
* Add a shadow to the element. Must be done after the element is added to the DOM
* @param {Boolean|Object} shadowOptions
*/
shadow: function (shadowOptions, group, cutOff) {
var shadows = [],
i,
shadow,
element = this.element,
strokeWidth,
shadowWidth,
shadowElementOpacity,
// compensate for inverted plot area
transform;
if (shadowOptions) {
shadowWidth = pick(shadowOptions.width, 3);
shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
transform = this.parentInverted ?
'(-1,-1)' :
'(' + pick(shadowOptions.offsetX, 1) + ', ' + pick(shadowOptions.offsetY, 1) + ')';
for (i = 1; i <= shadowWidth; i++) {
shadow = element.cloneNode(0);
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
attr(shadow, {
'isShadow': 'true',
'stroke': shadowOptions.color || 'black',
'stroke-opacity': shadowElementOpacity * i,
'stroke-width': strokeWidth,
'transform': 'translate' + transform,
'fill': NONE
});
if (cutOff) {
attr(shadow, 'height', mathMax(attr(shadow, 'height') - strokeWidth, 0));
shadow.cutHeight = strokeWidth;
}
if (group) {
group.element.appendChild(shadow);
} else {
element.parentNode.insertBefore(shadow, element);
}
shadows.push(shadow);
}
this.shadows = shadows;
}
return this;
},
xGetter: function (key) {
if (this.element.nodeName === 'circle') {
key = { x: 'cx', y: 'cy' }[key] || key;
}
return this._defaultGetter(key);
},
/**
* Get the current value of an attribute or pseudo attribute, used mainly
* for animation.
*/
_defaultGetter: function (key) {
var ret = pick(this[key], this.element ? this.element.getAttribute(key) : null, 0);
if (/^[\-0-9\.]+$/.test(ret)) { // is numerical
ret = parseFloat(ret);
}
return ret;
},
dSetter: function (value, key, element) {
if (value && value.join) { // join path
value = value.join(' ');
}
if (/(NaN| {2}|^$)/.test(value)) {
value = 'M 0 0';
}
element.setAttribute(key, value);
this[key] = value;
},
dashstyleSetter: function (value) {
var i;
value = value && value.toLowerCase();
if (value) {
value = value
.replace('shortdashdotdot', '3,1,1,1,1,1,')
.replace('shortdashdot', '3,1,1,1')
.replace('shortdot', '1,1,')
.replace('shortdash', '3,1,')
.replace('longdash', '8,3,')
.replace(/dot/g, '1,3,')
.replace('dash', '4,3,')
.replace(/,$/, '')
.split(','); // ending comma
i = value.length;
while (i--) {
value[i] = pInt(value[i]) * this['stroke-width'];
}
value = value.join(',')
.replace('NaN', 'none'); // #3226
this.element.setAttribute('stroke-dasharray', value);
}
},
alignSetter: function (value) {
this.element.setAttribute('text-anchor', { left: 'start', center: 'middle', right: 'end' }[value]);
},
opacitySetter: function (value, key, element) {
this[key] = value;
element.setAttribute(key, value);
},
titleSetter: function (value) {
var titleNode = this.element.getElementsByTagName('title')[0];
if (!titleNode) {
titleNode = doc.createElementNS(SVG_NS, 'title');
this.element.appendChild(titleNode);
}
titleNode.textContent = pick(value, '').replace(/<[^>]*>/g, ''); // #3276
},
textSetter: function (value) {
if (value !== this.textStr) {
// Delete bBox memo when the text changes
delete this.bBox;
this.textStr = value;
if (this.added) {
this.renderer.buildText(this);
}
}
},
fillSetter: function (value, key, element) {
if (typeof value === 'string') {
element.setAttribute(key, value);
} else if (value) {
this.colorGradient(value, key, element);
}
},
zIndexSetter: function (value, key) {
var renderer = this.renderer,
parentGroup = this.parentGroup,
parentWrapper = parentGroup || renderer,
parentNode = parentWrapper.element || renderer.box,
childNodes,
otherElement,
otherZIndex,
element = this.element,
inserted,
i;
if (defined(value)) {
element.setAttribute(key, value); // So we can read it for other elements in the group
this[key] = +value;
}
// Insert according to this and other elements' zIndex. Before .add() is called,
// nothing is done. Then on add, or by later calls to zIndexSetter, the node
// is placed on the right place in the DOM.
if (this.added) {
value = this.zIndex;
if (value && parentGroup) {
parentGroup.handleZ = true;
}
childNodes = parentNode.childNodes;
for (i = 0; i < childNodes.length && !inserted; i++) {
otherElement = childNodes[i];
otherZIndex = attr(otherElement, 'zIndex');
if (otherElement !== element && (
// Insert before the first element with a higher zIndex
pInt(otherZIndex) > value ||
// If no zIndex given, insert before the first element with a zIndex
(!defined(value) && defined(otherZIndex))
)) {
parentNode.insertBefore(element, otherElement);
inserted = true;
}
}
if (!inserted) {
parentNode.appendChild(element);
}
}
return inserted;
},
_defaultSetter: function (value, key, element) {
element.setAttribute(key, value);
}
};
// Some shared setters and getters
SVGElement.prototype.yGetter = SVGElement.prototype.xGetter;
SVGElement.prototype.translateXSetter = SVGElement.prototype.translateYSetter =
SVGElement.prototype.rotationSetter = SVGElement.prototype.verticalAlignSetter =
SVGElement.prototype.scaleXSetter = SVGElement.prototype.scaleYSetter = function (value, key) {
this[key] = value;
this.doTransform = true;
};
// WebKit and Batik have problems with a stroke-width of zero, so in this case we remove the
// stroke attribute altogether. #1270, #1369, #3065, #3072.
SVGElement.prototype['stroke-widthSetter'] = SVGElement.prototype.strokeSetter = function (value, key, element) {
this[key] = value;
// Only apply the stroke attribute if the stroke width is defined and larger than 0
if (this.stroke && this['stroke-width']) {
this.strokeWidth = this['stroke-width'];
SVGElement.prototype.fillSetter.call(this, this.stroke, 'stroke', element); // use prototype as instance may be overridden
element.setAttribute('stroke-width', this['stroke-width']);
this.hasStroke = true;
} else if (key === 'stroke-width' && value === 0 && this.hasStroke) {
element.removeAttribute('stroke');
this.hasStroke = false;
}
};
/**
* The default SVG renderer
*/
var SVGRenderer = function () {
this.init.apply(this, arguments);
};
SVGRenderer.prototype = {
Element: SVGElement,
/**
* Initialize the SVGRenderer
* @param {Object} container
* @param {Number} width
* @param {Number} height
* @param {Boolean} forExport
*/
init: function (container, width, height, style, forExport) {
var renderer = this,
loc = location,
boxWrapper,
element,
desc;
boxWrapper = renderer.createElement('svg')
.attr({
version: '1.1'
})
.css(this.getStyle(style));
element = boxWrapper.element;
container.appendChild(element);
// For browsers other than IE, add the namespace attribute (#1978)
if (container.innerHTML.indexOf('xmlns') === -1) {
attr(element, 'xmlns', SVG_NS);
}
// object properties
renderer.isSVG = true;
renderer.box = element;
renderer.boxWrapper = boxWrapper;
renderer.alignedObjects = [];
// Page url used for internal references. #24, #672, #1070
renderer.url = (isFirefox || isWebKit) && doc.getElementsByTagName('base').length ?
loc.href
.replace(/#.*?$/, '') // remove the hash
.replace(/([\('\)])/g, '\\$1') // escape parantheses and quotes
.replace(/ /g, '%20') : // replace spaces (needed for Safari only)
'';
// Add description
desc = this.createElement('desc').add();
desc.element.appendChild(doc.createTextNode('Created with ' + PRODUCT + ' ' + VERSION));
renderer.defs = this.createElement('defs').add();
renderer.forExport = forExport;
renderer.gradients = {}; // Object where gradient SvgElements are stored
renderer.cache = {}; // Cache for numerical bounding boxes
renderer.setSize(width, height, false);
// Issue 110 workaround:
// In Firefox, if a div is positioned by percentage, its pixel position may land
// between pixels. The container itself doesn't display this, but an SVG element
// inside this container will be drawn at subpixel precision. In order to draw
// sharp lines, this must be compensated for. This doesn't seem to work inside
// iframes though (like in jsFiddle).
var subPixelFix, rect;
if (isFirefox && container.getBoundingClientRect) {
renderer.subPixelFix = subPixelFix = function () {
css(container, { left: 0, top: 0 });
rect = container.getBoundingClientRect();
css(container, {
left: (mathCeil(rect.left) - rect.left) + PX,
top: (mathCeil(rect.top) - rect.top) + PX
});
};
// run the fix now
subPixelFix();
// run it on resize
addEvent(win, 'resize', subPixelFix);
}
},
getStyle: function (style) {
return (this.style = extend({
fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', // default font
fontSize: '12px'
}, style));
},
/**
* Detect whether the renderer is hidden. This happens when one of the parent elements
* has display: none. #608.
*/
isHidden: function () {
return !this.boxWrapper.getBBox().width;
},
/**
* Destroys the renderer and its allocated members.
*/
destroy: function () {
var renderer = this,
rendererDefs = renderer.defs;
renderer.box = null;
renderer.boxWrapper = renderer.boxWrapper.destroy();
// Call destroy on all gradient elements
destroyObjectProperties(renderer.gradients || {});
renderer.gradients = null;
// Defs are null in VMLRenderer
// Otherwise, destroy them here.
if (rendererDefs) {
renderer.defs = rendererDefs.destroy();
}
// Remove sub pixel fix handler
// We need to check that there is a handler, otherwise all functions that are registered for event 'resize' are removed
// See issue #982
if (renderer.subPixelFix) {
removeEvent(win, 'resize', renderer.subPixelFix);
}
renderer.alignedObjects = null;
return null;
},
/**
* Create a wrapper for an SVG element
* @param {Object} nodeName
*/
createElement: function (nodeName) {
var wrapper = new this.Element();
wrapper.init(this, nodeName);
return wrapper;
},
/**
* Dummy function for use in canvas renderer
*/
draw: function () {},
/**
* Parse a simple HTML string into SVG tspans
*
* @param {Object} textNode The parent text SVG node
*/
buildText: function (wrapper) {
var textNode = wrapper.element,
renderer = this,
forExport = renderer.forExport,
textStr = pick(wrapper.textStr, '').toString(),
hasMarkup = textStr.indexOf('<') !== -1,
lines,
childNodes = textNode.childNodes,
styleRegex,
hrefRegex,
parentX = attr(textNode, 'x'),
textStyles = wrapper.styles,
width = wrapper.textWidth,
textLineHeight = textStyles && textStyles.lineHeight,
textShadow = textStyles && textStyles.textShadow,
ellipsis = textStyles && textStyles.textOverflow === 'ellipsis',
i = childNodes.length,
tempParent = width && !wrapper.added && this.box,
getLineHeight = function (tspan) {
return textLineHeight ?
pInt(textLineHeight) :
renderer.fontMetrics(
/(px|em)$/.test(tspan && tspan.style.fontSize) ?
tspan.style.fontSize :
((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),
tspan
).h;
},
unescapeAngleBrackets = function (inputStr) {
return inputStr.replace(/</g, '<').replace(/>/g, '>');
};
/// remove old text
while (i--) {
textNode.removeChild(childNodes[i]);
}
// Skip tspans, add text directly to text node. The forceTSpan is a hook
// used in text outline hack.
if (!hasMarkup && !textShadow && !ellipsis && textStr.indexOf(' ') === -1) {
textNode.appendChild(doc.createTextNode(unescapeAngleBrackets(textStr)));
return;
// Complex strings, add more logic
} else {
styleRegex = /<.*style="([^"]+)".*>/;
hrefRegex = /<.*href="(http[^"]+)".*>/;
if (tempParent) {
tempParent.appendChild(textNode); // attach it to the DOM to read offset width
}
if (hasMarkup) {
lines = textStr
.replace(/<(b|strong)>/g, '<span style="font-weight:bold">')
.replace(/<(i|em)>/g, '<span style="font-style:italic">')
.replace(/<a/g, '<span')
.replace(/<\/(b|strong|i|em|a)>/g, '</span>')
.split(/<br.*?>/g);
} else {
lines = [textStr];
}
// remove empty line at end
if (lines[lines.length - 1] === '') {
lines.pop();
}
// build the lines
each(lines, function (line, lineNo) {
var spans, spanNo = 0;
line = line.replace(/<span/g, '|||<span').replace(/<\/span>/g, '</span>|||');
spans = line.split('|||');
each(spans, function (span) {
if (span !== '' || spans.length === 1) {
var attributes = {},
tspan = doc.createElementNS(SVG_NS, 'tspan'),
spanStyle; // #390
if (styleRegex.test(span)) {
spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');
attr(tspan, 'style', spanStyle);
}
if (hrefRegex.test(span) && !forExport) { // Not for export - #1529
attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
css(tspan, { cursor: 'pointer' });
}
span = unescapeAngleBrackets(span.replace(/<(.|\n)*?>/g, '') || ' ');
// Nested tags aren't supported, and cause crash in Safari (#1596)
if (span !== ' ') {
// add the text node
tspan.appendChild(doc.createTextNode(span));
if (!spanNo) { // first span in a line, align it to the left
if (lineNo && parentX !== null) {
attributes.x = parentX;
}
} else {
attributes.dx = 0; // #16
}
// add attributes
attr(tspan, attributes);
// Append it
textNode.appendChild(tspan);
// first span on subsequent line, add the line height
if (!spanNo && lineNo) {
// allow getting the right offset height in exporting in IE
if (!hasSVG && forExport) {
css(tspan, { display: 'block' });
}
// Set the line height based on the font size of either
// the text element or the tspan element
attr(
tspan,
'dy',
getLineHeight(tspan)
);
}
/*if (width) {
renderer.breakText(wrapper, width);
}*/
// Check width and apply soft breaks or ellipsis
if (width) {
var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273
hasWhiteSpace = spans.length > 1 || lineNo || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),
tooLong,
wasTooLong,
actualWidth,
rest = [],
dy = getLineHeight(tspan),
softLineNo = 1,
rotation = wrapper.rotation,
wordStr = span, // for ellipsis
cursor = wordStr.length, // binary search cursor
bBox;
while ((hasWhiteSpace || ellipsis) && (words.length || rest.length)) {
wrapper.rotation = 0; // discard rotation when computing box
bBox = wrapper.getBBox(true);
actualWidth = bBox.width;
// Old IE cannot measure the actualWidth for SVG elements (#2314)
if (!hasSVG && renderer.forExport) {
actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);
}
tooLong = actualWidth > width;
// For ellipsis, do a binary search for the correct string length
if (wasTooLong === undefined) {
wasTooLong = tooLong; // First time
}
if (ellipsis && wasTooLong) {
cursor /= 2;
if (wordStr === '' || (!tooLong && cursor < 0.5)) {
words = []; // All ok, break out
} else {
if (tooLong) {
wasTooLong = true;
}
wordStr = span.substring(0, wordStr.length + (tooLong ? -1 : 1) * mathCeil(cursor));
words = [wordStr + '\u2026'];
tspan.removeChild(tspan.firstChild);
}
// Looping down, this is the first word sequence that is not too long,
// so we can move on to build the next line.
} else if (!tooLong || words.length === 1) {
words = rest;
rest = [];
if (words.length) {
softLineNo++;
tspan = doc.createElementNS(SVG_NS, 'tspan');
attr(tspan, {
dy: dy,
x: parentX
});
if (spanStyle) { // #390
attr(tspan, 'style', spanStyle);
}
textNode.appendChild(tspan);
}
if (actualWidth > width) { // a single word is pressing it out
width = actualWidth;
}
} else { // append to existing line tspan
tspan.removeChild(tspan.firstChild);
rest.unshift(words.pop());
}
if (words.length) {
tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
}
}
if (wasTooLong) {
wrapper.attr('title', wrapper.textStr);
}
wrapper.rotation = rotation;
}
spanNo++;
}
}
});
});
if (tempParent) {
tempParent.removeChild(textNode); // attach it to the DOM to read offset width
}
// Apply the text shadow
if (textShadow && wrapper.applyTextShadow) {
wrapper.applyTextShadow(textShadow);
}
}
},
/*
breakText: function (wrapper, width) {
var bBox = wrapper.getBBox(),
node = wrapper.element,
textLength = node.textContent.length,
pos = mathRound(width * textLength / bBox.width), // try this position first, based on average character width
increment = 0,
finalPos;
if (bBox.width > width) {
while (finalPos === undefined) {
textLength = node.getSubStringLength(0, pos);
if (textLength <= width) {
if (increment === -1) {
finalPos = pos;
} else {
increment = 1;
}
} else {
if (increment === 1) {
finalPos = pos - 1;
} else {
increment = -1;
}
}
pos += increment;
}
}
console.log(finalPos, node.getSubStringLength(0, finalPos))
},
*/
/**
* Returns white for dark colors and black for bright colors
*/
getContrast: function (color) {
color = Color(color).rgba;
return color[0] + color[1] + color[2] > 384 ? '#000' : '#FFF';
},
/**
* Create a button with preset states
* @param {String} text
* @param {Number} x
* @param {Number} y
* @param {Function} callback
* @param {Object} normalState
* @param {Object} hoverState
* @param {Object} pressedState
*/
button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
var label = this.label(text, x, y, shape, null, null, null, null, 'button'),
curState = 0,
stateOptions,
stateStyle,
normalStyle,
hoverStyle,
pressedStyle,
disabledStyle,
verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 };
// Normal state - prepare the attributes
normalState = merge({
'stroke-width': 1,
stroke: '#CCCCCC',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#FEFEFE'],
[1, '#F6F6F6']
]
},
r: 2,
padding: 5,
style: {
color: 'black'
}
}, normalState);
normalStyle = normalState.style;
delete normalState.style;
// Hover state
hoverState = merge(normalState, {
stroke: '#68A',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#FFF'],
[1, '#ACF']
]
}
}, hoverState);
hoverStyle = hoverState.style;
delete hoverState.style;
// Pressed state
pressedState = merge(normalState, {
stroke: '#68A',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#9BD'],
[1, '#CDF']
]
}
}, pressedState);
pressedStyle = pressedState.style;
delete pressedState.style;
// Disabled state
disabledState = merge(normalState, {
style: {
color: '#CCC'
}
}, disabledState);
disabledStyle = disabledState.style;
delete disabledState.style;
// Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667).
addEvent(label.element, isIE ? 'mouseover' : 'mouseenter', function () {
if (curState !== 3) {
label.attr(hoverState)
.css(hoverStyle);
}
});
addEvent(label.element, isIE ? 'mouseout' : 'mouseleave', function () {
if (curState !== 3) {
stateOptions = [normalState, hoverState, pressedState][curState];
stateStyle = [normalStyle, hoverStyle, pressedStyle][curState];
label.attr(stateOptions)
.css(stateStyle);
}
});
label.setState = function (state) {
label.state = curState = state;
if (!state) {
label.attr(normalState)
.css(normalStyle);
} else if (state === 2) {
label.attr(pressedState)
.css(pressedStyle);
} else if (state === 3) {
label.attr(disabledState)
.css(disabledStyle);
}
};
return label
.on('click', function () {
if (curState !== 3) {
callback.call(label);
}
})
.attr(normalState)
.css(extend({ cursor: 'default' }, normalStyle));
},
/**
* Make a straight line crisper by not spilling out to neighbour pixels
* @param {Array} points
* @param {Number} width
*/
crispLine: function (points, width) {
// points format: [M, 0, 0, L, 100, 0]
// normalize to a crisp line
if (points[1] === points[4]) {
// Substract due to #1129. Now bottom and left axis gridlines behave the same.
points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2);
}
if (points[2] === points[5]) {
points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2);
}
return points;
},
/**
* Draw a path
* @param {Array} path An SVG path in array form
*/
path: function (path) {
var attr = {
fill: NONE
};
if (isArray(path)) {
attr.d = path;
} else if (isObject(path)) { // attributes
extend(attr, path);
}
return this.createElement('path').attr(attr);
},
/**
* Draw and return an SVG circle
* @param {Number} x The x position
* @param {Number} y The y position
* @param {Number} r The radius
*/
circle: function (x, y, r) {
var attr = isObject(x) ?
x :
{
x: x,
y: y,
r: r
},
wrapper = this.createElement('circle');
wrapper.xSetter = function (value) {
this.element.setAttribute('cx', value);
};
wrapper.ySetter = function (value) {
this.element.setAttribute('cy', value);
};
return wrapper.attr(attr);
},
/**
* Draw and return an arc
* @param {Number} x X position
* @param {Number} y Y position
* @param {Number} r Radius
* @param {Number} innerR Inner radius like used in donut charts
* @param {Number} start Starting angle
* @param {Number} end Ending angle
*/
arc: function (x, y, r, innerR, start, end) {
var arc;
if (isObject(x)) {
y = x.y;
r = x.r;
innerR = x.innerR;
start = x.start;
end = x.end;
x = x.x;
}
// Arcs are defined as symbols for the ability to set
// attributes in attr and animate
arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, {
innerR: innerR || 0,
start: start || 0,
end: end || 0
});
arc.r = r; // #959
return arc;
},
/**
* Draw and return a rectangle
* @param {Number} x Left position
* @param {Number} y Top position
* @param {Number} width
* @param {Number} height
* @param {Number} r Border corner radius
* @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing
*/
rect: function (x, y, width, height, r, strokeWidth) {
r = isObject(x) ? x.r : r;
var wrapper = this.createElement('rect'),
attribs = isObject(x) ? x : x === UNDEFINED ? {} : {
x: x,
y: y,
width: mathMax(width, 0),
height: mathMax(height, 0)
};
if (strokeWidth !== UNDEFINED) {
attribs.strokeWidth = strokeWidth;
attribs = wrapper.crisp(attribs);
}
if (r) {
attribs.r = r;
}
wrapper.rSetter = function (value) {
attr(this.element, {
rx: value,
ry: value
});
};
return wrapper.attr(attribs);
},
/**
* Resize the box and re-align all aligned elements
* @param {Object} width
* @param {Object} height
* @param {Boolean} animate
*
*/
setSize: function (width, height, animate) {
var renderer = this,
alignedObjects = renderer.alignedObjects,
i = alignedObjects.length;
renderer.width = width;
renderer.height = height;
renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({
width: width,
height: height
});
while (i--) {
alignedObjects[i].align();
}
},
/**
* Create a group
* @param {String} name The group will be given a class name of 'highcharts-{name}'.
* This can be used for styling and scripting.
*/
g: function (name) {
var elem = this.createElement('g');
return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem;
},
/**
* Display an image
* @param {String} src
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
image: function (src, x, y, width, height) {
var attribs = {
preserveAspectRatio: NONE
},
elemWrapper;
// optional properties
if (arguments.length > 1) {
extend(attribs, {
x: x,
y: y,
width: width,
height: height
});
}
elemWrapper = this.createElement('image').attr(attribs);
// set the href in the xlink namespace
if (elemWrapper.element.setAttributeNS) {
elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink',
'href', src);
} else {
// could be exporting in IE
// using href throws "not supported" in ie7 and under, requries regex shim to fix later
elemWrapper.element.setAttribute('hc-svg-href', src);
}
return elemWrapper;
},
/**
* Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object.
*
* @param {Object} symbol
* @param {Object} x
* @param {Object} y
* @param {Object} radius
* @param {Object} options
*/
symbol: function (symbol, x, y, width, height, options) {
var obj,
// get the symbol definition function
symbolFn = this.symbols[symbol],
// check if there's a path defined for this symbol
path = symbolFn && symbolFn(
mathRound(x),
mathRound(y),
width,
height,
options
),
imageElement,
imageRegex = /^url\((.*?)\)$/,
imageSrc,
imageSize,
centerImage;
if (path) {
obj = this.path(path);
// expando properties for use in animate and attr
extend(obj, {
symbolName: symbol,
x: x,
y: y,
width: width,
height: height
});
if (options) {
extend(obj, options);
}
// image symbols
} else if (imageRegex.test(symbol)) {
// On image load, set the size and position
centerImage = function (img, size) {
if (img.element) { // it may be destroyed in the meantime (#1390)
img.attr({
width: size[0],
height: size[1]
});
if (!img.alignByTranslate) { // #185
img.translate(
mathRound((width - size[0]) / 2), // #1378
mathRound((height - size[1]) / 2)
);
}
}
};
imageSrc = symbol.match(imageRegex)[1];
imageSize = symbolSizes[imageSrc] || (options && options.width && options.height && [options.width, options.height]);
// Ireate the image synchronously, add attribs async
obj = this.image(imageSrc)
.attr({
x: x,
y: y
});
obj.isImg = true;
if (imageSize) {
centerImage(obj, imageSize);
} else {
// Initialize image to be 0 size so export will still function if there's no cached sizes.
obj.attr({ width: 0, height: 0 });
// Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8,
// the created element must be assigned to a variable in order to load (#292).
imageElement = createElement('img', {
onload: function () {
centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]);
},
src: imageSrc
});
}
}
return obj;
},
/**
* An extendable collection of functions for defining symbol paths.
*/
symbols: {
'circle': function (x, y, w, h) {
var cpw = 0.166 * w;
return [
M, x + w / 2, y,
'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h,
'C', x - cpw, y + h, x - cpw, y, x + w / 2, y,
'Z'
];
},
'square': function (x, y, w, h) {
return [
M, x, y,
L, x + w, y,
x + w, y + h,
x, y + h,
'Z'
];
},
'triangle': function (x, y, w, h) {
return [
M, x + w / 2, y,
L, x + w, y + h,
x, y + h,
'Z'
];
},
'triangle-down': function (x, y, w, h) {
return [
M, x, y,
L, x + w, y,
x + w / 2, y + h,
'Z'
];
},
'diamond': function (x, y, w, h) {
return [
M, x + w / 2, y,
L, x + w, y + h / 2,
x + w / 2, y + h,
x, y + h / 2,
'Z'
];
},
'arc': function (x, y, w, h, options) {
var start = options.start,
radius = options.r || w || h,
end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561)
innerRadius = options.innerR,
open = options.open,
cosStart = mathCos(start),
sinStart = mathSin(start),
cosEnd = mathCos(end),
sinEnd = mathSin(end),
longArc = options.end - start < mathPI ? 0 : 1;
return [
M,
x + radius * cosStart,
y + radius * sinStart,
'A', // arcTo
radius, // x radius
radius, // y radius
0, // slanting
longArc, // long or short arc
1, // clockwise
x + radius * cosEnd,
y + radius * sinEnd,
open ? M : L,
x + innerRadius * cosEnd,
y + innerRadius * sinEnd,
'A', // arcTo
innerRadius, // x radius
innerRadius, // y radius
0, // slanting
longArc, // long or short arc
0, // clockwise
x + innerRadius * cosStart,
y + innerRadius * sinStart,
open ? '' : 'Z' // close
];
},
/**
* Callout shape used for default tooltips, also used for rounded rectangles in VML
*/
callout: function (x, y, w, h, options) {
var arrowLength = 6,
halfDistance = 6,
r = mathMin((options && options.r) || 0, w, h),
safeDistance = r + halfDistance,
anchorX = options && options.anchorX,
anchorY = options && options.anchorY,
path,
normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;
x += normalizer;
y += normalizer;
path = [
'M', x + r, y,
'L', x + w - r, y, // top side
'C', x + w, y, x + w, y, x + w, y + r, // top-right corner
'L', x + w, y + h - r, // right side
'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner
'L', x + r, y + h, // bottom side
'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner
'L', x, y + r, // left side
'C', x, y, x, y, x + r, y // top-right corner
];
if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side
path.splice(13, 3,
'L', x + w, anchorY - halfDistance,
x + w + arrowLength, anchorY,
x + w, anchorY + halfDistance,
x + w, y + h - r
);
} else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side
path.splice(33, 3,
'L', x, anchorY + halfDistance,
x - arrowLength, anchorY,
x, anchorY - halfDistance,
x, y + r
);
} else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom
path.splice(23, 3,
'L', anchorX + halfDistance, y + h,
anchorX, y + h + arrowLength,
anchorX - halfDistance, y + h,
x + r, y + h
);
} else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top
path.splice(3, 3,
'L', anchorX - halfDistance, y,
anchorX, y - arrowLength,
anchorX + halfDistance, y,
w - r, y
);
}
return path;
}
},
/**
* Define a clipping rectangle
* @param {String} id
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
clipRect: function (x, y, width, height) {
var wrapper,
id = PREFIX + idCounter++,
clipPath = this.createElement('clipPath').attr({
id: id
}).add(this.defs);
wrapper = this.rect(x, y, width, height, 0).add(clipPath);
wrapper.id = id;
wrapper.clipPath = clipPath;
wrapper.count = 0;
return wrapper;
},
/**
* Add text to the SVG object
* @param {String} str
* @param {Number} x Left position
* @param {Number} y Top position
* @param {Boolean} useHTML Use HTML to render the text
*/
text: function (str, x, y, useHTML) {
// declare variables
var renderer = this,
fakeSVG = useCanVG || (!hasSVG && renderer.forExport),
wrapper,
attr = {};
if (useHTML && !renderer.forExport) {
return renderer.html(str, x, y);
}
attr.x = Math.round(x || 0); // X is always needed for line-wrap logic
if (y) {
attr.y = Math.round(y);
}
if (str || str === 0) {
attr.text = str;
}
wrapper = renderer.createElement('text')
.attr(attr);
// Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063)
if (fakeSVG) {
wrapper.css({
position: ABSOLUTE
});
}
if (!useHTML) {
wrapper.xSetter = function (value, key, element) {
var tspans = element.getElementsByTagName('tspan'),
tspan,
parentVal = element.getAttribute(key),
i;
for (i = 0; i < tspans.length; i++) {
tspan = tspans[i];
// If the x values are equal, the tspan represents a linebreak
if (tspan.getAttribute(key) === parentVal) {
tspan.setAttribute(key, value);
}
}
element.setAttribute(key, value);
};
}
return wrapper;
},
/**
* Utility to return the baseline offset and total line height from the font size
*/
fontMetrics: function (fontSize, elem) {
fontSize = fontSize || this.style.fontSize;
if (elem && win.getComputedStyle) {
elem = elem.element || elem; // SVGElement
fontSize = win.getComputedStyle(elem, "").fontSize;
}
fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12;
// Empirical values found by comparing font size and bounding box height.
// Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/
var lineHeight = fontSize < 24 ? fontSize + 3 : mathRound(fontSize * 1.2),
baseline = mathRound(lineHeight * 0.8);
return {
h: lineHeight,
b: baseline,
f: fontSize
};
},
/**
* Correct X and Y positioning of a label for rotation (#1764)
*/
rotCorr: function (baseline, rotation, alterY) {
var y = baseline;
if (rotation && alterY) {
y = mathMax(y * mathCos(rotation * deg2rad), 4);
}
return {
x: (-baseline / 3) * mathSin(rotation * deg2rad),
y: y
};
},
/**
* Add a label, a text item that can hold a colored or gradient background
* as well as a border and shadow.
* @param {string} str
* @param {Number} x
* @param {Number} y
* @param {String} shape
* @param {Number} anchorX In case the shape has a pointer, like a flag, this is the
* coordinates it should be pinned to
* @param {Number} anchorY
* @param {Boolean} baseline Whether to position the label relative to the text baseline,
* like renderer.text, or to the upper border of the rectangle.
* @param {String} className Class name for the group
*/
label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
var renderer = this,
wrapper = renderer.g(className),
text = renderer.text('', 0, 0, useHTML)
.attr({
zIndex: 1
}),
//.add(wrapper),
box,
bBox,
alignFactor = 0,
padding = 3,
paddingLeft = 0,
width,
height,
wrapperX,
wrapperY,
crispAdjust = 0,
deferredAttr = {},
baselineOffset,
needsBox;
/**
* This function runs after the label is added to the DOM (when the bounding box is
* available), and after the text of the label is updated to detect the new bounding
* box and reflect it in the border box.
*/
function updateBoxSize() {
var boxX,
boxY,
style = text.element.style;
bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && defined(text.textStr) &&
text.getBBox(); //#3295 && 3514 box failure when string equals 0
wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;
wrapper.height = (height || bBox.height || 0) + 2 * padding;
// update the label-scoped y offset
baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b;
if (needsBox) {
// create the border box if it is not already present
if (!box) {
boxX = mathRound(-alignFactor * padding);
boxY = baseline ? -baselineOffset : 0;
wrapper.box = box = shape ?
renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :
renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);
box.attr('fill', NONE).add(wrapper);
}
// apply the box attributes
if (!box.isImg) { // #1630
box.attr(extend({
width: mathRound(wrapper.width),
height: mathRound(wrapper.height)
}, deferredAttr));
}
deferredAttr = null;
}
}
/**
* This function runs after setting text or padding, but only if padding is changed
*/
function updateTextPadding() {
var styles = wrapper.styles,
textAlign = styles && styles.textAlign,
x = paddingLeft + padding * (1 - alignFactor),
y;
// determin y based on the baseline
y = baseline ? 0 : baselineOffset;
// compensate for alignment
if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) {
x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width);
}
// update if anything changed
if (x !== text.x || y !== text.y) {
text.attr('x', x);
if (y !== UNDEFINED) {
text.attr('y', y);
}
}
// record current values
text.x = x;
text.y = y;
}
/**
* Set a box attribute, or defer it if the box is not yet created
* @param {Object} key
* @param {Object} value
*/
function boxAttr(key, value) {
if (box) {
box.attr(key, value);
} else {
deferredAttr[key] = value;
}
}
/**
* After the text element is added, get the desired size of the border box
* and add it before the text in the DOM.
*/
wrapper.onAdd = function () {
text.add(wrapper);
wrapper.attr({
text: (str || str === 0) ? str : '', // alignment is available now // #3295: 0 not rendered if given as a value
x: x,
y: y
});
if (box && defined(anchorX)) {
wrapper.attr({
anchorX: anchorX,
anchorY: anchorY
});
}
};
/*
* Add specific attribute setters.
*/
// only change local variables
wrapper.widthSetter = function (value) {
width = value;
};
wrapper.heightSetter = function (value) {
height = value;
};
wrapper.paddingSetter = function (value) {
if (defined(value) && value !== padding) {
padding = wrapper.padding = value;
updateTextPadding();
}
};
wrapper.paddingLeftSetter = function (value) {
if (defined(value) && value !== paddingLeft) {
paddingLeft = value;
updateTextPadding();
}
};
// change local variable and prevent setting attribute on the group
wrapper.alignSetter = function (value) {
alignFactor = { left: 0, center: 0.5, right: 1 }[value];
};
// apply these to the box and the text alike
wrapper.textSetter = function (value) {
if (value !== UNDEFINED) {
text.textSetter(value);
}
updateBoxSize();
updateTextPadding();
};
// apply these to the box but not to the text
wrapper['stroke-widthSetter'] = function (value, key) {
if (value) {
needsBox = true;
}
crispAdjust = value % 2 / 2;
boxAttr(key, value);
};
wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) {
if (key === 'fill' && value) {
needsBox = true;
}
boxAttr(key, value);
};
wrapper.anchorXSetter = function (value, key) {
anchorX = value;
boxAttr(key, value + crispAdjust - wrapperX);
};
wrapper.anchorYSetter = function (value, key) {
anchorY = value;
boxAttr(key, value - wrapperY);
};
// rename attributes
wrapper.xSetter = function (value) {
wrapper.x = value; // for animation getter
if (alignFactor) {
value -= alignFactor * ((width || bBox.width) + padding);
}
wrapperX = mathRound(value);
wrapper.attr('translateX', wrapperX);
};
wrapper.ySetter = function (value) {
wrapperY = wrapper.y = mathRound(value);
wrapper.attr('translateY', wrapperY);
};
// Redirect certain methods to either the box or the text
var baseCss = wrapper.css;
return extend(wrapper, {
/**
* Pick up some properties and apply them to the text instead of the wrapper
*/
css: function (styles) {
if (styles) {
var textStyles = {};
styles = merge(styles); // create a copy to avoid altering the original object (#537)
each(wrapper.textProps, function (prop) {
if (styles[prop] !== UNDEFINED) {
textStyles[prop] = styles[prop];
delete styles[prop];
}
});
text.css(textStyles);
}
return baseCss.call(wrapper, styles);
},
/**
* Return the bounding box of the box, not the group
*/
getBBox: function () {
return {
width: bBox.width + 2 * padding,
height: bBox.height + 2 * padding,
x: bBox.x - padding,
y: bBox.y - padding
};
},
/**
* Apply the shadow to the box
*/
shadow: function (b) {
if (box) {
box.shadow(b);
}
return wrapper;
},
/**
* Destroy and release memory.
*/
destroy: function () {
// Added by button implementation
removeEvent(wrapper.element, 'mouseenter');
removeEvent(wrapper.element, 'mouseleave');
if (text) {
text = text.destroy();
}
if (box) {
box = box.destroy();
}
// Call base implementation to destroy the rest
SVGElement.prototype.destroy.call(wrapper);
// Release local pointers (#1298)
wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null;
}
});
}
}; // end SVGRenderer
// general renderer
Renderer = SVGRenderer;
// extend SvgElement for useHTML option
extend(SVGElement.prototype, {
/**
* Apply CSS to HTML elements. This is used in text within SVG rendering and
* by the VML renderer
*/
htmlCss: function (styles) {
var wrapper = this,
element = wrapper.element,
textWidth = styles && element.tagName === 'SPAN' && styles.width;
if (textWidth) {
delete styles.width;
wrapper.textWidth = textWidth;
wrapper.updateTransform();
}
if (styles && styles.textOverflow === 'ellipsis') {
styles.whiteSpace = 'nowrap';
styles.overflow = 'hidden';
}
wrapper.styles = extend(wrapper.styles, styles);
css(wrapper.element, styles);
return wrapper;
},
/**
* VML and useHTML method for calculating the bounding box based on offsets
* @param {Boolean} refresh Whether to force a fresh value from the DOM or to
* use the cached value
*
* @return {Object} A hash containing values for x, y, width and height
*/
htmlGetBBox: function () {
var wrapper = this,
element = wrapper.element;
// faking getBBox in exported SVG in legacy IE
// faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?)
if (element.nodeName === 'text') {
element.style.position = ABSOLUTE;
}
return {
x: element.offsetLeft,
y: element.offsetTop,
width: element.offsetWidth,
height: element.offsetHeight
};
},
/**
* VML override private method to update elements based on internal
* properties based on SVG transform
*/
htmlUpdateTransform: function () {
// aligning non added elements is expensive
if (!this.added) {
this.alignOnAdd = true;
return;
}
var wrapper = this,
renderer = wrapper.renderer,
elem = wrapper.element,
translateX = wrapper.translateX || 0,
translateY = wrapper.translateY || 0,
x = wrapper.x || 0,
y = wrapper.y || 0,
align = wrapper.textAlign || 'left',
alignCorrection = { left: 0, center: 0.5, right: 1 }[align],
shadows = wrapper.shadows,
styles = wrapper.styles;
// apply translate
css(elem, {
marginLeft: translateX,
marginTop: translateY
});
if (shadows) { // used in labels/tooltip
each(shadows, function (shadow) {
css(shadow, {
marginLeft: translateX + 1,
marginTop: translateY + 1
});
});
}
// apply inversion
if (wrapper.inverted) { // wrapper is a group
each(elem.childNodes, function (child) {
renderer.invertChild(child, elem);
});
}
if (elem.tagName === 'SPAN') {
var width,
rotation = wrapper.rotation,
baseline,
textWidth = pInt(wrapper.textWidth),
currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');
if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed
baseline = renderer.fontMetrics(elem.style.fontSize).b;
// Renderer specific handling of span rotation
if (defined(rotation)) {
wrapper.setSpanRotation(rotation, alignCorrection, baseline);
}
width = pick(wrapper.elemWidth, elem.offsetWidth);
// Update textWidth
if (width > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254
css(elem, {
width: textWidth + PX,
display: 'block',
whiteSpace: (styles && styles.whiteSpace) || 'normal' // #3331
});
width = textWidth;
}
wrapper.getSpanCorrection(width, baseline, alignCorrection, rotation, align);
}
// apply position with correction
css(elem, {
left: (x + (wrapper.xCorr || 0)) + PX,
top: (y + (wrapper.yCorr || 0)) + PX
});
// force reflow in webkit to apply the left and top on useHTML element (#1249)
if (isWebKit) {
baseline = elem.offsetHeight; // assigned to baseline for JSLint purpose
}
// record current text transform
wrapper.cTT = currentTextTransform;
}
},
/**
* Set the rotation of an individual HTML span
*/
setSpanRotation: function (rotation, alignCorrection, baseline) {
var rotationStyle = {},
cssTransformKey = isIE ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : '';
rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)';
rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px';
css(this.element, rotationStyle);
},
/**
* Get the correction in X and Y positioning as the element is rotated.
*/
getSpanCorrection: function (width, baseline, alignCorrection) {
this.xCorr = -width * alignCorrection;
this.yCorr = -baseline;
}
});
// Extend SvgRenderer for useHTML option.
extend(SVGRenderer.prototype, {
/**
* Create HTML text node. This is used by the VML renderer as well as the SVG
* renderer through the useHTML option.
*
* @param {String} str
* @param {Number} x
* @param {Number} y
*/
html: function (str, x, y) {
var wrapper = this.createElement('span'),
element = wrapper.element,
renderer = wrapper.renderer;
// Text setter
wrapper.textSetter = function (value) {
if (value !== element.innerHTML) {
delete this.bBox;
}
element.innerHTML = this.textStr = value;
};
// Various setters which rely on update transform
wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) {
if (key === 'align') {
key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML.
}
wrapper[key] = value;
wrapper.htmlUpdateTransform();
};
// Set the default attributes
wrapper.attr({
text: str,
x: mathRound(x),
y: mathRound(y)
})
.css({
position: ABSOLUTE,
fontFamily: this.style.fontFamily,
fontSize: this.style.fontSize
});
// Keep the whiteSpace style outside the wrapper.styles collection
element.style.whiteSpace = 'nowrap';
// Use the HTML specific .css method
wrapper.css = wrapper.htmlCss;
// This is specific for HTML within SVG
if (renderer.isSVG) {
wrapper.add = function (svgGroupWrapper) {
var htmlGroup,
container = renderer.box.parentNode,
parentGroup,
parents = [];
this.parentGroup = svgGroupWrapper;
// Create a mock group to hold the HTML elements
if (svgGroupWrapper) {
htmlGroup = svgGroupWrapper.div;
if (!htmlGroup) {
// Read the parent chain into an array and read from top down
parentGroup = svgGroupWrapper;
while (parentGroup) {
parents.push(parentGroup);
// Move up to the next parent group
parentGroup = parentGroup.parentGroup;
}
// Ensure dynamically updating position when any parent is translated
each(parents.reverse(), function (parentGroup) {
var htmlGroupStyle;
// Create a HTML div and append it to the parent div to emulate
// the SVG group structure
htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, {
className: attr(parentGroup.element, 'class')
}, {
position: ABSOLUTE,
left: (parentGroup.translateX || 0) + PX,
top: (parentGroup.translateY || 0) + PX
}, htmlGroup || container); // the top group is appended to container
// Shortcut
htmlGroupStyle = htmlGroup.style;
// Set listeners to update the HTML div's position whenever the SVG group
// position is changed
extend(parentGroup, {
translateXSetter: function (value, key) {
htmlGroupStyle.left = value + PX;
parentGroup[key] = value;
parentGroup.doTransform = true;
},
translateYSetter: function (value, key) {
htmlGroupStyle.top = value + PX;
parentGroup[key] = value;
parentGroup.doTransform = true;
},
visibilitySetter: function (value, key) {
htmlGroupStyle[key] = value;
}
});
});
}
} else {
htmlGroup = container;
}
htmlGroup.appendChild(element);
// Shared with VML:
wrapper.added = true;
if (wrapper.alignOnAdd) {
wrapper.htmlUpdateTransform();
}
return wrapper;
};
}
return wrapper;
}
});
/* ****************************************************************************
* *
* START OF INTERNET EXPLORER <= 8 SPECIFIC CODE *
* *
* For applications and websites that don't need IE support, like platform *
* targeted mobile apps and web apps, this code can be removed. *
* *
*****************************************************************************/
/**
* @constructor
*/
var VMLRenderer, VMLElement;
if (!hasSVG && !useCanVG) {
/**
* The VML element wrapper.
*/
VMLElement = {
/**
* Initialize a new VML element wrapper. It builds the markup as a string
* to minimize DOM traffic.
* @param {Object} renderer
* @param {Object} nodeName
*/
init: function (renderer, nodeName) {
var wrapper = this,
markup = ['<', nodeName, ' filled="f" stroked="f"'],
style = ['position: ', ABSOLUTE, ';'],
isDiv = nodeName === DIV;
// divs and shapes need size
if (nodeName === 'shape' || isDiv) {
style.push('left:0;top:0;width:1px;height:1px;');
}
style.push('visibility: ', isDiv ? HIDDEN : VISIBLE);
markup.push(' style="', style.join(''), '"/>');
// create element with default attributes and style
if (nodeName) {
markup = isDiv || nodeName === 'span' || nodeName === 'img' ?
markup.join('')
: renderer.prepVML(markup);
wrapper.element = createElement(markup);
}
wrapper.renderer = renderer;
},
/**
* Add the node to the given parent
* @param {Object} parent
*/
add: function (parent) {
var wrapper = this,
renderer = wrapper.renderer,
element = wrapper.element,
box = renderer.box,
inverted = parent && parent.inverted,
// get the parent node
parentNode = parent ?
parent.element || parent :
box;
// if the parent group is inverted, apply inversion on all children
if (inverted) { // only on groups
renderer.invertChild(element, parentNode);
}
// append it
parentNode.appendChild(element);
// align text after adding to be able to read offset
wrapper.added = true;
if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
wrapper.updateTransform();
}
// fire an event for internal hooks
if (wrapper.onAdd) {
wrapper.onAdd();
}
return wrapper;
},
/**
* VML always uses htmlUpdateTransform
*/
updateTransform: SVGElement.prototype.htmlUpdateTransform,
/**
* Set the rotation of a span with oldIE's filter
*/
setSpanRotation: function () {
// Adjust for alignment and rotation. Rotation of useHTML content is not yet implemented
// but it can probably be implemented for Firefox 3.5+ on user request. FF3.5+
// has support for CSS3 transform. The getBBox method also needs to be updated
// to compensate for the rotation, like it currently does for SVG.
// Test case: http://jsfiddle.net/highcharts/Ybt44/
var rotation = this.rotation,
costheta = mathCos(rotation * deg2rad),
sintheta = mathSin(rotation * deg2rad);
css(this.element, {
filter: rotation ? ['progid:DXImageTransform.Microsoft.Matrix(M11=', costheta,
', M12=', -sintheta, ', M21=', sintheta, ', M22=', costheta,
', sizingMethod=\'auto expand\')'].join('') : NONE
});
},
/**
* Get the positioning correction for the span after rotating.
*/
getSpanCorrection: function (width, baseline, alignCorrection, rotation, align) {
var costheta = rotation ? mathCos(rotation * deg2rad) : 1,
sintheta = rotation ? mathSin(rotation * deg2rad) : 0,
height = pick(this.elemHeight, this.element.offsetHeight),
quad,
nonLeft = align && align !== 'left';
// correct x and y
this.xCorr = costheta < 0 && -width;
this.yCorr = sintheta < 0 && -height;
// correct for baseline and corners spilling out after rotation
quad = costheta * sintheta < 0;
this.xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection);
this.yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1);
// correct for the length/height of the text
if (nonLeft) {
this.xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1);
if (rotation) {
this.yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1);
}
css(this.element, {
textAlign: align
});
}
},
/**
* Converts a subset of an SVG path definition to its VML counterpart. Takes an array
* as the parameter and returns a string.
*/
pathToVML: function (value) {
// convert paths
var i = value.length,
path = [];
while (i--) {
// Multiply by 10 to allow subpixel precision.
// Substracting half a pixel seems to make the coordinates
// align with SVG, but this hasn't been tested thoroughly
if (isNumber(value[i])) {
path[i] = mathRound(value[i] * 10) - 5;
} else if (value[i] === 'Z') { // close the path
path[i] = 'x';
} else {
path[i] = value[i];
// When the start X and end X coordinates of an arc are too close,
// they are rounded to the same value above. In this case, substract or
// add 1 from the end X and Y positions. #186, #760, #1371, #1410.
if (value.isArc && (value[i] === 'wa' || value[i] === 'at')) {
// Start and end X
if (path[i + 5] === path[i + 7]) {
path[i + 7] += value[i + 7] > value[i + 5] ? 1 : -1;
}
// Start and end Y
if (path[i + 6] === path[i + 8]) {
path[i + 8] += value[i + 8] > value[i + 6] ? 1 : -1;
}
}
}
}
// Loop up again to handle path shortcuts (#2132)
/*while (i++ < path.length) {
if (path[i] === 'H') { // horizontal line to
path[i] = 'L';
path.splice(i + 2, 0, path[i - 1]);
} else if (path[i] === 'V') { // vertical line to
path[i] = 'L';
path.splice(i + 1, 0, path[i - 2]);
}
}*/
return path.join(' ') || 'x';
},
/**
* Set the element's clipping to a predefined rectangle
*
* @param {String} id The id of the clip rectangle
*/
clip: function (clipRect) {
var wrapper = this,
clipMembers,
cssRet;
if (clipRect) {
clipMembers = clipRect.members;
erase(clipMembers, wrapper); // Ensure unique list of elements (#1258)
clipMembers.push(wrapper);
wrapper.destroyClip = function () {
erase(clipMembers, wrapper);
};
cssRet = clipRect.getCSS(wrapper);
} else {
if (wrapper.destroyClip) {
wrapper.destroyClip();
}
cssRet = { clip: docMode8 ? 'inherit' : 'rect(auto)' }; // #1214
}
return wrapper.css(cssRet);
},
/**
* Set styles for the element
* @param {Object} styles
*/
css: SVGElement.prototype.htmlCss,
/**
* Removes a child either by removeChild or move to garbageBin.
* Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
*/
safeRemoveChild: function (element) {
// discardElement will detach the node from its parent before attaching it
// to the garbage bin. Therefore it is important that the node is attached and have parent.
if (element.parentNode) {
discardElement(element);
}
},
/**
* Extend element.destroy by removing it from the clip members array
*/
destroy: function () {
if (this.destroyClip) {
this.destroyClip();
}
return SVGElement.prototype.destroy.apply(this);
},
/**
* Add an event listener. VML override for normalizing event parameters.
* @param {String} eventType
* @param {Function} handler
*/
on: function (eventType, handler) {
// simplest possible event model for internal use
this.element['on' + eventType] = function () {
var evt = win.event;
evt.target = evt.srcElement;
handler(evt);
};
return this;
},
/**
* In stacked columns, cut off the shadows so that they don't overlap
*/
cutOffPath: function (path, length) {
var len;
path = path.split(/[ ,]/);
len = path.length;
if (len === 9 || len === 11) {
path[len - 4] = path[len - 2] = pInt(path[len - 2]) - 10 * length;
}
return path.join(' ');
},
/**
* Apply a drop shadow by copying elements and giving them different strokes
* @param {Boolean|Object} shadowOptions
*/
shadow: function (shadowOptions, group, cutOff) {
var shadows = [],
i,
element = this.element,
renderer = this.renderer,
shadow,
elemStyle = element.style,
markup,
path = element.path,
strokeWidth,
modifiedPath,
shadowWidth,
shadowElementOpacity;
// some times empty paths are not strings
if (path && typeof path.value !== 'string') {
path = 'x';
}
modifiedPath = path;
if (shadowOptions) {
shadowWidth = pick(shadowOptions.width, 3);
shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
for (i = 1; i <= 3; i++) {
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
// Cut off shadows for stacked column items
if (cutOff) {
modifiedPath = this.cutOffPath(path.value, strokeWidth + 0.5);
}
markup = ['<shape isShadow="true" strokeweight="', strokeWidth,
'" filled="false" path="', modifiedPath,
'" coordsize="10 10" style="', element.style.cssText, '" />'];
shadow = createElement(renderer.prepVML(markup),
null, {
left: pInt(elemStyle.left) + pick(shadowOptions.offsetX, 1),
top: pInt(elemStyle.top) + pick(shadowOptions.offsetY, 1)
}
);
if (cutOff) {
shadow.cutOff = strokeWidth + 1;
}
// apply the opacity
markup = ['<stroke color="', shadowOptions.color || 'black', '" opacity="', shadowElementOpacity * i, '"/>'];
createElement(renderer.prepVML(markup), null, null, shadow);
// insert it
if (group) {
group.element.appendChild(shadow);
} else {
element.parentNode.insertBefore(shadow, element);
}
// record it
shadows.push(shadow);
}
this.shadows = shadows;
}
return this;
},
updateShadows: noop, // Used in SVG only
setAttr: function (key, value) {
if (docMode8) { // IE8 setAttribute bug
this.element[key] = value;
} else {
this.element.setAttribute(key, value);
}
},
classSetter: function (value) {
// IE8 Standards mode has problems retrieving the className unless set like this
this.element.className = value;
},
dashstyleSetter: function (value, key, element) {
var strokeElem = element.getElementsByTagName('stroke')[0] ||
createElement(this.renderer.prepVML(['<stroke/>']), null, null, element);
strokeElem[key] = value || 'solid';
this[key] = value; /* because changing stroke-width will change the dash length
and cause an epileptic effect */
},
dSetter: function (value, key, element) {
var i,
shadows = this.shadows;
value = value || [];
this.d = value.join && value.join(' '); // used in getter for animation
element.path = value = this.pathToVML(value);
// update shadows
if (shadows) {
i = shadows.length;
while (i--) {
shadows[i].path = shadows[i].cutOff ? this.cutOffPath(value, shadows[i].cutOff) : value;
}
}
this.setAttr(key, value);
},
fillSetter: function (value, key, element) {
var nodeName = element.nodeName;
if (nodeName === 'SPAN') { // text color
element.style.color = value;
} else if (nodeName !== 'IMG') { // #1336
element.filled = value !== NONE;
this.setAttr('fillcolor', this.renderer.color(value, element, key, this));
}
},
opacitySetter: noop, // Don't bother - animation is too slow and filters introduce artifacts
rotationSetter: function (value, key, element) {
var style = element.style;
this[key] = style[key] = value; // style is for #1873
// Correction for the 1x1 size of the shape container. Used in gauge needles.
style.left = -mathRound(mathSin(value * deg2rad) + 1) + PX;
style.top = mathRound(mathCos(value * deg2rad)) + PX;
},
strokeSetter: function (value, key, element) {
this.setAttr('strokecolor', this.renderer.color(value, element, key));
},
'stroke-widthSetter': function (value, key, element) {
element.stroked = !!value; // VML "stroked" attribute
this[key] = value; // used in getter, issue #113
if (isNumber(value)) {
value += PX;
}
this.setAttr('strokeweight', value);
},
titleSetter: function (value, key) {
this.setAttr(key, value);
},
visibilitySetter: function (value, key, element) {
// Handle inherited visibility
if (value === 'inherit') {
value = VISIBLE;
}
// Let the shadow follow the main element
if (this.shadows) {
each(this.shadows, function (shadow) {
shadow.style[key] = value;
});
}
// Instead of toggling the visibility CSS property, move the div out of the viewport.
// This works around #61 and #586
if (element.nodeName === 'DIV') {
value = value === HIDDEN ? '-999em' : 0;
// In order to redraw, IE7 needs the div to be visible when tucked away
// outside the viewport. So the visibility is actually opposite of
// the expected value. This applies to the tooltip only.
if (!docMode8) {
element.style[key] = value ? VISIBLE : HIDDEN;
}
key = 'top';
}
element.style[key] = value;
},
xSetter: function (value, key, element) {
this[key] = value; // used in getter
if (key === 'x') {
key = 'left';
} else if (key === 'y') {
key = 'top';
}/* else {
value = mathMax(0, value); // don't set width or height below zero (#311)
}*/
// clipping rectangle special
if (this.updateClipping) {
this[key] = value; // the key is now 'left' or 'top' for 'x' and 'y'
this.updateClipping();
} else {
// normal
element.style[key] = value;
}
},
zIndexSetter: function (value, key, element) {
element.style[key] = value;
}
};
Highcharts.VMLElement = VMLElement = extendClass(SVGElement, VMLElement);
// Some shared setters
VMLElement.prototype.ySetter =
VMLElement.prototype.widthSetter =
VMLElement.prototype.heightSetter =
VMLElement.prototype.xSetter;
/**
* The VML renderer
*/
var VMLRendererExtension = { // inherit SVGRenderer
Element: VMLElement,
isIE8: userAgent.indexOf('MSIE 8.0') > -1,
/**
* Initialize the VMLRenderer
* @param {Object} container
* @param {Number} width
* @param {Number} height
*/
init: function (container, width, height, style) {
var renderer = this,
boxWrapper,
box,
css;
renderer.alignedObjects = [];
boxWrapper = renderer.createElement(DIV)
.css(extend(this.getStyle(style), { position: RELATIVE}));
box = boxWrapper.element;
container.appendChild(boxWrapper.element);
// generate the containing box
renderer.isVML = true;
renderer.box = box;
renderer.boxWrapper = boxWrapper;
renderer.cache = {};
renderer.setSize(width, height, false);
// The only way to make IE6 and IE7 print is to use a global namespace. However,
// with IE8 the only way to make the dynamic shapes visible in screen and print mode
// seems to be to add the xmlns attribute and the behaviour style inline.
if (!doc.namespaces.hcv) {
doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml');
// Setup default CSS (#2153, #2368, #2384)
css = 'hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke' +
'{ behavior:url(#default#VML); display: inline-block; } ';
try {
doc.createStyleSheet().cssText = css;
} catch (e) {
doc.styleSheets[0].cssText += css;
}
}
},
/**
* Detect whether the renderer is hidden. This happens when one of the parent elements
* has display: none
*/
isHidden: function () {
return !this.box.offsetWidth;
},
/**
* Define a clipping rectangle. In VML it is accomplished by storing the values
* for setting the CSS style to all associated members.
*
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
clipRect: function (x, y, width, height) {
// create a dummy element
var clipRect = this.createElement(),
isObj = isObject(x);
// mimic a rectangle with its style object for automatic updating in attr
return extend(clipRect, {
members: [],
count: 0,
left: (isObj ? x.x : x) + 1,
top: (isObj ? x.y : y) + 1,
width: (isObj ? x.width : width) - 1,
height: (isObj ? x.height : height) - 1,
getCSS: function (wrapper) {
var element = wrapper.element,
nodeName = element.nodeName,
isShape = nodeName === 'shape',
inverted = wrapper.inverted,
rect = this,
top = rect.top - (isShape ? element.offsetTop : 0),
left = rect.left,
right = left + rect.width,
bottom = top + rect.height,
ret = {
clip: 'rect(' +
mathRound(inverted ? left : top) + 'px,' +
mathRound(inverted ? bottom : right) + 'px,' +
mathRound(inverted ? right : bottom) + 'px,' +
mathRound(inverted ? top : left) + 'px)'
};
// issue 74 workaround
if (!inverted && docMode8 && nodeName === 'DIV') {
extend(ret, {
width: right + PX,
height: bottom + PX
});
}
return ret;
},
// used in attr and animation to update the clipping of all members
updateClipping: function () {
each(clipRect.members, function (member) {
if (member.element) { // Deleted series, like in stock/members/series-remove demo. Should be removed from members, but this will do.
member.css(clipRect.getCSS(member));
}
});
}
});
},
/**
* Take a color and return it if it's a string, make it a gradient if it's a
* gradient configuration object, and apply opacity.
*
* @param {Object} color The color or config object
*/
color: function (color, elem, prop, wrapper) {
var renderer = this,
colorObject,
regexRgba = /^rgba/,
markup,
fillType,
ret = NONE;
// Check for linear or radial gradient
if (color && color.linearGradient) {
fillType = 'gradient';
} else if (color && color.radialGradient) {
fillType = 'pattern';
}
if (fillType) {
var stopColor,
stopOpacity,
gradient = color.linearGradient || color.radialGradient,
x1,
y1,
x2,
y2,
opacity1,
opacity2,
color1,
color2,
fillAttr = '',
stops = color.stops,
firstStop,
lastStop,
colors = [],
addFillNode = function () {
// Add the fill subnode. When colors attribute is used, the meanings of opacity and o:opacity2
// are reversed.
markup = ['<fill colors="' + colors.join(',') + '" opacity="', opacity2, '" o:opacity2="', opacity1,
'" type="', fillType, '" ', fillAttr, 'focus="100%" method="any" />'];
createElement(renderer.prepVML(markup), null, null, elem);
};
// Extend from 0 to 1
firstStop = stops[0];
lastStop = stops[stops.length - 1];
if (firstStop[0] > 0) {
stops.unshift([
0,
firstStop[1]
]);
}
if (lastStop[0] < 1) {
stops.push([
1,
lastStop[1]
]);
}
// Compute the stops
each(stops, function (stop, i) {
if (regexRgba.test(stop[1])) {
colorObject = Color(stop[1]);
stopColor = colorObject.get('rgb');
stopOpacity = colorObject.get('a');
} else {
stopColor = stop[1];
stopOpacity = 1;
}
// Build the color attribute
colors.push((stop[0] * 100) + '% ' + stopColor);
// Only start and end opacities are allowed, so we use the first and the last
if (!i) {
opacity1 = stopOpacity;
color2 = stopColor;
} else {
opacity2 = stopOpacity;
color1 = stopColor;
}
});
// Apply the gradient to fills only.
if (prop === 'fill') {
// Handle linear gradient angle
if (fillType === 'gradient') {
x1 = gradient.x1 || gradient[0] || 0;
y1 = gradient.y1 || gradient[1] || 0;
x2 = gradient.x2 || gradient[2] || 0;
y2 = gradient.y2 || gradient[3] || 0;
fillAttr = 'angle="' + (90 - math.atan(
(y2 - y1) / // y vector
(x2 - x1) // x vector
) * 180 / mathPI) + '"';
addFillNode();
// Radial (circular) gradient
} else {
var r = gradient.r,
sizex = r * 2,
sizey = r * 2,
cx = gradient.cx,
cy = gradient.cy,
radialReference = elem.radialReference,
bBox,
applyRadialGradient = function () {
if (radialReference) {
bBox = wrapper.getBBox();
cx += (radialReference[0] - bBox.x) / bBox.width - 0.5;
cy += (radialReference[1] - bBox.y) / bBox.height - 0.5;
sizex *= radialReference[2] / bBox.width;
sizey *= radialReference[2] / bBox.height;
}
fillAttr = 'src="' + defaultOptions.global.VMLRadialGradientURL + '" ' +
'size="' + sizex + ',' + sizey + '" ' +
'origin="0.5,0.5" ' +
'position="' + cx + ',' + cy + '" ' +
'color2="' + color2 + '" ';
addFillNode();
};
// Apply radial gradient
if (wrapper.added) {
applyRadialGradient();
} else {
// We need to know the bounding box to get the size and position right
wrapper.onAdd = applyRadialGradient;
}
// The fill element's color attribute is broken in IE8 standards mode, so we
// need to set the parent shape's fillcolor attribute instead.
ret = color1;
}
// Gradients are not supported for VML stroke, return the first color. #722.
} else {
ret = stopColor;
}
// if the color is an rgba color, split it and add a fill node
// to hold the opacity component
} else if (regexRgba.test(color) && elem.tagName !== 'IMG') {
colorObject = Color(color);
markup = ['<', prop, ' opacity="', colorObject.get('a'), '"/>'];
createElement(this.prepVML(markup), null, null, elem);
ret = colorObject.get('rgb');
} else {
var propNodes = elem.getElementsByTagName(prop); // 'stroke' or 'fill' node
if (propNodes.length) {
propNodes[0].opacity = 1;
propNodes[0].type = 'solid';
}
ret = color;
}
return ret;
},
/**
* Take a VML string and prepare it for either IE8 or IE6/IE7.
* @param {Array} markup A string array of the VML markup to prepare
*/
prepVML: function (markup) {
var vmlStyle = 'display:inline-block;behavior:url(#default#VML);',
isIE8 = this.isIE8;
markup = markup.join('');
if (isIE8) { // add xmlns and style inline
markup = markup.replace('/>', ' xmlns="urn:schemas-microsoft-com:vml" />');
if (markup.indexOf('style="') === -1) {
markup = markup.replace('/>', ' style="' + vmlStyle + '" />');
} else {
markup = markup.replace('style="', 'style="' + vmlStyle);
}
} else { // add namespace
markup = markup.replace('<', '<hcv:');
}
return markup;
},
/**
* Create rotated and aligned text
* @param {String} str
* @param {Number} x
* @param {Number} y
*/
text: SVGRenderer.prototype.html,
/**
* Create and return a path element
* @param {Array} path
*/
path: function (path) {
var attr = {
// subpixel precision down to 0.1 (width and height = 1px)
coordsize: '10 10'
};
if (isArray(path)) {
attr.d = path;
} else if (isObject(path)) { // attributes
extend(attr, path);
}
// create the shape
return this.createElement('shape').attr(attr);
},
/**
* Create and return a circle element. In VML circles are implemented as
* shapes, which is faster than v:oval
* @param {Number} x
* @param {Number} y
* @param {Number} r
*/
circle: function (x, y, r) {
var circle = this.symbol('circle');
if (isObject(x)) {
r = x.r;
y = x.y;
x = x.x;
}
circle.isCircle = true; // Causes x and y to mean center (#1682)
circle.r = r;
return circle.attr({ x: x, y: y });
},
/**
* Create a group using an outer div and an inner v:group to allow rotating
* and flipping. A simple v:group would have problems with positioning
* child HTML elements and CSS clip.
*
* @param {String} name The name of the group
*/
g: function (name) {
var wrapper,
attribs;
// set the class name
if (name) {
attribs = { 'className': PREFIX + name, 'class': PREFIX + name };
}
// the div to hold HTML and clipping
wrapper = this.createElement(DIV).attr(attribs);
return wrapper;
},
/**
* VML override to create a regular HTML image
* @param {String} src
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
image: function (src, x, y, width, height) {
var obj = this.createElement('img')
.attr({ src: src });
if (arguments.length > 1) {
obj.attr({
x: x,
y: y,
width: width,
height: height
});
}
return obj;
},
/**
* For rectangles, VML uses a shape for rect to overcome bugs and rotation problems
*/
createElement: function (nodeName) {
return nodeName === 'rect' ? this.symbol(nodeName) : SVGRenderer.prototype.createElement.call(this, nodeName);
},
/**
* In the VML renderer, each child of an inverted div (group) is inverted
* @param {Object} element
* @param {Object} parentNode
*/
invertChild: function (element, parentNode) {
var ren = this,
parentStyle = parentNode.style,
imgStyle = element.tagName === 'IMG' && element.style; // #1111
css(element, {
flip: 'x',
left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1),
top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1),
rotation: -90
});
// Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806.
each(element.childNodes, function (child) {
ren.invertChild(child, element);
});
},
/**
* Symbol definitions that override the parent SVG renderer's symbols
*
*/
symbols: {
// VML specific arc function
arc: function (x, y, w, h, options) {
var start = options.start,
end = options.end,
radius = options.r || w || h,
innerRadius = options.innerR,
cosStart = mathCos(start),
sinStart = mathSin(start),
cosEnd = mathCos(end),
sinEnd = mathSin(end),
ret;
if (end - start === 0) { // no angle, don't show it.
return ['x'];
}
ret = [
'wa', // clockwise arc to
x - radius, // left
y - radius, // top
x + radius, // right
y + radius, // bottom
x + radius * cosStart, // start x
y + radius * sinStart, // start y
x + radius * cosEnd, // end x
y + radius * sinEnd // end y
];
if (options.open && !innerRadius) {
ret.push(
'e',
M,
x,// - innerRadius,
y// - innerRadius
);
}
ret.push(
'at', // anti clockwise arc to
x - innerRadius, // left
y - innerRadius, // top
x + innerRadius, // right
y + innerRadius, // bottom
x + innerRadius * cosEnd, // start x
y + innerRadius * sinEnd, // start y
x + innerRadius * cosStart, // end x
y + innerRadius * sinStart, // end y
'x', // finish path
'e' // close
);
ret.isArc = true;
return ret;
},
// Add circle symbol path. This performs significantly faster than v:oval.
circle: function (x, y, w, h, wrapper) {
if (wrapper) {
w = h = 2 * wrapper.r;
}
// Center correction, #1682
if (wrapper && wrapper.isCircle) {
x -= w / 2;
y -= h / 2;
}
// Return the path
return [
'wa', // clockwisearcto
x, // left
y, // top
x + w, // right
y + h, // bottom
x + w, // start x
y + h / 2, // start y
x + w, // end x
y + h / 2, // end y
//'x', // finish path
'e' // close
];
},
/**
* Add rectangle symbol path which eases rotation and omits arcsize problems
* compared to the built-in VML roundrect shape. When borders are not rounded,
* use the simpler square path, else use the callout path without the arrow.
*/
rect: function (x, y, w, h, options) {
return SVGRenderer.prototype.symbols[
!defined(options) || !options.r ? 'square' : 'callout'
].call(0, x, y, w, h, options);
}
}
};
Highcharts.VMLRenderer = VMLRenderer = function () {
this.init.apply(this, arguments);
};
VMLRenderer.prototype = merge(SVGRenderer.prototype, VMLRendererExtension);
// general renderer
Renderer = VMLRenderer;
}
// This method is used with exporting in old IE, when emulating SVG (see #2314)
SVGRenderer.prototype.measureSpanWidth = function (text, styles) {
var measuringSpan = doc.createElement('span'),
offsetWidth,
textNode = doc.createTextNode(text);
measuringSpan.appendChild(textNode);
css(measuringSpan, styles);
this.box.appendChild(measuringSpan);
offsetWidth = measuringSpan.offsetWidth;
discardElement(measuringSpan); // #2463
return offsetWidth;
};
/* ****************************************************************************
* *
* END OF INTERNET EXPLORER <= 8 SPECIFIC CODE *
* *
*****************************************************************************/
/* ****************************************************************************
* *
* START OF ANDROID < 3 SPECIFIC CODE. THIS CAN BE REMOVED IF YOU'RE NOT *
* TARGETING THAT SYSTEM. *
* *
*****************************************************************************/
var CanVGRenderer,
CanVGController;
if (useCanVG) {
/**
* The CanVGRenderer is empty from start to keep the source footprint small.
* When requested, the CanVGController downloads the rest of the source packaged
* together with the canvg library.
*/
Highcharts.CanVGRenderer = CanVGRenderer = function () {
// Override the global SVG namespace to fake SVG/HTML that accepts CSS
SVG_NS = 'http://www.w3.org/1999/xhtml';
};
/**
* Start with an empty symbols object. This is needed when exporting is used (exporting.src.js will add a few symbols), but
* the implementation from SvgRenderer will not be merged in until first render.
*/
CanVGRenderer.prototype.symbols = {};
/**
* Handles on demand download of canvg rendering support.
*/
CanVGController = (function () {
// List of renderering calls
var deferredRenderCalls = [];
/**
* When downloaded, we are ready to draw deferred charts.
*/
function drawDeferred() {
var callLength = deferredRenderCalls.length,
callIndex;
// Draw all pending render calls
for (callIndex = 0; callIndex < callLength; callIndex++) {
deferredRenderCalls[callIndex]();
}
// Clear the list
deferredRenderCalls = [];
}
return {
push: function (func, scriptLocation) {
// Only get the script once
if (deferredRenderCalls.length === 0) {
getScript(scriptLocation, drawDeferred);
}
// Register render call
deferredRenderCalls.push(func);
}
};
}());
Renderer = CanVGRenderer;
} // end CanVGRenderer
/* ****************************************************************************
* *
* END OF ANDROID < 3 SPECIFIC CODE *
* *
*****************************************************************************/
/**
* The Tick class
*/
function Tick(axis, pos, type, noLabel) {
this.axis = axis;
this.pos = pos;
this.type = type || '';
this.isNew = true;
if (!type && !noLabel) {
this.addLabel();
}
}
Tick.prototype = {
/**
* Write the tick label
*/
addLabel: function () {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
categories = axis.categories,
names = axis.names,
pos = tick.pos,
labelOptions = options.labels,
str,
tickPositions = axis.tickPositions,
isFirst = pos === tickPositions[0],
isLast = pos === tickPositions[tickPositions.length - 1],
value = categories ?
pick(categories[pos], names[pos], pos) :
pos,
label = tick.label,
tickPositionInfo = tickPositions.info,
dateTimeLabelFormat;
// Set the datetime label format. If a higher rank is set for this position, use that. If not,
// use the general format.
if (axis.isDatetimeAxis && tickPositionInfo) {
dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName];
}
// set properties for access in render method
tick.isFirst = isFirst;
tick.isLast = isLast;
// get the string
str = axis.labelFormatter.call({
axis: axis,
chart: chart,
isFirst: isFirst,
isLast: isLast,
dateTimeLabelFormat: dateTimeLabelFormat,
value: axis.isLog ? correctFloat(lin2log(value)) : value
});
// prepare CSS
//css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX };
// first call
if (!defined(label)) {
tick.label = label =
defined(str) && labelOptions.enabled ?
chart.renderer.text(
str,
0,
0,
labelOptions.useHTML
)
//.attr(attr)
// without position absolute, IE export sometimes is wrong
.css(merge(labelOptions.style))
.add(axis.labelGroup) :
null;
tick.labelLength = label && label.getBBox().width; // Un-rotated length
tick.rotation = 0; // Base value to detect change for new calls to getBBox
// update
} else if (label) {
label.attr({ text: str });
}
},
/**
* Get the offset height or width of the label
*/
getLabelSize: function () {
return this.label ?
this.label.getBBox()[this.axis.horiz ? 'height' : 'width'] :
0;
},
/**
* Handle the label overflow by adjusting the labels to the left and right edge, or
* hide them if they collide into the neighbour label.
*/
handleOverflow: function (xy) {
var axis = this.axis,
pxPos = xy.x,
chartWidth = axis.chart.chartWidth,
spacing = axis.chart.spacing,
leftBound = pick(axis.labelLeft, spacing[3]),
rightBound = pick(axis.labelRight, chartWidth - spacing[1]),
label = this.label,
rotation = this.rotation,
factor = { left: 0, center: 0.5, right: 1 }[axis.labelAlign],
labelWidth = label.getBBox().width,
slotWidth = axis.slotWidth,
leftPos,
rightPos,
textWidth;
// Check if the label overshoots the chart spacing box. If it does, move it.
// If it now overshoots the slotWidth, add ellipsis.
if (!rotation) {
leftPos = pxPos - factor * labelWidth;
rightPos = pxPos + factor * labelWidth;
if (leftPos < leftBound) {
slotWidth -= leftBound - leftPos;
xy.x = leftBound;
label.attr({ align: 'left' });
} else if (rightPos > rightBound) {
slotWidth -= rightPos - rightBound;
xy.x = rightBound;
label.attr({ align: 'right' });
}
if (labelWidth > slotWidth) {
textWidth = slotWidth;
}
// Add ellipsis to prevent rotated labels to be clipped against the edge of the chart
} else if (rotation < 0 && pxPos - factor * labelWidth < leftBound) {
textWidth = mathRound(pxPos / mathCos(rotation * deg2rad) - leftBound);
} else if (rotation > 0 && pxPos + factor * labelWidth > rightBound) {
textWidth = mathRound((chartWidth - pxPos) / mathCos(rotation * deg2rad));
}
if (textWidth) {
label.css({
width: textWidth,
textOverflow: 'ellipsis'
});
}
},
/**
* Get the x and y position for ticks and labels
*/
getPosition: function (horiz, pos, tickmarkOffset, old) {
var axis = this.axis,
chart = axis.chart,
cHeight = (old && chart.oldChartHeight) || chart.chartHeight;
return {
x: horiz ?
axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB :
axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0),
y: horiz ?
cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) :
cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB
};
},
/**
* Get the x, y position of the tick label
*/
getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
var axis = this.axis,
transA = axis.transA,
reversed = axis.reversed,
staggerLines = axis.staggerLines,
rotCorr = axis.tickRotCorr || { x: 0, y: 0 },
yOffset = pick(labelOptions.y, rotCorr.y + (axis.side === 2 ? 8 : -(label.getBBox().height / 2))),
line;
x = x + labelOptions.x + rotCorr.x - (tickmarkOffset && horiz ?
tickmarkOffset * transA * (reversed ? -1 : 1) : 0);
y = y + yOffset - (tickmarkOffset && !horiz ?
tickmarkOffset * transA * (reversed ? 1 : -1) : 0);
// Correct for staggered labels
if (staggerLines) {
line = (index / (step || 1) % staggerLines);
y += line * (axis.labelOffset / staggerLines);
}
return {
x: x,
y: mathRound(y)
};
},
/**
* Extendible method to return the path of the marker
*/
getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) {
return renderer.crispLine([
M,
x,
y,
L,
x + (horiz ? 0 : -tickLength),
y + (horiz ? tickLength : 0)
], tickWidth);
},
/**
* Put everything in place
*
* @param index {Number}
* @param old {Boolean} Use old coordinates to prepare an animation into new position
*/
render: function (index, old, opacity) {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
renderer = chart.renderer,
horiz = axis.horiz,
type = tick.type,
label = tick.label,
pos = tick.pos,
labelOptions = options.labels,
gridLine = tick.gridLine,
gridPrefix = type ? type + 'Grid' : 'grid',
tickPrefix = type ? type + 'Tick' : 'tick',
gridLineWidth = options[gridPrefix + 'LineWidth'],
gridLineColor = options[gridPrefix + 'LineColor'],
dashStyle = options[gridPrefix + 'LineDashStyle'],
tickLength = options[tickPrefix + 'Length'],
tickWidth = options[tickPrefix + 'Width'] || 0,
tickColor = options[tickPrefix + 'Color'],
tickPosition = options[tickPrefix + 'Position'],
gridLinePath,
mark = tick.mark,
markPath,
step = /*axis.labelStep || */labelOptions.step,
attribs,
show = true,
tickmarkOffset = axis.tickmarkOffset,
xy = tick.getPosition(horiz, pos, tickmarkOffset, old),
x = xy.x,
y = xy.y,
reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687
opacity = pick(opacity, 1);
this.isActive = true;
// create the grid line
if (gridLineWidth) {
gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true);
if (gridLine === UNDEFINED) {
attribs = {
stroke: gridLineColor,
'stroke-width': gridLineWidth
};
if (dashStyle) {
attribs.dashstyle = dashStyle;
}
if (!type) {
attribs.zIndex = 1;
}
if (old) {
attribs.opacity = 0;
}
tick.gridLine = gridLine =
gridLineWidth ?
renderer.path(gridLinePath)
.attr(attribs).add(axis.gridGroup) :
null;
}
// If the parameter 'old' is set, the current call will be followed
// by another call, therefore do not do any animations this time
if (!old && gridLine && gridLinePath) {
gridLine[tick.isNew ? 'attr' : 'animate']({
d: gridLinePath,
opacity: opacity
});
}
}
// create the tick mark
if (tickWidth && tickLength) {
// negate the length
if (tickPosition === 'inside') {
tickLength = -tickLength;
}
if (axis.opposite) {
tickLength = -tickLength;
}
markPath = tick.getMarkPath(x, y, tickLength, tickWidth * reverseCrisp, horiz, renderer);
if (mark) { // updating
mark.animate({
d: markPath,
opacity: opacity
});
} else { // first time
tick.mark = renderer.path(
markPath
).attr({
stroke: tickColor,
'stroke-width': tickWidth,
opacity: opacity
}).add(axis.axisGroup);
}
}
// the label is created on init - now move it into place
if (label && !isNaN(x)) {
label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step);
// Apply show first and show last. If the tick is both first and last, it is
// a single centered tick, in which case we show the label anyway (#2100).
if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) ||
(tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) {
show = false;
// Handle label overflow and show or hide accordingly
} else if (horiz && !axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) {
tick.handleOverflow(xy);
}
// apply step
if (step && index % step) {
// show those indices dividable by step
show = false;
}
// Set the new position, and show or hide
if (show && !isNaN(xy.y)) {
xy.opacity = opacity;
label[tick.isNew ? 'attr' : 'animate'](xy);
tick.isNew = false;
} else {
label.attr('y', -9999); // #1338
}
}
},
/**
* Destructor for the tick prototype
*/
destroy: function () {
destroyObjectProperties(this, this.axis);
}
};
/**
* The object wrapper for plot lines and plot bands
* @param {Object} options
*/
Highcharts.PlotLineOrBand = function (axis, options) {
this.axis = axis;
if (options) {
this.options = options;
this.id = options.id;
}
};
Highcharts.PlotLineOrBand.prototype = {
/**
* Render the plot line or plot band. If it is already existing,
* move it.
*/
render: function () {
var plotLine = this,
axis = plotLine.axis,
horiz = axis.horiz,
options = plotLine.options,
optionsLabel = options.label,
label = plotLine.label,
width = options.width,
to = options.to,
from = options.from,
isBand = defined(from) && defined(to),
value = options.value,
dashStyle = options.dashStyle,
svgElem = plotLine.svgElem,
path = [],
addEvent,
eventType,
xs,
ys,
x,
y,
color = options.color,
zIndex = options.zIndex,
events = options.events,
attribs = {},
renderer = axis.chart.renderer;
// logarithmic conversion
if (axis.isLog) {
from = log2lin(from);
to = log2lin(to);
value = log2lin(value);
}
// plot line
if (width) {
path = axis.getPlotLinePath(value, width);
attribs = {
stroke: color,
'stroke-width': width
};
if (dashStyle) {
attribs.dashstyle = dashStyle;
}
} else if (isBand) { // plot band
path = axis.getPlotBandPath(from, to, options);
if (color) {
attribs.fill = color;
}
if (options.borderWidth) {
attribs.stroke = options.borderColor;
attribs['stroke-width'] = options.borderWidth;
}
} else {
return;
}
// zIndex
if (defined(zIndex)) {
attribs.zIndex = zIndex;
}
// common for lines and bands
if (svgElem) {
if (path) {
svgElem.animate({
d: path
}, null, svgElem.onGetPath);
} else {
svgElem.hide();
svgElem.onGetPath = function () {
svgElem.show();
};
if (label) {
plotLine.label = label = label.destroy();
}
}
} else if (path && path.length) {
plotLine.svgElem = svgElem = renderer.path(path)
.attr(attribs).add();
// events
if (events) {
addEvent = function (eventType) {
svgElem.on(eventType, function (e) {
events[eventType].apply(plotLine, [e]);
});
};
for (eventType in events) {
addEvent(eventType);
}
}
}
// the plot band/line label
if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0) {
// apply defaults
optionsLabel = merge({
align: horiz && isBand && 'center',
x: horiz ? !isBand && 4 : 10,
verticalAlign : !horiz && isBand && 'middle',
y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4,
rotation: horiz && !isBand && 90
}, optionsLabel);
// add the SVG element
if (!label) {
attribs = {
align: optionsLabel.textAlign || optionsLabel.align,
rotation: optionsLabel.rotation
};
if (defined(zIndex)) {
attribs.zIndex = zIndex;
}
plotLine.label = label = renderer.text(
optionsLabel.text,
0,
0,
optionsLabel.useHTML
)
.attr(attribs)
.css(optionsLabel.style)
.add();
}
// get the bounding box and align the label
// #3000 changed to better handle choice between plotband or plotline
xs = [path[1], path[4], (isBand ? path[6] : path[1])];
ys = [path[2], path[5], (isBand ? path[7] : path[2])];
x = arrayMin(xs);
y = arrayMin(ys);
label.align(optionsLabel, false, {
x: x,
y: y,
width: arrayMax(xs) - x,
height: arrayMax(ys) - y
});
label.show();
} else if (label) { // move out of sight
label.hide();
}
// chainable
return plotLine;
},
/**
* Remove the plot line or band
*/
destroy: function () {
// remove it from the lookup
erase(this.axis.plotLinesAndBands, this);
delete this.axis;
destroyObjectProperties(this);
}
};
/**
* Object with members for extending the Axis prototype
*/
AxisPlotLineOrBandExtension = {
/**
* Create the path for a plot band
*/
getPlotBandPath: function (from, to) {
var toPath = this.getPlotLinePath(to, null, null, true),
path = this.getPlotLinePath(from, null, null, true);
if (path && toPath && path.toString() !== toPath.toString()) { // #3836
path.push(
toPath[4],
toPath[5],
toPath[1],
toPath[2]
);
} else { // outside the axis area
path = null;
}
return path;
},
addPlotBand: function (options) {
return this.addPlotBandOrLine(options, 'plotBands');
},
addPlotLine: function (options) {
return this.addPlotBandOrLine(options, 'plotLines');
},
/**
* Add a plot band or plot line after render time
*
* @param options {Object} The plotBand or plotLine configuration object
*/
addPlotBandOrLine: function (options, coll) {
var obj = new Highcharts.PlotLineOrBand(this, options).render(),
userOptions = this.userOptions;
if (obj) { // #2189
// Add it to the user options for exporting and Axis.update
if (coll) {
userOptions[coll] = userOptions[coll] || [];
userOptions[coll].push(options);
}
this.plotLinesAndBands.push(obj);
}
return obj;
},
/**
* Remove a plot band or plot line from the chart by id
* @param {Object} id
*/
removePlotBandOrLine: function (id) {
var plotLinesAndBands = this.plotLinesAndBands,
options = this.options,
userOptions = this.userOptions,
i = plotLinesAndBands.length;
while (i--) {
if (plotLinesAndBands[i].id === id) {
plotLinesAndBands[i].destroy();
}
}
each([options.plotLines || [], userOptions.plotLines || [], options.plotBands || [], userOptions.plotBands || []], function (arr) {
i = arr.length;
while (i--) {
if (arr[i].id === id) {
erase(arr, arr[i]);
}
}
});
}
};
/**
* Create a new axis object
* @param {Object} chart
* @param {Object} options
*/
var Axis = Highcharts.Axis = function () {
this.init.apply(this, arguments);
};
Axis.prototype = {
/**
* Default options for the X axis - the Y axis has extended defaults
*/
defaultOptions: {
// allowDecimals: null,
// alternateGridColor: null,
// categories: [],
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
},
endOnTick: false,
gridLineColor: '#D8D8D8',
// gridLineDashStyle: 'solid',
// gridLineWidth: 0,
// reversed: false,
labels: {
enabled: true,
// rotation: 0,
// align: 'center',
// step: null,
style: {
color: '#606060',
cursor: 'default',
fontSize: '11px'
},
x: 0,
y: 15
/*formatter: function () {
return this.value;
},*/
},
lineColor: '#C0D0E0',
lineWidth: 1,
//linkedTo: null,
//max: undefined,
//min: undefined,
minPadding: 0.01,
maxPadding: 0.01,
//minRange: null,
minorGridLineColor: '#E0E0E0',
// minorGridLineDashStyle: null,
minorGridLineWidth: 1,
minorTickColor: '#A0A0A0',
//minorTickInterval: null,
minorTickLength: 2,
minorTickPosition: 'outside', // inside or outside
//minorTickWidth: 0,
//opposite: false,
//offset: 0,
//plotBands: [{
// events: {},
// zIndex: 1,
// labels: { align, x, verticalAlign, y, style, rotation, textAlign }
//}],
//plotLines: [{
// events: {}
// dashStyle: {}
// zIndex:
// labels: { align, x, verticalAlign, y, style, rotation, textAlign }
//}],
//reversed: false,
// showFirstLabel: true,
// showLastLabel: true,
startOfWeek: 1,
startOnTick: false,
tickColor: '#C0D0E0',
//tickInterval: null,
tickLength: 10,
tickmarkPlacement: 'between', // on or between
tickPixelInterval: 100,
tickPosition: 'outside',
tickWidth: 1,
title: {
//text: null,
align: 'middle', // low, middle or high
//margin: 0 for horizontal, 10 for vertical axes,
//rotation: 0,
//side: 'outside',
style: {
color: '#707070'
}
//x: 0,
//y: 0
},
type: 'linear' // linear, logarithmic or datetime
},
/**
* This options set extends the defaultOptions for Y axes
*/
defaultYAxisOptions: {
endOnTick: true,
gridLineWidth: 1,
tickPixelInterval: 72,
showLastLabel: true,
labels: {
x: -8,
y: 3
},
lineWidth: 0,
maxPadding: 0.05,
minPadding: 0.05,
startOnTick: true,
tickWidth: 0,
title: {
rotation: 270,
text: 'Values'
},
stackLabels: {
enabled: false,
//align: dynamic,
//y: dynamic,
//x: dynamic,
//verticalAlign: dynamic,
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
return Highcharts.numberFormat(this.total, -1);
},
style: merge(defaultPlotOptions.line.dataLabels.style, { color: '#000000' })
}
},
/**
* These options extend the defaultOptions for left axes
*/
defaultLeftAxisOptions: {
labels: {
x: -15,
y: null
},
title: {
rotation: 270
}
},
/**
* These options extend the defaultOptions for right axes
*/
defaultRightAxisOptions: {
labels: {
x: 15,
y: null
},
title: {
rotation: 90
}
},
/**
* These options extend the defaultOptions for bottom axes
*/
defaultBottomAxisOptions: {
labels: {
autoRotation: [-45],
x: 0,
y: null // based on font size
// overflow: undefined,
// staggerLines: null
},
title: {
rotation: 0
}
},
/**
* These options extend the defaultOptions for top axes
*/
defaultTopAxisOptions: {
labels: {
autoRotation: [-45],
x: 0,
y: -15
// overflow: undefined
// staggerLines: null
},
title: {
rotation: 0
}
},
/**
* Initialize the axis
*/
init: function (chart, userOptions) {
var isXAxis = userOptions.isX,
axis = this;
// Flag, is the axis horizontal
axis.horiz = chart.inverted ? !isXAxis : isXAxis;
// Flag, isXAxis
axis.isXAxis = isXAxis;
axis.coll = isXAxis ? 'xAxis' : 'yAxis';
axis.opposite = userOptions.opposite; // needed in setOptions
axis.side = userOptions.side || (axis.horiz ?
(axis.opposite ? 0 : 2) : // top : bottom
(axis.opposite ? 1 : 3)); // right : left
axis.setOptions(userOptions);
var options = this.options,
type = options.type,
isDatetimeAxis = type === 'datetime';
axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format
// Flag, stagger lines or not
axis.userOptions = userOptions;
//axis.axisTitleMargin = UNDEFINED,// = options.title.margin,
axis.minPixelPadding = 0;
//axis.ignoreMinPadding = UNDEFINED; // can be set to true by a column or bar series
//axis.ignoreMaxPadding = UNDEFINED;
axis.chart = chart;
axis.reversed = options.reversed;
axis.zoomEnabled = options.zoomEnabled !== false;
// Initial categories
axis.categories = options.categories || type === 'category';
axis.names = axis.names || []; // Preserve on update (#3830)
// Elements
//axis.axisGroup = UNDEFINED;
//axis.gridGroup = UNDEFINED;
//axis.axisTitle = UNDEFINED;
//axis.axisLine = UNDEFINED;
// Shorthand types
axis.isLog = type === 'logarithmic';
axis.isDatetimeAxis = isDatetimeAxis;
// Flag, if axis is linked to another axis
axis.isLinked = defined(options.linkedTo);
// Linked axis.
//axis.linkedParent = UNDEFINED;
// Tick positions
//axis.tickPositions = UNDEFINED; // array containing predefined positions
// Tick intervals
//axis.tickInterval = UNDEFINED;
//axis.minorTickInterval = UNDEFINED;
// Major ticks
axis.ticks = {};
axis.labelEdge = [];
// Minor ticks
axis.minorTicks = {};
// List of plotLines/Bands
axis.plotLinesAndBands = [];
// Alternate bands
axis.alternateBands = {};
// Axis metrics
//axis.left = UNDEFINED;
//axis.top = UNDEFINED;
//axis.width = UNDEFINED;
//axis.height = UNDEFINED;
//axis.bottom = UNDEFINED;
//axis.right = UNDEFINED;
//axis.transA = UNDEFINED;
//axis.transB = UNDEFINED;
//axis.oldTransA = UNDEFINED;
axis.len = 0;
//axis.oldMin = UNDEFINED;
//axis.oldMax = UNDEFINED;
//axis.oldUserMin = UNDEFINED;
//axis.oldUserMax = UNDEFINED;
//axis.oldAxisLength = UNDEFINED;
axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;
axis.range = options.range;
axis.offset = options.offset || 0;
// Dictionary for stacks
axis.stacks = {};
axis.oldStacks = {};
// Min and max in the data
//axis.dataMin = UNDEFINED,
//axis.dataMax = UNDEFINED,
// The axis range
axis.max = null;
axis.min = null;
// User set min and max
//axis.userMin = UNDEFINED,
//axis.userMax = UNDEFINED,
// Crosshair options
axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false);
// Run Axis
var eventType,
events = axis.options.events;
// Register
if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update()
if (isXAxis && !this.isColorAxis) { // #2713
chart.axes.splice(chart.xAxis.length, 0, axis);
} else {
chart.axes.push(axis);
}
chart[axis.coll].push(axis);
}
axis.series = axis.series || []; // populated by Series
// inverted charts have reversed xAxes as default
if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) {
axis.reversed = true;
}
axis.removePlotBand = axis.removePlotBandOrLine;
axis.removePlotLine = axis.removePlotBandOrLine;
// register event listeners
for (eventType in events) {
addEvent(axis, eventType, events[eventType]);
}
// extend logarithmic axis
if (axis.isLog) {
axis.val2lin = log2lin;
axis.lin2val = lin2log;
}
},
/**
* Merge and set options
*/
setOptions: function (userOptions) {
this.options = merge(
this.defaultOptions,
this.isXAxis ? {} : this.defaultYAxisOptions,
[this.defaultTopAxisOptions, this.defaultRightAxisOptions,
this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side],
merge(
defaultOptions[this.coll], // if set in setOptions (#1053)
userOptions
)
);
},
/**
* The default label formatter. The context is a special config object for the label.
*/
defaultLabelFormatter: function () {
var axis = this.axis,
value = this.value,
categories = axis.categories,
dateTimeLabelFormat = this.dateTimeLabelFormat,
numericSymbols = defaultOptions.lang.numericSymbols,
i = numericSymbols && numericSymbols.length,
multi,
ret,
formatOption = axis.options.labels.format,
// make sure the same symbol is added for all labels on a linear axis
numericSymbolDetector = axis.isLog ? value : axis.tickInterval;
if (formatOption) {
ret = format(formatOption, this);
} else if (categories) {
ret = value;
} else if (dateTimeLabelFormat) { // datetime axis
ret = dateFormat(dateTimeLabelFormat, value);
} else if (i && numericSymbolDetector >= 1000) {
// Decide whether we should add a numeric symbol like k (thousands) or M (millions).
// If we are to enable this in tooltip or other places as well, we can move this
// logic to the numberFormatter and enable it by a parameter.
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
ret = Highcharts.numberFormat(value, 0);
} else { // small numbers
ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
return ret;
},
/**
* Get the minimum and maximum for the series of each axis
*/
getSeriesExtremes: function () {
var axis = this,
chart = axis.chart;
axis.hasVisibleSeries = false;
// Reset properties in case we're redrawing (#3353)
axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;
if (axis.buildStacks) {
axis.buildStacks();
}
// loop through this axis' series
each(axis.series, function (series) {
if (series.visible || !chart.options.chart.ignoreHiddenSeries) {
var seriesOptions = series.options,
xData,
threshold = seriesOptions.threshold,
seriesDataMin,
seriesDataMax;
axis.hasVisibleSeries = true;
// Validate threshold in logarithmic axes
if (axis.isLog && threshold <= 0) {
threshold = null;
}
// Get dataMin and dataMax for X axes
if (axis.isXAxis) {
xData = series.xData;
if (xData.length) {
axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), arrayMin(xData));
axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData));
}
// Get dataMin and dataMax for Y axes, as well as handle stacking and processed data
} else {
// Get this particular series extremes
series.getExtremes();
seriesDataMax = series.dataMax;
seriesDataMin = series.dataMin;
// Get the dataMin and dataMax so far. If percentage is used, the min and max are
// always 0 and 100. If seriesDataMin and seriesDataMax is null, then series
// doesn't have active y data, we continue with nulls
if (defined(seriesDataMin) && defined(seriesDataMax)) {
axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin);
axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax);
}
// Adjust to threshold
if (defined(threshold)) {
if (axis.dataMin >= threshold) {
axis.dataMin = threshold;
axis.ignoreMinPadding = true;
} else if (axis.dataMax < threshold) {
axis.dataMax = threshold;
axis.ignoreMaxPadding = true;
}
}
}
}
});
},
/**
* Translate from axis value to pixel position on the chart, or back
*
*/
translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {
var axis = this,
sign = 1,
cvsOffset = 0,
localA = old ? axis.oldTransA : axis.transA,
localMin = old ? axis.oldMin : axis.min,
returnValue,
minPixelPadding = axis.minPixelPadding,
doPostTranslate = (axis.doPostTranslate || (axis.isLog && handleLog)) && axis.lin2val;
if (!localA) {
localA = axis.transA;
}
// In vertical axes, the canvas coordinates start from 0 at the top like in
// SVG.
if (cvsCoord) {
sign *= -1; // canvas coordinates inverts the value
cvsOffset = axis.len;
}
// Handle reversed axis
if (axis.reversed) {
sign *= -1;
cvsOffset -= sign * (axis.sector || axis.len);
}
// From pixels to value
if (backwards) { // reverse translation
val = val * sign + cvsOffset;
val -= minPixelPadding;
returnValue = val / localA + localMin; // from chart pixel to value
if (doPostTranslate) { // log and ordinal axes
returnValue = axis.lin2val(returnValue);
}
// From value to pixels
} else {
if (doPostTranslate) { // log and ordinal axes
val = axis.val2lin(val);
}
if (pointPlacement === 'between') {
pointPlacement = 0.5;
}
returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) +
(isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0);
}
return returnValue;
},
/**
* Utility method to translate an axis value to pixel position.
* @param {Number} value A value in terms of axis units
* @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart
* or just the axis/pane itself.
*/
toPixels: function (value, paneCoordinates) {
return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos);
},
/*
* Utility method to translate a pixel position in to an axis value
* @param {Number} pixel The pixel value coordinate
* @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the
* axis/pane itself.
*/
toValue: function (pixel, paneCoordinates) {
return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true);
},
/**
* Create the path for a plot line that goes from the given value on
* this axis, across the plot to the opposite side
* @param {Number} value
* @param {Number} lineWidth Used for calculation crisp line
* @param {Number] old Use old coordinates (for resizing and rescaling)
*/
getPlotLinePath: function (value, lineWidth, old, force, translatedValue) {
var axis = this,
chart = axis.chart,
axisLeft = axis.left,
axisTop = axis.top,
x1,
y1,
x2,
y2,
cHeight = (old && chart.oldChartHeight) || chart.chartHeight,
cWidth = (old && chart.oldChartWidth) || chart.chartWidth,
skip,
transB = axis.transB,
/**
* Check if x is between a and b. If not, either move to a/b or skip,
* depending on the force parameter.
*/
between = function (x, a, b) {
if (x < a || x > b) {
if (force) {
x = mathMin(mathMax(a, x), b);
} else {
skip = true;
}
}
return x;
};
translatedValue = pick(translatedValue, axis.translate(value, null, null, old));
x1 = x2 = mathRound(translatedValue + transB);
y1 = y2 = mathRound(cHeight - translatedValue - transB);
if (isNaN(translatedValue)) { // no min or max
skip = true;
} else if (axis.horiz) {
y1 = axisTop;
y2 = cHeight - axis.bottom;
x1 = x2 = between(x1, axisLeft, axisLeft + axis.width);
} else {
x1 = axisLeft;
x2 = cWidth - axis.right;
y1 = y2 = between(y1, axisTop, axisTop + axis.height);
}
return skip && !force ?
null :
chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1);
},
/**
* Set the tick positions of a linear axis to round values like whole tens or every five.
*/
getLinearTickPositions: function (tickInterval, min, max) {
var pos,
lastPos,
roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval),
roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval),
tickPositions = [];
// For single points, add a tick regardless of the relative position (#2662)
if (min === max && isNumber(min)) {
return [min];
}
// Populate the intermediate values
pos = roundedMin;
while (pos <= roundedMax) {
// Place the tick on the rounded value
tickPositions.push(pos);
// Always add the raw tickInterval, not the corrected one.
pos = correctFloat(pos + tickInterval);
// If the interval is not big enough in the current min - max range to actually increase
// the loop variable, we need to break out to prevent endless loop. Issue #619
if (pos === lastPos) {
break;
}
// Record the last value
lastPos = pos;
}
return tickPositions;
},
/**
* Return the minor tick positions. For logarithmic axes, reuse the same logic
* as for major ticks.
*/
getMinorTickPositions: function () {
var axis = this,
options = axis.options,
tickPositions = axis.tickPositions,
minorTickInterval = axis.minorTickInterval,
minorTickPositions = [],
pos,
i,
min = axis.min,
max = axis.max,
range = max - min,
len;
// If minor ticks get too dense, they are hard to read, and may cause long running script. So we don't draw them.
if (range && range / minorTickInterval < axis.len / 3) { // #3875
if (axis.isLog) {
len = tickPositions.length;
for (i = 1; i < len; i++) {
minorTickPositions = minorTickPositions.concat(
axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true)
);
}
} else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314
minorTickPositions = minorTickPositions.concat(
axis.getTimeTicks(
axis.normalizeTimeTickInterval(minorTickInterval),
min,
max,
options.startOfWeek
)
);
} else {
for (pos = min + (tickPositions[0] - min) % minorTickInterval; pos <= max; pos += minorTickInterval) {
minorTickPositions.push(pos);
}
}
}
axis.trimTicks(minorTickPositions); // #3652 #3743
return minorTickPositions;
},
/**
* Adjust the min and max for the minimum range. Keep in mind that the series data is
* not yet processed, so we don't have information on data cropping and grouping, or
* updated axis.pointRange or series.pointRange. The data can't be processed until
* we have finally established min and max.
*/
adjustForMinRange: function () {
var axis = this,
options = axis.options,
min = axis.min,
max = axis.max,
zoomOffset,
spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange,
closestDataRange,
i,
distance,
xData,
loopLength,
minArgs,
maxArgs;
// Set the automatic minimum range based on the closest point distance
if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) {
if (defined(options.min) || defined(options.max)) {
axis.minRange = null; // don't do this again
} else {
// Find the closest distance between raw data points, as opposed to
// closestPointRange that applies to processed points (cropped and grouped)
each(axis.series, function (series) {
xData = series.xData;
loopLength = series.xIncrement ? 1 : xData.length - 1;
for (i = loopLength; i > 0; i--) {
distance = xData[i] - xData[i - 1];
if (closestDataRange === UNDEFINED || distance < closestDataRange) {
closestDataRange = distance;
}
}
});
axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin);
}
}
// if minRange is exceeded, adjust
if (max - min < axis.minRange) {
var minRange = axis.minRange;
zoomOffset = (minRange - max + min) / 2;
// if min and max options have been set, don't go beyond it
minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)];
if (spaceAvailable) { // if space is available, stay within the data range
minArgs[2] = axis.dataMin;
}
min = arrayMax(minArgs);
maxArgs = [min + minRange, pick(options.max, min + minRange)];
if (spaceAvailable) { // if space is availabe, stay within the data range
maxArgs[2] = axis.dataMax;
}
max = arrayMin(maxArgs);
// now if the max is adjusted, adjust the min back
if (max - min < minRange) {
minArgs[0] = max - minRange;
minArgs[1] = pick(options.min, max - minRange);
min = arrayMax(minArgs);
}
}
// Record modified extremes
axis.min = min;
axis.max = max;
},
/**
* Update translation information
*/
setAxisTranslation: function (saveOld) {
var axis = this,
range = axis.max - axis.min,
pointRange = axis.axisPointRange || 0,
closestPointRange,
minPointOffset = 0,
pointRangePadding = 0,
linkedParent = axis.linkedParent,
ordinalCorrection,
hasCategories = !!axis.categories,
transA = axis.transA;
// Adjust translation for padding. Y axis with categories need to go through the same (#1784).
if (axis.isXAxis || hasCategories || pointRange) {
if (linkedParent) {
minPointOffset = linkedParent.minPointOffset;
pointRangePadding = linkedParent.pointRangePadding;
} else {
each(axis.series, function (series) {
var seriesPointRange = hasCategories ? 1 : (axis.isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806
pointPlacement = series.options.pointPlacement,
seriesClosestPointRange = series.closestPointRange;
if (seriesPointRange > range) { // #1446
seriesPointRange = 0;
}
pointRange = mathMax(pointRange, seriesPointRange);
if (!axis.single) {
// minPointOffset is the value padding to the left of the axis in order to make
// room for points with a pointRange, typically columns. When the pointPlacement option
// is 'between' or 'on', this padding does not apply.
minPointOffset = mathMax(
minPointOffset,
isString(pointPlacement) ? 0 : seriesPointRange / 2
);
// Determine the total padding needed to the length of the axis to make room for the
// pointRange. If the series' pointPlacement is 'on', no padding is added.
pointRangePadding = mathMax(
pointRangePadding,
pointPlacement === 'on' ? 0 : seriesPointRange
);
}
// Set the closestPointRange
if (!series.noSharedTooltip && defined(seriesClosestPointRange)) {
closestPointRange = defined(closestPointRange) ?
mathMin(closestPointRange, seriesClosestPointRange) :
seriesClosestPointRange;
}
});
}
// Record minPointOffset and pointRangePadding
ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853
axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection;
axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection;
// pointRange means the width reserved for each point, like in a column chart
axis.pointRange = mathMin(pointRange, range);
// closestPointRange means the closest distance between points. In columns
// it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange
// is some other value
axis.closestPointRange = closestPointRange;
}
// Secondary values
if (saveOld) {
axis.oldTransA = transA;
}
axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1);
axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend
axis.minPixelPadding = transA * minPointOffset;
},
/**
* Set the tick positions to round values and optionally extend the extremes
* to the nearest tick
*/
setTickInterval: function (secondPass) {
var axis = this,
chart = axis.chart,
options = axis.options,
isLog = axis.isLog,
isDatetimeAxis = axis.isDatetimeAxis,
isXAxis = axis.isXAxis,
isLinked = axis.isLinked,
maxPadding = options.maxPadding,
minPadding = options.minPadding,
length,
linkedParentExtremes,
tickIntervalOption = options.tickInterval,
minTickInterval,
tickPixelIntervalOption = options.tickPixelInterval,
categories = axis.categories;
if (!isDatetimeAxis && !categories && !isLinked) {
this.getTickAmount();
}
// linked axis gets the extremes from the parent axis
if (isLinked) {
axis.linkedParent = chart[axis.coll][options.linkedTo];
linkedParentExtremes = axis.linkedParent.getExtremes();
axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);
axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);
if (options.type !== axis.linkedParent.options.type) {
error(11, 1); // Can't link axes of different type
}
} else { // initial min and max from the extreme data values
axis.min = pick(axis.userMin, options.min, axis.dataMin);
axis.max = pick(axis.userMax, options.max, axis.dataMax);
}
if (isLog) {
if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978
error(10, 1); // Can't plot negative values on log axis
}
axis.min = correctFloat(log2lin(axis.min)); // correctFloat cures #934
axis.max = correctFloat(log2lin(axis.max));
}
// handle zoomed range
if (axis.range && defined(axis.max)) {
axis.userMin = axis.min = mathMax(axis.min, axis.max - axis.range); // #618
axis.userMax = axis.max;
axis.range = null; // don't use it when running setExtremes
}
// Hook for adjusting this.min and this.max. Used by bubble series.
if (axis.beforePadding) {
axis.beforePadding();
}
// adjust min and max for the minimum range
axis.adjustForMinRange();
// Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding
// into account, we do this after computing tick interval (#1337).
if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) {
length = axis.max - axis.min;
if (length) {
if (!defined(options.min) && !defined(axis.userMin) && minPadding && (axis.dataMin < 0 || !axis.ignoreMinPadding)) {
axis.min -= length * minPadding;
}
if (!defined(options.max) && !defined(axis.userMax) && maxPadding && (axis.dataMax > 0 || !axis.ignoreMaxPadding)) {
axis.max += length * maxPadding;
}
}
}
// Stay within floor and ceiling
if (isNumber(options.floor)) {
axis.min = mathMax(axis.min, options.floor);
}
if (isNumber(options.ceiling)) {
axis.max = mathMin(axis.max, options.ceiling);
}
// get tickInterval
if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) {
axis.tickInterval = 1;
} else if (isLinked && !tickIntervalOption &&
tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) {
axis.tickInterval = axis.linkedParent.tickInterval;
} else {
axis.tickInterval = pick(
tickIntervalOption,
this.tickAmount ? ((axis.max - axis.min) / mathMax(this.tickAmount - 1, 1)) : undefined,
categories ? // for categoried axis, 1 is default, for linear axis use tickPix
1 :
// don't let it be more than the data range
(axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption)
);
}
// Now we're finished detecting min and max, crop and group series data. This
// is in turn needed in order to find tick positions in ordinal axes.
if (isXAxis && !secondPass) {
each(axis.series, function (series) {
series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax);
});
}
// set the translation factor used in translate function
axis.setAxisTranslation(true);
// hook for ordinal axes and radial axes
if (axis.beforeSetTickPositions) {
axis.beforeSetTickPositions();
}
// hook for extensions, used in Highstock ordinal axes
if (axis.postProcessTickInterval) {
axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval);
}
// In column-like charts, don't cramp in more ticks than there are points (#1943)
if (axis.pointRange) {
axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval);
}
// Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined.
minTickInterval = pick(options.minTickInterval, axis.isDatetimeAxis && axis.closestPointRange);
if (!tickIntervalOption && axis.tickInterval < minTickInterval) {
axis.tickInterval = minTickInterval;
}
// for linear axes, get magnitude and normalize the interval
if (!isDatetimeAxis && !isLog) { // linear
if (!tickIntervalOption) {
axis.tickInterval = normalizeTickInterval(
axis.tickInterval,
null,
getMagnitude(axis.tickInterval),
// If the tick interval is between 0.5 and 5 and the axis max is in the order of
// thousands, chances are we are dealing with years. Don't allow decimals. #3363.
pick(options.allowDecimals, !(axis.tickInterval > 0.5 && axis.tickInterval < 5 && axis.max > 1000 && axis.max < 9999)),
!!this.tickAmount
);
}
}
// Prevent ticks from getting so close that we can't draw the labels
if (!this.tickAmount && this.len) { // Color axis with disabled legend has no length
axis.tickInterval = axis.unsquish();
}
this.setTickPositions();
},
/**
* Now we have computed the normalized tickInterval, get the tick positions
*/
setTickPositions: function () {
var options = this.options,
tickPositions,
tickPositionsOption = options.tickPositions,
tickPositioner = options.tickPositioner,
startOnTick = options.startOnTick,
endOnTick = options.endOnTick,
single;
// Set the tickmarkOffset
this.tickmarkOffset = (this.categories && options.tickmarkPlacement === 'between' &&
this.tickInterval === 1) ? 0.5 : 0; // #3202
// get minorTickInterval
this.minorTickInterval = options.minorTickInterval === 'auto' && this.tickInterval ?
this.tickInterval / 5 : options.minorTickInterval;
// Find the tick positions
this.tickPositions = tickPositions = options.tickPositions && options.tickPositions.slice(); // Work on a copy (#1565)
if (!tickPositions) {
if (this.isDatetimeAxis) {
tickPositions = this.getTimeTicks(
this.normalizeTimeTickInterval(this.tickInterval, options.units),
this.min,
this.max,
options.startOfWeek,
this.ordinalPositions,
this.closestPointRange,
true
);
} else if (this.isLog) {
tickPositions = this.getLogTickPositions(this.tickInterval, this.min, this.max);
} else {
tickPositions = this.getLinearTickPositions(this.tickInterval, this.min, this.max);
}
this.tickPositions = tickPositions;
// Run the tick positioner callback, that allows modifying auto tick positions.
if (tickPositioner) {
tickPositioner = tickPositioner.apply(this, [this.min, this.max]);
if (tickPositioner) {
this.tickPositions = tickPositions = tickPositioner;
}
}
}
if (!this.isLinked) {
// reset min/max or remove extremes based on start/end on tick
this.trimTicks(tickPositions, startOnTick, endOnTick);
// When there is only one point, or all points have the same value on this axis, then min
// and max are equal and tickPositions.length is 0 or 1. In this case, add some padding
// in order to center the point, but leave it with one tick. #1337.
if (this.min === this.max && defined(this.min) && !this.tickAmount) {
// Substract half a unit (#2619, #2846, #2515, #3390)
single = true;
this.min -= 0.5;
this.max += 0.5;
}
this.single = single;
if (!tickPositionsOption && !tickPositioner) {
this.adjustTickAmount();
}
}
},
/**
* Handle startOnTick and endOnTick by either adapting to padding min/max or rounded min/max
*/
trimTicks: function (tickPositions, startOnTick, endOnTick) {
var roundedMin = tickPositions[0],
roundedMax = tickPositions[tickPositions.length - 1],
minPointOffset = this.minPointOffset || 0;
if (startOnTick) {
this.min = roundedMin;
} else if (this.min - minPointOffset > roundedMin) {
tickPositions.shift();
}
if (endOnTick) {
this.max = roundedMax;
} else if (this.max + minPointOffset < roundedMax) {
tickPositions.pop();
}
// If no tick are left, set one tick in the middle (#3195)
if (tickPositions.length === 0 && defined(roundedMin)) {
tickPositions.push((roundedMax + roundedMin) / 2);
}
},
/**
* Set the max ticks of either the x and y axis collection
*/
getTickAmount: function () {
var others = {}, // Whether there is another axis to pair with this one
hasOther,
options = this.options,
tickAmount = options.tickAmount,
tickPixelInterval = options.tickPixelInterval;
if (!defined(options.tickInterval) && this.len < tickPixelInterval && !this.isRadial &&
!this.isLog && options.startOnTick && options.endOnTick) {
tickAmount = 2;
}
if (!tickAmount && this.chart.options.chart.alignTicks !== false && options.alignTicks !== false) {
// Check if there are multiple axes in the same pane
each(this.chart[this.coll], function (axis) {
var options = axis.options,
horiz = axis.horiz,
key = [horiz ? options.left : options.top, horiz ? options.width : options.height, options.pane].join(',');
if (others[key]) {
hasOther = true;
} else {
others[key] = 1;
}
});
if (hasOther) {
// Add 1 because 4 tick intervals require 5 ticks (including first and last)
tickAmount = mathCeil(this.len / tickPixelInterval) + 1;
}
}
// For tick amounts of 2 and 3, compute five ticks and remove the intermediate ones. This
// prevents the axis from adding ticks that are too far away from the data extremes.
if (tickAmount < 4) {
this.finalTickAmt = tickAmount;
tickAmount = 5;
}
this.tickAmount = tickAmount;
},
/**
* When using multiple axes, adjust the number of ticks to match the highest
* number of ticks in that group
*/
adjustTickAmount: function () {
var tickInterval = this.tickInterval,
tickPositions = this.tickPositions,
tickAmount = this.tickAmount,
finalTickAmt = this.finalTickAmt,
currentTickAmount = tickPositions && tickPositions.length,
i,
len;
if (currentTickAmount < tickAmount) { // TODO: Check #3411
while (tickPositions.length < tickAmount) {
tickPositions.push(correctFloat(
tickPositions[tickPositions.length - 1] + tickInterval
));
}
this.transA *= (currentTickAmount - 1) / (tickAmount - 1);
this.max = tickPositions[tickPositions.length - 1];
// We have too many ticks, run second pass to try to reduce ticks
} else if (currentTickAmount > tickAmount) {
this.tickInterval *= 2;
this.setTickPositions();
}
// The finalTickAmt property is set in getTickAmount
if (defined(finalTickAmt)) {
i = len = tickPositions.length;
while (i--) {
if (
(finalTickAmt === 3 && i % 2 === 1) || // Remove every other tick
(finalTickAmt <= 2 && i > 0 && i < len - 1) // Remove all but first and last
) {
tickPositions.splice(i, 1);
}
}
this.finalTickAmt = UNDEFINED;
}
},
/**
* Set the scale based on data min and max, user set min and max or options
*
*/
setScale: function () {
var axis = this,
stacks = axis.stacks,
type,
i,
isDirtyData,
isDirtyAxisLength;
axis.oldMin = axis.min;
axis.oldMax = axis.max;
axis.oldAxisLength = axis.len;
// set the new axisLength
axis.setAxisSize();
//axisLength = horiz ? axisWidth : axisHeight;
isDirtyAxisLength = axis.len !== axis.oldAxisLength;
// is there new data?
each(axis.series, function (series) {
if (series.isDirtyData || series.isDirty ||
series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well
isDirtyData = true;
}
});
// do we really need to go through all this?
if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw ||
axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax) {
// reset stacks
if (!axis.isXAxis) {
for (type in stacks) {
for (i in stacks[type]) {
stacks[type][i].total = null;
stacks[type][i].cum = 0;
}
}
}
axis.forceRedraw = false;
// get data extremes if needed
axis.getSeriesExtremes();
// get fixed positions based on tickInterval
axis.setTickInterval();
// record old values to decide whether a rescale is necessary later on (#540)
axis.oldUserMin = axis.userMin;
axis.oldUserMax = axis.userMax;
// Mark as dirty if it is not already set to dirty and extremes have changed. #595.
if (!axis.isDirty) {
axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax;
}
} else if (!axis.isXAxis) {
if (axis.oldStacks) {
stacks = axis.stacks = axis.oldStacks;
}
// reset stacks
for (type in stacks) {
for (i in stacks[type]) {
stacks[type][i].cum = stacks[type][i].total;
}
}
}
},
/**
* Set the extremes and optionally redraw
* @param {Number} newMin
* @param {Number} newMax
* @param {Boolean} redraw
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
* @param {Object} eventArguments
*
*/
setExtremes: function (newMin, newMax, redraw, animation, eventArguments) {
var axis = this,
chart = axis.chart;
redraw = pick(redraw, true); // defaults to true
each(axis.series, function (serie) {
delete serie.kdTree;
});
// Extend the arguments with min and max
eventArguments = extend(eventArguments, {
min: newMin,
max: newMax
});
// Fire the event
fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler
axis.userMin = newMin;
axis.userMax = newMax;
axis.eventArgs = eventArguments;
// Mark for running afterSetExtremes
axis.isDirtyExtremes = true;
// redraw
if (redraw) {
chart.redraw(animation);
}
});
},
/**
* Overridable method for zooming chart. Pulled out in a separate method to allow overriding
* in stock charts.
*/
zoom: function (newMin, newMax) {
var dataMin = this.dataMin,
dataMax = this.dataMax,
options = this.options;
// Prevent pinch zooming out of range. Check for defined is for #1946. #1734.
if (!this.allowZoomOutside) {
if (defined(dataMin) && newMin <= mathMin(dataMin, pick(options.min, dataMin))) {
newMin = UNDEFINED;
}
if (defined(dataMax) && newMax >= mathMax(dataMax, pick(options.max, dataMax))) {
newMax = UNDEFINED;
}
}
// In full view, displaying the reset zoom button is not required
this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED;
// Do it
this.setExtremes(
newMin,
newMax,
false,
UNDEFINED,
{ trigger: 'zoom' }
);
return true;
},
/**
* Update the axis metrics
*/
setAxisSize: function () {
var chart = this.chart,
options = this.options,
offsetLeft = options.offsetLeft || 0,
offsetRight = options.offsetRight || 0,
horiz = this.horiz,
width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight),
height = pick(options.height, chart.plotHeight),
top = pick(options.top, chart.plotTop),
left = pick(options.left, chart.plotLeft + offsetLeft),
percentRegex = /%$/;
// Check for percentage based input values
if (percentRegex.test(height)) {
height = parseFloat(height) / 100 * chart.plotHeight;
}
if (percentRegex.test(top)) {
top = parseFloat(top) / 100 * chart.plotHeight + chart.plotTop;
}
// Expose basic values to use in Series object and navigator
this.left = left;
this.top = top;
this.width = width;
this.height = height;
this.bottom = chart.chartHeight - height - top;
this.right = chart.chartWidth - width - left;
// Direction agnostic properties
this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905
this.pos = horiz ? left : top; // distance from SVG origin
},
/**
* Get the actual axis extremes
*/
getExtremes: function () {
var axis = this,
isLog = axis.isLog;
return {
min: isLog ? correctFloat(lin2log(axis.min)) : axis.min,
max: isLog ? correctFloat(lin2log(axis.max)) : axis.max,
dataMin: axis.dataMin,
dataMax: axis.dataMax,
userMin: axis.userMin,
userMax: axis.userMax
};
},
/**
* Get the zero plane either based on zero or on the min or max value.
* Used in bar and area plots
*/
getThreshold: function (threshold) {
var axis = this,
isLog = axis.isLog;
var realMin = isLog ? lin2log(axis.min) : axis.min,
realMax = isLog ? lin2log(axis.max) : axis.max;
if (realMin > threshold || threshold === null) {
threshold = realMin;
} else if (realMax < threshold) {
threshold = realMax;
}
return axis.translate(threshold, 0, 1, 0, 1);
},
/**
* Compute auto alignment for the axis label based on which side the axis is on
* and the given rotation for the label
*/
autoLabelAlign: function (rotation) {
var ret,
angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360;
if (angle > 15 && angle < 165) {
ret = 'right';
} else if (angle > 195 && angle < 345) {
ret = 'left';
} else {
ret = 'center';
}
return ret;
},
/**
* Prevent the ticks from getting so close we can't draw the labels. On a horizontal
* axis, this is handled by rotating the labels, removing ticks and adding ellipsis.
* On a vertical axis remove ticks and add ellipsis.
*/
unsquish: function () {
var chart = this.chart,
ticks = this.ticks,
labelOptions = this.options.labels,
horiz = this.horiz,
tickInterval = this.tickInterval,
newTickInterval = tickInterval,
slotSize = this.len / (((this.categories ? 1 : 0) + this.max - this.min) / tickInterval),
rotation,
rotationOption = labelOptions.rotation,
labelMetrics = chart.renderer.fontMetrics(labelOptions.style.fontSize, ticks[0] && ticks[0].label),
step,
bestScore = Number.MAX_VALUE,
autoRotation,
// Return the multiple of tickInterval that is needed to avoid collision
getStep = function (spaceNeeded) {
var step = spaceNeeded / (slotSize || 1);
step = step > 1 ? mathCeil(step) : 1;
return step * tickInterval;
};
if (horiz) {
autoRotation = defined(rotationOption) ?
[rotationOption] :
slotSize < 80 && !labelOptions.staggerLines && !labelOptions.step && labelOptions.autoRotation;
if (autoRotation) {
// Loop over the given autoRotation options, and determine which gives the best score. The
// best score is that with the lowest number of steps and a rotation closest to horizontal.
each(autoRotation, function (rot) {
var score;
if (rot && rot >= -90 && rot <= 90) {
step = getStep(mathAbs(labelMetrics.h / mathSin(deg2rad * rot)));
score = step + mathAbs(rot / 360);
if (score < bestScore) {
bestScore = score;
rotation = rot;
newTickInterval = step;
}
}
});
}
} else {
newTickInterval = getStep(labelMetrics.h);
}
this.autoRotation = autoRotation;
this.labelRotation = rotation;
return newTickInterval;
},
renderUnsquish: function () {
var chart = this.chart,
renderer = chart.renderer,
tickPositions = this.tickPositions,
ticks = this.ticks,
labelOptions = this.options.labels,
horiz = this.horiz,
margin = chart.margin,
slotWidth = this.slotWidth = (horiz && !labelOptions.step && !labelOptions.rotation &&
((this.staggerLines || 1) * chart.plotWidth) / tickPositions.length) ||
(!horiz && ((margin[3] && (margin[3] - chart.spacing[3])) || chart.chartWidth * 0.33)), // #1580, #1931,
innerWidth = mathMax(1, mathRound(slotWidth - 2 * (labelOptions.padding || 5))),
attr = {},
labelMetrics = renderer.fontMetrics(labelOptions.style.fontSize, ticks[0] && ticks[0].label),
css,
labelLength = 0,
label,
i,
pos;
// Set rotation option unless it is "auto", like in gauges
if (!isString(labelOptions.rotation)) {
attr.rotation = labelOptions.rotation;
}
// Handle auto rotation on horizontal axis
if (this.autoRotation) {
// Get the longest label length
each(tickPositions, function (tick) {
tick = ticks[tick];
if (tick && tick.labelLength > labelLength) {
labelLength = tick.labelLength;
}
});
// Apply rotation only if the label is too wide for the slot, and
// the label is wider than its height.
if (labelLength > innerWidth && labelLength > labelMetrics.h) {
attr.rotation = this.labelRotation;
} else {
this.labelRotation = 0;
}
// Handle word-wrap or ellipsis on vertical axis
} else if (slotWidth) {
// For word-wrap or ellipsis
css = { width: innerWidth + PX, textOverflow: 'clip' };
// On vertical axis, only allow word wrap if there is room for more lines.
i = tickPositions.length;
while (!horiz && i--) {
pos = tickPositions[i];
label = ticks[pos].label;
if (label) {
if (this.len / tickPositions.length - 4 < label.getBBox().height) {
label.specCss = { textOverflow: 'ellipsis' };
}
}
}
}
// Add ellipsis if the label length is significantly longer than ideal
if (attr.rotation) {
css = {
width: (labelLength > chart.chartHeight * 0.5 ? chart.chartHeight * 0.33 : chart.chartHeight) + PX,
textOverflow: 'ellipsis'
};
}
// Set the explicit or automatic label alignment
this.labelAlign = attr.align = labelOptions.align || this.autoLabelAlign(this.labelRotation);
// Apply general and specific CSS
each(tickPositions, function (pos) {
var tick = ticks[pos],
label = tick && tick.label;
if (label) {
if (css) {
label.css(merge(css, label.specCss));
}
delete label.specCss;
label.attr(attr);
tick.rotation = attr.rotation;
}
});
// TODO: Why not part of getLabelPosition?
this.tickRotCorr = renderer.rotCorr(labelMetrics.b, this.labelRotation || 0, this.side === 2);
},
/**
* Render the tick labels to a preliminary position to get their sizes
*/
getOffset: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
tickPositions = axis.tickPositions,
ticks = axis.ticks,
horiz = axis.horiz,
side = axis.side,
invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side,
hasData,
showAxis,
titleOffset = 0,
titleOffsetOption,
titleMargin = 0,
axisTitleOptions = options.title,
labelOptions = options.labels,
labelOffset = 0, // reset
labelOffsetPadded,
axisOffset = chart.axisOffset,
clipOffset = chart.clipOffset,
directionFactor = [-1, 1, 1, -1][side],
n,
lineHeightCorrection;
// For reuse in Axis.render
axis.hasData = hasData = (axis.hasVisibleSeries || (defined(axis.min) && defined(axis.max) && !!tickPositions));
axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);
// Set/reset staggerLines
axis.staggerLines = axis.horiz && labelOptions.staggerLines;
// Create the axisGroup and gridGroup elements on first iteration
if (!axis.axisGroup) {
axis.gridGroup = renderer.g('grid')
.attr({ zIndex: options.gridZIndex || 1 })
.add();
axis.axisGroup = renderer.g('axis')
.attr({ zIndex: options.zIndex || 2 })
.add();
axis.labelGroup = renderer.g('axis-labels')
.attr({ zIndex: labelOptions.zIndex || 7 })
.addClass(PREFIX + axis.coll.toLowerCase() + '-labels')
.add();
}
if (hasData || axis.isLinked) {
// Generate ticks
each(tickPositions, function (pos) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
} else {
ticks[pos].addLabel(); // update labels depending on tick interval
}
});
axis.renderUnsquish();
each(tickPositions, function (pos) {
// left side must be align: right and right side must have align: left for labels
if (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign) {
// get the highest offset
labelOffset = mathMax(
ticks[pos].getLabelSize(),
labelOffset
);
}
});
if (axis.staggerLines) {
labelOffset *= axis.staggerLines;
axis.labelOffset = labelOffset;
}
} else { // doesn't have data
for (n in ticks) {
ticks[n].destroy();
delete ticks[n];
}
}
if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) {
if (!axis.axisTitle) {
axis.axisTitle = renderer.text(
axisTitleOptions.text,
0,
0,
axisTitleOptions.useHTML
)
.attr({
zIndex: 7,
rotation: axisTitleOptions.rotation || 0,
align:
axisTitleOptions.textAlign ||
{ low: 'left', middle: 'center', high: 'right' }[axisTitleOptions.align]
})
.addClass(PREFIX + this.coll.toLowerCase() + '-title')
.css(axisTitleOptions.style)
.add(axis.axisGroup);
axis.axisTitle.isNew = true;
}
if (showAxis) {
titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];
titleOffsetOption = axisTitleOptions.offset;
titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10);
}
// hide or show the title depending on whether showEmpty is set
axis.axisTitle[showAxis ? 'show' : 'hide']();
}
// handle automatic or user set offset
axis.offset = directionFactor * pick(options.offset, axisOffset[side]);
axis.tickRotCorr = axis.tickRotCorr || { x: 0, y: 0 }; // polar
lineHeightCorrection = side === 2 ? axis.tickRotCorr.y : 0;
labelOffsetPadded = labelOffset + titleMargin +
(labelOffset && (directionFactor * (horiz ? pick(labelOptions.y, axis.tickRotCorr.y + 8) : labelOptions.x) - lineHeightCorrection));
axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);
axisOffset[side] = mathMax(
axisOffset[side],
axis.axisTitleMargin + titleOffset + directionFactor * axis.offset,
labelOffsetPadded // #3027
);
clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], mathFloor(options.lineWidth / 2) * 2);
},
/**
* Get the path for the axis line
*/
getLinePath: function (lineWidth) {
var chart = this.chart,
opposite = this.opposite,
offset = this.offset,
horiz = this.horiz,
lineLeft = this.left + (opposite ? this.width : 0) + offset,
lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset;
if (opposite) {
lineWidth *= -1; // crispify the other way - #1480, #1687
}
return chart.renderer.crispLine([
M,
horiz ?
this.left :
lineLeft,
horiz ?
lineTop :
this.top,
L,
horiz ?
chart.chartWidth - this.right :
lineLeft,
horiz ?
lineTop :
chart.chartHeight - this.bottom
], lineWidth);
},
/**
* Position the title
*/
getTitlePosition: function () {
// compute anchor points for each of the title align options
var horiz = this.horiz,
axisLeft = this.left,
axisTop = this.top,
axisLength = this.len,
axisTitleOptions = this.options.title,
margin = horiz ? axisLeft : axisTop,
opposite = this.opposite,
offset = this.offset,
fontSize = pInt(axisTitleOptions.style.fontSize || 12),
// the position in the length direction of the axis
alongAxis = {
low: margin + (horiz ? 0 : axisLength),
middle: margin + axisLength / 2,
high: margin + (horiz ? axisLength : 0)
}[axisTitleOptions.align],
// the position in the perpendicular direction of the axis
offAxis = (horiz ? axisTop + this.height : axisLeft) +
(horiz ? 1 : -1) * // horizontal axis reverses the margin
(opposite ? -1 : 1) * // so does opposite axes
this.axisTitleMargin +
(this.side === 2 ? fontSize : 0);
return {
x: horiz ?
alongAxis :
offAxis + (opposite ? this.width : 0) + offset +
(axisTitleOptions.x || 0), // x
y: horiz ?
offAxis - (opposite ? this.height : 0) + offset :
alongAxis + (axisTitleOptions.y || 0) // y
};
},
/**
* Render the axis
*/
render: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
isLog = axis.isLog,
isLinked = axis.isLinked,
tickPositions = axis.tickPositions,
axisTitle = axis.axisTitle,
ticks = axis.ticks,
minorTicks = axis.minorTicks,
alternateBands = axis.alternateBands,
stackLabelOptions = options.stackLabels,
alternateGridColor = options.alternateGridColor,
tickmarkOffset = axis.tickmarkOffset,
lineWidth = options.lineWidth,
linePath,
hasRendered = chart.hasRendered,
slideInTicks = hasRendered && defined(axis.oldMin) && !isNaN(axis.oldMin),
hasData = axis.hasData,
showAxis = axis.showAxis,
from,
to;
// Reset
axis.labelEdge.length = 0;
//axis.justifyToPlot = overflow === 'justify';
axis.overlap = false;
// Mark all elements inActive before we go over and mark the active ones
each([ticks, minorTicks, alternateBands], function (coll) {
var pos;
for (pos in coll) {
coll[pos].isActive = false;
}
});
// If the series has data draw the ticks. Else only the line and title
if (hasData || isLinked) {
// minor ticks
if (axis.minorTickInterval && !axis.categories) {
each(axis.getMinorTickPositions(), function (pos) {
if (!minorTicks[pos]) {
minorTicks[pos] = new Tick(axis, pos, 'minor');
}
// render new ticks in old position
if (slideInTicks && minorTicks[pos].isNew) {
minorTicks[pos].render(null, true);
}
minorTicks[pos].render(null, false, 1);
});
}
// Major ticks. Pull out the first item and render it last so that
// we can get the position of the neighbour label. #808.
if (tickPositions.length) { // #1300
each(tickPositions, function (pos, i) {
// linked axes need an extra check to find out if
if (!isLinked || (pos >= axis.min && pos <= axis.max)) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
}
// render new ticks in old position
if (slideInTicks && ticks[pos].isNew) {
ticks[pos].render(i, true, 0.1);
}
ticks[pos].render(i);
}
});
// In a categorized axis, the tick marks are displayed between labels. So
// we need to add a tick mark and grid line at the left edge of the X axis.
if (tickmarkOffset && (axis.min === 0 || axis.single)) {
if (!ticks[-1]) {
ticks[-1] = new Tick(axis, -1, null, true);
}
ticks[-1].render(-1);
}
}
// alternate grid color
if (alternateGridColor) {
each(tickPositions, function (pos, i) {
if (i % 2 === 0 && pos < axis.max) {
if (!alternateBands[pos]) {
alternateBands[pos] = new Highcharts.PlotLineOrBand(axis);
}
from = pos + tickmarkOffset; // #949
to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max;
alternateBands[pos].options = {
from: isLog ? lin2log(from) : from,
to: isLog ? lin2log(to) : to,
color: alternateGridColor
};
alternateBands[pos].render();
alternateBands[pos].isActive = true;
}
});
}
// custom plot lines and bands
if (!axis._addedPlotLB) { // only first time
each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) {
axis.addPlotBandOrLine(plotLineOptions);
});
axis._addedPlotLB = true;
}
} // end if hasData
// Remove inactive ticks
each([ticks, minorTicks, alternateBands], function (coll) {
var pos,
i,
forDestruction = [],
delay = globalAnimation ? globalAnimation.duration || 500 : 0,
destroyInactiveItems = function () {
i = forDestruction.length;
while (i--) {
// When resizing rapidly, the same items may be destroyed in different timeouts,
// or the may be reactivated
if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) {
coll[forDestruction[i]].destroy();
delete coll[forDestruction[i]];
}
}
};
for (pos in coll) {
if (!coll[pos].isActive) {
// Render to zero opacity
coll[pos].render(pos, false, 0);
coll[pos].isActive = false;
forDestruction.push(pos);
}
}
// When the objects are finished fading out, destroy them
if (coll === alternateBands || !chart.hasRendered || !delay) {
destroyInactiveItems();
} else if (delay) {
setTimeout(destroyInactiveItems, delay);
}
});
// Static items. As the axis group is cleared on subsequent calls
// to render, these items are added outside the group.
// axis line
if (lineWidth) {
linePath = axis.getLinePath(lineWidth);
if (!axis.axisLine) {
axis.axisLine = renderer.path(linePath)
.attr({
stroke: options.lineColor,
'stroke-width': lineWidth,
zIndex: 7
})
.add(axis.axisGroup);
} else {
axis.axisLine.animate({ d: linePath });
}
// show or hide the line depending on options.showEmpty
axis.axisLine[showAxis ? 'show' : 'hide']();
}
if (axisTitle && showAxis) {
axisTitle[axisTitle.isNew ? 'attr' : 'animate'](
axis.getTitlePosition()
);
axisTitle.isNew = false;
}
// Stacked totals:
if (stackLabelOptions && stackLabelOptions.enabled) {
axis.renderStackTotals();
}
// End stacked totals
axis.isDirty = false;
},
/**
* Redraw the axis to reflect changes in the data or axis extremes
*/
redraw: function () {
// render the axis
this.render();
// move plot lines and bands
each(this.plotLinesAndBands, function (plotLine) {
plotLine.render();
});
// mark associated series as dirty and ready for redraw
each(this.series, function (series) {
series.isDirty = true;
});
},
/**
* Destroys an Axis instance.
*/
destroy: function (keepEvents) {
var axis = this,
stacks = axis.stacks,
stackKey,
plotLinesAndBands = axis.plotLinesAndBands,
i;
// Remove the events
if (!keepEvents) {
removeEvent(axis);
}
// Destroy each stack total
for (stackKey in stacks) {
destroyObjectProperties(stacks[stackKey]);
stacks[stackKey] = null;
}
// Destroy collections
each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) {
destroyObjectProperties(coll);
});
i = plotLinesAndBands.length;
while (i--) { // #1975
plotLinesAndBands[i].destroy();
}
// Destroy local variables
each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'cross', 'gridGroup', 'labelGroup'], function (prop) {
if (axis[prop]) {
axis[prop] = axis[prop].destroy();
}
});
// Destroy crosshair
if (this.cross) {
this.cross.destroy();
}
},
/**
* Draw the crosshair
*/
drawCrosshair: function (e, point) { // docs: Missing docs for Axis.crosshair. Also for properties.
var path,
options = this.crosshair,
animation = options.animation,
pos,
attribs,
categorized;
if (
// Disabled in options
!this.crosshair ||
// Snap
((defined(point) || !pick(this.crosshair.snap, true)) === false)
) {
this.hideCrosshair();
} else {
// Get the path
if (!pick(options.snap, true)) {
pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos);
} else if (defined(point)) {
/*jslint eqeq: true*/
pos = this.isXAxis ? point.plotX : this.len - point.plotY; // #3834
/*jslint eqeq: false*/
}
if (this.isRadial) {
path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y)) || null; // #3189
} else {
path = this.getPlotLinePath(null, null, null, null, pos) || null; // #3189
}
if (path === null) {
this.hideCrosshair();
return;
}
// Draw the cross
if (this.cross) {
this.cross
.attr({ visibility: VISIBLE })[animation ? 'animate' : 'attr']({ d: path }, animation);
} else {
categorized = this.categories && !this.isRadial;
attribs = {
'stroke-width': options.width || (categorized ? this.transA : 1),
stroke: options.color || (categorized ? 'rgba(155,200,255,0.2)' : '#C0C0C0'),
zIndex: options.zIndex || 2
};
if (options.dashStyle) {
attribs.dashstyle = options.dashStyle;
}
this.cross = this.chart.renderer.path(path).attr(attribs).add();
}
}
},
/**
* Hide the crosshair.
*/
hideCrosshair: function () {
if (this.cross) {
this.cross.hide();
}
}
}; // end Axis
extend(Axis.prototype, AxisPlotLineOrBandExtension);
/**
* Set the tick positions to a time unit that makes sense, for example
* on the first of each month or on every Monday. Return an array
* with the time positions. Used in datetime axes as well as for grouping
* data on a datetime axis.
*
* @param {Object} normalizedInterval The interval in axis values (ms) and the count
* @param {Number} min The minimum in axis values
* @param {Number} max The maximum in axis values
* @param {Number} startOfWeek
*/
Axis.prototype.getTimeTicks = function (normalizedInterval, min, max, startOfWeek) {
var tickPositions = [],
i,
higherRanks = {},
useUTC = defaultOptions.global.useUTC,
minYear, // used in months and years as a basis for Date.UTC()
minDate = new Date(min - getTZOffset(min)),
interval = normalizedInterval.unitRange,
count = normalizedInterval.count;
if (defined(min)) { // #1300
minDate.setMilliseconds(interval >= timeUnits.second ? 0 :
count * mathFloor(minDate.getMilliseconds() / count)); // #3652, #3654
if (interval >= timeUnits.second) { // second
minDate.setSeconds(interval >= timeUnits.minute ? 0 :
count * mathFloor(minDate.getSeconds() / count));
}
if (interval >= timeUnits.minute) { // minute
minDate[setMinutes](interval >= timeUnits.hour ? 0 :
count * mathFloor(minDate[getMinutes]() / count));
}
if (interval >= timeUnits.hour) { // hour
minDate[setHours](interval >= timeUnits.day ? 0 :
count * mathFloor(minDate[getHours]() / count));
}
if (interval >= timeUnits.day) { // day
minDate[setDate](interval >= timeUnits.month ? 1 :
count * mathFloor(minDate[getDate]() / count));
}
if (interval >= timeUnits.month) { // month
minDate[setMonth](interval >= timeUnits.year ? 0 :
count * mathFloor(minDate[getMonth]() / count));
minYear = minDate[getFullYear]();
}
if (interval >= timeUnits.year) { // year
minYear -= minYear % count;
minDate[setFullYear](minYear);
}
// week is a special case that runs outside the hierarchy
if (interval === timeUnits.week) {
// get start of current week, independent of count
minDate[setDate](minDate[getDate]() - minDate[getDay]() +
pick(startOfWeek, 1));
}
// get tick positions
i = 1;
if (timezoneOffset || getTimezoneOffset) {
minDate = minDate.getTime();
minDate = new Date(minDate + getTZOffset(minDate));
}
minYear = minDate[getFullYear]();
var time = minDate.getTime(),
minMonth = minDate[getMonth](),
minDateDate = minDate[getDate](),
localTimezoneOffset = (timeUnits.day +
(useUTC ? getTZOffset(minDate) : minDate.getTimezoneOffset() * 60 * 1000)
) % timeUnits.day; // #950, #3359
// iterate and add tick positions at appropriate values
while (time < max) {
tickPositions.push(time);
// if the interval is years, use Date.UTC to increase years
if (interval === timeUnits.year) {
time = makeTime(minYear + i * count, 0);
// if the interval is months, use Date.UTC to increase months
} else if (interval === timeUnits.month) {
time = makeTime(minYear, minMonth + i * count);
// if we're using global time, the interval is not fixed as it jumps
// one hour at the DST crossover
} else if (!useUTC && (interval === timeUnits.day || interval === timeUnits.week)) {
time = makeTime(minYear, minMonth, minDateDate +
i * count * (interval === timeUnits.day ? 1 : 7));
// else, the interval is fixed and we use simple addition
} else {
time += interval * count;
}
i++;
}
// push the last time
tickPositions.push(time);
// mark new days if the time is dividible by day (#1649, #1760)
each(grep(tickPositions, function (time) {
return interval <= timeUnits.hour && time % timeUnits.day === localTimezoneOffset;
}), function (time) {
higherRanks[time] = 'day';
});
}
// record information on the chosen unit - for dynamic label formatter
tickPositions.info = extend(normalizedInterval, {
higherRanks: higherRanks,
totalRange: interval * count
});
return tickPositions;
};
/**
* Get a normalized tick interval for dates. Returns a configuration object with
* unit range (interval), count and name. Used to prepare data for getTimeTicks.
* Previously this logic was part of getTimeTicks, but as getTimeTicks now runs
* of segments in stock charts, the normalizing logic was extracted in order to
* prevent it for running over again for each segment having the same interval.
* #662, #697.
*/
Axis.prototype.normalizeTimeTickInterval = function (tickInterval, unitsOption) {
var units = unitsOption || [[
'millisecond', // unit name
[1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
], [
'second',
[1, 2, 5, 10, 15, 30]
], [
'minute',
[1, 2, 5, 10, 15, 30]
], [
'hour',
[1, 2, 3, 4, 6, 8, 12]
], [
'day',
[1, 2]
], [
'week',
[1, 2]
], [
'month',
[1, 2, 3, 4, 6]
], [
'year',
null
]],
unit = units[units.length - 1], // default unit is years
interval = timeUnits[unit[0]],
multiples = unit[1],
count,
i;
// loop through the units to find the one that best fits the tickInterval
for (i = 0; i < units.length; i++) {
unit = units[i];
interval = timeUnits[unit[0]];
multiples = unit[1];
if (units[i + 1]) {
// lessThan is in the middle between the highest multiple and the next unit.
var lessThan = (interval * multiples[multiples.length - 1] +
timeUnits[units[i + 1][0]]) / 2;
// break and keep the current unit
if (tickInterval <= lessThan) {
break;
}
}
}
// prevent 2.5 years intervals, though 25, 250 etc. are allowed
if (interval === timeUnits.year && tickInterval < 5 * interval) {
multiples = [1, 2, 5];
}
// get the count
count = normalizeTickInterval(
tickInterval / interval,
multiples,
unit[0] === 'year' ? mathMax(getMagnitude(tickInterval / interval), 1) : 1 // #1913, #2360
);
return {
unitRange: interval,
count: count,
unitName: unit[0]
};
};/**
* Methods defined on the Axis prototype
*/
/**
* Set the tick positions of a logarithmic axis
*/
Axis.prototype.getLogTickPositions = function (interval, min, max, minor) {
var axis = this,
options = axis.options,
axisLength = axis.len,
// Since we use this method for both major and minor ticks,
// use a local variable and return the result
positions = [];
// Reset
if (!minor) {
axis._minorAutoInterval = null;
}
// First case: All ticks fall on whole logarithms: 1, 10, 100 etc.
if (interval >= 0.5) {
interval = mathRound(interval);
positions = axis.getLinearTickPositions(interval, min, max);
// Second case: We need intermediary ticks. For example
// 1, 2, 4, 6, 8, 10, 20, 40 etc.
} else if (interval >= 0.08) {
var roundedMin = mathFloor(min),
intermediate,
i,
j,
len,
pos,
lastPos,
break2;
if (interval > 0.3) {
intermediate = [1, 2, 4];
} else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc
intermediate = [1, 2, 4, 6, 8];
} else { // 0.1 equals ten minor ticks per 1, 10, 100 etc
intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9];
}
for (i = roundedMin; i < max + 1 && !break2; i++) {
len = intermediate.length;
for (j = 0; j < len && !break2; j++) {
pos = log2lin(lin2log(i) * intermediate[j]);
if (pos > min && (!minor || lastPos <= max) && lastPos !== UNDEFINED) { // #1670, lastPos is #3113
positions.push(lastPos);
}
if (lastPos > max) {
break2 = true;
}
lastPos = pos;
}
}
// Third case: We are so deep in between whole logarithmic values that
// we might as well handle the tick positions like a linear axis. For
// example 1.01, 1.02, 1.03, 1.04.
} else {
var realMin = lin2log(min),
realMax = lin2log(max),
tickIntervalOption = options[minor ? 'minorTickInterval' : 'tickInterval'],
filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption,
tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1),
totalPixelLength = minor ? axisLength / axis.tickPositions.length : axisLength;
interval = pick(
filteredTickIntervalOption,
axis._minorAutoInterval,
(realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1)
);
interval = normalizeTickInterval(
interval,
null,
getMagnitude(interval)
);
positions = map(axis.getLinearTickPositions(
interval,
realMin,
realMax
), log2lin);
if (!minor) {
axis._minorAutoInterval = interval / 5;
}
}
// Set the axis-level tickInterval variable
if (!minor) {
axis.tickInterval = interval;
}
return positions;
};/**
* The tooltip object
* @param {Object} chart The chart instance
* @param {Object} options Tooltip options
*/
var Tooltip = Highcharts.Tooltip = function () {
this.init.apply(this, arguments);
};
Tooltip.prototype = {
init: function (chart, options) {
var borderWidth = options.borderWidth,
style = options.style,
padding = pInt(style.padding);
// Save the chart and options
this.chart = chart;
this.options = options;
// Keep track of the current series
//this.currentSeries = UNDEFINED;
// List of crosshairs
this.crosshairs = [];
// Current values of x and y when animating
this.now = { x: 0, y: 0 };
// The tooltip is initially hidden
this.isHidden = true;
// create the label
this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip')
.attr({
padding: padding,
fill: options.backgroundColor,
'stroke-width': borderWidth,
r: options.borderRadius,
zIndex: 8
})
.css(style)
.css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117)
.add()
.attr({ y: -9999 }); // #2301, #2657
// When using canVG the shadow shows up as a gray circle
// even if the tooltip is hidden.
if (!useCanVG) {
this.label.shadow(options.shadow);
}
// Public property for getting the shared state.
this.shared = options.shared;
},
/**
* Destroy the tooltip and its elements.
*/
destroy: function () {
// Destroy and clear local variables
if (this.label) {
this.label = this.label.destroy();
}
clearTimeout(this.hideTimer);
clearTimeout(this.tooltipTimeout);
},
/**
* Provide a soft movement for the tooltip
*
* @param {Number} x
* @param {Number} y
* @private
*/
move: function (x, y, anchorX, anchorY) {
var tooltip = this,
now = tooltip.now,
animate = tooltip.options.animation !== false && !tooltip.isHidden &&
// When we get close to the target position, abort animation and land on the right place (#3056)
(mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1),
skipAnchor = tooltip.followPointer || tooltip.len > 1;
// Get intermediate values for animation
extend(now, {
x: animate ? (2 * now.x + x) / 3 : x,
y: animate ? (now.y + y) / 2 : y,
anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,
anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY
});
// Move to the intermediate value
tooltip.label.attr(now);
// Run on next tick of the mouse tracker
if (animate) {
// Never allow two timeouts
clearTimeout(this.tooltipTimeout);
// Set the fixed interval ticking for the smooth tooltip
this.tooltipTimeout = setTimeout(function () {
// The interval function may still be running during destroy, so check that the chart is really there before calling.
if (tooltip) {
tooltip.move(x, y, anchorX, anchorY);
}
}, 32);
}
},
/**
* Hide the tooltip
*/
hide: function (delay) {
var tooltip = this,
hoverPoints;
clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766)
if (!this.isHidden) {
hoverPoints = this.chart.hoverPoints;
this.hideTimer = setTimeout(function () {
tooltip.label.fadeOut();
tooltip.isHidden = true;
}, pick(delay, this.options.hideDelay, 500));
// hide previous hoverPoints and set new
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
this.chart.hoverPoints = null;
this.chart.hoverSeries = null;
}
},
/**
* Extendable method to get the anchor position of the tooltip
* from a point or set of points
*/
getAnchor: function (points, mouseEvent) {
var ret,
chart = this.chart,
inverted = chart.inverted,
plotTop = chart.plotTop,
plotLeft = chart.plotLeft,
plotX = 0,
plotY = 0,
yAxis,
xAxis;
points = splat(points);
// Pie uses a special tooltipPos
ret = points[0].tooltipPos;
// When tooltip follows mouse, relate the position to the mouse
if (this.followPointer && mouseEvent) {
if (mouseEvent.chartX === UNDEFINED) {
mouseEvent = chart.pointer.normalize(mouseEvent);
}
ret = [
mouseEvent.chartX - chart.plotLeft,
mouseEvent.chartY - plotTop
];
}
// When shared, use the average position
if (!ret) {
each(points, function (point) {
yAxis = point.series.yAxis;
xAxis = point.series.xAxis;
plotX += point.plotX + (!inverted && xAxis ? xAxis.left - plotLeft : 0);
plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) +
(!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151
});
plotX /= points.length;
plotY /= points.length;
ret = [
inverted ? chart.plotWidth - plotY : plotX,
this.shared && !inverted && points.length > 1 && mouseEvent ?
mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424)
inverted ? chart.plotHeight - plotX : plotY
];
}
return map(ret, mathRound);
},
/**
* Place the tooltip in a chart without spilling over
* and not covering the point it self.
*/
getPosition: function (boxWidth, boxHeight, point) {
var chart = this.chart,
distance = this.distance,
ret = {},
swapped,
first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop],
second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft],
// The far side is right or bottom
preferFarSide = pick(point.ttBelow, (chart.inverted && !point.negative) || (!chart.inverted && point.negative)),
/**
* Handle the preferred dimension. When the preferred dimension is tooltip
* on top or bottom of the point, it will look for space there.
*/
firstDimension = function (dim, outerSize, innerSize, point) {
var roomLeft = innerSize < point - distance,
roomRight = point + distance + innerSize < outerSize,
alignedLeft = point - distance - innerSize,
alignedRight = point + distance;
if (preferFarSide && roomRight) {
ret[dim] = alignedRight;
} else if (!preferFarSide && roomLeft) {
ret[dim] = alignedLeft;
} else if (roomLeft) {
ret[dim] = alignedLeft;
} else if (roomRight) {
ret[dim] = alignedRight;
} else {
return false;
}
},
/**
* Handle the secondary dimension. If the preferred dimension is tooltip
* on top or bottom of the point, the second dimension is to align the tooltip
* above the point, trying to align center but allowing left or right
* align within the chart box.
*/
secondDimension = function (dim, outerSize, innerSize, point) {
// Too close to the edge, return false and swap dimensions
if (point < distance || point > outerSize - distance) {
return false;
// Align left/top
} else if (point < innerSize / 2) {
ret[dim] = 1;
// Align right/bottom
} else if (point > outerSize - innerSize / 2) {
ret[dim] = outerSize - innerSize - 2;
// Align center
} else {
ret[dim] = point - innerSize / 2;
}
},
/**
* Swap the dimensions
*/
swap = function (count) {
var temp = first;
first = second;
second = temp;
swapped = count;
},
run = function () {
if (firstDimension.apply(0, first) !== false) {
if (secondDimension.apply(0, second) === false && !swapped) {
swap(true);
run();
}
} else if (!swapped) {
swap(true);
run();
} else {
ret.x = ret.y = 0;
}
};
// Under these conditions, prefer the tooltip on the side of the point
if (chart.inverted || this.len > 1) {
swap();
}
run();
return ret;
},
/**
* In case no user defined formatter is given, this will be used. Note that the context
* here is an object holding point, series, x, y etc.
*/
defaultFormatter: function (tooltip) {
var items = this.points || splat(this),
s;
// build the header
s = [tooltip.tooltipFooterHeaderFormatter(items[0])]; //#3397: abstraction to enable formatting of footer and header
// build the values
s = s.concat(tooltip.bodyFormatter(items));
// footer
s.push(tooltip.tooltipFooterHeaderFormatter(items[0], true)); //#3397: abstraction to enable formatting of footer and header
return s.join('');
},
/**
* Refresh the tooltip's text and position.
* @param {Object} point
*/
refresh: function (point, mouseEvent) {
var tooltip = this,
chart = tooltip.chart,
label = tooltip.label,
options = tooltip.options,
x,
y,
anchor,
textConfig = {},
text,
pointConfig = [],
formatter = options.formatter || tooltip.defaultFormatter,
hoverPoints = chart.hoverPoints,
borderColor,
shared = tooltip.shared,
currentSeries;
clearTimeout(this.hideTimer);
// get the reference point coordinates (pie charts use tooltipPos)
tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;
anchor = tooltip.getAnchor(point, mouseEvent);
x = anchor[0];
y = anchor[1];
// shared tooltip, array is sent over
if (shared && !(point.series && point.series.noSharedTooltip)) {
// hide previous hoverPoints and set new
chart.hoverPoints = point;
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
each(point, function (item) {
item.setState(HOVER_STATE);
pointConfig.push(item.getLabelConfig());
});
textConfig = {
x: point[0].category,
y: point[0].y
};
textConfig.points = pointConfig;
this.len = pointConfig.length;
point = point[0];
// single point tooltip
} else {
textConfig = point.getLabelConfig();
}
text = formatter.call(textConfig, tooltip);
// register the current series
currentSeries = point.series;
this.distance = pick(currentSeries.tooltipOptions.distance, 16);
// update the inner HTML
if (text === false) {
this.hide();
} else {
// show it
if (tooltip.isHidden) {
stop(label);
label.attr('opacity', 1).show();
}
// update text
label.attr({
text: text
});
// set the stroke color of the box
borderColor = options.borderColor || point.color || currentSeries.color || '#606060';
label.attr({
stroke: borderColor
});
tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow });
this.isHidden = false;
}
fireEvent(chart, 'tooltipRefresh', {
text: text,
x: x + chart.plotLeft,
y: y + chart.plotTop,
borderColor: borderColor
});
},
/**
* Find the new position and perform the move
*/
updatePosition: function (point) {
var chart = this.chart,
label = this.label,
pos = (this.options.positioner || this.getPosition).call(
this,
label.width,
label.height,
point
);
// do the move
this.move(
mathRound(pos.x),
mathRound(pos.y),
point.plotX + chart.plotLeft,
point.plotY + chart.plotTop
);
},
/**
* Get the best X date format based on the closest point range on the axis.
*/
getXDateFormat: function (point, options, xAxis) {
var xDateFormat,
dateTimeLabelFormats = options.dateTimeLabelFormats,
closestPointRange = xAxis && xAxis.closestPointRange,
n,
blank = '01-01 00:00:00.000',
strpos = {
millisecond: 15,
second: 12,
minute: 9,
hour: 6,
day: 3
},
date,
lastN;
if (closestPointRange) {
date = dateFormat('%m-%d %H:%M:%S.%L', point.x);
for (n in timeUnits) {
// If the range is exactly one week and we're looking at a Sunday/Monday, go for the week format
if (closestPointRange === timeUnits.week && +dateFormat('%w', point.x) === xAxis.options.startOfWeek &&
date.substr(6) === blank.substr(6)) {
n = 'week';
break;
// The first format that is too great for the range
} else if (timeUnits[n] > closestPointRange) {
n = lastN;
break;
// If the point is placed every day at 23:59, we need to show
// the minutes as well. #2637.
} else if (strpos[n] && date.substr(strpos[n]) !== blank.substr(strpos[n])) {
break;
}
// Weeks are outside the hierarchy, only apply them on Mondays/Sundays like in the first condition
if (n !== 'week') {
lastN = n;
}
}
if (n) {
xDateFormat = dateTimeLabelFormats[n];
}
} else {
xDateFormat = dateTimeLabelFormats.day;
}
return xDateFormat || dateTimeLabelFormats.year; // #2546, 2581
},
/**
* Format the footer/header of the tooltip
* #3397: abstraction to enable formatting of footer and header
*/
tooltipFooterHeaderFormatter: function (point, isFooter) {
var footOrHead = isFooter ? 'footer' : 'header',
series = point.series,
tooltipOptions = series.tooltipOptions,
xDateFormat = tooltipOptions.xDateFormat,
xAxis = series.xAxis,
isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(point.key),
formatString = tooltipOptions[footOrHead+'Format'];
// Guess the best date format based on the closest point distance (#568, #3418)
if (isDateTime && !xDateFormat) {
xDateFormat = this.getXDateFormat(point, tooltipOptions, xAxis);
}
// Insert the footer date format if any
if (isDateTime && xDateFormat) {
formatString = formatString.replace('{point.key}', '{point.key:' + xDateFormat + '}');
}
return format(formatString, {
point: point,
series: series
});
},
/**
* Build the body (lines) of the tooltip by iterating over the items and returning one entry for each item,
* abstracting this functionality allows to easily overwrite and extend it.
*/
bodyFormatter: function (items) {
return map(items, function (item) {
var tooltipOptions = item.series.tooltipOptions;
return (tooltipOptions.pointFormatter || item.point.tooltipFormatter).call(item.point, tooltipOptions.pointFormat);
});
}
};
var hoverChartIndex;
// Global flag for touch support
hasTouch = doc.documentElement.ontouchstart !== UNDEFINED;
/**
* The mouse tracker object. All methods starting with "on" are primary DOM event handlers.
* Subsequent methods should be named differently from what they are doing.
* @param {Object} chart The Chart instance
* @param {Object} options The root options object
*/
var Pointer = Highcharts.Pointer = function (chart, options) {
this.init(chart, options);
};
Pointer.prototype = {
/**
* Initialize Pointer
*/
init: function (chart, options) {
var chartOptions = options.chart,
chartEvents = chartOptions.events,
zoomType = useCanVG ? '' : chartOptions.zoomType,
inverted = chart.inverted,
zoomX,
zoomY;
// Store references
this.options = options;
this.chart = chart;
// Zoom status
this.zoomX = zoomX = /x/.test(zoomType);
this.zoomY = zoomY = /y/.test(zoomType);
this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);
this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);
this.hasZoom = zoomX || zoomY;
// Do we need to handle click on a touch device?
this.runChartClick = chartEvents && !!chartEvents.click;
this.pinchDown = [];
this.lastValidTouch = {};
if (Highcharts.Tooltip && options.tooltip.enabled) {
chart.tooltip = new Tooltip(chart, options.tooltip);
this.followTouchMove = pick(options.tooltip.followTouchMove, true);
}
this.setDOMEvents();
},
/**
* Add crossbrowser support for chartX and chartY
* @param {Object} e The event object in standard browsers
*/
normalize: function (e, chartPosition) {
var chartX,
chartY,
ePos;
// common IE normalizing
e = e || window.event;
// Framework specific normalizing (#1165)
e = washMouseEvent(e);
// More IE normalizing, needs to go after washMouseEvent
if (!e.target) {
e.target = e.srcElement;
}
// iOS (#2757)
ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e;
// Get mouse position
if (!chartPosition) {
this.chartPosition = chartPosition = offset(this.chart.container);
}
// chartX and chartY
if (ePos.pageX === UNDEFINED) { // IE < 9. #886.
chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is
// for IE10 quirks mode within framesets
chartY = e.y;
} else {
chartX = ePos.pageX - chartPosition.left;
chartY = ePos.pageY - chartPosition.top;
}
return extend(e, {
chartX: mathRound(chartX),
chartY: mathRound(chartY)
});
},
/**
* Get the click position in terms of axis values.
*
* @param {Object} e A pointer event
*/
getCoordinates: function (e) {
var coordinates = {
xAxis: [],
yAxis: []
};
each(this.chart.axes, function (axis) {
coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({
axis: axis,
value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY'])
});
});
return coordinates;
},
/**
* With line type charts with a single tracker, get the point closest to the mouse.
* Run Point.onMouseOver and display tooltip for the point or points.
*/
runPointActions: function (e) {
var pointer = this,
chart = pointer.chart,
series = chart.series,
tooltip = chart.tooltip,
shared = tooltip ? tooltip.shared : false,
followPointer,
//point,
//points,
hoverPoint = chart.hoverPoint,
hoverSeries = chart.hoverSeries,
i,
trueXkd,
trueX,
//j,
distance = chart.chartWidth,
rdistance = chart.chartWidth,
anchor,
noSharedTooltip,
kdpoints = [],
kdpoint,
kdpointT;
// For hovering over the empty parts of the plot area (hoverSeries is undefined).
// If there is one series with point tracking (combo chart), don't go to nearest neighbour.
if (!shared && !hoverSeries) {
for (i = 0; i < series.length; i++) {
if (series[i].directTouch || !series[i].options.stickyTracking) {
series = [];
}
}
}
if (!(hoverSeries && hoverSeries.noSharedTooltip) && (shared || !hoverSeries)) { // #3821
// Find nearest points on all series
each(series, function (s) {
// Skip hidden series
noSharedTooltip = s.noSharedTooltip && shared;
if (s.visible && !noSharedTooltip && pick(s.options.enableMouseTracking, true)) { // #3821
kdpointT = s.searchPoint(e); // #3828
if (kdpointT) {
kdpoints.push(kdpointT);
}
}
});
// Find absolute nearest point
each(kdpoints, function (p) {
if (p && defined(p.plotX) && defined(p.plotY)) {
if ((p.dist.distX < distance) || ((p.dist.distX === distance || p.series.kdDimensions > 1) && p.dist.distR < rdistance)) {
distance = p.dist.distX;
rdistance = p.dist.distR;
kdpoint = p;
}
}
//point = kdpoints[0];
});
} else {
kdpoint = hoverSeries ? hoverSeries.searchPoint(e) : UNDEFINED;
}
// Refresh tooltip for kdpoint
if (kdpoint && kdpoint !== hoverPoint) {
// Draw tooltip if necessary
if (shared && !kdpoint.series.noSharedTooltip) {
i = kdpoints.length;
trueXkd = kdpoint.clientX;
while (i--) {
trueX = kdpoints[i].clientX;
if (kdpoints[i].x !== kdpoint.x || trueX !== trueXkd || !defined(kdpoints[i].y) || (kdpoints[i].series.noSharedTooltip || false)) {
kdpoints.splice(i, 1);
}
}
if (tooltip) {
tooltip.refresh(kdpoints, e);
}
each(kdpoints, function (point) {
point.onMouseOver(e);
});
} else {
if (tooltip) {
tooltip.refresh(kdpoint, e);
}
kdpoint.onMouseOver(e);
}
// Update positions (regardless of kdpoint or hoverPoint)
} else {
followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;
if (tooltip && followPointer && !tooltip.isHidden) {
anchor = tooltip.getAnchor([{}], e);
tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });
}
}
// Start the event listener to pick up the tooltip
if (tooltip && !pointer._onDocumentMouseMove) {
pointer._onDocumentMouseMove = function (e) {
pointer.onDocumentMouseMove(e);
};
addEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
}
// Crosshair
each(chart.axes, function (axis) {
axis.drawCrosshair(e, pick(kdpoint, hoverPoint));
});
},
/**
* Reset the tracking by hiding the tooltip, the hover series state and the hover point
*
* @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible
*/
reset: function (allowMove, delay) {
var pointer = this,
chart = pointer.chart,
hoverSeries = chart.hoverSeries,
hoverPoint = chart.hoverPoint,
tooltip = chart.tooltip,
tooltipPoints = tooltip && tooltip.shared ? chart.hoverPoints : hoverPoint;
// Narrow in allowMove
allowMove = allowMove && tooltip && tooltipPoints;
// Check if the points have moved outside the plot area, #1003
if (allowMove && splat(tooltipPoints)[0].plotX === UNDEFINED) {
allowMove = false;
}
// Just move the tooltip, #349
if (allowMove) {
tooltip.refresh(tooltipPoints);
if (hoverPoint) { // #2500
hoverPoint.setState(hoverPoint.state, true);
each(chart.axes, function (axis) {
if (pick(axis.options.crosshair && axis.options.crosshair.snap, true)) {
axis.drawCrosshair(null, allowMove);
} else {
axis.hideCrosshair();
}
});
}
// Full reset
} else {
if (hoverPoint) {
hoverPoint.onMouseOut();
}
if (hoverSeries) {
hoverSeries.onMouseOut();
}
if (tooltip) {
tooltip.hide(delay);
}
if (pointer._onDocumentMouseMove) {
removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
pointer._onDocumentMouseMove = null;
}
// Remove crosshairs
each(chart.axes, function (axis) {
axis.hideCrosshair();
});
pointer.hoverX = null;
}
},
/**
* Scale series groups to a certain scale and translation
*/
scaleGroups: function (attribs, clip) {
var chart = this.chart,
seriesAttribs;
// Scale each series
each(chart.series, function (series) {
seriesAttribs = attribs || series.getPlotBox(); // #1701
if (series.xAxis && series.xAxis.zoomEnabled) {
series.group.attr(seriesAttribs);
if (series.markerGroup) {
series.markerGroup.attr(seriesAttribs);
series.markerGroup.clip(clip ? chart.clipRect : null);
}
if (series.dataLabelsGroup) {
series.dataLabelsGroup.attr(seriesAttribs);
}
}
});
// Clip
chart.clipRect.attr(clip || chart.clipBox);
},
/**
* Start a drag operation
*/
dragStart: function (e) {
var chart = this.chart;
// Record the start position
chart.mouseIsDown = e.type;
chart.cancelClick = false;
chart.mouseDownX = this.mouseDownX = e.chartX;
chart.mouseDownY = this.mouseDownY = e.chartY;
},
/**
* Perform a drag operation in response to a mousemove event while the mouse is down
*/
drag: function (e) {
var chart = this.chart,
chartOptions = chart.options.chart,
chartX = e.chartX,
chartY = e.chartY,
zoomHor = this.zoomHor,
zoomVert = this.zoomVert,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
clickedInside,
size,
mouseDownX = this.mouseDownX,
mouseDownY = this.mouseDownY,
panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key'];
// If the mouse is outside the plot area, adjust to cooordinates
// inside to prevent the selection marker from going outside
if (chartX < plotLeft) {
chartX = plotLeft;
} else if (chartX > plotLeft + plotWidth) {
chartX = plotLeft + plotWidth;
}
if (chartY < plotTop) {
chartY = plotTop;
} else if (chartY > plotTop + plotHeight) {
chartY = plotTop + plotHeight;
}
// determine if the mouse has moved more than 10px
this.hasDragged = Math.sqrt(
Math.pow(mouseDownX - chartX, 2) +
Math.pow(mouseDownY - chartY, 2)
);
if (this.hasDragged > 10) {
clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop);
// make a selection
if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) {
if (!this.selectionMarker) {
this.selectionMarker = chart.renderer.rect(
plotLeft,
plotTop,
zoomHor ? 1 : plotWidth,
zoomVert ? 1 : plotHeight,
0
)
.attr({
fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)',
zIndex: 7
})
.add();
}
}
// adjust the width of the selection marker
if (this.selectionMarker && zoomHor) {
size = chartX - mouseDownX;
this.selectionMarker.attr({
width: mathAbs(size),
x: (size > 0 ? 0 : size) + mouseDownX
});
}
// adjust the height of the selection marker
if (this.selectionMarker && zoomVert) {
size = chartY - mouseDownY;
this.selectionMarker.attr({
height: mathAbs(size),
y: (size > 0 ? 0 : size) + mouseDownY
});
}
// panning
if (clickedInside && !this.selectionMarker && chartOptions.panning) {
chart.pan(e, chartOptions.panning);
}
}
},
/**
* On mouse up or touch end across the entire document, drop the selection.
*/
drop: function (e) {
var pointer = this,
chart = this.chart,
hasPinched = this.hasPinched;
if (this.selectionMarker) {
var selectionData = {
xAxis: [],
yAxis: [],
originalEvent: e.originalEvent || e
},
selectionBox = this.selectionMarker,
selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,
selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,
selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,
selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,
runZoom;
// a selection has been made
if (this.hasDragged || hasPinched) {
// record each axis' min and max
each(chart.axes, function (axis) {
if (axis.zoomEnabled && defined(axis.min) && (hasPinched || pointer[{ xAxis: 'zoomX', yAxis: 'zoomY' }[axis.coll]])) { // #859, #3569
var horiz = axis.horiz,
minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075
selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),
selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);
selectionData[axis.coll].push({
axis: axis,
min: mathMin(selectionMin, selectionMax), // for reversed axes
max: mathMax(selectionMin, selectionMax)
});
runZoom = true;
}
});
if (runZoom) {
fireEvent(chart, 'selection', selectionData, function (args) {
chart.zoom(extend(args, hasPinched ? { animation: false } : null));
});
}
}
this.selectionMarker = this.selectionMarker.destroy();
// Reset scaling preview
if (hasPinched) {
this.scaleGroups();
}
}
// Reset all
if (chart) { // it may be destroyed on mouse up - #877
css(chart.container, { cursor: chart._cursor });
chart.cancelClick = this.hasDragged > 10; // #370
chart.mouseIsDown = this.hasDragged = this.hasPinched = false;
this.pinchDown = [];
}
},
onContainerMouseDown: function (e) {
e = this.normalize(e);
// issue #295, dragging not always working in Firefox
if (e.preventDefault) {
e.preventDefault();
}
this.dragStart(e);
},
onDocumentMouseUp: function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.drop(e);
}
},
/**
* Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea.
* Issue #149 workaround. The mouseleave event does not always fire.
*/
onDocumentMouseMove: function (e) {
var chart = this.chart,
chartPosition = this.chartPosition;
e = this.normalize(e, chartPosition);
// If we're outside, hide the tooltip
if (chartPosition && !this.inClass(e.target, 'highcharts-tracker') &&
!chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
this.reset();
}
},
/**
* When mouse leaves the container, hide the tooltip.
*/
onContainerMouseLeave: function () {
var chart = charts[hoverChartIndex];
if (chart) {
chart.pointer.reset();
chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix
}
},
// The mousemove, touchmove and touchstart event handler
onContainerMouseMove: function (e) {
var chart = this.chart;
hoverChartIndex = chart.index;
e = this.normalize(e);
e.returnValue = false; // #2251, #3224
if (chart.mouseIsDown === 'mousedown') {
this.drag(e);
}
// Show the tooltip and run mouse over events (#977)
if ((this.inClass(e.target, 'highcharts-tracker') ||
chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) {
this.runPointActions(e);
}
},
/**
* Utility to detect whether an element has, or has a parent with, a specific
* class name. Used on detection of tracker objects and on deciding whether
* hovering the tooltip should cause the active series to mouse out.
*/
inClass: function (element, className) {
var elemClassName;
while (element) {
elemClassName = attr(element, 'class');
if (elemClassName) {
if (elemClassName.indexOf(className) !== -1) {
return true;
} else if (elemClassName.indexOf(PREFIX + 'container') !== -1) {
return false;
}
}
element = element.parentNode;
}
},
onTrackerMouseOut: function (e) {
var series = this.chart.hoverSeries,
relatedTarget = e.relatedTarget || e.toElement,
relatedSeries = relatedTarget && relatedTarget.point && relatedTarget.point.series; // #2499
if (series && !series.options.stickyTracking && !this.inClass(relatedTarget, PREFIX + 'tooltip') &&
relatedSeries !== series) {
series.onMouseOut();
}
},
onContainerClick: function (e) {
var chart = this.chart,
hoverPoint = chart.hoverPoint,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop;
e = this.normalize(e);
e.cancelBubble = true; // IE specific
if (!chart.cancelClick) {
// On tracker click, fire the series and point events. #783, #1583
if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) {
// the series click event
fireEvent(hoverPoint.series, 'click', extend(e, {
point: hoverPoint
}));
// the point click event
if (chart.hoverPoint) { // it may be destroyed (#1844)
hoverPoint.firePointEvent('click', e);
}
// When clicking outside a tracker, fire a chart event
} else {
extend(e, this.getCoordinates(e));
// fire a click event in the chart
if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) {
fireEvent(chart, 'click', e);
}
}
}
},
/**
* Set the JS DOM events on the container and document. This method should contain
* a one-to-one assignment between methods and their handlers. Any advanced logic should
* be moved to the handler reflecting the event's name.
*/
setDOMEvents: function () {
var pointer = this,
container = pointer.chart.container;
container.onmousedown = function (e) {
pointer.onContainerMouseDown(e);
};
container.onmousemove = function (e) {
pointer.onContainerMouseMove(e);
};
container.onclick = function (e) {
pointer.onContainerClick(e);
};
addEvent(container, 'mouseleave', pointer.onContainerMouseLeave);
if (chartCount === 1) {
addEvent(doc, 'mouseup', pointer.onDocumentMouseUp);
}
if (hasTouch) {
container.ontouchstart = function (e) {
pointer.onContainerTouchStart(e);
};
container.ontouchmove = function (e) {
pointer.onContainerTouchMove(e);
};
if (chartCount === 1) {
addEvent(doc, 'touchend', pointer.onDocumentTouchEnd);
}
}
},
/**
* Destroys the Pointer object and disconnects DOM events.
*/
destroy: function () {
var prop;
removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave);
if (!chartCount) {
removeEvent(doc, 'mouseup', this.onDocumentMouseUp);
removeEvent(doc, 'touchend', this.onDocumentTouchEnd);
}
// memory and CPU leak
clearInterval(this.tooltipTimeout);
for (prop in this) {
this[prop] = null;
}
}
};
/* Support for touch devices */
extend(Highcharts.Pointer.prototype, {
/**
* Run translation operations
*/
pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {
if (this.zoomHor || this.pinchHor) {
this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
}
if (this.zoomVert || this.pinchVert) {
this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
}
},
/**
* Run translation operations for each direction (horizontal and vertical) independently
*/
pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) {
var chart = this.chart,
xy = horiz ? 'x' : 'y',
XY = horiz ? 'X' : 'Y',
sChartXY = 'chart' + XY,
wh = horiz ? 'width' : 'height',
plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')],
selectionWH,
selectionXY,
clipXY,
scale = forcedScale || 1,
inverted = chart.inverted,
bounds = chart.bounds[horiz ? 'h' : 'v'],
singleTouch = pinchDown.length === 1,
touch0Start = pinchDown[0][sChartXY],
touch0Now = touches[0][sChartXY],
touch1Start = !singleTouch && pinchDown[1][sChartXY],
touch1Now = !singleTouch && touches[1][sChartXY],
outOfBounds,
transformScale,
scaleKey,
setScale = function () {
if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis
scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start);
}
clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;
selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale;
};
// Set the scale, first pass
setScale();
selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not
// Out of bounds
if (selectionXY < bounds.min) {
selectionXY = bounds.min;
outOfBounds = true;
} else if (selectionXY + selectionWH > bounds.max) {
selectionXY = bounds.max - selectionWH;
outOfBounds = true;
}
// Is the chart dragged off its bounds, determined by dataMin and dataMax?
if (outOfBounds) {
// Modify the touchNow position in order to create an elastic drag movement. This indicates
// to the user that the chart is responsive but can't be dragged further.
touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);
if (!singleTouch) {
touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);
}
// Set the scale, second pass to adapt to the modified touchNow positions
setScale();
} else {
lastValidTouch[xy] = [touch0Now, touch1Now];
}
// Set geometry for clipping, selection and transformation
if (!inverted) { // TODO: implement clipping for inverted charts
clip[xy] = clipXY - plotLeftTop;
clip[wh] = selectionWH;
}
scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;
transformScale = inverted ? 1 / scale : scale;
selectionMarker[wh] = selectionWH;
selectionMarker[xy] = selectionXY;
transform[scaleKey] = scale;
transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start));
},
/**
* Handle touch events with two touches
*/
pinch: function (e) {
var self = this,
chart = self.chart,
pinchDown = self.pinchDown,
touches = e.touches,
touchesLength = touches.length,
lastValidTouch = self.lastValidTouch,
hasZoom = self.hasZoom,
selectionMarker = self.selectionMarker,
transform = {},
fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') &&
chart.runTrackerClick) || self.runChartClick),
clip = {};
// On touch devices, only proceed to trigger click if a handler is defined
if (hasZoom && !fireClickEvent) {
e.preventDefault();
}
// Normalize each touch
map(touches, function (e) {
return self.normalize(e);
});
// Register the touch start position
if (e.type === 'touchstart') {
each(touches, function (e, i) {
pinchDown[i] = { chartX: e.chartX, chartY: e.chartY };
});
lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX];
lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY];
// Identify the data bounds in pixels
each(chart.axes, function (axis) {
if (axis.zoomEnabled) {
var bounds = chart.bounds[axis.horiz ? 'h' : 'v'],
minPixelPadding = axis.minPixelPadding,
min = axis.toPixels(pick(axis.options.min, axis.dataMin)),
max = axis.toPixels(pick(axis.options.max, axis.dataMax)),
absMin = mathMin(min, max),
absMax = mathMax(min, max);
// Store the bounds for use in the touchmove handler
bounds.min = mathMin(axis.pos, absMin - minPixelPadding);
bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding);
}
});
self.res = true; // reset on next move
// Event type is touchmove, handle panning and pinching
} else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first
// Set the marker
if (!selectionMarker) {
self.selectionMarker = selectionMarker = extend({
destroy: noop
}, chart.plotBox);
}
self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
self.hasPinched = hasZoom;
// Scale and translate the groups to provide visual feedback during pinching
self.scaleGroups(transform, clip);
// Optionally move the tooltip on touchmove
if (!hasZoom && self.followTouchMove && touchesLength === 1) {
this.runPointActions(self.normalize(e));
} else if (self.res) {
self.res = false;
this.reset(false, 0);
}
}
},
onContainerTouchStart: function (e) {
var chart = this.chart;
hoverChartIndex = chart.index;
if (e.touches.length === 1) {
e = this.normalize(e);
if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && !chart.openMenu) {
// Run mouse events and display tooltip etc
this.runPointActions(e);
this.pinch(e);
} else {
// Hide the tooltip on touching outside the plot area (#1203)
this.reset();
}
} else if (e.touches.length === 2) {
this.pinch(e);
}
},
onContainerTouchMove: function (e) {
if (e.touches.length === 1 || e.touches.length === 2) {
this.pinch(e);
}
},
onDocumentTouchEnd: function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.drop(e);
}
}
});
if (win.PointerEvent || win.MSPointerEvent) {
// The touches object keeps track of the points being touched at all times
var touches = {},
hasPointerEvent = !!win.PointerEvent,
getWebkitTouches = function () {
var key, fake = [];
fake.item = function (i) { return this[i]; };
for (key in touches) {
if (touches.hasOwnProperty(key)) {
fake.push({
pageX: touches[key].pageX,
pageY: touches[key].pageY,
target: touches[key].target
});
}
}
return fake;
},
translateMSPointer = function (e, method, wktype, callback) {
var p;
e = e.originalEvent || e;
if ((e.pointerType === 'touch' || e.pointerType === e.MSPOINTER_TYPE_TOUCH) && charts[hoverChartIndex]) {
callback(e);
p = charts[hoverChartIndex].pointer;
p[method]({
type: wktype,
target: e.currentTarget,
preventDefault: noop,
touches: getWebkitTouches()
});
}
};
/**
* Extend the Pointer prototype with methods for each event handler and more
*/
extend(Pointer.prototype, {
onContainerPointerDown: function (e) {
translateMSPointer(e, 'onContainerTouchStart', 'touchstart', function (e) {
touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY, target: e.currentTarget };
});
},
onContainerPointerMove: function (e) {
translateMSPointer(e, 'onContainerTouchMove', 'touchmove', function (e) {
touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY };
if (!touches[e.pointerId].target) {
touches[e.pointerId].target = e.currentTarget;
}
});
},
onDocumentPointerUp: function (e) {
translateMSPointer(e, 'onContainerTouchEnd', 'touchend', function (e) {
delete touches[e.pointerId];
});
},
/**
* Add or remove the MS Pointer specific events
*/
batchMSEvents: function (fn) {
fn(this.chart.container, hasPointerEvent ? 'pointerdown' : 'MSPointerDown', this.onContainerPointerDown);
fn(this.chart.container, hasPointerEvent ? 'pointermove' : 'MSPointerMove', this.onContainerPointerMove);
fn(doc, hasPointerEvent ? 'pointerup' : 'MSPointerUp', this.onDocumentPointerUp);
}
});
// Disable default IE actions for pinch and such on chart element
wrap(Pointer.prototype, 'init', function (proceed, chart, options) {
proceed.call(this, chart, options);
if (this.hasZoom || this.followTouchMove) {
css(chart.container, {
'-ms-touch-action': NONE,
'touch-action': NONE
});
}
});
// Add IE specific touch events to chart
wrap(Pointer.prototype, 'setDOMEvents', function (proceed) {
proceed.apply(this);
if (this.hasZoom || this.followTouchMove) {
this.batchMSEvents(addEvent);
}
});
// Destroy MS events also
wrap(Pointer.prototype, 'destroy', function (proceed) {
this.batchMSEvents(removeEvent);
proceed.call(this);
});
}
/**
* The overview of the chart's series
*/
var Legend = Highcharts.Legend = function (chart, options) {
this.init(chart, options);
};
Legend.prototype = {
/**
* Initialize the legend
*/
init: function (chart, options) {
var legend = this,
itemStyle = options.itemStyle,
padding,
itemMarginTop = options.itemMarginTop || 0;
this.options = options;
if (!options.enabled) {
return;
}
legend.itemStyle = itemStyle;
legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle);
legend.itemMarginTop = itemMarginTop;
legend.padding = padding = pick(options.padding, 8);
legend.initialItemX = padding;
legend.initialItemY = padding - 5; // 5 is the number of pixels above the text
legend.maxItemWidth = 0;
legend.chart = chart;
legend.itemHeight = 0;
legend.symbolWidth = pick(options.symbolWidth, 16);
legend.pages = [];
// Render it
legend.render();
// move checkboxes
addEvent(legend.chart, 'endResize', function () {
legend.positionCheckboxes();
});
},
/**
* Set the colors for the legend item
* @param {Object} item A Series or Point instance
* @param {Object} visible Dimmed or colored
*/
colorizeItem: function (item, visible) {
var legend = this,
options = legend.options,
legendItem = item.legendItem,
legendLine = item.legendLine,
legendSymbol = item.legendSymbol,
hiddenColor = legend.itemHiddenStyle.color,
textColor = visible ? options.itemStyle.color : hiddenColor,
symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor,
markerOptions = item.options && item.options.marker,
symbolAttr = { fill: symbolColor },
key,
val;
if (legendItem) {
legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE
}
if (legendLine) {
legendLine.attr({ stroke: symbolColor });
}
if (legendSymbol) {
// Apply marker options
if (markerOptions && legendSymbol.isMarker) { // #585
symbolAttr.stroke = symbolColor;
markerOptions = item.convertAttribs(markerOptions);
for (key in markerOptions) {
val = markerOptions[key];
if (val !== UNDEFINED) {
symbolAttr[key] = val;
}
}
}
legendSymbol.attr(symbolAttr);
}
},
/**
* Position the legend item
* @param {Object} item A Series or Point instance
*/
positionItem: function (item) {
var legend = this,
options = legend.options,
symbolPadding = options.symbolPadding,
ltr = !options.rtl,
legendItemPos = item._legendItemPos,
itemX = legendItemPos[0],
itemY = legendItemPos[1],
checkbox = item.checkbox;
if (item.legendGroup) {
item.legendGroup.translate(
ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4,
itemY
);
}
if (checkbox) {
checkbox.x = itemX;
checkbox.y = itemY;
}
},
/**
* Destroy a single legend item
* @param {Object} item The series or point
*/
destroyItem: function (item) {
var checkbox = item.checkbox;
// destroy SVG elements
each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) {
if (item[key]) {
item[key] = item[key].destroy();
}
});
if (checkbox) {
discardElement(item.checkbox);
}
},
/**
* Destroy all items.
*/
clearItems: function () {
var legend = this;
each(legend.getAllItems(), function (item) {
legend.destroyItem(item);
});
},
/**
* Destroys the legend.
*/
destroy: function () {
var legend = this,
legendGroup = legend.group,
box = legend.box;
if (box) {
legend.box = box.destroy();
}
if (legendGroup) {
legend.group = legendGroup.destroy();
}
},
/**
* Position the checkboxes after the width is determined
*/
positionCheckboxes: function (scrollOffset) {
var alignAttr = this.group.alignAttr,
translateY,
clipHeight = this.clipHeight || this.legendHeight;
if (alignAttr) {
translateY = alignAttr.translateY;
each(this.allItems, function (item) {
var checkbox = item.checkbox,
top;
if (checkbox) {
top = (translateY + checkbox.y + (scrollOffset || 0) + 3);
css(checkbox, {
left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX,
top: top + PX,
display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE
});
}
});
}
},
/**
* Render the legend title on top of the legend
*/
renderTitle: function () {
var options = this.options,
padding = this.padding,
titleOptions = options.title,
titleHeight = 0,
bBox;
if (titleOptions.text) {
if (!this.title) {
this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title')
.attr({ zIndex: 1 })
.css(titleOptions.style)
.add(this.group);
}
bBox = this.title.getBBox();
titleHeight = bBox.height;
this.offsetWidth = bBox.width; // #1717
this.contentGroup.attr({ translateY: titleHeight });
}
this.titleHeight = titleHeight;
},
/**
* Render a single specific legend item
* @param {Object} item A series or point
*/
renderItem: function (item) {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
options = legend.options,
horizontal = options.layout === 'horizontal',
symbolWidth = legend.symbolWidth,
symbolPadding = options.symbolPadding,
itemStyle = legend.itemStyle,
itemHiddenStyle = legend.itemHiddenStyle,
padding = legend.padding,
itemDistance = horizontal ? pick(options.itemDistance, 20) : 0,
ltr = !options.rtl,
itemHeight,
widthOption = options.width,
itemMarginBottom = options.itemMarginBottom || 0,
itemMarginTop = legend.itemMarginTop,
initialItemX = legend.initialItemX,
bBox,
itemWidth,
li = item.legendItem,
series = item.series && item.series.drawLegendSymbol ? item.series : item,
seriesOptions = series.options,
showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox,
useHTML = options.useHTML;
if (!li) { // generate it once, later move it
// Generate the group box
// A group to hold the symbol and text. Text is to be appended in Legend class.
item.legendGroup = renderer.g('legend-item')
.attr({ zIndex: 1 })
.add(legend.scrollGroup);
// Generate the list item text and add it to the group
item.legendItem = li = renderer.text(
options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),
ltr ? symbolWidth + symbolPadding : -symbolPadding,
legend.baseline || 0,
useHTML
)
.css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)
.attr({
align: ltr ? 'left' : 'right',
zIndex: 2
})
.add(item.legendGroup);
// Get the baseline for the first item - the font size is equal for all
if (!legend.baseline) {
legend.baseline = renderer.fontMetrics(itemStyle.fontSize, li).f + 3 + itemMarginTop;
li.attr('y', legend.baseline);
}
// Draw the legend symbol inside the group box
series.drawLegendSymbol(legend, item);
if (legend.setItemEvents) {
legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle);
}
// Colorize the items
legend.colorizeItem(item, item.visible);
// add the HTML checkbox on top
if (showCheckbox) {
legend.createCheckboxForItem(item);
}
}
// calculate the positions for the next line
bBox = li.getBBox();
itemWidth = item.checkboxOffset =
options.itemWidth ||
item.legendItemWidth ||
symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0);
legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height);
// if the item exceeds the width, start a new line
if (horizontal && legend.itemX - initialItemX + itemWidth >
(widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) {
legend.itemX = initialItemX;
legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;
}
// If the item exceeds the height, start a new column
/*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {
legend.itemY = legend.initialItemY;
legend.itemX += legend.maxItemWidth;
legend.maxItemWidth = 0;
}*/
// Set the edge positions
legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);
legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;
legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915
// cache the position of the newly generated or reordered items
item._legendItemPos = [legend.itemX, legend.itemY];
// advance
if (horizontal) {
legend.itemX += itemWidth;
} else {
legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;
legend.lastLineHeight = itemHeight;
}
// the width of the widest item
legend.offsetWidth = widthOption || mathMax(
(horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,
legend.offsetWidth
);
},
/**
* Get all items, which is one item per series for normal series and one item per point
* for pie series.
*/
getAllItems: function () {
var allItems = [];
each(this.chart.series, function (series) {
var seriesOptions = series.options;
// Handle showInLegend. If the series is linked to another series, defaults to false.
if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) {
return;
}
// use points or series for the legend item depending on legendType
allItems = allItems.concat(
series.legendItems ||
(seriesOptions.legendType === 'point' ?
series.data :
series)
);
});
return allItems;
},
/**
* Adjust the chart margins by reserving space for the legend on only one side
* of the chart. If the position is set to a corner, top or bottom is reserved
* for horizontal legends and left or right for vertical ones.
*/
adjustMargins: function (margin, spacing) {
var chart = this.chart,
options = this.options,
// Use the first letter of each alignment option in order to detect the side
alignment = options.align[0] + options.verticalAlign[0] + options.layout[0];
if (this.display && !options.floating) {
each([
/(lth|ct|rth)/,
/(rtv|rm|rbv)/,
/(rbh|cb|lbh)/,
/(lbv|lm|ltv)/
], function (alignments, side) {
if (alignments.test(alignment) && !defined(margin[side])) {
// Now we have detected on which side of the chart we should reserve space for the legend
chart[marginNames[side]] = mathMax(
chart[marginNames[side]],
chart.legend[(side + 1) % 2 ? 'legendHeight' : 'legendWidth'] +
[1, -1, -1, 1][side] * options[(side % 2) ? 'x' : 'y'] +
pick(options.margin, 12) +
spacing[side]
);
}
});
}
},
/**
* Render the legend. This method can be called both before and after
* chart.render. If called after, it will only rearrange items instead
* of creating new ones.
*/
render: function () {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
legendGroup = legend.group,
allItems,
display,
legendWidth,
legendHeight,
box = legend.box,
options = legend.options,
padding = legend.padding,
legendBorderWidth = options.borderWidth,
legendBackgroundColor = options.backgroundColor;
legend.itemX = legend.initialItemX;
legend.itemY = legend.initialItemY;
legend.offsetWidth = 0;
legend.lastItemY = 0;
if (!legendGroup) {
legend.group = legendGroup = renderer.g('legend')
.attr({ zIndex: 7 })
.add();
legend.contentGroup = renderer.g()
.attr({ zIndex: 1 }) // above background
.add(legendGroup);
legend.scrollGroup = renderer.g()
.add(legend.contentGroup);
}
legend.renderTitle();
// add each series or point
allItems = legend.getAllItems();
// sort by legendIndex
stableSort(allItems, function (a, b) {
return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0);
});
// reversed legend
if (options.reversed) {
allItems.reverse();
}
legend.allItems = allItems;
legend.display = display = !!allItems.length;
// render the items
legend.lastLineHeight = 0;
each(allItems, function (item) {
legend.renderItem(item);
});
// Get the box
legendWidth = (options.width || legend.offsetWidth) + padding;
legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight;
legendHeight = legend.handleOverflow(legendHeight);
legendHeight += padding;
// Draw the border and/or background
if (legendBorderWidth || legendBackgroundColor) {
if (!box) {
legend.box = box = renderer.rect(
0,
0,
legendWidth,
legendHeight,
options.borderRadius,
legendBorderWidth || 0
).attr({
stroke: options.borderColor,
'stroke-width': legendBorderWidth || 0,
fill: legendBackgroundColor || NONE
})
.add(legendGroup)
.shadow(options.shadow);
box.isNew = true;
} else if (legendWidth > 0 && legendHeight > 0) {
box[box.isNew ? 'attr' : 'animate'](
box.crisp({ width: legendWidth, height: legendHeight })
);
box.isNew = false;
}
// hide the border if no items
box[display ? 'show' : 'hide']();
}
legend.legendWidth = legendWidth;
legend.legendHeight = legendHeight;
// Now that the legend width and height are established, put the items in the
// final position
each(allItems, function (item) {
legend.positionItem(item);
});
// 1.x compatibility: positioning based on style
/*var props = ['left', 'right', 'top', 'bottom'],
prop,
i = 4;
while (i--) {
prop = props[i];
if (options.style[prop] && options.style[prop] !== 'auto') {
options[i < 2 ? 'align' : 'verticalAlign'] = prop;
options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1);
}
}*/
if (display) {
legendGroup.align(extend({
width: legendWidth,
height: legendHeight
}, options), true, 'spacingBox');
}
if (!chart.isResizing) {
this.positionCheckboxes();
}
},
/**
* Set up the overflow handling by adding navigation with up and down arrows below the
* legend.
*/
handleOverflow: function (legendHeight) {
var legend = this,
chart = this.chart,
renderer = chart.renderer,
options = this.options,
optionsY = options.y,
alignTop = options.verticalAlign === 'top',
spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding,
maxHeight = options.maxHeight,
clipHeight,
clipRect = this.clipRect,
navOptions = options.navigation,
animation = pick(navOptions.animation, true),
arrowSize = navOptions.arrowSize || 12,
nav = this.nav,
pages = this.pages,
lastY,
allItems = this.allItems;
// Adjust the height
if (options.layout === 'horizontal') {
spaceHeight /= 2;
}
if (maxHeight) {
spaceHeight = mathMin(spaceHeight, maxHeight);
}
// Reset the legend height and adjust the clipping rectangle
pages.length = 0;
if (legendHeight > spaceHeight && !options.useHTML) {
this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - this.padding, 0);
this.currentPage = pick(this.currentPage, 1);
this.fullHeight = legendHeight;
// Fill pages with Y positions so that the top of each a legend item defines
// the scroll top for each page (#2098)
each(allItems, function (item, i) {
var y = item._legendItemPos[1],
h = mathRound(item.legendItem.getBBox().height),
len = pages.length;
if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) {
pages.push(lastY || y);
len++;
}
if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) {
pages.push(y);
}
if (y !== lastY) {
lastY = y;
}
});
// Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787)
if (!clipRect) {
clipRect = legend.clipRect = renderer.clipRect(0, this.padding, 9999, 0);
legend.contentGroup.clip(clipRect);
}
clipRect.attr({
height: clipHeight
});
// Add navigation elements
if (!nav) {
this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group);
this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize)
.on('click', function () {
legend.scroll(-1, animation);
})
.add(nav);
this.pager = renderer.text('', 15, 10)
.css(navOptions.style)
.add(nav);
this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize)
.on('click', function () {
legend.scroll(1, animation);
})
.add(nav);
}
// Set initial position
legend.scroll(0);
legendHeight = spaceHeight;
} else if (nav) {
clipRect.attr({
height: chart.chartHeight
});
nav.hide();
this.scrollGroup.attr({
translateY: 1
});
this.clipHeight = 0; // #1379
}
return legendHeight;
},
/**
* Scroll the legend by a number of pages
* @param {Object} scrollBy
* @param {Object} animation
*/
scroll: function (scrollBy, animation) {
var pages = this.pages,
pageCount = pages.length,
currentPage = this.currentPage + scrollBy,
clipHeight = this.clipHeight,
navOptions = this.options.navigation,
activeColor = navOptions.activeColor,
inactiveColor = navOptions.inactiveColor,
pager = this.pager,
padding = this.padding,
scrollOffset;
// When resizing while looking at the last page
if (currentPage > pageCount) {
currentPage = pageCount;
}
if (currentPage > 0) {
if (animation !== UNDEFINED) {
setAnimation(animation, this.chart);
}
this.nav.attr({
translateX: padding,
translateY: clipHeight + this.padding + 7 + this.titleHeight,
visibility: VISIBLE
});
this.up.attr({
fill: currentPage === 1 ? inactiveColor : activeColor
})
.css({
cursor: currentPage === 1 ? 'default' : 'pointer'
});
pager.attr({
text: currentPage + '/' + pageCount
});
this.down.attr({
x: 18 + this.pager.getBBox().width, // adjust to text width
fill: currentPage === pageCount ? inactiveColor : activeColor
})
.css({
cursor: currentPage === pageCount ? 'default' : 'pointer'
});
scrollOffset = -pages[currentPage - 1] + this.initialItemY;
this.scrollGroup.animate({
translateY: scrollOffset
});
this.currentPage = currentPage;
this.positionCheckboxes(scrollOffset);
}
}
};
/*
* LegendSymbolMixin
*/
var LegendSymbolMixin = Highcharts.LegendSymbolMixin = {
/**
* Get the series' symbol in the legend
*
* @param {Object} legend The legend object
* @param {Object} item The series (this) or point
*/
drawRectangle: function (legend, item) {
var symbolHeight = legend.options.symbolHeight || 12;
item.legendSymbol = this.chart.renderer.rect(
0,
legend.baseline - 5 - (symbolHeight / 2),
legend.symbolWidth,
symbolHeight,
legend.options.symbolRadius || 0
).attr({
zIndex: 3
}).add(item.legendGroup);
},
/**
* Get the series' symbol in the legend. This method should be overridable to create custom
* symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols.
*
* @param {Object} legend The legend object
*/
drawLineMarker: function (legend) {
var options = this.options,
markerOptions = options.marker,
radius,
legendOptions = legend.options,
legendSymbol,
symbolWidth = legend.symbolWidth,
renderer = this.chart.renderer,
legendItemGroup = this.legendGroup,
verticalCenter = legend.baseline - mathRound(renderer.fontMetrics(legendOptions.itemStyle.fontSize, this.legendItem).b * 0.3),
attr;
// Draw the line
if (options.lineWidth) {
attr = {
'stroke-width': options.lineWidth
};
if (options.dashStyle) {
attr.dashstyle = options.dashStyle;
}
this.legendLine = renderer.path([
M,
0,
verticalCenter,
L,
symbolWidth,
verticalCenter
])
.attr(attr)
.add(legendItemGroup);
}
// Draw the marker
if (markerOptions && markerOptions.enabled !== false) {
radius = markerOptions.radius;
this.legendSymbol = legendSymbol = renderer.symbol(
this.symbol,
(symbolWidth / 2) - radius,
verticalCenter - radius,
2 * radius,
2 * radius
)
.add(legendItemGroup);
legendSymbol.isMarker = true;
}
}
};
// Workaround for #2030, horizontal legend items not displaying in IE11 Preview,
// and for #2580, a similar drawing flaw in Firefox 26.
// TODO: Explore if there's a general cause for this. The problem may be related
// to nested group elements, as the legend item texts are within 4 group elements.
if (/Trident\/7\.0/.test(userAgent) || isFirefox) {
wrap(Legend.prototype, 'positionItem', function (proceed, item) {
var legend = this,
runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030)
if (item._legendItemPos) {
proceed.call(legend, item);
}
};
// Do it now, for export and to get checkbox placement
runPositionItem();
// Do it after to work around the core issue
setTimeout(runPositionItem);
});
}
/**
* The chart class
* @param {Object} options
* @param {Function} callback Function to run when the chart has loaded
*/
var Chart = Highcharts.Chart = function () {
this.init.apply(this, arguments);
};
Chart.prototype = {
/**
* Hook for modules
*/
callbacks: [],
/**
* Initialize the chart
*/
init: function (userOptions, callback) {
// Handle regular options
var options,
seriesOptions = userOptions.series; // skip merging data points to increase performance
userOptions.series = null;
options = merge(defaultOptions, userOptions); // do the merge
options.series = userOptions.series = seriesOptions; // set back the series data
this.userOptions = userOptions;
var optionsChart = options.chart;
// Create margin & spacing array
this.margin = this.splashArray('margin', optionsChart);
this.spacing = this.splashArray('spacing', optionsChart);
var chartEvents = optionsChart.events;
//this.runChartClick = chartEvents && !!chartEvents.click;
this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom
this.callback = callback;
this.isResizing = 0;
this.options = options;
//chartTitleOptions = UNDEFINED;
//chartSubtitleOptions = UNDEFINED;
this.axes = [];
this.series = [];
this.hasCartesianSeries = optionsChart.showAxes;
//this.axisOffset = UNDEFINED;
//this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes
//this.inverted = UNDEFINED;
//this.loadingShown = UNDEFINED;
//this.container = UNDEFINED;
//this.chartWidth = UNDEFINED;
//this.chartHeight = UNDEFINED;
//this.marginRight = UNDEFINED;
//this.marginBottom = UNDEFINED;
//this.containerWidth = UNDEFINED;
//this.containerHeight = UNDEFINED;
//this.oldChartWidth = UNDEFINED;
//this.oldChartHeight = UNDEFINED;
//this.renderTo = UNDEFINED;
//this.renderToClone = UNDEFINED;
//this.spacingBox = UNDEFINED
//this.legend = UNDEFINED;
// Elements
//this.chartBackground = UNDEFINED;
//this.plotBackground = UNDEFINED;
//this.plotBGImage = UNDEFINED;
//this.plotBorder = UNDEFINED;
//this.loadingDiv = UNDEFINED;
//this.loadingSpan = UNDEFINED;
var chart = this,
eventType;
// Add the chart to the global lookup
chart.index = charts.length;
charts.push(chart);
chartCount++;
// Set up auto resize
if (optionsChart.reflow !== false) {
addEvent(chart, 'load', function () {
chart.initReflow();
});
}
// Chart event handlers
if (chartEvents) {
for (eventType in chartEvents) {
addEvent(chart, eventType, chartEvents[eventType]);
}
}
chart.xAxis = [];
chart.yAxis = [];
// Expose methods and variables
chart.animation = useCanVG ? false : pick(optionsChart.animation, true);
chart.pointCount = chart.colorCounter = chart.symbolCounter = 0;
chart.firstRender();
},
/**
* Initialize an individual series, called internally before render time
*/
initSeries: function (options) {
var chart = this,
optionsChart = chart.options.chart,
type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
series,
constr = seriesTypes[type];
// No such series type
if (!constr) {
error(17, true);
}
series = new constr();
series.init(this, options);
return series;
},
/**
* Check whether a given point is within the plot area
*
* @param {Number} plotX Pixel x relative to the plot area
* @param {Number} plotY Pixel y relative to the plot area
* @param {Boolean} inverted Whether the chart is inverted
*/
isInsidePlot: function (plotX, plotY, inverted) {
var x = inverted ? plotY : plotX,
y = inverted ? plotX : plotY;
return x >= 0 &&
x <= this.plotWidth &&
y >= 0 &&
y <= this.plotHeight;
},
/**
* Redraw legend, axes or series based on updated data
*
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
redraw: function (animation) {
var chart = this,
axes = chart.axes,
series = chart.series,
pointer = chart.pointer,
legend = chart.legend,
redrawLegend = chart.isDirtyLegend,
hasStackedSeries,
hasDirtyStacks,
hasCartesianSeries = chart.hasCartesianSeries,
isDirtyBox = chart.isDirtyBox, // todo: check if it has actually changed?
seriesLength = series.length,
i = seriesLength,
serie,
renderer = chart.renderer,
isHiddenChart = renderer.isHidden(),
afterRedraw = [];
setAnimation(animation, chart);
if (isHiddenChart) {
chart.cloneRenderTo();
}
// Adjust title layout (reflow multiline text)
chart.layOutTitles();
// link stacked series
while (i--) {
serie = series[i];
if (serie.options.stacking) {
hasStackedSeries = true;
if (serie.isDirty) {
hasDirtyStacks = true;
break;
}
}
}
if (hasDirtyStacks) { // mark others as dirty
i = seriesLength;
while (i--) {
serie = series[i];
if (serie.options.stacking) {
serie.isDirty = true;
}
}
}
// handle updated data in the series
each(series, function (serie) {
if (serie.isDirty) { // prepare the data so axis can read it
if (serie.options.legendType === 'point') {
redrawLegend = true;
}
}
});
// handle added or removed series
if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed
// draw legend graphics
legend.render();
chart.isDirtyLegend = false;
}
// reset stacks
if (hasStackedSeries) {
chart.getStacks();
}
if (hasCartesianSeries) {
if (!chart.isResizing) {
// reset maxTicks
chart.maxTicks = null;
// set axes scales
each(axes, function (axis) {
axis.setScale();
});
}
}
chart.getMargins(); // #3098
if (hasCartesianSeries) {
// If one axis is dirty, all axes must be redrawn (#792, #2169)
each(axes, function (axis) {
if (axis.isDirty) {
isDirtyBox = true;
}
});
// redraw axes
each(axes, function (axis) {
// Fire 'afterSetExtremes' only if extremes are set
if (axis.isDirtyExtremes) { // #821
axis.isDirtyExtremes = false;
afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119)
fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751
delete axis.eventArgs;
});
}
if (isDirtyBox || hasStackedSeries) {
axis.redraw();
}
});
}
// the plot areas size has changed
if (isDirtyBox) {
chart.drawChartBox();
}
// redraw affected series
each(series, function (serie) {
if (serie.isDirty && serie.visible &&
(!serie.isCartesian || serie.xAxis)) { // issue #153
serie.redraw();
}
});
// move tooltip or reset
if (pointer) {
pointer.reset(true);
}
// redraw if canvas
renderer.draw();
// fire the event
fireEvent(chart, 'redraw'); // jQuery breaks this when calling it from addEvent. Overwrites chart.redraw
if (isHiddenChart) {
chart.cloneRenderTo(true);
}
// Fire callbacks that are put on hold until after the redraw
each(afterRedraw, function (callback) {
callback.call();
});
},
/**
* Get an axis, series or point object by id.
* @param id {String} The id as given in the configuration options
*/
get: function (id) {
var chart = this,
axes = chart.axes,
series = chart.series;
var i,
j,
points;
// search axes
for (i = 0; i < axes.length; i++) {
if (axes[i].options.id === id) {
return axes[i];
}
}
// search series
for (i = 0; i < series.length; i++) {
if (series[i].options.id === id) {
return series[i];
}
}
// search points
for (i = 0; i < series.length; i++) {
points = series[i].points || [];
for (j = 0; j < points.length; j++) {
if (points[j].id === id) {
return points[j];
}
}
}
return null;
},
/**
* Create the Axis instances based on the config options
*/
getAxes: function () {
var chart = this,
options = this.options,
xAxisOptions = options.xAxis = splat(options.xAxis || {}),
yAxisOptions = options.yAxis = splat(options.yAxis || {}),
optionsArray,
axis;
// make sure the options are arrays and add some members
each(xAxisOptions, function (axis, i) {
axis.index = i;
axis.isX = true;
});
each(yAxisOptions, function (axis, i) {
axis.index = i;
});
// concatenate all axis options into one array
optionsArray = xAxisOptions.concat(yAxisOptions);
each(optionsArray, function (axisOptions) {
axis = new Axis(chart, axisOptions);
});
},
/**
* Get the currently selected points from all series
*/
getSelectedPoints: function () {
var points = [];
each(this.series, function (serie) {
points = points.concat(grep(serie.points || [], function (point) {
return point.selected;
}));
});
return points;
},
/**
* Get the currently selected series
*/
getSelectedSeries: function () {
return grep(this.series, function (serie) {
return serie.selected;
});
},
/**
* Generate stacks for each series and calculate stacks total values
*/
getStacks: function () {
var chart = this;
// reset stacks for each yAxis
each(chart.yAxis, function (axis) {
if (axis.stacks && axis.hasVisibleSeries) {
axis.oldStacks = axis.stacks;
}
});
each(chart.series, function (series) {
if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) {
series.stackKey = series.type + pick(series.options.stack, '');
}
});
},
/**
* Show the title and subtitle of the chart
*
* @param titleOptions {Object} New title options
* @param subtitleOptions {Object} New subtitle options
*
*/
setTitle: function (titleOptions, subtitleOptions, redraw) {
var chart = this,
options = chart.options,
chartTitleOptions,
chartSubtitleOptions;
chartTitleOptions = options.title = merge(options.title, titleOptions);
chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions);
// add title and subtitle
each([
['title', titleOptions, chartTitleOptions],
['subtitle', subtitleOptions, chartSubtitleOptions]
], function (arr) {
var name = arr[0],
title = chart[name],
titleOptions = arr[1],
chartTitleOptions = arr[2];
if (title && titleOptions) {
chart[name] = title = title.destroy(); // remove old
}
if (chartTitleOptions && chartTitleOptions.text && !title) {
chart[name] = chart.renderer.text(
chartTitleOptions.text,
0,
0,
chartTitleOptions.useHTML
)
.attr({
align: chartTitleOptions.align,
'class': PREFIX + name,
zIndex: chartTitleOptions.zIndex || 4
})
.css(chartTitleOptions.style)
.add();
}
});
chart.layOutTitles(redraw);
},
/**
* Lay out the chart titles and cache the full offset height for use in getMargins
*/
layOutTitles: function (redraw) {
var titleOffset = 0,
title = this.title,
subtitle = this.subtitle,
options = this.options,
titleOptions = options.title,
subtitleOptions = options.subtitle,
requiresDirtyBox,
renderer = this.renderer,
autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button
if (title) {
title
.css({ width: (titleOptions.width || autoWidth) + PX })
.align(extend({
y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3
}, titleOptions), false, 'spacingBox');
if (!titleOptions.floating && !titleOptions.verticalAlign) {
titleOffset = title.getBBox().height;
}
}
if (subtitle) {
subtitle
.css({ width: (subtitleOptions.width || autoWidth) + PX })
.align(extend({
y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(titleOptions.style.fontSize, subtitle).b
}, subtitleOptions), false, 'spacingBox');
if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {
titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);
}
}
requiresDirtyBox = this.titleOffset !== titleOffset;
this.titleOffset = titleOffset; // used in getMargins
if (!this.isDirtyBox && requiresDirtyBox) {
this.isDirtyBox = requiresDirtyBox;
// Redraw if necessary (#2719, #2744)
if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) {
this.redraw();
}
}
},
/**
* Get chart width and height according to options and container size
*/
getChartSize: function () {
var chart = this,
optionsChart = chart.options.chart,
widthOption = optionsChart.width,
heightOption = optionsChart.height,
renderTo = chart.renderToClone || chart.renderTo;
// get inner width and height from jQuery (#824)
if (!defined(widthOption)) {
chart.containerWidth = adapterRun(renderTo, 'width');
}
if (!defined(heightOption)) {
chart.containerHeight = adapterRun(renderTo, 'height');
}
chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460
chart.chartHeight = mathMax(0, pick(heightOption,
// the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:
chart.containerHeight > 19 ? chart.containerHeight : 400));
},
/**
* Create a clone of the chart's renderTo div and place it outside the viewport to allow
* size computation on chart.render and chart.redraw
*/
cloneRenderTo: function (revert) {
var clone = this.renderToClone,
container = this.container;
// Destroy the clone and bring the container back to the real renderTo div
if (revert) {
if (clone) {
this.renderTo.appendChild(container);
discardElement(clone);
delete this.renderToClone;
}
// Set up the clone
} else {
if (container && container.parentNode === this.renderTo) {
this.renderTo.removeChild(container); // do not clone this
}
this.renderToClone = clone = this.renderTo.cloneNode(0);
css(clone, {
position: ABSOLUTE,
top: '-9999px',
display: 'block' // #833
});
if (clone.style.setProperty) { // #2631
clone.style.setProperty('display', 'block', 'important');
}
doc.body.appendChild(clone);
if (container) {
clone.appendChild(container);
}
}
},
/**
* Get the containing element, determine the size and create the inner container
* div to hold the chart
*/
getContainer: function () {
var chart = this,
container,
optionsChart = chart.options.chart,
chartWidth,
chartHeight,
renderTo,
indexAttrName = 'data-highcharts-chart',
oldChartIndex,
containerId;
chart.renderTo = renderTo = optionsChart.renderTo;
containerId = PREFIX + idCounter++;
if (isString(renderTo)) {
chart.renderTo = renderTo = doc.getElementById(renderTo);
}
// Display an error if the renderTo is wrong
if (!renderTo) {
error(13, true);
}
// If the container already holds a chart, destroy it. The check for hasRendered is there
// because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart
// attribute and the SVG contents, but not an interactive chart. So in this case,
// charts[oldChartIndex] will point to the wrong chart if any (#2609).
oldChartIndex = pInt(attr(renderTo, indexAttrName));
if (!isNaN(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) {
charts[oldChartIndex].destroy();
}
// Make a reference to the chart from the div
attr(renderTo, indexAttrName, chart.index);
// remove previous chart
renderTo.innerHTML = '';
// If the container doesn't have an offsetWidth, it has or is a child of a node
// that has display:none. We need to temporarily move it out to a visible
// state to determine the size, else the legend and tooltips won't render
// properly. The allowClone option is used in sparklines as a micro optimization,
// saving about 1-2 ms each chart.
if (!optionsChart.skipClone && !renderTo.offsetWidth) {
chart.cloneRenderTo();
}
// get the width and height
chart.getChartSize();
chartWidth = chart.chartWidth;
chartHeight = chart.chartHeight;
// create the inner container
chart.container = container = createElement(DIV, {
className: PREFIX + 'container' +
(optionsChart.className ? ' ' + optionsChart.className : ''),
id: containerId
}, extend({
position: RELATIVE,
overflow: HIDDEN, // needed for context menu (avoid scrollbars) and
// content overflow in IE
width: chartWidth + PX,
height: chartHeight + PX,
textAlign: 'left',
lineHeight: 'normal', // #427
zIndex: 0, // #1072
'-webkit-tap-highlight-color': 'rgba(0,0,0,0)'
}, optionsChart.style),
chart.renderToClone || renderTo
);
// cache the cursor (#1650)
chart._cursor = container.style.cursor;
// Initialize the renderer
chart.renderer =
optionsChart.forExport ? // force SVG, used for SVG export
new SVGRenderer(container, chartWidth, chartHeight, optionsChart.style, true) :
new Renderer(container, chartWidth, chartHeight, optionsChart.style);
if (useCanVG) {
// If we need canvg library, extend and configure the renderer
// to get the tracker for translating mouse events
chart.renderer.create(chart, container, chartWidth, chartHeight);
}
// Add a reference to the charts index
chart.renderer.chartIndex = chart.index;
},
/**
* Calculate margins by rendering axis labels in a preliminary position. Title,
* subtitle and legend have already been rendered at this stage, but will be
* moved into their final positions
*/
getMargins: function (skipAxes) {
var chart = this,
spacing = chart.spacing,
margin = chart.margin,
titleOffset = chart.titleOffset;
chart.resetMargins();
// Adjust for title and subtitle
if (titleOffset && !defined(margin[0])) {
chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]);
}
// Adjust for legend
chart.legend.adjustMargins(margin, spacing);
// adjust for scroller
if (chart.extraBottomMargin) {
chart.marginBottom += chart.extraBottomMargin;
}
if (chart.extraTopMargin) {
chart.plotTop += chart.extraTopMargin;
}
if (!skipAxes) {
this.getAxisMargins();
}
},
getAxisMargins: function () {
var chart = this,
axisOffset = chart.axisOffset = [0, 0, 0, 0], // top, right, bottom, left
margin = chart.margin;
// pre-render axes to get labels offset width
if (chart.hasCartesianSeries) {
each(chart.axes, function (axis) {
axis.getOffset();
});
}
// Add the axis offsets
each(marginNames, function (m, side) {
if (!defined(margin[side])) {
chart[m] += axisOffset[side];
}
});
chart.setChartSize();
},
/**
* Resize the chart to its container if size is not explicitly set
*/
reflow: function (e) {
var chart = this,
optionsChart = chart.options.chart,
renderTo = chart.renderTo,
width = optionsChart.width || adapterRun(renderTo, 'width'),
height = optionsChart.height || adapterRun(renderTo, 'height'),
target = e ? e.target : win, // #805 - MooTools doesn't supply e
doReflow = function () {
if (chart.container) { // It may have been destroyed in the meantime (#1257)
chart.setSize(width, height, false);
chart.hasUserSize = null;
}
};
// Width and height checks for display:none. Target is doc in IE8 and Opera,
// win in Firefox, Chrome and IE9.
if (!chart.hasUserSize && width && height && (target === win || target === doc)) {
if (width !== chart.containerWidth || height !== chart.containerHeight) {
clearTimeout(chart.reflowTimeout);
if (e) { // Called from window.resize
chart.reflowTimeout = setTimeout(doReflow, 100);
} else { // Called directly (#2224)
doReflow();
}
}
chart.containerWidth = width;
chart.containerHeight = height;
}
},
/**
* Add the event handlers necessary for auto resizing
*/
initReflow: function () {
var chart = this,
reflow = function (e) {
chart.reflow(e);
};
addEvent(win, 'resize', reflow);
addEvent(chart, 'destroy', function () {
removeEvent(win, 'resize', reflow);
});
},
/**
* Resize the chart to a given width and height
* @param {Number} width
* @param {Number} height
* @param {Object|Boolean} animation
*/
setSize: function (width, height, animation) {
var chart = this,
chartWidth,
chartHeight,
fireEndResize;
// Handle the isResizing counter
chart.isResizing += 1;
fireEndResize = function () {
if (chart) {
fireEvent(chart, 'endResize', null, function () {
chart.isResizing -= 1;
});
}
};
// set the animation for the current process
setAnimation(animation, chart);
chart.oldChartHeight = chart.chartHeight;
chart.oldChartWidth = chart.chartWidth;
if (defined(width)) {
chart.chartWidth = chartWidth = mathMax(0, mathRound(width));
chart.hasUserSize = !!chartWidth;
}
if (defined(height)) {
chart.chartHeight = chartHeight = mathMax(0, mathRound(height));
}
// Resize the container with the global animation applied if enabled (#2503)
(globalAnimation ? animate : css)(chart.container, {
width: chartWidth + PX,
height: chartHeight + PX
}, globalAnimation);
chart.setChartSize(true);
chart.renderer.setSize(chartWidth, chartHeight, animation);
// handle axes
chart.maxTicks = null;
each(chart.axes, function (axis) {
axis.isDirty = true;
axis.setScale();
});
// make sure non-cartesian series are also handled
each(chart.series, function (serie) {
serie.isDirty = true;
});
chart.isDirtyLegend = true; // force legend redraw
chart.isDirtyBox = true; // force redraw of plot and chart border
chart.layOutTitles(); // #2857
chart.getMargins();
chart.redraw(animation);
chart.oldChartHeight = null;
fireEvent(chart, 'resize');
// fire endResize and set isResizing back
// If animation is disabled, fire without delay
if (globalAnimation === false) {
fireEndResize();
} else { // else set a timeout with the animation duration
setTimeout(fireEndResize, (globalAnimation && globalAnimation.duration) || 500);
}
},
/**
* Set the public chart properties. This is done before and after the pre-render
* to determine margin sizes
*/
setChartSize: function (skipAxes) {
var chart = this,
inverted = chart.inverted,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
optionsChart = chart.options.chart,
spacing = chart.spacing,
clipOffset = chart.clipOffset,
clipX,
clipY,
plotLeft,
plotTop,
plotWidth,
plotHeight,
plotBorderWidth;
chart.plotLeft = plotLeft = mathRound(chart.plotLeft);
chart.plotTop = plotTop = mathRound(chart.plotTop);
chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight));
chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom));
chart.plotSizeX = inverted ? plotHeight : plotWidth;
chart.plotSizeY = inverted ? plotWidth : plotHeight;
chart.plotBorderWidth = optionsChart.plotBorderWidth || 0;
// Set boxes used for alignment
chart.spacingBox = renderer.spacingBox = {
x: spacing[3],
y: spacing[0],
width: chartWidth - spacing[3] - spacing[1],
height: chartHeight - spacing[0] - spacing[2]
};
chart.plotBox = renderer.plotBox = {
x: plotLeft,
y: plotTop,
width: plotWidth,
height: plotHeight
};
plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2);
clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2);
clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2);
chart.clipBox = {
x: clipX,
y: clipY,
width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX),
height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY))
};
if (!skipAxes) {
each(chart.axes, function (axis) {
axis.setAxisSize();
axis.setAxisTranslation();
});
}
},
/**
* Initial margins before auto size margins are applied
*/
resetMargins: function () {
var chart = this;
each(marginNames, function (m, side) {
chart[m] = pick(chart.margin[side], chart.spacing[side]);
});
chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left
chart.clipOffset = [0, 0, 0, 0];
},
/**
* Draw the borders and backgrounds for chart and plot area
*/
drawChartBox: function () {
var chart = this,
optionsChart = chart.options.chart,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
chartBackground = chart.chartBackground,
plotBackground = chart.plotBackground,
plotBorder = chart.plotBorder,
plotBGImage = chart.plotBGImage,
chartBorderWidth = optionsChart.borderWidth || 0,
chartBackgroundColor = optionsChart.backgroundColor,
plotBackgroundColor = optionsChart.plotBackgroundColor,
plotBackgroundImage = optionsChart.plotBackgroundImage,
plotBorderWidth = optionsChart.plotBorderWidth || 0,
mgn,
bgAttr,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
plotBox = chart.plotBox,
clipRect = chart.clipRect,
clipBox = chart.clipBox;
// Chart area
mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0);
if (chartBorderWidth || chartBackgroundColor) {
if (!chartBackground) {
bgAttr = {
fill: chartBackgroundColor || NONE
};
if (chartBorderWidth) { // #980
bgAttr.stroke = optionsChart.borderColor;
bgAttr['stroke-width'] = chartBorderWidth;
}
chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn,
optionsChart.borderRadius, chartBorderWidth)
.attr(bgAttr)
.addClass(PREFIX + 'background')
.add()
.shadow(optionsChart.shadow);
} else { // resize
chartBackground.animate(
chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn })
);
}
}
// Plot background
if (plotBackgroundColor) {
if (!plotBackground) {
chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0)
.attr({
fill: plotBackgroundColor
})
.add()
.shadow(optionsChart.plotShadow);
} else {
plotBackground.animate(plotBox);
}
}
if (plotBackgroundImage) {
if (!plotBGImage) {
chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight)
.add();
} else {
plotBGImage.animate(plotBox);
}
}
// Plot clip
if (!clipRect) {
chart.clipRect = renderer.clipRect(clipBox);
} else {
clipRect.animate({
width: clipBox.width,
height: clipBox.height
});
}
// Plot area border
if (plotBorderWidth) {
if (!plotBorder) {
chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth)
.attr({
stroke: optionsChart.plotBorderColor,
'stroke-width': plotBorderWidth,
fill: NONE,
zIndex: 1
})
.add();
} else {
plotBorder.animate(
plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight, strokeWidth: -plotBorderWidth }) //#3282 plotBorder should be negative
);
}
}
// reset
chart.isDirtyBox = false;
},
/**
* Detect whether a certain chart property is needed based on inspecting its options
* and series. This mainly applies to the chart.invert property, and in extensions to
* the chart.angular and chart.polar properties.
*/
propFromSeries: function () {
var chart = this,
optionsChart = chart.options.chart,
klass,
seriesOptions = chart.options.series,
i,
value;
each(['inverted', 'angular', 'polar'], function (key) {
// The default series type's class
klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType];
// Get the value from available chart-wide properties
value = (
chart[key] || // 1. it is set before
optionsChart[key] || // 2. it is set in the options
(klass && klass.prototype[key]) // 3. it's default series class requires it
);
// 4. Check if any the chart's series require it
i = seriesOptions && seriesOptions.length;
while (!value && i--) {
klass = seriesTypes[seriesOptions[i].type];
if (klass && klass.prototype[key]) {
value = true;
}
}
// Set the chart property
chart[key] = value;
});
},
/**
* Link two or more series together. This is done initially from Chart.render,
* and after Chart.addSeries and Series.remove.
*/
linkSeries: function () {
var chart = this,
chartSeries = chart.series;
// Reset links
each(chartSeries, function (series) {
series.linkedSeries.length = 0;
});
// Apply new links
each(chartSeries, function (series) {
var linkedTo = series.options.linkedTo;
if (isString(linkedTo)) {
if (linkedTo === ':previous') {
linkedTo = chart.series[series.index - 1];
} else {
linkedTo = chart.get(linkedTo);
}
if (linkedTo) {
linkedTo.linkedSeries.push(series);
series.linkedParent = linkedTo;
}
}
});
},
/**
* Render series for the chart
*/
renderSeries: function () {
each(this.series, function (serie) {
serie.translate();
serie.render();
});
},
/**
* Render labels for the chart
*/
renderLabels: function () {
var chart = this,
labels = chart.options.labels;
if (labels.items) {
each(labels.items, function (label) {
var style = extend(labels.style, label.style),
x = pInt(style.left) + chart.plotLeft,
y = pInt(style.top) + chart.plotTop + 12;
// delete to prevent rewriting in IE
delete style.left;
delete style.top;
chart.renderer.text(
label.html,
x,
y
)
.attr({ zIndex: 2 })
.css(style)
.add();
});
}
},
/**
* Render all graphics for the chart
*/
render: function () {
var chart = this,
axes = chart.axes,
renderer = chart.renderer,
options = chart.options,
tempWidth,
tempHeight,
redoHorizontal,
redoVertical;
// Title
chart.setTitle();
// Legend
chart.legend = new Legend(chart, options.legend);
chart.getStacks(); // render stacks
// Get chart margins
chart.getMargins(true);
chart.setChartSize();
// Record preliminary dimensions for later comparison
tempWidth = chart.plotWidth;
tempHeight = chart.plotHeight = chart.plotHeight - 13; // 13 is the most common height of X axis labels
// Get margins by pre-rendering axes
each(axes, function (axis) {
axis.setScale();
});
chart.getAxisMargins();
// If the plot area size has changed significantly, calculate tick positions again
redoHorizontal = tempWidth / chart.plotWidth > 1.2;
redoVertical = tempHeight / chart.plotHeight > 1.1;
if (redoHorizontal || redoVertical) {
chart.maxTicks = null; // reset for second pass
each(axes, function (axis) {
if ((axis.horiz && redoHorizontal) || (!axis.horiz && redoVertical)) {
axis.setTickInterval(true); // update to reflect the new margins
}
});
chart.getMargins(); // second pass to check for new labels
}
// Draw the borders and backgrounds
chart.drawChartBox();
// Axes
if (chart.hasCartesianSeries) {
each(axes, function (axis) {
axis.render();
});
}
// The series
if (!chart.seriesGroup) {
chart.seriesGroup = renderer.g('series-group')
.attr({ zIndex: 3 })
.add();
}
chart.renderSeries();
// Labels
chart.renderLabels();
// Credits
chart.showCredits(options.credits);
// Set flag
chart.hasRendered = true;
},
/**
* Show chart credits based on config options
*/
showCredits: function (credits) {
if (credits.enabled && !this.credits) {
this.credits = this.renderer.text(
credits.text,
0,
0
)
.on('click', function () {
if (credits.href) {
location.href = credits.href;
}
})
.attr({
align: credits.position.align,
zIndex: 8
})
.css(credits.style)
.add()
.align(credits.position);
}
},
/**
* Clean up memory usage
*/
destroy: function () {
var chart = this,
axes = chart.axes,
series = chart.series,
container = chart.container,
i,
parentNode = container && container.parentNode;
// fire the chart.destoy event
fireEvent(chart, 'destroy');
// Delete the chart from charts lookup array
charts[chart.index] = UNDEFINED;
chartCount--;
chart.renderTo.removeAttribute('data-highcharts-chart');
// remove events
removeEvent(chart);
// ==== Destroy collections:
// Destroy axes
i = axes.length;
while (i--) {
axes[i] = axes[i].destroy();
}
// Destroy each series
i = series.length;
while (i--) {
series[i] = series[i].destroy();
}
// ==== Destroy chart properties:
each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage',
'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller',
'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) {
var prop = chart[name];
if (prop && prop.destroy) {
chart[name] = prop.destroy();
}
});
// remove container and all SVG
if (container) { // can break in IE when destroyed before finished loading
container.innerHTML = '';
removeEvent(container);
if (parentNode) {
discardElement(container);
}
}
// clean it all up
for (i in chart) {
delete chart[i];
}
},
/**
* VML namespaces can't be added until after complete. Listening
* for Perini's doScroll hack is not enough.
*/
isReadyToRender: function () {
var chart = this;
// Note: in spite of JSLint's complaints, win == win.top is required
/*jslint eqeq: true*/
if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) {
/*jslint eqeq: false*/
if (useCanVG) {
// Delay rendering until canvg library is downloaded and ready
CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL);
} else {
doc.attachEvent('onreadystatechange', function () {
doc.detachEvent('onreadystatechange', chart.firstRender);
if (doc.readyState === 'complete') {
chart.firstRender();
}
});
}
return false;
}
return true;
},
/**
* Prepare for first rendering after all data are loaded
*/
firstRender: function () {
var chart = this,
options = chart.options,
callback = chart.callback;
// Check whether the chart is ready to render
if (!chart.isReadyToRender()) {
return;
}
// Create the container
chart.getContainer();
// Run an early event after the container and renderer are established
fireEvent(chart, 'init');
chart.resetMargins();
chart.setChartSize();
// Set the common chart properties (mainly invert) from the given series
chart.propFromSeries();
// get axes
chart.getAxes();
// Initialize the series
each(options.series || [], function (serieOptions) {
chart.initSeries(serieOptions);
});
chart.linkSeries();
// Run an event after axes and series are initialized, but before render. At this stage,
// the series data is indexed and cached in the xData and yData arrays, so we can access
// those before rendering. Used in Highstock.
fireEvent(chart, 'beforeRender');
// depends on inverted and on margins being set
if (Highcharts.Pointer) {
chart.pointer = new Pointer(chart, options);
}
chart.render();
// add canvas
chart.renderer.draw();
// run callbacks
if (callback) {
callback.apply(chart, [chart]);
}
each(chart.callbacks, function (fn) {
if (chart.index !== UNDEFINED) { // Chart destroyed in its own callback (#3600)
fn.apply(chart, [chart]);
}
});
// Fire the load event
fireEvent(chart, 'load');
// If the chart was rendered outside the top container, put it back in (#3679)
chart.cloneRenderTo(true);
},
/**
* Creates arrays for spacing and margin from given options.
*/
splashArray: function (target, options) {
var oVar = options[target],
tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar];
return [pick(options[target + 'Top'], tArray[0]),
pick(options[target + 'Right'], tArray[1]),
pick(options[target + 'Bottom'], tArray[2]),
pick(options[target + 'Left'], tArray[3])];
}
}; // end Chart
var CenteredSeriesMixin = Highcharts.CenteredSeriesMixin = {
/**
* Get the center of the pie based on the size and center options relative to the
* plot area. Borrowed by the polar and gauge series types.
*/
getCenter: function () {
var options = this.options,
chart = this.chart,
slicingRoom = 2 * (options.slicedOffset || 0),
handleSlicingRoom,
plotWidth = chart.plotWidth - 2 * slicingRoom,
plotHeight = chart.plotHeight - 2 * slicingRoom,
centerOption = options.center,
positions = [pick(centerOption[0], '50%'), pick(centerOption[1], '50%'), options.size || '100%', options.innerSize || 0],
smallestSize = mathMin(plotWidth, plotHeight),
isPercent,
i,
value;
for (i = 0; i < 4; ++i) {
value = positions[i];
isPercent = /%$/.test(value);
handleSlicingRoom = i < 2 || (i === 2 && isPercent);
positions[i] = (isPercent ?
// i == 0: centerX, relative to width
// i == 1: centerY, relative to height
// i == 2: size, relative to smallestSize
// i == 3: innerSize, relative to size
[plotWidth, plotHeight, smallestSize, positions[2]][i] *
pInt(value) / 100 :
pInt(value)) + (handleSlicingRoom ? slicingRoom : 0);
}
return positions;
}
};
/**
* The Point object and prototype. Inheritable and used as base for PiePoint
*/
var Point = function () {};
Point.prototype = {
/**
* Initialize the point
* @param {Object} series The series object containing this point
* @param {Object} options The data in either number, array or object format
*/
init: function (series, options, x) {
var point = this,
colors;
point.series = series;
point.color = series.color; // #3445
point.applyOptions(options, x);
point.pointAttr = {};
if (series.options.colorByPoint) {
colors = series.options.colors || series.chart.options.colors;
point.color = point.color || colors[series.colorCounter++];
// loop back to zero
if (series.colorCounter === colors.length) {
series.colorCounter = 0;
}
}
series.chart.pointCount++;
return point;
},
/**
* Apply the options containing the x and y data and possible some extra properties.
* This is called on point init or from point.update.
*
* @param {Object} options
*/
applyOptions: function (options, x) {
var point = this,
series = point.series,
pointValKey = series.options.pointValKey || series.pointValKey;
options = Point.prototype.optionsToObject.call(this, options);
// copy options directly to point
extend(point, options);
point.options = point.options ? extend(point.options, options) : options;
// For higher dimension series types. For instance, for ranges, point.y is mapped to point.low.
if (pointValKey) {
point.y = point[pointValKey];
}
// If no x is set by now, get auto incremented value. All points must have an
// x value, however the y value can be null to create a gap in the series
if (point.x === UNDEFINED && series) {
point.x = x === UNDEFINED ? series.autoIncrement() : x;
}
return point;
},
/**
* Transform number or array configs into objects
*/
optionsToObject: function (options) {
var ret = {},
series = this.series,
pointArrayMap = series.pointArrayMap || ['y'],
valueCount = pointArrayMap.length,
firstItemType,
i = 0,
j = 0;
if (typeof options === 'number' || options === null) {
ret[pointArrayMap[0]] = options;
} else if (isArray(options)) {
// with leading x value
if (options.length > valueCount) {
firstItemType = typeof options[0];
if (firstItemType === 'string') {
ret.name = options[0];
} else if (firstItemType === 'number') {
ret.x = options[0];
}
i++;
}
while (j < valueCount) {
ret[pointArrayMap[j++]] = options[i++];
}
} else if (typeof options === 'object') {
ret = options;
// This is the fastest way to detect if there are individual point dataLabels that need
// to be considered in drawDataLabels. These can only occur in object configs.
if (options.dataLabels) {
series._hasPointLabels = true;
}
// Same approach as above for markers
if (options.marker) {
series._hasPointMarkers = true;
}
}
return ret;
},
/**
* Destroy a point to clear memory. Its reference still stays in series.data.
*/
destroy: function () {
var point = this,
series = point.series,
chart = series.chart,
hoverPoints = chart.hoverPoints,
prop;
chart.pointCount--;
if (hoverPoints) {
point.setState();
erase(hoverPoints, point);
if (!hoverPoints.length) {
chart.hoverPoints = null;
}
}
if (point === chart.hoverPoint) {
point.onMouseOut();
}
// remove all events
if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive
removeEvent(point);
point.destroyElements();
}
if (point.legendItem) { // pies have legend items
chart.legend.destroyItem(point);
}
for (prop in point) {
point[prop] = null;
}
},
/**
* Destroy SVG elements associated with the point
*/
destroyElements: function () {
var point = this,
props = ['graphic', 'dataLabel', 'dataLabelUpper', 'group', 'connector', 'shadowGroup'],
prop,
i = 6;
while (i--) {
prop = props[i];
if (point[prop]) {
point[prop] = point[prop].destroy();
}
}
},
/**
* Return the configuration hash needed for the data label and tooltip formatters
*/
getLabelConfig: function () {
var point = this;
return {
x: point.category,
y: point.y,
key: point.name || point.category,
series: point.series,
point: point,
percentage: point.percentage,
total: point.total || point.stackTotal
};
},
/**
* Extendable method for formatting each point's tooltip line
*
* @return {String} A string to be concatenated in to the common tooltip text
*/
tooltipFormatter: function (pointFormat) {
// Insert options for valueDecimals, valuePrefix, and valueSuffix
var series = this.series,
seriesTooltipOptions = series.tooltipOptions,
valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''),
valuePrefix = seriesTooltipOptions.valuePrefix || '',
valueSuffix = seriesTooltipOptions.valueSuffix || '';
// Loop over the point array map and replace unformatted values with sprintf formatting markup
each(series.pointArrayMap || ['y'], function (key) {
key = '{point.' + key; // without the closing bracket
if (valuePrefix || valueSuffix) {
pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix);
}
pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}');
});
return format(pointFormat, {
point: this,
series: this.series
});
},
/**
* Fire an event on the Point object. Must not be renamed to fireEvent, as this
* causes a name clash in MooTools
* @param {String} eventType
* @param {Object} eventArgs Additional event arguments
* @param {Function} defaultFunction Default event handler
*/
firePointEvent: function (eventType, eventArgs, defaultFunction) {
var point = this,
series = this.series,
seriesOptions = series.options;
// load event handlers on demand to save time on mouseover/out
if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) {
this.importEvents();
}
// add default handler if in selection mode
if (eventType === 'click' && seriesOptions.allowPointSelect) {
defaultFunction = function (event) {
// Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera
point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);
};
}
fireEvent(this, eventType, eventArgs, defaultFunction);
}
};/**
* @classDescription The base function which all other series types inherit from. The data in the series is stored
* in various arrays.
*
* - First, series.options.data contains all the original config options for
* each point whether added by options or methods like series.addPoint.
* - Next, series.data contains those values converted to points, but in case the series data length
* exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It
* only contains the points that have been created on demand.
* - Then there's series.points that contains all currently visible point objects. In case of cropping,
* the cropped-away points are not part of this array. The series.points array starts at series.cropStart
* compared to series.data and series.options.data. If however the series data is grouped, these can't
* be correlated one to one.
* - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points.
* - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points.
*
* @param {Object} chart
* @param {Object} options
*/
var Series = Highcharts.Series = function () {};
Series.prototype = {
isCartesian: true,
type: 'line',
pointClass: Point,
sorted: true, // requires the data to be sorted
requireSorting: true,
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'lineColor',
'stroke-width': 'lineWidth',
fill: 'fillColor',
r: 'radius'
},
axisTypes: ['xAxis', 'yAxis'],
colorCounter: 0,
parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData
init: function (chart, options) {
var series = this,
eventType,
events,
chartSeries = chart.series,
sortByIndex = function (a, b) {
return pick(a.options.index, a._i) - pick(b.options.index, b._i);
};
series.chart = chart;
series.options = options = series.setOptions(options); // merge with plotOptions
series.linkedSeries = [];
// bind the axes
series.bindAxes();
// set some variables
extend(series, {
name: options.name,
state: NORMAL_STATE,
pointAttr: {},
visible: options.visible !== false, // true by default
selected: options.selected === true // false by default
});
// special
if (useCanVG) {
options.animation = false;
}
// register event listeners
events = options.events;
for (eventType in events) {
addEvent(series, eventType, events[eventType]);
}
if (
(events && events.click) ||
(options.point && options.point.events && options.point.events.click) ||
options.allowPointSelect
) {
chart.runTrackerClick = true;
}
series.getColor();
series.getSymbol();
// Set the data
each(series.parallelArrays, function (key) {
series[key + 'Data'] = [];
});
series.setData(options.data, false);
// Mark cartesian
if (series.isCartesian) {
chart.hasCartesianSeries = true;
}
// Register it in the chart
chartSeries.push(series);
series._i = chartSeries.length - 1;
// Sort series according to index option (#248, #1123, #2456)
stableSort(chartSeries, sortByIndex);
if (this.yAxis) {
stableSort(this.yAxis.series, sortByIndex);
}
each(chartSeries, function (series, i) {
series.index = i;
series.name = series.name || 'Series ' + (i + 1);
});
},
/**
* Set the xAxis and yAxis properties of cartesian series, and register the series
* in the axis.series array
*/
bindAxes: function () {
var series = this,
seriesOptions = series.options,
chart = series.chart,
axisOptions;
each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis
each(chart[AXIS], function (axis) { // loop through the chart's axis objects
axisOptions = axis.options;
// apply if the series xAxis or yAxis option mathches the number of the
// axis, or if undefined, use the first axis
if ((seriesOptions[AXIS] === axisOptions.index) ||
(seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) ||
(seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) {
// register this series in the axis.series lookup
axis.series.push(series);
// set this series.xAxis or series.yAxis reference
series[AXIS] = axis;
// mark dirty for redraw
axis.isDirty = true;
}
});
// The series needs an X and an Y axis
if (!series[AXIS] && series.optionalAxis !== AXIS) {
error(18, true);
}
});
},
/**
* For simple series types like line and column, the data values are held in arrays like
* xData and yData for quick lookup to find extremes and more. For multidimensional series
* like bubble and map, this can be extended with arrays like zData and valueData by
* adding to the series.parallelArrays array.
*/
updateParallelArrays: function (point, i) {
var series = point.series,
args = arguments,
fn = typeof i === 'number' ?
// Insert the value in the given position
function (key) {
var val = key === 'y' && series.toYData ? series.toYData(point) : point[key];
series[key + 'Data'][i] = val;
} :
// Apply the method specified in i with the following arguments as arguments
function (key) {
Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2));
};
each(series.parallelArrays, fn);
},
/**
* Return an auto incremented x value based on the pointStart and pointInterval options.
* This is only used if an x value is not given for the point that calls autoIncrement.
*/
autoIncrement: function () {
var options = this.options,
xIncrement = this.xIncrement,
date,
pointInterval,
pointIntervalUnit = options.pointIntervalUnit;
xIncrement = pick(xIncrement, options.pointStart, 0);
this.pointInterval = pointInterval = pick(this.pointInterval, options.pointInterval, 1);
// Added code for pointInterval strings
if (pointIntervalUnit === 'month' || pointIntervalUnit === 'year') {
date = new Date(xIncrement);
date = (pointIntervalUnit === 'month') ?
+date[setMonth](date[getMonth]() + pointInterval) :
+date[setFullYear](date[getFullYear]() + pointInterval);
pointInterval = date - xIncrement;
}
this.xIncrement = xIncrement + pointInterval;
return xIncrement;
},
/**
* Divide the series data into segments divided by null values.
*/
getSegments: function () {
var series = this,
lastNull = -1,
segments = [],
i,
points = series.points,
pointsLength = points.length;
if (pointsLength) { // no action required for []
// if connect nulls, just remove null points
if (series.options.connectNulls) {
i = pointsLength;
while (i--) {
if (points[i].y === null) {
points.splice(i, 1);
}
}
if (points.length) {
segments = [points];
}
// else, split on null points
} else {
each(points, function (point, i) {
if (point.y === null) {
if (i > lastNull + 1) {
segments.push(points.slice(lastNull + 1, i));
}
lastNull = i;
} else if (i === pointsLength - 1) { // last value
segments.push(points.slice(lastNull + 1, i + 1));
}
});
}
}
// register it
series.segments = segments;
},
/**
* Set the series options by merging from the options tree
* @param {Object} itemOptions
*/
setOptions: function (itemOptions) {
var chart = this.chart,
chartOptions = chart.options,
plotOptions = chartOptions.plotOptions,
userOptions = chart.userOptions || {},
userPlotOptions = userOptions.plotOptions || {},
typeOptions = plotOptions[this.type],
options,
zones;
this.userOptions = itemOptions;
// General series options take precedence over type options because otherwise, default
// type options like column.animation would be overwritten by the general option.
// But issues have been raised here (#3881), and the solution may be to distinguish
// between default option and userOptions like in the tooltip below.
options = merge(
typeOptions,
plotOptions.series,
itemOptions
);
// The tooltip options are merged between global and series specific options
this.tooltipOptions = merge(
defaultOptions.tooltip,
defaultOptions.plotOptions[this.type].tooltip,
userOptions.tooltip,
userPlotOptions.series && userPlotOptions.series.tooltip,
userPlotOptions[this.type] && userPlotOptions[this.type].tooltip,
itemOptions.tooltip
);
// Delete marker object if not allowed (#1125)
if (typeOptions.marker === null) {
delete options.marker;
}
// Handle color zones
this.zoneAxis = options.zoneAxis;
zones = this.zones = (options.zones || []).slice();
if ((options.negativeColor || options.negativeFillColor) && !options.zones) {
zones.push({
value: options[this.zoneAxis + 'Threshold'] || options.threshold || 0,
color: options.negativeColor,
fillColor: options.negativeFillColor
});
}
if (zones.length) { // Push one extra zone for the rest
if (defined(zones[zones.length - 1].value)) {
zones.push({
color: this.color,
fillColor: this.fillColor
});
}
}
return options;
},
getCyclic: function (prop, value, defaults) {
var i,
userOptions = this.userOptions,
indexName = '_' + prop + 'Index',
counterName = prop + 'Counter';
if (!value) {
if (defined(userOptions[indexName])) { // after Series.update()
i = userOptions[indexName];
} else {
userOptions[indexName] = i = this.chart[counterName] % defaults.length;
this.chart[counterName] += 1;
}
value = defaults[i];
}
this[prop] = value;
},
/**
* Get the series' color
*/
getColor: function () {
if (!this.options.colorByPoint) {
this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors);
}
},
/**
* Get the series' symbol
*/
getSymbol: function () {
var seriesMarkerOption = this.options.marker;
this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols);
// don't substract radius in image symbols (#604)
if (/^url/.test(this.symbol)) {
seriesMarkerOption.radius = 0;
}
},
drawLegendSymbol: LegendSymbolMixin.drawLineMarker,
/**
* Replace the series data with a new set of data
* @param {Object} data
* @param {Object} redraw
*/
setData: function (data, redraw, animation, updatePoints) {
var series = this,
oldData = series.points,
oldDataLength = (oldData && oldData.length) || 0,
dataLength,
options = series.options,
chart = series.chart,
firstPoint = null,
xAxis = series.xAxis,
hasCategories = xAxis && !!xAxis.categories,
i,
turboThreshold = options.turboThreshold,
pt,
xData = this.xData,
yData = this.yData,
pointArrayMap = series.pointArrayMap,
valueCount = pointArrayMap && pointArrayMap.length;
data = data || [];
dataLength = data.length;
redraw = pick(redraw, true);
// If the point count is the same as is was, just run Point.update which is
// cheaper, allows animation, and keeps references to points.
if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData && series.visible) {
each(data, function (point, i) {
oldData[i].update(point, false, null, false);
});
} else {
// Reset properties
series.xIncrement = null;
series.pointRange = hasCategories ? 1 : options.pointRange;
series.colorCounter = 0; // for series with colorByPoint (#1547)
// Update parallel arrays
each(this.parallelArrays, function (key) {
series[key + 'Data'].length = 0;
});
// In turbo mode, only one- or twodimensional arrays of numbers are allowed. The
// first value is tested, and we assume that all the rest are defined the same
// way. Although the 'for' loops are similar, they are repeated inside each
// if-else conditional for max performance.
if (turboThreshold && dataLength > turboThreshold) {
// find the first non-null point
i = 0;
while (firstPoint === null && i < dataLength) {
firstPoint = data[i];
i++;
}
if (isNumber(firstPoint)) { // assume all points are numbers
var x = pick(options.pointStart, 0),
pointInterval = pick(options.pointInterval, 1);
for (i = 0; i < dataLength; i++) {
xData[i] = x;
yData[i] = data[i];
x += pointInterval;
}
series.xIncrement = x;
} else if (isArray(firstPoint)) { // assume all points are arrays
if (valueCount) { // [x, low, high] or [x, o, h, l, c]
for (i = 0; i < dataLength; i++) {
pt = data[i];
xData[i] = pt[0];
yData[i] = pt.slice(1, valueCount + 1);
}
} else { // [x, y]
for (i = 0; i < dataLength; i++) {
pt = data[i];
xData[i] = pt[0];
yData[i] = pt[1];
}
}
} else {
error(12); // Highcharts expects configs to be numbers or arrays in turbo mode
}
} else {
for (i = 0; i < dataLength; i++) {
if (data[i] !== UNDEFINED) { // stray commas in oldIE
pt = { series: series };
series.pointClass.prototype.applyOptions.apply(pt, [data[i]]);
series.updateParallelArrays(pt, i);
if (hasCategories && pt.name) {
xAxis.names[pt.x] = pt.name; // #2046
}
}
}
}
// Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON
if (isString(yData[0])) {
error(14, true);
}
series.data = [];
series.options.data = data;
//series.zData = zData;
// destroy old points
i = oldDataLength;
while (i--) {
if (oldData[i] && oldData[i].destroy) {
oldData[i].destroy();
}
}
// reset minRange (#878)
if (xAxis) {
xAxis.minRange = xAxis.userMinRange;
}
// redraw
series.isDirty = series.isDirtyData = chart.isDirtyBox = true;
animation = false;
}
if (redraw) {
chart.redraw(animation);
}
},
/**
* Process the data by cropping away unused data points if the series is longer
* than the crop threshold. This saves computing time for lage series.
*/
processData: function (force) {
var series = this,
processedXData = series.xData, // copied during slice operation below
processedYData = series.yData,
dataLength = processedXData.length,
croppedData,
cropStart = 0,
cropped,
distance,
closestPointRange,
xAxis = series.xAxis,
i, // loop variable
options = series.options,
cropThreshold = options.cropThreshold,
isCartesian = series.isCartesian,
xExtremes,
min,
max;
// If the series data or axes haven't changed, don't go through this. Return false to pass
// the message on to override methods like in data grouping.
if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) {
return false;
}
if (xAxis) {
xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053)
min = xExtremes.min;
max = xExtremes.max;
}
// optionally filter out points outside the plot area
if (isCartesian && series.sorted && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) {
// it's outside current extremes
if (processedXData[dataLength - 1] < min || processedXData[0] > max) {
processedXData = [];
processedYData = [];
// only crop if it's actually spilling out
} else if (processedXData[0] < min || processedXData[dataLength - 1] > max) {
croppedData = this.cropData(series.xData, series.yData, min, max);
processedXData = croppedData.xData;
processedYData = croppedData.yData;
cropStart = croppedData.start;
cropped = true;
}
}
// Find the closest distance between processed points
for (i = processedXData.length - 1; i >= 0; i--) {
distance = processedXData[i] - processedXData[i - 1];
if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) {
closestPointRange = distance;
// Unsorted data is not supported by the line tooltip, as well as data grouping and
// navigation in Stock charts (#725) and width calculation of columns (#1900)
} else if (distance < 0 && series.requireSorting) {
error(15);
}
}
// Record the properties
series.cropped = cropped; // undefined or true
series.cropStart = cropStart;
series.processedXData = processedXData;
series.processedYData = processedYData;
if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC
series.pointRange = closestPointRange || 1;
}
series.closestPointRange = closestPointRange;
},
/**
* Iterate over xData and crop values between min and max. Returns object containing crop start/end
* cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range
*/
cropData: function (xData, yData, min, max) {
var dataLength = xData.length,
cropStart = 0,
cropEnd = dataLength,
cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside
i;
// iterate up to find slice start
for (i = 0; i < dataLength; i++) {
if (xData[i] >= min) {
cropStart = mathMax(0, i - cropShoulder);
break;
}
}
// proceed to find slice end
for (; i < dataLength; i++) {
if (xData[i] > max) {
cropEnd = i + cropShoulder;
break;
}
}
return {
xData: xData.slice(cropStart, cropEnd),
yData: yData.slice(cropStart, cropEnd),
start: cropStart,
end: cropEnd
};
},
/**
* Generate the data point after the data has been processed by cropping away
* unused points and optionally grouped in Highcharts Stock.
*/
generatePoints: function () {
var series = this,
options = series.options,
dataOptions = options.data,
data = series.data,
dataLength,
processedXData = series.processedXData,
processedYData = series.processedYData,
pointClass = series.pointClass,
processedDataLength = processedXData.length,
cropStart = series.cropStart || 0,
cursor,
hasGroupedData = series.hasGroupedData,
point,
points = [],
i;
if (!data && !hasGroupedData) {
var arr = [];
arr.length = dataOptions.length;
data = series.data = arr;
}
for (i = 0; i < processedDataLength; i++) {
cursor = cropStart + i;
if (!hasGroupedData) {
if (data[cursor]) {
point = data[cursor];
} else if (dataOptions[cursor] !== UNDEFINED) { // #970
data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]);
}
points[i] = point;
} else {
// splat the y data in case of ohlc data array
points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i])));
}
points[i].index = cursor; // For faster access in Point.update
}
// Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when
// swithching view from non-grouped data to grouped data (#637)
if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) {
for (i = 0; i < dataLength; i++) {
if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points
i += processedDataLength;
}
if (data[i]) {
data[i].destroyElements();
data[i].plotX = UNDEFINED; // #1003
}
}
}
series.data = data;
series.points = points;
},
/**
* Calculate Y extremes for visible data
*/
getExtremes: function (yData) {
var xAxis = this.xAxis,
yAxis = this.yAxis,
xData = this.processedXData,
yDataLength,
activeYData = [],
activeCounter = 0,
xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis
xMin = xExtremes.min,
xMax = xExtremes.max,
validValue,
withinRange,
dataMin,
dataMax,
x,
y,
i,
j;
yData = yData || this.stackedYData || this.processedYData;
yDataLength = yData.length;
for (i = 0; i < yDataLength; i++) {
x = xData[i];
y = yData[i];
// For points within the visible range, including the first point outside the
// visible range, consider y extremes
validValue = y !== null && y !== UNDEFINED && (!yAxis.isLog || (y.length || y > 0));
withinRange = this.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin &&
(xData[i - 1] || x) <= xMax);
if (validValue && withinRange) {
j = y.length;
if (j) { // array, like ohlc or range data
while (j--) {
if (y[j] !== null) {
activeYData[activeCounter++] = y[j];
}
}
} else {
activeYData[activeCounter++] = y;
}
}
}
this.dataMin = pick(dataMin, arrayMin(activeYData));
this.dataMax = pick(dataMax, arrayMax(activeYData));
},
/**
* Translate data points from raw data values to chart specific positioning data
* needed later in drawPoints, drawGraph and drawTracker.
*/
translate: function () {
if (!this.processedXData) { // hidden series
this.processData();
}
this.generatePoints();
var series = this,
options = series.options,
stacking = options.stacking,
xAxis = series.xAxis,
categories = xAxis.categories,
yAxis = series.yAxis,
points = series.points,
dataLength = points.length,
hasModifyValue = !!series.modifyValue,
i,
pointPlacement = options.pointPlacement,
dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement),
threshold = options.threshold,
plotX,
plotY,
lastPlotX,
closestPointRangePx = Number.MAX_VALUE;
// Translate each point
for (i = 0; i < dataLength; i++) {
var point = points[i],
xValue = point.x,
yValue = point.y,
yBottom = point.low,
stack = stacking && yAxis.stacks[(series.negStacks && yValue < threshold ? '-' : '') + series.stackKey],
pointStack,
stackValues;
// Discard disallowed y values for log axes (#3434)
if (yAxis.isLog && yValue !== null && yValue <= 0) {
point.y = yValue = null;
error(10);
}
// Get the plotX translation
point.plotX = plotX = xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags'); // Math.round fixes #591
// Calculate the bottom y value for stacked series
if (stacking && series.visible && stack && stack[xValue]) {
pointStack = stack[xValue];
stackValues = pointStack.points[series.index + ',' + i];
yBottom = stackValues[0];
yValue = stackValues[1];
if (yBottom === 0) {
yBottom = pick(threshold, yAxis.min);
}
if (yAxis.isLog && yBottom <= 0) { // #1200, #1232
yBottom = null;
}
point.total = point.stackTotal = pointStack.total;
point.percentage = pointStack.total && (point.y / pointStack.total * 100);
point.stackY = yValue;
// Place the stack label
pointStack.setOffset(series.pointXOffset || 0, series.barW || 0);
}
// Set translated yBottom or remove it
point.yBottom = defined(yBottom) ?
yAxis.translate(yBottom, 0, 1, 0, 1) :
null;
// general hook, used for Highstock compare mode
if (hasModifyValue) {
yValue = series.modifyValue(yValue, point);
}
// Set the the plotY value, reset it for redraws
point.plotY = plotY = (typeof yValue === 'number' && yValue !== Infinity) ?
mathMin(mathMax(-1e5, yAxis.translate(yValue, 0, 1, 0, 1)), 1e5) : // #3201
UNDEFINED;
point.isInside = plotY !== UNDEFINED && plotY >= 0 && plotY <= yAxis.len && // #3519
plotX >= 0 && plotX <= xAxis.len;
// Set client related positions for mouse tracking
point.clientX = dynamicallyPlaced ? xAxis.translate(xValue, 0, 0, 0, 1) : plotX; // #1514
point.negative = point.y < (threshold || 0);
// some API data
point.category = categories && categories[point.x] !== UNDEFINED ?
categories[point.x] : point.x;
// Determine auto enabling of markers (#3635)
if (i) {
closestPointRangePx = mathMin(closestPointRangePx, mathAbs(plotX - lastPlotX));
}
lastPlotX = plotX;
}
series.closestPointRangePx = closestPointRangePx;
// now that we have the cropped data, build the segments
series.getSegments();
},
/**
* Set the clipping for the series. For animated series it is called twice, first to initiate
* animating the clip then the second time without the animation to set the final clip.
*/
setClip: function (animation) {
var chart = this.chart,
renderer = chart.renderer,
inverted = chart.inverted,
seriesClipBox = this.clipBox,
clipBox = seriesClipBox || chart.clipBox,
sharedClipKey = this.sharedClipKey || ['_sharedClip', animation && animation.duration, animation && animation.easing, clipBox.height].join(','),
clipRect = chart[sharedClipKey],
markerClipRect = chart[sharedClipKey + 'm'];
// If a clipping rectangle with the same properties is currently present in the chart, use that.
if (!clipRect) {
// When animation is set, prepare the initial positions
if (animation) {
clipBox.width = 0;
chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect(
-99, // include the width of the first marker
inverted ? -chart.plotLeft : -chart.plotTop,
99,
inverted ? chart.chartWidth : chart.chartHeight
);
}
chart[sharedClipKey] = clipRect = renderer.clipRect(clipBox);
}
if (animation) {
clipRect.count += 1;
}
if (this.options.clip !== false) {
this.group.clip(animation || seriesClipBox ? clipRect : chart.clipRect);
this.markerGroup.clip(markerClipRect);
this.sharedClipKey = sharedClipKey;
}
// Remove the shared clipping rectancgle when all series are shown
if (!animation) {
clipRect.count -= 1;
if (clipRect.count <= 0 && sharedClipKey && chart[sharedClipKey]) {
if (!seriesClipBox) {
chart[sharedClipKey] = chart[sharedClipKey].destroy();
}
if (chart[sharedClipKey + 'm']) {
chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy();
}
}
}
},
/**
* Animate in the series
*/
animate: function (init) {
var series = this,
chart = series.chart,
clipRect,
animation = series.options.animation,
sharedClipKey;
// Animation option is set to true
if (animation && !isObject(animation)) {
animation = defaultPlotOptions[series.type].animation;
}
// Initialize the animation. Set up the clipping rectangle.
if (init) {
series.setClip(animation);
// Run the animation
} else {
sharedClipKey = this.sharedClipKey;
clipRect = chart[sharedClipKey];
if (clipRect) {
clipRect.animate({
width: chart.plotSizeX
}, animation);
}
if (chart[sharedClipKey + 'm']) {
chart[sharedClipKey + 'm'].animate({
width: chart.plotSizeX + 99
}, animation);
}
// Delete this function to allow it only once
series.animate = null;
}
},
/**
* This runs after animation to land on the final plot clipping
*/
afterAnimate: function () {
this.setClip();
fireEvent(this, 'afterAnimate');
},
/**
* Draw the markers
*/
drawPoints: function () {
var series = this,
pointAttr,
points = series.points,
chart = series.chart,
plotX,
plotY,
i,
point,
radius,
symbol,
isImage,
graphic,
options = series.options,
seriesMarkerOptions = options.marker,
seriesPointAttr = series.pointAttr[''],
pointMarkerOptions,
hasPointMarker,
enabled,
isInside,
markerGroup = series.markerGroup,
xAxis = series.xAxis,
globallyEnabled = pick(
seriesMarkerOptions.enabled,
xAxis.isRadial,
series.closestPointRangePx > 2 * seriesMarkerOptions.radius
);
if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) {
i = points.length;
while (i--) {
point = points[i];
plotX = mathFloor(point.plotX); // #1843
plotY = point.plotY;
graphic = point.graphic;
pointMarkerOptions = point.marker || {};
hasPointMarker = !!point.marker;
enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled;
isInside = point.isInside;
// only draw the point if y is defined
if (enabled && plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
// shortcuts
pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr;
radius = pointAttr.r;
symbol = pick(pointMarkerOptions.symbol, series.symbol);
isImage = symbol.indexOf('url') === 0;
if (graphic) { // update
graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled
.animate(extend({
x: plotX - radius,
y: plotY - radius
}, graphic.symbolName ? { // don't apply to image symbols #507
width: 2 * radius,
height: 2 * radius
} : {}));
} else if (isInside && (radius > 0 || isImage)) {
point.graphic = graphic = chart.renderer.symbol(
symbol,
plotX - radius,
plotY - radius,
2 * radius,
2 * radius,
hasPointMarker ? pointMarkerOptions : seriesMarkerOptions
)
.attr(pointAttr)
.add(markerGroup);
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
}
}
},
/**
* Convert state properties from API naming conventions to SVG attributes
*
* @param {Object} options API options object
* @param {Object} base1 SVG attribute object to inherit from
* @param {Object} base2 Second level SVG attribute object to inherit from
*/
convertAttribs: function (options, base1, base2, base3) {
var conversion = this.pointAttrToOptions,
attr,
option,
obj = {};
options = options || {};
base1 = base1 || {};
base2 = base2 || {};
base3 = base3 || {};
for (attr in conversion) {
option = conversion[attr];
obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]);
}
return obj;
},
/**
* Get the state attributes. Each series type has its own set of attributes
* that are allowed to change on a point's state change. Series wide attributes are stored for
* all series, and additionally point specific attributes are stored for all
* points with individual marker options. If such options are not defined for the point,
* a reference to the series wide attributes is stored in point.pointAttr.
*/
getAttribs: function () {
var series = this,
seriesOptions = series.options,
normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
stateOptions = normalOptions.states,
stateOptionsHover = stateOptions[HOVER_STATE],
pointStateOptionsHover,
seriesColor = series.color,
seriesNegativeColor = series.options.negativeColor,
normalDefaults = {
stroke: seriesColor,
fill: seriesColor
},
points = series.points || [], // #927
i,
point,
seriesPointAttr = [],
pointAttr,
pointAttrToOptions = series.pointAttrToOptions,
hasPointSpecificOptions = series.hasPointSpecificOptions,
defaultLineColor = normalOptions.lineColor,
defaultFillColor = normalOptions.fillColor,
turboThreshold = seriesOptions.turboThreshold,
zones = series.zones,
zoneAxis = series.zoneAxis || 'y',
attr,
key;
// series type specific modifications
if (seriesOptions.marker) { // line, spline, area, areaspline, scatter
// if no hover radius is given, default to normal radius + 2
stateOptionsHover.radius = stateOptionsHover.radius || normalOptions.radius + stateOptionsHover.radiusPlus;
stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus;
} else { // column, bar, pie
// if no hover color is given, brighten the normal color
stateOptionsHover.color = stateOptionsHover.color ||
Color(stateOptionsHover.color || seriesColor)
.brighten(stateOptionsHover.brightness).get();
// if no hover negativeColor is given, brighten the normal negativeColor
stateOptionsHover.negativeColor = stateOptionsHover.negativeColor ||
Color(stateOptionsHover.negativeColor || seriesNegativeColor)
.brighten(stateOptionsHover.brightness).get();
}
// general point attributes for the series normal state
seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults);
// HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius
each([HOVER_STATE, SELECT_STATE], function (state) {
seriesPointAttr[state] =
series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]);
});
// set it
series.pointAttr = seriesPointAttr;
// Generate the point-specific attribute collections if specific point
// options are given. If not, create a referance to the series wide point
// attributes
i = points.length;
if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) {
while (i--) {
point = points[i];
normalOptions = (point.options && point.options.marker) || point.options;
if (normalOptions && normalOptions.enabled === false) {
normalOptions.radius = 0;
}
if (zones.length) {
var j = 0,
threshold = zones[j];
while (point[zoneAxis] >= threshold.value) {
threshold = zones[++j];
}
point.color = point.fillColor = threshold.color;
}
hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868
// check if the point has specific visual options
if (point.options) {
for (key in pointAttrToOptions) {
if (defined(normalOptions[pointAttrToOptions[key]])) {
hasPointSpecificOptions = true;
}
}
}
// a specific marker config object is defined for the individual point:
// create it's own attribute collection
if (hasPointSpecificOptions) {
normalOptions = normalOptions || {};
pointAttr = [];
stateOptions = normalOptions.states || {}; // reassign for individual point
pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {};
// Handle colors for column and pies
if (!seriesOptions.marker) { // column, bar, point
// If no hover color is given, brighten the normal color. #1619, #2579
pointStateOptionsHover.color = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover[(point.negative && seriesNegativeColor ? 'negativeColor' : 'color')]) ||
Color(point.color)
.brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness)
.get();
}
// normal point state inherits series wide normal state
attr = { color: point.color }; // #868
if (!defaultFillColor) { // Individual point color or negative color markers (#2219)
attr.fillColor = point.color;
}
if (!defaultLineColor) {
attr.lineColor = point.color; // Bubbles take point color, line markers use white
}
pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]);
// inherit from point normal and series hover
pointAttr[HOVER_STATE] = series.convertAttribs(
stateOptions[HOVER_STATE],
seriesPointAttr[HOVER_STATE],
pointAttr[NORMAL_STATE]
);
// inherit from point normal and series hover
pointAttr[SELECT_STATE] = series.convertAttribs(
stateOptions[SELECT_STATE],
seriesPointAttr[SELECT_STATE],
pointAttr[NORMAL_STATE]
);
// no marker config object is created: copy a reference to the series-wide
// attribute collection
} else {
pointAttr = seriesPointAttr;
}
point.pointAttr = pointAttr;
}
}
},
/**
* Clear DOM objects and free up memory
*/
destroy: function () {
var series = this,
chart = series.chart,
issue134 = /AppleWebKit\/533/.test(userAgent),
destroy,
i,
data = series.data || [],
point,
prop,
axis;
// add event hook
fireEvent(series, 'destroy');
// remove all events
removeEvent(series);
// erase from axes
each(series.axisTypes || [], function (AXIS) {
axis = series[AXIS];
if (axis) {
erase(axis.series, series);
axis.isDirty = axis.forceRedraw = true;
}
});
// remove legend items
if (series.legendItem) {
series.chart.legend.destroyItem(series);
}
// destroy all points with their elements
i = data.length;
while (i--) {
point = data[i];
if (point && point.destroy) {
point.destroy();
}
}
series.points = null;
// Clear the animation timeout if we are destroying the series during initial animation
clearTimeout(series.animationTimeout);
// destroy all SVGElements associated to the series
each(['area', 'graph', 'dataLabelsGroup', 'group', 'markerGroup', 'tracker',
'graphNeg', 'areaNeg', 'posClip', 'negClip'], function (prop) {
if (series[prop]) {
// issue 134 workaround
destroy = issue134 && prop === 'group' ?
'hide' :
'destroy';
series[prop][destroy]();
}
});
// remove from hoverSeries
if (chart.hoverSeries === series) {
chart.hoverSeries = null;
}
erase(chart.series, series);
// clear all members
for (prop in series) {
delete series[prop];
}
},
/**
* Return the graph path of a segment
*/
getSegmentPath: function (segment) {
var series = this,
segmentPath = [],
step = series.options.step;
// build the segment line
each(segment, function (point, i) {
var plotX = point.plotX,
plotY = point.plotY,
lastPoint;
if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object
segmentPath.push.apply(segmentPath, series.getPointSpline(segment, point, i));
} else {
// moveTo or lineTo
segmentPath.push(i ? L : M);
// step line?
if (step && i) {
lastPoint = segment[i - 1];
if (step === 'right') {
segmentPath.push(
lastPoint.plotX,
plotY
);
} else if (step === 'center') {
segmentPath.push(
(lastPoint.plotX + plotX) / 2,
lastPoint.plotY,
(lastPoint.plotX + plotX) / 2,
plotY
);
} else {
segmentPath.push(
plotX,
lastPoint.plotY
);
}
}
// normal line to next point
segmentPath.push(
point.plotX,
point.plotY
);
}
});
return segmentPath;
},
/**
* Get the graph path
*/
getGraphPath: function () {
var series = this,
graphPath = [],
segmentPath,
singlePoints = []; // used in drawTracker
// Divide into segments and build graph and area paths
each(series.segments, function (segment) {
segmentPath = series.getSegmentPath(segment);
// add the segment to the graph, or a single point for tracking
if (segment.length > 1) {
graphPath = graphPath.concat(segmentPath);
} else {
singlePoints.push(segment[0]);
}
});
// Record it for use in drawGraph and drawTracker, and return graphPath
series.singlePoints = singlePoints;
series.graphPath = graphPath;
return graphPath;
},
/**
* Draw the actual graph
*/
drawGraph: function () {
var series = this,
options = this.options,
props = [['graph', options.lineColor || this.color, options.dashStyle]],
lineWidth = options.lineWidth,
roundCap = options.linecap !== 'square',
graphPath = this.getGraphPath(),
fillColor = (this.fillGraph && this.color) || NONE, // polygon series use filled graph
zones = this.zones;
each(zones, function (threshold, i) {
props.push(['colorGraph' + i, threshold.color || series.color, threshold.dashStyle || options.dashStyle]);
});
// Draw the graph
each(props, function (prop, i) {
var graphKey = prop[0],
graph = series[graphKey],
attribs;
if (graph) {
stop(graph); // cancel running animations, #459
graph.animate({ d: graphPath });
} else if ((lineWidth || fillColor) && graphPath.length) { // #1487
attribs = {
stroke: prop[1],
'stroke-width': lineWidth,
fill: fillColor,
zIndex: 1 // #1069
};
if (prop[2]) {
attribs.dashstyle = prop[2];
} else if (roundCap) {
attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';
}
series[graphKey] = series.chart.renderer.path(graphPath)
.attr(attribs)
.add(series.group)
.shadow(!i && options.shadow);
}
});
},
/**
* Clip the graphs into the positive and negative coloured graphs
*/
applyZones: function () {
var series = this,
chart = this.chart,
renderer = chart.renderer,
zones = this.zones,
translatedFrom,
translatedTo,
clips = this.clips || [],
clipAttr,
graph = this.graph,
area = this.area,
chartSizeMax = mathMax(chart.chartWidth, chart.chartHeight),
zoneAxis = this.zoneAxis || 'y',
axis = this[zoneAxis + 'Axis'],
reversed = axis.reversed,
horiz = axis.horiz;
if (zones.length && (graph || area)) {
// The use of the Color Threshold assumes there are no gaps
// so it is safe to hide the original graph and area
graph.hide();
if (area) { area.hide(); }
// Create the clips
each(zones, function (threshold, i) {
translatedFrom = pick(translatedTo, (reversed ? (horiz ? chart.plotWidth : 0) : (horiz ? 0 : axis.toPixels(axis.min))));
translatedTo = mathRound(axis.toPixels(pick(threshold.value, axis.max), true));
if (axis.isXAxis) {
clipAttr = {
x: reversed ? translatedTo : translatedFrom,
y: 0,
width: Math.abs(translatedFrom - translatedTo),
height: chartSizeMax
};
if (!horiz) {
clipAttr.x = chart.plotHeight - clipAttr.x;
}
} else {
clipAttr = {
x: 0,
y: reversed ? translatedFrom : translatedTo,
width: chartSizeMax,
height: Math.abs(translatedFrom - translatedTo)
};
if (horiz) {
clipAttr.y = chart.plotWidth - clipAttr.y;
}
}
/// VML SUPPPORT
if (chart.inverted && renderer.isVML) {
if (axis.isXAxis) {
clipAttr = {
x: 0,
y: reversed ? translatedFrom : translatedTo,
height: clipAttr.width,
width: chart.chartWidth
};
} else {
clipAttr = {
x: clipAttr.y - chart.plotLeft - chart.spacingBox.x,
y: 0,
width: clipAttr.height,
height: chart.chartHeight
};
}
}
/// END OF VML SUPPORT
if (clips[i]) {
clips[i].animate(clipAttr);
} else {
clips[i] = renderer.clipRect(clipAttr);
series['colorGraph' + i].clip(clips[i]);
if (area) {
series['colorArea' + i].clip(clips[i]);
}
}
});
this.clips = clips;
}
},
/**
* Initialize and perform group inversion on series.group and series.markerGroup
*/
invertGroups: function () {
var series = this,
chart = series.chart;
// Pie, go away (#1736)
if (!series.xAxis) {
return;
}
// A fixed size is needed for inversion to work
function setInvert() {
var size = {
width: series.yAxis.len,
height: series.xAxis.len
};
each(['group', 'markerGroup'], function (groupName) {
if (series[groupName]) {
series[groupName].attr(size).invert();
}
});
}
addEvent(chart, 'resize', setInvert); // do it on resize
addEvent(series, 'destroy', function () {
removeEvent(chart, 'resize', setInvert);
});
// Do it now
setInvert(); // do it now
// On subsequent render and redraw, just do setInvert without setting up events again
series.invertGroups = setInvert;
},
/**
* General abstraction for creating plot groups like series.group, series.dataLabelsGroup and
* series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size.
*/
plotGroup: function (prop, name, visibility, zIndex, parent) {
var group = this[prop],
isNew = !group;
// Generate it on first call
if (isNew) {
this[prop] = group = this.chart.renderer.g(name)
.attr({
visibility: visibility,
zIndex: zIndex || 0.1 // IE8 needs this
})
.add(parent);
}
// Place it on first and subsequent (redraw) calls
group[isNew ? 'attr' : 'animate'](this.getPlotBox());
return group;
},
/**
* Get the translation and scale for the plot area of this series
*/
getPlotBox: function () {
var chart = this.chart,
xAxis = this.xAxis,
yAxis = this.yAxis;
// Swap axes for inverted (#2339)
if (chart.inverted) {
xAxis = yAxis;
yAxis = this.xAxis;
}
return {
translateX: xAxis ? xAxis.left : chart.plotLeft,
translateY: yAxis ? yAxis.top : chart.plotTop,
scaleX: 1, // #1623
scaleY: 1
};
},
/**
* Render the graph and markers
*/
render: function () {
var series = this,
chart = series.chart,
group,
options = series.options,
animation = options.animation,
// Animation doesn't work in IE8 quirks when the group div is hidden,
// and looks bad in other oldIE
animDuration = (animation && !!series.animate && chart.renderer.isSVG && pick(animation.duration, 500)) || 0,
visibility = series.visible ? VISIBLE : HIDDEN,
zIndex = options.zIndex,
hasRendered = series.hasRendered,
chartSeriesGroup = chart.seriesGroup;
// the group
group = series.plotGroup(
'group',
'series',
visibility,
zIndex,
chartSeriesGroup
);
series.markerGroup = series.plotGroup(
'markerGroup',
'markers',
visibility,
zIndex,
chartSeriesGroup
);
// initiate the animation
if (animDuration) {
series.animate(true);
}
// cache attributes for shapes
series.getAttribs();
// SVGRenderer needs to know this before drawing elements (#1089, #1795)
group.inverted = series.isCartesian ? chart.inverted : false;
// draw the graph if any
if (series.drawGraph) {
series.drawGraph();
series.applyZones();
}
each(series.points, function (point) {
if (point.redraw) {
point.redraw();
}
});
// draw the data labels (inn pies they go before the points)
if (series.drawDataLabels) {
series.drawDataLabels();
}
// draw the points
if (series.visible) {
series.drawPoints();
}
// draw the mouse tracking area
if (series.drawTracker && series.options.enableMouseTracking !== false) {
series.drawTracker();
}
// Handle inverted series and tracker groups
if (chart.inverted) {
series.invertGroups();
}
// Initial clipping, must be defined after inverting groups for VML. Applies to columns etc. (#3839).
if (options.clip !== false && !series.sharedClipKey && !hasRendered) {
group.clip(chart.clipRect);
}
// Run the animation
if (animDuration) {
series.animate();
}
// Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option
// which should be available to the user).
if (!hasRendered) {
if (animDuration) {
series.animationTimeout = setTimeout(function () {
series.afterAnimate();
}, animDuration);
} else {
series.afterAnimate();
}
}
series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
// (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
series.hasRendered = true;
},
/**
* Redraw the series after an update in the axes.
*/
redraw: function () {
var series = this,
chart = series.chart,
wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after
group = series.group,
xAxis = series.xAxis,
yAxis = series.yAxis;
// reposition on resize
if (group) {
if (chart.inverted) {
group.attr({
width: chart.plotWidth,
height: chart.plotHeight
});
}
group.animate({
translateX: pick(xAxis && xAxis.left, chart.plotLeft),
translateY: pick(yAxis && yAxis.top, chart.plotTop)
});
}
series.translate();
series.render();
if (wasDirtyData) {
delete this.kdTree; // #3868 recalculate the kdtree with dirty data
fireEvent(series, 'updatedData');
}
},
/**
* KD Tree && PointSearching Implementation
*/
kdDimensions: 1,
kdTree: null,
kdAxisArray: ['plotX', 'plotY'],
kdComparer: 'distX',
searchPoint: function (e) {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
inverted = series.chart.inverted;
e.plotX = inverted ? xAxis.len - e.chartY + xAxis.pos : e.chartX - xAxis.pos;
e.plotY = inverted ? yAxis.len - e.chartX + yAxis.pos : e.chartY - yAxis.pos;
return this.searchKDTree(e);
},
buildKDTree: function () {
var series = this,
dimensions = series.kdDimensions;
// Internal function
function _kdtree(points, depth, dimensions) {
var axis, median, length = points && points.length;
if (length) {
// alternate between the axis
axis = series.kdAxisArray[depth % dimensions];
// sort point array
points.sort(function(a, b) {
return a[axis] - b[axis];
});
median = Math.floor(length / 2);
// build and return node
return {
point: points[median],
left: _kdtree(points.slice(0, median), depth + 1, dimensions),
right: _kdtree(points.slice(median + 1), depth + 1, dimensions)
};
}
}
// Start the recursive build process with a clone of the points array (#3873)
function startRecursive() {
series.kdTree = _kdtree(series.points.slice(), dimensions, dimensions);
}
delete series.kdTree;
if (series.options.kdSync) { // For testing tooltips, don't build async
startRecursive();
} else {
setTimeout(startRecursive);
}
},
searchKDTree: function (point) {
var series = this,
kdComparer = this.kdComparer,
kdX = this.kdAxisArray[0],
kdY = this.kdAxisArray[1];
// Internal function
function _distance(p1, p2) {
var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,
y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,
r = (x || 0) + (y || 0);
return {
distX: defined(x) ? Math.sqrt(x) : Number.MAX_VALUE,
distY: defined(y) ? Math.sqrt(y) : Number.MAX_VALUE,
distR: defined(r) ? Math.sqrt(r) : Number.MAX_VALUE
};
}
function _search(search, tree, depth, dimensions) {
var point = tree.point,
axis = series.kdAxisArray[depth % dimensions],
tdist,
sideA,
sideB,
ret = point,
nPoint1,
nPoint2;
point.dist = _distance(search, point);
// Pick side based on distance to splitting point
tdist = search[axis] - point[axis];
sideA = tdist < 0 ? 'left' : 'right';
// End of tree
if (tree[sideA]) {
nPoint1 =_search(search, tree[sideA], depth + 1, dimensions);
ret = (nPoint1.dist[kdComparer] < ret.dist[kdComparer] ? nPoint1 : point);
sideB = tdist < 0 ? 'right' : 'left';
if (tree[sideB]) {
// compare distance to current best to splitting point to decide wether to check side B or not
if (Math.sqrt(tdist*tdist) < ret.dist[kdComparer]) {
nPoint2 = _search(search, tree[sideB], depth + 1, dimensions);
ret = (nPoint2.dist[kdComparer] < ret.dist[kdComparer] ? nPoint2 : ret);
}
}
}
return ret;
}
if (!this.kdTree) {
this.buildKDTree();
}
if (this.kdTree) {
return _search(point,
this.kdTree, this.kdDimensions, this.kdDimensions);
}
}
}; // end Series prototype
/**
* The class for stack items
*/
function StackItem(axis, options, isNegative, x, stackOption) {
var inverted = axis.chart.inverted;
this.axis = axis;
// Tells if the stack is negative
this.isNegative = isNegative;
// Save the options to be able to style the label
this.options = options;
// Save the x value to be able to position the label later
this.x = x;
// Initialize total value
this.total = null;
// This will keep each points' extremes stored by series.index and point index
this.points = {};
// Save the stack option on the series configuration object, and whether to treat it as percent
this.stack = stackOption;
// The align options and text align varies on whether the stack is negative and
// if the chart is inverted or not.
// First test the user supplied value, then use the dynamic.
this.alignOptions = {
align: options.align || (inverted ? (isNegative ? 'left' : 'right') : 'center'),
verticalAlign: options.verticalAlign || (inverted ? 'middle' : (isNegative ? 'bottom' : 'top')),
y: pick(options.y, inverted ? 4 : (isNegative ? 14 : -6)),
x: pick(options.x, inverted ? (isNegative ? -6 : 6) : 0)
};
this.textAlign = options.textAlign || (inverted ? (isNegative ? 'right' : 'left') : 'center');
}
StackItem.prototype = {
destroy: function () {
destroyObjectProperties(this, this.axis);
},
/**
* Renders the stack total label and adds it to the stack label group.
*/
render: function (group) {
var options = this.options,
formatOption = options.format,
str = formatOption ?
format(formatOption, this) :
options.formatter.call(this); // format the text in the label
// Change the text to reflect the new total and set visibility to hidden in case the serie is hidden
if (this.label) {
this.label.attr({text: str, visibility: HIDDEN});
// Create new label
} else {
this.label =
this.axis.chart.renderer.text(str, null, null, options.useHTML) // dummy positions, actual position updated with setOffset method in columnseries
.css(options.style) // apply style
.attr({
align: this.textAlign, // fix the text-anchor
rotation: options.rotation, // rotation
visibility: HIDDEN // hidden until setOffset is called
})
.add(group); // add to the labels-group
}
},
/**
* Sets the offset that the stack has from the x value and repositions the label.
*/
setOffset: function (xOffset, xWidth) {
var stackItem = this,
axis = stackItem.axis,
chart = axis.chart,
inverted = chart.inverted,
neg = this.isNegative, // special treatment is needed for negative stacks
y = axis.translate(axis.usePercentage ? 100 : this.total, 0, 0, 0, 1), // stack value translated mapped to chart coordinates
yZero = axis.translate(0), // stack origin
h = mathAbs(y - yZero), // stack height
x = chart.xAxis[0].translate(this.x) + xOffset, // stack x position
plotHeight = chart.plotHeight,
stackBox = { // this is the box for the complete stack
x: inverted ? (neg ? y : y - h) : x,
y: inverted ? plotHeight - x - xWidth : (neg ? (plotHeight - y - h) : plotHeight - y),
width: inverted ? h : xWidth,
height: inverted ? xWidth : h
},
label = this.label,
alignAttr;
if (label) {
label.align(this.alignOptions, null, stackBox); // align the label to the box
// Set visibility (#678)
alignAttr = label.alignAttr;
label[this.options.crop === false || chart.isInsidePlot(alignAttr.x, alignAttr.y) ? 'show' : 'hide'](true);
}
}
};
// Stacking methods defined on the Axis prototype
/**
* Build the stacks from top down
*/
Axis.prototype.buildStacks = function () {
var series = this.series,
reversedStacks = pick(this.options.reversedStacks, true),
i = series.length;
if (!this.isXAxis) {
this.usePercentage = false;
while (i--) {
series[reversedStacks ? i : series.length - i - 1].setStackedPoints();
}
// Loop up again to compute percent stack
if (this.usePercentage) {
for (i = 0; i < series.length; i++) {
series[i].setPercentStacks();
}
}
}
};
Axis.prototype.renderStackTotals = function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
stacks = axis.stacks,
stackKey,
oneStack,
stackCategory,
stackTotalGroup = axis.stackTotalGroup;
// Create a separate group for the stack total labels
if (!stackTotalGroup) {
axis.stackTotalGroup = stackTotalGroup =
renderer.g('stack-labels')
.attr({
visibility: VISIBLE,
zIndex: 6
})
.add();
}
// plotLeft/Top will change when y axis gets wider so we need to translate the
// stackTotalGroup at every render call. See bug #506 and #516
stackTotalGroup.translate(chart.plotLeft, chart.plotTop);
// Render each stack total
for (stackKey in stacks) {
oneStack = stacks[stackKey];
for (stackCategory in oneStack) {
oneStack[stackCategory].render(stackTotalGroup);
}
}
};
// Stacking methods defnied for Series prototype
/**
* Adds series' points value to corresponding stack
*/
Series.prototype.setStackedPoints = function () {
if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) {
return;
}
var series = this,
xData = series.processedXData,
yData = series.processedYData,
stackedYData = [],
yDataLength = yData.length,
seriesOptions = series.options,
threshold = seriesOptions.threshold,
stackOption = seriesOptions.stack,
stacking = seriesOptions.stacking,
stackKey = series.stackKey,
negKey = '-' + stackKey,
negStacks = series.negStacks,
yAxis = series.yAxis,
stacks = yAxis.stacks,
oldStacks = yAxis.oldStacks,
isNegative,
stack,
other,
key,
pointKey,
i,
x,
y;
// loop over the non-null y values and read them into a local array
for (i = 0; i < yDataLength; i++) {
x = xData[i];
y = yData[i];
pointKey = series.index + ',' + i;
// Read stacked values into a stack based on the x value,
// the sign of y and the stack key. Stacking is also handled for null values (#739)
isNegative = negStacks && y < threshold;
key = isNegative ? negKey : stackKey;
// Create empty object for this stack if it doesn't exist yet
if (!stacks[key]) {
stacks[key] = {};
}
// Initialize StackItem for this x
if (!stacks[key][x]) {
if (oldStacks[key] && oldStacks[key][x]) {
stacks[key][x] = oldStacks[key][x];
stacks[key][x].total = null;
} else {
stacks[key][x] = new StackItem(yAxis, yAxis.options.stackLabels, isNegative, x, stackOption);
}
}
// If the StackItem doesn't exist, create it first
stack = stacks[key][x];
stack.points[pointKey] = [stack.cum || 0];
// Add value to the stack total
if (stacking === 'percent') {
// Percent stacked column, totals are the same for the positive and negative stacks
other = isNegative ? stackKey : negKey;
if (negStacks && stacks[other] && stacks[other][x]) {
other = stacks[other][x];
stack.total = other.total = mathMax(other.total, stack.total) + mathAbs(y) || 0;
// Percent stacked areas
} else {
stack.total = correctFloat(stack.total + (mathAbs(y) || 0));
}
} else {
stack.total = correctFloat(stack.total + (y || 0));
}
stack.cum = (stack.cum || 0) + (y || 0);
stack.points[pointKey].push(stack.cum);
stackedYData[i] = stack.cum;
}
if (stacking === 'percent') {
yAxis.usePercentage = true;
}
this.stackedYData = stackedYData; // To be used in getExtremes
// Reset old stacks
yAxis.oldStacks = {};
};
/**
* Iterate over all stacks and compute the absolute values to percent
*/
Series.prototype.setPercentStacks = function () {
var series = this,
stackKey = series.stackKey,
stacks = series.yAxis.stacks,
processedXData = series.processedXData;
each([stackKey, '-' + stackKey], function (key) {
var i = processedXData.length,
x,
stack,
pointExtremes,
totalFactor;
while (i--) {
x = processedXData[i];
stack = stacks[key] && stacks[key][x];
pointExtremes = stack && stack.points[series.index + ',' + i];
if (pointExtremes) {
totalFactor = stack.total ? 100 / stack.total : 0;
pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor); // Y bottom value
pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor); // Y value
series.stackedYData[i] = pointExtremes[1];
}
}
});
};
// Extend the Chart prototype for dynamic methods
extend(Chart.prototype, {
/**
* Add a series dynamically after time
*
* @param {Object} options The config options
* @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true.
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*
* @return {Object} series The newly created series object
*/
addSeries: function (options, redraw, animation) {
var series,
chart = this;
if (options) {
redraw = pick(redraw, true); // defaults to true
fireEvent(chart, 'addSeries', { options: options }, function () {
series = chart.initSeries(options);
chart.isDirtyLegend = true; // the series array is out of sync with the display
chart.linkSeries();
if (redraw) {
chart.redraw(animation);
}
});
}
return series;
},
/**
* Add an axis to the chart
* @param {Object} options The axis option
* @param {Boolean} isX Whether it is an X axis or a value axis
*/
addAxis: function (options, isX, redraw, animation) {
var key = isX ? 'xAxis' : 'yAxis',
chartOptions = this.options,
axis;
/*jslint unused: false*/
axis = new Axis(this, merge(options, {
index: this[key].length,
isX: isX
}));
/*jslint unused: true*/
// Push the new axis options to the chart options
chartOptions[key] = splat(chartOptions[key] || {});
chartOptions[key].push(options);
if (pick(redraw, true)) {
this.redraw(animation);
}
},
/**
* Dim the chart and show a loading text or symbol
* @param {String} str An optional text to show in the loading label instead of the default one
*/
showLoading: function (str) {
var chart = this,
options = chart.options,
loadingDiv = chart.loadingDiv,
loadingOptions = options.loading,
setLoadingSize = function () {
if (loadingDiv) {
css(loadingDiv, {
left: chart.plotLeft + PX,
top: chart.plotTop + PX,
width: chart.plotWidth + PX,
height: chart.plotHeight + PX
});
}
};
// create the layer at the first call
if (!loadingDiv) {
chart.loadingDiv = loadingDiv = createElement(DIV, {
className: PREFIX + 'loading'
}, extend(loadingOptions.style, {
zIndex: 10,
display: NONE
}), chart.container);
chart.loadingSpan = createElement(
'span',
null,
loadingOptions.labelStyle,
loadingDiv
);
addEvent(chart, 'redraw', setLoadingSize); // #1080
}
// update text
chart.loadingSpan.innerHTML = str || options.lang.loading;
// show it
if (!chart.loadingShown) {
css(loadingDiv, {
opacity: 0,
display: ''
});
animate(loadingDiv, {
opacity: loadingOptions.style.opacity
}, {
duration: loadingOptions.showDuration || 0
});
chart.loadingShown = true;
}
setLoadingSize();
},
/**
* Hide the loading layer
*/
hideLoading: function () {
var options = this.options,
loadingDiv = this.loadingDiv;
if (loadingDiv) {
animate(loadingDiv, {
opacity: 0
}, {
duration: options.loading.hideDuration || 100,
complete: function () {
css(loadingDiv, { display: NONE });
}
});
}
this.loadingShown = false;
}
});
// extend the Point prototype for dynamic methods
extend(Point.prototype, {
/**
* Update the point with new options (typically x/y data) and optionally redraw the series.
*
* @param {Object} options Point options as defined in the series.data array
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*
*/
update: function (options, redraw, animation, runEvent) {
var point = this,
series = point.series,
graphic = point.graphic,
i,
chart = series.chart,
seriesOptions = series.options,
names = series.xAxis && series.xAxis.names;
redraw = pick(redraw, true);
function update() {
point.applyOptions(options);
// Update visuals
if (isObject(options) && !isArray(options)) {
// Defer the actual redraw until getAttribs has been called (#3260)
point.redraw = function () {
if (graphic) {
if (options && options.marker && options.marker.symbol) {
point.graphic = graphic.destroy();
} else {
graphic.attr(point.pointAttr[point.state || '']);
}
}
if (options && options.dataLabels && point.dataLabel) { // #2468
point.dataLabel = point.dataLabel.destroy();
}
point.redraw = null;
};
}
// record changes in the parallel arrays
i = point.index;
series.updateParallelArrays(point, i);
if (names && point.name) {
names[point.x] = point.name;
}
seriesOptions.data[i] = point.options;
// redraw
series.isDirty = series.isDirtyData = true;
if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320
chart.isDirtyBox = true;
}
if (seriesOptions.legendType === 'point') { // #1831, #1885
series.updateTotals();
chart.legend.clearItems();
}
if (redraw) {
chart.redraw(animation);
}
}
// Fire the event with a default handler of doing the update
if (runEvent === false) { // When called from setData
update();
} else {
point.firePointEvent('update', { options: options }, update);
}
},
/**
* Remove a point and optionally redraw the series and if necessary the axes
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
remove: function (redraw, animation) {
this.series.removePoint(inArray(this, this.series.data), redraw, animation);
}
});
// Extend the series prototype for dynamic methods
extend(Series.prototype, {
/**
* Add a point dynamically after chart load time
* @param {Object} options Point options as given in series.data
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean} shift If shift is true, a point is shifted off the start
* of the series as one is appended to the end.
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
addPoint: function (options, redraw, shift, animation) {
var series = this,
seriesOptions = series.options,
data = series.data,
graph = series.graph,
area = series.area,
chart = series.chart,
names = series.xAxis && series.xAxis.names,
currentShift = (graph && graph.shift) || 0,
dataOptions = seriesOptions.data,
point,
isInTheMiddle,
xData = series.xData,
x,
i;
setAnimation(animation, chart);
// Make graph animate sideways
if (shift) {
each([graph, area, series.graphNeg, series.areaNeg], function (shape) {
if (shape) {
shape.shift = currentShift + 1;
}
});
}
if (area) {
area.isArea = true; // needed in animation, both with and without shift
}
// Optional redraw, defaults to true
redraw = pick(redraw, true);
// Get options and push the point to xData, yData and series.options. In series.generatePoints
// the Point instance will be created on demand and pushed to the series.data array.
point = { series: series };
series.pointClass.prototype.applyOptions.apply(point, [options]);
x = point.x;
// Get the insertion point
i = xData.length;
if (series.requireSorting && x < xData[i - 1]) {
isInTheMiddle = true;
while (i && xData[i - 1] > x) {
i--;
}
}
series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item
series.updateParallelArrays(point, i); // update it
if (names && point.name) {
names[x] = point.name;
}
dataOptions.splice(i, 0, options);
if (isInTheMiddle) {
series.data.splice(i, 0, null);
series.processData();
}
// Generate points to be added to the legend (#1329)
if (seriesOptions.legendType === 'point') {
series.generatePoints();
}
// Shift the first point off the parallel arrays
// todo: consider series.removePoint(i) method
if (shift) {
if (data[0] && data[0].remove) {
data[0].remove(false);
} else {
data.shift();
series.updateParallelArrays(point, 'shift');
dataOptions.shift();
}
}
// redraw
series.isDirty = true;
series.isDirtyData = true;
if (redraw) {
series.getAttribs(); // #1937
chart.redraw();
}
},
/**
* Remove a point (rendered or not), by index
*/
removePoint: function (i, redraw, animation) {
var series = this,
data = series.data,
point = data[i],
points = series.points,
chart = series.chart,
remove = function () {
if (data.length === points.length) {
points.splice(i, 1);
}
data.splice(i, 1);
series.options.data.splice(i, 1);
series.updateParallelArrays(point || { series: series }, 'splice', i, 1);
if (point) {
point.destroy();
}
// redraw
series.isDirty = true;
series.isDirtyData = true;
if (redraw) {
chart.redraw();
}
};
setAnimation(animation, chart);
redraw = pick(redraw, true);
// Fire the event with a default handler of removing the point
if (point) {
point.firePointEvent('remove', null, remove);
} else {
remove();
}
},
/**
* Remove a series and optionally redraw the chart
*
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
remove: function (redraw, animation) {
var series = this,
chart = series.chart;
redraw = pick(redraw, true);
if (!series.isRemoving) { /* prevent triggering native event in jQuery
(calling the remove function from the remove event) */
series.isRemoving = true;
// fire the event with a default handler of removing the point
fireEvent(series, 'remove', null, function () {
// destroy elements
series.destroy();
// redraw
chart.isDirtyLegend = chart.isDirtyBox = true;
chart.linkSeries();
if (redraw) {
chart.redraw(animation);
}
});
}
series.isRemoving = false;
},
/**
* Update the series with a new set of options
*/
update: function (newOptions, redraw) {
var series = this,
chart = this.chart,
// must use user options when changing type because this.options is merged
// in with type specific plotOptions
oldOptions = this.userOptions,
oldType = this.type,
proto = seriesTypes[oldType].prototype,
preserve = ['group', 'markerGroup', 'dataLabelsGroup'],
n;
// If we're changing type or zIndex, create new groups (#3380, #3404)
if ((newOptions.type && newOptions.type !== oldType) || newOptions.zIndex !== undefined) {
preserve.length = 0;
}
// Make sure groups are not destroyed (#3094)
each(preserve, function (prop) {
preserve[prop] = series[prop];
delete series[prop];
});
// Do the merge, with some forced options
newOptions = merge(oldOptions, {
animation: false,
index: this.index,
pointStart: this.xData[0] // when updating after addPoint
}, { data: this.options.data }, newOptions);
// Destroy the series and delete all properties. Reinsert all methods
// and properties from the new type prototype (#2270, #3719)
this.remove(false);
for (n in proto) {
this[n] = UNDEFINED;
}
extend(this, seriesTypes[newOptions.type || oldType].prototype);
// Re-register groups (#3094)
each(preserve, function (prop) {
series[prop] = preserve[prop];
});
this.init(chart, newOptions);
chart.linkSeries(); // Links are lost in this.remove (#3028)
if (pick(redraw, true)) {
chart.redraw(false);
}
}
});
// Extend the Axis.prototype for dynamic methods
extend(Axis.prototype, {
/**
* Update the axis with a new options structure
*/
update: function (newOptions, redraw) {
var chart = this.chart;
newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions);
this.destroy(true);
this._addedPlotLB = UNDEFINED; // #1611, #2887
this.init(chart, extend(newOptions, { events: UNDEFINED }));
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
},
/**
* Remove the axis from the chart
*/
remove: function (redraw) {
var chart = this.chart,
key = this.coll, // xAxis or yAxis
axisSeries = this.series,
i = axisSeries.length;
// Remove associated series (#2687)
while (i--) {
if (axisSeries[i]) {
axisSeries[i].remove(false);
}
}
// Remove the axis
erase(chart.axes, this);
erase(chart[key], this);
chart.options[key].splice(this.options.index, 1);
each(chart[key], function (axis, i) { // Re-index, #1706
axis.options.index = i;
});
this.destroy();
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
},
/**
* Update the axis title by options
*/
setTitle: function (newTitleOptions, redraw) {
this.update({ title: newTitleOptions }, redraw);
},
/**
* Set new axis categories and optionally redraw
* @param {Array} categories
* @param {Boolean} redraw
*/
setCategories: function (categories, redraw) {
this.update({ categories: categories }, redraw);
}
});
/**
* LineSeries object
*/
var LineSeries = extendClass(Series);
seriesTypes.line = LineSeries;
/**
* Set the default options for area
*/
defaultPlotOptions.area = merge(defaultSeriesOptions, {
threshold: 0
// trackByArea: false,
// lineColor: null, // overrides color, but lets fillColor be unaltered
// fillOpacity: 0.75,
// fillColor: null
});
/**
* AreaSeries object
*/
var AreaSeries = extendClass(Series, {
type: 'area',
/**
* For stacks, don't split segments on null values. Instead, draw null values with
* no marker. Also insert dummy points for any X position that exists in other series
* in the stack.
*/
getSegments: function () {
var series = this,
segments = [],
segment = [],
keys = [],
xAxis = this.xAxis,
yAxis = this.yAxis,
stack = yAxis.stacks[this.stackKey],
pointMap = {},
plotX,
plotY,
points = this.points,
connectNulls = this.options.connectNulls,
i,
x;
if (this.options.stacking && !this.cropped) { // cropped causes artefacts in Stock, and perf issue
// Create a map where we can quickly look up the points by their X value.
for (i = 0; i < points.length; i++) {
pointMap[points[i].x] = points[i];
}
// Sort the keys (#1651)
for (x in stack) {
if (stack[x].total !== null) { // nulled after switching between grouping and not (#1651, #2336)
keys.push(+x);
}
}
keys.sort(function (a, b) {
return a - b;
});
each(keys, function (x) {
var y = 0,
stackPoint;
if (connectNulls && (!pointMap[x] || pointMap[x].y === null)) { // #1836
return;
// The point exists, push it to the segment
} else if (pointMap[x]) {
segment.push(pointMap[x]);
// There is no point for this X value in this series, so we
// insert a dummy point in order for the areas to be drawn
// correctly.
} else {
// Loop down the stack to find the series below this one that has
// a value (#1991)
for (i = series.index; i <= yAxis.series.length; i++) {
stackPoint = stack[x].points[i + ',' + x];
if (stackPoint) {
y = stackPoint[1];
break;
}
}
plotX = xAxis.translate(x);
plotY = yAxis.toPixels(y, true);
segment.push({
y: null,
plotX: plotX,
clientX: plotX,
plotY: plotY,
yBottom: plotY,
onMouseOver: noop
});
}
});
if (segment.length) {
segments.push(segment);
}
} else {
Series.prototype.getSegments.call(this);
segments = this.segments;
}
this.segments = segments;
},
/**
* Extend the base Series getSegmentPath method by adding the path for the area.
* This path is pushed to the series.areaPath property.
*/
getSegmentPath: function (segment) {
var segmentPath = Series.prototype.getSegmentPath.call(this, segment), // call base method
areaSegmentPath = [].concat(segmentPath), // work on a copy for the area path
i,
options = this.options,
segLength = segmentPath.length,
translatedThreshold = this.yAxis.getThreshold(options.threshold), // #2181
yBottom;
if (segLength === 3) { // for animation from 1 to two points
areaSegmentPath.push(L, segmentPath[1], segmentPath[2]);
}
if (options.stacking && !this.closedStacks) {
// Follow stack back. Todo: implement areaspline. A general solution could be to
// reverse the entire graphPath of the previous series, though may be hard with
// splines and with series with different extremes
for (i = segment.length - 1; i >= 0; i--) {
yBottom = pick(segment[i].yBottom, translatedThreshold);
// step line?
if (i < segment.length - 1 && options.step) {
areaSegmentPath.push(segment[i + 1].plotX, yBottom);
}
areaSegmentPath.push(segment[i].plotX, yBottom);
}
} else { // follow zero line back
this.closeSegment(areaSegmentPath, segment, translatedThreshold);
}
this.areaPath = this.areaPath.concat(areaSegmentPath);
return segmentPath;
},
/**
* Extendable method to close the segment path of an area. This is overridden in polar
* charts.
*/
closeSegment: function (path, segment, translatedThreshold) {
path.push(
L,
segment[segment.length - 1].plotX,
translatedThreshold,
L,
segment[0].plotX,
translatedThreshold
);
},
/**
* Draw the graph and the underlying area. This method calls the Series base
* function and adds the area. The areaPath is calculated in the getSegmentPath
* method called from Series.prototype.drawGraph.
*/
drawGraph: function () {
// Define or reset areaPath
this.areaPath = [];
// Call the base method
Series.prototype.drawGraph.apply(this);
// Define local variables
var series = this,
areaPath = this.areaPath,
options = this.options,
zones = this.zones,
props = [['area', this.color, options.fillColor]]; // area name, main color, fill color
each(zones, function (threshold, i) {
props.push(['colorArea' + i, threshold.color || series.color, threshold.fillColor || options.fillColor]);
});
each(props, function (prop) {
var areaKey = prop[0],
area = series[areaKey];
// Create or update the area
if (area) { // update
area.animate({ d: areaPath });
} else { // create
series[areaKey] = series.chart.renderer.path(areaPath)
.attr({
fill: pick(
prop[2],
Color(prop[1]).setOpacity(pick(options.fillOpacity, 0.75)).get()
),
zIndex: 0 // #1069
}).add(series.group);
}
});
},
drawLegendSymbol: LegendSymbolMixin.drawRectangle
});
seriesTypes.area = AreaSeries;
/**
* Set the default options for spline
*/
defaultPlotOptions.spline = merge(defaultSeriesOptions);
/**
* SplineSeries object
*/
var SplineSeries = extendClass(Series, {
type: 'spline',
/**
* Get the spline segment from a given point's previous neighbour to the given point
*/
getPointSpline: function (segment, point, i) {
var smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc
denom = smoothing + 1,
plotX = point.plotX,
plotY = point.plotY,
lastPoint = segment[i - 1],
nextPoint = segment[i + 1],
leftContX,
leftContY,
rightContX,
rightContY,
ret;
// find control points
if (lastPoint && nextPoint) {
var lastX = lastPoint.plotX,
lastY = lastPoint.plotY,
nextX = nextPoint.plotX,
nextY = nextPoint.plotY,
correction;
leftContX = (smoothing * plotX + lastX) / denom;
leftContY = (smoothing * plotY + lastY) / denom;
rightContX = (smoothing * plotX + nextX) / denom;
rightContY = (smoothing * plotY + nextY) / denom;
// have the two control points make a straight line through main point
correction = ((rightContY - leftContY) * (rightContX - plotX)) /
(rightContX - leftContX) + plotY - rightContY;
leftContY += correction;
rightContY += correction;
// to prevent false extremes, check that control points are between
// neighbouring points' y values
if (leftContY > lastY && leftContY > plotY) {
leftContY = mathMax(lastY, plotY);
rightContY = 2 * plotY - leftContY; // mirror of left control point
} else if (leftContY < lastY && leftContY < plotY) {
leftContY = mathMin(lastY, plotY);
rightContY = 2 * plotY - leftContY;
}
if (rightContY > nextY && rightContY > plotY) {
rightContY = mathMax(nextY, plotY);
leftContY = 2 * plotY - rightContY;
} else if (rightContY < nextY && rightContY < plotY) {
rightContY = mathMin(nextY, plotY);
leftContY = 2 * plotY - rightContY;
}
// record for drawing in next point
point.rightContX = rightContX;
point.rightContY = rightContY;
}
// Visualize control points for debugging
/*
if (leftContX) {
this.chart.renderer.circle(leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 2)
.attr({
stroke: 'red',
'stroke-width': 1,
fill: 'none'
})
.add();
this.chart.renderer.path(['M', leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop,
'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop])
.attr({
stroke: 'red',
'stroke-width': 1
})
.add();
this.chart.renderer.circle(rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 2)
.attr({
stroke: 'green',
'stroke-width': 1,
fill: 'none'
})
.add();
this.chart.renderer.path(['M', rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop,
'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop])
.attr({
stroke: 'green',
'stroke-width': 1
})
.add();
}
*/
// moveTo or lineTo
if (!i) {
ret = [M, plotX, plotY];
} else { // curve from last point to this
ret = [
'C',
lastPoint.rightContX || lastPoint.plotX,
lastPoint.rightContY || lastPoint.plotY,
leftContX || plotX,
leftContY || plotY,
plotX,
plotY
];
lastPoint.rightContX = lastPoint.rightContY = null; // reset for updating series later
}
return ret;
}
});
seriesTypes.spline = SplineSeries;
/**
* Set the default options for areaspline
*/
defaultPlotOptions.areaspline = merge(defaultPlotOptions.area);
/**
* AreaSplineSeries object
*/
var areaProto = AreaSeries.prototype,
AreaSplineSeries = extendClass(SplineSeries, {
type: 'areaspline',
closedStacks: true, // instead of following the previous graph back, follow the threshold back
// Mix in methods from the area series
getSegmentPath: areaProto.getSegmentPath,
closeSegment: areaProto.closeSegment,
drawGraph: areaProto.drawGraph,
drawLegendSymbol: LegendSymbolMixin.drawRectangle
});
seriesTypes.areaspline = AreaSplineSeries;
/**
* Set the default options for column
*/
defaultPlotOptions.column = merge(defaultSeriesOptions, {
borderColor: '#FFFFFF',
//borderWidth: 1,
borderRadius: 0,
//colorByPoint: undefined,
groupPadding: 0.2,
//grouping: true,
marker: null, // point options are specified in the base options
pointPadding: 0.1,
//pointWidth: null,
minPointLength: 0,
cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes
pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories
states: {
hover: {
brightness: 0.1,
shadow: false,
halo: false
},
select: {
color: '#C0C0C0',
borderColor: '#000000',
shadow: false
}
},
dataLabels: {
align: null, // auto
verticalAlign: null, // auto
y: null
},
stickyTracking: false,
tooltip: {
distance: 6
},
threshold: 0
});
/**
* ColumnSeries object
*/
var ColumnSeries = extendClass(Series, {
type: 'column',
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'borderColor',
fill: 'color',
r: 'borderRadius'
},
cropShoulder: 0,
directTouch: true, // When tooltip is not shared, this series (and derivatives) requires direct touch/hover. KD-tree does not apply.
trackerGroups: ['group', 'dataLabelsGroup'],
negStacks: true, // use separate negative stacks, unlike area stacks where a negative
// point is substracted from previous (#1910)
/**
* Initialize the series
*/
init: function () {
Series.prototype.init.apply(this, arguments);
var series = this,
chart = series.chart;
// if the series is added dynamically, force redraw of other
// series affected by a new column
if (chart.hasRendered) {
each(chart.series, function (otherSeries) {
if (otherSeries.type === series.type) {
otherSeries.isDirty = true;
}
});
}
},
/**
* Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding,
* pointWidth etc.
*/
getColumnMetrics: function () {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis,
reversedXAxis = xAxis.reversed,
stackKey,
stackGroups = {},
columnIndex,
columnCount = 0;
// Get the total number of column type series.
// This is called on every series. Consider moving this logic to a
// chart.orderStacks() function and call it on init, addSeries and removeSeries
if (options.grouping === false) {
columnCount = 1;
} else {
each(series.chart.series, function (otherSeries) {
var otherOptions = otherSeries.options,
otherYAxis = otherSeries.yAxis;
if (otherSeries.type === series.type && otherSeries.visible &&
yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086
if (otherOptions.stacking) {
stackKey = otherSeries.stackKey;
if (stackGroups[stackKey] === UNDEFINED) {
stackGroups[stackKey] = columnCount++;
}
columnIndex = stackGroups[stackKey];
} else if (otherOptions.grouping !== false) { // #1162
columnIndex = columnCount++;
}
otherSeries.columnIndex = columnIndex;
}
});
}
var categoryWidth = mathMin(
mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610
xAxis.len // #1535
),
groupPadding = categoryWidth * options.groupPadding,
groupWidth = categoryWidth - 2 * groupPadding,
pointOffsetWidth = groupWidth / columnCount,
optionPointWidth = options.pointWidth,
pointPadding = defined(optionPointWidth) ? (pointOffsetWidth - optionPointWidth) / 2 :
pointOffsetWidth * options.pointPadding,
pointWidth = pick(optionPointWidth, pointOffsetWidth - 2 * pointPadding), // exact point width, used in polar charts
colIndex = (reversedXAxis ?
columnCount - (series.columnIndex || 0) : // #1251
series.columnIndex) || 0,
pointXOffset = pointPadding + (groupPadding + colIndex *
pointOffsetWidth - (categoryWidth / 2)) *
(reversedXAxis ? -1 : 1);
// Save it for reading in linked series (Error bars particularly)
return (series.columnMetrics = {
width: pointWidth,
offset: pointXOffset
});
},
/**
* Translate each point to the plot area coordinate system and find shape positions
*/
translate: function () {
var series = this,
chart = series.chart,
options = series.options,
borderWidth = series.borderWidth = pick(
options.borderWidth,
series.closestPointRange * series.xAxis.transA < 2 ? 0 : 1 // #3635
),
yAxis = series.yAxis,
threshold = options.threshold,
translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold),
minPointLength = pick(options.minPointLength, 5),
metrics = series.getColumnMetrics(),
pointWidth = metrics.width,
seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width
pointXOffset = series.pointXOffset = metrics.offset,
xCrisp = -(borderWidth % 2 ? 0.5 : 0),
yCrisp = borderWidth % 2 ? 0.5 : 1;
if (chart.renderer.isVML && chart.inverted) {
yCrisp += 1;
}
// When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual
// columns to have individual sizes. When pointPadding is greater, we strive for equal-width
// columns (#2694).
if (options.pointPadding) {
seriesBarW = mathCeil(seriesBarW);
}
Series.prototype.translate.apply(series);
// Record the new values
each(series.points, function (point) {
var yBottom = pick(point.yBottom, translatedThreshold),
plotY = mathMin(mathMax(-999 - yBottom, point.plotY), yAxis.len + 999 + yBottom), // Don't draw too far outside plot area (#1303, #2241)
barX = point.plotX + pointXOffset,
barW = seriesBarW,
barY = mathMin(plotY, yBottom),
right,
bottom,
fromTop,
barH = mathMax(plotY, yBottom) - barY;
// Handle options.minPointLength
if (mathAbs(barH) < minPointLength) {
if (minPointLength) {
barH = minPointLength;
barY =
mathRound(mathAbs(barY - translatedThreshold) > minPointLength ? // stacked
yBottom - minPointLength : // keep position
translatedThreshold - (yAxis.translate(point.y, 0, 1, 0, 1) <= translatedThreshold ? minPointLength : 0)); // use exact yAxis.translation (#1485)
}
}
// Cache for access in polar
point.barX = barX;
point.pointWidth = pointWidth;
// Fix the tooltip on center of grouped columns (#1216, #424, #3648)
point.tooltipPos = chart.inverted ?
[yAxis.len + yAxis.pos - chart.plotLeft - plotY, series.xAxis.len - barX - barW / 2] :
[barX + barW / 2, plotY + yAxis.pos - chart.plotTop];
// Round off to obtain crisp edges and avoid overlapping with neighbours (#2694)
right = mathRound(barX + barW) + xCrisp;
barX = mathRound(barX) + xCrisp;
barW = right - barX;
fromTop = mathAbs(barY) < 0.5;
bottom = mathMin(mathRound(barY + barH) + yCrisp, 9e4); // #3575
barY = mathRound(barY) + yCrisp;
barH = bottom - barY;
// Top edges are exceptions
if (fromTop) {
barY -= 1;
barH += 1;
}
// Register shape type and arguments to be used in drawPoints
point.shapeType = 'rect';
point.shapeArgs = {
x: barX,
y: barY,
width: barW,
height: barH
};
});
},
getSymbol: noop,
/**
* Use a solid rectangle like the area series types
*/
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
/**
* Columns have no graph
*/
drawGraph: noop,
/**
* Draw the columns. For bars, the series.group is rotated, so the same coordinates
* apply for columns and bars. This method is inherited by scatter series.
*
*/
drawPoints: function () {
var series = this,
chart = this.chart,
options = series.options,
renderer = chart.renderer,
animationLimit = options.animationLimit || 250,
shapeArgs,
pointAttr;
// draw the columns
each(series.points, function (point) {
var plotY = point.plotY,
graphic = point.graphic,
borderAttr;
if (plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
shapeArgs = point.shapeArgs;
borderAttr = defined(series.borderWidth) ? {
'stroke-width': series.borderWidth
} : {};
pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE];
if (graphic) { // update
stop(graphic);
graphic.attr(borderAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs));
} else {
point.graphic = graphic = renderer[point.shapeType](shapeArgs)
.attr(borderAttr)
.attr(pointAttr)
.add(series.group)
.shadow(options.shadow, null, options.stacking && !options.borderRadius);
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
});
},
/**
* Animate the column heights one by one from zero
* @param {Boolean} init Whether to initialize the animation or run it
*/
animate: function (init) {
var series = this,
yAxis = this.yAxis,
options = series.options,
inverted = this.chart.inverted,
attr = {},
translatedThreshold;
if (hasSVG) { // VML is too slow anyway
if (init) {
attr.scaleY = 0.001;
translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold)));
if (inverted) {
attr.translateX = translatedThreshold - yAxis.len;
} else {
attr.translateY = translatedThreshold;
}
series.group.attr(attr);
} else { // run the animation
attr.scaleY = 1;
attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos;
series.group.animate(attr, series.options.animation);
// delete this function to allow it only once
series.animate = null;
}
}
},
/**
* Remove this series from the chart
*/
remove: function () {
var series = this,
chart = series.chart;
// column and bar series affects other series of the same type
// as they are either stacked or grouped
if (chart.hasRendered) {
each(chart.series, function (otherSeries) {
if (otherSeries.type === series.type) {
otherSeries.isDirty = true;
}
});
}
Series.prototype.remove.apply(series, arguments);
}
});
seriesTypes.column = ColumnSeries;
/**
* Set the default options for bar
*/
defaultPlotOptions.bar = merge(defaultPlotOptions.column);
/**
* The Bar series class
*/
var BarSeries = extendClass(ColumnSeries, {
type: 'bar',
inverted: true
});
seriesTypes.bar = BarSeries;
/**
* Set the default options for scatter
*/
defaultPlotOptions.scatter = merge(defaultSeriesOptions, {
lineWidth: 0,
marker: {
enabled: true // Overrides auto-enabling in line series (#3647)
},
tooltip: {
headerFormat: '<span style="color:{series.color}">\u25CF</span> <span style="font-size: 10px;"> {series.name}</span><br/>',
pointFormat: 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>'
}
});
/**
* The scatter series class
*/
var ScatterSeries = extendClass(Series, {
type: 'scatter',
sorted: false,
requireSorting: false,
noSharedTooltip: true,
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
takeOrdinalPosition: false, // #2342
kdDimensions: 2,
kdComparer: 'distR',
drawGraph: function () {
if (this.options.lineWidth) {
Series.prototype.drawGraph.call(this);
}
}
});
seriesTypes.scatter = ScatterSeries;
/**
* Set the default options for pie
*/
defaultPlotOptions.pie = merge(defaultSeriesOptions, {
borderColor: '#FFFFFF',
borderWidth: 1,
center: [null, null],
clip: false,
colorByPoint: true, // always true for pies
dataLabels: {
// align: null,
// connectorWidth: 1,
// connectorColor: point.color,
// connectorPadding: 5,
distance: 30,
enabled: true,
formatter: function () { // #2945
return this.point.name;
},
// softConnector: true,
x: 0
// y: 0
},
ignoreHiddenPoint: true,
//innerSize: 0,
legendType: 'point',
marker: null, // point options are specified in the base options
size: null,
showInLegend: false,
slicedOffset: 10,
states: {
hover: {
brightness: 0.1,
shadow: false
}
},
stickyTracking: false,
tooltip: {
followPointer: true
}
});
/**
* Extended point object for pies
*/
var PiePoint = extendClass(Point, {
/**
* Initiate the pie slice
*/
init: function () {
Point.prototype.init.apply(this, arguments);
var point = this,
toggleSlice;
extend(point, {
visible: point.visible !== false,
name: pick(point.name, 'Slice')
});
// add event listener for select
toggleSlice = function (e) {
point.slice(e.type === 'select');
};
addEvent(point, 'select', toggleSlice);
addEvent(point, 'unselect', toggleSlice);
return point;
},
/**
* Toggle the visibility of the pie slice
* @param {Boolean} vis Whether to show the slice or not. If undefined, the
* visibility is toggled
*/
setVisible: function (vis) {
var point = this,
series = point.series,
chart = series.chart,
doRedraw = !series.isDirty && series.options.ignoreHiddenPoint;
// if called without an argument, toggle visibility
point.visible = point.options.visible = vis = vis === UNDEFINED ? !point.visible : vis;
series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data
// Show and hide associated elements
each(['graphic', 'dataLabel', 'connector', 'shadowGroup'], function (key) {
if (point[key]) {
point[key][vis ? 'show' : 'hide'](true);
}
});
if (point.legendItem) {
if (chart.hasRendered) {
series.updateTotals();
chart.legend.clearItems();
if (!doRedraw) {
chart.legend.render();
}
}
chart.legend.colorizeItem(point, vis);
}
// Handle ignore hidden slices
if (doRedraw) {
series.isDirty = true;
chart.redraw();
}
},
/**
* Set or toggle whether the slice is cut out from the pie
* @param {Boolean} sliced When undefined, the slice state is toggled
* @param {Boolean} redraw Whether to redraw the chart. True by default.
*/
slice: function (sliced, redraw, animation) {
var point = this,
series = point.series,
chart = series.chart,
translation;
setAnimation(animation, chart);
// redraw is true by default
redraw = pick(redraw, true);
// if called without an argument, toggle
point.sliced = point.options.sliced = sliced = defined(sliced) ? sliced : !point.sliced;
series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data
translation = sliced ? point.slicedTranslation : {
translateX: 0,
translateY: 0
};
point.graphic.animate(translation);
if (point.shadowGroup) {
point.shadowGroup.animate(translation);
}
},
haloPath: function (size) {
var shapeArgs = this.shapeArgs,
chart = this.series.chart;
return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(chart.plotLeft + shapeArgs.x, chart.plotTop + shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, {
innerR: this.shapeArgs.r,
start: shapeArgs.start,
end: shapeArgs.end
});
}
});
/**
* The Pie series class
*/
var PieSeries = {
type: 'pie',
isCartesian: false,
pointClass: PiePoint,
requireSorting: false,
noSharedTooltip: true,
trackerGroups: ['group', 'dataLabelsGroup'],
axisTypes: [],
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'borderColor',
'stroke-width': 'borderWidth',
fill: 'color'
},
/**
* Pies have one color each point
*/
getColor: noop,
/**
* Animate the pies in
*/
animate: function (init) {
var series = this,
points = series.points,
startAngleRad = series.startAngleRad;
if (!init) {
each(points, function (point) {
var graphic = point.graphic,
args = point.shapeArgs;
if (graphic) {
// start values
graphic.attr({
r: series.center[3] / 2, // animate from inner radius (#779)
start: startAngleRad,
end: startAngleRad
});
// animate
graphic.animate({
r: args.r,
start: args.start,
end: args.end
}, series.options.animation);
}
});
// delete this function to allow it only once
series.animate = null;
}
},
/**
* Extend the basic setData method by running processData and generatePoints immediately,
* in order to access the points from the legend.
*/
setData: function (data, redraw, animation, updatePoints) {
Series.prototype.setData.call(this, data, false, animation, updatePoints);
this.processData();
this.generatePoints();
if (pick(redraw, true)) {
this.chart.redraw(animation);
}
},
/**
* Recompute total chart sum and update percentages of points.
*/
updateTotals: function () {
var i,
total = 0,
points,
len,
point,
ignoreHiddenPoint = this.options.ignoreHiddenPoint;
// Populate local vars
points = this.points;
len = points.length;
// Get the total sum
for (i = 0; i < len; i++) {
point = points[i];
// Disallow negative values (#1530, #3623)
if (point.y < 0) {
point.y = null;
}
total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
}
this.total = total;
// Set each point's properties
for (i = 0; i < len; i++) {
point = points[i];
//point.percentage = (total <= 0 || ignoreHiddenPoint && !point.visible) ? 0 : point.y / total * 100;
point.percentage = (total > 0 && (point.visible || !ignoreHiddenPoint)) ? point.y / total * 100 : 0;
point.total = total;
}
},
/**
* Extend the generatePoints method by adding total and percentage properties to each point
*/
generatePoints: function () {
Series.prototype.generatePoints.call(this);
this.updateTotals();
},
/**
* Do translation for pie slices
*/
translate: function (positions) {
this.generatePoints();
var series = this,
cumulative = 0,
precision = 1000, // issue #172
options = series.options,
slicedOffset = options.slicedOffset,
connectorOffset = slicedOffset + options.borderWidth,
start,
end,
angle,
startAngle = options.startAngle || 0,
startAngleRad = series.startAngleRad = mathPI / 180 * (startAngle - 90),
endAngleRad = series.endAngleRad = mathPI / 180 * ((pick(options.endAngle, startAngle + 360)) - 90),
circ = endAngleRad - startAngleRad, //2 * mathPI,
points = series.points,
radiusX, // the x component of the radius vector for a given point
radiusY,
labelDistance = options.dataLabels.distance,
ignoreHiddenPoint = options.ignoreHiddenPoint,
i,
len = points.length,
point;
// Get positions - either an integer or a percentage string must be given.
// If positions are passed as a parameter, we're in a recursive loop for adjusting
// space for data labels.
if (!positions) {
series.center = positions = series.getCenter();
}
// utility for getting the x value from a given y, used for anticollision logic in data labels
series.getX = function (y, left) {
angle = math.asin(mathMin((y - positions[1]) / (positions[2] / 2 + labelDistance), 1));
return positions[0] +
(left ? -1 : 1) *
(mathCos(angle) * (positions[2] / 2 + labelDistance));
};
// Calculate the geometry for each point
for (i = 0; i < len; i++) {
point = points[i];
// set start and end angle
start = startAngleRad + (cumulative * circ);
if (!ignoreHiddenPoint || point.visible) {
cumulative += point.percentage / 100;
}
end = startAngleRad + (cumulative * circ);
// set the shape
point.shapeType = 'arc';
point.shapeArgs = {
x: positions[0],
y: positions[1],
r: positions[2] / 2,
innerR: positions[3] / 2,
start: mathRound(start * precision) / precision,
end: mathRound(end * precision) / precision
};
// The angle must stay within -90 and 270 (#2645)
angle = (end + start) / 2;
if (angle > 1.5 * mathPI) {
angle -= 2 * mathPI;
} else if (angle < -mathPI / 2) {
angle += 2 * mathPI;
}
// Center for the sliced out slice
point.slicedTranslation = {
translateX: mathRound(mathCos(angle) * slicedOffset),
translateY: mathRound(mathSin(angle) * slicedOffset)
};
// set the anchor point for tooltips
radiusX = mathCos(angle) * positions[2] / 2;
radiusY = mathSin(angle) * positions[2] / 2;
point.tooltipPos = [
positions[0] + radiusX * 0.7,
positions[1] + radiusY * 0.7
];
point.half = angle < -mathPI / 2 || angle > mathPI / 2 ? 1 : 0;
point.angle = angle;
// set the anchor point for data labels
connectorOffset = mathMin(connectorOffset, labelDistance / 2); // #1678
point.labelPos = [
positions[0] + radiusX + mathCos(angle) * labelDistance, // first break of connector
positions[1] + radiusY + mathSin(angle) * labelDistance, // a/a
positions[0] + radiusX + mathCos(angle) * connectorOffset, // second break, right outside pie
positions[1] + radiusY + mathSin(angle) * connectorOffset, // a/a
positions[0] + radiusX, // landing point for connector
positions[1] + radiusY, // a/a
labelDistance < 0 ? // alignment
'center' :
point.half ? 'right' : 'left', // alignment
angle // center angle
];
}
},
drawGraph: null,
/**
* Draw the data points
*/
drawPoints: function () {
var series = this,
chart = series.chart,
renderer = chart.renderer,
groupTranslation,
//center,
graphic,
//group,
shadow = series.options.shadow,
shadowGroup,
shapeArgs;
if (shadow && !series.shadowGroup) {
series.shadowGroup = renderer.g('shadow')
.add(series.group);
}
// draw the slices
each(series.points, function (point) {
graphic = point.graphic;
shapeArgs = point.shapeArgs;
shadowGroup = point.shadowGroup;
// put the shadow behind all points
if (shadow && !shadowGroup) {
shadowGroup = point.shadowGroup = renderer.g('shadow')
.add(series.shadowGroup);
}
// if the point is sliced, use special translation, else use plot area traslation
groupTranslation = point.sliced ? point.slicedTranslation : {
translateX: 0,
translateY: 0
};
//group.translate(groupTranslation[0], groupTranslation[1]);
if (shadowGroup) {
shadowGroup.attr(groupTranslation);
}
// draw the slice
if (graphic) {
graphic.animate(extend(shapeArgs, groupTranslation));
} else {
point.graphic = graphic = renderer[point.shapeType](shapeArgs)
.setRadialReference(series.center)
.attr(
point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE]
)
.attr({
'stroke-linejoin': 'round'
//zIndex: 1 // #2722 (reversed)
})
.attr(groupTranslation)
.add(series.group)
.shadow(shadow, shadowGroup);
}
// detect point specific visibility (#2430)
if (point.visible !== undefined) {
point.setVisible(point.visible);
}
});
},
searchPoint: noop,
/**
* Utility for sorting data labels
*/
sortByAngle: function (points, sign) {
points.sort(function (a, b) {
return a.angle !== undefined && (b.angle - a.angle) * sign;
});
},
/**
* Use a simple symbol from LegendSymbolMixin
*/
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
/**
* Use the getCenter method from drawLegendSymbol
*/
getCenter: CenteredSeriesMixin.getCenter,
/**
* Pies don't have point marker symbols
*/
getSymbol: noop
};
PieSeries = extendClass(Series, PieSeries);
seriesTypes.pie = PieSeries;
/**
* Draw the data labels
*/
Series.prototype.drawDataLabels = function () {
var series = this,
seriesOptions = series.options,
cursor = seriesOptions.cursor,
options = seriesOptions.dataLabels,
points = series.points,
pointOptions,
generalOptions,
hasRendered = series.hasRendered || 0,
str,
dataLabelsGroup,
renderer = series.chart.renderer;
if (options.enabled || series._hasPointLabels) {
// Process default alignment of data labels for columns
if (series.dlProcessOptions) {
series.dlProcessOptions(options);
}
// Create a separate group for the data labels to avoid rotation
dataLabelsGroup = series.plotGroup(
'dataLabelsGroup',
'data-labels',
options.defer ? HIDDEN : VISIBLE,
options.zIndex || 6
);
if (pick(options.defer, true)) {
dataLabelsGroup.attr({ opacity: +hasRendered }); // #3300
if (!hasRendered) {
addEvent(series, 'afterAnimate', function () {
if (series.visible) { // #3023, #3024
dataLabelsGroup.show();
}
dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 });
});
}
}
// Make the labels for each point
generalOptions = options;
each(points, function (point) {
var enabled,
dataLabel = point.dataLabel,
labelConfig,
attr,
name,
rotation,
connector = point.connector,
isNew = true,
style,
moreStyle = {};
// Determine if each data label is enabled
pointOptions = point.dlOptions || (point.options && point.options.dataLabels); // dlOptions is used in treemaps
enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled); // #2282
// If the point is outside the plot area, destroy it. #678, #820
if (dataLabel && !enabled) {
point.dataLabel = dataLabel.destroy();
// Individual labels are disabled if the are explicitly disabled
// in the point options, or if they fall outside the plot area.
} else if (enabled) {
// Create individual options structure that can be extended without
// affecting others
options = merge(generalOptions, pointOptions);
style = options.style;
rotation = options.rotation;
// Get the string
labelConfig = point.getLabelConfig();
str = options.format ?
format(options.format, labelConfig) :
options.formatter.call(labelConfig, options);
// Determine the color
style.color = pick(options.color, style.color, series.color, 'black');
// update existing label
if (dataLabel) {
if (defined(str)) {
dataLabel
.attr({
text: str
});
isNew = false;
} else { // #1437 - the label is shown conditionally
point.dataLabel = dataLabel = dataLabel.destroy();
if (connector) {
point.connector = connector.destroy();
}
}
// create new label
} else if (defined(str)) {
attr = {
//align: align,
fill: options.backgroundColor,
stroke: options.borderColor,
'stroke-width': options.borderWidth,
r: options.borderRadius || 0,
rotation: rotation,
padding: options.padding,
zIndex: 1
};
// Get automated contrast color
if (style.color === 'contrast') {
moreStyle.color = options.inside || options.distance < 0 || !!seriesOptions.stacking ?
renderer.getContrast(point.color || series.color) :
'#000000';
}
if (cursor) {
moreStyle.cursor = cursor;
}
// Remove unused attributes (#947)
for (name in attr) {
if (attr[name] === UNDEFINED) {
delete attr[name];
}
}
dataLabel = point.dataLabel = renderer[rotation ? 'text' : 'label']( // labels don't support rotation
str,
0,
-999,
options.shape,
null,
null,
options.useHTML
)
.attr(attr)
.css(extend(style, moreStyle))
.add(dataLabelsGroup)
.shadow(options.shadow);
}
if (dataLabel) {
// Now the data label is created and placed at 0,0, so we need to align it
series.alignDataLabel(point, dataLabel, options, null, isNew);
}
}
});
}
};
/**
* Align each individual data label
*/
Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
var chart = this.chart,
inverted = chart.inverted,
plotX = pick(point.plotX, -999),
plotY = pick(point.plotY, -999),
bBox = dataLabel.getBBox(),
baseline = chart.renderer.fontMetrics(options.style.fontSize).b,
rotCorr, // rotation correction
// Math.round for rounding errors (#2683), alignTo to allow column labels (#2700)
visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) ||
(alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))),
alignAttr; // the final position;
if (visible) {
// The alignment box is a singular point
alignTo = extend({
x: inverted ? chart.plotWidth - plotY : plotX,
y: mathRound(inverted ? chart.plotHeight - plotX : plotY),
width: 0,
height: 0
}, alignTo);
// Add the text size for alignment calculation
extend(options, {
width: bBox.width,
height: bBox.height
});
// Allow a hook for changing alignment in the last moment, then do the alignment
if (options.rotation) { // Fancy box alignment isn't supported for rotated text
rotCorr = chart.renderer.rotCorr(baseline, options.rotation); // #3723
dataLabel[isNew ? 'attr' : 'animate']({
x: alignTo.x + options.x + alignTo.width / 2 + rotCorr.x,
y: alignTo.y + options.y + alignTo.height / 2
})
.attr({ // #3003
align: options.align
});
} else {
dataLabel.align(options, null, alignTo);
alignAttr = dataLabel.alignAttr;
// Handle justify or crop
if (pick(options.overflow, 'justify') === 'justify') {
this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew);
} else if (pick(options.crop, true)) {
// Now check that the data label is within the plot area
visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height);
}
// When we're using a shape, make it possible with a connector or an arrow pointing to thie point
if (options.shape) {
dataLabel.attr({
anchorX: point.plotX,
anchorY: point.plotY
});
}
}
}
// Show or hide based on the final aligned position
if (!visible) {
dataLabel.attr({ y: -999 });
dataLabel.placed = false; // don't animate back in
}
};
/**
* If data labels fall partly outside the plot area, align them back in, in a way that
* doesn't hide the point.
*/
Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) {
var chart = this.chart,
align = options.align,
verticalAlign = options.verticalAlign,
off,
justified,
padding = dataLabel.box ? 0 : (dataLabel.padding || 0);
// Off left
off = alignAttr.x + padding;
if (off < 0) {
if (align === 'right') {
options.align = 'left';
} else {
options.x = -off;
}
justified = true;
}
// Off right
off = alignAttr.x + bBox.width - padding;
if (off > chart.plotWidth) {
if (align === 'left') {
options.align = 'right';
} else {
options.x = chart.plotWidth - off;
}
justified = true;
}
// Off top
off = alignAttr.y + padding;
if (off < 0) {
if (verticalAlign === 'bottom') {
options.verticalAlign = 'top';
} else {
options.y = -off;
}
justified = true;
}
// Off bottom
off = alignAttr.y + bBox.height - padding;
if (off > chart.plotHeight) {
if (verticalAlign === 'top') {
options.verticalAlign = 'bottom';
} else {
options.y = chart.plotHeight - off;
}
justified = true;
}
if (justified) {
dataLabel.placed = !isNew;
dataLabel.align(options, null, alignTo);
}
};
/**
* Override the base drawDataLabels method by pie specific functionality
*/
if (seriesTypes.pie) {
seriesTypes.pie.prototype.drawDataLabels = function () {
var series = this,
data = series.data,
point,
chart = series.chart,
options = series.options.dataLabels,
connectorPadding = pick(options.connectorPadding, 10),
connectorWidth = pick(options.connectorWidth, 1),
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
connector,
connectorPath,
softConnector = pick(options.softConnector, true),
distanceOption = options.distance,
seriesCenter = series.center,
radius = seriesCenter[2] / 2,
centerY = seriesCenter[1],
outside = distanceOption > 0,
dataLabel,
dataLabelWidth,
labelPos,
labelHeight,
halves = [// divide the points into right and left halves for anti collision
[], // right
[] // left
],
x,
y,
visibility,
rankArr,
i,
j,
overflow = [0, 0, 0, 0], // top, right, bottom, left
sort = function (a, b) {
return b.y - a.y;
};
// get out if not enabled
if (!series.visible || (!options.enabled && !series._hasPointLabels)) {
return;
}
// run parent method
Series.prototype.drawDataLabels.apply(series);
// arrange points for detection collision
each(data, function (point) {
if (point.dataLabel && point.visible) { // #407, #2510
halves[point.half].push(point);
}
});
/* Loop over the points in each half, starting from the top and bottom
* of the pie to detect overlapping labels.
*/
i = 2;
while (i--) {
var slots = [],
slotsLength,
usedSlots = [],
points = halves[i],
pos,
bottom,
length = points.length,
slotIndex;
if (!length) {
continue;
}
// Sort by angle
series.sortByAngle(points, i - 0.5);
// Assume equal label heights on either hemisphere (#2630)
j = labelHeight = 0;
while (!labelHeight && points[j]) { // #1569
labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968
j++;
}
// Only do anti-collision when we are outside the pie and have connectors (#856)
if (distanceOption > 0) {
// Build the slots
bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight);
for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) {
slots.push(pos);
}
slotsLength = slots.length;
/* Visualize the slots
if (!series.slotElements) {
series.slotElements = [];
}
if (i === 1) {
series.slotElements.forEach(function (elem) {
elem.destroy();
});
series.slotElements.length = 0;
}
slots.forEach(function (pos, no) {
var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0),
slotY = pos + chart.plotTop;
if (!isNaN(slotX)) {
series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1)
.attr({
'stroke-width': 1,
stroke: 'silver',
fill: 'rgba(0,0,255,0.1)'
})
.add());
series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4)
.attr({
fill: 'silver'
}).add());
}
});
// */
// if there are more values than available slots, remove lowest values
if (length > slotsLength) {
// create an array for sorting and ranking the points within each quarter
rankArr = [].concat(points);
rankArr.sort(sort);
j = length;
while (j--) {
rankArr[j].rank = j;
}
j = length;
while (j--) {
if (points[j].rank >= slotsLength) {
points.splice(j, 1);
}
}
length = points.length;
}
// The label goes to the nearest open slot, but not closer to the edge than
// the label's index.
for (j = 0; j < length; j++) {
point = points[j];
labelPos = point.labelPos;
var closest = 9999,
distance,
slotI;
// find the closest slot index
for (slotI = 0; slotI < slotsLength; slotI++) {
distance = mathAbs(slots[slotI] - labelPos[1]);
if (distance < closest) {
closest = distance;
slotIndex = slotI;
}
}
// if that slot index is closer to the edges of the slots, move it
// to the closest appropriate slot
if (slotIndex < j && slots[j] !== null) { // cluster at the top
slotIndex = j;
} else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom
slotIndex = slotsLength - length + j;
while (slots[slotIndex] === null) { // make sure it is not taken
slotIndex++;
}
} else {
// Slot is taken, find next free slot below. In the next run, the next slice will find the
// slot above these, because it is the closest one
while (slots[slotIndex] === null) { // make sure it is not taken
slotIndex++;
}
}
usedSlots.push({ i: slotIndex, y: slots[slotIndex] });
slots[slotIndex] = null; // mark as taken
}
// sort them in order to fill in from the top
usedSlots.sort(sort);
}
// now the used slots are sorted, fill them up sequentially
for (j = 0; j < length; j++) {
var slot, naturalY;
point = points[j];
labelPos = point.labelPos;
dataLabel = point.dataLabel;
visibility = point.visible === false ? HIDDEN : VISIBLE;
naturalY = labelPos[1];
if (distanceOption > 0) {
slot = usedSlots.pop();
slotIndex = slot.i;
// if the slot next to currrent slot is free, the y value is allowed
// to fall back to the natural position
y = slot.y;
if ((naturalY > y && slots[slotIndex + 1] !== null) ||
(naturalY < y && slots[slotIndex - 1] !== null)) {
y = mathMin(mathMax(0, naturalY), chart.plotHeight);
}
} else {
y = naturalY;
}
// get the x - use the natural x position for first and last slot, to prevent the top
// and botton slice connectors from touching each other on either side
x = options.justify ?
seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) :
series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i);
// Record the placement and visibility
dataLabel._attr = {
visibility: visibility,
align: labelPos[6]
};
dataLabel._pos = {
x: x + options.x +
({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0),
y: y + options.y - 10 // 10 is for the baseline (label vs text)
};
dataLabel.connX = x;
dataLabel.connY = y;
// Detect overflowing data labels
if (this.options.size === null) {
dataLabelWidth = dataLabel.width;
// Overflow left
if (x - dataLabelWidth < connectorPadding) {
overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]);
// Overflow right
} else if (x + dataLabelWidth > plotWidth - connectorPadding) {
overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]);
}
// Overflow top
if (y - labelHeight / 2 < 0) {
overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]);
// Overflow left
} else if (y + labelHeight / 2 > plotHeight) {
overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]);
}
}
} // for each point
} // for each half
// Do not apply the final placement and draw the connectors until we have verified
// that labels are not spilling over.
if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) {
// Place the labels in the final position
this.placeDataLabels();
// Draw the connectors
if (outside && connectorWidth) {
each(this.points, function (point) {
connector = point.connector;
labelPos = point.labelPos;
dataLabel = point.dataLabel;
if (dataLabel && dataLabel._pos) {
visibility = dataLabel._attr.visibility;
x = dataLabel.connX;
y = dataLabel.connY;
connectorPath = softConnector ? [
M,
x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
'C',
x, y, // first break, next to the label
2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5],
labelPos[2], labelPos[3], // second break
L,
labelPos[4], labelPos[5] // base
] : [
M,
x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
L,
labelPos[2], labelPos[3], // second break
L,
labelPos[4], labelPos[5] // base
];
if (connector) {
connector.animate({ d: connectorPath });
connector.attr('visibility', visibility);
} else {
point.connector = connector = series.chart.renderer.path(connectorPath).attr({
'stroke-width': connectorWidth,
stroke: options.connectorColor || point.color || '#606060',
visibility: visibility
//zIndex: 0 // #2722 (reversed)
})
.add(series.dataLabelsGroup);
}
} else if (connector) {
point.connector = connector.destroy();
}
});
}
}
};
/**
* Perform the final placement of the data labels after we have verified that they
* fall within the plot area.
*/
seriesTypes.pie.prototype.placeDataLabels = function () {
each(this.points, function (point) {
var dataLabel = point.dataLabel,
_pos;
if (dataLabel) {
_pos = dataLabel._pos;
if (_pos) {
dataLabel.attr(dataLabel._attr);
dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos);
dataLabel.moved = true;
} else if (dataLabel) {
dataLabel.attr({ y: -999 });
}
}
});
};
seriesTypes.pie.prototype.alignDataLabel = noop;
/**
* Verify whether the data labels are allowed to draw, or we should run more translation and data
* label positioning to keep them inside the plot area. Returns true when data labels are ready
* to draw.
*/
seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) {
var center = this.center,
options = this.options,
centerOption = options.center,
minSize = options.minSize || 80,
newSize = minSize,
ret;
// Handle horizontal size and center
if (centerOption[0] !== null) { // Fixed center
newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize);
} else { // Auto center
newSize = mathMax(
center[2] - overflow[1] - overflow[3], // horizontal overflow
minSize
);
center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center
}
// Handle vertical size and center
if (centerOption[1] !== null) { // Fixed center
newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize);
} else { // Auto center
newSize = mathMax(
mathMin(
newSize,
center[2] - overflow[0] - overflow[2] // vertical overflow
),
minSize
);
center[1] += (overflow[0] - overflow[2]) / 2; // vertical center
}
// If the size must be decreased, we need to run translate and drawDataLabels again
if (newSize < center[2]) {
center[2] = newSize;
this.translate(center);
each(this.points, function (point) {
if (point.dataLabel) {
point.dataLabel._pos = null; // reset
}
});
if (this.drawDataLabels) {
this.drawDataLabels();
}
// Else, return true to indicate that the pie and its labels is within the plot area
} else {
ret = true;
}
return ret;
};
}
if (seriesTypes.column) {
/**
* Override the basic data label alignment by adjusting for the position of the column
*/
seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
var inverted = this.chart.inverted,
series = point.series,
dlBox = point.dlBox || point.shapeArgs, // data label box for alignment
below = point.below || (point.plotY > pick(this.translatedThreshold, series.yAxis.len)),
inside = pick(options.inside, !!this.options.stacking); // draw it inside the box?
// Align to the column itself, or the top of it
if (dlBox) { // Area range uses this method but not alignTo
alignTo = merge(dlBox);
if (inverted) {
alignTo = {
x: series.yAxis.len - alignTo.y - alignTo.height,
y: series.xAxis.len - alignTo.x - alignTo.width,
width: alignTo.height,
height: alignTo.width
};
}
// Compute the alignment box
if (!inside) {
if (inverted) {
alignTo.x += below ? 0 : alignTo.width;
alignTo.width = 0;
} else {
alignTo.y += below ? alignTo.height : 0;
alignTo.height = 0;
}
}
}
// When alignment is undefined (typically columns and bars), display the individual
// point below or above the point depending on the threshold
options.align = pick(
options.align,
!inverted || inside ? 'center' : below ? 'right' : 'left'
);
options.verticalAlign = pick(
options.verticalAlign,
inverted || inside ? 'middle' : below ? 'top' : 'bottom'
);
// Call the parent method
Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);
};
}
/**
* Highcharts JS v4.1.2 (2015-02-27)
* Highcharts module to hide overlapping data labels. This module is included by default in Highmaps.
*
* (c) 2010-2014 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/*global Highcharts, HighchartsAdapter */
(function (H) {
var Chart = H.Chart,
each = H.each,
addEvent = HighchartsAdapter.addEvent;
// Collect potensial overlapping data labels. Stack labels probably don't need to be
// considered because they are usually accompanied by data labels that lie inside the columns.
Chart.prototype.callbacks.push(function (chart) {
function collectAndHide() {
var labels = [];
each(chart.series, function (series) {
var dlOptions = series.options.dataLabels;
if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap && series.visible) { // #3866
each(series.points, function (point) {
if (point.dataLabel) {
point.dataLabel.labelrank = point.labelrank;
labels.push(point.dataLabel);
}
});
}
});
chart.hideOverlappingLabels(labels);
}
// Do it now ...
collectAndHide();
// ... and after each chart redraw
addEvent(chart, 'redraw', collectAndHide);
});
/**
* Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth
* visual imression.
*/
Chart.prototype.hideOverlappingLabels = function (labels) {
var len = labels.length,
label,
i,
j,
label1,
label2,
intersectRect = function (pos1, pos2, size1, size2) {
return !(
pos2.x > pos1.x + size1.width ||
pos2.x + size2.width < pos1.x ||
pos2.y > pos1.y + size1.height ||
pos2.y + size2.height < pos1.y
);
};
// Mark with initial opacity
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
label.oldOpacity = label.opacity;
label.newOpacity = 1;
}
}
// Detect overlapping labels
for (i = 0; i < len; i++) {
label1 = labels[i];
for (j = i + 1; j < len; ++j) {
label2 = labels[j];
if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0 &&
intersectRect(label1.alignAttr, label2.alignAttr, label1, label2)) {
(label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0;
}
}
}
// Hide or show
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
if (label.oldOpacity !== label.newOpacity && label.placed) {
label.alignAttr.opacity = label.newOpacity;
label[label.isOld && label.newOpacity ? 'animate' : 'attr'](label.alignAttr);
}
label.isOld = true;
}
}
};
}(Highcharts));/**
* TrackerMixin for points and graphs
*/
var TrackerMixin = Highcharts.TrackerMixin = {
drawTrackerPoint: function () {
var series = this,
chart = series.chart,
pointer = chart.pointer,
cursor = series.options.cursor,
css = cursor && { cursor: cursor },
onMouseOver = function (e) {
var target = e.target,
point;
if (chart.hoverSeries !== series) {
series.onMouseOver();
}
while (target && !point) {
point = target.point;
target = target.parentNode;
}
if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart
point.onMouseOver(e);
}
};
// Add reference to the point
each(series.points, function (point) {
if (point.graphic) {
point.graphic.element.point = point;
}
if (point.dataLabel) {
point.dataLabel.element.point = point;
}
});
// Add the event listeners, we need to do this only once
if (!series._hasTracking) {
each(series.trackerGroups, function (key) {
if (series[key]) { // we don't always have dataLabelsGroup
series[key]
.addClass(PREFIX + 'tracker')
.on('mouseover', onMouseOver)
.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
.css(css);
if (hasTouch) {
series[key].on('touchstart', onMouseOver);
}
}
});
series._hasTracking = true;
}
},
/**
* Draw the tracker object that sits above all data labels and markers to
* track mouse events on the graph or points. For the line type charts
* the tracker uses the same graphPath, but with a greater stroke width
* for better control.
*/
drawTrackerGraph: function () {
var series = this,
options = series.options,
trackByArea = options.trackByArea,
trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath),
trackerPathLength = trackerPath.length,
chart = series.chart,
pointer = chart.pointer,
renderer = chart.renderer,
snap = chart.options.tooltip.snap,
tracker = series.tracker,
cursor = options.cursor,
css = cursor && { cursor: cursor },
singlePoints = series.singlePoints,
singlePoint,
i,
onMouseOver = function () {
if (chart.hoverSeries !== series) {
series.onMouseOver();
}
},
/*
* Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable
* IE6: 0.002
* IE7: 0.002
* IE8: 0.002
* IE9: 0.00000000001 (unlimited)
* IE10: 0.0001 (exporting only)
* FF: 0.00000000001 (unlimited)
* Chrome: 0.000001
* Safari: 0.000001
* Opera: 0.00000000001 (unlimited)
*/
TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')';
// Extend end points. A better way would be to use round linecaps,
// but those are not clickable in VML.
if (trackerPathLength && !trackByArea) {
i = trackerPathLength + 1;
while (i--) {
if (trackerPath[i] === M) { // extend left side
trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L);
}
if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side
trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]);
}
}
}
// handle single points
for (i = 0; i < singlePoints.length; i++) {
singlePoint = singlePoints[i];
trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY,
L, singlePoint.plotX + snap, singlePoint.plotY);
}
// draw the tracker
if (tracker) {
tracker.attr({ d: trackerPath });
} else { // create
series.tracker = renderer.path(trackerPath)
.attr({
'stroke-linejoin': 'round', // #1225
visibility: series.visible ? VISIBLE : HIDDEN,
stroke: TRACKER_FILL,
fill: trackByArea ? TRACKER_FILL : NONE,
'stroke-width' : options.lineWidth + (trackByArea ? 0 : 2 * snap),
zIndex: 2
})
.add(series.group);
// The tracker is added to the series group, which is clipped, but is covered
// by the marker group. So the marker group also needs to capture events.
each([series.tracker, series.markerGroup], function (tracker) {
tracker.addClass(PREFIX + 'tracker')
.on('mouseover', onMouseOver)
.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
.css(css);
if (hasTouch) {
tracker.on('touchstart', onMouseOver);
}
});
}
}
};
/* End TrackerMixin */
/**
* Add tracking event listener to the series group, so the point graphics
* themselves act as trackers
*/
if (seriesTypes.column) {
ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
if (seriesTypes.pie) {
seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
if (seriesTypes.scatter) {
ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
/*
* Extend Legend for item events
*/
extend(Legend.prototype, {
setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) {
var legend = this;
// Set the events on the item group, or in case of useHTML, the item itself (#1249)
(useHTML ? legendItem : item.legendGroup).on('mouseover', function () {
item.setState(HOVER_STATE);
legendItem.css(legend.options.itemHoverStyle);
})
.on('mouseout', function () {
legendItem.css(item.visible ? itemStyle : itemHiddenStyle);
item.setState();
})
.on('click', function (event) {
var strLegendItemClick = 'legendItemClick',
fnLegendItemClick = function () {
item.setVisible();
};
// Pass over the click/touch event. #4.
event = {
browserEvent: event
};
// click the name or symbol
if (item.firePointEvent) { // point
item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);
} else {
fireEvent(item, strLegendItemClick, event, fnLegendItemClick);
}
});
},
createCheckboxForItem: function (item) {
var legend = this;
item.checkbox = createElement('input', {
type: 'checkbox',
checked: item.selected,
defaultChecked: item.selected // required by IE7
}, legend.options.itemCheckboxStyle, legend.chart.container);
addEvent(item.checkbox, 'click', function (event) {
var target = event.target;
fireEvent(item.series || item, 'checkboxClick', { // #3712
checked: target.checked,
item: item
},
function () {
item.select();
}
);
});
}
});
/*
* Add pointer cursor to legend itemstyle in defaultOptions
*/
defaultOptions.legend.itemStyle.cursor = 'pointer';
/*
* Extend the Chart object with interaction
*/
extend(Chart.prototype, {
/**
* Display the zoom button
*/
showResetZoom: function () {
var chart = this,
lang = defaultOptions.lang,
btnOptions = chart.options.chart.resetZoomButton,
theme = btnOptions.theme,
states = theme.states,
alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox';
this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, function () { chart.zoomOut(); }, theme, states && states.hover)
.attr({
align: btnOptions.position.align,
title: lang.resetZoomTitle
})
.add()
.align(btnOptions.position, false, alignTo);
},
/**
* Zoom out to 1:1
*/
zoomOut: function () {
var chart = this;
fireEvent(chart, 'selection', { resetSelection: true }, function () {
chart.zoom();
});
},
/**
* Zoom into a given portion of the chart given by axis coordinates
* @param {Object} event
*/
zoom: function (event) {
var chart = this,
hasZoomed,
pointer = chart.pointer,
displayButton = false,
resetZoomButton;
// If zoom is called with no arguments, reset the axes
if (!event || event.resetSelection) {
each(chart.axes, function (axis) {
hasZoomed = axis.zoom();
});
} else { // else, zoom in on all axes
each(event.xAxis.concat(event.yAxis), function (axisData) {
var axis = axisData.axis,
isXAxis = axis.isXAxis;
// don't zoom more than minRange
if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) {
hasZoomed = axis.zoom(axisData.min, axisData.max);
if (axis.displayBtn) {
displayButton = true;
}
}
});
}
// Show or hide the Reset zoom button
resetZoomButton = chart.resetZoomButton;
if (displayButton && !resetZoomButton) {
chart.showResetZoom();
} else if (!displayButton && isObject(resetZoomButton)) {
chart.resetZoomButton = resetZoomButton.destroy();
}
// Redraw
if (hasZoomed) {
chart.redraw(
pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation
);
}
},
/**
* Pan the chart by dragging the mouse across the pane. This function is called
* on mouse move, and the distance to pan is computed from chartX compared to
* the first chartX position in the dragging operation.
*/
pan: function (e, panning) {
var chart = this,
hoverPoints = chart.hoverPoints,
doRedraw;
// remove active points for shared tooltip
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps
var mousePos = e[isX ? 'chartX' : 'chartY'],
axis = chart[isX ? 'xAxis' : 'yAxis'][0],
startPos = chart[isX ? 'mouseDownX' : 'mouseDownY'],
halfPointRange = (axis.pointRange || 0) / 2,
extremes = axis.getExtremes(),
newMin = axis.toValue(startPos - mousePos, true) + halfPointRange,
newMax = axis.toValue(startPos + chart[isX ? 'plotWidth' : 'plotHeight'] - mousePos, true) - halfPointRange,
goingLeft = startPos > mousePos; // #3613
if (axis.series.length &&
(goingLeft || newMin > mathMin(extremes.dataMin, extremes.min)) &&
(!goingLeft || newMax < mathMax(extremes.dataMax, extremes.max))) {
axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' });
doRedraw = true;
}
chart[isX ? 'mouseDownX' : 'mouseDownY'] = mousePos; // set new reference for next run
});
if (doRedraw) {
chart.redraw(false);
}
css(chart.container, { cursor: 'move' });
}
});
/*
* Extend the Point object with interaction
*/
extend(Point.prototype, {
/**
* Toggle the selection status of a point
* @param {Boolean} selected Whether to select or unselect the point.
* @param {Boolean} accumulate Whether to add to the previous selection. By default,
* this happens if the control key (Cmd on Mac) was pressed during clicking.
*/
select: function (selected, accumulate) {
var point = this,
series = point.series,
chart = series.chart;
selected = pick(selected, !point.selected);
// fire the event with the defalut handler
point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () {
point.selected = point.options.selected = selected;
series.options.data[inArray(point, series.data)] = point.options;
point.setState(selected && SELECT_STATE);
// unselect all other points unless Ctrl or Cmd + click
if (!accumulate) {
each(chart.getSelectedPoints(), function (loopPoint) {
if (loopPoint.selected && loopPoint !== point) {
loopPoint.selected = loopPoint.options.selected = false;
series.options.data[inArray(loopPoint, series.data)] = loopPoint.options;
loopPoint.setState(NORMAL_STATE);
loopPoint.firePointEvent('unselect');
}
});
}
});
},
/**
* Runs on mouse over the point
*/
onMouseOver: function (e) {
var point = this,
series = point.series,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// set normal state to previous series
if (hoverPoint && hoverPoint !== point) {
hoverPoint.onMouseOut();
}
// trigger the event
point.firePointEvent('mouseOver');
// update the tooltip
if (tooltip && (!tooltip.shared || series.noSharedTooltip)) {
tooltip.refresh(point, e);
}
// hover this
point.setState(HOVER_STATE);
chart.hoverPoint = point;
},
/**
* Runs on mouse out from the point
*/
onMouseOut: function () {
var chart = this.series.chart,
hoverPoints = chart.hoverPoints;
this.firePointEvent('mouseOut');
if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240
this.setState();
chart.hoverPoint = null;
}
},
/**
* Import events from the series' and point's options. Only do it on
* demand, to save processing time on hovering.
*/
importEvents: function () {
if (!this.hasImportedEvents) {
var point = this,
options = merge(point.series.options.point, point.options),
events = options.events,
eventType;
point.events = events;
for (eventType in events) {
addEvent(point, eventType, events[eventType]);
}
this.hasImportedEvents = true;
}
},
/**
* Set the point's state
* @param {String} state
*/
setState: function (state, move) {
var point = this,
plotX = point.plotX,
plotY = point.plotY,
series = point.series,
stateOptions = series.options.states,
markerOptions = defaultPlotOptions[series.type].marker && series.options.marker,
normalDisabled = markerOptions && !markerOptions.enabled,
markerStateOptions = markerOptions && markerOptions.states[state],
stateDisabled = markerStateOptions && markerStateOptions.enabled === false,
stateMarkerGraphic = series.stateMarkerGraphic,
pointMarker = point.marker || {},
chart = series.chart,
radius,
halo = series.halo,
haloOptions,
newSymbol,
pointAttr;
state = state || NORMAL_STATE; // empty string
pointAttr = point.pointAttr[state] || series.pointAttr[state];
if (
// already has this state
(state === point.state && !move) ||
// selected points don't respond to hover
(point.selected && state !== SELECT_STATE) ||
// series' state options is disabled
(stateOptions[state] && stateOptions[state].enabled === false) ||
// general point marker's state options is disabled
(state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) ||
// individual point marker's state options is disabled
(state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610
) {
return;
}
// apply hover styles to the existing point
if (point.graphic) {
radius = markerOptions && point.graphic.symbolName && pointAttr.r;
point.graphic.attr(merge(
pointAttr,
radius ? { // new symbol attributes (#507, #612)
x: plotX - radius,
y: plotY - radius,
width: 2 * radius,
height: 2 * radius
} : {}
));
// Zooming in from a range with no markers to a range with markers
if (stateMarkerGraphic) {
stateMarkerGraphic.hide();
}
} else {
// if a graphic is not applied to each point in the normal state, create a shared
// graphic for the hover state
if (state && markerStateOptions) {
radius = markerStateOptions.radius;
newSymbol = pointMarker.symbol || series.symbol;
// If the point has another symbol than the previous one, throw away the
// state marker graphic and force a new one (#1459)
if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) {
stateMarkerGraphic = stateMarkerGraphic.destroy();
}
// Add a new state marker graphic
if (!stateMarkerGraphic) {
if (newSymbol) {
series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol(
newSymbol,
plotX - radius,
plotY - radius,
2 * radius,
2 * radius
)
.attr(pointAttr)
.add(series.markerGroup);
stateMarkerGraphic.currentSymbol = newSymbol;
}
// Move the existing graphic
} else {
stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054
x: plotX - radius,
y: plotY - radius
});
}
}
if (stateMarkerGraphic) {
stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450
}
}
// Show me your halo
haloOptions = stateOptions[state] && stateOptions[state].halo;
if (haloOptions && haloOptions.size) {
if (!halo) {
series.halo = halo = chart.renderer.path()
.add(chart.seriesGroup);
}
halo.attr(extend({
fill: Color(point.color || series.color).setOpacity(haloOptions.opacity).get()
}, haloOptions.attributes))[move ? 'animate' : 'attr']({
d: point.haloPath(haloOptions.size)
});
} else if (halo) {
halo.attr({ d: [] });
}
point.state = state;
},
haloPath: function (size) {
var series = this.series,
chart = series.chart,
plotBox = series.getPlotBox(),
inverted = chart.inverted;
return chart.renderer.symbols.circle(
plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : this.plotX) - size,
plotBox.translateY + (inverted ? series.xAxis.len - this.plotX : this.plotY) - size,
size * 2,
size * 2
);
}
});
/*
* Extend the Series object with interaction
*/
extend(Series.prototype, {
/**
* Series mouse over handler
*/
onMouseOver: function () {
var series = this,
chart = series.chart,
hoverSeries = chart.hoverSeries;
// set normal state to previous series
if (hoverSeries && hoverSeries !== series) {
hoverSeries.onMouseOut();
}
// trigger the event, but to save processing time,
// only if defined
if (series.options.events.mouseOver) {
fireEvent(series, 'mouseOver');
}
// hover this
series.setState(HOVER_STATE);
chart.hoverSeries = series;
},
/**
* Series mouse out handler
*/
onMouseOut: function () {
// trigger the event only if listeners exist
var series = this,
options = series.options,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// trigger mouse out on the point, which must be in this series
if (hoverPoint) {
hoverPoint.onMouseOut();
}
// fire the mouse out event
if (series && options.events.mouseOut) {
fireEvent(series, 'mouseOut');
}
// hide the tooltip
if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) {
tooltip.hide();
}
// set normal state
series.setState();
chart.hoverSeries = null;
},
/**
* Set the state of the graph
*/
setState: function (state) {
var series = this,
options = series.options,
graph = series.graph,
graphNeg = series.graphNeg,
stateOptions = options.states,
lineWidth = options.lineWidth,
attribs;
state = state || NORMAL_STATE;
if (series.state !== state) {
series.state = state;
if (stateOptions[state] && stateOptions[state].enabled === false) {
return;
}
if (state) {
lineWidth = (stateOptions[state].lineWidth || lineWidth) + (stateOptions[state].lineWidthPlus || 0);
}
if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML
attribs = {
'stroke-width': lineWidth
};
// use attr because animate will cause any other animation on the graph to stop
graph.attr(attribs);
if (graphNeg) {
graphNeg.attr(attribs);
}
}
}
},
/**
* Set the visibility of the graph
*
* @param vis {Boolean} True to show the series, false to hide. If UNDEFINED,
* the visibility is toggled.
*/
setVisible: function (vis, redraw) {
var series = this,
chart = series.chart,
legendItem = series.legendItem,
showOrHide,
ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries,
oldVisibility = series.visible;
// if called without an argument, toggle visibility
series.visible = vis = series.userOptions.visible = vis === UNDEFINED ? !oldVisibility : vis;
showOrHide = vis ? 'show' : 'hide';
// show or hide elements
each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) {
if (series[key]) {
series[key][showOrHide]();
}
});
// hide tooltip (#1361)
if (chart.hoverSeries === series || (chart.hoverPoint && chart.hoverPoint.series) === series) {
series.onMouseOut();
}
if (legendItem) {
chart.legend.colorizeItem(series, vis);
}
// rescale or adapt to resized chart
series.isDirty = true;
// in a stack, all other series are affected
if (series.options.stacking) {
each(chart.series, function (otherSeries) {
if (otherSeries.options.stacking && otherSeries.visible) {
otherSeries.isDirty = true;
}
});
}
// show or hide linked series
each(series.linkedSeries, function (otherSeries) {
otherSeries.setVisible(vis, false);
});
if (ignoreHiddenSeries) {
chart.isDirtyBox = true;
}
if (redraw !== false) {
chart.redraw();
}
fireEvent(series, showOrHide);
},
/**
* Show the graph
*/
show: function () {
this.setVisible(true);
},
/**
* Hide the graph
*/
hide: function () {
this.setVisible(false);
},
/**
* Set the selected state of the graph
*
* @param selected {Boolean} True to select the series, false to unselect. If
* UNDEFINED, the selection state is toggled.
*/
select: function (selected) {
var series = this;
// if called without an argument, toggle
series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;
if (series.checkbox) {
series.checkbox.checked = selected;
}
fireEvent(series, selected ? 'select' : 'unselect');
},
drawTracker: TrackerMixin.drawTrackerGraph
});
// global variables
extend(Highcharts, {
// Constructors
Color: Color,
Point: Point,
Tick: Tick,
Renderer: Renderer,
SVGElement: SVGElement,
SVGRenderer: SVGRenderer,
// Various
arrayMin: arrayMin,
arrayMax: arrayMax,
charts: charts,
dateFormat: dateFormat,
error: error,
format: format,
pathAnim: pathAnim,
getOptions: getOptions,
hasBidiBug: hasBidiBug,
isTouchDevice: isTouchDevice,
setOptions: setOptions,
addEvent: addEvent,
removeEvent: removeEvent,
createElement: createElement,
discardElement: discardElement,
css: css,
each: each,
map: map,
merge: merge,
splat: splat,
extendClass: extendClass,
pInt: pInt,
svg: hasSVG,
canvas: useCanVG,
vml: !hasSVG && !useCanVG,
product: PRODUCT,
version: VERSION
});
}());
|
fields/types/cloudinaryimage/CloudinaryImageField.js
|
joerter/keystone
|
import xhr from 'xhr';
import React from 'react';
import ReactDOM from 'react-dom';
import Field from '../Field';
import Select from 'react-select';
import { Button, FormField, FormInput, FormNote } from 'elemental';
import Lightbox from '../../components/Lightbox';
import classnames from 'classnames';
const SUPPORTED_TYPES = ['image/gif', 'image/png', 'image/jpeg', 'image/bmp', 'image/x-icon', 'application/pdf', 'image/x-tiff', 'image/x-tiff', 'application/postscript', 'image/vnd.adobe.photoshop', 'image/svg+xml'];
const iconClassUploadPending = [
'upload-pending',
'mega-octicon',
'octicon-cloud-upload',
];
const iconClassDeletePending = [
'delete-pending',
'mega-octicon',
'octicon-x',
];
module.exports = Field.create({
displayName: 'CloudinaryImageField',
openLightbox (index) {
event.preventDefault();
this.setState({
lightboxIsVisible: true,
lightboxImageIndex: index,
});
},
closeLightbox () {
this.setState({
lightboxIsVisible: false,
lightboxImageIndex: null,
});
},
renderLightbox () {
const { value } = this.props;
if (!value || !Object.keys(value).length) return;
const images = [value.url];
return (
<Lightbox
images={images}
initialImage={this.state.lightboxImageIndex}
isOpen={this.state.lightboxIsVisible}
onCancel={this.closeLightbox}
/>
);
},
fileFieldNode () {
return ReactDOM.findDOMNode(this.refs.fileField);
},
changeImage () {
this.fileFieldNode().click();
},
getImageSource () {
if (this.hasLocal()) {
return this.state.localSource;
} else if (this.hasExisting()) {
return this.props.value.url;
} else {
return null;
}
},
getImageURL () {
if (!this.hasLocal() && this.hasExisting()) {
return this.props.value.url;
}
},
/**
* Reset origin and removal.
*/
undoRemove () {
this.fileFieldNode().value = '';
this.setState({
removeExisting: false,
localSource: null,
origin: false,
action: null,
});
},
/**
* Check support for input files on input change.
*/
fileChanged (event) {
var self = this;
if (window.FileReader) {
var files = event.target.files;
Array.prototype.forEach.call(files, function (f) {
if (SUPPORTED_TYPES.indexOf(f.type) === -1) {
self.removeImage();
alert('Unsupported file type. Supported formats are: GIF, PNG, JPG, BMP, ICO, PDF, TIFF, EPS, PSD, SVG');
return false;
}
var fileReader = new FileReader();
fileReader.onload = function (e) {
if (!self.isMounted()) return;
self.setState({
localSource: e.target.result,
origin: 'local',
});
};
fileReader.readAsDataURL(f);
});
} else {
this.setState({
origin: 'local',
});
}
},
/**
* If we have a local file added then remove it and reset the file field.
*/
removeImage (e) {
var state = {
localSource: null,
origin: false,
};
if (this.hasLocal()) {
this.fileFieldNode().value = '';
} else if (this.hasExisting()) {
state.removeExisting = true;
if (this.props.autoCleanup) {
if (e.altKey) {
state.action = 'reset';
} else {
state.action = 'delete';
}
} else {
if (e.altKey) {
state.action = 'delete';
} else {
state.action = 'reset';
}
}
}
this.setState(state);
},
/**
* Is the currently active image uploaded in this session?
*/
hasLocal () {
return this.state.origin === 'local';
},
/**
* Do we have an image preview to display?
*/
hasImage () {
return this.hasExisting() || this.hasLocal();
},
/**
* Do we have an existing file?
*/
hasExisting () {
return !!this.props.value.url;
},
/**
* Render an image preview
*/
renderImagePreview () {
var iconClassName;
var className = ['image-preview'];
if (this.hasLocal()) {
iconClassName = classnames(iconClassUploadPending);
} else if (this.state.removeExisting) {
className.push(' removed');
iconClassName = classnames(iconClassDeletePending);
}
className = classnames(className);
var body = [this.renderImagePreviewThumbnail()];
if (iconClassName) body.push(<div key={this.props.path + '_preview_icon'} className={iconClassName} />);
var url = this.getImageURL();
if (url) {
body = <a className="img-thumbnail" href={this.getImageURL()} onClick={this.openLightbox.bind(this, 0)} target="__blank">{body}</a>;
} else {
body = <div className="img-thumbnail">{body}</div>;
}
return <div key={this.props.path + '_preview'} className={className}>{body}</div>;
},
renderImagePreviewThumbnail () {
var url = this.getImageURL();
if (url) {
// add cloudinary thumbnail parameters to the url
url = url.replace(/image\/upload/, 'image/upload/c_thumb,g_face,h_90,w_90');
} else {
url = this.getImageSource();
}
return <img key={this.props.path + '_preview_thumbnail'} className="img-load" style={{ height: '90' }} src={url} />;
},
/**
* Render image details - leave these out if we're uploading a local file or
* the existing file is to be removed.
*/
renderImageDetails (add) {
var values = null;
if (!this.hasLocal() && !this.state.removeExisting) {
values = (
<div className="image-values">
<FormInput noedit>{this.props.value.url}</FormInput>
{/*
TODO: move this somewhere better when appropriate
this.renderImageDimensions()
*/}
</div>
);
}
return (
<div key={this.props.path + '_details'} className="image-details">
{values}
{add}
</div>
);
},
renderImageDimensions () {
return <FormInput noedit>{this.props.value.width} x {this.props.value.height}</FormInput>;
},
/**
* Render an alert.
*
* - On a local file, output a "to be uploaded" message.
* - On a cloudinary file, output a "from cloudinary" message.
* - On removal of existing file, output a "save to remove" message.
*/
renderAlert () {
if (this.hasLocal()) {
return (
<FormInput noedit>Image selected - save to upload</FormInput>
);
} else if (this.state.origin === 'cloudinary') {
return (
<FormInput noedit>Image selected from Cloudinary</FormInput>
);
} else if (this.state.removeExisting) {
return (
<FormInput noedit>Image {this.props.autoCleanup ? 'deleted' : 'removed'} - save to confirm</FormInput>
);
} else {
return null;
}
},
/**
* Output clear/delete/remove button.
*
* - On removal of existing image, output "undo remove" button.
* - Otherwise output Cancel/Delete image button.
*/
renderClearButton () {
if (this.state.removeExisting) {
return (
<Button type="link" onClick={this.undoRemove}>
Undo Remove
</Button>
);
} else {
var clearText;
if (this.hasLocal()) {
clearText = 'Cancel';
} else {
clearText = (this.props.autoCleanup ? 'Delete Image' : 'Remove Image');
}
return (
<Button type="link-cancel" onClick={this.removeImage}>
{clearText}
</Button>
);
}
},
renderFileField () {
return <input ref="fileField" type="file" name={this.props.paths.upload} className="field-upload" onChange={this.fileChanged} tabIndex="-1" />;
},
renderFileAction () {
return <input type="hidden" name={this.props.paths.action} className="field-action" value={this.state.action} />;
},
renderImageToolbar () {
return (
<div key={this.props.path + '_toolbar'} className="image-toolbar">
<div className="u-float-left">
<Button onClick={this.changeImage}>
{this.hasImage() ? 'Change' : 'Upload'} Image
</Button>
{this.hasImage() && this.renderClearButton()}
</div>
{this.props.select && this.renderImageSelect()}
</div>
);
},
renderImageSelect () {
var selectPrefix = this.props.selectPrefix;
var self = this;
var getOptions = function (input, callback) {
// build our url, accounting for selectPrefix
var uri = Keystone.adminPath + '/api/cloudinary/autocomplete';
if (selectPrefix) {
uri = uri + '?prefix=' + selectPrefix;
}
// make the request
xhr({
body: JSON.stringify({
q: input,
}),
uri: uri,
headers: {
'Content-Type': 'application/json',
},
}, function (err, resp, body) {
// callback with err
if (err) {
callback(null, {
options: [],
complete: false,
});
return;
}
// try and parse the response
try {
var data = JSON.parse(body);
var options = [];
data.items.forEach(function (item) {
options.push({
value: item.public_id,
label: item.public_id,
});
});
callback(null, {
options: options,
complete: true,
});
} catch (e) {
callback(null, {
options: [],
complete: false,
});
}
});
};
// listen for changes
var onChange = function onChange (data) {
if (data && data.value) {
self.setState({ selectedCloudinaryImage: data.value });
} else {
self.setState({ selectedCloudinaryImage: null });
}
};
return (
<div className="image-select">
<Select.Async
placeholder="Search for an image from Cloudinary ..."
name={this.props.paths.select}
value={this.state.selectedCloudinaryImage}
onChange={onChange}
id={'field_' + this.props.paths.select}
loadOptions={getOptions}
/>
</div>
);
},
renderNote () {
if (!this.props.note) return null;
return <FormNote note={this.props.note} />;
},
renderUI () {
var container = [];
var body = [];
var hasImage = this.hasImage();
if (this.shouldRenderField()) {
if (hasImage) {
container.push(this.renderImagePreview());
container.push(this.renderImageDetails(this.renderAlert()));
}
body.push(this.renderImageToolbar());
} else {
if (hasImage) {
container.push(this.renderImagePreview());
container.push(this.renderImageDetails());
} else {
container.push(<div className="help-block">no image</div>);
}
}
return (
<FormField label={this.props.label} className="field-type-cloudinaryimage">
{this.renderFileField()}
{this.renderFileAction()}
<div className="image-container">{container}</div>
{body}
{this.renderNote()}
{this.renderLightbox()}
</FormField>
);
},
});
|
ajax/libs/webshim/1.15.3/dev/shims/moxie/js/moxie-swf.js
|
nareshs435/cdnjs
|
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.2.1
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2014-05-14
*/
/**
* Compiled inline version. (Library mode)
*/
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
/*globals $code */
(function(exports, undefined) {
"use strict";
var modules = {};
function require(ids, callback) {
var module, defs = [];
for (var i = 0; i < ids.length; ++i) {
module = modules[ids[i]] || resolve(ids[i]);
if (!module) {
throw 'module definition dependecy not found: ' + ids[i];
}
defs.push(module);
}
callback.apply(null, defs);
}
function define(id, dependencies, definition) {
if (typeof id !== 'string') {
throw 'invalid module definition, module id must be defined and be a string';
}
if (dependencies === undefined) {
throw 'invalid module definition, dependencies must be specified';
}
if (definition === undefined) {
throw 'invalid module definition, definition function must be specified';
}
require(dependencies, function() {
modules[id] = definition.apply(null, arguments);
});
}
function defined(id) {
return !!modules[id];
}
function resolve(id) {
var target = exports;
var fragments = id.split(/[.\/]/);
for (var fi = 0; fi < fragments.length; ++fi) {
if (!target[fragments[fi]]) {
return;
}
target = target[fragments[fi]];
}
return target;
}
function expose(ids) {
for (var i = 0; i < ids.length; i++) {
var target = exports;
var id = ids[i];
var fragments = id.split(/[.\/]/);
for (var fi = 0; fi < fragments.length - 1; ++fi) {
if (target[fragments[fi]] === undefined) {
target[fragments[fi]] = {};
}
target = target[fragments[fi]];
}
target[fragments[fragments.length - 1]] = modules[id];
}
}
// Included from: src/javascript/core/utils/Basic.js
/**
* Basic.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Basic', [], function() {
/**
Gets the true type of the built-in object (better version of typeof).
@author Angus Croll (http://javascriptweblog.wordpress.com/)
@method typeOf
@for Utils
@static
@param {Object} o Object to check.
@return {String} Object [[Class]]
*/
var typeOf = function(o) {
var undef;
if (o === undef) {
return 'undefined';
} else if (o === null) {
return 'null';
} else if (o.nodeType) {
return 'node';
}
// the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8
return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
};
/**
Extends the specified object with another object.
@method extend
@static
@param {Object} target Object to extend.
@param {Object} [obj]* Multiple objects to extend with.
@return {Object} Same as target, the extended object.
*/
var extend = function(target) {
var undef;
each(arguments, function(arg, i) {
if (i > 0) {
each(arg, function(value, key) {
if (value !== undef) {
if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) {
extend(target[key], value);
} else {
target[key] = value;
}
}
});
}
});
return target;
};
/**
Executes the callback function for each item in array/object. If you return false in the
callback it will break the loop.
@method each
@static
@param {Object} obj Object to iterate.
@param {function} callback Callback function to execute for each item.
*/
var each = function(obj, callback) {
var length, key, i, undef;
if (obj) {
try {
length = obj.length;
} catch(ex) {
length = undef;
}
if (length === undef) {
// Loop object items
for (key in obj) {
if (obj.hasOwnProperty(key)) {
if (callback(obj[key], key) === false) {
return;
}
}
}
} else {
// Loop array items
for (i = 0; i < length; i++) {
if (callback(obj[i], i) === false) {
return;
}
}
}
}
};
/**
Checks if object is empty.
@method isEmptyObj
@static
@param {Object} o Object to check.
@return {Boolean}
*/
var isEmptyObj = function(obj) {
var prop;
if (!obj || typeOf(obj) !== 'object') {
return true;
}
for (prop in obj) {
return false;
}
return true;
};
/**
Recieve an array of functions (usually async) to call in sequence, each function
receives a callback as first argument that it should call, when it completes. Finally,
after everything is complete, main callback is called. Passing truthy value to the
callback as a first argument will interrupt the sequence and invoke main callback
immediately.
@method inSeries
@static
@param {Array} queue Array of functions to call in sequence
@param {Function} cb Main callback that is called in the end, or in case of error
*/
var inSeries = function(queue, cb) {
var i = 0, length = queue.length;
if (typeOf(cb) !== 'function') {
cb = function() {};
}
if (!queue || !queue.length) {
cb();
}
function callNext(i) {
if (typeOf(queue[i]) === 'function') {
queue[i](function(error) {
/*jshint expr:true */
++i < length && !error ? callNext(i) : cb(error);
});
}
}
callNext(i);
};
/**
Recieve an array of functions (usually async) to call in parallel, each function
receives a callback as first argument that it should call, when it completes. After
everything is complete, main callback is called. Passing truthy value to the
callback as a first argument will interrupt the process and invoke main callback
immediately.
@method inParallel
@static
@param {Array} queue Array of functions to call in sequence
@param {Function} cb Main callback that is called in the end, or in case of erro
*/
var inParallel = function(queue, cb) {
var count = 0, num = queue.length, cbArgs = new Array(num);
each(queue, function(fn, i) {
fn(function(error) {
if (error) {
return cb(error);
}
var args = [].slice.call(arguments);
args.shift(); // strip error - undefined or not
cbArgs[i] = args;
count++;
if (count === num) {
cbArgs.unshift(null);
cb.apply(this, cbArgs);
}
});
});
};
/**
Find an element in array and return it's index if present, otherwise return -1.
@method inArray
@static
@param {Mixed} needle Element to find
@param {Array} array
@return {Int} Index of the element, or -1 if not found
*/
var inArray = function(needle, array) {
if (array) {
if (Array.prototype.indexOf) {
return Array.prototype.indexOf.call(array, needle);
}
for (var i = 0, length = array.length; i < length; i++) {
if (array[i] === needle) {
return i;
}
}
}
return -1;
};
/**
Returns elements of first array if they are not present in second. And false - otherwise.
@private
@method arrayDiff
@param {Array} needles
@param {Array} array
@return {Array|Boolean}
*/
var arrayDiff = function(needles, array) {
var diff = [];
if (typeOf(needles) !== 'array') {
needles = [needles];
}
if (typeOf(array) !== 'array') {
array = [array];
}
for (var i in needles) {
if (inArray(needles[i], array) === -1) {
diff.push(needles[i]);
}
}
return diff.length ? diff : false;
};
/**
Find intersection of two arrays.
@private
@method arrayIntersect
@param {Array} array1
@param {Array} array2
@return {Array} Intersection of two arrays or null if there is none
*/
var arrayIntersect = function(array1, array2) {
var result = [];
each(array1, function(item) {
if (inArray(item, array2) !== -1) {
result.push(item);
}
});
return result.length ? result : null;
};
/**
Forces anything into an array.
@method toArray
@static
@param {Object} obj Object with length field.
@return {Array} Array object containing all items.
*/
var toArray = function(obj) {
var i, arr = [];
for (i = 0; i < obj.length; i++) {
arr[i] = obj[i];
}
return arr;
};
/**
Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers.
The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages
to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique.
It's more probable for the earth to be hit with an ansteriod. Y
@method guid
@static
@param {String} prefix to prepend (by default 'o' will be prepended).
@method guid
@return {String} Virtually unique id.
*/
var guid = (function() {
var counter = 0;
return function(prefix) {
var guid = new Date().getTime().toString(32), i;
for (i = 0; i < 5; i++) {
guid += Math.floor(Math.random() * 65535).toString(32);
}
return (prefix || 'o_') + guid + (counter++).toString(32);
};
}());
/**
Trims white spaces around the string
@method trim
@static
@param {String} str
@return {String}
*/
var trim = function(str) {
if (!str) {
return str;
}
return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, '');
};
/**
Parses the specified size string into a byte value. For example 10kb becomes 10240.
@method parseSizeStr
@static
@param {String/Number} size String to parse or number to just pass through.
@return {Number} Size in bytes.
*/
var parseSizeStr = function(size) {
if (typeof(size) !== 'string') {
return size;
}
var muls = {
t: 1099511627776,
g: 1073741824,
m: 1048576,
k: 1024
},
mul;
size = /^([0-9]+)([mgk]?)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, ''));
mul = size[2];
size = +size[1];
if (muls.hasOwnProperty(mul)) {
size *= muls[mul];
}
return size;
};
return {
guid: guid,
typeOf: typeOf,
extend: extend,
each: each,
isEmptyObj: isEmptyObj,
inSeries: inSeries,
inParallel: inParallel,
inArray: inArray,
arrayDiff: arrayDiff,
arrayIntersect: arrayIntersect,
toArray: toArray,
trim: trim,
parseSizeStr: parseSizeStr
};
});
// Included from: src/javascript/core/I18n.js
/**
* I18n.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/core/I18n", [
"moxie/core/utils/Basic"
], function(Basic) {
var i18n = {};
return {
/**
* Extends the language pack object with new items.
*
* @param {Object} pack Language pack items to add.
* @return {Object} Extended language pack object.
*/
addI18n: function(pack) {
return Basic.extend(i18n, pack);
},
/**
* Translates the specified string by checking for the english string in the language pack lookup.
*
* @param {String} str String to look for.
* @return {String} Translated string or the input string if it wasn't found.
*/
translate: function(str) {
return i18n[str] || str;
},
/**
* Shortcut for translate function
*
* @param {String} str String to look for.
* @return {String} Translated string or the input string if it wasn't found.
*/
_: function(str) {
return this.translate(str);
},
/**
* Pseudo sprintf implementation - simple way to replace tokens with specified values.
*
* @param {String} str String with tokens
* @return {String} String with replaced tokens
*/
sprintf: function(str) {
var args = [].slice.call(arguments, 1);
return str.replace(/%[a-z]/g, function() {
var value = args.shift();
return Basic.typeOf(value) !== 'undefined' ? value : '';
});
}
};
});
// Included from: src/javascript/core/utils/Mime.js
/**
* Mime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/core/utils/Mime", [
"moxie/core/utils/Basic",
"moxie/core/I18n"
], function(Basic, I18n) {
var mimeData = "" +
"application/msword,doc dot," +
"application/pdf,pdf," +
"application/pgp-signature,pgp," +
"application/postscript,ps ai eps," +
"application/rtf,rtf," +
"application/vnd.ms-excel,xls xlb," +
"application/vnd.ms-powerpoint,ppt pps pot," +
"application/zip,zip," +
"application/x-shockwave-flash,swf swfl," +
"application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," +
"application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," +
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," +
"application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," +
"application/vnd.openxmlformats-officedocument.presentationml.template,potx," +
"application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," +
"application/x-javascript,js," +
"application/json,json," +
"audio/mpeg,mp3 mpga mpega mp2," +
"audio/x-wav,wav," +
"audio/x-m4a,m4a," +
"audio/ogg,oga ogg," +
"audio/aiff,aiff aif," +
"audio/flac,flac," +
"audio/aac,aac," +
"audio/ac3,ac3," +
"audio/x-ms-wma,wma," +
"image/bmp,bmp," +
"image/gif,gif," +
"image/jpeg,jpg jpeg jpe," +
"image/photoshop,psd," +
"image/png,png," +
"image/svg+xml,svg svgz," +
"image/tiff,tiff tif," +
"text/plain,asc txt text diff log," +
"text/html,htm html xhtml," +
"text/css,css," +
"text/csv,csv," +
"text/rtf,rtf," +
"video/mpeg,mpeg mpg mpe m2v," +
"video/quicktime,qt mov," +
"video/mp4,mp4," +
"video/x-m4v,m4v," +
"video/x-flv,flv," +
"video/x-ms-wmv,wmv," +
"video/avi,avi," +
"video/webm,webm," +
"video/3gpp,3gpp 3gp," +
"video/3gpp2,3g2," +
"video/vnd.rn-realvideo,rv," +
"video/ogg,ogv," +
"video/x-matroska,mkv," +
"application/vnd.oasis.opendocument.formula-template,otf," +
"application/octet-stream,exe";
var Mime = {
mimes: {},
extensions: {},
// Parses the default mime types string into a mimes and extensions lookup maps
addMimeType: function (mimeData) {
var items = mimeData.split(/,/), i, ii, ext;
for (i = 0; i < items.length; i += 2) {
ext = items[i + 1].split(/ /);
// extension to mime lookup
for (ii = 0; ii < ext.length; ii++) {
this.mimes[ext[ii]] = items[i];
}
// mime to extension lookup
this.extensions[items[i]] = ext;
}
},
extList2mimes: function (filters, addMissingExtensions) {
var self = this, ext, i, ii, type, mimes = [];
// convert extensions to mime types list
for (i = 0; i < filters.length; i++) {
ext = filters[i].extensions.split(/\s*,\s*/);
for (ii = 0; ii < ext.length; ii++) {
// if there's an asterisk in the list, then accept attribute is not required
if (ext[ii] === '*') {
return [];
}
type = self.mimes[ext[ii]];
if (!type) {
if (addMissingExtensions && /^\w+$/.test(ext[ii])) {
mimes.push('.' + ext[ii]);
} else {
return []; // accept all
}
} else if (Basic.inArray(type, mimes) === -1) {
mimes.push(type);
}
}
}
return mimes;
},
mimes2exts: function(mimes) {
var self = this, exts = [];
Basic.each(mimes, function(mime) {
if (mime === '*') {
exts = [];
return false;
}
// check if this thing looks like mime type
var m = mime.match(/^(\w+)\/(\*|\w+)$/);
if (m) {
if (m[2] === '*') {
// wildcard mime type detected
Basic.each(self.extensions, function(arr, mime) {
if ((new RegExp('^' + m[1] + '/')).test(mime)) {
[].push.apply(exts, self.extensions[mime]);
}
});
} else if (self.extensions[mime]) {
[].push.apply(exts, self.extensions[mime]);
}
}
});
return exts;
},
mimes2extList: function(mimes) {
var accept = [], exts = [];
if (Basic.typeOf(mimes) === 'string') {
mimes = Basic.trim(mimes).split(/\s*,\s*/);
}
exts = this.mimes2exts(mimes);
accept.push({
title: I18n.translate('Files'),
extensions: exts.length ? exts.join(',') : '*'
});
// save original mimes string
accept.mimes = mimes;
return accept;
},
getFileExtension: function(fileName) {
var matches = fileName && fileName.match(/\.([^.]+)$/);
if (matches) {
return matches[1].toLowerCase();
}
return '';
},
getFileMime: function(fileName) {
return this.mimes[this.getFileExtension(fileName)] || '';
}
};
Mime.addMimeType(mimeData);
return Mime;
});
// Included from: src/javascript/core/utils/Env.js
/**
* Env.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/core/utils/Env", [
"moxie/core/utils/Basic"
], function(Basic) {
// UAParser.js v0.6.2
// Lightweight JavaScript-based User-Agent string parser
// https://github.com/faisalman/ua-parser-js
//
// Copyright © 2012-2013 Faisalman <fyzlman@gmail.com>
// Dual licensed under GPLv2 & MIT
var UAParser = (function (undefined) {
//////////////
// Constants
/////////////
var EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
UNDEF_TYPE = 'undefined',
OBJ_TYPE = 'object',
MAJOR = 'major',
MODEL = 'model',
NAME = 'name',
TYPE = 'type',
VENDOR = 'vendor',
VERSION = 'version',
ARCHITECTURE= 'architecture',
CONSOLE = 'console',
MOBILE = 'mobile',
TABLET = 'tablet';
///////////
// Helper
//////////
var util = {
has : function (str1, str2) {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
},
lowerize : function (str) {
return str.toLowerCase();
}
};
///////////////
// Map helper
//////////////
var mapper = {
rgx : function () {
// loop through all regexes maps
for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) {
var regex = args[i], // even sequence (0,2,4,..)
props = args[i + 1]; // odd sequence (1,3,5,..)
// construct object barebones
if (typeof(result) === UNDEF_TYPE) {
result = {};
for (p in props) {
q = props[p];
if (typeof(q) === OBJ_TYPE) {
result[q[0]] = undefined;
} else {
result[q] = undefined;
}
}
}
// try matching uastring with regexes
for (j = k = 0; j < regex.length; j++) {
matches = regex[j].exec(this.getUA());
if (!!matches) {
for (p = 0; p < props.length; p++) {
match = matches[++k];
q = props[p];
// check if given property is actually array
if (typeof(q) === OBJ_TYPE && q.length > 0) {
if (q.length == 2) {
if (typeof(q[1]) == FUNC_TYPE) {
// assign modified match
result[q[0]] = q[1].call(this, match);
} else {
// assign given value, ignore regex match
result[q[0]] = q[1];
}
} else if (q.length == 3) {
// check whether function or regex
if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) {
// call function (usually string mapper)
result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;
} else {
// sanitize match using given regex
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
}
} else if (q.length == 4) {
result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
}
} else {
result[q] = match ? match : undefined;
}
}
break;
}
}
if(!!matches) break; // break the loop immediately if match found
}
return result;
},
str : function (str, map) {
for (var i in map) {
// check if array
if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) {
for (var j = 0; j < map[i].length; j++) {
if (util.has(map[i][j], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
} else if (util.has(map[i], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
return str;
}
};
///////////////
// String map
//////////////
var maps = {
browser : {
oldsafari : {
major : {
'1' : ['/8', '/1', '/3'],
'2' : '/4',
'?' : '/'
},
version : {
'1.0' : '/8',
'1.2' : '/1',
'1.3' : '/3',
'2.0' : '/412',
'2.0.2' : '/416',
'2.0.3' : '/417',
'2.0.4' : '/419',
'?' : '/'
}
}
},
device : {
sprint : {
model : {
'Evo Shift 4G' : '7373KT'
},
vendor : {
'HTC' : 'APA',
'Sprint' : 'Sprint'
}
}
},
os : {
windows : {
version : {
'ME' : '4.90',
'NT 3.11' : 'NT3.51',
'NT 4.0' : 'NT4.0',
'2000' : 'NT 5.0',
'XP' : ['NT 5.1', 'NT 5.2'],
'Vista' : 'NT 6.0',
'7' : 'NT 6.1',
'8' : 'NT 6.2',
'8.1' : 'NT 6.3',
'RT' : 'ARM'
}
}
}
};
//////////////
// Regex map
/////////////
var regexes = {
browser : [[
// Presto based
/(opera\smini)\/((\d+)?[\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80
], [NAME, VERSION, MAJOR], [
/\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit
], [[NAME, 'Opera'], VERSION, MAJOR], [
// Mixed
/(kindle)\/((\d+)?[\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
// Avant/IEMobile/SlimBrowser/Baidu
/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based
/(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron
], [NAME, VERSION, MAJOR], [
/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11
], [[NAME, 'IE'], VERSION, MAJOR], [
/(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex
], [[NAME, 'Yandex'], VERSION, MAJOR], [
/(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION, MAJOR], [
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i
// Chrome/OmniWeb/Arora/Tizen/Nokia
], [NAME, VERSION, MAJOR], [
/(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin
], [[NAME, 'Dolphin'], VERSION, MAJOR], [
/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS
], [[NAME, 'Chrome'], VERSION, MAJOR], [
/((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i // Android Browser
], [[NAME, 'Android Browser'], VERSION, MAJOR], [
/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [
/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
], [VERSION, MAJOR, NAME], [
/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0
], [NAME, [MAJOR, mapper.str, maps.browser.oldsafari.major], [VERSION, mapper.str, maps.browser.oldsafari.version]], [
/(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror
/(webkit|khtml)\/((\d+)?[\w\.]+)/i
], [NAME, VERSION, MAJOR], [
// Gecko based
/(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION, MAJOR], [
/(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
// Other
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser
/(links)\s\(((\d+)?[\w\.]+)/i, // Links
/(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic
], [NAME, VERSION, MAJOR]
],
engine : [[
/(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
], [NAME, VERSION], [
/rv\:([\w\.]+).*(gecko)/i // Gecko
], [VERSION, NAME]
],
os : [[
// Windows based
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [
// Mobile/Embedded OS
/\((bb)(10);/i // BlackBerry 10
], [[NAME, 'BlackBerry'], VERSION], [
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
/(tizen)\/([\w\.]+)/i, // Tizen
/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo
], [NAME, VERSION], [
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
], [[NAME, 'Symbian'], VERSION],[
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS'], VERSION], [
// Console
/(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation
// GNU/Linux based
/(mint)[\/\s\(]?(\w+)*/i, // Mint
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
/(gnu)\s?([\w\.]+)*/i // GNU
], [NAME, VERSION], [
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
], [[NAME, 'Chromium OS'], VERSION],[
// Solaris
/(sunos)\s?([\w\.]+\d)*/i // Solaris
], [[NAME, 'Solaris'], VERSION], [
// BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
], [NAME, VERSION],[
/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i // Mac OS
], [NAME, [VERSION, /_/g, '.']], [
// Other
/(haiku)\s(\w+)/i, // Haiku
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS
/(unix)\s?([\w\.]+)*/i // UNIX
], [NAME, VERSION]
]
};
/////////////////
// Constructor
////////////////
var UAParser = function (uastring) {
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
this.getBrowser = function () {
return mapper.rgx.apply(this, regexes.browser);
};
this.getEngine = function () {
return mapper.rgx.apply(this, regexes.engine);
};
this.getOS = function () {
return mapper.rgx.apply(this, regexes.os);
};
this.getResult = function() {
return {
ua : this.getUA(),
browser : this.getBrowser(),
engine : this.getEngine(),
os : this.getOS()
};
};
this.getUA = function () {
return ua;
};
this.setUA = function (uastring) {
ua = uastring;
return this;
};
this.setUA(ua);
};
return new UAParser().getResult();
})();
function version_compare(v1, v2, operator) {
// From: http://phpjs.org/functions
// + original by: Philippe Jausions (http://pear.php.net/user/jausions)
// + original by: Aidan Lister (http://aidanlister.com/)
// + reimplemented by: Kankrelune (http://www.webfaktory.info/)
// + improved by: Brett Zamir (http://brett-zamir.me)
// + improved by: Scott Baker
// + improved by: Theriault
// * example 1: version_compare('8.2.5rc', '8.2.5a');
// * returns 1: 1
// * example 2: version_compare('8.2.50', '8.2.52', '<');
// * returns 2: true
// * example 3: version_compare('5.3.0-dev', '5.3.0');
// * returns 3: -1
// * example 4: version_compare('4.1.0.52','4.01.0.51');
// * returns 4: 1
// Important: compare must be initialized at 0.
var i = 0,
x = 0,
compare = 0,
// vm maps textual PHP versions to negatives so they're less than 0.
// PHP currently defines these as CASE-SENSITIVE. It is important to
// leave these as negatives so that they can come before numerical versions
// and as if no letters were there to begin with.
// (1alpha is < 1 and < 1.1 but > 1dev1)
// If a non-numerical value can't be mapped to this table, it receives
// -7 as its value.
vm = {
'dev': -6,
'alpha': -5,
'a': -5,
'beta': -4,
'b': -4,
'RC': -3,
'rc': -3,
'#': -2,
'p': 1,
'pl': 1
},
// This function will be called to prepare each version argument.
// It replaces every _, -, and + with a dot.
// It surrounds any nonsequence of numbers/dots with dots.
// It replaces sequences of dots with a single dot.
// version_compare('4..0', '4.0') == 0
// Important: A string of 0 length needs to be converted into a value
// even less than an unexisting value in vm (-7), hence [-8].
// It's also important to not strip spaces because of this.
// version_compare('', ' ') == 1
prepVersion = function (v) {
v = ('' + v).replace(/[_\-+]/g, '.');
v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.');
return (!v.length ? [-8] : v.split('.'));
},
// This converts a version component to a number.
// Empty component becomes 0.
// Non-numerical component becomes a negative number.
// Numerical component becomes itself as an integer.
numVersion = function (v) {
return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10));
};
v1 = prepVersion(v1);
v2 = prepVersion(v2);
x = Math.max(v1.length, v2.length);
for (i = 0; i < x; i++) {
if (v1[i] == v2[i]) {
continue;
}
v1[i] = numVersion(v1[i]);
v2[i] = numVersion(v2[i]);
if (v1[i] < v2[i]) {
compare = -1;
break;
} else if (v1[i] > v2[i]) {
compare = 1;
break;
}
}
if (!operator) {
return compare;
}
// Important: operator is CASE-SENSITIVE.
// "No operator" seems to be treated as "<."
// Any other values seem to make the function return null.
switch (operator) {
case '>':
case 'gt':
return (compare > 0);
case '>=':
case 'ge':
return (compare >= 0);
case '<=':
case 'le':
return (compare <= 0);
case '==':
case '=':
case 'eq':
return (compare === 0);
case '<>':
case '!=':
case 'ne':
return (compare !== 0);
case '':
case '<':
case 'lt':
return (compare < 0);
default:
return null;
}
}
var can = (function() {
var caps = {
define_property: (function() {
/* // currently too much extra code required, not exactly worth it
try { // as of IE8, getters/setters are supported only on DOM elements
var obj = {};
if (Object.defineProperty) {
Object.defineProperty(obj, 'prop', {
enumerable: true,
configurable: true
});
return true;
}
} catch(ex) {}
if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) {
return true;
}*/
return false;
}()),
create_canvas: (function() {
// On the S60 and BB Storm, getContext exists, but always returns undefined
// so we actually have to call getContext() to verify
// github.com/Modernizr/Modernizr/issues/issue/97/
var el = document.createElement('canvas');
return !!(el.getContext && el.getContext('2d'));
}()),
return_response_type: function(responseType) {
try {
if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) {
return true;
} else if (window.XMLHttpRequest) {
var xhr = new XMLHttpRequest();
xhr.open('get', '/'); // otherwise Gecko throws an exception
if ('responseType' in xhr) {
xhr.responseType = responseType;
// as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?)
if (xhr.responseType !== responseType) {
return false;
}
return true;
}
}
} catch (ex) {}
return false;
},
// ideas for this heavily come from Modernizr (http://modernizr.com/)
use_data_uri: (function() {
var du = new Image();
du.onload = function() {
caps.use_data_uri = (du.width === 1 && du.height === 1);
};
setTimeout(function() {
du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
}, 1);
return false;
}()),
use_data_uri_over32kb: function() { // IE8
return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9);
},
use_data_uri_of: function(bytes) {
return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb());
},
use_fileinput: function() {
var el = document.createElement('input');
el.setAttribute('type', 'file');
return !el.disabled;
}
};
return function(cap) {
var args = [].slice.call(arguments);
args.shift(); // shift of cap
return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap];
};
}());
var Env = {
can: can,
browser: UAParser.browser.name,
version: parseFloat(UAParser.browser.major),
os: UAParser.os.name, // everybody intuitively types it in a lowercase for some reason
osVersion: UAParser.os.version,
verComp: version_compare,
swf_url: "../flash/Moxie.swf",
xap_url: "../silverlight/Moxie.xap",
global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent"
};
// for backward compatibility
// @deprecated Use `Env.os` instead
Env.OS = Env.os;
return Env;
});
// Included from: src/javascript/core/utils/Dom.js
/**
* Dom.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) {
/**
Get DOM Element by it's id.
@method get
@for Utils
@param {String} id Identifier of the DOM Element
@return {DOMElement}
*/
var get = function(id) {
if (typeof id !== 'string') {
return id;
}
return document.getElementById(id);
};
/**
Checks if specified DOM element has specified class.
@method hasClass
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Class name
*/
var hasClass = function(obj, name) {
if (!obj.className) {
return false;
}
var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)");
return regExp.test(obj.className);
};
/**
Adds specified className to specified DOM element.
@method addClass
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Class name
*/
var addClass = function(obj, name) {
if (!hasClass(obj, name)) {
obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name;
}
};
/**
Removes specified className from specified DOM element.
@method removeClass
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Class name
*/
var removeClass = function(obj, name) {
if (obj.className) {
var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)");
obj.className = obj.className.replace(regExp, function($0, $1, $2) {
return $1 === ' ' && $2 === ' ' ? ' ' : '';
});
}
};
/**
Returns a given computed style of a DOM element.
@method getStyle
@static
@param {Object} obj DOM element like object.
@param {String} name Style you want to get from the DOM element
*/
var getStyle = function(obj, name) {
if (obj.currentStyle) {
return obj.currentStyle[name];
} else if (window.getComputedStyle) {
return window.getComputedStyle(obj, null)[name];
}
};
/**
Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields.
@method getPos
@static
@param {Element} node HTML element or element id to get x, y position from.
@param {Element} root Optional root element to stop calculations at.
@return {object} Absolute position of the specified element object with x, y fields.
*/
var getPos = function(node, root) {
var x = 0, y = 0, parent, doc = document, nodeRect, rootRect;
node = node;
root = root || doc.body;
// Returns the x, y cordinate for an element on IE 6 and IE 7
function getIEPos(node) {
var bodyElm, rect, x = 0, y = 0;
if (node) {
rect = node.getBoundingClientRect();
bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body;
x = rect.left + bodyElm.scrollLeft;
y = rect.top + bodyElm.scrollTop;
}
return {
x : x,
y : y
};
}
// Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode
if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) {
nodeRect = getIEPos(node);
rootRect = getIEPos(root);
return {
x : nodeRect.x - rootRect.x,
y : nodeRect.y - rootRect.y
};
}
parent = node;
while (parent && parent != root && parent.nodeType) {
x += parent.offsetLeft || 0;
y += parent.offsetTop || 0;
parent = parent.offsetParent;
}
parent = node.parentNode;
while (parent && parent != root && parent.nodeType) {
x -= parent.scrollLeft || 0;
y -= parent.scrollTop || 0;
parent = parent.parentNode;
}
return {
x : x,
y : y
};
};
/**
Returns the size of the specified node in pixels.
@method getSize
@static
@param {Node} node Node to get the size of.
@return {Object} Object with a w and h property.
*/
var getSize = function(node) {
return {
w : node.offsetWidth || node.clientWidth,
h : node.offsetHeight || node.clientHeight
};
};
return {
get: get,
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
getStyle: getStyle,
getPos: getPos,
getSize: getSize
};
});
// Included from: src/javascript/core/Exceptions.js
/**
* Exceptions.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/Exceptions', [
'moxie/core/utils/Basic'
], function(Basic) {
function _findKey(obj, value) {
var key;
for (key in obj) {
if (obj[key] === value) {
return key;
}
}
return null;
}
return {
RuntimeError: (function() {
var namecodes = {
NOT_INIT_ERR: 1,
NOT_SUPPORTED_ERR: 9,
JS_ERR: 4
};
function RuntimeError(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": RuntimeError " + this.code;
}
Basic.extend(RuntimeError, namecodes);
RuntimeError.prototype = Error.prototype;
return RuntimeError;
}()),
OperationNotAllowedException: (function() {
function OperationNotAllowedException(code) {
this.code = code;
this.name = 'OperationNotAllowedException';
}
Basic.extend(OperationNotAllowedException, {
NOT_ALLOWED_ERR: 1
});
OperationNotAllowedException.prototype = Error.prototype;
return OperationNotAllowedException;
}()),
ImageError: (function() {
var namecodes = {
WRONG_FORMAT: 1,
MAX_RESOLUTION_ERR: 2
};
function ImageError(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": ImageError " + this.code;
}
Basic.extend(ImageError, namecodes);
ImageError.prototype = Error.prototype;
return ImageError;
}()),
FileException: (function() {
var namecodes = {
NOT_FOUND_ERR: 1,
SECURITY_ERR: 2,
ABORT_ERR: 3,
NOT_READABLE_ERR: 4,
ENCODING_ERR: 5,
NO_MODIFICATION_ALLOWED_ERR: 6,
INVALID_STATE_ERR: 7,
SYNTAX_ERR: 8
};
function FileException(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": FileException " + this.code;
}
Basic.extend(FileException, namecodes);
FileException.prototype = Error.prototype;
return FileException;
}()),
DOMException: (function() {
var namecodes = {
INDEX_SIZE_ERR: 1,
DOMSTRING_SIZE_ERR: 2,
HIERARCHY_REQUEST_ERR: 3,
WRONG_DOCUMENT_ERR: 4,
INVALID_CHARACTER_ERR: 5,
NO_DATA_ALLOWED_ERR: 6,
NO_MODIFICATION_ALLOWED_ERR: 7,
NOT_FOUND_ERR: 8,
NOT_SUPPORTED_ERR: 9,
INUSE_ATTRIBUTE_ERR: 10,
INVALID_STATE_ERR: 11,
SYNTAX_ERR: 12,
INVALID_MODIFICATION_ERR: 13,
NAMESPACE_ERR: 14,
INVALID_ACCESS_ERR: 15,
VALIDATION_ERR: 16,
TYPE_MISMATCH_ERR: 17,
SECURITY_ERR: 18,
NETWORK_ERR: 19,
ABORT_ERR: 20,
URL_MISMATCH_ERR: 21,
QUOTA_EXCEEDED_ERR: 22,
TIMEOUT_ERR: 23,
INVALID_NODE_TYPE_ERR: 24,
DATA_CLONE_ERR: 25
};
function DOMException(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": DOMException " + this.code;
}
Basic.extend(DOMException, namecodes);
DOMException.prototype = Error.prototype;
return DOMException;
}()),
EventException: (function() {
function EventException(code) {
this.code = code;
this.name = 'EventException';
}
Basic.extend(EventException, {
UNSPECIFIED_EVENT_TYPE_ERR: 0
});
EventException.prototype = Error.prototype;
return EventException;
}())
};
});
// Included from: src/javascript/core/EventTarget.js
/**
* EventTarget.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/EventTarget', [
'moxie/core/Exceptions',
'moxie/core/utils/Basic'
], function(x, Basic) {
/**
Parent object for all event dispatching components and objects
@class EventTarget
@constructor EventTarget
*/
function EventTarget() {
// hash of event listeners by object uid
var eventpool = {};
Basic.extend(this, {
/**
Unique id of the event dispatcher, usually overriden by children
@property uid
@type String
*/
uid: null,
/**
Can be called from within a child in order to acquire uniqie id in automated manner
@method init
*/
init: function() {
if (!this.uid) {
this.uid = Basic.guid('uid_');
}
},
/**
Register a handler to a specific event dispatched by the object
@method addEventListener
@param {String} type Type or basically a name of the event to subscribe to
@param {Function} fn Callback function that will be called when event happens
@param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first
@param {Object} [scope=this] A scope to invoke event handler in
*/
addEventListener: function(type, fn, priority, scope) {
var self = this, list;
type = Basic.trim(type);
if (/\s/.test(type)) {
// multiple event types were passed for one handler
Basic.each(type.split(/\s+/), function(type) {
self.addEventListener(type, fn, priority, scope);
});
return;
}
type = type.toLowerCase();
priority = parseInt(priority, 10) || 0;
list = eventpool[this.uid] && eventpool[this.uid][type] || [];
list.push({fn : fn, priority : priority, scope : scope || this});
if (!eventpool[this.uid]) {
eventpool[this.uid] = {};
}
eventpool[this.uid][type] = list;
},
/**
Check if any handlers were registered to the specified event
@method hasEventListener
@param {String} type Type or basically a name of the event to check
@return {Mixed} Returns a handler if it was found and false, if - not
*/
hasEventListener: function(type) {
return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid];
},
/**
Unregister the handler from the event, or if former was not specified - unregister all handlers
@method removeEventListener
@param {String} type Type or basically a name of the event
@param {Function} [fn] Handler to unregister
*/
removeEventListener: function(type, fn) {
type = type.toLowerCase();
var list = eventpool[this.uid] && eventpool[this.uid][type], i;
if (list) {
if (fn) {
for (i = list.length - 1; i >= 0; i--) {
if (list[i].fn === fn) {
list.splice(i, 1);
break;
}
}
} else {
list = [];
}
// delete event list if it has become empty
if (!list.length) {
delete eventpool[this.uid][type];
// and object specific entry in a hash if it has no more listeners attached
if (Basic.isEmptyObj(eventpool[this.uid])) {
delete eventpool[this.uid];
}
}
}
},
/**
Remove all event handlers from the object
@method removeAllEventListeners
*/
removeAllEventListeners: function() {
if (eventpool[this.uid]) {
delete eventpool[this.uid];
}
},
/**
Dispatch the event
@method dispatchEvent
@param {String/Object} Type of event or event object to dispatch
@param {Mixed} [...] Variable number of arguments to be passed to a handlers
@return {Boolean} true by default and false if any handler returned false
*/
dispatchEvent: function(type) {
var uid, list, args, tmpEvt, evt = {}, result = true, undef;
if (Basic.typeOf(type) !== 'string') {
// we can't use original object directly (because of Silverlight)
tmpEvt = type;
if (Basic.typeOf(tmpEvt.type) === 'string') {
type = tmpEvt.type;
if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event
evt.total = tmpEvt.total;
evt.loaded = tmpEvt.loaded;
}
evt.async = tmpEvt.async || false;
} else {
throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR);
}
}
// check if event is meant to be dispatched on an object having specific uid
if (type.indexOf('::') !== -1) {
(function(arr) {
uid = arr[0];
type = arr[1];
}(type.split('::')));
} else {
uid = this.uid;
}
type = type.toLowerCase();
list = eventpool[uid] && eventpool[uid][type];
if (list) {
// sort event list by prority
list.sort(function(a, b) { return b.priority - a.priority; });
args = [].slice.call(arguments);
// first argument will be pseudo-event object
args.shift();
evt.type = type;
args.unshift(evt);
// Dispatch event to all listeners
var queue = [];
Basic.each(list, function(handler) {
// explicitly set the target, otherwise events fired from shims do not get it
args[0].target = handler.scope;
// if event is marked as async, detach the handler
if (evt.async) {
queue.push(function(cb) {
setTimeout(function() {
cb(handler.fn.apply(handler.scope, args) === false);
}, 1);
});
} else {
queue.push(function(cb) {
cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation
});
}
});
if (queue.length) {
Basic.inSeries(queue, function(err) {
result = !err;
});
}
}
return result;
},
/**
Alias for addEventListener
@method bind
@protected
*/
bind: function() {
this.addEventListener.apply(this, arguments);
},
/**
Alias for removeEventListener
@method unbind
@protected
*/
unbind: function() {
this.removeEventListener.apply(this, arguments);
},
/**
Alias for removeAllEventListeners
@method unbindAll
@protected
*/
unbindAll: function() {
this.removeAllEventListeners.apply(this, arguments);
},
/**
Alias for dispatchEvent
@method trigger
@protected
*/
trigger: function() {
return this.dispatchEvent.apply(this, arguments);
},
/**
Converts properties of on[event] type to corresponding event handlers,
is used to avoid extra hassle around the process of calling them back
@method convertEventPropsToHandlers
@private
*/
convertEventPropsToHandlers: function(handlers) {
var h;
if (Basic.typeOf(handlers) !== 'array') {
handlers = [handlers];
}
for (var i = 0; i < handlers.length; i++) {
h = 'on' + handlers[i];
if (Basic.typeOf(this[h]) === 'function') {
this.addEventListener(handlers[i], this[h]);
} else if (Basic.typeOf(this[h]) === 'undefined') {
this[h] = null; // object must have defined event properties, even if it doesn't make use of them
}
}
}
});
}
EventTarget.instance = new EventTarget();
return EventTarget;
});
// Included from: src/javascript/core/utils/Encode.js
/**
* Encode.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Encode', [], function() {
/**
Encode string with UTF-8
@method utf8_encode
@for Utils
@static
@param {String} str String to encode
@return {String} UTF-8 encoded string
*/
var utf8_encode = function(str) {
return unescape(encodeURIComponent(str));
};
/**
Decode UTF-8 encoded string
@method utf8_decode
@static
@param {String} str String to decode
@return {String} Decoded string
*/
var utf8_decode = function(str_data) {
return decodeURIComponent(escape(str_data));
};
/**
Decode Base64 encoded string (uses browser's default method if available),
from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js
@method atob
@static
@param {String} data String to decode
@return {String} Decoded string
*/
var atob = function(data, utf8) {
if (typeof(window.atob) === 'function') {
return utf8 ? utf8_decode(window.atob(data)) : window.atob(data);
}
// http://kevin.vanzonneveld.net
// + original by: Tyler Akins (http://rumkin.com)
// + improved by: Thunder.m
// + input by: Aman Gupta
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman
// + bugfixed by: Pellentesque Malesuada
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: Brett Zamir (http://brett-zamir.me)
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
// * returns 1: 'Kevin van Zonneveld'
// mozilla has this native
// - but breaks in 2.0.0.12!
//if (typeof this.window.atob == 'function') {
// return atob(data);
//}
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
ac = 0,
dec = "",
tmp_arr = [];
if (!data) {
return data;
}
data += '';
do { // unpack four hexets into three octets using index points in b64
h1 = b64.indexOf(data.charAt(i++));
h2 = b64.indexOf(data.charAt(i++));
h3 = b64.indexOf(data.charAt(i++));
h4 = b64.indexOf(data.charAt(i++));
bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
o1 = bits >> 16 & 0xff;
o2 = bits >> 8 & 0xff;
o3 = bits & 0xff;
if (h3 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1);
} else if (h4 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1, o2);
} else {
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
}
} while (i < data.length);
dec = tmp_arr.join('');
return utf8 ? utf8_decode(dec) : dec;
};
/**
Base64 encode string (uses browser's default method if available),
from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js
@method btoa
@static
@param {String} data String to encode
@return {String} Base64 encoded string
*/
var btoa = function(data, utf8) {
if (utf8) {
utf8_encode(data);
}
if (typeof(window.btoa) === 'function') {
return window.btoa(data);
}
// http://kevin.vanzonneveld.net
// + original by: Tyler Akins (http://rumkin.com)
// + improved by: Bayron Guevara
// + improved by: Thunder.m
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Pellentesque Malesuada
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Rafał Kukawski (http://kukawski.pl)
// * example 1: base64_encode('Kevin van Zonneveld');
// * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
// mozilla has this native
// - but breaks in 2.0.0.12!
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
ac = 0,
enc = "",
tmp_arr = [];
if (!data) {
return data;
}
do { // pack three octets into four hexets
o1 = data.charCodeAt(i++);
o2 = data.charCodeAt(i++);
o3 = data.charCodeAt(i++);
bits = o1 << 16 | o2 << 8 | o3;
h1 = bits >> 18 & 0x3f;
h2 = bits >> 12 & 0x3f;
h3 = bits >> 6 & 0x3f;
h4 = bits & 0x3f;
// use hexets to index into b64, and append result to encoded string
tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
} while (i < data.length);
enc = tmp_arr.join('');
var r = data.length % 3;
return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
};
return {
utf8_encode: utf8_encode,
utf8_decode: utf8_decode,
atob: atob,
btoa: btoa
};
});
// Included from: src/javascript/runtime/Runtime.js
/**
* Runtime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/runtime/Runtime', [
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/EventTarget"
], function(Basic, Dom, EventTarget) {
var runtimeConstructors = {}, runtimes = {};
/**
Common set of methods and properties for every runtime instance
@class Runtime
@param {Object} options
@param {String} type Sanitized name of the runtime
@param {Object} [caps] Set of capabilities that differentiate specified runtime
@param {Object} [modeCaps] Set of capabilities that do require specific operational mode
@param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested
*/
function Runtime(options, type, caps, modeCaps, preferredMode) {
/**
Dispatched when runtime is initialized and ready.
Results in RuntimeInit on a connected component.
@event Init
*/
/**
Dispatched when runtime fails to initialize.
Results in RuntimeError on a connected component.
@event Error
*/
var self = this
, _shim
, _uid = Basic.guid(type + '_')
, defaultMode = preferredMode || 'browser'
;
options = options || {};
// register runtime in private hash
runtimes[_uid] = this;
/**
Default set of capabilities, which can be redifined later by specific runtime
@private
@property caps
@type Object
*/
caps = Basic.extend({
// Runtime can:
// provide access to raw binary data of the file
access_binary: false,
// provide access to raw binary data of the image (image extension is optional)
access_image_binary: false,
// display binary data as thumbs for example
display_media: false,
// make cross-domain requests
do_cors: false,
// accept files dragged and dropped from the desktop
drag_and_drop: false,
// filter files in selection dialog by their extensions
filter_by_extension: true,
// resize image (and manipulate it raw data of any file in general)
resize_image: false,
// periodically report how many bytes of total in the file were uploaded (loaded)
report_upload_progress: false,
// provide access to the headers of http response
return_response_headers: false,
// support response of specific type, which should be passed as an argument
// e.g. runtime.can('return_response_type', 'blob')
return_response_type: false,
// return http status code of the response
return_status_code: true,
// send custom http header with the request
send_custom_headers: false,
// pick up the files from a dialog
select_file: false,
// select whole folder in file browse dialog
select_folder: false,
// select multiple files at once in file browse dialog
select_multiple: true,
// send raw binary data, that is generated after image resizing or manipulation of other kind
send_binary_string: false,
// send cookies with http request and therefore retain session
send_browser_cookies: true,
// send data formatted as multipart/form-data
send_multipart: true,
// slice the file or blob to smaller parts
slice_blob: false,
// upload file without preloading it to memory, stream it out directly from disk
stream_upload: false,
// programmatically trigger file browse dialog
summon_file_dialog: false,
// upload file of specific size, size should be passed as argument
// e.g. runtime.can('upload_filesize', '500mb')
upload_filesize: true,
// initiate http request with specific http method, method should be passed as argument
// e.g. runtime.can('use_http_method', 'put')
use_http_method: true
}, caps);
// default to the mode that is compatible with preferred caps
if (options.preferred_caps) {
defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode);
}
// small extension factory here (is meant to be extended with actual extensions constructors)
_shim = (function() {
var objpool = {};
return {
exec: function(uid, comp, fn, args) {
if (_shim[comp]) {
if (!objpool[uid]) {
objpool[uid] = {
context: this,
instance: new _shim[comp]()
};
}
if (objpool[uid].instance[fn]) {
return objpool[uid].instance[fn].apply(this, args);
}
}
},
removeInstance: function(uid) {
delete objpool[uid];
},
removeAllInstances: function() {
var self = this;
Basic.each(objpool, function(obj, uid) {
if (Basic.typeOf(obj.instance.destroy) === 'function') {
obj.instance.destroy.call(obj.context);
}
self.removeInstance(uid);
});
}
};
}());
// public methods
Basic.extend(this, {
/**
Specifies whether runtime instance was initialized or not
@property initialized
@type {Boolean}
@default false
*/
initialized: false, // shims require this flag to stop initialization retries
/**
Unique ID of the runtime
@property uid
@type {String}
*/
uid: _uid,
/**
Runtime type (e.g. flash, html5, etc)
@property type
@type {String}
*/
type: type,
/**
Runtime (not native one) may operate in browser or client mode.
@property mode
@private
@type {String|Boolean} current mode or false, if none possible
*/
mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode),
/**
id of the DOM container for the runtime (if available)
@property shimid
@type {String}
*/
shimid: _uid + '_container',
/**
Number of connected clients. If equal to zero, runtime can be destroyed
@property clients
@type {Number}
*/
clients: 0,
/**
Runtime initialization options
@property options
@type {Object}
*/
options: options,
/**
Checks if the runtime has specific capability
@method can
@param {String} cap Name of capability to check
@param {Mixed} [value] If passed, capability should somehow correlate to the value
@param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set)
@return {Boolean} true if runtime has such capability and false, if - not
*/
can: function(cap, value) {
var refCaps = arguments[2] || caps;
// if cap var is a comma-separated list of caps, convert it to object (key/value)
if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') {
cap = Runtime.parseCaps(cap);
}
if (Basic.typeOf(cap) === 'object') {
for (var key in cap) {
if (!this.can(key, cap[key], refCaps)) {
return false;
}
}
return true;
}
// check the individual cap
if (Basic.typeOf(refCaps[cap]) === 'function') {
return refCaps[cap].call(this, value);
} else {
return (value === refCaps[cap]);
}
},
/**
Returns container for the runtime as DOM element
@method getShimContainer
@return {DOMElement}
*/
getShimContainer: function() {
var container, shimContainer = Dom.get(this.shimid);
// if no container for shim, create one
if (!shimContainer) {
container = this.options.container ? Dom.get(this.options.container) : document.body;
// create shim container and insert it at an absolute position into the outer container
shimContainer = document.createElement('div');
shimContainer.id = this.shimid;
shimContainer.className = 'moxie-shim moxie-shim-' + this.type;
Basic.extend(shimContainer.style, {
position: 'absolute',
top: '0px',
left: '0px',
width: '1px',
height: '1px',
overflow: 'hidden'
});
container.appendChild(shimContainer);
container = null;
}
return shimContainer;
},
/**
Returns runtime as DOM element (if appropriate)
@method getShim
@return {DOMElement}
*/
getShim: function() {
return _shim;
},
/**
Invokes a method within the runtime itself (might differ across the runtimes)
@method shimExec
@param {Mixed} []
@protected
@return {Mixed} Depends on the action and component
*/
shimExec: function(component, action) {
var args = [].slice.call(arguments, 2);
return self.getShim().exec.call(this, this.uid, component, action, args);
},
/**
Operaional interface that is used by components to invoke specific actions on the runtime
(is invoked in the scope of component)
@method exec
@param {Mixed} []*
@protected
@return {Mixed} Depends on the action and component
*/
exec: function(component, action) { // this is called in the context of component, not runtime
var args = [].slice.call(arguments, 2);
if (self[component] && self[component][action]) {
return self[component][action].apply(this, args);
}
return self.shimExec.apply(this, arguments);
},
/**
Destroys the runtime (removes all events and deletes DOM structures)
@method destroy
*/
destroy: function() {
if (!self) {
return; // obviously already destroyed
}
var shimContainer = Dom.get(this.shimid);
if (shimContainer) {
shimContainer.parentNode.removeChild(shimContainer);
}
if (_shim) {
_shim.removeAllInstances();
}
this.unbindAll();
delete runtimes[this.uid];
this.uid = null; // mark this runtime as destroyed
_uid = self = _shim = shimContainer = null;
}
});
// once we got the mode, test against all caps
if (this.mode && options.required_caps && !this.can(options.required_caps)) {
this.mode = false;
}
}
/**
Default order to try different runtime types
@property order
@type String
@static
*/
Runtime.order = 'html5,flash,silverlight,html4';
/**
Retrieves runtime from private hash by it's uid
@method getRuntime
@private
@static
@param {String} uid Unique identifier of the runtime
@return {Runtime|Boolean} Returns runtime, if it exists and false, if - not
*/
Runtime.getRuntime = function(uid) {
return runtimes[uid] ? runtimes[uid] : false;
};
/**
Register constructor for the Runtime of new (or perhaps modified) type
@method addConstructor
@static
@param {String} type Runtime type (e.g. flash, html5, etc)
@param {Function} construct Constructor for the Runtime type
*/
Runtime.addConstructor = function(type, constructor) {
constructor.prototype = EventTarget.instance;
runtimeConstructors[type] = constructor;
};
/**
Get the constructor for the specified type.
method getConstructor
@static
@param {String} type Runtime type (e.g. flash, html5, etc)
@return {Function} Constructor for the Runtime type
*/
Runtime.getConstructor = function(type) {
return runtimeConstructors[type] || null;
};
/**
Get info about the runtime (uid, type, capabilities)
@method getInfo
@static
@param {String} uid Unique identifier of the runtime
@return {Mixed} Info object or null if runtime doesn't exist
*/
Runtime.getInfo = function(uid) {
var runtime = Runtime.getRuntime(uid);
if (runtime) {
return {
uid: runtime.uid,
type: runtime.type,
mode: runtime.mode,
can: function() {
return runtime.can.apply(runtime, arguments);
}
};
}
return null;
};
/**
Convert caps represented by a comma-separated string to the object representation.
@method parseCaps
@static
@param {String} capStr Comma-separated list of capabilities
@return {Object}
*/
Runtime.parseCaps = function(capStr) {
var capObj = {};
if (Basic.typeOf(capStr) !== 'string') {
return capStr || {};
}
Basic.each(capStr.split(','), function(key) {
capObj[key] = true; // we assume it to be - true
});
return capObj;
};
/**
Test the specified runtime for specific capabilities.
@method can
@static
@param {String} type Runtime type (e.g. flash, html5, etc)
@param {String|Object} caps Set of capabilities to check
@return {Boolean} Result of the test
*/
Runtime.can = function(type, caps) {
var runtime
, constructor = Runtime.getConstructor(type)
, mode
;
if (constructor) {
runtime = new constructor({
required_caps: caps
});
mode = runtime.mode;
runtime.destroy();
return !!mode;
}
return false;
};
/**
Figure out a runtime that supports specified capabilities.
@method thatCan
@static
@param {String|Object} caps Set of capabilities to check
@param {String} [runtimeOrder] Comma-separated list of runtimes to check against
@return {String} Usable runtime identifier or null
*/
Runtime.thatCan = function(caps, runtimeOrder) {
var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/);
for (var i in types) {
if (Runtime.can(types[i], caps)) {
return types[i];
}
}
return null;
};
/**
Figure out an operational mode for the specified set of capabilities.
@method getMode
@static
@param {Object} modeCaps Set of capabilities that depend on particular runtime mode
@param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for
@param {String|Boolean} [defaultMode='browser'] Default mode to use
@return {String|Boolean} Compatible operational mode
*/
Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) {
var mode = null;
if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified
defaultMode = 'browser';
}
if (requiredCaps && !Basic.isEmptyObj(modeCaps)) {
// loop over required caps and check if they do require the same mode
Basic.each(requiredCaps, function(value, cap) {
if (modeCaps.hasOwnProperty(cap)) {
var capMode = modeCaps[cap](value);
// make sure we always have an array
if (typeof(capMode) === 'string') {
capMode = [capMode];
}
if (!mode) {
mode = capMode;
} else if (!(mode = Basic.arrayIntersect(mode, capMode))) {
// if cap requires conflicting mode - runtime cannot fulfill required caps
return (mode = false);
}
}
});
if (mode) {
return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0];
} else if (mode === false) {
return false;
}
}
return defaultMode;
};
/**
Capability check that always returns true
@private
@static
@return {True}
*/
Runtime.capTrue = function() {
return true;
};
/**
Capability check that always returns false
@private
@static
@return {False}
*/
Runtime.capFalse = function() {
return false;
};
/**
Evaluate the expression to boolean value and create a function that always returns it.
@private
@static
@param {Mixed} expr Expression to evaluate
@return {Function} Function returning the result of evaluation
*/
Runtime.capTest = function(expr) {
return function() {
return !!expr;
};
};
return Runtime;
});
// Included from: src/javascript/runtime/RuntimeClient.js
/**
* RuntimeClient.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/runtime/RuntimeClient', [
'moxie/core/Exceptions',
'moxie/core/utils/Basic',
'moxie/runtime/Runtime'
], function(x, Basic, Runtime) {
/**
Set of methods and properties, required by a component to acquire ability to connect to a runtime
@class RuntimeClient
*/
return function RuntimeClient() {
var runtime;
Basic.extend(this, {
/**
Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one.
Increments number of clients connected to the specified runtime.
@method connectRuntime
@param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites
*/
connectRuntime: function(options) {
var comp = this, ruid;
function initialize(items) {
var type, constructor;
// if we ran out of runtimes
if (!items.length) {
comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));
runtime = null;
return;
}
type = items.shift();
constructor = Runtime.getConstructor(type);
if (!constructor) {
initialize(items);
return;
}
// try initializing the runtime
runtime = new constructor(options);
runtime.bind('Init', function() {
// mark runtime as initialized
runtime.initialized = true;
// jailbreak ...
setTimeout(function() {
runtime.clients++;
// this will be triggered on component
comp.trigger('RuntimeInit', runtime);
}, 1);
});
runtime.bind('Error', function() {
runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here
initialize(items);
});
/*runtime.bind('Exception', function() { });*/
// check if runtime managed to pick-up operational mode
if (!runtime.mode) {
runtime.trigger('Error');
return;
}
runtime.init();
}
// check if a particular runtime was requested
if (Basic.typeOf(options) === 'string') {
ruid = options;
} else if (Basic.typeOf(options.ruid) === 'string') {
ruid = options.ruid;
}
if (ruid) {
runtime = Runtime.getRuntime(ruid);
if (runtime) {
runtime.clients++;
return runtime;
} else {
// there should be a runtime and there's none - weird case
throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR);
}
}
// initialize a fresh one, that fits runtime list and required features best
initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/));
},
/**
Returns the runtime to which the client is currently connected.
@method getRuntime
@return {Runtime} Runtime or null if client is not connected
*/
getRuntime: function() {
if (runtime && runtime.uid) {
return runtime;
}
runtime = null; // make sure we do not leave zombies rambling around
return null;
},
/**
Disconnects from the runtime. Decrements number of clients connected to the specified runtime.
@method disconnectRuntime
*/
disconnectRuntime: function() {
if (runtime && --runtime.clients <= 0) {
runtime.destroy();
runtime = null;
}
}
});
};
});
// Included from: src/javascript/file/Blob.js
/**
* Blob.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/Blob', [
'moxie/core/utils/Basic',
'moxie/core/utils/Encode',
'moxie/runtime/RuntimeClient'
], function(Basic, Encode, RuntimeClient) {
var blobpool = {};
/**
@class Blob
@constructor
@param {String} ruid Unique id of the runtime, to which this blob belongs to
@param {Object} blob Object "Native" blob object, as it is represented in the runtime
*/
function Blob(ruid, blob) {
function _sliceDetached(start, end, type) {
var blob, data = blobpool[this.uid];
if (Basic.typeOf(data) !== 'string' || !data.length) {
return null; // or throw exception
}
blob = new Blob(null, {
type: type,
size: end - start
});
blob.detach(data.substr(start, blob.size));
return blob;
}
RuntimeClient.call(this);
if (ruid) {
this.connectRuntime(ruid);
}
if (!blob) {
blob = {};
} else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string
blob = { data: blob };
}
Basic.extend(this, {
/**
Unique id of the component
@property uid
@type {String}
*/
uid: blob.uid || Basic.guid('uid_'),
/**
Unique id of the connected runtime, if falsy, then runtime will have to be initialized
before this Blob can be used, modified or sent
@property ruid
@type {String}
*/
ruid: ruid,
/**
Size of blob
@property size
@type {Number}
@default 0
*/
size: blob.size || 0,
/**
Mime type of blob
@property type
@type {String}
@default ''
*/
type: blob.type || '',
/**
@method slice
@param {Number} [start=0]
*/
slice: function(start, end, type) {
if (this.isDetached()) {
return _sliceDetached.apply(this, arguments);
}
return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type);
},
/**
Returns "native" blob object (as it is represented in connected runtime) or null if not found
@method getSource
@return {Blob} Returns "native" blob object or null if not found
*/
getSource: function() {
if (!blobpool[this.uid]) {
return null;
}
return blobpool[this.uid];
},
/**
Detaches blob from any runtime that it depends on and initialize with standalone value
@method detach
@protected
@param {DOMString} [data=''] Standalone value
*/
detach: function(data) {
if (this.ruid) {
this.getRuntime().exec.call(this, 'Blob', 'destroy');
this.disconnectRuntime();
this.ruid = null;
}
data = data || '';
// if dataUrl, convert to binary string
var matches = data.match(/^data:([^;]*);base64,/);
if (matches) {
this.type = matches[1];
data = Encode.atob(data.substring(data.indexOf('base64,') + 7));
}
this.size = data.length;
blobpool[this.uid] = data;
},
/**
Checks if blob is standalone (detached of any runtime)
@method isDetached
@protected
@return {Boolean}
*/
isDetached: function() {
return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string';
},
/**
Destroy Blob and free any resources it was using
@method destroy
*/
destroy: function() {
this.detach();
delete blobpool[this.uid];
}
});
if (blob.data) {
this.detach(blob.data); // auto-detach if payload has been passed
} else {
blobpool[this.uid] = blob;
}
}
return Blob;
});
// Included from: src/javascript/file/File.js
/**
* File.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/File', [
'moxie/core/utils/Basic',
'moxie/core/utils/Mime',
'moxie/file/Blob'
], function(Basic, Mime, Blob) {
/**
@class File
@extends Blob
@constructor
@param {String} ruid Unique id of the runtime, to which this blob belongs to
@param {Object} file Object "Native" file object, as it is represented in the runtime
*/
function File(ruid, file) {
var name, type;
if (!file) { // avoid extra errors in case we overlooked something
file = {};
}
// figure out the type
if (file.type && file.type !== '') {
type = file.type;
} else {
type = Mime.getFileMime(file.name);
}
// sanitize file name or generate new one
if (file.name) {
name = file.name.replace(/\\/g, '/');
name = name.substr(name.lastIndexOf('/') + 1);
} else {
var prefix = type.split('/')[0];
name = Basic.guid((prefix !== '' ? prefix : 'file') + '_');
if (Mime.extensions[type]) {
name += '.' + Mime.extensions[type][0]; // append proper extension if possible
}
}
Blob.apply(this, arguments);
Basic.extend(this, {
/**
File mime type
@property type
@type {String}
@default ''
*/
type: type || '',
/**
File name
@property name
@type {String}
@default UID
*/
name: name || Basic.guid('file_'),
/**
Relative path to the file inside a directory
@property relativePath
@type {String}
@default ''
*/
relativePath: '',
/**
Date of last modification
@property lastModifiedDate
@type {String}
@default now
*/
lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET)
});
}
File.prototype = Blob.prototype;
return File;
});
// Included from: src/javascript/file/FileInput.js
/**
* FileInput.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/FileInput', [
'moxie/core/utils/Basic',
'moxie/core/utils/Mime',
'moxie/core/utils/Dom',
'moxie/core/Exceptions',
'moxie/core/EventTarget',
'moxie/core/I18n',
'moxie/file/File',
'moxie/runtime/Runtime',
'moxie/runtime/RuntimeClient'
], function(Basic, Mime, Dom, x, EventTarget, I18n, File, Runtime, RuntimeClient) {
/**
Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click,
converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory
with _FileReader_ or uploaded to a server through _XMLHttpRequest_.
@class FileInput
@constructor
@extends EventTarget
@uses RuntimeClient
@param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_.
@param {String|DOMElement} options.browse_button DOM Element to turn into file picker.
@param {Array} [options.accept] Array of mime types to accept. By default accepts all.
@param {String} [options.file='file'] Name of the file field (not the filename).
@param {Boolean} [options.multiple=false] Enable selection of multiple files.
@param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time).
@param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode
for _browse\_button_.
@param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support.
@example
<div id="container">
<a id="file-picker" href="javascript:;">Browse...</a>
</div>
<script>
var fileInput = new mOxie.FileInput({
browse_button: 'file-picker', // or document.getElementById('file-picker')
container: 'container',
accept: [
{title: "Image files", extensions: "jpg,gif,png"} // accept only images
],
multiple: true // allow multiple file selection
});
fileInput.onchange = function(e) {
// do something to files array
console.info(e.target.files); // or this.files or fileInput.files
};
fileInput.init(); // initialize
</script>
*/
var dispatches = [
/**
Dispatched when runtime is connected and file-picker is ready to be used.
@event ready
@param {Object} event
*/
'ready',
/**
Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked.
Check [corresponding documentation entry](#method_refresh) for more info.
@event refresh
@param {Object} event
*/
/**
Dispatched when selection of files in the dialog is complete.
@event change
@param {Object} event
*/
'change',
'cancel', // TODO: might be useful
/**
Dispatched when mouse cursor enters file-picker area. Can be used to style element
accordingly.
@event mouseenter
@param {Object} event
*/
'mouseenter',
/**
Dispatched when mouse cursor leaves file-picker area. Can be used to style element
accordingly.
@event mouseleave
@param {Object} event
*/
'mouseleave',
/**
Dispatched when functional mouse button is pressed on top of file-picker area.
@event mousedown
@param {Object} event
*/
'mousedown',
/**
Dispatched when functional mouse button is released on top of file-picker area.
@event mouseup
@param {Object} event
*/
'mouseup'
];
function FileInput(options) {
var self = this,
container, browseButton, defaults;
// if flat argument passed it should be browse_button id
if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) {
options = { browse_button : options };
}
// this will help us to find proper default container
browseButton = Dom.get(options.browse_button);
if (!browseButton) {
// browse button is required
throw new x.DOMException(x.DOMException.NOT_FOUND_ERR);
}
// figure out the options
defaults = {
accept: [{
title: I18n.translate('All Files'),
extensions: '*'
}],
name: 'file',
multiple: false,
required_caps: false,
container: browseButton.parentNode || document.body
};
options = Basic.extend({}, defaults, options);
// convert to object representation
if (typeof(options.required_caps) === 'string') {
options.required_caps = Runtime.parseCaps(options.required_caps);
}
// normalize accept option (could be list of mime types or array of title/extensions pairs)
if (typeof(options.accept) === 'string') {
options.accept = Mime.mimes2extList(options.accept);
}
container = Dom.get(options.container);
// make sure we have container
if (!container) {
container = document.body;
}
// make container relative, if it's not
if (Dom.getStyle(container, 'position') === 'static') {
container.style.position = 'relative';
}
container = browseButton = null; // IE
RuntimeClient.call(self);
Basic.extend(self, {
/**
Unique id of the component
@property uid
@protected
@readOnly
@type {String}
@default UID
*/
uid: Basic.guid('uid_'),
/**
Unique id of the connected runtime, if any.
@property ruid
@protected
@type {String}
*/
ruid: null,
/**
Unique id of the runtime container. Useful to get hold of it for various manipulations.
@property shimid
@protected
@type {String}
*/
shimid: null,
/**
Array of selected mOxie.File objects
@property files
@type {Array}
@default null
*/
files: null,
/**
Initializes the file-picker, connects it to runtime and dispatches event ready when done.
@method init
*/
init: function() {
self.convertEventPropsToHandlers(dispatches);
self.bind('RuntimeInit', function(e, runtime) {
self.ruid = runtime.uid;
self.shimid = runtime.shimid;
self.bind("Ready", function() {
self.trigger("Refresh");
}, 999);
self.bind("Change", function() {
var files = runtime.exec.call(self, 'FileInput', 'getFiles');
self.files = [];
Basic.each(files, function(file) {
// ignore empty files (IE10 for example hangs if you try to send them via XHR)
if (file.size === 0) {
return true;
}
self.files.push(new File(self.ruid, file));
});
}, 999);
// re-position and resize shim container
self.bind('Refresh', function() {
var pos, size, browseButton, shimContainer;
browseButton = Dom.get(options.browse_button);
shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist
if (browseButton) {
pos = Dom.getPos(browseButton, Dom.get(options.container));
size = Dom.getSize(browseButton);
if (shimContainer) {
Basic.extend(shimContainer.style, {
top : pos.y + 'px',
left : pos.x + 'px',
width : size.w + 'px',
height : size.h + 'px'
});
}
}
shimContainer = browseButton = null;
});
runtime.exec.call(self, 'FileInput', 'init', options);
});
// runtime needs: options.required_features, options.runtime_order and options.container
self.connectRuntime(Basic.extend({}, options, {
required_caps: {
select_file: true
}
}));
},
/**
Disables file-picker element, so that it doesn't react to mouse clicks.
@method disable
@param {Boolean} [state=true] Disable component if - true, enable if - false
*/
disable: function(state) {
var runtime = this.getRuntime();
if (runtime) {
runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state);
}
},
/**
Reposition and resize dialog trigger to match the position and size of browse_button element.
@method refresh
*/
refresh: function() {
self.trigger("Refresh");
},
/**
Destroy component.
@method destroy
*/
destroy: function() {
var runtime = this.getRuntime();
if (runtime) {
runtime.exec.call(this, 'FileInput', 'destroy');
this.disconnectRuntime();
}
if (Basic.typeOf(this.files) === 'array') {
// no sense in leaving associated files behind
Basic.each(this.files, function(file) {
file.destroy();
});
}
this.files = null;
}
});
}
FileInput.prototype = EventTarget.instance;
return FileInput;
});
// Included from: src/javascript/runtime/RuntimeTarget.js
/**
* RuntimeTarget.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/runtime/RuntimeTarget', [
'moxie/core/utils/Basic',
'moxie/runtime/RuntimeClient',
"moxie/core/EventTarget"
], function(Basic, RuntimeClient, EventTarget) {
/**
Instance of this class can be used as a target for the events dispatched by shims,
when allowing them onto components is for either reason inappropriate
@class RuntimeTarget
@constructor
@protected
@extends EventTarget
*/
function RuntimeTarget() {
this.uid = Basic.guid('uid_');
RuntimeClient.call(this);
this.destroy = function() {
this.disconnectRuntime();
this.unbindAll();
};
}
RuntimeTarget.prototype = EventTarget.instance;
return RuntimeTarget;
});
// Included from: src/javascript/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/FileReader', [
'moxie/core/utils/Basic',
'moxie/core/utils/Encode',
'moxie/core/Exceptions',
'moxie/core/EventTarget',
'moxie/file/Blob',
'moxie/file/File',
'moxie/runtime/RuntimeTarget'
], function(Basic, Encode, x, EventTarget, Blob, File, RuntimeTarget) {
/**
Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader)
interface. Where possible uses native FileReader, where - not falls back to shims.
@class FileReader
@constructor FileReader
@extends EventTarget
@uses RuntimeClient
*/
var dispatches = [
/**
Dispatched when the read starts.
@event loadstart
@param {Object} event
*/
'loadstart',
/**
Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total).
@event progress
@param {Object} event
*/
'progress',
/**
Dispatched when the read has successfully completed.
@event load
@param {Object} event
*/
'load',
/**
Dispatched when the read has been aborted. For instance, by invoking the abort() method.
@event abort
@param {Object} event
*/
'abort',
/**
Dispatched when the read has failed.
@event error
@param {Object} event
*/
'error',
/**
Dispatched when the request has completed (either in success or failure).
@event loadend
@param {Object} event
*/
'loadend'
];
function FileReader() {
var self = this, _fr;
Basic.extend(this, {
/**
UID of the component instance.
@property uid
@type {String}
*/
uid: Basic.guid('uid_'),
/**
Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING
and FileReader.DONE.
@property readyState
@type {Number}
@default FileReader.EMPTY
*/
readyState: FileReader.EMPTY,
/**
Result of the successful read operation.
@property result
@type {String}
*/
result: null,
/**
Stores the error of failed asynchronous read operation.
@property error
@type {DOMError}
*/
error: null,
/**
Initiates reading of File/Blob object contents to binary string.
@method readAsBinaryString
@param {Blob|File} blob Object to preload
*/
readAsBinaryString: function(blob) {
_read.call(this, 'readAsBinaryString', blob);
},
/**
Initiates reading of File/Blob object contents to dataURL string.
@method readAsDataURL
@param {Blob|File} blob Object to preload
*/
readAsDataURL: function(blob) {
_read.call(this, 'readAsDataURL', blob);
},
/**
Initiates reading of File/Blob object contents to string.
@method readAsText
@param {Blob|File} blob Object to preload
*/
readAsText: function(blob) {
_read.call(this, 'readAsText', blob);
},
/**
Aborts preloading process.
@method abort
*/
abort: function() {
this.result = null;
if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) {
return;
} else if (this.readyState === FileReader.LOADING) {
this.readyState = FileReader.DONE;
}
if (_fr) {
_fr.getRuntime().exec.call(this, 'FileReader', 'abort');
}
this.trigger('abort');
this.trigger('loadend');
},
/**
Destroy component and release resources.
@method destroy
*/
destroy: function() {
this.abort();
if (_fr) {
_fr.getRuntime().exec.call(this, 'FileReader', 'destroy');
_fr.disconnectRuntime();
}
self = _fr = null;
}
});
function _read(op, blob) {
_fr = new RuntimeTarget();
function error(err) {
self.readyState = FileReader.DONE;
self.error = err;
self.trigger('error');
loadEnd();
}
function loadEnd() {
_fr.destroy();
_fr = null;
self.trigger('loadend');
}
function exec(runtime) {
_fr.bind('Error', function(e, err) {
error(err);
});
_fr.bind('Progress', function(e) {
self.result = runtime.exec.call(_fr, 'FileReader', 'getResult');
self.trigger(e);
});
_fr.bind('Load', function(e) {
self.readyState = FileReader.DONE;
self.result = runtime.exec.call(_fr, 'FileReader', 'getResult');
self.trigger(e);
loadEnd();
});
runtime.exec.call(_fr, 'FileReader', 'read', op, blob);
}
this.convertEventPropsToHandlers(dispatches);
if (this.readyState === FileReader.LOADING) {
return error(new x.DOMException(x.DOMException.INVALID_STATE_ERR));
}
this.readyState = FileReader.LOADING;
this.trigger('loadstart');
// if source is o.Blob/o.File
if (blob instanceof Blob) {
if (blob.isDetached()) {
var src = blob.getSource();
switch (op) {
case 'readAsText':
case 'readAsBinaryString':
this.result = src;
break;
case 'readAsDataURL':
this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src);
break;
}
this.readyState = FileReader.DONE;
this.trigger('load');
loadEnd();
} else {
exec(_fr.connectRuntime(blob.ruid));
}
} else {
error(new x.DOMException(x.DOMException.NOT_FOUND_ERR));
}
}
}
/**
Initial FileReader state
@property EMPTY
@type {Number}
@final
@static
@default 0
*/
FileReader.EMPTY = 0;
/**
FileReader switches to this state when it is preloading the source
@property LOADING
@type {Number}
@final
@static
@default 1
*/
FileReader.LOADING = 1;
/**
Preloading is complete, this is a final state
@property DONE
@type {Number}
@final
@static
@default 2
*/
FileReader.DONE = 2;
FileReader.prototype = EventTarget.instance;
return FileReader;
});
// Included from: src/javascript/core/utils/Url.js
/**
* Url.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Url', [], function() {
/**
Parse url into separate components and fill in absent parts with parts from current url,
based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js
@method parseUrl
@for Utils
@static
@param {String} url Url to parse (defaults to empty string if undefined)
@return {Object} Hash containing extracted uri components
*/
var parseUrl = function(url, currentUrl) {
var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment']
, i = key.length
, ports = {
http: 80,
https: 443
}
, uri = {}
, regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/
, m = regex.exec(url || '')
;
while (i--) {
if (m[i]) {
uri[key[i]] = m[i];
}
}
// when url is relative, we set the origin and the path ourselves
if (!uri.scheme) {
// come up with defaults
if (!currentUrl || typeof(currentUrl) === 'string') {
currentUrl = parseUrl(currentUrl || document.location.href);
}
uri.scheme = currentUrl.scheme;
uri.host = currentUrl.host;
uri.port = currentUrl.port;
var path = '';
// for urls without trailing slash we need to figure out the path
if (/^[^\/]/.test(uri.path)) {
path = currentUrl.path;
// if path ends with a filename, strip it
if (!/(\/|\/[^\.]+)$/.test(path)) {
path = path.replace(/\/[^\/]+$/, '/');
} else {
path += '/';
}
}
uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir
}
if (!uri.port) {
uri.port = ports[uri.scheme] || 80;
}
uri.port = parseInt(uri.port, 10);
if (!uri.path) {
uri.path = "/";
}
delete uri.source;
return uri;
};
/**
Resolve url - among other things will turn relative url to absolute
@method resolveUrl
@static
@param {String} url Either absolute or relative
@return {String} Resolved, absolute url
*/
var resolveUrl = function(url) {
var ports = { // we ignore default ports
http: 80,
https: 443
}
, urlp = parseUrl(url)
;
return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : '');
};
/**
Check if specified url has the same origin as the current document
@method hasSameOrigin
@param {String|Object} url
@return {Boolean}
*/
var hasSameOrigin = function(url) {
function origin(url) {
return [url.scheme, url.host, url.port].join('/');
}
if (typeof url === 'string') {
url = parseUrl(url);
}
return origin(parseUrl()) === origin(url);
};
return {
parseUrl: parseUrl,
resolveUrl: resolveUrl,
hasSameOrigin: hasSameOrigin
};
});
// Included from: src/javascript/file/FileReaderSync.js
/**
* FileReaderSync.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/FileReaderSync', [
'moxie/core/utils/Basic',
'moxie/runtime/RuntimeClient',
'moxie/core/utils/Encode'
], function(Basic, RuntimeClient, Encode) {
/**
Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here
it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be,
but probably < 1mb). Not meant to be used directly by user.
@class FileReaderSync
@private
@constructor
*/
return function() {
RuntimeClient.call(this);
Basic.extend(this, {
uid: Basic.guid('uid_'),
readAsBinaryString: function(blob) {
return _read.call(this, 'readAsBinaryString', blob);
},
readAsDataURL: function(blob) {
return _read.call(this, 'readAsDataURL', blob);
},
/*readAsArrayBuffer: function(blob) {
return _read.call(this, 'readAsArrayBuffer', blob);
},*/
readAsText: function(blob) {
return _read.call(this, 'readAsText', blob);
}
});
function _read(op, blob) {
if (blob.isDetached()) {
var src = blob.getSource();
switch (op) {
case 'readAsBinaryString':
return src;
case 'readAsDataURL':
return 'data:' + blob.type + ';base64,' + Encode.btoa(src);
case 'readAsText':
var txt = '';
for (var i = 0, length = src.length; i < length; i++) {
txt += String.fromCharCode(src[i]);
}
return txt;
}
} else {
var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob);
this.disconnectRuntime();
return result;
}
}
};
});
// Included from: src/javascript/xhr/FormData.js
/**
* FormData.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/xhr/FormData", [
"moxie/core/Exceptions",
"moxie/core/utils/Basic",
"moxie/file/Blob"
], function(x, Basic, Blob) {
/**
FormData
@class FormData
@constructor
*/
function FormData() {
var _blob, _fields = [];
Basic.extend(this, {
/**
Append another key-value pair to the FormData object
@method append
@param {String} name Name for the new field
@param {String|Blob|Array|Object} value Value for the field
*/
append: function(name, value) {
var self = this, valueType = Basic.typeOf(value);
// according to specs value might be either Blob or String
if (value instanceof Blob) {
_blob = {
name: name,
value: value // unfortunately we can only send single Blob in one FormData
};
} else if ('array' === valueType) {
name += '[]';
Basic.each(value, function(value) {
self.append(name, value);
});
} else if ('object' === valueType) {
Basic.each(value, function(value, key) {
self.append(name + '[' + key + ']', value);
});
} else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) {
self.append(name, "false");
} else {
_fields.push({
name: name,
value: value.toString()
});
}
},
/**
Checks if FormData contains Blob.
@method hasBlob
@return {Boolean}
*/
hasBlob: function() {
return !!this.getBlob();
},
/**
Retrieves blob.
@method getBlob
@return {Object} Either Blob if found or null
*/
getBlob: function() {
return _blob && _blob.value || null;
},
/**
Retrieves blob field name.
@method getBlobName
@return {String} Either Blob field name or null
*/
getBlobName: function() {
return _blob && _blob.name || null;
},
/**
Loop over the fields in FormData and invoke the callback for each of them.
@method each
@param {Function} cb Callback to call for each field
*/
each: function(cb) {
Basic.each(_fields, function(field) {
cb(field.value, field.name);
});
if (_blob) {
cb(_blob.value, _blob.name);
}
},
destroy: function() {
_blob = null;
_fields = [];
}
});
}
return FormData;
});
// Included from: src/javascript/xhr/XMLHttpRequest.js
/**
* XMLHttpRequest.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/xhr/XMLHttpRequest", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/core/EventTarget",
"moxie/core/utils/Encode",
"moxie/core/utils/Url",
"moxie/runtime/Runtime",
"moxie/runtime/RuntimeTarget",
"moxie/file/Blob",
"moxie/file/FileReaderSync",
"moxie/xhr/FormData",
"moxie/core/utils/Env",
"moxie/core/utils/Mime"
], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) {
var httpCode = {
100: 'Continue',
101: 'Switching Protocols',
102: 'Processing',
200: 'OK',
201: 'Created',
202: 'Accepted',
203: 'Non-Authoritative Information',
204: 'No Content',
205: 'Reset Content',
206: 'Partial Content',
207: 'Multi-Status',
226: 'IM Used',
300: 'Multiple Choices',
301: 'Moved Permanently',
302: 'Found',
303: 'See Other',
304: 'Not Modified',
305: 'Use Proxy',
306: 'Reserved',
307: 'Temporary Redirect',
400: 'Bad Request',
401: 'Unauthorized',
402: 'Payment Required',
403: 'Forbidden',
404: 'Not Found',
405: 'Method Not Allowed',
406: 'Not Acceptable',
407: 'Proxy Authentication Required',
408: 'Request Timeout',
409: 'Conflict',
410: 'Gone',
411: 'Length Required',
412: 'Precondition Failed',
413: 'Request Entity Too Large',
414: 'Request-URI Too Long',
415: 'Unsupported Media Type',
416: 'Requested Range Not Satisfiable',
417: 'Expectation Failed',
422: 'Unprocessable Entity',
423: 'Locked',
424: 'Failed Dependency',
426: 'Upgrade Required',
500: 'Internal Server Error',
501: 'Not Implemented',
502: 'Bad Gateway',
503: 'Service Unavailable',
504: 'Gateway Timeout',
505: 'HTTP Version Not Supported',
506: 'Variant Also Negotiates',
507: 'Insufficient Storage',
510: 'Not Extended'
};
function XMLHttpRequestUpload() {
this.uid = Basic.guid('uid_');
}
XMLHttpRequestUpload.prototype = EventTarget.instance;
/**
Implementation of XMLHttpRequest
@class XMLHttpRequest
@constructor
@uses RuntimeClient
@extends EventTarget
*/
var dispatches = ['loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend']; // & readystatechange (for historical reasons)
var NATIVE = 1, RUNTIME = 2;
function XMLHttpRequest() {
var self = this,
// this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible
props = {
/**
The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout.
@property timeout
@type Number
@default 0
*/
timeout: 0,
/**
Current state, can take following values:
UNSENT (numeric value 0)
The object has been constructed.
OPENED (numeric value 1)
The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method.
HEADERS_RECEIVED (numeric value 2)
All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available.
LOADING (numeric value 3)
The response entity body is being received.
DONE (numeric value 4)
@property readyState
@type Number
@default 0 (UNSENT)
*/
readyState: XMLHttpRequest.UNSENT,
/**
True when user credentials are to be included in a cross-origin request. False when they are to be excluded
in a cross-origin request and when cookies are to be ignored in its response. Initially false.
@property withCredentials
@type Boolean
@default false
*/
withCredentials: false,
/**
Returns the HTTP status code.
@property status
@type Number
@default 0
*/
status: 0,
/**
Returns the HTTP status text.
@property statusText
@type String
*/
statusText: "",
/**
Returns the response type. Can be set to change the response type. Values are:
the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
@property responseType
@type String
*/
responseType: "",
/**
Returns the document response entity body.
Throws an "InvalidStateError" exception if responseType is not the empty string or "document".
@property responseXML
@type Document
*/
responseXML: null,
/**
Returns the text response entity body.
Throws an "InvalidStateError" exception if responseType is not the empty string or "text".
@property responseText
@type String
*/
responseText: null,
/**
Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body).
Can become: ArrayBuffer, Blob, Document, JSON, Text
@property response
@type Mixed
*/
response: null
},
_async = true,
_url,
_method,
_headers = {},
_user,
_password,
_encoding = null,
_mimeType = null,
// flags
_sync_flag = false,
_send_flag = false,
_upload_events_flag = false,
_upload_complete_flag = false,
_error_flag = false,
_same_origin_flag = false,
// times
_start_time,
_timeoutset_time,
_finalMime = null,
_finalCharset = null,
_options = {},
_xhr,
_responseHeaders = '',
_responseHeadersBag
;
Basic.extend(this, props, {
/**
Unique id of the component
@property uid
@type String
*/
uid: Basic.guid('uid_'),
/**
Target for Upload events
@property upload
@type XMLHttpRequestUpload
*/
upload: new XMLHttpRequestUpload(),
/**
Sets the request method, request URL, synchronous flag, request username, and request password.
Throws a "SyntaxError" exception if one of the following is true:
method is not a valid HTTP method.
url cannot be resolved.
url contains the "user:password" format in the userinfo production.
Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK.
Throws an "InvalidAccessError" exception if one of the following is true:
Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin.
There is an associated XMLHttpRequest document and either the timeout attribute is not zero,
the withCredentials attribute is true, or the responseType attribute is not the empty string.
@method open
@param {String} method HTTP method to use on request
@param {String} url URL to request
@param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default.
@param {String} [user] Username to use in HTTP authentication process on server-side
@param {String} [password] Password to use in HTTP authentication process on server-side
*/
open: function(method, url, async, user, password) {
var urlp;
// first two arguments are required
if (!method || !url) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method
if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 3
if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) {
_method = method.toUpperCase();
}
// 4 - allowing these methods poses a security risk
if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) {
throw new x.DOMException(x.DOMException.SECURITY_ERR);
}
// 5
url = Encode.utf8_encode(url);
// 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError".
urlp = Url.parseUrl(url);
_same_origin_flag = Url.hasSameOrigin(urlp);
// 7 - manually build up absolute url
_url = Url.resolveUrl(url);
// 9-10, 12-13
if ((user || password) && !_same_origin_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
_user = user || urlp.user;
_password = password || urlp.pass;
// 11
_async = async || true;
if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// 14 - terminate abort()
// 15 - terminate send()
// 18
_sync_flag = !_async;
_send_flag = false;
_headers = {};
_reset.call(this);
// 19
_p('readyState', XMLHttpRequest.OPENED);
// 20
this.convertEventPropsToHandlers(['readystatechange']); // unify event handlers
this.dispatchEvent('readystatechange');
},
/**
Appends an header to the list of author request headers, or if header is already
in the list of author request headers, combines its value with value.
Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set.
Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value
is not a valid HTTP header field value.
@method setRequestHeader
@param {String} header
@param {String|Number} value
*/
setRequestHeader: function(header, value) {
var uaHeaders = [ // these headers are controlled by the user agent
"accept-charset",
"accept-encoding",
"access-control-request-headers",
"access-control-request-method",
"connection",
"content-length",
"cookie",
"cookie2",
"content-transfer-encoding",
"date",
"expect",
"host",
"keep-alive",
"origin",
"referer",
"te",
"trailer",
"transfer-encoding",
"upgrade",
"user-agent",
"via"
];
// 1-2
if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 3
if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 4
/* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values
if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}*/
header = Basic.trim(header).toLowerCase();
// setting of proxy-* and sec-* headers is prohibited by spec
if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) {
return false;
}
// camelize
// browsers lowercase header names (at least for custom ones)
// header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); });
if (!_headers[header]) {
_headers[header] = value;
} else {
// http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph)
_headers[header] += ', ' + value;
}
return true;
},
/**
Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2.
@method getAllResponseHeaders
@return {String} reponse headers or empty string
*/
getAllResponseHeaders: function() {
return _responseHeaders || '';
},
/**
Returns the header field value from the response of which the field name matches header,
unless the field name is Set-Cookie or Set-Cookie2.
@method getResponseHeader
@param {String} header
@return {String} value(s) for the specified header or null
*/
getResponseHeader: function(header) {
header = header.toLowerCase();
if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) {
return null;
}
if (_responseHeaders && _responseHeaders !== '') {
// if we didn't parse response headers until now, do it and keep for later
if (!_responseHeadersBag) {
_responseHeadersBag = {};
Basic.each(_responseHeaders.split(/\r\n/), function(line) {
var pair = line.split(/:\s+/);
if (pair.length === 2) { // last line might be empty, omit
pair[0] = Basic.trim(pair[0]); // just in case
_responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form
header: pair[0],
value: Basic.trim(pair[1])
};
}
});
}
if (_responseHeadersBag.hasOwnProperty(header)) {
return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value;
}
}
return null;
},
/**
Sets the Content-Type header for the response to mime.
Throws an "InvalidStateError" exception if the state is LOADING or DONE.
Throws a "SyntaxError" exception if mime is not a valid media type.
@method overrideMimeType
@param String mime Mime type to set
*/
overrideMimeType: function(mime) {
var matches, charset;
// 1
if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2
mime = Basic.trim(mime.toLowerCase());
if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) {
mime = matches[1];
if (matches[2]) {
charset = matches[2];
}
}
if (!Mime.mimes[mime]) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 3-4
_finalMime = mime;
_finalCharset = charset;
},
/**
Initiates the request. The optional argument provides the request entity body.
The argument is ignored if request method is GET or HEAD.
Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set.
@method send
@param {Blob|Document|String|FormData} [data] Request entity body
@param {Object} [options] Set of requirements and pre-requisities for runtime initialization
*/
send: function(data, options) {
if (Basic.typeOf(options) === 'string') {
_options = { ruid: options };
} else if (!options) {
_options = {};
} else {
_options = options;
}
this.convertEventPropsToHandlers(dispatches);
this.upload.convertEventPropsToHandlers(dispatches);
// 1-2
if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 3
// sending Blob
if (data instanceof Blob) {
_options.ruid = data.ruid;
_mimeType = data.type || 'application/octet-stream';
}
// FormData
else if (data instanceof FormData) {
if (data.hasBlob()) {
var blob = data.getBlob();
_options.ruid = blob.ruid;
_mimeType = blob.type || 'application/octet-stream';
}
}
// DOMString
else if (typeof data === 'string') {
_encoding = 'UTF-8';
_mimeType = 'text/plain;charset=UTF-8';
// data should be converted to Unicode and encoded as UTF-8
data = Encode.utf8_encode(data);
}
// if withCredentials not set, but requested, set it automatically
if (!this.withCredentials) {
this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag;
}
// 4 - storage mutex
// 5
_upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP
// 6
_error_flag = false;
// 7
_upload_complete_flag = !data;
// 8 - Asynchronous steps
if (!_sync_flag) {
// 8.1
_send_flag = true;
// 8.2
// this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr
// 8.3
//if (!_upload_complete_flag) {
// this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr
//}
}
// 8.5 - Return the send() method call, but continue running the steps in this algorithm.
_doXHR.call(this, data);
},
/**
Cancels any network activity.
@method abort
*/
abort: function() {
_error_flag = true;
_sync_flag = false;
if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) {
_p('readyState', XMLHttpRequest.DONE);
_send_flag = false;
if (_xhr) {
_xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag);
} else {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
_upload_complete_flag = true;
} else {
_p('readyState', XMLHttpRequest.UNSENT);
}
},
destroy: function() {
if (_xhr) {
if (Basic.typeOf(_xhr.destroy) === 'function') {
_xhr.destroy();
}
_xhr = null;
}
this.unbindAll();
if (this.upload) {
this.upload.unbindAll();
this.upload = null;
}
}
});
/* this is nice, but maybe too lengthy
// if supported by JS version, set getters/setters for specific properties
o.defineProperty(this, 'readyState', {
configurable: false,
get: function() {
return _p('readyState');
}
});
o.defineProperty(this, 'timeout', {
configurable: false,
get: function() {
return _p('timeout');
},
set: function(value) {
if (_sync_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// timeout still should be measured relative to the start time of request
_timeoutset_time = (new Date).getTime();
_p('timeout', value);
}
});
// the withCredentials attribute has no effect when fetching same-origin resources
o.defineProperty(this, 'withCredentials', {
configurable: false,
get: function() {
return _p('withCredentials');
},
set: function(value) {
// 1-2
if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 3-4
if (_anonymous_flag || _sync_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// 5
_p('withCredentials', value);
}
});
o.defineProperty(this, 'status', {
configurable: false,
get: function() {
return _p('status');
}
});
o.defineProperty(this, 'statusText', {
configurable: false,
get: function() {
return _p('statusText');
}
});
o.defineProperty(this, 'responseType', {
configurable: false,
get: function() {
return _p('responseType');
},
set: function(value) {
// 1
if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2
if (_sync_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// 3
_p('responseType', value.toLowerCase());
}
});
o.defineProperty(this, 'responseText', {
configurable: false,
get: function() {
// 1
if (!~o.inArray(_p('responseType'), ['', 'text'])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2-3
if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return _p('responseText');
}
});
o.defineProperty(this, 'responseXML', {
configurable: false,
get: function() {
// 1
if (!~o.inArray(_p('responseType'), ['', 'document'])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2-3
if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return _p('responseXML');
}
});
o.defineProperty(this, 'response', {
configurable: false,
get: function() {
if (!!~o.inArray(_p('responseType'), ['', 'text'])) {
if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) {
return '';
}
}
if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) {
return null;
}
return _p('response');
}
});
*/
function _p(prop, value) {
if (!props.hasOwnProperty(prop)) {
return;
}
if (arguments.length === 1) { // get
return Env.can('define_property') ? props[prop] : self[prop];
} else { // set
if (Env.can('define_property')) {
props[prop] = value;
} else {
self[prop] = value;
}
}
}
/*
function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) {
// TODO: http://tools.ietf.org/html/rfc3490#section-4.1
return str.toLowerCase();
}
*/
function _doXHR(data) {
var self = this;
_start_time = new Date().getTime();
_xhr = new RuntimeTarget();
function loadEnd() {
if (_xhr) { // it could have been destroyed by now
_xhr.destroy();
_xhr = null;
}
self.dispatchEvent('loadend');
self = null;
}
function exec(runtime) {
_xhr.bind('LoadStart', function(e) {
_p('readyState', XMLHttpRequest.LOADING);
self.dispatchEvent('readystatechange');
self.dispatchEvent(e);
if (_upload_events_flag) {
self.upload.dispatchEvent(e);
}
});
_xhr.bind('Progress', function(e) {
if (_p('readyState') !== XMLHttpRequest.LOADING) {
_p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example)
self.dispatchEvent('readystatechange');
}
self.dispatchEvent(e);
});
_xhr.bind('UploadProgress', function(e) {
if (_upload_events_flag) {
self.upload.dispatchEvent({
type: 'progress',
lengthComputable: false,
total: e.total,
loaded: e.loaded
});
}
});
_xhr.bind('Load', function(e) {
_p('readyState', XMLHttpRequest.DONE);
_p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0));
_p('statusText', httpCode[_p('status')] || "");
_p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType')));
if (!!~Basic.inArray(_p('responseType'), ['text', ''])) {
_p('responseText', _p('response'));
} else if (_p('responseType') === 'document') {
_p('responseXML', _p('response'));
}
_responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders');
self.dispatchEvent('readystatechange');
if (_p('status') > 0) { // status 0 usually means that server is unreachable
if (_upload_events_flag) {
self.upload.dispatchEvent(e);
}
self.dispatchEvent(e);
} else {
_error_flag = true;
self.dispatchEvent('error');
}
loadEnd();
});
_xhr.bind('Abort', function(e) {
self.dispatchEvent(e);
loadEnd();
});
_xhr.bind('Error', function(e) {
_error_flag = true;
_p('readyState', XMLHttpRequest.DONE);
self.dispatchEvent('readystatechange');
_upload_complete_flag = true;
self.dispatchEvent(e);
loadEnd();
});
runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', {
url: _url,
method: _method,
async: _async,
user: _user,
password: _password,
headers: _headers,
mimeType: _mimeType,
encoding: _encoding,
responseType: self.responseType,
withCredentials: self.withCredentials,
options: _options
}, data);
}
// clarify our requirements
if (typeof(_options.required_caps) === 'string') {
_options.required_caps = Runtime.parseCaps(_options.required_caps);
}
_options.required_caps = Basic.extend({}, _options.required_caps, {
return_response_type: self.responseType
});
if (data instanceof FormData) {
_options.required_caps.send_multipart = true;
}
if (!_same_origin_flag) {
_options.required_caps.do_cors = true;
}
if (_options.ruid) { // we do not need to wait if we can connect directly
exec(_xhr.connectRuntime(_options));
} else {
_xhr.bind('RuntimeInit', function(e, runtime) {
exec(runtime);
});
_xhr.bind('RuntimeError', function(e, err) {
self.dispatchEvent('RuntimeError', err);
});
_xhr.connectRuntime(_options);
}
}
function _reset() {
_p('responseText', "");
_p('responseXML', null);
_p('response', null);
_p('status', 0);
_p('statusText', "");
_start_time = _timeoutset_time = null;
}
}
XMLHttpRequest.UNSENT = 0;
XMLHttpRequest.OPENED = 1;
XMLHttpRequest.HEADERS_RECEIVED = 2;
XMLHttpRequest.LOADING = 3;
XMLHttpRequest.DONE = 4;
XMLHttpRequest.prototype = EventTarget.instance;
return XMLHttpRequest;
});
// Included from: src/javascript/runtime/Transporter.js
/**
* Transporter.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/runtime/Transporter", [
"moxie/core/utils/Basic",
"moxie/core/utils/Encode",
"moxie/runtime/RuntimeClient",
"moxie/core/EventTarget"
], function(Basic, Encode, RuntimeClient, EventTarget) {
function Transporter() {
var mod, _runtime, _data, _size, _pos, _chunk_size;
RuntimeClient.call(this);
Basic.extend(this, {
uid: Basic.guid('uid_'),
state: Transporter.IDLE,
result: null,
transport: function(data, type, options) {
var self = this;
options = Basic.extend({
chunk_size: 204798
}, options);
// should divide by three, base64 requires this
if ((mod = options.chunk_size % 3)) {
options.chunk_size += 3 - mod;
}
_chunk_size = options.chunk_size;
_reset.call(this);
_data = data;
_size = data.length;
if (Basic.typeOf(options) === 'string' || options.ruid) {
_run.call(self, type, this.connectRuntime(options));
} else {
// we require this to run only once
var cb = function(e, runtime) {
self.unbind("RuntimeInit", cb);
_run.call(self, type, runtime);
};
this.bind("RuntimeInit", cb);
this.connectRuntime(options);
}
},
abort: function() {
var self = this;
self.state = Transporter.IDLE;
if (_runtime) {
_runtime.exec.call(self, 'Transporter', 'clear');
self.trigger("TransportingAborted");
}
_reset.call(self);
},
destroy: function() {
this.unbindAll();
_runtime = null;
this.disconnectRuntime();
_reset.call(this);
}
});
function _reset() {
_size = _pos = 0;
_data = this.result = null;
}
function _run(type, runtime) {
var self = this;
_runtime = runtime;
//self.unbind("RuntimeInit");
self.bind("TransportingProgress", function(e) {
_pos = e.loaded;
if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) {
_transport.call(self);
}
}, 999);
self.bind("TransportingComplete", function() {
_pos = _size;
self.state = Transporter.DONE;
_data = null; // clean a bit
self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || '');
}, 999);
self.state = Transporter.BUSY;
self.trigger("TransportingStarted");
_transport.call(self);
}
function _transport() {
var self = this,
chunk,
bytesLeft = _size - _pos;
if (_chunk_size > bytesLeft) {
_chunk_size = bytesLeft;
}
chunk = Encode.btoa(_data.substr(_pos, _chunk_size));
_runtime.exec.call(self, 'Transporter', 'receive', chunk, _size);
}
}
Transporter.IDLE = 0;
Transporter.BUSY = 1;
Transporter.DONE = 2;
Transporter.prototype = EventTarget.instance;
return Transporter;
});
// Included from: src/javascript/image/Image.js
/**
* Image.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/image/Image", [
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/Exceptions",
"moxie/file/FileReaderSync",
"moxie/xhr/XMLHttpRequest",
"moxie/runtime/Runtime",
"moxie/runtime/RuntimeClient",
"moxie/runtime/Transporter",
"moxie/core/utils/Env",
"moxie/core/EventTarget",
"moxie/file/Blob",
"moxie/file/File",
"moxie/core/utils/Encode"
], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) {
/**
Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data.
@class Image
@constructor
@extends EventTarget
*/
var dispatches = [
'progress',
/**
Dispatched when loading is complete.
@event load
@param {Object} event
*/
'load',
'error',
/**
Dispatched when resize operation is complete.
@event resize
@param {Object} event
*/
'resize',
/**
Dispatched when visual representation of the image is successfully embedded
into the corresponsing container.
@event embedded
@param {Object} event
*/
'embedded'
];
function Image() {
RuntimeClient.call(this);
Basic.extend(this, {
/**
Unique id of the component
@property uid
@type {String}
*/
uid: Basic.guid('uid_'),
/**
Unique id of the connected runtime, if any.
@property ruid
@type {String}
*/
ruid: null,
/**
Name of the file, that was used to create an image, if available. If not equals to empty string.
@property name
@type {String}
@default ""
*/
name: "",
/**
Size of the image in bytes. Actual value is set only after image is preloaded.
@property size
@type {Number}
@default 0
*/
size: 0,
/**
Width of the image. Actual value is set only after image is preloaded.
@property width
@type {Number}
@default 0
*/
width: 0,
/**
Height of the image. Actual value is set only after image is preloaded.
@property height
@type {Number}
@default 0
*/
height: 0,
/**
Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded.
@property type
@type {String}
@default ""
*/
type: "",
/**
Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded.
@property meta
@type {Object}
@default {}
*/
meta: {},
/**
Alias for load method, that takes another mOxie.Image object as a source (see load).
@method clone
@param {Image} src Source for the image
@param {Boolean} [exact=false] Whether to activate in-depth clone mode
*/
clone: function() {
this.load.apply(this, arguments);
},
/**
Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File,
native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL,
Image will be downloaded from remote destination and loaded in memory.
@example
var img = new mOxie.Image();
img.onload = function() {
var blob = img.getAsBlob();
var formData = new mOxie.FormData();
formData.append('file', blob);
var xhr = new mOxie.XMLHttpRequest();
xhr.onload = function() {
// upload complete
};
xhr.open('post', 'upload.php');
xhr.send(formData);
};
img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg)
@method load
@param {Image|Blob|File|String} src Source for the image
@param {Boolean|Object} [mixed]
*/
load: function() {
// this is here because to bind properly we need an uid first, which is created above
this.bind('Load Resize', function() {
_updateInfo.call(this);
}, 999);
this.convertEventPropsToHandlers(dispatches);
_load.apply(this, arguments);
},
/**
Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions.
@method downsize
@param {Number} width Resulting width
@param {Number} [height=width] Resulting height (optional, if not supplied will default to width)
@param {Boolean} [crop=false] Whether to crop the image to exact dimensions
@param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize)
*/
downsize: function(opts) {
var defaults = {
width: this.width,
height: this.height,
crop: false,
preserveHeaders: true
};
if (typeof(opts) === 'object') {
opts = Basic.extend(defaults, opts);
} else {
opts = Basic.extend(defaults, {
width: arguments[0],
height: arguments[1],
crop: arguments[2],
preserveHeaders: arguments[3]
});
}
try {
if (!this.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// no way to reliably intercept the crash due to high resolution, so we simply avoid it
if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) {
throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR);
}
this.getRuntime().exec.call(this, 'Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders);
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
},
/**
Alias for downsize(width, height, true). (see downsize)
@method crop
@param {Number} width Resulting width
@param {Number} [height=width] Resulting height (optional, if not supplied will default to width)
@param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize)
*/
crop: function(width, height, preserveHeaders) {
this.downsize(width, height, true, preserveHeaders);
},
getAsCanvas: function() {
if (!Env.can('create_canvas')) {
throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR);
}
var runtime = this.connectRuntime(this.ruid);
return runtime.exec.call(this, 'Image', 'getAsCanvas');
},
/**
Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsBlob
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {Blob} Image as Blob
*/
getAsBlob: function(type, quality) {
if (!this.size) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
if (!type) {
type = 'image/jpeg';
}
if (type === 'image/jpeg' && !quality) {
quality = 90;
}
return this.getRuntime().exec.call(this, 'Image', 'getAsBlob', type, quality);
},
/**
Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsDataURL
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {String} Image as dataURL string
*/
getAsDataURL: function(type, quality) {
if (!this.size) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return this.getRuntime().exec.call(this, 'Image', 'getAsDataURL', type, quality);
},
/**
Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsBinaryString
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {String} Image as binary string
*/
getAsBinaryString: function(type, quality) {
var dataUrl = this.getAsDataURL(type, quality);
return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7));
},
/**
Embeds a visual representation of the image into the specified node. Depending on the runtime,
it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare,
can be used in legacy browsers that do not have canvas or proper dataURI support).
@method embed
@param {DOMElement} el DOM element to insert the image object into
@param {Object} [options]
@param {Number} [options.width] The width of an embed (defaults to the image width)
@param {Number} [options.height] The height of an embed (defaults to the image height)
@param {String} [type="image/jpeg"] Mime type
@param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg
@param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions
*/
embed: function(el) {
var self = this
, imgCopy
, type, quality, crop
, options = arguments[1] || {}
, width = this.width
, height = this.height
, runtime // this has to be outside of all the closures to contain proper runtime
;
function onResize() {
// if possible, embed a canvas element directly
if (Env.can('create_canvas')) {
var canvas = imgCopy.getAsCanvas();
if (canvas) {
el.appendChild(canvas);
canvas = null;
imgCopy.destroy();
self.trigger('embedded');
return;
}
}
var dataUrl = imgCopy.getAsDataURL(type, quality);
if (!dataUrl) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
if (Env.can('use_data_uri_of', dataUrl.length)) {
el.innerHTML = '<img src="' + dataUrl + '" width="' + imgCopy.width + '" height="' + imgCopy.height + '" />';
imgCopy.destroy();
self.trigger('embedded');
} else {
var tr = new Transporter();
tr.bind("TransportingComplete", function() {
runtime = self.connectRuntime(this.result.ruid);
self.bind("Embedded", function() {
// position and size properly
Basic.extend(runtime.getShimContainer().style, {
//position: 'relative',
top: '0px',
left: '0px',
width: imgCopy.width + 'px',
height: imgCopy.height + 'px'
});
// some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's
// position type changes (in Gecko), but since we basically need this only in IEs 6/7 and
// sometimes 8 and they do not have this problem, we can comment this for now
/*tr.bind("RuntimeInit", function(e, runtime) {
tr.destroy();
runtime.destroy();
onResize.call(self); // re-feed our image data
});*/
runtime = null;
}, 999);
runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height);
imgCopy.destroy();
});
tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, Basic.extend({}, options, {
required_caps: {
display_media: true
},
runtime_order: 'flash,silverlight',
container: el
}));
}
}
try {
if (!(el = Dom.get(el))) {
throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR);
}
if (!this.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) {
throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR);
}
type = options.type || this.type || 'image/jpeg';
quality = options.quality || 90;
crop = Basic.typeOf(options.crop) !== 'undefined' ? options.crop : false;
// figure out dimensions for the thumb
if (options.width) {
width = options.width;
height = options.height || width;
} else {
// if container element has measurable dimensions, use them
var dimensions = Dom.getSize(el);
if (dimensions.w && dimensions.h) { // both should be > 0
width = dimensions.w;
height = dimensions.h;
}
}
imgCopy = new Image();
imgCopy.bind("Resize", function() {
onResize.call(self);
});
imgCopy.bind("Load", function() {
imgCopy.downsize(width, height, crop, false);
});
imgCopy.clone(this, false);
return imgCopy;
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
},
/**
Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object.
@method destroy
*/
destroy: function() {
if (this.ruid) {
this.getRuntime().exec.call(this, 'Image', 'destroy');
this.disconnectRuntime();
}
this.unbindAll();
}
});
function _updateInfo(info) {
if (!info) {
info = this.getRuntime().exec.call(this, 'Image', 'getInfo');
}
this.size = info.size;
this.width = info.width;
this.height = info.height;
this.type = info.type;
this.meta = info.meta;
// update file name, only if empty
if (this.name === '') {
this.name = info.name;
}
}
function _load(src) {
var srcType = Basic.typeOf(src);
try {
// if source is Image
if (src instanceof Image) {
if (!src.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
_loadFromImage.apply(this, arguments);
}
// if source is o.Blob/o.File
else if (src instanceof Blob) {
if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
_loadFromBlob.apply(this, arguments);
}
// if native blob/file
else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) {
_load.call(this, new File(null, src), arguments[1]);
}
// if String
else if (srcType === 'string') {
// if dataUrl String
if (/^data:[^;]*;base64,/.test(src)) {
_load.call(this, new Blob(null, { data: src }), arguments[1]);
}
// else assume Url, either relative or absolute
else {
_loadFromUrl.apply(this, arguments);
}
}
// if source seems to be an img node
else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') {
_load.call(this, src.src, arguments[1]);
}
else {
throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR);
}
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
}
function _loadFromImage(img, exact) {
var runtime = this.connectRuntime(img.ruid);
this.ruid = runtime.uid;
runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact));
}
function _loadFromBlob(blob, options) {
var self = this;
self.name = blob.name || '';
function exec(runtime) {
self.ruid = runtime.uid;
runtime.exec.call(self, 'Image', 'loadFromBlob', blob);
}
if (blob.isDetached()) {
this.bind('RuntimeInit', function(e, runtime) {
exec(runtime);
});
// convert to object representation
if (options && typeof(options.required_caps) === 'string') {
options.required_caps = Runtime.parseCaps(options.required_caps);
}
this.connectRuntime(Basic.extend({
required_caps: {
access_image_binary: true,
resize_image: true
}
}, options));
} else {
exec(this.connectRuntime(blob.ruid));
}
}
function _loadFromUrl(url, options) {
var self = this, xhr;
xhr = new XMLHttpRequest();
xhr.open('get', url);
xhr.responseType = 'blob';
xhr.onprogress = function(e) {
self.trigger(e);
};
xhr.onload = function() {
_loadFromBlob.call(self, xhr.response, true);
};
xhr.onerror = function(e) {
self.trigger(e);
};
xhr.onloadend = function() {
xhr.destroy();
};
xhr.bind('RuntimeError', function(e, err) {
self.trigger('RuntimeError', err);
});
xhr.send(null, options);
}
}
// virtual world will crash on you if image has a resolution higher than this:
Image.MAX_RESIZE_WIDTH = 6500;
Image.MAX_RESIZE_HEIGHT = 6500;
Image.prototype = EventTarget.instance;
return Image;
});
// Included from: src/javascript/runtime/flash/Runtime.js
/**
* Runtime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global ActiveXObject:true */
/**
Defines constructor for Flash runtime.
@class moxie/runtime/flash/Runtime
@private
*/
define("moxie/runtime/flash/Runtime", [
"moxie/core/utils/Basic",
"moxie/core/utils/Env",
"moxie/core/utils/Dom",
"moxie/core/Exceptions",
"moxie/runtime/Runtime"
], function(Basic, Env, Dom, x, Runtime) {
var type = 'flash', extensions = {};
/**
Get the version of the Flash Player
@method getShimVersion
@private
@return {Number} Flash Player version
*/
function getShimVersion() {
var version;
try {
version = navigator.plugins['Shockwave Flash'];
version = version.description;
} catch (e1) {
try {
version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
} catch (e2) {
version = '0.0';
}
}
version = version.match(/\d+/g);
return parseFloat(version[0] + '.' + version[1]);
}
/**
Constructor for the Flash Runtime
@class FlashRuntime
@extends Runtime
*/
function FlashRuntime(options) {
var I = this, initTimer;
options = Basic.extend({ swf_url: Env.swf_url }, options);
Runtime.call(this, options, type, {
access_binary: function(value) {
return value && I.mode === 'browser';
},
access_image_binary: function(value) {
return value && I.mode === 'browser';
},
display_media: Runtime.capTrue,
do_cors: Runtime.capTrue,
drag_and_drop: false,
report_upload_progress: function() {
return I.mode === 'client';
},
resize_image: Runtime.capTrue,
return_response_headers: false,
return_response_type: function(responseType) {
if (responseType === 'json' && !!window.JSON) {
return true;
}
return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser';
},
return_status_code: function(code) {
return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]);
},
select_file: Runtime.capTrue,
select_multiple: Runtime.capTrue,
send_binary_string: function(value) {
return value && I.mode === 'browser';
},
send_browser_cookies: function(value) {
return value && I.mode === 'browser';
},
send_custom_headers: function(value) {
return value && I.mode === 'browser';
},
send_multipart: Runtime.capTrue,
slice_blob: function(value) {
return value && I.mode === 'browser';
},
stream_upload: function(value) {
return value && I.mode === 'browser';
},
summon_file_dialog: false,
upload_filesize: function(size) {
return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client';
},
use_http_method: function(methods) {
return !Basic.arrayDiff(methods, ['GET', 'POST']);
}
}, {
// capabilities that require specific mode
access_binary: function(value) {
return value ? 'browser' : 'client';
},
access_image_binary: function(value) {
return value ? 'browser' : 'client';
},
report_upload_progress: function(value) {
return value ? 'browser' : 'client';
},
return_response_type: function(responseType) {
return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser'];
},
return_status_code: function(code) {
return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser'];
},
send_binary_string: function(value) {
return value ? 'browser' : 'client';
},
send_browser_cookies: function(value) {
return value ? 'browser' : 'client';
},
send_custom_headers: function(value) {
return value ? 'browser' : 'client';
},
stream_upload: function(value) {
return value ? 'client' : 'browser';
},
upload_filesize: function(size) {
return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser';
}
}, 'client');
// minimal requirement for Flash Player version
if (getShimVersion() < 10) {
this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before
}
Basic.extend(this, {
getShim: function() {
return Dom.get(this.uid);
},
shimExec: function(component, action) {
var args = [].slice.call(arguments, 2);
return I.getShim().exec(this.uid, component, action, args);
},
init: function() {
var html, el, container;
container = this.getShimContainer();
// if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc)
Basic.extend(container.style, {
position: 'absolute',
top: '-8px',
left: '-8px',
width: '9px',
height: '9px',
overflow: 'hidden'
});
// insert flash object
html = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + options.swf_url + '" ';
if (Env.browser === 'IE') {
html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
}
html += 'width="100%" height="100%" style="outline:0">' +
'<param name="movie" value="' + options.swf_url + '" />' +
'<param name="flashvars" value="uid=' + escape(this.uid) + '&target=' + Env.global_event_dispatcher + '" />' +
'<param name="wmode" value="transparent" />' +
'<param name="allowscriptaccess" value="always" />' +
'</object>';
if (Env.browser === 'IE') {
el = document.createElement('div');
container.appendChild(el);
el.outerHTML = html;
el = container = null; // just in case
} else {
container.innerHTML = html;
}
// Init is dispatched by the shim
initTimer = setTimeout(function() {
if (I && !I.initialized) { // runtime might be already destroyed by this moment
I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));
}
}, 5000);
},
destroy: (function(destroy) { // extend default destroy method
return function() {
destroy.call(I);
clearTimeout(initTimer); // initialization check might be still onwait
options = initTimer = destroy = I = null;
};
}(this.destroy))
}, extensions);
}
Runtime.addConstructor(type, FlashRuntime);
return extensions;
});
// Included from: src/javascript/runtime/flash/file/Blob.js
/**
* Blob.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/Blob
@private
*/
define("moxie/runtime/flash/file/Blob", [
"moxie/runtime/flash/Runtime",
"moxie/file/Blob"
], function(extensions, Blob) {
var FlashBlob = {
slice: function(blob, start, end, type) {
var self = this.getRuntime();
if (start < 0) {
start = Math.max(blob.size + start, 0);
} else if (start > 0) {
start = Math.min(start, blob.size);
}
if (end < 0) {
end = Math.max(blob.size + end, 0);
} else if (end > 0) {
end = Math.min(end, blob.size);
}
blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || '');
if (blob) {
blob = new Blob(self.uid, blob);
}
return blob;
}
};
return (extensions.Blob = FlashBlob);
});
// Included from: src/javascript/runtime/flash/file/FileInput.js
/**
* FileInput.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/FileInput
@private
*/
define("moxie/runtime/flash/file/FileInput", [
"moxie/runtime/flash/Runtime"
], function(extensions) {
var FileInput = {
init: function(options) {
this.getRuntime().shimExec.call(this, 'FileInput', 'init', {
name: options.name,
accept: options.accept,
multiple: options.multiple
});
this.trigger('ready');
}
};
return (extensions.FileInput = FileInput);
});
// Included from: src/javascript/runtime/flash/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/FileReader
@private
*/
define("moxie/runtime/flash/file/FileReader", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Encode"
], function(extensions, Encode) {
var _result = '';
function _formatData(data, op) {
switch (op) {
case 'readAsText':
return Encode.atob(data, 'utf8');
case 'readAsBinaryString':
return Encode.atob(data);
case 'readAsDataURL':
return data;
}
return null;
}
var FileReader = {
read: function(op, blob) {
var target = this, self = target.getRuntime();
// special prefix for DataURL read mode
if (op === 'readAsDataURL') {
_result = 'data:' + (blob.type || '') + ';base64,';
}
target.bind('Progress', function(e, data) {
if (data) {
_result += _formatData(data, op);
}
});
return self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid);
},
getResult: function() {
return _result;
},
destroy: function() {
_result = null;
}
};
return (extensions.FileReader = FileReader);
});
// Included from: src/javascript/runtime/flash/file/FileReaderSync.js
/**
* FileReaderSync.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/FileReaderSync
@private
*/
define("moxie/runtime/flash/file/FileReaderSync", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Encode"
], function(extensions, Encode) {
function _formatData(data, op) {
switch (op) {
case 'readAsText':
return Encode.atob(data, 'utf8');
case 'readAsBinaryString':
return Encode.atob(data);
case 'readAsDataURL':
return data;
}
return null;
}
var FileReaderSync = {
read: function(op, blob) {
var result, self = this.getRuntime();
result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid);
if (!result) {
return null; // or throw ex
}
// special prefix for DataURL read mode
if (op === 'readAsDataURL') {
result = 'data:' + (blob.type || '') + ';base64,' + result;
}
return _formatData(result, op, blob.type);
}
};
return (extensions.FileReaderSync = FileReaderSync);
});
// Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js
/**
* XMLHttpRequest.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/xhr/XMLHttpRequest
@private
*/
define("moxie/runtime/flash/xhr/XMLHttpRequest", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Basic",
"moxie/file/Blob",
"moxie/file/File",
"moxie/file/FileReaderSync",
"moxie/xhr/FormData",
"moxie/runtime/Transporter"
], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) {
var XMLHttpRequest = {
send: function(meta, data) {
var target = this, self = target.getRuntime();
function send() {
meta.transport = self.mode;
self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data);
}
function appendBlob(name, blob) {
self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid);
data = null;
send();
}
function attachBlob(blob, cb) {
var tr = new Transporter();
tr.bind("TransportingComplete", function() {
cb(this.result);
});
tr.transport(blob.getSource(), blob.type, {
ruid: self.uid
});
}
// copy over the headers if any
if (!Basic.isEmptyObj(meta.headers)) {
Basic.each(meta.headers, function(value, header) {
self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object
});
}
// transfer over multipart params and blob itself
if (data instanceof FormData) {
var blobField;
data.each(function(value, name) {
if (value instanceof Blob) {
blobField = name;
} else {
self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value);
}
});
if (!data.hasBlob()) {
data = null;
send();
} else {
var blob = data.getBlob();
if (blob.isDetached()) {
attachBlob(blob, function(attachedBlob) {
blob.destroy();
appendBlob(blobField, attachedBlob);
});
} else {
appendBlob(blobField, blob);
}
}
} else if (data instanceof Blob) {
if (data.isDetached()) {
attachBlob(data, function(attachedBlob) {
data.destroy();
data = attachedBlob.uid;
send();
});
} else {
data = data.uid;
send();
}
} else {
send();
}
},
getResponse: function(responseType) {
var frs, blob, self = this.getRuntime();
blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob');
if (blob) {
blob = new File(self.uid, blob);
if ('blob' === responseType) {
return blob;
}
try {
frs = new FileReaderSync();
if (!!~Basic.inArray(responseType, ["", "text"])) {
return frs.readAsText(blob);
} else if ('json' === responseType && !!window.JSON) {
return JSON.parse(frs.readAsText(blob));
}
} finally {
blob.destroy();
}
}
return null;
},
abort: function(upload_complete_flag) {
var self = this.getRuntime();
self.shimExec.call(this, 'XMLHttpRequest', 'abort');
this.dispatchEvent('readystatechange');
// this.dispatchEvent('progress');
this.dispatchEvent('abort');
//if (!upload_complete_flag) {
// this.dispatchEvent('uploadprogress');
//}
}
};
return (extensions.XMLHttpRequest = XMLHttpRequest);
});
// Included from: src/javascript/runtime/flash/runtime/Transporter.js
/**
* Transporter.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/runtime/Transporter
@private
*/
define("moxie/runtime/flash/runtime/Transporter", [
"moxie/runtime/flash/Runtime",
"moxie/file/Blob"
], function(extensions, Blob) {
var Transporter = {
getAsBlob: function(type) {
var self = this.getRuntime()
, blob = self.shimExec.call(this, 'Transporter', 'getAsBlob', type)
;
if (blob) {
return new Blob(self.uid, blob);
}
return null;
}
};
return (extensions.Transporter = Transporter);
});
// Included from: src/javascript/runtime/flash/image/Image.js
/**
* Image.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/image/Image
@private
*/
define("moxie/runtime/flash/image/Image", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Basic",
"moxie/runtime/Transporter",
"moxie/file/Blob",
"moxie/file/FileReaderSync"
], function(extensions, Basic, Transporter, Blob, FileReaderSync) {
var Image = {
loadFromBlob: function(blob) {
var comp = this, self = comp.getRuntime();
function exec(srcBlob) {
self.shimExec.call(comp, 'Image', 'loadFromBlob', srcBlob.uid);
comp = self = null;
}
if (blob.isDetached()) { // binary string
var tr = new Transporter();
tr.bind("TransportingComplete", function() {
exec(tr.result.getSource());
});
tr.transport(blob.getSource(), blob.type, { ruid: self.uid });
} else {
exec(blob.getSource());
}
},
loadFromImage: function(img) {
var self = this.getRuntime();
return self.shimExec.call(this, 'Image', 'loadFromImage', img.uid);
},
getAsBlob: function(type, quality) {
var self = this.getRuntime()
, blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality)
;
if (blob) {
return new Blob(self.uid, blob);
}
return null;
},
getAsDataURL: function() {
var self = this.getRuntime()
, blob = self.Image.getAsBlob.apply(this, arguments)
, frs
;
if (!blob) {
return null;
}
frs = new FileReaderSync();
return frs.readAsDataURL(blob);
}
};
return (extensions.Image = Image);
});
expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image"]);
})(this);/**
* o.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global moxie:true */
/**
Globally exposed namespace with the most frequently used public classes and handy methods.
@class o
@static
@private
*/
(function(exports) {
"use strict";
var o = {}, inArray = exports.moxie.core.utils.Basic.inArray;
// directly add some public classes
// (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included)
(function addAlias(ns) {
var name, itemType;
for (name in ns) {
itemType = typeof(ns[name]);
if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) {
addAlias(ns[name]);
} else if (itemType === 'function') {
o[name] = ns[name];
}
}
})(exports.moxie);
// add some manually
o.Env = exports.moxie.core.utils.Env;
o.Mime = exports.moxie.core.utils.Mime;
o.Exceptions = exports.moxie.core.Exceptions;
// expose globally
exports.mOxie = o;
if (!exports.o) {
exports.o = o;
}
return o;
})(this);
|
src/client/components/Login.js
|
giulianf/Start-Redux
|
/**
* Created by julienfumanti on 06/04/2017.
*/
import React, { Component } from 'react';
import { Grid, Row, Col } from 'react-bootstrap';
export default class Login extends Component {
constructor (props){
super(props);
}
render() {
return (
<Grid >
<Row className='section section-padding'>
<Col md={4} sm={8} xs={12} mdOffset={4} smOffset={4} >
</Col>
</Row>
</Grid>
)
}
}
|
test/MediaBoxSpec.js
|
mattBlackDesign/react-materialize
|
/* global describe, it */
import React from 'react';
import { shallow } from 'enzyme';
import { assert } from 'chai';
import MediaBox from '../src/MediaBox';
const wrapper = shallow(
<MediaBox className='more' src='image.jpg' caption='A demo media box1' width='650' />
);
describe('<MediaBox />', () => {
it('renders', () => {
assert(wrapper.find('img.materialboxed.more').length);
});
it('passes props', () => {
assert.strictEqual(wrapper.props().width, '650', 'width');
assert.strictEqual(wrapper.props()['data-caption'], 'A demo media box1', 'caption');
assert.strictEqual(wrapper.props().src, 'image.jpg', 'image');
});
});
|
react-native-demo/Zebreto/src/components/Decks/Deck.js
|
zhangjunhd/react-examples
|
import React, { Component } from 'react';
import {
StyleSheet,
View
} from 'react-native';
import DeckModel from './../../data/Deck';
import Button from './../Button';
import NormalText from './../NormalText';
import colors from './../../styles/colors';
class Deck extends Component {
static displayName = 'Deck';
_review = () => {
this.props.onReview(this.props.deck.id);
}
_addCards = () => {
this.props.addCards(this.props.deck);
}
render() {
return (
<View style={styles.deckGroup}>
<Button style={styles.deckButton} onPress={this._review}>
<NormalText>
{this.props.deck.name}: {this.props.deck.dueCards} due
</NormalText>
</Button>
<Button style={styles.editButton}
onPress={this._addCards}>
<NormalText>+</NormalText>
</Button>
</View>
);
}
}
Deck.propTypes = {
onReview: React.PropTypes.func.isRequired,
deck: React.PropTypes.instanceOf(DeckModel),
addCards: React.PropTypes.func.isRequired
};
const styles = StyleSheet.create({
deckGroup: {
flex: 1,
flexDirection: 'row',
alignItems: 'stretch',
padding: 10,
marginBottom: 5
},
deckButton: {
backgroundColor: colors.pink,
padding: 10,
margin: 0,
flex: 1
},
editButton: {
width: 60,
backgroundColor: colors.pink2,
justifyContent: 'center',
alignItems: 'center',
alignSelf: 'center',
padding: 0,
paddingTop: 10,
paddingBottom: 10,
margin: 0,
flex: 0
}
});
export default Deck;
|
docs/src/app/components/pages/components/SvgIcon/ExampleSimple.js
|
pancho111203/material-ui
|
import React from 'react';
import {blue500, red500, greenA200} from 'material-ui/styles/colors';
import SvgIcon from 'material-ui/SvgIcon';
const iconStyles = {
marginRight: 24,
};
const HomeIcon = (props) => (
<SvgIcon {...props}>
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
</SvgIcon>
);
const SvgIconExampleSimple = () => (
<div>
<HomeIcon style={iconStyles} />
<HomeIcon style={iconStyles} color={blue500} />
<HomeIcon style={iconStyles} color={red500} hoverColor={greenA200} />
</div>
);
export default SvgIconExampleSimple;
|
ajax/libs/parsley.js/2.3.1/parsley.js
|
Piicksarn/cdnjs
|
/*!
* Parsley.js
* Version 2.3.1 - built Wed, Feb 10th 2016, 10:06 am
* http://parsleyjs.org
* Guillaume Potier - <guillaume@wisembly.com>
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
* MIT Licensed
*/
// The source code below is generated by babel as
// Parsley is written in ECMAScript 6
//
var _slice = Array.prototype.slice;
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : global.parsley = factory(global.jQuery);
})(this, function ($) {
'use strict';
var globalID = 1;
var pastWarnings = {};
var ParsleyUtils__ParsleyUtils = {
// Parsley DOM-API
// returns object from dom attributes and values
attr: function attr($element, namespace, obj) {
var i;
var attribute;
var attributes;
var regex = new RegExp('^' + namespace, 'i');
if ('undefined' === typeof obj) obj = {};else {
// Clear all own properties. This won't affect prototype's values
for (i in obj) {
if (obj.hasOwnProperty(i)) delete obj[i];
}
}
if ('undefined' === typeof $element || 'undefined' === typeof $element[0]) return obj;
attributes = $element[0].attributes;
for (i = attributes.length; i--;) {
attribute = attributes[i];
if (attribute && attribute.specified && regex.test(attribute.name)) {
obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);
}
}
return obj;
},
checkAttr: function checkAttr($element, namespace, _checkAttr) {
return $element.is('[' + namespace + _checkAttr + ']');
},
setAttr: function setAttr($element, namespace, attr, value) {
$element[0].setAttribute(this.dasherize(namespace + attr), String(value));
},
generateID: function generateID() {
return '' + globalID++;
},
/** Third party functions **/
// Zepto deserialize function
deserializeValue: function deserializeValue(value) {
var num;
try {
return value ? value == "true" || (value == "false" ? false : value == "null" ? null : !isNaN(num = Number(value)) ? num : /^[\[\{]/.test(value) ? $.parseJSON(value) : value) : value;
} catch (e) {
return value;
}
},
// Zepto camelize function
camelize: function camelize(str) {
return str.replace(/-+(.)?/g, function (match, chr) {
return chr ? chr.toUpperCase() : '';
});
},
// Zepto dasherize function
dasherize: function dasherize(str) {
return str.replace(/::/g, '/').replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\d])([A-Z])/g, '$1_$2').replace(/_/g, '-').toLowerCase();
},
warn: function warn() {
var _window$console;
if (window.console && 'function' === typeof window.console.warn) (_window$console = window.console).warn.apply(_window$console, arguments);
},
warnOnce: function warnOnce(msg) {
if (!pastWarnings[msg]) {
pastWarnings[msg] = true;
this.warn.apply(this, arguments);
}
},
_resetWarnings: function _resetWarnings() {
pastWarnings = {};
},
trimString: function trimString(string) {
return string.replace(/^\s+|\s+$/g, '');
},
namespaceEvents: function namespaceEvents(events, namespace) {
events = this.trimString(events || '').split(/\s+/);
if (!events[0]) return '';
return $.map(events, function (evt) {
return evt + '.' + namespace;
}).join(' ');
},
// Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill
objectCreate: Object.create || (function () {
var Object = function Object() {};
return function (prototype) {
if (arguments.length > 1) {
throw Error('Second argument not supported');
}
if (typeof prototype != 'object') {
throw TypeError('Argument must be an object');
}
Object.prototype = prototype;
var result = new Object();
Object.prototype = null;
return result;
};
})()
};
var ParsleyUtils__default = ParsleyUtils__ParsleyUtils;
// All these options could be overriden and specified directly in DOM using
// `data-parsley-` default DOM-API
// eg: `inputs` can be set in DOM using `data-parsley-inputs="input, textarea"`
// eg: `data-parsley-stop-on-first-failing-constraint="false"`
var ParsleyDefaults = {
// ### General
// Default data-namespace for DOM API
namespace: 'data-parsley-',
// Supported inputs by default
inputs: 'input, textarea, select',
// Excluded inputs by default
excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',
// Stop validating field on highest priority failing constraint
priorityEnabled: true,
// ### Field only
// identifier used to group together inputs (e.g. radio buttons...)
multiple: null,
// identifier (or array of identifiers) used to validate only a select group of inputs
group: null,
// ### UI
// Enable\Disable error messages
uiEnabled: true,
// Key events threshold before validation
validationThreshold: 3,
// Focused field on form validation error. 'first'|'last'|'none'
focus: 'first',
// event(s) that will trigger validation before first failure. eg: `input`...
trigger: false,
// event(s) that will trigger validation after first failure.
triggerAfterFailure: 'input',
// Class that would be added on every failing validation Parsley field
errorClass: 'parsley-error',
// Same for success validation
successClass: 'parsley-success',
// Return the `$element` that will receive these above success or error classes
// Could also be (and given directly from DOM) a valid selector like `'#div'`
classHandler: function classHandler(ParsleyField) {},
// Return the `$element` where errors will be appended
// Could also be (and given directly from DOM) a valid selector like `'#div'`
errorsContainer: function errorsContainer(ParsleyField) {},
// ul elem that would receive errors' list
errorsWrapper: '<ul class="parsley-errors-list"></ul>',
// li elem that would receive error message
errorTemplate: '<li></li>'
};
var ParsleyAbstract = function ParsleyAbstract() {};
ParsleyAbstract.prototype = {
asyncSupport: true, // Deprecated
actualizeOptions: function actualizeOptions() {
ParsleyUtils__default.attr(this.$element, this.options.namespace, this.domOptions);
if (this.parent && this.parent.actualizeOptions) this.parent.actualizeOptions();
return this;
},
_resetOptions: function _resetOptions(initOptions) {
this.domOptions = ParsleyUtils__default.objectCreate(this.parent.options);
this.options = ParsleyUtils__default.objectCreate(this.domOptions);
// Shallow copy of ownProperties of initOptions:
for (var i in initOptions) {
if (initOptions.hasOwnProperty(i)) this.options[i] = initOptions[i];
}
this.actualizeOptions();
},
_listeners: null,
// Register a callback for the given event name
// Callback is called with context as the first argument and the `this`
// The context is the current parsley instance, or window.Parsley if global
// A return value of `false` will interrupt the calls
on: function on(name, fn) {
this._listeners = this._listeners || {};
var queue = this._listeners[name] = this._listeners[name] || [];
queue.push(fn);
return this;
},
// Deprecated. Use `on` instead
subscribe: function subscribe(name, fn) {
$.listenTo(this, name.toLowerCase(), fn);
},
// Unregister a callback (or all if none is given) for the given event name
off: function off(name, fn) {
var queue = this._listeners && this._listeners[name];
if (queue) {
if (!fn) {
delete this._listeners[name];
} else {
for (var i = queue.length; i--;) if (queue[i] === fn) queue.splice(i, 1);
}
}
return this;
},
// Deprecated. Use `off`
unsubscribe: function unsubscribe(name, fn) {
$.unsubscribeTo(this, name.toLowerCase());
},
// Trigger an event of the given name
// A return value of `false` interrupts the callback chain
// Returns false if execution was interrupted
trigger: function trigger(name, target, extraArg) {
target = target || this;
var queue = this._listeners && this._listeners[name];
var result;
var parentResult;
if (queue) {
for (var i = queue.length; i--;) {
result = queue[i].call(target, target, extraArg);
if (result === false) return result;
}
}
if (this.parent) {
return this.parent.trigger(name, target, extraArg);
}
return true;
},
// Reset UI
reset: function reset() {
// Field case: just emit a reset event for UI
if ('ParsleyForm' !== this.__class__) {
this._resetUI();
return this._trigger('reset');
}
// Form case: emit a reset event for each field
for (var i = 0; i < this.fields.length; i++) this.fields[i].reset();
this._trigger('reset');
},
// Destroy Parsley instance (+ UI)
destroy: function destroy() {
// Field case: emit destroy event to clean UI and then destroy stored instance
this._destroyUI();
if ('ParsleyForm' !== this.__class__) {
this.$element.removeData('Parsley');
this.$element.removeData('ParsleyFieldMultiple');
this._trigger('destroy');
return;
}
// Form case: destroy all its fields and then destroy stored instance
for (var i = 0; i < this.fields.length; i++) this.fields[i].destroy();
this.$element.removeData('Parsley');
this._trigger('destroy');
},
asyncIsValid: function asyncIsValid(group, force) {
ParsleyUtils__default.warnOnce("asyncIsValid is deprecated; please use whenValid instead");
return this.whenValid({ group: group, force: force });
},
_findRelated: function _findRelated() {
return this.options.multiple ? this.parent.$element.find('[' + this.options.namespace + 'multiple="' + this.options.multiple + '"]') : this.$element;
}
};
var requirementConverters = {
string: function string(_string) {
return _string;
},
integer: function integer(string) {
if (isNaN(string)) throw 'Requirement is not an integer: "' + string + '"';
return parseInt(string, 10);
},
number: function number(string) {
if (isNaN(string)) throw 'Requirement is not a number: "' + string + '"';
return parseFloat(string);
},
reference: function reference(string) {
// Unused for now
var result = $(string);
if (result.length === 0) throw 'No such reference: "' + string + '"';
return result;
},
boolean: function boolean(string) {
return string !== 'false';
},
object: function object(string) {
return ParsleyUtils__default.deserializeValue(string);
},
regexp: function regexp(_regexp) {
var flags = '';
// Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern
if (/^\/.*\/(?:[gimy]*)$/.test(_regexp)) {
// Replace the regexp literal string with the first match group: ([gimy]*)
// If no flag is present, this will be a blank string
flags = _regexp.replace(/.*\/([gimy]*)$/, '$1');
// Again, replace the regexp literal string with the first match group:
// everything excluding the opening and closing slashes and the flags
_regexp = _regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
} else {
// Anchor regexp:
_regexp = '^' + _regexp + '$';
}
return new RegExp(_regexp, flags);
}
};
var convertArrayRequirement = function convertArrayRequirement(string, length) {
var m = string.match(/^\s*\[(.*)\]\s*$/);
if (!m) throw 'Requirement is not an array: "' + string + '"';
var values = m[1].split(',').map(ParsleyUtils__default.trimString);
if (values.length !== length) throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';
return values;
};
var convertRequirement = function convertRequirement(requirementType, string) {
var converter = requirementConverters[requirementType || 'string'];
if (!converter) throw 'Unknown requirement specification: "' + requirementType + '"';
return converter(string);
};
var convertExtraOptionRequirement = function convertExtraOptionRequirement(requirementSpec, string, extraOptionReader) {
var main = null;
var extra = {};
for (var key in requirementSpec) {
if (key) {
var value = extraOptionReader(key);
if ('string' === typeof value) value = convertRequirement(requirementSpec[key], value);
extra[key] = value;
} else {
main = convertRequirement(requirementSpec[key], string);
}
}
return [main, extra];
};
// A Validator needs to implement the methods `validate` and `parseRequirements`
var ParsleyValidator = function ParsleyValidator(spec) {
$.extend(true, this, spec);
};
ParsleyValidator.prototype = {
// Returns `true` iff the given `value` is valid according the given requirements.
validate: function validate(value, requirementFirstArg) {
if (this.fn) {
// Legacy style validator
if (arguments.length > 3) // If more args then value, requirement, instance...
requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest
return this.fn.call(this, value, requirementFirstArg);
}
if ($.isArray(value)) {
if (!this.validateMultiple) throw 'Validator `' + this.name + '` does not handle multiple values';
return this.validateMultiple.apply(this, arguments);
} else {
if (this.validateNumber) {
if (isNaN(value)) return false;
arguments[0] = parseFloat(arguments[0]);
return this.validateNumber.apply(this, arguments);
}
if (this.validateString) {
return this.validateString.apply(this, arguments);
}
throw 'Validator `' + this.name + '` only handles multiple values';
}
},
// Parses `requirements` into an array of arguments,
// according to `this.requirementType`
parseRequirements: function parseRequirements(requirements, extraOptionReader) {
if ('string' !== typeof requirements) {
// Assume requirement already parsed
// but make sure we return an array
return $.isArray(requirements) ? requirements : [requirements];
}
var type = this.requirementType;
if ($.isArray(type)) {
var values = convertArrayRequirement(requirements, type.length);
for (var i = 0; i < values.length; i++) values[i] = convertRequirement(type[i], values[i]);
return values;
} else if ($.isPlainObject(type)) {
return convertExtraOptionRequirement(type, requirements, extraOptionReader);
} else {
return [convertRequirement(type, requirements)];
}
},
// Defaults:
requirementType: 'string',
priority: 2
};
var ParsleyValidatorRegistry = function ParsleyValidatorRegistry(validators, catalog) {
this.__class__ = 'ParsleyValidatorRegistry';
// Default Parsley locale is en
this.locale = 'en';
this.init(validators || {}, catalog || {});
};
var typeRegexes = {
email: /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,
// Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers
number: /^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,
integer: /^-?\d+$/,
digits: /^\d+$/,
alphanum: /^\w+$/i,
url: new RegExp("^" +
// protocol identifier
"(?:(?:https?|ftp)://)?" + // ** mod: make scheme optional
// user:pass authentication
"(?:\\S+(?::\\S*)?@)?" + "(?:" +
// IP address exclusion
// private & local networks
// "(?!(?:10|127)(?:\\.\\d{1,3}){3})" + // ** mod: allow local networks
// "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" + // ** mod: allow local networks
// "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" + // ** mod: allow local networks
// IP address dotted notation octets
// excludes loopback network 0.0.0.0
// excludes reserved space >= 224.0.0.0
// excludes network & broacast addresses
// (first & last IP address of each class)
"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" +
// host name
'(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)' +
// domain name
'(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*' +
// TLD identifier
'(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))' + ")" +
// port number
"(?::\\d{2,5})?" +
// resource path
"(?:/\\S*)?" + "$", 'i')
};
typeRegexes.range = typeRegexes.number;
// See http://stackoverflow.com/a/10454560/8279
var decimalPlaces = function decimalPlaces(num) {
var match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
if (!match) {
return 0;
}
return Math.max(0,
// Number of digits right of decimal point.
(match[1] ? match[1].length : 0) - (
// Adjust for scientific notation.
match[2] ? +match[2] : 0));
};
ParsleyValidatorRegistry.prototype = {
init: function init(validators, catalog) {
this.catalog = catalog;
// Copy prototype's validators:
this.validators = $.extend({}, this.validators);
for (var name in validators) this.addValidator(name, validators[name].fn, validators[name].priority);
window.Parsley.trigger('parsley:validator:init');
},
// Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n
setLocale: function setLocale(locale) {
if ('undefined' === typeof this.catalog[locale]) throw new Error(locale + ' is not available in the catalog');
this.locale = locale;
return this;
},
// Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`
addCatalog: function addCatalog(locale, messages, set) {
if ('object' === typeof messages) this.catalog[locale] = messages;
if (true === set) return this.setLocale(locale);
return this;
},
// Add a specific message for a given constraint in a given locale
addMessage: function addMessage(locale, name, message) {
if ('undefined' === typeof this.catalog[locale]) this.catalog[locale] = {};
this.catalog[locale][name] = message;
return this;
},
// Add messages for a given locale
addMessages: function addMessages(locale, nameMessageObject) {
for (var name in nameMessageObject) this.addMessage(locale, name, nameMessageObject[name]);
return this;
},
// Add a new validator
//
// addValidator('custom', {
// requirementType: ['integer', 'integer'],
// validateString: function(value, from, to) {},
// priority: 22,
// messages: {
// en: "Hey, that's no good",
// fr: "Aye aye, pas bon du tout",
// }
// })
//
// Old API was addValidator(name, function, priority)
//
addValidator: function addValidator(name, arg1, arg2) {
if (this.validators[name]) ParsleyUtils__default.warn('Validator "' + name + '" is already defined.');else if (ParsleyDefaults.hasOwnProperty(name)) {
ParsleyUtils__default.warn('"' + name + '" is a restricted keyword and is not a valid validator name.');
return;
}
return this._setValidator.apply(this, arguments);
},
updateValidator: function updateValidator(name, arg1, arg2) {
if (!this.validators[name]) {
ParsleyUtils__default.warn('Validator "' + name + '" is not already defined.');
return this.addValidator.apply(this, arguments);
}
return this._setValidator(this, arguments);
},
removeValidator: function removeValidator(name) {
if (!this.validators[name]) ParsleyUtils__default.warn('Validator "' + name + '" is not defined.');
delete this.validators[name];
return this;
},
_setValidator: function _setValidator(name, validator, priority) {
if ('object' !== typeof validator) {
// Old style validator, with `fn` and `priority`
validator = {
fn: validator,
priority: priority
};
}
if (!validator.validate) {
validator = new ParsleyValidator(validator);
}
this.validators[name] = validator;
for (var locale in validator.messages || {}) this.addMessage(locale, name, validator.messages[locale]);
return this;
},
getErrorMessage: function getErrorMessage(constraint) {
var message;
// Type constraints are a bit different, we have to match their requirements too to find right error message
if ('type' === constraint.name) {
var typeMessages = this.catalog[this.locale][constraint.name] || {};
message = typeMessages[constraint.requirements];
} else message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);
return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;
},
// Kind of light `sprintf()` implementation
formatMessage: function formatMessage(string, parameters) {
if ('object' === typeof parameters) {
for (var i in parameters) string = this.formatMessage(string, parameters[i]);
return string;
}
return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';
},
// Here is the Parsley default validators list.
// A validator is an object with the following key values:
// - priority: an integer
// - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these
// - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise
// Alternatively, a validator can be a function that returns such an object
//
validators: {
notblank: {
validateString: function validateString(value) {
return (/\S/.test(value)
);
},
priority: 2
},
required: {
validateMultiple: function validateMultiple(values) {
return values.length > 0;
},
validateString: function validateString(value) {
return (/\S/.test(value)
);
},
priority: 512
},
type: {
validateString: function validateString(value, type) {
var _ref = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
var _ref$step = _ref.step;
var step = _ref$step === undefined ? '1' : _ref$step;
var _ref$base = _ref.base;
var base = _ref$base === undefined ? 0 : _ref$base;
var regex = typeRegexes[type];
if (!regex) {
throw new Error('validator type `' + type + '` is not supported');
}
if (!regex.test(value)) return false;
if ('number' === type) {
if (!/^any$/i.test(step || '')) {
var nb = Number(value);
var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));
if (decimalPlaces(nb) > decimals) // Value can't have too many decimals
return false;
// Be careful of rounding errors by using integers.
var toInt = function toInt(f) {
return Math.round(f * Math.pow(10, decimals));
};
if ((toInt(nb) - toInt(base)) % toInt(step) != 0) return false;
}
}
return true;
},
requirementType: {
'': 'string',
step: 'string',
base: 'number'
},
priority: 256
},
pattern: {
validateString: function validateString(value, regexp) {
return regexp.test(value);
},
requirementType: 'regexp',
priority: 64
},
minlength: {
validateString: function validateString(value, requirement) {
return value.length >= requirement;
},
requirementType: 'integer',
priority: 30
},
maxlength: {
validateString: function validateString(value, requirement) {
return value.length <= requirement;
},
requirementType: 'integer',
priority: 30
},
length: {
validateString: function validateString(value, min, max) {
return value.length >= min && value.length <= max;
},
requirementType: ['integer', 'integer'],
priority: 30
},
mincheck: {
validateMultiple: function validateMultiple(values, requirement) {
return values.length >= requirement;
},
requirementType: 'integer',
priority: 30
},
maxcheck: {
validateMultiple: function validateMultiple(values, requirement) {
return values.length <= requirement;
},
requirementType: 'integer',
priority: 30
},
check: {
validateMultiple: function validateMultiple(values, min, max) {
return values.length >= min && values.length <= max;
},
requirementType: ['integer', 'integer'],
priority: 30
},
min: {
validateNumber: function validateNumber(value, requirement) {
return value >= requirement;
},
requirementType: 'number',
priority: 30
},
max: {
validateNumber: function validateNumber(value, requirement) {
return value <= requirement;
},
requirementType: 'number',
priority: 30
},
range: {
validateNumber: function validateNumber(value, min, max) {
return value >= min && value <= max;
},
requirementType: ['number', 'number'],
priority: 30
},
equalto: {
validateString: function validateString(value, refOrValue) {
var $reference = $(refOrValue);
if ($reference.length) return value === $reference.val();else return value === refOrValue;
},
priority: 256
}
}
};
var ParsleyUI = {};
var diffResults = function diffResults(newResult, oldResult, deep) {
var added = [];
var kept = [];
for (var i = 0; i < newResult.length; i++) {
var found = false;
for (var j = 0; j < oldResult.length; j++) if (newResult[i].assert.name === oldResult[j].assert.name) {
found = true;
break;
}
if (found) kept.push(newResult[i]);else added.push(newResult[i]);
}
return {
kept: kept,
added: added,
removed: !deep ? diffResults(oldResult, newResult, true).added : []
};
};
ParsleyUI.Form = {
_actualizeTriggers: function _actualizeTriggers() {
var _this = this;
this.$element.on('submit.Parsley', function (evt) {
_this.onSubmitValidate(evt);
});
this.$element.on('click.Parsley', 'input[type="submit"], button[type="submit"]', function (evt) {
_this.onSubmitButton(evt);
});
// UI could be disabled
if (false === this.options.uiEnabled) return;
this.$element.attr('novalidate', '');
},
focus: function focus() {
this._focusedField = null;
if (true === this.validationResult || 'none' === this.options.focus) return null;
for (var i = 0; i < this.fields.length; i++) {
var field = this.fields[i];
if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {
this._focusedField = field.$element;
if ('first' === this.options.focus) break;
}
}
if (null === this._focusedField) return null;
return this._focusedField.focus();
},
_destroyUI: function _destroyUI() {
// Reset all event listeners
this.$element.off('.Parsley');
}
};
ParsleyUI.Field = {
_reflowUI: function _reflowUI() {
this._buildUI();
// If this field doesn't have an active UI don't bother doing something
if (!this._ui) return;
// Diff between two validation results
var diff = diffResults(this.validationResult, this._ui.lastValidationResult);
// Then store current validation result for next reflow
this._ui.lastValidationResult = this.validationResult;
// Handle valid / invalid / none field class
this._manageStatusClass();
// Add, remove, updated errors messages
this._manageErrorsMessages(diff);
// Triggers impl
this._actualizeTriggers();
// If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user
if ((diff.kept.length || diff.added.length) && !this._failedOnce) {
this._failedOnce = true;
this._actualizeTriggers();
}
},
// Returns an array of field's error message(s)
getErrorsMessages: function getErrorsMessages() {
// No error message, field is valid
if (true === this.validationResult) return [];
var messages = [];
for (var i = 0; i < this.validationResult.length; i++) messages.push(this.validationResult[i].errorMessage || this._getErrorMessage(this.validationResult[i].assert));
return messages;
},
_manageStatusClass: function _manageStatusClass() {
if (this.hasConstraints() && this.needsValidation() && true === this.validationResult) this._successClass();else if (this.validationResult.length > 0) this._errorClass();else this._resetClass();
},
_manageErrorsMessages: function _manageErrorsMessages(diff) {
if ('undefined' !== typeof this.options.errorsMessagesDisabled) return;
// Case where we have errorMessage option that configure an unique field error message, regardless failing validators
if ('undefined' !== typeof this.options.errorMessage) {
if (diff.added.length || diff.kept.length) {
this._insertErrorWrapper();
if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length) this._ui.$errorsWrapper.append($(this.options.errorTemplate).addClass('parsley-custom-error-message'));
return this._ui.$errorsWrapper.addClass('filled').find('.parsley-custom-error-message').html(this.options.errorMessage);
}
return this._ui.$errorsWrapper.removeClass('filled').find('.parsley-custom-error-message').remove();
}
// Show, hide, update failing constraints messages
for (var i = 0; i < diff.removed.length; i++) this.removeError(diff.removed[i].assert.name, { updateClass: false });
for (i = 0; i < diff.added.length; i++) this.addError(diff.added[i].assert.name, { message: diff.added[i].errorMessage, assert: diff.added[i].assert, updateClass: false });
for (i = 0; i < diff.kept.length; i++) this.updateError(diff.kept[i].assert.name, { message: diff.kept[i].errorMessage, assert: diff.kept[i].assert, updateClass: false });
},
// TODO: strange API here, intuitive for manual usage with addError(pslyInstance, 'foo', 'bar')
// but a little bit complex for above internal usage, with forced undefined parameter...
addError: function addError(name) {
var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var message = _ref2.message;
var assert = _ref2.assert;
var _ref2$updateClass = _ref2.updateClass;
var updateClass = _ref2$updateClass === undefined ? true : _ref2$updateClass;
this._insertErrorWrapper();
this._ui.$errorsWrapper.addClass('filled').append($(this.options.errorTemplate).addClass('parsley-' + name).html(message || this._getErrorMessage(assert)));
if (updateClass) this._errorClass();
},
// Same as above
updateError: function updateError(name) {
var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var message = _ref3.message;
var assert = _ref3.assert;
var _ref3$updateClass = _ref3.updateClass;
var updateClass = _ref3$updateClass === undefined ? true : _ref3$updateClass;
this._ui.$errorsWrapper.addClass('filled').find('.parsley-' + name).html(message || this._getErrorMessage(assert));
if (updateClass) this._errorClass();
},
// Same as above twice
removeError: function removeError(name) {
var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var _ref4$updateClass = _ref4.updateClass;
var updateClass = _ref4$updateClass === undefined ? true : _ref4$updateClass;
this._ui.$errorsWrapper.removeClass('filled').find('.parsley-' + name).remove();
// edge case possible here: remove a standard Parsley error that is still failing in this.validationResult
// but highly improbable cuz' manually removing a well Parsley handled error makes no sense.
if (updateClass) this._manageStatusClass();
},
_getErrorMessage: function _getErrorMessage(constraint) {
var customConstraintErrorMessage = constraint.name + 'Message';
if ('undefined' !== typeof this.options[customConstraintErrorMessage]) return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);
return window.Parsley.getErrorMessage(constraint);
},
_buildUI: function _buildUI() {
// UI could be already built or disabled
if (this._ui || false === this.options.uiEnabled) return;
var _ui = {};
// Give field its Parsley id in DOM
this.$element.attr(this.options.namespace + 'id', this.__id__);
/** Generate important UI elements and store them in this **/
// $errorClassHandler is the $element that woul have parsley-error and parsley-success classes
_ui.$errorClassHandler = this._manageClassHandler();
// $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer
_ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);
_ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);
// ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly
_ui.lastValidationResult = [];
_ui.validationInformationVisible = false;
// Store it in this for later
this._ui = _ui;
},
// Determine which element will have `parsley-error` and `parsley-success` classes
_manageClassHandler: function _manageClassHandler() {
// An element selector could be passed through DOM with `data-parsley-class-handler=#foo`
if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length) return $(this.options.classHandler);
// Class handled could also be determined by function given in Parsley options
var $handler = this.options.classHandler();
// If this function returned a valid existing DOM element, go for it
if ('undefined' !== typeof $handler && $handler.length) return $handler;
// Otherwise, if simple element (input, texatrea, select...) it will perfectly host the classes
if (!this.options.multiple || this.$element.is('select')) return this.$element;
// But if multiple element (radio, checkbox), that would be their parent
return this.$element.parent();
},
_insertErrorWrapper: function _insertErrorWrapper() {
var $errorsContainer;
// Nothing to do if already inserted
if (0 !== this._ui.$errorsWrapper.parent().length) return this._ui.$errorsWrapper.parent();
if ('string' === typeof this.options.errorsContainer) {
if ($(this.options.errorsContainer).length) return $(this.options.errorsContainer).append(this._ui.$errorsWrapper);else ParsleyUtils__default.warn('The errors container `' + this.options.errorsContainer + '` does not exist in DOM');
} else if ('function' === typeof this.options.errorsContainer) $errorsContainer = this.options.errorsContainer();
if ('undefined' !== typeof $errorsContainer && $errorsContainer.length) return $errorsContainer.append(this._ui.$errorsWrapper);
var $from = this.$element;
if (this.options.multiple) $from = $from.parent();
return $from.after(this._ui.$errorsWrapper);
},
_actualizeTriggers: function _actualizeTriggers() {
var _this2 = this;
var $toBind = this._findRelated();
// Remove Parsley events already bound on this field
$toBind.off('.Parsley');
if (this._failedOnce) $toBind.on(ParsleyUtils__default.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), function () {
_this2.validate();
});else {
$toBind.on(ParsleyUtils__default.namespaceEvents(this.options.trigger, 'Parsley'), function (event) {
_this2._eventValidate(event);
});
}
},
_eventValidate: function _eventValidate(event) {
// For keyup, keypress, keydown, input... events that could be a little bit obstrusive
// do not validate if val length < min threshold on first validation. Once field have been validated once and info
// about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.
if (/key|input/.test(event.type)) if (!(this._ui && field._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold) return;
this.validate();
},
_resetUI: function _resetUI() {
// Reset all event listeners
this._failedOnce = false;
this._actualizeTriggers();
// Nothing to do if UI never initialized for this field
if ('undefined' === typeof this._ui) return;
// Reset all errors' li
this._ui.$errorsWrapper.removeClass('filled').children().remove();
// Reset validation class
this._resetClass();
// Reset validation flags and last validation result
this._ui.lastValidationResult = [];
this._ui.validationInformationVisible = false;
},
_destroyUI: function _destroyUI() {
this._resetUI();
if ('undefined' !== typeof this._ui) this._ui.$errorsWrapper.remove();
delete this._ui;
},
_successClass: function _successClass() {
this._ui.validationInformationVisible = true;
this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);
},
_errorClass: function _errorClass() {
this._ui.validationInformationVisible = true;
this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);
},
_resetClass: function _resetClass() {
this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);
}
};
var ParsleyForm = function ParsleyForm(element, domOptions, options) {
this.__class__ = 'ParsleyForm';
this.__id__ = ParsleyUtils__default.generateID();
this.$element = $(element);
this.domOptions = domOptions;
this.options = options;
this.parent = window.Parsley;
this.fields = [];
this.validationResult = null;
};
var ParsleyForm__statusMapping = { pending: null, resolved: true, rejected: false };
ParsleyForm.prototype = {
onSubmitValidate: function onSubmitValidate(event) {
var _this3 = this;
// This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior
if (true === event.parsley) return;
// If we didn't come here through a submit button, use the first one in the form
var $submitSource = this._$submitSource || this.$element.find('input[type="submit"], button[type="submit"]').first();
this._$submitSource = null;
this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);
if ($submitSource.is('[formnovalidate]')) return;
var promise = this.whenValidate({ event: event });
if ('resolved' === promise.state() && false !== this._trigger('submit')) {
// All good, let event go through. We make this distinction because browsers
// differ in their handling of `submit` being called from inside a submit event [#1047]
} else {
// Rejected or pending: cancel this submit
event.stopImmediatePropagation();
event.preventDefault();
if ('pending' === promise.state()) promise.done(function () {
_this3._submit($submitSource);
});
}
},
onSubmitButton: function onSubmitButton(event) {
this._$submitSource = $(event.target);
},
// internal
// _submit submits the form, this time without going through the validations.
// Care must be taken to "fake" the actual submit button being clicked.
_submit: function _submit($submitSource) {
if (false === this._trigger('submit')) return;
// Add submit button's data
if ($submitSource) {
var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);
if (0 === $synthetic.length) $synthetic = $('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element);
$synthetic.attr({
name: $submitSource.attr('name'),
value: $submitSource.attr('value')
});
}
this.$element.trigger($.extend($.Event('submit'), { parsley: true }));
},
// Performs validation on fields while triggering events.
// @returns `true` if all validations succeeds, `false`
// if a failure is immediately detected, or `null`
// if dependant on a promise.
// Consider using `whenValidate` instead.
validate: function validate(options) {
if (arguments.length >= 1 && !$.isPlainObject(options)) {
ParsleyUtils__default.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');
var _arguments = _slice.call(arguments);
var group = _arguments[0];
var force = _arguments[1];
var event = _arguments[2];
options = { group: group, force: force, event: event };
}
return ParsleyForm__statusMapping[this.whenValidate(options).state()];
},
whenValidate: function whenValidate() {
var _this4 = this;
var _ref5 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var group = _ref5.group;
var force = _ref5.force;
var event = _ref5.event;
this.submitEvent = event;
if (event) {
this.submitEvent = $.extend({}, event, { preventDefault: function preventDefault() {
ParsleyUtils__default.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`");
_this4.validationResult = false;
} });
}
this.validationResult = true;
// fire validate event to eventually modify things before very validation
this._trigger('validate');
// Refresh form DOM options and form's fields that could have changed
this._refreshFields();
var promises = this._withoutReactualizingFormOptions(function () {
return $.map(_this4.fields, function (field) {
return field.whenValidate({ force: force, group: group });
});
});
var promiseBasedOnValidationResult = function promiseBasedOnValidationResult() {
var r = $.Deferred();
if (false === _this4.validationResult) r.reject();
return r.resolve().promise();
};
return $.when.apply($, _toConsumableArray(promises)).done(function () {
_this4._trigger('success');
}).fail(function () {
_this4.validationResult = false;
_this4.focus();
_this4._trigger('error');
}).always(function () {
_this4._trigger('validated');
}).pipe(promiseBasedOnValidationResult, promiseBasedOnValidationResult);
},
// Iterate over refreshed fields, and stop on first failure.
// Returns `true` if all fields are valid, `false` if a failure is detected
// or `null` if the result depends on an unresolved promise.
// Prefer using `whenValid` instead.
isValid: function isValid(options) {
if (arguments.length >= 1 && !$.isPlainObject(options)) {
ParsleyUtils__default.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');
var _arguments2 = _slice.call(arguments);
var group = _arguments2[0];
var force = _arguments2[1];
options = { group: group, force: force };
}
return ParsleyForm__statusMapping[this.whenValid(options).state()];
},
// Iterate over refreshed fields and validate them.
// Returns a promise.
// A validation that immediately fails will interrupt the validations.
whenValid: function whenValid() {
var _this5 = this;
var _ref6 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var group = _ref6.group;
var force = _ref6.force;
this._refreshFields();
var promises = this._withoutReactualizingFormOptions(function () {
return $.map(_this5.fields, function (field) {
return field.whenValid({ group: group, force: force });
});
});
return $.when.apply($, _toConsumableArray(promises));
},
_refreshFields: function _refreshFields() {
return this.actualizeOptions()._bindFields();
},
_bindFields: function _bindFields() {
var _this6 = this;
var oldFields = this.fields;
this.fields = [];
this.fieldsMappedById = {};
this._withoutReactualizingFormOptions(function () {
_this6.$element.find(_this6.options.inputs).not(_this6.options.excluded).each(function (_, element) {
var fieldInstance = new window.Parsley.Factory(element, {}, _this6);
// Only add valid and not excluded `ParsleyField` and `ParsleyFieldMultiple` children
if (('ParsleyField' === fieldInstance.__class__ || 'ParsleyFieldMultiple' === fieldInstance.__class__) && true !== fieldInstance.options.excluded) if ('undefined' === typeof _this6.fieldsMappedById[fieldInstance.__class__ + '-' + fieldInstance.__id__]) {
_this6.fieldsMappedById[fieldInstance.__class__ + '-' + fieldInstance.__id__] = fieldInstance;
_this6.fields.push(fieldInstance);
}
});
$(oldFields).not(_this6.fields).each(function (_, field) {
field._trigger('reset');
});
});
return this;
},
// Internal only.
// Looping on a form's fields to do validation or similar
// will trigger reactualizing options on all of them, which
// in turn will reactualize the form's options.
// To avoid calling actualizeOptions so many times on the form
// for nothing, _withoutReactualizingFormOptions temporarily disables
// the method actualizeOptions on this form while `fn` is called.
_withoutReactualizingFormOptions: function _withoutReactualizingFormOptions(fn) {
var oldActualizeOptions = this.actualizeOptions;
this.actualizeOptions = function () {
return this;
};
var result = fn();
this.actualizeOptions = oldActualizeOptions;
return result;
},
// Internal only.
// Shortcut to trigger an event
// Returns true iff event is not interrupted and default not prevented.
_trigger: function _trigger(eventName) {
return this.trigger('form:' + eventName);
}
};
var ConstraintFactory = function ConstraintFactory(parsleyField, name, requirements, priority, isDomConstraint) {
if (!/ParsleyField/.test(parsleyField.__class__)) throw new Error('ParsleyField or ParsleyFieldMultiple instance expected');
var validatorSpec = window.Parsley._validatorRegistry.validators[name];
var validator = new ParsleyValidator(validatorSpec);
$.extend(this, {
validator: validator,
name: name,
requirements: requirements,
priority: priority || parsleyField.options[name + 'Priority'] || validator.priority,
isDomConstraint: true === isDomConstraint
});
this._parseRequirements(parsleyField.options);
};
var capitalize = function capitalize(str) {
var cap = str[0].toUpperCase();
return cap + str.slice(1);
};
ConstraintFactory.prototype = {
validate: function validate(value, instance) {
var args = this.requirementList.slice(0); // Make copy
args.unshift(value);
args.push(instance);
return this.validator.validate.apply(this.validator, args);
},
_parseRequirements: function _parseRequirements(options) {
var _this7 = this;
this.requirementList = this.validator.parseRequirements(this.requirements, function (key) {
return options[_this7.name + capitalize(key)];
});
}
};
var ParsleyField = function ParsleyField(field, domOptions, options, parsleyFormInstance) {
this.__class__ = 'ParsleyField';
this.__id__ = ParsleyUtils__default.generateID();
this.$element = $(field);
// Set parent if we have one
if ('undefined' !== typeof parsleyFormInstance) {
this.parent = parsleyFormInstance;
}
this.options = options;
this.domOptions = domOptions;
// Initialize some properties
this.constraints = [];
this.constraintsByName = {};
this.validationResult = [];
// Bind constraints
this._bindConstraints();
};
var parsley_field__statusMapping = { pending: null, resolved: true, rejected: false };
ParsleyField.prototype = {
// # Public API
// Validate field and trigger some events for mainly `ParsleyUI`
// @returns `true`, an array of the validators that failed, or
// `null` if validation is not finished. Prefer using whenValidate
validate: function validate(options) {
if (arguments.length >= 1 && !$.isPlainObject(options)) {
ParsleyUtils__default.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');
options = { options: options };
}
var promise = this.whenValidate(options);
if (!promise) // If excluded with `group` option
return true;
switch (promise.state()) {
case 'pending':
return null;
case 'resolved':
return true;
case 'rejected':
return this.validationResult;
}
},
// Validate field and trigger some events for mainly `ParsleyUI`
// @returns a promise that succeeds only when all validations do
// or `undefined` if field is not in the given `group`.
whenValidate: function whenValidate() {
var _this8 = this;
var _ref7 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var force = _ref7.force;
var group = _ref7.group;
// do not validate a field if not the same as given validation group
this.refreshConstraints();
if (group && !this._isInGroup(group)) return;
this.value = this.getValue();
// Field Validate event. `this.value` could be altered for custom needs
this._trigger('validate');
return this.whenValid({ force: force, value: this.value, _refreshed: true }).always(function () {
_this8._reflowUI();
}).done(function () {
_this8._trigger('success');
}).fail(function () {
_this8._trigger('error');
}).always(function () {
_this8._trigger('validated');
});
},
hasConstraints: function hasConstraints() {
return 0 !== this.constraints.length;
},
// An empty optional field does not need validation
needsValidation: function needsValidation(value) {
if ('undefined' === typeof value) value = this.getValue();
// If a field is empty and not required, it is valid
// Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators
if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty) return false;
return true;
},
_isInGroup: function _isInGroup(group) {
if ($.isArray(this.options.group)) return -1 !== $.inArray(group, this.options.group);
return this.options.group === group;
},
// Just validate field. Do not trigger any event.
// Returns `true` iff all constraints pass, `false` if there are failures,
// or `null` if the result can not be determined yet (depends on a promise)
// See also `whenValid`.
isValid: function isValid(options) {
if (arguments.length >= 1 && !$.isPlainObject(options)) {
ParsleyUtils__default.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');
var _arguments3 = _slice.call(arguments);
var force = _arguments3[0];
var value = _arguments3[1];
options = { force: force, value: value };
}
var promise = this.whenValid(options);
if (!promise) // Excluded via `group`
return true;
return parsley_field__statusMapping[promise.state()];
},
// Just validate field. Do not trigger any event.
// @returns a promise that succeeds only when all validations do
// or `undefined` if the field is not in the given `group`.
// The argument `force` will force validation of empty fields.
// If a `value` is given, it will be validated instead of the value of the input.
whenValid: function whenValid() {
var _this9 = this;
var _ref8 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var _ref8$force = _ref8.force;
var force = _ref8$force === undefined ? false : _ref8$force;
var value = _ref8.value;
var group = _ref8.group;
var _refreshed = _ref8._refreshed;
// Recompute options and rebind constraints to have latest changes
if (!_refreshed) this.refreshConstraints();
// do not validate a field if not the same as given validation group
if (group && !this._isInGroup(group)) return;
this.validationResult = true;
// A field without constraint is valid
if (!this.hasConstraints()) return $.when();
// Value could be passed as argument, needed to add more power to 'parsley:field:validate'
if ('undefined' === typeof value || null === value) value = this.getValue();
if (!this.needsValidation(value) && true !== force) return $.when();
var groupedConstraints = this._getGroupedConstraints();
var promises = [];
$.each(groupedConstraints, function (_, constraints) {
// Process one group of constraints at a time, we validate the constraints
// and combine the promises together.
var promise = $.when.apply($, _toConsumableArray($.map(constraints, function (constraint) {
return _this9._validateConstraint(value, constraint);
})));
promises.push(promise);
if (promise.state() === 'rejected') return false; // Interrupt processing if a group has already failed
});
return $.when.apply($, promises);
},
// @returns a promise
_validateConstraint: function _validateConstraint(value, constraint) {
var _this10 = this;
var result = constraint.validate(value, this);
// Map false to a failed promise
if (false === result) result = $.Deferred().reject();
// Make sure we return a promise and that we record failures
return $.when(result).fail(function (errorMessage) {
if (true === _this10.validationResult) _this10.validationResult = [];
_this10.validationResult.push({
assert: constraint,
errorMessage: 'string' === typeof errorMessage && errorMessage
});
});
},
// @returns Parsley field computed value that could be overrided or configured in DOM
getValue: function getValue() {
var value;
// Value could be overriden in DOM or with explicit options
if ('function' === typeof this.options.value) value = this.options.value(this);else if ('undefined' !== typeof this.options.value) value = this.options.value;else value = this.$element.val();
// Handle wrong DOM or configurations
if ('undefined' === typeof value || null === value) return '';
return this._handleWhitespace(value);
},
// Actualize options that could have change since previous validation
// Re-bind accordingly constraints (could be some new, removed or updated)
refreshConstraints: function refreshConstraints() {
return this.actualizeOptions()._bindConstraints();
},
/**
* Add a new constraint to a field
*
* @param {String} name
* @param {Mixed} requirements optional
* @param {Number} priority optional
* @param {Boolean} isDomConstraint optional
*/
addConstraint: function addConstraint(name, requirements, priority, isDomConstraint) {
if (window.Parsley._validatorRegistry.validators[name]) {
var constraint = new ConstraintFactory(this, name, requirements, priority, isDomConstraint);
// if constraint already exist, delete it and push new version
if ('undefined' !== this.constraintsByName[constraint.name]) this.removeConstraint(constraint.name);
this.constraints.push(constraint);
this.constraintsByName[constraint.name] = constraint;
}
return this;
},
// Remove a constraint
removeConstraint: function removeConstraint(name) {
for (var i = 0; i < this.constraints.length; i++) if (name === this.constraints[i].name) {
this.constraints.splice(i, 1);
break;
}
delete this.constraintsByName[name];
return this;
},
// Update a constraint (Remove + re-add)
updateConstraint: function updateConstraint(name, parameters, priority) {
return this.removeConstraint(name).addConstraint(name, parameters, priority);
},
// # Internals
// Internal only.
// Bind constraints from config + options + DOM
_bindConstraints: function _bindConstraints() {
var constraints = [];
var constraintsByName = {};
// clean all existing DOM constraints to only keep javascript user constraints
for (var i = 0; i < this.constraints.length; i++) if (false === this.constraints[i].isDomConstraint) {
constraints.push(this.constraints[i]);
constraintsByName[this.constraints[i].name] = this.constraints[i];
}
this.constraints = constraints;
this.constraintsByName = constraintsByName;
// then re-add Parsley DOM-API constraints
for (var name in this.options) this.addConstraint(name, this.options[name], undefined, true);
// finally, bind special HTML5 constraints
return this._bindHtml5Constraints();
},
// Internal only.
// Bind specific HTML5 constraints to be HTML5 compliant
_bindHtml5Constraints: function _bindHtml5Constraints() {
// html5 required
if (this.$element.hasClass('required') || this.$element.attr('required')) this.addConstraint('required', true, undefined, true);
// html5 pattern
if ('string' === typeof this.$element.attr('pattern')) this.addConstraint('pattern', this.$element.attr('pattern'), undefined, true);
// range
if ('undefined' !== typeof this.$element.attr('min') && 'undefined' !== typeof this.$element.attr('max')) this.addConstraint('range', [this.$element.attr('min'), this.$element.attr('max')], undefined, true);
// HTML5 min
else if ('undefined' !== typeof this.$element.attr('min')) this.addConstraint('min', this.$element.attr('min'), undefined, true);
// HTML5 max
else if ('undefined' !== typeof this.$element.attr('max')) this.addConstraint('max', this.$element.attr('max'), undefined, true);
// length
if ('undefined' !== typeof this.$element.attr('minlength') && 'undefined' !== typeof this.$element.attr('maxlength')) this.addConstraint('length', [this.$element.attr('minlength'), this.$element.attr('maxlength')], undefined, true);
// HTML5 minlength
else if ('undefined' !== typeof this.$element.attr('minlength')) this.addConstraint('minlength', this.$element.attr('minlength'), undefined, true);
// HTML5 maxlength
else if ('undefined' !== typeof this.$element.attr('maxlength')) this.addConstraint('maxlength', this.$element.attr('maxlength'), undefined, true);
// html5 types
var type = this.$element.attr('type');
if ('undefined' === typeof type) return this;
// Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise
if ('number' === type) {
return this.addConstraint('type', ['number', {
step: this.$element.attr('step'),
base: this.$element.attr('min') || this.$element.attr('value')
}], undefined, true);
// Regular other HTML5 supported types
} else if (/^(email|url|range)$/i.test(type)) {
return this.addConstraint('type', type, undefined, true);
}
return this;
},
// Internal only.
// Field is required if have required constraint without `false` value
_isRequired: function _isRequired() {
if ('undefined' === typeof this.constraintsByName.required) return false;
return false !== this.constraintsByName.required.requirements;
},
// Internal only.
// Shortcut to trigger an event
_trigger: function _trigger(eventName) {
return this.trigger('field:' + eventName);
},
// Internal only
// Handles whitespace in a value
// Use `data-parsley-whitespace="squish"` to auto squish input value
// Use `data-parsley-whitespace="trim"` to auto trim input value
_handleWhitespace: function _handleWhitespace(value) {
if (true === this.options.trimValue) ParsleyUtils__default.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"');
if ('squish' === this.options.whitespace) value = value.replace(/\s{2,}/g, ' ');
if ('trim' === this.options.whitespace || 'squish' === this.options.whitespace || true === this.options.trimValue) value = ParsleyUtils__default.trimString(value);
return value;
},
// Internal only.
// Returns the constraints, grouped by descending priority.
// The result is thus an array of arrays of constraints.
_getGroupedConstraints: function _getGroupedConstraints() {
if (false === this.options.priorityEnabled) return [this.constraints];
var groupedConstraints = [];
var index = {};
// Create array unique of priorities
for (var i = 0; i < this.constraints.length; i++) {
var p = this.constraints[i].priority;
if (!index[p]) groupedConstraints.push(index[p] = []);
index[p].push(this.constraints[i]);
}
// Sort them by priority DESC
groupedConstraints.sort(function (a, b) {
return b[0].priority - a[0].priority;
});
return groupedConstraints;
}
};
var parsley_field = ParsleyField;
var ParsleyMultiple = function ParsleyMultiple() {
this.__class__ = 'ParsleyFieldMultiple';
};
ParsleyMultiple.prototype = {
// Add new `$element` sibling for multiple field
addElement: function addElement($element) {
this.$elements.push($element);
return this;
},
// See `ParsleyField.refreshConstraints()`
refreshConstraints: function refreshConstraints() {
var fieldConstraints;
this.constraints = [];
// Select multiple special treatment
if (this.$element.is('select')) {
this.actualizeOptions()._bindConstraints();
return this;
}
// Gather all constraints for each input in the multiple group
for (var i = 0; i < this.$elements.length; i++) {
// Check if element have not been dynamically removed since last binding
if (!$('html').has(this.$elements[i]).length) {
this.$elements.splice(i, 1);
continue;
}
fieldConstraints = this.$elements[i].data('ParsleyFieldMultiple').refreshConstraints().constraints;
for (var j = 0; j < fieldConstraints.length; j++) this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);
}
return this;
},
// See `ParsleyField.getValue()`
getValue: function getValue() {
// Value could be overriden in DOM
if ('function' === typeof this.options.value) value = this.options.value(this);else if ('undefined' !== typeof this.options.value) return this.options.value;
// Radio input case
if (this.$element.is('input[type=radio]')) return this._findRelated().filter(':checked').val() || '';
// checkbox input case
if (this.$element.is('input[type=checkbox]')) {
var values = [];
this._findRelated().filter(':checked').each(function () {
values.push($(this).val());
});
return values;
}
// Select multiple case
if (this.$element.is('select') && null === this.$element.val()) return [];
// Default case that should never happen
return this.$element.val();
},
_init: function _init() {
this.$elements = [this.$element];
return this;
}
};
var ParsleyFactory = function ParsleyFactory(element, options, parsleyFormInstance) {
this.$element = $(element);
// If the element has already been bound, returns its saved Parsley instance
var savedparsleyFormInstance = this.$element.data('Parsley');
if (savedparsleyFormInstance) {
// If the saved instance has been bound without a ParsleyForm parent and there is one given in this call, add it
if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {
savedparsleyFormInstance.parent = parsleyFormInstance;
savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);
}
return savedparsleyFormInstance;
}
// Parsley must be instantiated with a DOM element or jQuery $element
if (!this.$element.length) throw new Error('You must bind Parsley on an existing element.');
if ('undefined' !== typeof parsleyFormInstance && 'ParsleyForm' !== parsleyFormInstance.__class__) throw new Error('Parent instance must be a ParsleyForm instance');
this.parent = parsleyFormInstance || window.Parsley;
return this.init(options);
};
ParsleyFactory.prototype = {
init: function init(options) {
this.__class__ = 'Parsley';
this.__version__ = '2.3.1';
this.__id__ = ParsleyUtils__default.generateID();
// Pre-compute options
this._resetOptions(options);
// A ParsleyForm instance is obviously a `<form>` element but also every node that is not an input and has the `data-parsley-validate` attribute
if (this.$element.is('form') || ParsleyUtils__default.checkAttr(this.$element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)) return this.bind('parsleyForm');
// Every other element is bound as a `ParsleyField` or `ParsleyFieldMultiple`
return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');
},
isMultiple: function isMultiple() {
return this.$element.is('input[type=radio], input[type=checkbox]') || this.$element.is('select') && 'undefined' !== typeof this.$element.attr('multiple');
},
// Multiples fields are a real nightmare :(
// Maybe some refactoring would be appreciated here...
handleMultiple: function handleMultiple() {
var _this11 = this;
var name;
var multiple;
var parsleyMultipleInstance;
// Handle multiple name
if (this.options.multiple) ; // We already have our 'multiple' identifier
else if ('undefined' !== typeof this.$element.attr('name') && this.$element.attr('name').length) this.options.multiple = name = this.$element.attr('name');else if ('undefined' !== typeof this.$element.attr('id') && this.$element.attr('id').length) this.options.multiple = this.$element.attr('id');
// Special select multiple input
if (this.$element.is('select') && 'undefined' !== typeof this.$element.attr('multiple')) {
this.options.multiple = this.options.multiple || this.__id__;
return this.bind('parsleyFieldMultiple');
// Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it
} else if (!this.options.multiple) {
ParsleyUtils__default.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);
return this;
}
// Remove special chars
this.options.multiple = this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g, '');
// Add proper `data-parsley-multiple` to siblings if we have a valid multiple name
if ('undefined' !== typeof name) {
$('input[name="' + name + '"]').each(function (i, input) {
if ($(input).is('input[type=radio], input[type=checkbox]')) $(input).attr(_this11.options.namespace + 'multiple', _this11.options.multiple);
});
}
// Check here if we don't already have a related multiple instance saved
var $previouslyRelated = this._findRelated();
for (var i = 0; i < $previouslyRelated.length; i++) {
parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');
if ('undefined' !== typeof parsleyMultipleInstance) {
if (!this.$element.data('ParsleyFieldMultiple')) {
parsleyMultipleInstance.addElement(this.$element);
}
break;
}
}
// Create a secret ParsleyField instance for every multiple field. It will be stored in `data('ParsleyFieldMultiple')`
// And will be useful later to access classic `ParsleyField` stuff while being in a `ParsleyFieldMultiple` instance
this.bind('parsleyField', true);
return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');
},
// Return proper `ParsleyForm`, `ParsleyField` or `ParsleyFieldMultiple`
bind: function bind(type, doNotStore) {
var parsleyInstance;
switch (type) {
case 'parsleyForm':
parsleyInstance = $.extend(new ParsleyForm(this.$element, this.domOptions, this.options), window.ParsleyExtend)._bindFields();
break;
case 'parsleyField':
parsleyInstance = $.extend(new parsley_field(this.$element, this.domOptions, this.options, this.parent), window.ParsleyExtend);
break;
case 'parsleyFieldMultiple':
parsleyInstance = $.extend(new parsley_field(this.$element, this.domOptions, this.options, this.parent), new ParsleyMultiple(), window.ParsleyExtend)._init();
break;
default:
throw new Error(type + 'is not a supported Parsley type');
}
if (this.options.multiple) ParsleyUtils__default.setAttr(this.$element, this.options.namespace, 'multiple', this.options.multiple);
if ('undefined' !== typeof doNotStore) {
this.$element.data('ParsleyFieldMultiple', parsleyInstance);
return parsleyInstance;
}
// Store the freshly bound instance in a DOM element for later access using jQuery `data()`
this.$element.data('Parsley', parsleyInstance);
// Tell the world we have a new ParsleyForm or ParsleyField instance!
parsleyInstance._actualizeTriggers();
parsleyInstance._trigger('init');
return parsleyInstance;
}
};
var vernums = $.fn.jquery.split('.');
if (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {
throw "The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";
}
if (!vernums.forEach) {
ParsleyUtils__default.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');
}
// Inherit `on`, `off` & `trigger` to Parsley:
var Parsley = $.extend(new ParsleyAbstract(), {
$element: $(document),
actualizeOptions: null,
_resetOptions: null,
Factory: ParsleyFactory,
version: '2.3.1'
});
// Supplement ParsleyField and Form with ParsleyAbstract
// This way, the constructors will have access to those methods
$.extend(parsley_field.prototype, ParsleyUI.Field, ParsleyAbstract.prototype);
$.extend(ParsleyForm.prototype, ParsleyUI.Form, ParsleyAbstract.prototype);
// Inherit actualizeOptions and _resetOptions:
$.extend(ParsleyFactory.prototype, ParsleyAbstract.prototype);
// ### jQuery API
// `$('.elem').parsley(options)` or `$('.elem').psly(options)`
$.fn.parsley = $.fn.psly = function (options) {
if (this.length > 1) {
var instances = [];
this.each(function () {
instances.push($(this).parsley(options));
});
return instances;
}
// Return undefined if applied to non existing DOM element
if (!$(this).length) {
ParsleyUtils__default.warn('You must bind Parsley on an existing element.');
return;
}
return new ParsleyFactory(this, options);
};
// ### ParsleyField and ParsleyForm extension
// Ensure the extension is now defined if it wasn't previously
if ('undefined' === typeof window.ParsleyExtend) window.ParsleyExtend = {};
// ### Parsley config
// Inherit from ParsleyDefault, and copy over any existing values
Parsley.options = $.extend(ParsleyUtils__default.objectCreate(ParsleyDefaults), window.ParsleyConfig);
window.ParsleyConfig = Parsley.options; // Old way of accessing global options
// ### Globals
window.Parsley = window.psly = Parsley;
window.ParsleyUtils = ParsleyUtils__default;
// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley
var registry = window.Parsley._validatorRegistry = new ParsleyValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);
window.ParsleyValidator = {};
$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator'.split(' '), function (i, method) {
window.Parsley[method] = $.proxy(registry, method);
window.ParsleyValidator[method] = function () {
var _window$Parsley;
ParsleyUtils__default.warnOnce('Accessing the method \'' + method + '\' through ParsleyValidator is deprecated. Simply call \'window.Parsley.' + method + '(...)\'');
return (_window$Parsley = window.Parsley)[method].apply(_window$Parsley, arguments);
};
});
// ### ParsleyUI
// Deprecated global object
window.Parsley.UI = ParsleyUI;
window.ParsleyUI = {
removeError: function removeError(instance, name, doNotUpdateClass) {
var updateClass = true !== doNotUpdateClass;
ParsleyUtils__default.warnOnce('Accessing ParsleyUI is deprecated. Call \'removeError\' on the instance directly.');
return instance.removeError(name, { updateClass: updateClass });
},
getErrorsMessages: function getErrorsMessages(instance) {
ParsleyUtils__default.warnOnce('Accessing ParsleyUI is deprecated. Call \'getErrorsMessages\' on the instance directly.');
return instance.getErrorsMessages();
}
};
$.each('addError updateError'.split(' '), function (i, method) {
window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {
var updateClass = true !== doNotUpdateClass;
ParsleyUtils__default.warnOnce('Accessing ParsleyUI is deprecated. Call \'' + method + '\' on the instance directly.');
return instance[method](name, { message: message, assert: assert, updateClass: updateClass });
};
});
// ### PARSLEY auto-binding
// Prevent it by setting `ParsleyConfig.autoBind` to `false`
if (false !== window.ParsleyConfig.autoBind) {
$(function () {
// Works only on `data-parsley-validate`.
if ($('[data-parsley-validate]').length) $('[data-parsley-validate]').parsley();
});
}
var o = $({});
var deprecated = function deprecated() {
ParsleyUtils__default.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley");
};
// Returns an event handler that calls `fn` with the arguments it expects
function adapt(fn, context) {
// Store to allow unbinding
if (!fn.parsleyAdaptedCallback) {
fn.parsleyAdaptedCallback = function () {
var args = Array.prototype.slice.call(arguments, 0);
args.unshift(this);
fn.apply(context || o, args);
};
}
return fn.parsleyAdaptedCallback;
}
var eventPrefix = 'parsley:';
// Converts 'parsley:form:validate' into 'form:validate'
function eventName(name) {
if (name.lastIndexOf(eventPrefix, 0) === 0) return name.substr(eventPrefix.length);
return name;
}
// $.listen is deprecated. Use Parsley.on instead.
$.listen = function (name, callback) {
var context;
deprecated();
if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {
context = arguments[1];
callback = arguments[2];
}
if ('function' !== typeof callback) throw new Error('Wrong parameters');
window.Parsley.on(eventName(name), adapt(callback, context));
};
$.listenTo = function (instance, name, fn) {
deprecated();
if (!(instance instanceof parsley_field) && !(instance instanceof ParsleyForm)) throw new Error('Must give Parsley instance');
if ('string' !== typeof name || 'function' !== typeof fn) throw new Error('Wrong parameters');
instance.on(eventName(name), adapt(fn));
};
$.unsubscribe = function (name, fn) {
deprecated();
if ('string' !== typeof name || 'function' !== typeof fn) throw new Error('Wrong arguments');
window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);
};
$.unsubscribeTo = function (instance, name) {
deprecated();
if (!(instance instanceof parsley_field) && !(instance instanceof ParsleyForm)) throw new Error('Must give Parsley instance');
instance.off(eventName(name));
};
$.unsubscribeAll = function (name) {
deprecated();
window.Parsley.off(eventName(name));
$('form,input,textarea,select').each(function () {
var instance = $(this).data('Parsley');
if (instance) {
instance.off(eventName(name));
}
});
};
// $.emit is deprecated. Use jQuery events instead.
$.emit = function (name, instance) {
var _instance;
deprecated();
var instanceGiven = instance instanceof parsley_field || instance instanceof ParsleyForm;
var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);
args.unshift(eventName(name));
if (!instanceGiven) {
instance = window.Parsley;
}
(_instance = instance).trigger.apply(_instance, _toConsumableArray(args));
};
var pubsub = {};
$.extend(true, Parsley, {
asyncValidators: {
'default': {
fn: function fn(xhr) {
// By default, only status 2xx are deemed successful.
// Note: we use status instead of state() because responses with status 200
// but invalid messages (e.g. an empty body for content type set to JSON) will
// result in state() === 'rejected'.
return xhr.status >= 200 && xhr.status < 300;
},
url: false
},
reverse: {
fn: function fn(xhr) {
// If reverse option is set, a failing ajax request is considered successful
return xhr.status < 200 || xhr.status >= 300;
},
url: false
}
},
addAsyncValidator: function addAsyncValidator(name, fn, url, options) {
Parsley.asyncValidators[name] = {
fn: fn,
url: url || false,
options: options || {}
};
return this;
}
});
Parsley.addValidator('remote', {
requirementType: {
'': 'string',
'validator': 'string',
'reverse': 'boolean',
'options': 'object'
},
validateString: function validateString(value, url, options, instance) {
var data = {};
var ajaxOptions;
var csr;
var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');
if ('undefined' === typeof Parsley.asyncValidators[validator]) throw new Error('Calling an undefined async validator: `' + validator + '`');
url = Parsley.asyncValidators[validator].url || url;
// Fill current value
if (url.indexOf('{value}') > -1) {
url = url.replace('{value}', encodeURIComponent(value));
} else {
data[instance.$element.attr('name') || instance.$element.attr('id')] = value;
}
// Merge options passed in from the function with the ones in the attribute
var remoteOptions = $.extend(true, options.options || {}, Parsley.asyncValidators[validator].options);
// All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`
ajaxOptions = $.extend(true, {}, {
url: url,
data: data,
type: 'GET'
}, remoteOptions);
// Generate store key based on ajax options
instance.trigger('field:ajaxoptions', instance, ajaxOptions);
csr = $.param(ajaxOptions);
// Initialise querry cache
if ('undefined' === typeof Parsley._remoteCache) Parsley._remoteCache = {};
// Try to retrieve stored xhr
var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);
var handleXhr = function handleXhr() {
var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);
if (!result) // Map falsy results to rejected promise
result = $.Deferred().reject();
return $.when(result);
};
return xhr.then(handleXhr, handleXhr);
},
priority: -1
});
Parsley.on('form:submit', function () {
Parsley._remoteCache = {};
});
window.ParsleyExtend.addAsyncValidator = function () {
ParsleyUtils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');
return Parsley.addAsyncValidator.apply(Parsley, arguments);
};
// This is included with the Parsley library itself,
// thus there is no use in adding it to your project.
Parsley.addMessages('en', {
defaultMessage: "This value seems to be invalid.",
type: {
email: "This value should be a valid email.",
url: "This value should be a valid url.",
number: "This value should be a valid number.",
integer: "This value should be a valid integer.",
digits: "This value should be digits.",
alphanum: "This value should be alphanumeric."
},
notblank: "This value should not be blank.",
required: "This value is required.",
pattern: "This value seems to be invalid.",
min: "This value should be greater than or equal to %s.",
max: "This value should be lower than or equal to %s.",
range: "This value should be between %s and %s.",
minlength: "This value is too short. It should have %s characters or more.",
maxlength: "This value is too long. It should have %s characters or fewer.",
length: "This value length is invalid. It should be between %s and %s characters long.",
mincheck: "You must select at least %s choices.",
maxcheck: "You must select %s choices or fewer.",
check: "You must select between %s and %s choices.",
equalto: "This value should be the same."
});
Parsley.setLocale('en');
var parsley = Parsley;
return parsley;
});
//# sourceMappingURL=parsley.js.map
|
node_modules/react-bootstrap/es/Badge.js
|
mohammed52/something.pk
|
import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import classNames from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
// TODO: `pullRight` doesn't belong here. There's no special handling here.
var propTypes = {
pullRight: PropTypes.bool
};
var defaultProps = {
pullRight: false
};
var Badge = function (_React$Component) {
_inherits(Badge, _React$Component);
function Badge() {
_classCallCheck(this, Badge);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Badge.prototype.hasContent = function hasContent(children) {
var result = false;
React.Children.forEach(children, function (child) {
if (result) {
return;
}
if (child || child === 0) {
result = true;
}
});
return result;
};
Badge.prototype.render = function render() {
var _props = this.props,
pullRight = _props.pullRight,
className = _props.className,
children = _props.children,
props = _objectWithoutProperties(_props, ['pullRight', 'className', 'children']);
var _splitBsProps = splitBsProps(props),
bsProps = _splitBsProps[0],
elementProps = _splitBsProps[1];
var classes = _extends({}, getClassSet(bsProps), {
'pull-right': pullRight,
// Hack for collapsing on IE8.
hidden: !this.hasContent(children)
});
return React.createElement(
'span',
_extends({}, elementProps, {
className: classNames(className, classes)
}),
children
);
};
return Badge;
}(React.Component);
Badge.propTypes = propTypes;
Badge.defaultProps = defaultProps;
export default bsClass('badge', Badge);
|
src/js/jquery-1.9.0.min.js
|
ivankd/restobaza-demo
|
/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t
},set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")
},nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
//@ sourceMappingURL=jquery.min.map
|
src/admin/components/chrome/index.js
|
ccetc/platform
|
import React from 'react'
import { connect } from 'react-redux'
import { getActiveUser } from '../admin/selectors'
import Topbar from './topbar'
export class Chrome extends React.Component {
static contextTypes = {
router: React.PropTypes.object
}
static propTypes = {
teams: React.PropTypes.array,
user: React.PropTypes.object
}
render() {
const { children, user } = this.props
if(!user) return null
return (
<div className="chrome">
<Topbar />
<div className="chrome-workspace">
{ children }
</div>
</div>
)
}
}
const mapStateToProps = (state, props) => ({
user: getActiveUser(state)
})
export default connect(mapStateToProps)(Chrome)
|
fields/types/password/PasswordField.js
|
tony2cssc/keystone
|
import React from 'react';
import Field from '../Field';
import { Button, FormInput, InputGroup } from 'elemental';
module.exports = Field.create({
displayName: 'PasswordField',
getInitialState () {
return {
passwordIsSet: this.props.value ? true : false,
showChangeUI: this.props.mode === 'create' ? true : false,
password: '',
confirm: '',
};
},
valueChanged (which, event) {
var newState = {};
newState[which] = event.target.value;
this.setState(newState);
},
showChangeUI () {
this.setState({
showChangeUI: true,
}, () => this.focus());
},
onCancel () {
this.setState({
showChangeUI: false,
}, () => this.focus());
},
renderValue () {
return <FormInput noedit>{this.props.value ? 'password set' : 'password not set'}</FormInput>;
},
renderField () {
return this.state.showChangeUI ? this.renderFields() : this.renderChangeButton();
},
renderFields () {
return (
<InputGroup>
<InputGroup.Section grow>
<FormInput type="password" name={this.props.path} placeholder="New password" ref="focusTarget" value={this.state.password} onChange={this.valueChanged.bind(this, 'password')} autoComplete="off" />
</InputGroup.Section>
<InputGroup.Section grow>
<FormInput type="password" name={this.props.paths.confirm} placeholder="Confirm new password" value={this.state.confirm} onChange={this.valueChanged.bind(this, 'confirm')} autoComplete="off" />
</InputGroup.Section>
{this.state.passwordIsSet ? <InputGroup.Section><Button onClick={this.onCancel}>Cancel</Button></InputGroup.Section> : null}
</InputGroup>
);
},
renderChangeButton () {
var label = this.state.passwordIsSet ? 'Change Password' : 'Set Password';
return (
<Button ref="focusTarget" onClick={this.showChangeUI}>{label}</Button>
);
},
});
|
ditto/static/dist/main-015e76c62b052d879970.js
|
Kvoti/ditto
|
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="/static/dist/",t(0)}([function(e,t,n){e.exports=n(270)},function(e,t,n){e.exports=n(61)},function(e,t,n){"use strict";function r(e){return isNaN(e=+e)?0:(e>0?m:h)(e)}function o(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function i(e,t,n){return e[t]=n,e}function a(e){return y?function(t,n,r){return _.setDesc(t,n,o(e,r))}:i}function s(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function u(e){return"function"==typeof e}function l(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}var c="undefined"!=typeof self?self:Function("return this")(),p={},f=Object.defineProperty,d={}.hasOwnProperty,h=Math.ceil,m=Math.floor,v=Math.max,g=Math.min,y=!!function(){try{return 2==f({},"a",{get:function(){return 2}}).a}catch(e){}}(),b=a(1),_=e.exports=n(332)({g:c,core:p,html:c.document&&document.documentElement,isObject:s,isFunction:u,that:function(){return this},toInteger:r,toLength:function(e){return e>0?g(r(e),9007199254740991):0},toIndex:function(e,t){return e=r(e),0>e?v(e+t,0):g(e,t)},has:function(e,t){return d.call(e,t)},create:Object.create,getProto:Object.getPrototypeOf,DESC:y,desc:o,getDesc:Object.getOwnPropertyDescriptor,setDesc:f,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:l,ES5Object:Object,toObject:function(e){return _.ES5Object(l(e))},hide:b,def:a(0),set:c.Symbol?i:b,each:[].forEach});"undefined"!=typeof __e&&(__e=p),"undefined"!=typeof __g&&(__g=c)},function(e,t,n){var r;/*!
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e+=" "+n;else if(Array.isArray(n))e+=" "+o.apply(null,n);else if("object"===r)for(var i in n)n.hasOwnProperty(i)&&n[i]&&(e+=" "+i)}}return e.substr(1)}"undefined"!=typeof e&&e.exports?e.exports=o:(r=function(){return o}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}()},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw u.framesToPop=1,u}};e.exports=r},function(e,t,n){function r(e,t){return function(){return e.apply(t,arguments)}}function o(e,t,n){var c,p,f,d,h=e&o.G,m=e&o.P,v=h?a:e&o.S?a[t]:(a[t]||{}).prototype,g=h?s:s[t]||(s[t]={});h&&(n=t);for(c in n)p=!(e&o.F)&&v&&c in v,f=(p?v:n)[c],d=e&o.B&&p?r(f,a):m&&u(f)?r(Function.call,f):f,v&&!p&&l(v,c,f),g[c]!=f&&i.hide(g,c,d),m&&((g.prototype||(g.prototype={}))[c]=f)}var i=n(2),a=i.g,s=i.core,u=i.isFunction,l=n(36);a.core=s,o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(99),i=r(o),a=n(14),s=r(a),u={propTypes:{bsClass:s["default"].keyOf(i["default"].CLASSES),bsStyle:s["default"].keyOf(i["default"].STYLES),bsSize:s["default"].keyOf(i["default"].SIZES)},getBsClassSet:function(){var e={},t=this.props.bsClass&&i["default"].CLASSES[this.props.bsClass];if(t){e[t]=!0;var n=t+"-",r=this.props.bsSize&&i["default"].SIZES[this.props.bsSize];r&&(e[n+r]=!0);var o=this.props.bsStyle&&i["default"].STYLES[this.props.bsStyle];this.props.bsStyle&&(e[n+o]=!0)}return e},prefixClass:function(e){return i["default"].CLASSES[this.props.bsClass]+"-"+e}};t["default"]=u,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),r=Object.prototype.hasOwnProperty,o=1;o<arguments.length;o++){var i=arguments[o];if(null!=i){var a=Object(i);for(var s in a)r.call(a,s)&&(n[s]=a[s])}}return n}e.exports=n},function(e,t,n){"use strict";var r=n(33),o=r;e.exports=o},function(e,t,n){"use strict";var r=n(152),o=n(40),i=n(7),a=(n(8),{key:!0,ref:!0}),s=function(e,t,n,r,o,i){this.type=e,this.key=t,this.ref=n,this._owner=r,this._context=o,this.props=i};s.prototype={_isReactElement:!0},s.createElement=function(e,t,n){var i,u={},l=null,c=null;if(null!=t){c=void 0===t.ref?null:t.ref,l=void 0===t.key?null:""+t.key;for(i in t)t.hasOwnProperty(i)&&!a.hasOwnProperty(i)&&(u[i]=t[i])}var p=arguments.length-2;if(1===p)u.children=n;else if(p>1){for(var f=Array(p),d=0;p>d;d++)f[d]=arguments[d+2];u.children=f}if(e&&e.defaultProps){var h=e.defaultProps;for(i in h)"undefined"==typeof u[i]&&(u[i]=h[i])}return new s(e,l,c,o.current,r.current,u)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceProps=function(e,t){var n=new s(e.type,e.key,e.ref,e._owner,e._context,t);return n},s.cloneElement=function(e,t,n){var r,u=i({},e.props),l=e.key,c=e.ref,p=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,p=o.current),void 0!==t.key&&(l=""+t.key);for(r in t)t.hasOwnProperty(r)&&!a.hasOwnProperty(r)&&(u[r]=t[r])}var f=arguments.length-2;if(1===f)u.children=n;else if(f>1){for(var d=Array(f),h=0;f>h;h++)d[h]=arguments[h+2];u.children=d}return new s(e.type,l,c,p,e._context,u)},s.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},e.exports=s},function(e,t,n){e.exports=n(552)},function(e,t,n){"use strict";var r=n(130);e.exports={ActionTypes:r({CONNECT:null,DISCONNECT:null,CREATE_THREAD:null,END_THREAD:null,RATE_THREAD:null,CREATE_MESSAGE:null,START_TYPING:null,STOP_TYPING:null,RECEIVE_RAW_CREATED_MESSAGE:null,RECEIVE_RAW_PRIVATE_MESSAGE:null,RECEIVE_RAW_MESSAGES:null,RECEIVE_USER_PROFILE:null,RECEIVE_START_TYPING:null,RECEIVE_STOP_TYPING:null,RECEIVE_ONLINE:null,RECEIVE_OFFLINE:null,RECEIVE_CHAT_STATUS:null,RECEIVE_END_THREAD:null,RECEIVE_SESSION_RATING:null,RECEIVE_ROOM_LIST:null,CREATE_ROOM:null,JOIN_ROOM:null,LEAVE_ROOM:null,CHANGE_AVATAR:null,CHANGE_CHATROOM:null,CHANGE_PRIVATE_CHAT:null,CHANGE_PRIVATE_CHAT_TYPE:null}),chatStatus:{away:"Away",chat:"Available",dnd:"Do not disturb",xa:"Extended away"},stillTypingTimeout:3e3,connected:"connected",disconnected:"disconnected",sessionRatings:["Very poor","Poor","OK","Good","Very good"]}},function(e,t,n){"use strict";var r=n(416).Dispatcher;e.exports=new r},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,o,i=n(e),a=1;a<arguments.length;a++){r=arguments[a],o=Object.keys(Object(r));for(var s=0;s<o.length;s++)i[o[s]]=r[o[s]]}return i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Array.isArray(e)?e:Array.from(e)}function i(e,t,n,r){return"Invalid prop '"+t+"' of value '"+e[t]+"'"+(" supplied to '"+n+"'"+r)}function a(e){function t(t,n,r,o){return o=o||h,null!=n[r]?e(n,r,o):t?new Error("Required prop '"+r+"' was not specified in '"+o+"'."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function s(){function e(e,t,n){return"object"!=typeof e[t]||"function"!=typeof e[t].render&&1!==e[t].nodeType?new Error(i(e,t,n,", expected a DOM element or an object that has a `render` method")):void 0}return a(e)}function u(e){function t(t,n,r){var o=t[n];if(!e.hasOwnProperty(o)){var a=JSON.stringify(Object.keys(e));return new Error(i(t,n,r,", expected one of "+a+"."))}}return a(t)}function l(e){function t(t,n,r){var i=e.map(function(e){return t[e]}).reduce(function(e,t){return e+(void 0!==t?1:0)},0);if(i>1){var a=o(e),s=a[0],u=a.slice(1),l=""+u.join(", ")+" and "+s;return new Error("Invalid prop '"+n+"', only one of the following may be provided: "+l)}}return t}function c(e){if(void 0===e)throw new Error("No validations provided");if(!(e instanceof Array))throw new Error("Invalid argument must be an array");if(0===e.length)throw new Error("No validations provided");return function(t,n,r){for(var o=0;o<e.length;o++){var i=e[o](t,n,r);if(void 0!==i&&null!==i)return i}}}function p(){function e(e,t,n){var r=i(e,t,n,". Expected an Element `type`");if("function"!=typeof e[t]){if(d["default"].isValidElement(e[t]))return new Error(r+", not an actual Element");if("string"!=typeof e[t])return new Error(r+" such as a tag name or return value of React.createClass(...)")}}return a(e)}Object.defineProperty(t,"__esModule",{value:!0});var f=n(1),d=r(f),h="<<anonymous>>",m={isRequiredForA11y:function(e){return function(t,n,r){return null===t[n]?new Error("The prop `"+n+"` is required to make "+r+" accessible for users using assistive technologies such as screen readers `"):e(t,n,r)}},mountable:s(),elementType:p(),keyOf:u,singlePropFrom:l,all:c};t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=0;return l["default"].Children.map(e,function(e){if(l["default"].isValidElement(e)){var o=r;return r++,t.call(n,e,o)}return e})}function i(e,t,n){var r=0;return l["default"].Children.forEach(e,function(e){l["default"].isValidElement(e)&&(t.call(n,e,r),r++)})}function a(e){var t=0;return l["default"].Children.forEach(e,function(e){l["default"].isValidElement(e)&&t++}),t}function s(e){var t=!1;return l["default"].Children.forEach(e,function(e){!t&&l["default"].isValidElement(e)&&(t=!0)}),t}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),l=r(u);t["default"]={map:o,forEach:i,numberOf:a,hasValidComponent:s},e.exports=t["default"]},function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r},function(e,t,n){function r(e,t,n){if(!e)throw TypeError(n?t+n:t)}var o=n(2);r.def=o.assertDefined,r.fn=function(e){if(!o.isFunction(e))throw TypeError(e+" is not a function!");return e},r.obj=function(e){if(!o.isObject(e))throw TypeError(e+" is not an object!");return e},r.inst=function(e,t,n){if(!(e instanceof t))throw TypeError(n+": use the 'new' operator!");return e},e.exports=r},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,o,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,s=new Array(o-1),u=1;o>u;u++)s[u-1]=arguments[u];n.apply(this,s)}else if(i(n)){for(o=arguments.length,s=new Array(o-1),u=1;o>u;u++)s[u-1]=arguments[u];for(l=n.slice(),o=l.length,u=0;o>u;u++)l[u].apply(this,s)}return!0},n.prototype.addListener=function(e,t){var o;if(!r(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned){var o;o=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-->0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(0>o)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?r(e._events[t])?1:e._events[t].length:0}},function(e,t){"use strict";function n(e){return"/"+DITTO.tenant+"/"+e}e.exports={startSession:function(){return n("ratings/")},getSessionRating:function(e){return n("ratings/"+e+"/")},rateSession:function(e){return this.getSessionRating(e)},messages:function(){return n("messages/")},message:function(e){return n("messages/"+e+"/")},sessions:function(){return n("sessions/")},session:function(e){return n("sessions/"+e+"/")},chatrooms:function(){return n("chatroom/")},chatroom:function(e){return this.chatrooms()+e+"/"},chatroomConfig:function(e){return n("config/chatroom/"+e+"/")},tickets:function(){return n("dashboard/tickets/")},ticket:function(e){return this.tickets()+e+"/"},users:function(){return n("people/")},user:function(e){return this.users()+e+"/"},api:{roles:function(){return n("api/roles/")},forms:function(e){return n("forms/api/"+e+"/")},chatrooms:function(){return n("api/chat/rooms/")},chatroom:function(e){return this.chatrooms()+e+"/"},slots:function(){return n("api/chat/slots/")},slot:function(e){return this.slots()+e+"/"},tickets:function(){return n("api/tickets/")},ticket:function(e){return this.tickets()+e+"/"},users:function(){return n("api/users/")},user:function(e){return this.users()+e+"/"},values:function(e){return n("api/values/"+e+"/")}}}},function(e,t,n){function r(e){return a.call(e).slice(8,-1)}var o=n(2),i=n(21)("toStringTag"),a={}.toString;r.classof=function(e){var t,n;return void 0==e?void 0===e?"Undefined":"Null":"string"==typeof(n=(t=Object(e))[i])?n:r(t)},r.set=function(e,t,n){e&&!o.has(e=n?e:e.prototype,i)&&o.hide(e,i,t)},e.exports=r},function(e,t,n){var r=n(2).g,o=n(124)("wks");e.exports=function(e){return o[e]||(o[e]=r.Symbol&&r.Symbol[e]||n(32).safe("Symbol."+e))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=d["default"].findDOMNode(e);return t&&t.ownerDocument||document}function i(e){var t=o(e);return t.defaultView?t.defaultView:t.parentWindow}function a(e){var t=o(e);try{return t.activeElement||t.body}catch(n){return t.body}}function s(e){return o(e).defaultView.getComputedStyle(e,null)}function u(e){if(window.jQuery)return window.jQuery(e).offset();var t=o(e).documentElement,n={top:0,left:0};return"undefined"!=typeof e.getBoundingClientRect&&(n=e.getBoundingClientRect()),{top:n.top+window.pageYOffset-t.clientTop,left:n.left+window.pageXOffset-t.clientLeft}}function l(e,t){var n=void 0,r=void 0;return window.jQuery?t?(n=window.jQuery(e).offset(),r=window.jQuery(t).offset(),{top:n.top-r.top,left:n.left-r.left}):window.jQuery(e).position():(r={top:0,left:0},"fixed"===s(e).position?n=e.getBoundingClientRect():(t||(t=c(e)),n=u(e),"HTML"!==t.nodeName&&(r=u(t)),r.top+=parseInt(s(t).borderTopWidth,10),r.left+=parseInt(s(t).borderLeftWidth,10)),{top:n.top-r.top-parseInt(s(e).marginTop,10),left:n.left-r.left-parseInt(s(e).marginLeft,10)})}function c(e){for(var t=o(e).documentElement,n=e.offsetParent||t;n&&"HTML"!==n.nodeName&&"static"===s(n).position;)n=n.offsetParent;return n||t}function p(e,t){function n(e,t){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}return e&&e.contains?e.contains(t):e&&e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):n(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var f=n(1),d=r(f),h=!("undefined"==typeof window||!window.document||!window.document.createElement);t["default"]={canUseDom:h,contains:p,ownerWindow:i,ownerDocument:o,getComputedStyles:s,getOffset:u,getPosition:l,activeElement:a,offsetParent:c},e.exports=t["default"]},function(e,t,n){"use strict";var r=n(81),o=r({bubbled:null,captured:null}),i=r({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),a={topLevelTypes:i,PropagationPhases:o};e.exports=a},function(e,t,n){"use strict";function r(e,t){var n=w.hasOwnProperty(t)?w[t]:null;O.hasOwnProperty(t)&&y(n===C.OVERRIDE_BASE),e.hasOwnProperty(t)&&y(n===C.DEFINE_MANY||n===C.DEFINE_MANY_MERGED)}function o(e,t){if(t){y("function"!=typeof t),y(!f.isValidElement(t));var n=e.prototype;t.hasOwnProperty(E)&&S.mixins(e,t.mixins);for(var o in t)if(t.hasOwnProperty(o)&&o!==E){var i=t[o];if(r(n,o),S.hasOwnProperty(o))S[o](e,i);else{var a=w.hasOwnProperty(o),l=n.hasOwnProperty(o),c=i&&i.__reactDontBind,p="function"==typeof i,d=p&&!a&&!l&&!c;if(d)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[o]=i,n[o]=i;else if(l){var h=w[o];y(a&&(h===C.DEFINE_MANY_MERGED||h===C.DEFINE_MANY)),h===C.DEFINE_MANY_MERGED?n[o]=s(n[o],i):h===C.DEFINE_MANY&&(n[o]=u(n[o],i))}else n[o]=i}}}}function i(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in S;y(!o);var i=n in e;y(!i),e[n]=r}}}function a(e,t){y(e&&t&&"object"==typeof e&&"object"==typeof t);for(var n in t)t.hasOwnProperty(n)&&(y(void 0===e[n]),e[n]=t[n]);return e}function s(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return a(o,n),a(o,r),o}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e,t){var n=t.bind(e);return n}function c(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=l(e,d.guard(n,e.constructor.displayName+"."+t))}}var p=n(239),f=(n(40),n(9)),d=n(537),h=n(65),m=n(155),v=(n(156),n(106),n(157)),g=n(7),y=n(4),b=n(81),_=n(34),E=(n(8),_({mixins:null})),C=b({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),T=[],w={mixins:C.DEFINE_MANY,statics:C.DEFINE_MANY,propTypes:C.DEFINE_MANY,contextTypes:C.DEFINE_MANY,childContextTypes:C.DEFINE_MANY,getDefaultProps:C.DEFINE_MANY_MERGED,getInitialState:C.DEFINE_MANY_MERGED,getChildContext:C.DEFINE_MANY_MERGED,render:C.DEFINE_ONCE,componentWillMount:C.DEFINE_MANY,componentDidMount:C.DEFINE_MANY,componentWillReceiveProps:C.DEFINE_MANY,shouldComponentUpdate:C.DEFINE_ONCE,componentWillUpdate:C.DEFINE_MANY,componentDidUpdate:C.DEFINE_MANY,componentWillUnmount:C.DEFINE_MANY,updateComponent:C.OVERRIDE_BASE},S={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)o(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=g({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=g({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=s(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=g({},e.propTypes,t)},statics:function(e,t){i(e,t)}},O={replaceState:function(e,t){v.enqueueReplaceState(this,e),t&&v.enqueueCallback(this,t)},isMounted:function(){var e=h.get(this);return e&&e!==m.currentlyMountingInstance},setProps:function(e,t){v.enqueueSetProps(this,e),t&&v.enqueueCallback(this,t)},replaceProps:function(e,t){v.enqueueReplaceProps(this,e),t&&v.enqueueCallback(this,t)}},x=function(){};g(x.prototype,p.prototype,O);var P={createClass:function(e){var t=function(e,t){this.__reactAutoBindMap&&c(this),this.props=e,this.context=t,this.state=null;var n=this.getInitialState?this.getInitialState():null;y("object"==typeof n&&!Array.isArray(n)),this.state=n};t.prototype=new x,t.prototype.constructor=t,T.forEach(o.bind(null,t)),o(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),y(t.prototype.render);for(var n in w)t.prototype[n]||(t.prototype[n]=null);return t.type=t,t},injection:{injectMixin:function(e){T.push(e)}}};e.exports=P},function(e,t,n){"use strict";function r(){c.updateRegFormSettings(s.getCurrent(),u.getRegFormSettingsForCurrentRole())}function o(e,t,n){c.updateValues(e,t,n)}var i=n(12),a=n(30),s=n(42),u=n(67),l=a.ActionTypes;e.exports={clickRole:function(e){i.dispatch({type:l.CLICK_ROLE,role:e})},clickItem:function(e){i.dispatch({type:l.CLICK_ITEM,item:e}),c.getRegFormSettings(s.getCurrent())},updateCaseNotesTitle:function(e,t){o(e,"case_notes_name",t),i.dispatch({type:l.UPDATE_CASE_NOTES_TITLE,role:e,text:t})},updatePostSessionFeedbackTitle:function(e,t){o(e,"post_session_feedback_name",t),i.dispatch({type:l.UPDATE_POST_SESSION_FEEDBACK_TITLE,role:e,text:t})},updatePostSessionFeedbackQuestion:function(e,t){o(e,"post_session_feedback_question",t),i.dispatch({type:l.UPDATE_POST_SESSION_FEEDBACK_QUESTION,role:e,text:t})},toggleImpactFootprintItem:function(e,t){t.on?i.dispatch({type:l.DISABLE_IMPACT_FOOTPRINT_ITEM,role:e,itemName:t.name}):i.dispatch({type:l.ENABLE_IMPACT_FOOTPRINT_ITEM,role:e,itemName:t.name})},toggleImpactFootprintItemContent:function(e,t){t.showContent?i.dispatch({type:l.DISABLE_IMPACT_FOOTPRINT_ITEM_CONTENT,role:e,itemName:t.name}):i.dispatch({type:l.ENABLE_IMPACT_FOOTPRINT_ITEM_CONTENT,role:e,itemName:t.name})},addRegField:function(e,t){i.dispatch({type:l.ENABLE_REG_FIELD,role:e,fieldName:t}),r()},removeRegField:function(e,t){i.dispatch({type:l.DISABLE_REG_FIELD,role:e,fieldName:t}),r()},addTextField:function(e,t){i.dispatch({type:l.ADD_TEXT_FIELD,role:e,questionText:t}),r()},addChoiceField:function(e,t,n){i.dispatch({type:l.ADD_CHOICE_FIELD,role:e,questionText:t,choices:n}),r()},addMultipleChoiceField:function(e,t,n){i.dispatch({type:l.ADD_CHOICE_FIELD,role:e,questionText:t,choices:n,multiple:!0}),r()},updateChoiceField:function(e,t,n,o){i.dispatch({type:l.UPDATE_CHOICE_FIELD,role:e,currentFieldName:t,questionText:n,choices:o}),r()},receiveRegFormSettings:function(e,t){i.dispatch({type:l.RECEIVE_REG_FORM_SETTINGS,role:e,settings:t})},receiveChatrooms:function(e){i.dispatch({type:l.RECEIVE_CHATROOMS,rooms:e})},receiveSlots:function(e){i.dispatch({type:l.RECEIVE_SLOTS,slots:e})},receiveCreateSlotSuccess:function(e,t){i.dispatch({type:l.RECEIVE_CREATE_SLOT_SUCCESS,slot:e,slotID:t})},createChatroom:function(e){p.createRoom(e),i.dispatch({type:l.CREATE_ROOM2,room:e})},updateChatroom:function(e,t){p.updateRoom(e,t).done(function(){i.dispatch({type:l.UPDATE_ROOM_SUCESS,room:e,update:t})}).fail(function(){i.dispatch({type:l.UPDATE_ROOM_FAILURE,room:e})}),i.dispatch({type:l.UPDATE_ROOM,room:e,update:t})},deleteChatroom:function(e){p.deleteRoom(e).done(function(){i.dispatch({type:l.DELETE_ROOM_SUCCESS,room:e})}).fail(function(){i.dispatch({type:l.DELETE_ROOM_FAILURE,room:e})}),i.dispatch({type:l.DELETE_ROOM,room:e})},revertChatroom:function(e){i.dispatch({type:l.UPDATE_ROOM_REVERT,room:e})},createSlot:function(e){p.createSlot(e),i.dispatch({type:l.CREATE_SLOT,slot:e})},updateSlot:function(e){p.updateSlot(e),i.dispatch({type:l.UPDATE_SLOT,slot:e})},deleteSlot:function(e){p.deleteSlot(e),i.dispatch({type:l.DELETE_SLOT,slotID:e})},receiveRoles:function(e){e.forEach(function(e){return c.getValues(e.name)}),e.forEach(function(e){return c.getRegFormSettings(e.name)}),i.dispatch({type:l.RECEIVE_ROLES,roles:e.map(function(e){return e.name})})},receiveValues:function(e,t){i.dispatch({type:l.RECEIVE_VALUES,role:e,values:t})}};var c=n(272),p=n(112)},function(e,t,n){"use strict";e.exports=n(1)},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.filter(function(e){return null!=e}).reduce(function(e,t){if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var n=arguments.length,r=Array(n),o=0;n>o;o++)r[o]=arguments[o];e.apply(this,r),t.apply(this,r)}},null)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(493),i=r(o);t.Router=i["default"];var a=n(489),s=r(a);t.Link=s["default"];var u=n(491),l=r(u);t.Redirect=l["default"];var c=n(492),p=r(c);t.Route=p["default"];var f=n(490),d=r(f);t.Navigation=d["default"];var h=n(499),m=r(h);t.TransitionHook=m["default"];var v=n(497),g=r(v);t.State=g["default"];var y=n(75);t.createRoutesFromReactChildren=y.createRoutesFromReactChildren;var b=n(101),_=r(b);t.PropTypes=_["default"];var E=r(o);t["default"]=E["default"]},function(e,t,n){"use strict";function r(){v(O.ReactReconcileTransaction&&_)}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=O.ReactReconcileTransaction.getPooled()}function i(e,t,n,o,i){r(),_.batchedUpdates(e,t,n,o,i)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;v(t===g.length),g.sort(a);for(var n=0;t>n;n++){var r=g[n],o=r._pendingCallbacks;if(r._pendingCallbacks=null,d.performUpdateIfNecessary(r,e.reconcileTransaction),o)for(var i=0;i<o.length;i++)e.callbackQueue.enqueue(o[i],r.getPublicInstance())}}function u(e){return r(),_.isBatchingUpdates?void g.push(e):void _.batchedUpdates(u,e)}function l(e,t){v(_.isBatchingUpdates),y.enqueue(e,t),b=!0}var c=n(146),p=n(38),f=(n(40),n(50)),d=n(66),h=n(108),m=n(7),v=n(4),g=(n(8),[]),y=c.getPooled(),b=!1,_=null,E={initialize:function(){this.dirtyComponentsLength=g.length},close:function(){this.dirtyComponentsLength!==g.length?(g.splice(0,this.dirtyComponentsLength),w()):g.length=0}},C={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},T=[E,C];m(o.prototype,h.Mixin,{getTransactionWrappers:function(){return T},destructor:function(){this.dirtyComponentsLength=null,c.release(this.callbackQueue),this.callbackQueue=null,O.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return h.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),p.addPoolingTo(o);var w=function(){for(;g.length||b;){if(g.length){var e=o.getPooled();e.perform(s,null,e),o.release(e)}if(b){b=!1;var t=y;y=c.getPooled(),t.notifyAll(),c.release(t)}}};w=f.measure("ReactUpdates","flushBatchedUpdates",w);var S={injectReconcileTransaction:function(e){v(e),O.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){v(e),v("function"==typeof e.batchedUpdates),v("boolean"==typeof e.isBatchingUpdates),_=e}},O={ReactReconcileTransaction:null,batchedUpdates:i,enqueueUpdate:u,flushBatchedUpdates:w,injection:S,asap:l};e.exports=O},function(e,t,n){"use strict";var r=n(130);e.exports={ActionTypes:r({CLICK_ROLE:null,CLICK_ITEM:null,UPDATE_CASE_NOTES_TITLE:null,UPDATE_POST_SESSION_FEEDBACK_TITLE:null,UPDATE_POST_SESSION_FEEDBACK_QUESTION:null,DISABLE_IMPACT_FOOTPRINT_ITEM:null,ENABLE_IMPACT_FOOTPRINT_ITEM:null,DISABLE_IMPACT_FOOTPRINT_ITEM_CONTENT:null,ENABLE_IMPACT_FOOTPRINT_ITEM_CONTENT:null,ENABLE_REG_FIELD:null,DISABLE_REG_FIELD:null,ADD_TEXT_FIELD:null,ADD_CHOICE_FIELD:null,UPDATE_CHOICE_FIELD:null,RECEIVE_REG_FORM_SETTINGS:null,RECEIVE_CHATROOMS:null,RECEIVE_SLOTS:null,RECEIVE_CREATE_SLOT_SUCCESS:null,CREATE_ROOM2:null,UPDATE_ROOM:null,UPDATE_ROOM_SUCCESS:null,UPDATE_ROOM_FAILURE:null,UPDATE_ROOM_REVERT:null,CREATE_SLOT:null,UPDATE_SLOT:null,DELETE_SLOT:null,DELETE_ROOM:null,DELETE_ROOM_SUCCESS:null,DELETE_ROOM_FAILURE:null,CHANGE_ROOM:null,RECEIVE_ROLES:null,RECEIVE_VALUES:null}),days:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){document.getElementById("new-message-beep").play();var t=new Notification("New message from "+e.authorName,{icon:"/static/images/kvoti-web-logo.png",body:e.text.slice(0,140)});t.onclick=function(){window.focus()}}function i(e){return 0===e.indexOf("session:")}var a,s=n(617),u=r(s),l=n(12),c=n(11),p=n(45),f=n(18).EventEmitter,d=n(13),h=c.ActionTypes,m="change",v="message",g="session",y=null,b=null,_=null,E={},C=v,T=[],w=d({},f.prototype,{message:v,session:g,init:function(e){e.forEach(function(e){var t=e.threadID,n=E[t];n&&n.lastMessage&&n.lastMessage.date>new Date(e.timestamp)||(n?n.lastMessage=p.convertRawMessage(e,y):E[t]={id:t,name:e.threadName,lastMessage:p.convertRawMessage(e,y)})},this),y&&E[y]&&E[y].lastMessage&&(E[y].lastMessage.isRead=!0)},emitChange:function(){this.emit(m)},addChangeListener:function(e){this.on(m,e)},removeChangeListener:function(e){this.removeListener(m,e)},get:function(e){return E[e]},getAll:function(){var e={};for(var t in E)(C===v&&!i(t)||C===g&&i(t))&&(e[t]=E[t]);return e},getAllChrono:function(){var e=[];for(var t in this.getAll()){var n=E[t];e.push(n)}return e.sort(function(e,t){return e.lastMessage?t.lastMessage?e.lastMessage.date<t.lastMessage.date?1:e.lastMessage.date>t.lastMessage.date?-1:0:1:-1}),e},getCurrentID:function(){return y},getCurrentChatID:function(){return b},getCurrentSessionID:function(){return _},getCurrent:function(){return this.get(this.getCurrentID())},getRooms:function(){return T},getCurrentRoomJID:function(){return a},getThreadType:function(){return C}});w.dispatchToken=l.register(function(e){switch(e.type){case h.RECEIVE_RAW_MESSAGES:w.init(e.rawMessages),w.emitChange();break;case h.RECEIVE_RAW_PRIVATE_MESSAGE:w.init([e.rawMessage]),(!E[e.rawMessage.threadID].lastMessage.isRead||!e.isArchived&&u["default"].hidden())&&o(E[e.rawMessage.threadID].lastMessage),w.emitChange();break;case h.RECEIVE_ROOM_LIST:T=e.rooms,a||(a=T.find(function(e){return e.startsWith("main")}),y=Strophe.getNodeFromJid(a),E[y]={id:y,name:y}),w.emitChange();break;case h.CREATE_ROOM:var t=e.roomJID;T.push(t),a=t,y=Strophe.getNodeFromJid(t),E[y]={id:y,name:y},w.emitChange();break;case h.JOIN_ROOM:var t=e.roomJID;E[Strophe.getNodeFromJid(t)].isJoined=!0,w.emitChange();break;case h.LEAVE_ROOM:var t=e.roomJID;E[Strophe.getNodeFromJid(t)].isJoined=!1,w.emitChange();break;case h.CHANGE_CHATROOM:a=e.roomJID,y=e.roomID,E[y]||(E[y]={id:y,name:y}),w.emitChange();break;case h.CHANGE_PRIVATE_CHAT:C===g&&e.threadType===v?_=y:C===v&&e.threadType===g&&(b=y),y=e.threadID,C=e.threadType,C===g?_=y:b=y,E[y]||(console.log("ID",y),E[y]={id:y,name:p.getMessageThreadName(y)});var n=E[y].lastMessage;n&&(n.isRead=!0),w.emitChange();break;case h.CHANGE_PRIVATE_CHAT_TYPE:C===g&&e.threadType===v?_=y:C===v&&e.threadType===g&&(b=y),y=null,C=e.threadType,C===g?_=y:b=y,w.emitChange();break;case h.END_THREAD:E[e.threadID].isEnded=!0,E[e.threadID].rating=null,w.emitChange();break;case h.RECEIVE_END_THREAD:E[e.threadID].isEnded=!0,E[e.threadID].rating=e.rating,w.emitChange();break;case h.RATE_THREAD:E[e.threadID].rating=e.rating,w.emitChange();break;case h.RECEIVE_SESSION_RATING:E[e.threadID].rating=e.rating,w.emitChange()}}),e.exports=w},function(e,t,n){function r(e){return"Symbol(".concat(void 0===e?"":e,")_",(++o+Math.random()).toString(36))}var o=0;r.safe=n(2).g.Symbol||r,e.exports=r},function(e,t){function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){"use strict";function r(e,t){o.hide(e,l,t),c in[]&&o.hide(e,c,t)}var o=n(2),i=n(20),a=i.classof,s=n(17),u=s.obj,l=n(21)("iterator"),c="@@iterator",p=n(124)("iterators"),f={};r(f,o.that),e.exports={BUGGY:"keys"in[]&&!("next"in[].keys()),Iterators:p,step:function(e,t){return{value:t,done:!!e}},is:function(e){var t=Object(e),n=o.g.Symbol;return(n&&n.iterator||c)in t||l in t||o.has(p,a(t))},get:function(e){var t,n=o.g.Symbol;return void 0!=e&&(t=e[n&&n.iterator||c]||e[l]||p[a(e)]),
s(o.isFunction(t),e," is not iterable!"),u(t.call(e))},set:r,create:function(e,t,n,r){e.prototype=o.create(r||f,{next:o.desc(1,n)}),i.set(e,t+" Iterator")}}},function(e,t,n){function r(e,t,n,r){if(o.isFunction(n)){var s=e[t];o.hide(n,a,s?String(s):i.replace(/hasOwnProperty/,String(t))),"name"in n||(n.name=t)}e===o.g?e[t]=n:(r||delete e[t],o.hide(e,t,n))}var o=n(2),i=String({}.hasOwnProperty),a=n(32).safe("src"),s=Function.toString;r(Function.prototype,"toString",function(){return o.has(this,a)?this[a]:s.call(this)}),o.core.inspectSource=function(e){return s.call(e)},e.exports=r},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw u.framesToPop=1,u}};e.exports=r},function(e,t,n){"use strict";var r=n(4),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},u=function(e){var t=this;r(e instanceof t),e.destructor&&e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=10,c=o,p=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||c,n.poolSize||(n.poolSize=l),n.release=u,n},f={addPoolingTo:p,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fiveArgumentPooler:s};e.exports=f},function(e,t,n){"use strict";var r=n(252),o={getDOMNode:function(){return r(this)}};e.exports=o},function(e,t){"use strict";var n={current:null};e.exports=n},function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){var t=D(e);return t&&W.getID(t)}function i(e){var t=a(e);if(t)if(j.hasOwnProperty(t)){var n=j[t];n!==e&&(M(!c(n,t)),j[t]=e)}else j[t]=e;return t}function a(e){return e&&e.getAttribute&&e.getAttribute(A)||""}function s(e,t){var n=a(e);n!==t&&delete j[n],e.setAttribute(A,t),j[t]=e}function u(e){return j.hasOwnProperty(e)&&c(j[e],e)||(j[e]=W.findReactNodeByID(e)),j[e]}function l(e){var t=E.get(e)._rootNodeID;return b.isNullComponentID(t)?null:(j.hasOwnProperty(t)&&c(j[t],t)||(j[t]=W.findReactNodeByID(t)),j[t])}function c(e,t){if(e){M(a(e)===t);var n=W.findReactContainerForID(t);if(n&&P(n,e))return!0}return!1}function p(e){delete j[e]}function f(e){var t=j[e];return t&&c(t,e)?void(V=t):!1}function d(e){V=null,_.traverseAncestors(e,f);var t=V;return V=null,t}function h(e,t,n,r,o){var i=w.mountComponent(e,t,r,x);e._isTopLevel=!0,W._mountImageIntoNode(i,n,o)}function m(e,t,n,r){var o=O.ReactReconcileTransaction.getPooled();o.perform(h,null,e,t,n,o,r),O.ReactReconcileTransaction.release(o)}var v=n(60),g=n(62),y=(n(40),n(9)),b=(n(79),n(154)),_=n(64),E=n(65),C=n(244),T=n(50),w=n(66),S=n(157),O=n(29),x=n(109),P=n(251),D=n(575),N=n(165),M=n(4),k=n(167),R=n(168),I=(n(8),_.SEPARATOR),A=v.ID_ATTRIBUTE_NAME,j={},L=1,F=9,H={},U={},B=[],V=null,W={_instancesByReactRootID:H,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return W.scrollMonitor(n,function(){S.enqueueElementInternal(e,t),r&&S.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){M(t&&(t.nodeType===L||t.nodeType===F)),g.ensureScrollValueMonitoring();var n=W.registerContainer(t);return H[n]=e,n},_renderNewRootComponent:function(e,t,n){var r=N(e,null),o=W._registerComponent(r,t);return O.batchedUpdates(m,r,o,t,n),r},render:function(e,t,n){M(y.isValidElement(e));var r=H[o(t)];if(r){var i=r._currentElement;if(R(i,e))return W._updateRootComponent(r,e,t,n).getPublicInstance();W.unmountComponentAtNode(t)}var a=D(t),s=a&&W.isRenderedByReact(a),u=s&&!r,l=W._renderNewRootComponent(e,t,u).getPublicInstance();return n&&n.call(l),l},constructAndRenderComponent:function(e,t,n){var r=y.createElement(e,t);return W.render(r,n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return M(r),W.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=o(e);return t&&(t=_.getReactRootIDFromNodeID(t)),t||(t=_.createReactRootID()),U[t]=e,t},unmountComponentAtNode:function(e){M(e&&(e.nodeType===L||e.nodeType===F));var t=o(e),n=H[t];return n?(W.unmountComponentFromNode(n,e),delete H[t],delete U[t],!0):!1},unmountComponentFromNode:function(e,t){for(w.unmountComponent(e),t.nodeType===F&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=_.getReactRootIDFromNodeID(e),n=U[t];return n},findReactNodeByID:function(e){var t=W.findReactContainerForID(e);return W.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=W.getID(e);return t?t.charAt(0)===I:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(W.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=B,r=0,o=d(t)||e;for(n[0]=o.firstChild,n.length=1;r<n.length;){for(var i,a=n[r++];a;){var s=W.getID(a);s?t===s?i=a:_.isAncestorIDOf(s,t)&&(n.length=r=0,n.push(a.firstChild)):n.push(a.firstChild),a=a.nextSibling}if(i)return n.length=0,i}n.length=0,M(!1)},_mountImageIntoNode:function(e,t,n){if(M(t&&(t.nodeType===L||t.nodeType===F)),n){var o=D(t);if(C.canReuseMarkup(e,o))return;var i=o.getAttribute(C.CHECKSUM_ATTR_NAME);o.removeAttribute(C.CHECKSUM_ATTR_NAME);var a=o.outerHTML;o.setAttribute(C.CHECKSUM_ATTR_NAME,i);var s=r(e,a);" (client) "+e.substring(s-20,s+20)+"\n (server) "+a.substring(s-20,s+20),M(t.nodeType!==F)}M(t.nodeType!==F),k(t,e)},getReactRootID:o,getID:i,setID:s,getNode:u,getNodeFromInstance:l,purgeID:p};T.measureMethods(W,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=W},function(e,t,n){"use strict";var r,o=n(12),i=n(30),a=n(18).EventEmitter,s=n(13),u=i.ActionTypes,l="change",c=[],p=s({},a.prototype,{emitChange:function(){this.emit(l)},addChangeListener:function(e){this.on(l,e)},removeChangeListener:function(e){this.removeListener(l,e)},getAll:function(){return c},getCurrent:function(){return r}});p.dispatchToken=o.register(function(e){switch(e.type){case u.RECEIVE_ROLES:r=e.roles[0],c=e.roles,p.emitChange();break;case u.CLICK_ROLE:r=e.role,p.emitChange()}}),e.exports=p},function(e,t,n){"use strict";var r=n(30),o=0;e.exports={slotsToDayIntervals:function(e){var t=function(){var e=[],t=!0,n=!1,o=void 0;try{for(var i,a=r.days[Symbol.iterator]();!(t=(i=a.next()).done);t=!0)i.value,e.push([])}catch(s){n=!0,o=s}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw o}}return e}();return e.forEach(function(e,n){var r,o=e.day,i=t[o],a=t[(o+1)%7];r=e.end<e.start?24:e.end,i.push({start:e.start,end:r,isPending:e.isPending,index:n}),e.end<e.start&&a.push({start:0,end:e.end,isPending:e.isPending,index:n})}),t},displayTime:function(e){var t;return t=0===e?"12am":12===e?"12pm":12>e?e+"am":e-12+"pm"},uniqueID:function(){return"id"+o++},ISODateStringToDate:function(e){if(!e)return e;var t=Date.parse(e),n=new Date;return n.setTime(t),n},addHours:function(e,t){var n=e.getTime();return n+=3600*t*1e3,new Date(n)}}},function(e,t,n){var r=n(17).fn;e.exports=function(e,t,n){if(r(e),~n&&void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){"use strict";e.exports={convertRawMessage:function(e,t){return{id:e.id,threadID:e.threadID,authorName:e.authorName,date:new Date(e.timestamp),text:e.text,isRead:e.isRead||e.threadID===t}},getCreatedMessageData:function(e,t){var n=Date.now();return{id:"m_"+n,threadID:t,authorName:Strophe.getNodeFromJid(chatConf.me),date:new Date(n),text:e,isRead:!0}},getMessageOther:function(e){var t=Strophe.getNodeFromJid(chatConf.me),n=e.split(":");0===e.indexOf("session:")&&(n=n.slice(1));var r=n[0]===t?n[1]:n[0];return r},getMessageThreadName:function(e){var t=e.split(":"),n="";return("session"===t[0]&&4===t.length||"session"!==t[0]&&3===t.length)&&(n=t[t.length-1]),n},getPrivateChatThreadID:function(e,t){var n=[e,t];n.sort();var r=n.join(":");return r}}},function(e,t){"use strict";function n(e){return i[e]?i[e]:(i[e]=e.replace(o,"_"),i[e])}function r(e){var t;return t="object"==typeof e?Object.keys(e).filter(function(t){return e[t]}):Array.prototype.slice.call(arguments),t.map(n).join(" ")}var o=/\//g,i={};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(14),f=r(p),d=a["default"].createClass({displayName:"Button",mixins:[c["default"]],propTypes:{active:a["default"].PropTypes.bool,disabled:a["default"].PropTypes.bool,block:a["default"].PropTypes.bool,navItem:a["default"].PropTypes.bool,navDropdown:a["default"].PropTypes.bool,componentClass:f["default"].elementType,href:a["default"].PropTypes.string,target:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"button",bsStyle:"default",type:"button"}},render:function(){var e=this.props.navDropdown?{}:this.getBsClassSet(),t=void 0;return e=o({active:this.props.active,"btn-block":this.props.block},e),this.props.navItem?this.renderNavItem(e):(t=this.props.href||this.props.target||this.props.navDropdown?"renderAnchor":"renderButton",this[t](e))},renderAnchor:function(e){var t=this.props.componentClass||"a",n=this.props.href||"#";return e.disabled=this.props.disabled,a["default"].createElement(t,o({},this.props,{href:n,className:u["default"](this.props.className,e),role:"button"}),this.props.children)},renderButton:function(e){var t=this.props.componentClass||"button";return a["default"].createElement(t,o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children)},renderNavItem:function(e){var t={active:this.props.active};return a["default"].createElement("li",{className:u["default"](t)},this.renderAnchor(e))}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(96),f=r(p),d=a["default"].createClass({displayName:"Panel",mixins:[c["default"],f["default"]],propTypes:{collapsible:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,header:a["default"].PropTypes.node,id:a["default"].PropTypes.string,footer:a["default"].PropTypes.node,eventKey:a["default"].PropTypes.any},getDefaultProps:function(){return{bsClass:"panel",bsStyle:"default"}},handleSelect:function(e){e.selected=!0,this.props.onSelect?this.props.onSelect(e,this.props.eventKey):e.preventDefault(),e.selected&&this.handleToggle()},handleToggle:function(){this.setState({expanded:!this.state.expanded})},getCollapsibleDimensionValue:function(){return a["default"].findDOMNode(this.refs.panel).scrollHeight},getCollapsibleDOMNode:function(){return this.isMounted()&&this.refs&&this.refs.panel?a["default"].findDOMNode(this.refs.panel):null},render:function(){return a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,this.getBsClassSet()),id:this.props.collapsible?null:this.props.id,onSelect:null}),this.renderHeading(),this.props.collapsible?this.renderCollapsibleBody():this.renderBody(),this.renderFooter())},renderCollapsibleBody:function(){var e=this.prefixClass("collapse");return a["default"].createElement("div",{className:u["default"](this.getCollapsibleClassSet(e)),id:this.props.id,ref:"panel","aria-expanded":this.isExpanded()?"true":"false"},this.renderBody())},renderBody:function(){function e(){return{key:u.length}}function t(t){u.push(i.cloneElement(t,e()))}function n(t){u.push(a["default"].createElement("div",o({className:c},e()),t))}function r(){0!==l.length&&(n(l),l=[])}var s=this.props.children,u=[],l=[],c=this.prefixClass("body");return Array.isArray(s)&&0!==s.length?(s.forEach(function(e){this.shouldRenderFill(e)?(r(),t(e)):l.push(e)}.bind(this)),r()):this.shouldRenderFill(s)?t(s):n(s),u},shouldRenderFill:function(e){return a["default"].isValidElement(e)&&null!=e.props.fill},renderHeading:function(){var e=this.props.header;if(!e)return null;if(!a["default"].isValidElement(e)||Array.isArray(e))e=this.props.collapsible?this.renderCollapsibleTitle(e):e;else{var t=u["default"](this.prefixClass("title"),e.props.className);e=this.props.collapsible?i.cloneElement(e,{className:t,children:this.renderAnchor(e.props.children)}):i.cloneElement(e,{className:t})}return a["default"].createElement("div",{className:this.prefixClass("heading")},e)},renderAnchor:function(e){return a["default"].createElement("a",{href:"#"+(this.props.id||""),"aria-controls":this.props.collapsible?this.props.id:null,className:this.isExpanded()?null:"collapsed","aria-expanded":this.isExpanded()?"true":"false",onClick:this.handleSelect},e)},renderCollapsibleTitle:function(e){return a["default"].createElement("h4",{className:this.prefixClass("title")},this.renderAnchor(e))},renderFooter:function(){return this.props.footer?a["default"].createElement("div",{className:this.prefixClass("footer")},this.props.footer):null}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw u.framesToPop=1,u}};e.exports=r},function(e,t,n){"use strict";function r(e,t,n){return n}var o={enableMeasure:!1,storedMeasure:r,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){o.storedMeasure=e}}};e.exports=o},function(e,t,n){"use strict";function r(e,t,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var r=this.constructor.Interface;for(var o in r)if(r.hasOwnProperty(o)){var i=r[o];i?this[o]=i(n):this[o]=n[o]}var s=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;s?this.isDefaultPrevented=a.thatReturnsTrue:this.isDefaultPrevented=a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse}var o=n(38),i=n(7),a=n(33),s=n(164),u={type:null,target:s,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=a.thatReturnsTrue},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=a.thatReturnsTrue},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=u,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);i(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=i({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.threeArgumentPooler)},o.addPoolingTo(r,o.threeArgumentPooler),e.exports=r},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(53),a=o.ActionTypes;e.exports={createThread:function(e){r.dispatch({type:a.CREATE_THREAD,threadID:e})},clickRoom:function(e){r.dispatch({type:a.CLICK_ROOM,roomJID:e}),i.joinChatroom(e)},createRoom:function(e){var t=e+"@muc."+Strophe.getDomainFromJid(chatConf.me);r.dispatch({type:a.CREATE_ROOM,roomJID:t}),i.joinChatroom(t)},toggleChatType:function(){r.dispatch({type:a.TOGGLE_CHAT_TYPE})},endThread:function(e){i.endThread(e),r.dispatch({type:a.END_THREAD,threadID:e})},rateThread:function(e,t){i.rateThread(e,t),r.dispatch({type:a.RATE_THREAD,threadID:e,rating:t})}}},function(e,t,n){"use strict";function r(e){return function(t){S=t,t==Strophe.Status.CONNECTED?(o(),l(),T.mam.init(T),T.addHandler(B,Strophe.NS.MAM,"message",null),p(),T.vcard.init(T),v(Strophe.getNodeFromJid(P)),T.chatstates.init(T),chatConf.hasChatroom&&(T.muc.init(T),c()),A.length&&A.forEach(function(e){return f(e)}),e(T),M.connect(T)):t==Strophe.Status.DISCONNECTED&&M.disconnect()}}function o(){T.send($pres().tree())}function i(e){return function(t){console.log("got chatrooms");var n=k.parse.roomList(t);e(n),M.receiveChatrooms(n)}}function a(e){chatConf.hasChatroom&&Promise.all([H,U]).then(function(t){var n=N(t,2),r=n[0],o=n[1];return-1===o.indexOf(e)?void console.log("No such room",o):(M.joinChatroom(e),void r.muc.join(e,D))})}function s(e){var t=k.parse.groupMessage(e);return t.threadID=t.to,t.authorName=t.from,t.from&&M.receivePrivateMessage(t,!0),!0}function u(e){var t=k.parse.groupPresence(e);return t.added?(M.receiveOnline(t.user,t.room),v(t.user)):t.removed&&(M.receiveOffline(t.user,t.room),t.destroyed&&M.leaveChatroom(t.room)),!0}function l(){T.addHandler(g,null,"message","chat",null),T.addHandler(y,null,"presence",null,null)}function c(){T.addHandler(s,null,"message","groupchat",null),T.addHandler(u,null,"presence",null,null)}function p(){T.roster.init(T),T.roster.registerRequestCallback(d),T.roster.registerCallback(h),T.roster.get()}function f(e){S===Strophe.Status.CONNECTED?T.roster.subscribe(E(e)):A.push(e)}function d(e){return T.roster.authorize(e),!0}function h(e,t){return e.forEach(function(e,t){var n=Strophe.getNodeFromJid(e.jid);"none"!==e.subscription&&(m(e.jid,""),v(n))}),!0}function m(e,t){(-1===j.indexOf(e)||t)&&(j.push(e),T.mam.query(Strophe.getBareJidFromJid(P),{"with":e,before:t,max:20,onMessage:function(){},onComplete:function(t){var n=k.parse.RSM(t);n&&m(e,n)}}))}function v(e){var t=E(e);-1===L.indexOf(e)&&(L.push(e),T.vcard.get(function(t){var n=k.parse.vCard(t);n.user=e,M.receiveUserProfile(n)},t,function(){C("sunshine"),M.receiveUserProfile({role:chatConf.role,avatar:"sunshine"})}))}function g(e){var t=k.parse.privateMessage(e);return t.composing.length?M.receiveStartTyping(t.from,t.threadID):(t.active.length&&M.receiveStopTyping(t.from,t.threadID),t.ended.length&&M.receiveEndThread(t.threadID,null),t.text&&M.receivePrivateMessage(t)),!0}function y(e){var t=k.parse.presence(e);return M.receiveChatStatus(t),!0}function b(e,t){$.get(I.getSessionRating(e)).done(t)}function _(){T.rawInput=function(e){console.log("RECV: ",e)},T.rawOutput=function(e){console.log("SENT: ",e)}}function E(e){return e+"@"+O}function C(e){var t=Strophe.xmlElement("ROLE");t.appendChild(Strophe.xmlTextNode(chatConf.role));var n=Strophe.xmlElement("PHOTO");n.appendChild(Strophe.xmlTextNode(e));var r=Strophe.xmlElement("XXX");r.appendChild(t),r.appendChild(n),T.vcard.set(function(e){},r)}var T,w,S,O,x,P,D,N=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{!r&&s["return"]&&s["return"]()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),M=n(291),k=n(303),R=n(45),I=n(19),A=[],j=[],L=[],F={},H=new Promise(function(e,t){w=e}),U=new Promise(function(e,t){-1===window.location.href.indexOf("messages")&&-1===window.location.href.indexOf("sessions")&&H.then(function(n){var r="muc."+O;n.muc.listRooms(r,i(e),t)})});U.then(function(e){if(e.length&&-1===window.location.href.indexOf("chatroom")){var t=e.find(function(e){return e.startsWith("main")});console.log("joining",t),a(t)}});var B=function(e){var t=k.parse.archivedPrivateMessage(e);return t&&(t.isRead=!0,M.receivePrivateMessage(t,!0),t.ended.length&&(M.receiveEndThread(t.threadID),b(t.threadID,function(e){return M.receiveSessionRating(t.threadID,e.rating)}))),!0};e.exports={connect:function(e,t,n,o){var i=arguments.length<=4||void 0===arguments[4]?!1:arguments[4];P=t,D=o,O=Strophe.getDomainFromJid(t),x=Strophe.getNodeFromJid(t),T=new Strophe.Connection("ws://"+e+":5280/ws-xmpp"),i&&_(),T.connect(t,n,r(w))},getAllMessages:function(){var e=JSON.parse(localStorage.getItem("messages"));M.receiveAll(e)},createMessage:function(e,t){var n;if(-1===e.threadID.indexOf(":"))n=e.threadID+"@muc."+O,T.muc.groupchat(n,e.text);else{var r=R.getMessageOther(e.threadID),o=k.create.privateMessage(e.text,P,E(r));T.chatstates.addActive(o),o.c("thread").t(e.threadID),delete F[t],T.send(o.tree())}},setStatus:function(e,t){var n=$pres();e&&n.c("show").t(e).up(),t&&n.c("status").t(t),T.send(n.tree())},startTyping:function(e){var t=R.getMessageOther(e);F[e]||(F[e]=!0,T.chatstates.sendComposing(E(t)))},stopTyping:function(e){var t=R.getMessageOther(e);delete F[e],T.chatstates.sendActive(E(t))},changeAvatar:C,joinChatroom:a,addFriend:f,startSession:function(e,t){var n=I.startSession();$.ajax({url:n,type:"POST",data:JSON.stringify({session_id:e,ratings:function(){var e=[],n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;e.push({user:s})}}catch(u){r=!0,o=u}finally{try{!n&&a["return"]&&a["return"]()}finally{if(r)throw o}}return e}()}),contentType:"application/json; charset=utf-8",dataType:"json",error:function(){return console.log("startsession failed")}})},rateThread:function(e,t){var n=I.rateSession(e);$.ajax({url:n,type:"PUT",data:JSON.stringify({rating:t}),contentType:"application/json; charset=utf-8",dataType:"json",error:function(){return console.log("rate session failed")}})},endThread:function(e){var t=R.getMessageOther(e),n=$msg({from:P,to:E(t),type:"chat"});n.c("ended").up(),n.c("thread").t(e).up(),n.c("body").up(),T.send(n.tree())}}},function(e,t){"use strict";function n(e,t){return $.get(e,t)}function r(e,t){return s(e,t,"POST")}function o(e,t){return s(e,t,"PUT")}function i(e,t){return s(e,t,"PATCH")}function a(e){return $.ajax({url:e,type:"DELETE",dataType:"json"})}function s(e,t,n){return $.ajax({url:e,type:n,data:JSON.stringify(t),contentType:"application/json; charset=utf-8",dataType:"json"})}Object.defineProperty(t,"__esModule",{value:!0}),t.get=n,t.post=r,t.put=o,t.patch=i,t.del=a},function(e,t,n){var r=n(21)("unscopables");r in[]||n(2).hide(Array.prototype,r,{}),e.exports=function(e){[][r][e]=!0}},function(e,t,n){"use strict";e.exports=n(240)},function(e,t){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=Math.pow(2,53)-1;e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(e){var t=window.history.state;t&&window.history.replaceState(s(t,e),"")}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(488),l=r(u),c=n(143),p=n(145),f=r(p),d=function(e){function t(n){o(this,t),e.call(this,n),this.handlePopState=this.handlePopState.bind(this),this.isSupported=c.supportsHistory()}return i(t,e),t.prototype._updateLocation=function(e){var t=null;if(this.isSupported){var n=window.history.state;t=this._createState(n),n&&n.key||window.history.replaceState(t,"")}this.location=this.createLocation(c.getWindowPath(),t,e)},t.prototype.setup=function(){null==this.location&&this._updateLocation()},t.prototype.handlePopState=function(e){void 0!==e.state&&(this._updateLocation(f["default"].POP),this._notifyChange())},t.prototype.addChangeListener=function(t){e.prototype.addChangeListener.call(this,t),1===this.changeListeners.length&&(window.addEventListener?window.addEventListener("popstate",this.handlePopState,!1):window.attachEvent("onpopstate",this.handlePopState))},t.prototype.removeChangeListener=function(t){e.prototype.removeChangeListener.call(this,t),0===this.changeListeners.length&&(window.removeEventListener?window.removeEventListener("popstate",this.handlePopState,!1):window.detachEvent("onpopstate",this.handlePopState))},t.prototype.pushState=function(e,t){this.isSupported?(a(this.getScrollPosition()),e=this._createState(e),window.history.pushState(e,"",t),this.location=this.createLocation(t,e,f["default"].PUSH),this._notifyChange()):window.location=t},t.prototype.replaceState=function(e,t){this.isSupported?(e=this._createState(e),window.history.replaceState(e,"",t),this.location=this.createLocation(t,e,f["default"].REPLACE),this._notifyChange()):window.location.replace(t)},t}(l["default"]),h=new d;t.history=h,t["default"]=d},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var o=n(4),i={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=e.Properties||{},n=e.DOMAttributeNames||{},a=e.DOMPropertyNames||{},u=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var l in t){o(!s.isStandardName.hasOwnProperty(l)),s.isStandardName[l]=!0;var c=l.toLowerCase();if(s.getPossibleStandardName[c]=l,n.hasOwnProperty(l)){var p=n[l];s.getPossibleStandardName[p]=l,s.getAttributeName[l]=p}else s.getAttributeName[l]=c;s.getPropertyName[l]=a.hasOwnProperty(l)?a[l]:l,u.hasOwnProperty(l)?s.getMutationMethod[l]=u[l]:s.getMutationMethod[l]=null;var f=t[l];s.mustUseAttribute[l]=r(f,i.MUST_USE_ATTRIBUTE),s.mustUseProperty[l]=r(f,i.MUST_USE_PROPERTY),s.hasSideEffects[l]=r(f,i.HAS_SIDE_EFFECTS),s.hasBooleanValue[l]=r(f,i.HAS_BOOLEAN_VALUE),s.hasNumericValue[l]=r(f,i.HAS_NUMERIC_VALUE),s.hasPositiveNumericValue[l]=r(f,i.HAS_POSITIVE_NUMERIC_VALUE),s.hasOverloadedBooleanValue[l]=r(f,i.HAS_OVERLOADED_BOOLEAN_VALUE),o(!s.mustUseAttribute[l]||!s.mustUseProperty[l]),o(s.mustUseProperty[l]||!s.hasSideEffects[l]),o(!!s.hasBooleanValue[l]+!!s.hasNumericValue[l]+!!s.hasOverloadedBooleanValue[l]<=1)}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){var n=s._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,r=a[e];return r||(a[e]=r={}),t in r||(n=document.createElement(e),r[t]=n[t]),r[t]},injection:i};e.exports=s},function(e,t,n){"use strict";var r=n(147),o=n(238),i=n(239),a=n(24),s=n(152),u=n(40),l=n(9),c=(n(79),n(525)),p=n(242),f=n(536),d=n(64),h=n(41),m=n(50),v=n(246),g=n(66),y=n(547),b=n(7),_=n(252),E=n(260);f.inject();var C=l.createElement,T=l.createFactory,w=l.cloneElement,S=m.measure("React","render",h.render),O={Children:{map:o.map,forEach:o.forEach,count:o.count,only:E},Component:i,DOM:c,PropTypes:v,initializeTouchEvents:function(e){r.useTouchEvents=e},createClass:a.createClass,createElement:C,cloneElement:w,createFactory:T,createMixin:function(e){return e},constructAndRenderComponent:h.constructAndRenderComponent,constructAndRenderComponentByID:h.constructAndRenderComponentByID,findDOMNode:_,render:S,renderToString:y.renderToString,renderToStaticMarkup:y.renderToStaticMarkup,unmountComponentAtNode:h.unmountComponentAtNode,isValidElement:l.isValidElement,withContext:s.withContext,__spread:b};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:u,InstanceHandles:d,Mount:h,Reconciler:g,TextComponent:p}),O.version="0.13.1",e.exports=O},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,m)||(e[m]=d++,p[e[m]]={}),p[e[m]]}var o=n(23),i=n(77),a=n(237),s=n(538),u=n(250),l=n(7),c=n(166),p={},f=!1,d=0,h={topBlur:"blur",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topWheel:"wheel"},m="_reactListenersID"+String(Math.random()).slice(2),v=l({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,i=r(n),s=a.registrationNameDependencies[e],u=o.topLevelTypes,l=0,p=s.length;p>l;l++){var f=s[l];i.hasOwnProperty(f)&&i[f]||(f===u.topWheel?c("wheel")?v.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",n):c("mousewheel")?v.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",n):v.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",n):f===u.topScroll?c("scroll",!0)?v.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",n):v.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",v.ReactEventListener.WINDOW_HANDLE):f===u.topFocus||f===u.topBlur?(c("focus",!0)?(v.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",n),v.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",n)):c("focusin")&&(v.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",n),v.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",n)),i[u.topBlur]=!0,i[u.topFocus]=!0):h.hasOwnProperty(f)&&v.ReactEventListener.trapBubbledEvent(f,h[f],n),i[f]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!f){var e=u.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),f=!0}},eventNameDispatchConfigs:i.eventNameDispatchConfigs,registrationNameModules:i.registrationNameModules,putListener:i.putListener,
getListener:i.getListener,deleteListener:i.deleteListener,deleteAllListeners:i.deleteAllListeners});e.exports=v},function(e,t,n){"use strict";var r=(n(9),n(8),{create:function(e){return e},extract:function(e){return e},extractIfFragment:function(e){return e}});e.exports=r},function(e,t,n){"use strict";function r(e){return d+e.toString(36)}function o(e,t){return e.charAt(t)===d||t===e.length}function i(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function a(e,t){return 0===t.indexOf(e)&&o(t,e.length)}function s(e){return e?e.substr(0,e.lastIndexOf(d)):""}function u(e,t){if(f(i(e)&&i(t)),f(a(e,t)),e===t)return e;var n,r=e.length+h;for(n=r;n<t.length&&!o(t,n);n++);return t.substr(0,n)}function l(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var r=0,a=0;n>=a;a++)if(o(e,a)&&o(t,a))r=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,r);return f(i(s)),s}function c(e,t,n,r,o,i){e=e||"",t=t||"",f(e!==t);var l=a(t,e);f(l||a(e,t));for(var c=0,p=l?s:u,d=e;;d=p(d,t)){var h;if(o&&d===e||i&&d===t||(h=n(d,l,r)),h===!1||d===t)break;f(c++<m)}}var p=n(248),f=n(4),d=".",h=d.length,m=100,v={createReactRootID:function(){return r(p.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===d&&e.length>1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=l(e,t);i!==e&&c(e,i,n,r,!1,!0),i!==t&&c(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},_getFirstCommonAncestorID:l,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:d};e.exports=v},function(e,t){"use strict";var n={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=n},function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=n(546),i=(n(79),{mountComponent:function(e,t,n,o){var i=e.mountComponent(t,n,o);return n.getReactMountReady().enqueue(r,e),i},unmountComponent:function(e){o.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||null==t._owner){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}});e.exports=i},function(e,t,n){"use strict";function r(e,t){for(var n=f[e].impactFootprint,r=0;r<n.length;r+=1)if(n[r].name===t)return n[r]}function o(e,t){for(var n=f[e].regForm,r=0;r<n.length;r+=1)if(n[r].name===t)return n[r]}var i=n(12),a=n(30),s=n(18).EventEmitter,u=n(13),l=n(42),c=a.ActionTypes,p="change",f={},d=u({},s.prototype,{emitChange:function(){this.emit(p)},addChangeListener:function(e){this.on(p,e)},removeChangeListener:function(e){this.removeListener(p,e)},getCaseNotesSettingsForCurrentRole:function(){var e=l.getCurrent();return f[e]||(f[e]={}),f[e].values?{title:f[e].values.case_notes_name}:"Loading ..."},getPostSessionFeedbackSettingsForCurrentRole:function(){var e=l.getCurrent();return f[e]||(f[e]={}),f[e].values?{title:f[e].values.post_session_feedback_name,question:f[e].values.post_session_feedback_question}:{title:"Loading ...",question:"Loading ..."}},getImpactFootprintSettingsForCurrentRole:function(){var e=l.getCurrent();return f[e].impactFootprint},getRegFormSettingsForCurrentRole:function(){var e=l.getCurrent();return f[e]?f[e].regForm:null}});d.dispatchToken=i.register(function(e){switch(e.type){case c.UPDATE_CASE_NOTES_TITLE:f[e.role].values.case_notes_name=e.text,d.emitChange();break;case c.UPDATE_POST_SESSION_FEEDBACK_TITLE:f[e.role].values.post_session_feedback_name=e.text,d.emitChange();break;case c.UPDATE_POST_SESSION_FEEDBACK_QUESTION:f[e.role].values.post_session_feedback_question=e.text,d.emitChange();break;case c.ENABLE_IMPACT_FOOTPRINT_ITEM:var t=r(e.role,e.itemName);t.on=!0,d.emitChange();break;case c.DISABLE_IMPACT_FOOTPRINT_ITEM:var t=r(e.role,e.itemName);t.on=!1,t.showContent=!1,d.emitChange();break;case c.ENABLE_IMPACT_FOOTPRINT_ITEM_CONTENT:var t=r(e.role,e.itemName);t.showContent=!0,d.emitChange();break;case c.DISABLE_IMPACT_FOOTPRINT_ITEM_CONTENT:var t=r(e.role,e.itemName);t.showContent=!1,d.emitChange();break;case c.ENABLE_REG_FIELD:var n=o(e.role,e.fieldName);n.on=!0,d.emitChange();break;case c.DISABLE_REG_FIELD:var n=o(e.role,e.fieldName);n.on=!1,d.emitChange();break;case c.ADD_TEXT_FIELD:f[e.role].regForm.push({name:e.questionText,on:!0}),d.emitChange();break;case c.ADD_CHOICE_FIELD:f[e.role].regForm.push({name:e.questionText,options:e.choices,on:!0,multiple:e.multiple}),d.emitChange();break;case c.UPDATE_CHOICE_FIELD:var n=o(e.role,e.currentFieldName);n.name=e.questionText,n.options=e.choices,d.emitChange();break;case c.RECEIVE_REG_FORM_SETTINGS:f[e.role]||(f[e.role]={}),f[e.role].regForm=e.settings,d.emitChange();break;case c.RECEIVE_VALUES:f[e.role]||(f[e.role]={}),f[e.role].values=e.values,d.emitChange()}}),e.exports=d},function(e,t,n){"use strict";var r=n(1),o=n(610),i=r.createClass({displayName:"TimeAgo",componentDidMount:function(){this.interval=setInterval(this.updateDelta,6e4)},componentWillUnmount:function(){clearInterval(this.interval)},updateDelta:function(){this.setState({})},render:function(){var e=this.props.when;try{e=e.toISOString()}catch(t){if(!t instanceof TypeError)throw t}var n=o(e);return r.createElement("time",{dateTime:e},n)}});e.exports=i},function(e,t,n){var r=n(44),o=n(35).get,i=n(193);e.exports=function(e,t,n,a){for(var s,u=o(e),l=r(n,a,t?2:1);!(s=u.next()).done;)if(i(u,l,s.value,t)===!1)return i.close(u)}},function(e,t,n){(function(t){"use strict";var r=n(387),o=n(208),i=o("transform"),a=o("backfaceVisibility"),s=function(){if(r.hasCSSTransforms()){var e=t.window?t.window.navigator.userAgent:"UNKNOWN",n=/Safari\//.test(e)&&!/Chrome\//.test(e);return!n&&r.hasCSS3DTransforms()?function(e,t,n){e[i]="translate3d("+t+"px,"+n+"px,0)",e[a]="hidden"}:function(e,t,n){e[i]="translate("+t+"px,"+n+"px)"}}return function(e,t,n){e.left=t+"px",e.top=n+"px"}}();e.exports=s}).call(t,function(){return this}())},function(e,t){function n(e){var t=typeof e;return"function"==t||!!e&&"object"==t}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(99),c=r(l),p=n(14),f=r(p),d=a["default"].createClass({displayName:"Col",propTypes:{xs:a["default"].PropTypes.number,sm:a["default"].PropTypes.number,md:a["default"].PropTypes.number,lg:a["default"].PropTypes.number,xsOffset:a["default"].PropTypes.number,smOffset:a["default"].PropTypes.number,mdOffset:a["default"].PropTypes.number,lgOffset:a["default"].PropTypes.number,xsPush:a["default"].PropTypes.number,smPush:a["default"].PropTypes.number,mdPush:a["default"].PropTypes.number,lgPush:a["default"].PropTypes.number,xsPull:a["default"].PropTypes.number,smPull:a["default"].PropTypes.number,mdPull:a["default"].PropTypes.number,lgPull:a["default"].PropTypes.number,componentClass:f["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass,t={};return Object.keys(c["default"].SIZES).forEach(function(e){var n=c["default"].SIZES[e],r=n,o=n+"-";this.props[r]&&(t["col-"+o+this.props[r]]=!0),r=n+"Offset",o=n+"-offset-",this.props[r]>=0&&(t["col-"+o+this.props[r]]=!0),r=n+"Push",o=n+"-push-",this.props[r]>=0&&(t["col-"+o+this.props[r]]=!0),r=n+"Pull",o=n+"-pull-",this.props[r]>=0&&(t["col-"+o+this.props[r]]=!0)},this),a["default"].createElement(e,o({},this.props,{className:u["default"](this.props.className,t)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(14),c=r(l),p=a["default"].createClass({displayName:"Row",propTypes:{componentClass:c["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass;return a["default"].createElement(e,o({},this.props,{className:u["default"](this.props.className,"row")}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||p.isValidElement(e)}function i(e){return o(e)||Array.isArray(e)&&e.every(o)}function a(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error&&h["default"](!1,o.message)}}function s(e){var t=e.type,n=c({},t.defaultProps,e.props);return t.propTypes&&a(t.displayName||t.name,t.propTypes,n),n.children&&(n.childRoutes=u(n.children),delete n.children),n}function u(e){var t=[];return f["default"].Children.forEach(e,function(e){p.isValidElement(e)&&(e.type.createRouteFromReactElement?t.push(e.type.createRouteFromReactElement(e)):t.push(s(e)))}),t}function l(e){return i(e)?e=u(e):Array.isArray(e)||(e=[e]),e}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.isReactChildren=i,t.createRouteFromReactElement=s,t.createRoutesFromReactChildren=u,t.createRoutes=l;var p=n(1),f=r(p),d=n(103),h=r(d)},function(e,t,n){"use strict";function r(e,t){return null==t||o.hasBooleanValue[e]&&!t||o.hasNumericValue[e]&&isNaN(t)||o.hasPositiveNumericValue[e]&&1>t||o.hasOverloadedBooleanValue[e]&&t===!1}var o=n(60),i=n(583),a=(n(8),{createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+i(e)},createMarkupForProperty:function(e,t){if(o.isStandardName.hasOwnProperty(e)&&o.isStandardName[e]){if(r(e,t))return"";var n=o.getAttributeName[e];return o.hasBooleanValue[e]||o.hasOverloadedBooleanValue[e]&&t===!0?n:n+"="+i(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+i(t):null},setValueForProperty:function(e,t,n){if(o.isStandardName.hasOwnProperty(t)&&o.isStandardName[t]){var i=o.getMutationMethod[t];if(i)i(e,n);else if(r(t,n))this.deleteValueForProperty(e,t);else if(o.mustUseAttribute[t])e.setAttribute(o.getAttributeName[t],""+n);else{var a=o.getPropertyName[t];o.hasSideEffects[t]&&""+e[a]==""+n||(e[a]=n)}}else o.isCustomAttribute(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){if(o.isStandardName.hasOwnProperty(t)&&o.isStandardName[t]){var n=o.getMutationMethod[t];if(n)n(e,void 0);else if(o.mustUseAttribute[t])e.removeAttribute(o.getAttributeName[t]);else{var r=o.getPropertyName[t],i=o.getDefaultValueForProperty(e.nodeName,r);o.hasSideEffects[t]&&""+e[r]===i||(e[r]=i)}}else o.isCustomAttribute(t)&&e.removeAttribute(t)}});e.exports=a},function(e,t,n){"use strict";var r=n(237),o=n(147),i=n(158),a=n(161),s=n(4),u={},l=null,c=function(e){if(e){var t=o.executeDispatch,n=r.getPluginModuleForEvent(e);n&&n.executeDispatch&&(t=n.executeDispatch),o.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},p=null,f={injection:{injectMount:o.injection.injectMount,injectInstanceHandle:function(e){p=e},getInstanceHandle:function(){return p},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){s(!n||"function"==typeof n);var r=u[t]||(u[t]={});r[e]=n},getListener:function(e,t){var n=u[t];return n&&n[e]},deleteListener:function(e,t){var n=u[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in u)delete u[t][e]},extractEvents:function(e,t,n,o){for(var a,s=r.plugins,u=0,l=s.length;l>u;u++){var c=s[u];if(c){var p=c.extractEvents(e,t,n,o);p&&(a=i(a,p))}}return a},enqueueEvents:function(e){e&&(l=i(l,e))},processEventQueue:function(){var e=l;l=null,a(e,c),s(!l)},__purge:function(){u={}},__getListenerBank:function(){return u}};e.exports=f},function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return v(e,r)}function o(e,t,n){var o=t?m.bubbled:m.captured,i=r(e,n,o);i&&(n._dispatchListeners=d(n._dispatchListeners,i),n._dispatchIDs=d(n._dispatchIDs,e))}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&f.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,o,e)}function a(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=v(e,r);o&&(n._dispatchListeners=d(n._dispatchListeners,o),n._dispatchIDs=d(n._dispatchIDs,e))}}function s(e){e&&e.dispatchConfig.registrationName&&a(e.dispatchMarker,null,e)}function u(e){h(e,i)}function l(e,t,n,r){f.injection.getInstanceHandle().traverseEnterLeave(n,r,a,e,t)}function c(e){h(e,s)}var p=n(23),f=n(77),d=n(158),h=n(161),m=p.PropagationPhases,v=f.getListener,g={accumulateTwoPhaseDispatches:u,accumulateDirectDispatches:c,accumulateEnterLeaveDispatches:l};e.exports=g},function(e,t,n){"use strict";function r(){if(y.current){var e=y.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e){var t=e&&e.getPublicInstance();if(!t)return void 0;var n=t.constructor;return n?n.displayName||n.name||void 0:void 0}function i(){var e=y.current;return e&&o(e)||void 0}function a(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,u('Each child in an array or iterator should have a unique "key" prop.',e,t))}function s(e,t,n){w.test(e)&&u("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function u(e,t,n){var r=i(),a="string"==typeof n?n:n.displayName||n.name,s=r||a,u=C[e]||(C[e]={});if(!u.hasOwnProperty(s)){u[s]=!0;var l="";if(t&&t._owner&&t._owner!==y.current){var c=o(t._owner);l=" It was passed a child from "+c+"."}}}function l(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];m.isValidElement(r)&&a(r,t)}else if(m.isValidElement(e))e._store.validated=!0;else if(e){var o=_(e);if(o){if(o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)m.isValidElement(i.value)&&a(i.value,t)}else if("object"==typeof e){var l=v.extractIfFragment(e);for(var c in l)l.hasOwnProperty(c)&&s(c,l[c],t)}}}function c(e,t,n,o){for(var i in t)if(t.hasOwnProperty(i)){var a;try{E("function"==typeof t[i]),a=t[i](n,i,e,o)}catch(s){a=s}a instanceof Error&&!(a.message in T)&&(T[a.message]=!0,r(this))}}function p(e,t){var n=t.type,r="string"==typeof n?n:n.displayName,o=t._owner?t._owner.getPublicInstance().constructor.displayName:null,i=e+"|"+r+"|"+o;if(!S.hasOwnProperty(i)){S[i]=!0;var a="";r&&(a=" <"+r+" />");var s="";o&&(s=" The element was created by "+o+".")}}function f(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function d(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var r in n)n.hasOwnProperty(r)&&(t.hasOwnProperty(r)&&f(t[r],n[r])||(p(r,e),t[r]=n[r]))}}function h(e){if(null!=e.type){var t=b.getComponentClassForElement(e),n=t.displayName||t.name;t.propTypes&&c(n,t.propTypes,e.props,g.prop),"function"==typeof t.getDefaultProps}}var m=n(9),v=n(63),g=n(156),y=(n(106),n(40)),b=n(105),_=n(255),E=n(4),C=(n(8),{}),T={},w=/^\d+$/,S={},O={checkAndWarnForMutatedProps:d,createElement:function(e,t,n){var r=m.createElement.apply(this,arguments);if(null==r)return r;for(var o=2;o<arguments.length;o++)l(arguments[o],e);return h(r),r},createFactory:function(e){var t=O.createElement.bind(null,e);return t.type=e,t},cloneElement:function(e,t,n){for(var r=m.cloneElement.apply(this,arguments),o=2;o<arguments.length;o++)l(arguments[o],r.type);return h(r),r}};e.exports=O},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(51),i=n(164),a={view:function(e){if(e.view)return e.view;var t=i(e);if(null!=t&&t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};o.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";var r=n(4),o=function(e){var t,n={};r(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=o},function(e,t,n){"use strict";var r=n(1),o=r.PropTypes,i=13,a=r.createClass({displayName:"TodoTextInput",propTypes:{className:o.string,id:o.string,placeholder:o.string,onSave:o.func.isRequired,value:o.string},getInitialState:function(){return{value:this.props.value||""}},render:function(){return r.createElement("input",{className:this.props.className,id:this.props.id,placeholder:this.props.placeholder,onBlur:this._save,onChange:this._onChange,onKeyDown:this._onKeyDown,value:this.state.value,autoFocus:!0})},_save:function(){this.props.onSave(this.state.value),this.setState({value:""})},_onChange:function(e){this.setState({value:e.target.value})},_onKeyDown:function(e){e.keyCode===i&&this._save()}});e.exports=a},function(e,t,n){"use strict";function r(e){e.forEach(function(e){d[e.id]||(d[e.id]=s.convertRawMessage(e,l.getCurrentID()))})}function o(e){for(var t in d)d[t].threadID===e&&(d[t].isRead=!0)}var i=n(12),a=n(11),s=n(45),u=n(18).EventEmitter,l=n(31),c=n(13),p=a.ActionTypes,f="change",d={},h=c({},u.prototype,{emitChange:function(){this.emit(f)},addChangeListener:function(e){this.on(f,e)},removeChangeListener:function(e){this.removeListener(f,e)},get:function(e){return d[e]},getAll:function(){return d},getAllForThread:function(e){var t=[];for(var n in d)d[n].threadID===e&&t.push(d[n]);return t.sort(function(e,t){return e.date<t.date?-1:e.date>t.date?1:0}),t},getAllForCurrentThread:function(){return this.getAllForThread(l.getCurrentID())}});h.dispatchToken=i.register(function(e){switch(e.type){case p.CHANGE_PRIVATE_CHAT:i.waitFor([l.dispatchToken]),o(l.getCurrentID()),h.emitChange();break;case p.CREATE_MESSAGE:if(!e.isGroup){var t=s.getCreatedMessageData(e.text,e.currentThreadID);d[t.id]=t,h.emitChange()}break;case p.RECEIVE_RAW_MESSAGES:r(e.rawMessages),i.waitFor([l.dispatchToken]),o(l.getCurrentID()),h.emitChange();break;case p.RECEIVE_RAW_PRIVATE_MESSAGE:r([e.rawMessage]),i.waitFor([l.dispatchToken]),o(l.getCurrentID()),h.emitChange()}}),e.exports=h},function(e,t,n){"use strict";var r=n(10),o=r.addons.update,i=r.createClass({displayName:"Undo",getInitialState:function(){return{states:[this.props.state],currentState:0}},componentWillReceiveProps:function(e){if(e.state!==this.state.states[this.state.currentState]){var t=this.state.states.length-this.state.currentState+1;this.setState(o(this.state,{states:{$splice:[[this.state.currentState+1,t,e.state]]},currentState:{$set:this.state.currentState+1}}))}},render:function(){var e,t,n,o;return e=this.state.currentState>0,t=this.state.currentState<this.state.states.length-1,n=r.addons.classSet({btn:!0,"btn-primary":e}),o=r.addons.classSet({btn:!0,"btn-primary":t}),r.createElement("div",null,r.createElement("button",{className:n,onClick:this._undo,disabled:!e},"Undo")," ",r.createElement("button",{className:o,onClick:this._redo,disabled:!t},"Redo"),this.props.children)},_undo:function(){var e=this.state.states[this.state.currentState-1];this.setState(o(this.state,{currentState:{$set:this.state.currentState-1}}),function(){this.props.onUndo(e)})},_redo:function(){var e=this.state.states[this.state.currentState+1];this.setState(o(this.state,{currentState:{$set:this.state.currentState+1}}),function(){this.props.onRedo(e)})}});e.exports=i},function(e,t,n){var r=n(2),o=n(44);e.exports=function(e){var t=1==e,n=2==e,i=3==e,a=4==e,s=6==e,u=5==e||s;return function(l,c,p){for(var f,d,h=Object(r.assertDefined(l)),m=r.ES5Object(h),v=o(c,p,3),g=r.toLength(m.length),y=0,b=t?Array(g):n?[]:void 0;g>y;y++)if((u||y in m)&&(f=m[y],d=v(f,y,h),e))if(t)b[y]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return y;case 2:b.push(f)}else if(a)return!1;return s?-1:i||a?a:b}}},function(e,t,n){"use strict";var r=n(2),o=n(5),i=n(35).BUGGY,a=n(69),s=n(89),u=n(17).inst;e.exports=function(e,t,l,c,p,f){function d(e){var t=g[e];n(36)(g,e,"delete"==e?function(e){return t.call(this,0===e?0:e)}:"has"==e?function(e){return t.call(this,0===e?0:e)}:"get"==e?function(e){return t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})}var h=r.g[e],m=h,v=p?"set":"add",g=m&&m.prototype,y={};if(r.isFunction(m)&&(f||!i&&g.forEach&&g.entries)){var b,_=new m,E=_[v](f?{}:-0,1);n(121)(function(e){new m(e)})||(m=t(function(t,n){u(t,m,e);var r=new h;return void 0!=n&&a(n,p,r[v],r),r}),m.prototype=g,g.constructor=m),f||_.forEach(function(e,t){b=1/t===-(1/0)}),b&&(d("delete"),d("has"),p&&d("get")),(b||E!==_)&&d(v)}else m=c.getConstructor(t,e,p,v),n(88)(m.prototype,l);return n(20).set(m,e),y[e]=m,o(o.G+o.W+o.F*(m!=h),y),s(m),s(r.core[e]),f||c.setIter(m,e,p),m}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3]);case 5:return r?e(t[0],t[1],t[2],t[3],t[4]):e.call(n,t[0],t[1],t[2],t[3],t[4])}return e.apply(n,t)}},function(e,t,n){var r=n(36);e.exports=function(e,t){for(var n in t)r(e,n,t[n]);return e}},function(e,t,n){var r=n(2),o=n(21)("species");e.exports=function(e){!r.DESC||o in e||r.setDesc(e,o,{configurable:!0,get:r.that})}},function(e,t,n){"use strict";e.exports=n(159)},function(e,t){"use strict";function n(e){e||(e="");var t,n=arguments.length;if(n>1)for(var r=1;n>r;r++)t=arguments[r],t&&(e=(e?e+" ":"")+t);return e}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t,n){var r=n(58),o=n(132),i=n(92),a="[object Array]",s=Object.prototype,u=s.toString,l=o(l=Array.isArray)&&l,c=l||function(e){return i(e)&&r(e.length)&&u.call(e)==a};e.exports=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(228),u=r(s),l=a["default"].createClass({displayName:"Accordion",render:function(){return a["default"].createElement(u["default"],o({},this.props,{accordion:!0}),this.props.children)}});t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=a["default"].createClass({displayName:"Alert",mixins:[c["default"]],propTypes:{onDismiss:a["default"].PropTypes.func,dismissAfter:a["default"].PropTypes.number,closeLabel:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"alert",bsStyle:"info",closeLabel:"Close Alert"}},renderDismissButton:function(){return a["default"].createElement("button",{type:"button",className:"close","aria-label":this.props.closeLabel,onClick:this.props.onDismiss},a["default"].createElement("span",{"aria-hidden":"true"},"×"))},render:function(){var e=this.getBsClassSet(),t=!!this.props.onDismiss;return e["alert-dismissable"]=t,a["default"].createElement("div",o({},this.props,{role:"alert",className:u["default"](this.props.className,e)}),t?this.renderDismissButton():null,this.props.children)},componentDidMount:function(){this.props.dismissAfter&&this.props.onDismiss&&(this.dismissTimer=setTimeout(this.props.onDismiss,this.props.dismissAfter))},componentWillUnmount:function(){clearTimeout(this.dismissTimer)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(140),s=r(a),u={propTypes:{defaultExpanded:i["default"].PropTypes.bool,expanded:i["default"].PropTypes.bool},getInitialState:function(){var e=null!=this.props.defaultExpanded?this.props.defaultExpanded:null!=this.props.expanded?this.props.expanded:!1;return{expanded:e,collapsing:!1}},componentWillUpdate:function(e,t){var n=null!=e.expanded?e.expanded:t.expanded;if(n!==this.isExpanded()){var r=this.getCollapsibleDOMNode(),o=this.dimension(),i="0";n||(i=this.getCollapsibleDimensionValue()),r.style[o]=i+"px",this._afterWillUpdate()}},componentDidUpdate:function(e,t){this._checkToggleCollapsing(e,t),this._checkStartAnimation()},_afterWillUpdate:function(){},_checkStartAnimation:function(){if(this.state.collapsing){var e=this.getCollapsibleDOMNode(),t=this.dimension(),n=this.getCollapsibleDimensionValue(),r=void 0;r=this.isExpanded()?n+"px":"0px",e.style[t]=r}},_checkToggleCollapsing:function(e,t){var n=null!=e.expanded?e.expanded:t.expanded,r=this.isExpanded();n!==r&&(n?this._handleCollapse():this._handleExpand())},_handleExpand:function(){var e=this,t=this.getCollapsibleDOMNode(),n=this.dimension(),r=function o(){e._removeEndEventListener(t,o),t.style[n]="",e.setState({collapsing:!1})};this._addEndEventListener(t,r),this.setState({collapsing:!0})},_handleCollapse:function(){var e=this,t=this.getCollapsibleDOMNode(),n=function r(){e._removeEndEventListener(t,r),e.setState({collapsing:!1})};this._addEndEventListener(t,n),this.setState({collapsing:!0})},_addEndEventListener:function(e,t){s["default"].addEndEventListener(e,t)},_removeEndEventListener:function(e,t){s["default"].removeEndEventListener(e,t)},dimension:function(){return"function"==typeof this.getCollapsibleDimension?this.getCollapsibleDimension():"height"},isExpanded:function(){return null!=this.props.expanded?this.props.expanded:this.state.expanded},getCollapsibleClassSet:function(e){var t={};return"string"==typeof e&&e.split(" ").forEach(function(e){e&&(t[e]=!0)}),t.collapsing=this.state.collapsing,t.collapse=!this.state.collapsing,t["in"]=this.isExpanded()&&!this.state.collapsing,t}};t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=e.querySelectorAll("."+t.join("."));n=[].map.call(n,function(e){return e});for(var r=0;r<t.length;r++)if(!e.className.match(new RegExp("\\b"+t[r]+"\\b")))return n;return n.unshift(e),n}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),s=n(22),u=r(s);t["default"]={_fadeIn:function(){var e=void 0;this.isMounted()&&(e=o(a["default"].findDOMNode(this),["fade"]),e.length&&e.forEach(function(e){e.className+=" in"}))},_fadeOut:function(){var e=o(this._fadeOutEl,["fade","in"]);e.length&&e.forEach(function(e){e.className=e.className.replace(/\bin\b/,"")}),setTimeout(this._handleFadeOutEnd,300)},_handleFadeOutEnd:function(){this._fadeOutEl&&this._fadeOutEl.parentNode&&this._fadeOutEl.parentNode.removeChild(this._fadeOutEl)},componentDidMount:function(){document.querySelectorAll&&setTimeout(this._fadeIn,20)},componentWillUnmount:function(){var e=o(a["default"].findDOMNode(this),["fade"]),t=this.props.container&&a["default"].findDOMNode(this.props.container)||u["default"].ownerDocument(this).body;e.length&&(this._fadeOutEl=document.createElement("div"),t.appendChild(this._fadeOutEl),this._fadeOutEl.appendChild(a["default"].findDOMNode(this).cloneNode(!0)),setTimeout(this._fadeOut,20))}},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(99),f=r(p),d=a["default"].createClass({displayName:"Glyphicon",mixins:[c["default"]],propTypes:{glyph:a["default"].PropTypes.oneOf(f["default"].GLYPHS).isRequired},getDefaultProps:function(){return{bsClass:"glyphicon"}},render:function(){var e=this.getBsClassSet();return e["glyphicon-"+this.props.glyph]=!0,a["default"].createElement("span",o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={CLASSES:{alert:"alert",button:"btn","button-group":"btn-group","button-toolbar":"btn-toolbar",column:"col","input-group":"input-group",form:"form",glyphicon:"glyphicon",label:"label",thumbnail:"thumbnail","list-group-item":"list-group-item",panel:"panel","panel-group":"panel-group",pagination:"pagination","progress-bar":"progress-bar",nav:"nav",navbar:"navbar",modal:"modal",row:"row",well:"well"},STYLES:{"default":"default",primary:"primary",success:"success",info:"info",warning:"warning",danger:"danger",link:"link",inline:"inline",tabs:"tabs",pills:"pills"},addStyle:function(e){n.STYLES[e]=e},SIZES:{large:"lg",medium:"md",small:"sm",xsmall:"xs"},GLYPHS:["asterisk","plus","euro","eur","minus","cloud","envelope","pencil","glass","music","search","heart","star","star-empty","user","film","th-large","th","th-list","ok","remove","zoom-in","zoom-out","off","signal","cog","trash","home","file","time","road","download-alt","download","upload","inbox","play-circle","repeat","refresh","list-alt","lock","flag","headphones","volume-off","volume-down","volume-up","qrcode","barcode","tag","tags","book","bookmark","print","camera","font","bold","italic","text-height","text-width","align-left","align-center","align-right","align-justify","list","indent-left","indent-right","facetime-video","picture","map-marker","adjust","tint","edit","share","check","move","step-backward","fast-backward","backward","play","pause","stop","forward","fast-forward","step-forward","eject","chevron-left","chevron-right","plus-sign","minus-sign","remove-sign","ok-sign","question-sign","info-sign","screenshot","remove-circle","ok-circle","ban-circle","arrow-left","arrow-right","arrow-up","arrow-down","share-alt","resize-full","resize-small","exclamation-sign","gift","leaf","fire","eye-open","eye-close","warning-sign","plane","calendar","random","comment","magnet","chevron-up","chevron-down","retweet","shopping-cart","folder-close","folder-open","resize-vertical","resize-horizontal","hdd","bullhorn","bell","certificate","thumbs-up","thumbs-down","hand-right","hand-left","hand-up","hand-down","circle-arrow-right","circle-arrow-left","circle-arrow-up","circle-arrow-down","globe","wrench","tasks","filter","briefcase","fullscreen","dashboard","paperclip","heart-empty","link","phone","pushpin","usd","gbp","sort","sort-by-alphabet","sort-by-alphabet-alt","sort-by-order","sort-by-order-alt","sort-by-attributes","sort-by-attributes-alt","unchecked","expand","collapse-down","collapse-up","log-in","flash","log-out","new-window","record","save","open","saved","import","export","send","floppy-disk","floppy-saved","floppy-remove","floppy-save","floppy-open","credit-card","transfer","cutlery","header","compressed","earphone","phone-alt","tower","stats","sd-video","hd-video","subtitles","sound-stereo","sound-dolby","sound-5-1","sound-6-1","sound-7-1","copyright-mark","registration-mark","cloud-download","cloud-upload","tree-conifer","tree-deciduous","cd","save-file","open-file","level-up","copy","paste","alert","equalizer","king","queen","pawn","bishop","knight","baby-formula","tent","blackboard","bed","apple","erase","hourglass","lamp","duplicate","piggy-bank","scissors","bitcoin","yen","ruble","scale","ice-lolly","ice-lolly-tasted","education","option-horizontal","option-vertical","menu-hamburger","modal-window","oil","grain","sunglasses","text-size","text-color","text-background","object-align-top","object-align-bottom","object-align-horizontal","object-align-left","object-align-vertical","object-align-right","triangle-right","triangle-left","triangle-bottom","triangle-top","console","superscript","subscript","menu-left","menu-right","menu-down","menu-up"]
};t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0}};t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return e[t]?new Error("<"+n+'> should not have a "'+t+'" prop'):void 0}var i=n(1),a=r(i),s=n(144),u=r(s),l=n(233),c=r(l),p=a["default"].PropTypes,f=p.func,d=p.object,h=p.arrayOf,m=p.instanceOf,v=p.oneOfType,g=p.element,y=f,b=v([y,d]),_=m(c["default"]),E=m(u["default"]),C=v([d,g]),T=v([C,h(C)]);e.exports={falsy:o,component:y,components:b,history:_,location:E,route:C,routes:T}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return y["default"].stringify(e,{arrayFormat:"brackets"})}function i(e){return e.replace(C,"")}function a(e){var t=e.match(C);return t?t[1]:""}function s(e){return e?e.replace(/^\/+/,""):""}function u(e){return"string"==typeof e&&"/"===e.charAt(0)}function l(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function c(e){return l(e).replace(/\/+/g,"/+")}function p(e){for(var t,n="",r=[],o=[],i=0,a=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;t=a.exec(e);)t.index!==i&&(o.push(e.slice(i,t.index)),n+=c(e.slice(i,t.index))),t[1]?(n+="([^/?#]+)",r.push(t[1])):"*"===t[0]?(n+="([\\s\\S]*?)",r.push("splat")):"("===t[0]?n+="(?:":")"===t[0]&&(n+=")?"),o.push(t[0]),i=a.lastIndex;return i!==e.length&&(o.push(e.slice(i,e.length)),n+=c(e.slice(i,e.length))),{pattern:e,regexpSource:n,paramNames:r,tokens:o}}function f(e){return e in T||(T[e]=p(e)),T[e]}function d(e,t){var n=f(s(e)),r=n.regexpSource,o=n.paramNames,i=n.tokens;r+="/*";var a="*"!==i[i.length-1];a&&(r+="([\\s\\S]*?)");var u,l,c=t.match(new RegExp("^"+r+"$","i"));return null!=c?(l=Array.prototype.slice.call(c,1).map(function(e){return null!=e?decodeURIComponent(e.replace(/\+/g,"%20")):e}),u=a?l.pop():t.replace(c[0],"")):u=l=null,{remainingPathname:u,paramNames:o,paramValues:l}}function h(e){return f(e).paramNames}function m(e,t){var n=d(e,s(t)),r=n.paramNames,o=n.paramValues;return null!=o?r.reduce(function(e,t,n){return e[t]=o[n],e},{}):null}function v(e,t){t=t||{};for(var n,r,o,i=f(e),a=i.tokens,s=0,u="",l=0,c=0,p=a.length;p>c;++c)n=a[c],"*"===n?(o=Array.isArray(t.splat)?t.splat[l++]:t.splat,_["default"](null!=o||s>0,'Missing splat #%s for path "%s"',l,e),null!=o&&(u+=encodeURI(o).replace(/%20/g,"+"))):"("===n?s+=1:")"===n?s-=1:":"===n.charAt(0)?(r=n.substring(1),o=t[r],_["default"](null!=o||s>0,'Missing "%s" parameter for path "%s"',r,e),null!=o&&(u+=encodeURIComponent(o).replace(/%20/g,"+"))):u+=n;return u.replace(/\/+/g,"/")}t.__esModule=!0,t.stringifyQuery=o,t.getPathname=i,t.getQueryString=a,t.stripLeadingSlashes=s,t.isAbsolutePath=u,t.compilePattern=f,t.matchPattern=d,t.getParamNames=h,t.getParams=m,t.formatPattern=v;var g=n(500),y=r(g),b=n(49),_=r(b),E=y["default"].parse;t.parseQueryString=E;var C=/\?([\s\S]*)$/,T={}},function(e,t,n){"use strict";var r=!1,o=function(){};r&&(o=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var o=2;r>o;o++)n[o-2]=arguments[o];if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var i=0,a="Warning: "+t.replace(/%s/g,function(){return n[i++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(s){}}}),e.exports=o},function(e,t,n){"use strict";var r=n(253),o={componentDidMount:function(){this.props.autoFocus&&r(this.getDOMNode())}};e.exports=o},function(e,t,n){"use strict";function r(e){if("function"==typeof e.type)return e.type;var t=e.type,n=p[t];return null==n&&(p[t]=n=l(t)),n}function o(e){return u(c),new c(e.type,e.props)}function i(e){return new f(e)}function a(e){return e instanceof f}var s=n(7),u=n(4),l=null,c=null,p={},f=null,d={injectGenericComponentClass:function(e){c=e},injectTextComponentClass:function(e){f=e},injectComponentClasses:function(e){s(p,e)},injectAutoWrapper:function(e){l=e}},h={getComponentClassForElement:r,createInternalComponent:o,createInstanceForText:i,isTextComponent:a,injection:d};e.exports=h},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(80),i=n(250),a=n(163),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:a,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+i.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+i.currentScrollTop}};o.augmentClass(r,s),e.exports=r},function(e,t,n){"use strict";var r=n(4),o={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,i,a,s,u){r(!this.isInTransaction());var l,c;try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,n,o,i,a,s,u),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(p){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=i.OBSERVED_ERROR,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===i.OBSERVED_ERROR)try{this.initializeAll(n+1)}catch(o){}}}},closeAll:function(e){r(this.isInTransaction());for(var t=this.transactionWrappers,n=e;n<t.length;n++){var o,a=t[n],s=this.wrapperInitData[n];try{o=!0,s!==i.OBSERVED_ERROR&&a.close&&a.close.call(this,s),o=!1}finally{if(o)try{this.closeAll(n+1)}catch(u){}}}this.wrapperInitData.length=0}},i={Mixin:o,OBSERVED_ERROR:{}};e.exports=i},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t){"use strict";function n(e){return o[e]}function r(e){return(""+e).replace(i,n)}var o={"&":"&",">":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;e.exports=r},function(e,t,n){"use strict";function r(){return{roles:s.getAll()}}var o=n(10),i=n(169),a=n(118),s=n(42),u=o.createClass({displayName:"RoleAndUserSelect",getInitialState:function(){return r()},componentDidMount:function(){s.addChangeListener(this._onChange)},componentWillUnmount:function(){s.removeChangeListener(this._onChange)},_onChange:function(){this.setState(r())},render:function(){return console.log("selected",this.props.selectedRoles),o.createElement("div",null,o.createElement("p",null,"Select roles:",o.createElement(i,{items:this.state.roles.map(function(e){return e.name}),selected:this.props.selectedRoles,onChange:this.props.onChangeRoles})),o.createElement("p",null,"Select users"),o.createElement(a,{value:this.props.users,multi:!0,onChange:this.props.onChangeUsers}))}});e.exports=u},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(54),i=n(43),a=(n(13),n(19));e.exports={loadRoles:function(){o.get(a.api.roles()).done(function(e){s.receiveRoles(e)})},loadChatrooms:function(){o.get(a.api.chatrooms()).done(function(e){e.forEach(function(e){e.start=i.ISODateStringToDate(e.start),e.end=i.ISODateStringToDate(e.end)}),s.receiveChatrooms(e)})},createRoom:function(e){o.post(a.api.chatrooms(),e)},updateRoom:function(e,t){return t=r({},t),t.start=t.start&&t.start.toISOString()||null,t.end=t.end&&t.end.toISOString()||null,o.put(a.api.chatroom(e),t)},deleteRoom:function(e){return o.del(a.api.chatroom(e))},loadSlots:function(){o.get(a.api.slots()).done(function(e){s.receiveSlots(e)})},createSlot:function(e){o.post(a.api.slots(),e).done(function(t){s.receiveCreateSlotSuccess(e,t.id)})},updateSlot:function(e){o.put(a.api.slots(),e)},deleteSlot:function(e){o.del(a.api.slot(e))}};var s=n(25)},function(e,t,n){"use strict";var r=n(1),o=n(183),i=$("#avatar_svgs").text(),a=r.createClass({displayName:"Avatar",propTypes:{username:r.PropTypes.string.isRequired,avatar:r.PropTypes.string.isRequired,size:r.PropTypes.number,link:r.PropTypes.bool},getDefaultProps:function(){return{size:50,link:!0}},render:function(){var e=r.createElement("div",{className:"avatar",style:{width:this.props.size,margin:"auto"},dangerouslySetInnerHTML:{__html:this._avatarSVG()}});return this.props.link&&(e=r.createElement(o,{username:this.props.username},e)),e},_avatarSVG:function(){var e=$(i);return e.find(">g[id!="+this.props.avatar+"]").remove(),e.find(">g").show(),e.attr({width:this.props.size,height:this.props.size}),e=e.get(0).outerHTML}});e.exports=a},function(e,t,n){"use strict";function r(){return{whosOnline:i.get(),userProfiles:a.get()}}var o=n(1),i=n(301),a=n(116),s=n(113),u=n(183),l=n(177),c=o.createClass({displayName:"WhosOnline",getInitialState:function(){return r()},componentDidMount:function(){i.addChangeListener(this._onChange),a.addChangeListener(this._onChange)},componentWillUnmount:function(){i.removeChangeListener(this._onChange),a.removeChangeListener(this._onChange)},render:function(){var e=this,t=this.state.whosOnline.map(function(t,n){var r=e.state.userProfiles[t]&&e.state.userProfiles[t].avatar;return e.props.stacked?o.createElement("div",{style:{height:50,display:"table"},key:t},o.createElement("div",{style:{display:"table-cell",verticalAlign:"middle"}},o.createElement(u,{username:t},r?o.createElement(s,{username:t,avatar:r,size:30,link:!1}):null)),o.createElement("div",{style:{display:"table-cell",verticalAlign:"middle",paddingLeft:5}},o.createElement("b",null,t)," ",o.createElement("i",null,"[",o.createElement(l,{user:t}),"]"))):o.createElement("div",{className:"whosOnlineItem",key:t},o.createElement(u,{username:t},r?o.createElement(s,{username:t,avatar:r,link:!1}):null),o.createElement("small",null,o.createElement("p",{className:"username"},t),o.createElement("p",null,o.createElement("i",null,"[",o.createElement(l,{user:t}),"]"))))});return o.createElement("div",{className:"whosOnline"},t)},_onChange:function(){this.setState(r())}});e.exports=c},function(e,t,n){"use strict";var r,o=n(12),i=n(11),a=n(18).EventEmitter,s=n(13),u=i.ActionTypes,l="change",c=s({},a.prototype,{emitChange:function(){this.emit(l)},addChangeListener:function(e){this.on(l,e)},removeChangeListener:function(e){this.removeListener(l,e)},get:function(){return r}});c.dispatchToken=o.register(function(e){switch(e.type){case u.CONNECT:r=i.connected,c.emitChange();break;case u.DISCONNECT:r=i.disconnected,c.emitChange()}}),e.exports=c},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(18).EventEmitter,a=n(13),s=o.ActionTypes,u="change",l={},c=a({},i.prototype,{emitChange:function(){this.emit(u)},addChangeListener:function(e){this.on(u,e)},removeChangeListener:function(e){this.removeListener(u,e)},get:function(e){return l}});c.setMaxListeners(0),c.dispatchToken=r.register(function(e){switch(e.type){case s.RECEIVE_USER_PROFILE:l[e.userProfile.user]=e.userProfile,c.emitChange();break;case s.CHANGE_AVATAR:l[e.user].avatar=e.avatarName,c.emitChange()}}),e.exports=c},function(e,t,n){"use strict";var r=n(10);e.exports={areItemsContiguous:function(e){for(var t,n=!1,r=0;r<e.length;r+=1){if(t=e[r],n&&t)return!1;this.isBlank(t)&&(n=!0)}return!0},areAllValuesEmpty:function(e){var t=this;return e=e.filter(function(e){return!t.isBlank(e)}),!e.length},isBlank:function(e){return!e&&0!==e},updateState:function(e,t){e.setState(r.addons.update(e.state,t))}}},function(e,t,n){"use strict";function r(e,t){if(e){var n="/"+DITTO.tenant+"/users/search/";$.getJSON(n,{q:e},function(e){var n=e.map(function(e){return{value:e,label:e}});t(null,{options:n})})}}var o=n(1),i=n(504),a=o.createClass({displayName:"UserAutocomplete",getDefaultProps:function(){return{name:"user-autocomplete"}},render:function(){return o.createElement(i,{name:this.props.name,value:this._value(),placeholder:"Enter username",asyncOptions:r,onChange:this.props.onChange?this._onChange:null,autoload:!1,delimiter:"|",multi:this.props.multi})},_value:function(){return this.props.multi?this.props.value&&this.props.value.length?this.props.value.join("|"):null:this.props.value},_onChange:function(e){var t;t=e?e.split("|"):"",this.props.onChange(t)}});e.exports=a},function(e,t){"use strict";var n={componentWillMount:function(){this._updateHeight()},componentDidMount:function(){$(window).on("resize",this._updateHeight)},componentWillUnmount:function(){$(window).off("resize",this._updateHeight)},_updateHeight:function(){var e=$(window).height()-this.props.heightOffset;this.setState({height:e})}};e.exports=n},function(e,t,n){var r=n(5),o=n(36),i=n(2),a=n(20),s=n(35),u=n(21)("iterator"),l="@@iterator",c="keys",p="values",f=s.Iterators;e.exports=function(e,t,n,d,h,m,v){function g(e){function t(t){return new n(t,e)}switch(e){case c:return function(){return t(this)};case p:return function(){return t(this)}}return function(){return t(this)}}s.create(n,t,d);var y,b,_=t+" Iterator",E=e.prototype,C=E[u]||E[l]||h&&E[h],T=C||g(h);if(C){var w=i.getProto(T.call(new e));a.set(w,_,!0),i.FW&&i.has(E,l)&&s.set(w,i.that)}if((i.FW||v)&&s.set(E,T),f[t]=T,f[_]=i.that,h)if(y={keys:m?T:g(c),values:h==p?T:g(p),entries:h!=p?T:g("entries")},v)for(b in y)b in E||o(E,b,y[b]);else r(r.P+r.F*s.BUGGY,t,y)}},function(e,t,n){var r=n(21)("iterator"),o=!1;try{var i=[7][r]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(a){}e.exports=function(e){if(!o)return!1;var t=!1;try{var n=[7],i=n[r]();i.next=function(){t=!0},n[r]=function(){return i},e(n)}catch(a){}return t}},function(e,t){"use strict";e.exports=function(e,t,n){var r=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(n?t:this).replace(e,r)}}},function(e,t,n){function r(e,t){i.obj(e),i(null===t||o.isObject(t),t,": can't set as prototype!")}var o=n(2),i=n(17);e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t){try{(t=n(44)(Function.call,o.getDesc(Object.prototype,"__proto__").set,2))({},[])}catch(i){e=!0}return function(n,o){return r(n,o),e?n.__proto__=o:t(n,o),n}}():void 0),check:r}},function(e,t,n){var r=n(2),o="__core-js_shared__",i=r.g[o]||(r.g[o]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,n){var r=n(2);e.exports=function(e){return function(t,n){var o,i,a=String(r.assertDefined(t)),s=r.toInteger(n),u=a.length;return 0>s||s>=u?e?"":void 0:(o=a.charCodeAt(s),55296>o||o>56319||s+1===u||(i=a.charCodeAt(s+1))<56320||i>57343?e?a.charAt(s):o:e?a.slice(s,s+2):(o-55296<<10)+(i-56320)+65536)}}},function(e,t){e.exports=function(e){try{return e(),!1}catch(t){return!0}}},function(e,t,n){"use strict";function r(e){return null===e||void 0===e?"":String(e)}function o(e,t){s.Children.forEach(e,function(e){e.type===u?o(e.props.children,t):e.type===l&&t(e)})}function i(e,t){var n=[];return s.Children.forEach(e,function(e){var r=e;if(e.type===u){var i=!1,a=[];o(e.props.children,function(e){var n=t(e);n!==e&&(i=!0),a.push(n)}),i&&(r=c(e,{key:e.key,children:a}))}else e.type===l&&(r=t(e));n.push(r)}),n}var a=n(206),s=n(26),u=n(203),l=n(202),c=n(90),p=a.isRTL()?-1:1,f=5,d={DIR_SIGN:p,CELL_VISIBILITY_TOLERANCE:f,renderToString:r,forEachColumn:o,mapColumns:i};e.exports=d},function(e,t){"use strict";function n(e,t,n){return e>t?e:t>n?n:t}e.exports=n},function(e,t,n){e.exports=n(394)},function(e,t){"use strict";var n=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=n},function(e,t){function n(e){return"string"==typeof e?e:null==e?"":e+""}e.exports=n},function(e,t,n){function r(e){return null==e?!1:c.call(e)==a?p.test(l.call(e)):i(e)&&s.test(e)}var o=n(444),i=n(92),a="[object Function]",s=/^\[object .+?Constructor\]$/,u=Object.prototype,l=Function.prototype.toString,c=u.toString,p=RegExp("^"+o(c).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){var r=n(58),o=n(132),i=n(71),a=n(438),s=o(s=Object.keys)&&s,u=s?function(e){if(e)var t=e.constructor,n=e.length;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&n&&r(n)?a(e):i(e)?s(e):[]}:a;e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(14),f=r(p),d=a["default"].createClass({displayName:"ButtonGroup",mixins:[c["default"]],propTypes:{vertical:a["default"].PropTypes.bool,justified:a["default"].PropTypes.bool,block:f["default"].all([a["default"].PropTypes.bool,function(e,t,n){return e.block&&!e.vertical?new Error("The block property requires the vertical property to be set to have any effect"):void 0}])},getDefaultProps:function(){return{bsClass:"button-group"}},render:function(){var e=this.getBsClassSet();return e["btn-group"]=!this.props.vertical,e["btn-group-vertical"]=this.props.vertical,e["btn-group-justified"]=this.props.justified,e["btn-block"]=this.props.block,a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(27),c=r(l),p=n(15),f=r(p),d=a["default"].createClass({displayName:"DropdownMenu",propTypes:{pullRight:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func},render:function(){var e={"dropdown-menu":!0,"dropdown-menu-right":this.props.pullRight};return a["default"].createElement("ul",o({},this.props,{className:u["default"](this.props.className,e),role:"menu"}),f["default"].map(this.props.children,this.renderMenuItem))},renderMenuItem:function(e,t){return i.cloneElement(e,{onSelect:c["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t})}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),s=n(22),u=r(s),l=n(100),c=r(l),p={getInitialState:function(){return{open:!1}},setDropdownState:function(e,t){e?this.bindRootCloseHandlers():this.unbindRootCloseHandlers(),this.setState({open:e},t)},handleDocumentKeyUp:function(e){27===e.keyCode&&this.setDropdownState(!1)},handleDocumentClick:function(e){var t=e.target||e.srcElement;o(t,a["default"].findDOMNode(this))||this.setDropdownState(!1)},bindRootCloseHandlers:function(){var e=u["default"].ownerDocument(this);this._onDocumentClickListener=c["default"].listen(e,"click",this.handleDocumentClick),this._onDocumentKeyupListener=c["default"].listen(e,"keyup",this.handleDocumentKeyUp)},unbindRootCloseHandlers:function(){this._onDocumentClickListener&&this._onDocumentClickListener.remove(),this._onDocumentKeyupListener&&this._onDocumentKeyupListener.remove()},componentWillUnmount:function(){this.unbindRootCloseHandlers()}};t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=n(219),d=r(f),h=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"getInputDOMNode",value:function(){return l["default"].findDOMNode(this.refs.input)}},{key:"getValue",value:function(){if("static"===this.props.type)return this.props.value;if(this.props.type)return"select"===this.props.type&&this.props.multiple?this.getSelectedOptions():this.getInputDOMNode().value;throw"Cannot use getValue without specifying input type."}},{key:"getChecked",value:function(){return this.getInputDOMNode().checked}},{key:"getSelectedOptions",value:function(){var e=[];return Array.prototype.forEach.call(this.getInputDOMNode().getElementsByTagName("option"),function(t){if(t.selected){var n=t.getAttribute("value")||t.innerHtml;e.push(n)}}),e}},{key:"isCheckboxOrRadio",value:function(){return"checkbox"===this.props.type||"radio"===this.props.type}},{key:"isFile",value:function(){return"file"===this.props.type}},{key:"renderInputGroup",value:function(e){var t=this.props.addonBefore?l["default"].createElement("span",{className:"input-group-addon",key:"addonBefore"},this.props.addonBefore):null,n=this.props.addonAfter?l["default"].createElement("span",{className:"input-group-addon",key:"addonAfter"},this.props.addonAfter):null,r=this.props.buttonBefore?l["default"].createElement("span",{className:"input-group-btn"},this.props.buttonBefore):null,o=this.props.buttonAfter?l["default"].createElement("span",{className:"input-group-btn"},this.props.buttonAfter):null,i=void 0;switch(this.props.bsSize){case"small":i="input-group-sm";break;case"large":i="input-group-lg"}return t||n||r||o?l["default"].createElement("div",{className:p["default"](i,"input-group"),key:"input-group"},t,r,e,n,o):e}},{key:"renderIcon",value:function(){var e={glyphicon:!0,"form-control-feedback":!0,"glyphicon-ok":"success"===this.props.bsStyle,"glyphicon-warning-sign":"warning"===this.props.bsStyle,"glyphicon-remove":"error"===this.props.bsStyle};return this.props.hasFeedback?l["default"].createElement("span",{className:p["default"](e),key:"icon"}):null}},{key:"renderHelp",value:function(){return this.props.help?l["default"].createElement("span",{className:"help-block",key:"help"},this.props.help):null}},{key:"renderCheckboxAndRadioWrapper",value:function(e){var t={checkbox:"checkbox"===this.props.type,radio:"radio"===this.props.type};return l["default"].createElement("div",{className:p["default"](t),key:"checkboxRadioWrapper"},e)}},{key:"renderWrapper",value:function(e){return this.props.wrapperClassName?l["default"].createElement("div",{className:this.props.wrapperClassName,key:"wrapper"},e):e}},{key:"renderLabel",value:function(e){var t={"control-label":!this.isCheckboxOrRadio()};return t[this.props.labelClassName]=this.props.labelClassName,this.props.label?l["default"].createElement("label",{htmlFor:this.props.id,className:p["default"](t),key:"label"},e,this.props.label):e}},{key:"renderInput",value:function(){if(!this.props.type)return this.props.children;switch(this.props.type){case"select":return l["default"].createElement("select",a({},this.props,{className:p["default"](this.props.className,"form-control"),ref:"input",key:"input"}),this.props.children);case"textarea":return l["default"].createElement("textarea",a({},this.props,{className:p["default"](this.props.className,"form-control"),ref:"input",key:"input"}));case"static":return l["default"].createElement("p",a({},this.props,{className:p["default"](this.props.className,"form-control-static"),ref:"input",key:"input"}),this.props.value)}var e=this.isCheckboxOrRadio()||this.isFile()?"":"form-control";return l["default"].createElement("input",a({},this.props,{className:p["default"](this.props.className,e),ref:"input",key:"input"}))}},{key:"renderFormGroup",value:function(e){return l["default"].createElement(d["default"],this.props,e)}},{key:"renderChildren",value:function(){return this.isCheckboxOrRadio()?this.renderWrapper([this.renderCheckboxAndRadioWrapper(this.renderLabel(this.renderInput())),this.renderHelp()]):[this.renderLabel(),this.renderWrapper([this.renderInputGroup(this.renderInput()),this.renderIcon(),this.renderHelp()])]}},{key:"render",value:function(){var e=this.renderChildren();return this.renderFormGroup(e)}}]),t}(l["default"].Component);h.propTypes={type:l["default"].PropTypes.string,label:l["default"].PropTypes.node,help:l["default"].PropTypes.node,addonBefore:l["default"].PropTypes.node,addonAfter:l["default"].PropTypes.node,buttonBefore:l["default"].PropTypes.node,buttonAfter:l["default"].PropTypes.node,bsSize:l["default"].PropTypes.oneOf(["small","medium","large"]),bsStyle:l["default"].PropTypes.oneOf(["success","warning","error"]),hasFeedback:l["default"].PropTypes.bool,id:l["default"].PropTypes.string,groupClassName:l["default"].PropTypes.string,wrapperClassName:l["default"].PropTypes.string,labelClassName:l["default"].PropTypes.string,multiple:l["default"].PropTypes.bool,disabled:l["default"].PropTypes.bool,value:l["default"].PropTypes.any},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(14),u=r(s),l=n(22),c=r(l),p=n(74),f=r(p),d={propTypes:{container:u["default"].mountable},componentDidMount:function(){this._renderOverlay()},componentDidUpdate:function(){this._renderOverlay()},componentWillUnmount:function(){this._unrenderOverlay(),this._mountOverlayTarget()},_mountOverlayTarget:function(){this._overlayTarget||(this._overlayTarget=document.createElement("div"),this.getContainerDOMNode().appendChild(this._overlayTarget))},_unmountOverlayTarget:function(){this._overlayTarget&&(this.getContainerDOMNode().removeChild(this._overlayTarget),this._overlayTarget=null)},_renderOverlay:function(){var e=this.renderOverlay();null!==e?(this._mountOverlayTarget(),this._overlayInstance=a["default"].render(e,this._overlayTarget)):(this._unrenderOverlay(),this._unmountOverlayTarget())},_unrenderOverlay:function(){this._overlayTarget&&(a["default"].unmountComponentAtNode(this._overlayTarget),this._overlayInstance=null)},getOverlayDOMNode:function(){if(!this.isMounted())throw new Error("getOverlayDOMNode(): A component must be mounted to have a DOM node.");return this._overlayInstance?a["default"].findDOMNode(this._overlayInstance):null},getContainerDOMNode:function(){return a["default"].findDOMNode(this.props.container)||c["default"].ownerDocument(this).body}};t.OverlayMixin=d,t["default"]=o({},d,{componentWillMount:function(){f["default"]("Overlay mixin","the `<Portal/>` Component","http://react-bootstrap.github.io/components.html#utilities-portal")}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(14),s=r(a),u=n(138),l=i["default"].createClass({displayName:"Portal",propTypes:{container:s["default"].mountable},mixins:[u.OverlayMixin],renderOverlay:function(){return this.props.children?i["default"].Children.only(this.props.children):null},render:function(){return null}});t["default"]=l,e.exports=t["default"]},function(e,t){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete a.animationend.animation,"TransitionEvent"in window||delete a.transitionend.transition;for(var n in a){var r=a[n];for(var o in r)if(o in t){s.push(r[o]);break}}}function r(e,t,n){e.addEventListener(t,n,!1)}function o(e,t,n){e.removeEventListener(t,n,!1)}Object.defineProperty(t,"__esModule",{value:!0});var i=!("undefined"==typeof window||!window.document||!window.document.createElement),a={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},s=[];i&&n();var u={addEndEventListener:function(e,t){return 0===s.length?void window.setTimeout(t,0):void s.forEach(function(n){r(e,n,t)})},removeEndEventListener:function(e,t){0!==s.length&&s.forEach(function(n){o(e,n,t)})}};t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=s.singlePropFrom(u)(e,t,n);if(!r){var o=a["default"].PropTypes.oneOfType(l);r=o(e,t,n)}return r}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var i=n(1),a=r(i),s=n(14),u=["children","value"],l=[a["default"].PropTypes.number,a["default"].PropTypes.string];e.exports=t["default"]},function(e,t,n){var r=n(1),o=n(611),i=r.PropTypes,a=function(e){return{"-webkit-user-select":e,"-khtml-user-drag":e,"-khtml-user-select":e,"-moz-user-select":e,"-ms-user-select":e,userSelect:e}},s=(a("none"),r.createClass({displayName:"SortableArea",propTypes:{components:i.arrayOf(i.node).isRequired,onReorder:i.func.isRequired,verify:i.func},render:function(){var e=o(this.state.components).map(function(e,t){return r.createElement(u,{index:t,component:e,area:this,key:e.key,draggable:e.props.draggable,dragging:t===this.state.dragging})}.bind(this));return r.createElement("ol",{className:this.props.className,style:this.props.style},e)},getDefaultProps:function(){return{verify:function(){return!0}}},getInitialState:function(){return{dragging:null,components:this.props.components}},componentWillReceiveProps:function(e){this.setState({components:e.components})},onDragStart:function(e){this.setState({dragging:e})},onDrop:function(){this.setState({dragging:null}),this.props.onReorder(this.state.components)},onDragEnter:function(e){if(this.state.dragging!==e){var t=this.state.components.slice(),n=t.splice(this.state.dragging,1);t.splice(e,0,n[0]);var r=this.props.verify(t);return r&&this.setState({dragging:e,components:t}),r}},componentDidMount:function(){this._setDragEvents()},componentDidUpdate:function(){this._setDragEvents()},_listenEvent:function(e){e.dataTransfer.setData("hackhackhack","because browsers!")},_cancelEvent:function(e){e.preventDefault()},_setDragEvents:function(){this._dragItems=this._dragItems||[];var e=this.getDOMNode().querySelectorAll("[draggable=true]"),t=o(this._dragItems).difference(e),n=o(e).difference(this._dragItems);o(n).each(function(e){e.addEventListener("dragstart",this._listenEvent),e.addEventListener("drop",this._cancelEvent)}.bind(this)),o(t).each(function(e){e.removeEventListener("dragstart",this._listenEvent),e.removeEventListener("drop",this._cancelEvent)}.bind(this))}})),u=r.createClass({displayName:"SortableItem",propTypes:{},render:function(){var e="sortable-disabled";return this.props.dragging?e="sortable-dragging":this.props.draggable&&(e="sortable-enabled"),r.createElement("li",{draggable:this.props.draggable,className:e,onDragStart:this.handleDragStart,onDrop:this.handleDrop,
onDragEnter:this.handleDragEnter,onDragOver:this.handleDragOver},this.props.component)},handleDragStart:function(e){e.nativeEvent.dataTransfer.effectAllowed="move",this.props.area.onDragStart(this.props.index)},handleDrop:function(){this.props.area.onDrop(this.props.index)},handleDragEnter:function(e){var t=this.props.area.onDragEnter(this.props.index);e.nativeEvent.dataTransfer.effectAllowed=t?"move":"none"},handleDragOver:function(e){e.preventDefault()}});e.exports=s},function(e,t){"use strict";function n(){return window.location.href.split("#")[1]||""}function r(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function o(){return window.location.pathname+window.location.search}function i(){return{scrollX:window.pageXOffset||document.documentElement.scrollLeft,scrollY:window.pageYOffset||document.documentElement.scrollTop}}function a(e,t){window.scrollTo(e,t)}function s(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}t.__esModule=!0,t.getHashPath=n,t.replaceHashPath=r,t.getWindowPath=o,t.getWindowScrollPosition=i,t.setWindowScrollPosition=a,t.supportsHistory=s;var u=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n(145),a=r(i),s=function(){function e(){var t=void 0===arguments[0]?"/":arguments[0],n=void 0===arguments[1]?null:arguments[1],r=void 0===arguments[2]?null:arguments[2],i=void 0===arguments[3]?a["default"].POP:arguments[3];o(this,e),this.pathname=t,this.query=n,this.state=r,this.navigationType=i}return e.isLocation=function(t){return t instanceof e},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(130),i=r(o),a=i["default"]({PUSH:null,REPLACE:null,POP:null});t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(){this._callbacks=null,this._contexts=null}var o=n(38),i=n(7),a=n(4);i(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){a(e.length===t.length),this._callbacks=null,this._contexts=null;for(var n=0,r=e.length;r>n;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e){return e===v.topMouseUp||e===v.topTouchEnd||e===v.topTouchCancel}function o(e){return e===v.topMouseMove||e===v.topTouchMove}function i(e){return e===v.topMouseDown||e===v.topTouchStart}function a(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)t(e,n[o],r[o]);else n&&t(e,n,r)}function s(e,t,n){e.currentTarget=m.Mount.getNode(n);var r=t(e,n);return e.currentTarget=null,r}function u(e,t){a(e,t),e._dispatchListeners=null,e._dispatchIDs=null}function l(e){var t=e._dispatchListeners,n=e._dispatchIDs;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function c(e){var t=l(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function p(e){var t=e._dispatchListeners,n=e._dispatchIDs;h(!Array.isArray(t));var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function f(e){return!!e._dispatchListeners}var d=n(23),h=n(4),m={Mount:null,injectMount:function(e){m.Mount=e}},v=d.topLevelTypes,g={isEndish:r,isMoveish:o,isStartish:i,executeDirectDispatch:p,executeDispatch:s,executeDispatchesInOrder:u,executeDispatchesInOrderStopAtTrue:c,hasDispatches:f,injection:m,useTouchEvents:!1};e.exports=g},function(e,t,n){"use strict";function r(e){l(null==e.props.checkedLink||null==e.props.valueLink)}function o(e){r(e),l(null==e.props.value&&null==e.props.onChange)}function i(e){r(e),l(null==e.props.checked&&null==e.props.onChange)}function a(e){this.props.valueLink.requestChange(e.target.value)}function s(e){this.props.checkedLink.requestChange(e.target.checked)}var u=n(246),l=n(4),c={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},p={Mixin:{propTypes:{value:function(e,t,n){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:u.func}},getValue:function(e){return e.props.valueLink?(o(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(i(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(o(e),a):e.props.checkedLink?(i(e),s):e.props.onChange}};e.exports=p},function(e,t,n){"use strict";function r(e){e.remove()}var o=n(62),i=n(158),a=n(161),s=n(4),u={trapBubbledEvent:function(e,t){s(this.isMounted());var n=this.getDOMNode();s(n);var r=o.trapBubbledEvent(e,t,n);this._localEventListeners=i(this._localEventListeners,r)},componentWillUnmount:function(){this._localEventListeners&&a(this._localEventListeners,r)}};e.exports=u},function(e,t,n){"use strict";var r=n(241),o=n(41),i={processChildrenUpdates:r.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:r.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){o.purgeID(e)}};e.exports=i},function(e,t,n){"use strict";var r=n(4),o=!1,i={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){r(!o),i.unmountIDFromEnvironment=e.unmountIDFromEnvironment,i.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(7),o=n(109),i=(n(8),{current:o,withContext:function(e,t){var n,o=i.current;i.current=r({},o,e);try{n=t()}finally{i.current=o}return n}});e.exports=i},function(e,t,n){"use strict";function r(e){e&&(null!=e.dangerouslySetInnerHTML&&(g(null==e.children),g(null!=e.dangerouslySetInnerHTML.__html)),g(null==e.style||"object"==typeof e.style))}function o(e,t,n,r){var o=f.findReactContainerForID(e);if(o){var i=o.nodeType===w?o.ownerDocument:o;_(t,i)}r.getPutListenerQueue().enqueuePutListener(e,t,n)}function i(e){D.call(P,e)||(g(x.test(e)),P[e]=!0)}function a(e){i(e),this._tag=e,this._renderedChildren=null,this._previousStyleCopy=null,this._rootNodeID=null}var s=n(236),u=n(60),l=n(76),c=n(62),p=n(150),f=n(41),d=n(542),h=n(50),m=n(7),v=n(110),g=n(4),y=(n(166),n(34)),b=(n(8),c.deleteListener),_=c.listenTo,E=c.registrationNameModules,C={string:!0,number:!0},T=y({style:null}),w=1,S=null,O={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},x=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P={},D={}.hasOwnProperty;a.displayName="ReactDOMComponent",a.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e,r(this._currentElement.props);var o=O[this._tag]?"":"</"+this._tag+">";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,n)+o},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(E.hasOwnProperty(r))o(this._rootNodeID,r,i,e);else{r===T&&(i&&(i=this._previousStyleCopy=m({},t.style)),i=s.createMarkupForStyles(i));var a=l.createMarkupForProperty(r,i);a&&(n+=" "+a)}}if(e.renderToStaticMarkup)return n+">";var u=l.createMarkupForID(this._rootNodeID);return n+" "+u+">"},_createContentMarkup:function(e,t){var n="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(n="\n");var r=this._currentElement.props,o=r.dangerouslySetInnerHTML;if(null!=o){if(null!=o.__html)return n+o.__html}else{var i=C[typeof r.children]?r.children:null,a=null!=i?null:r.children;if(null!=i)return n+v(i);if(null!=a){var s=this.mountChildren(a,e,t);return n+s.join("")}}return n},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,o){r(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,o)},_updateDOMProperties:function(e,t){var n,r,i,a=this._currentElement.props;for(n in e)if(!a.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===T){var s=this._previousStyleCopy;for(r in s)s.hasOwnProperty(r)&&(i=i||{},i[r]="");this._previousStyleCopy=null}else E.hasOwnProperty(n)?b(this._rootNodeID,n):(u.isStandardName[n]||u.isCustomAttribute(n))&&S.deletePropertyByID(this._rootNodeID,n);for(n in a){var l=a[n],c=n===T?this._previousStyleCopy:e[n];if(a.hasOwnProperty(n)&&l!==c)if(n===T)if(l&&(l=this._previousStyleCopy=m({},l)),c){for(r in c)!c.hasOwnProperty(r)||l&&l.hasOwnProperty(r)||(i=i||{},i[r]="");for(r in l)l.hasOwnProperty(r)&&c[r]!==l[r]&&(i=i||{},i[r]=l[r])}else i=l;else E.hasOwnProperty(n)?o(this._rootNodeID,n,l,t):(u.isStandardName[n]||u.isCustomAttribute(n))&&S.updatePropertyByID(this._rootNodeID,n,l)}i&&S.updateStylesByID(this._rootNodeID,i)},_updateDOMChildren:function(e,t,n){var r=this._currentElement.props,o=C[typeof e.children]?e.children:null,i=C[typeof r.children]?r.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=r.dangerouslySetInnerHTML&&r.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,l=null!=i?null:r.children,c=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==l?this.updateChildren(null,t,n):c&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&S.updateInnerHTMLByID(this._rootNodeID,s):null!=l&&this.updateChildren(l,t,n)},unmountComponent:function(){this.unmountChildren(),c.deleteAllListeners(this._rootNodeID),p.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},h.measureMethods(a,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),m(a.prototype,a.Mixin,d.Mixin),a.injection={injectIDOperations:function(e){a.BackendIDOperations=S=e}},e.exports=a},function(e,t,n){"use strict";function r(e){c[e]=!0}function o(e){delete c[e]}function i(e){return!!c[e]}var a,s=n(9),u=n(65),l=n(4),c={},p={injectEmptyComponent:function(e){a=s.createFactory(e)}},f=function(){};f.prototype.componentDidMount=function(){var e=u.get(this);e&&r(e._rootNodeID)},f.prototype.componentWillUnmount=function(){var e=u.get(this);e&&o(e._rootNodeID)},f.prototype.render=function(){return l(a),a()};var d=s.createElement(f),h={emptyElement:d,injection:p,isNullComponentID:i};e.exports=h},function(e,t){"use strict";var n={currentlyMountingInstance:null,currentlyUnmountingInstance:null};e.exports=n},function(e,t,n){"use strict";var r=n(81),o=r({prop:null,context:null,childContext:null});e.exports=o},function(e,t,n){"use strict";function r(e){e!==i.currentlyMountingInstance&&l.enqueueUpdate(e)}function o(e,t){p(null==a.current);var n=u.get(e);return n?n===i.currentlyUnmountingInstance?null:n:null}var i=n(155),a=n(40),s=n(9),u=n(65),l=n(29),c=n(7),p=n(4),f=(n(8),{enqueueCallback:function(e,t){p("function"==typeof t);var n=o(e);return n&&n!==i.currentlyMountingInstance?(n._pendingCallbacks?n._pendingCallbacks.push(t):n._pendingCallbacks=[t],void r(n)):null},enqueueCallbackInternal:function(e,t){p("function"==typeof t),e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=o(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=o(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=o(e,"setState");if(n){var i=n._pendingStateQueue||(n._pendingStateQueue=[]);i.push(t),r(n)}},enqueueSetProps:function(e,t){var n=o(e,"setProps");if(n){p(n._isTopLevel);var i=n._pendingElement||n._currentElement,a=c({},i.props,t);n._pendingElement=s.cloneAndReplaceProps(i,a),r(n)}},enqueueReplaceProps:function(e,t){var n=o(e,"replaceProps");if(n){p(n._isTopLevel);var i=n._pendingElement||n._currentElement;n._pendingElement=s.cloneAndReplaceProps(i,t),r(n)}},enqueueElementInternal:function(e,t){e._pendingElement=t,r(e)}});e.exports=f},function(e,t,n){"use strict";function r(e,t){if(o(null!=t),null==e)return t;var n=Array.isArray(e),r=Array.isArray(t);return n&&r?(e.push.apply(e,t),e):n?(e.push(t),e):r?[e].concat(t):[e,t]}var o=n(4);e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=i.mergeProps(t,e.props);return!n.hasOwnProperty(s)&&e.props.hasOwnProperty(s)&&(n.children=e.props.children),o.createElement(e.type,n)}var o=n(9),i=n(544),a=n(34),s=(n(8),a({children:null}));e.exports=r},function(e,t,n){"use strict";function r(e){return"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}).join(" "):Array.prototype.join.call(arguments," ")}n(8),e.exports=r},function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};e.exports=n},function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=n},function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(e){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=n},function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e,t){var n;if((null===e||e===!1)&&(e=a.emptyElement),"object"==typeof e){var o=e;n=t===o.type&&"string"==typeof o.type?s.createInternalComponent(o):r(o.type)?new o.type(o):new c}else"string"==typeof e||"number"==typeof e?n=s.createInstanceForText(e):l(!1);return n.construct(e),n._mountIndex=0,n._mountImage=null,n}var i=n(524),a=n(154),s=n(105),u=n(7),l=n(4),c=(n(8),function(){});u(c.prototype,i.Mixin,{_instantiateReactComponent:o}),e.exports=o},function(e,t,n){"use strict";/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(16);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t,n){"use strict";var r=n(16),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML="\ufeff"+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=a},function(e,t,n){"use strict";function r(e,t){if(null!=e&&null!=t){var n=typeof e,r=typeof t;if("string"===n||"number"===n)return"string"===r||"number"===r;if("object"===r&&e.type===t.type&&e.key===t.key){var o=e._owner===t._owner;return o}}return!1}n(8),e.exports=r},function(e,t,n){"use strict";var r=n(10),o=(r.addons.update,n(94),r.createClass({displayName:"CheckList",render:function(){var e=this;return r.createElement("div",null,this.props.items.map(function(t){return r.createElement("p",{key:t},r.createElement("label",null,r.createElement("input",{onChange:e._toggleItem.bind(e,t),checked:e.props.selected&&-1!==e.props.selected.indexOf(t),type:"checkbox"})," ",t))}))},_toggleItem:function(e){var t=this.props.selected.indexOf(e),n=this.props.selected.slice();-1===t?n.push(e):n.splice(t,1),this.props.onChange(n)}}));e.exports=o},function(e,t,n){"use strict";var r=n(10),o=(n(82),r.addons.update),i=n(47),a=n(98),s=r.createClass({displayName:"CustomChoiceField",getInitialState:function(){return{choices:this.props.choices||["","",""],questionText:this.props.questionText||""}},render:function(){var e,t=this,n=this.state.choices.map(function(e,n){var o,s;return n>0&&(o=r.createElement("button",{onClick:t._moveUp.bind(t,n),className:"btn btn-primary",ariaLabel:"Move up"},r.createElement(a,{glyph:"arrow-up"}))),n<t.state.choices.length-1&&(s=r.createElement("button",{onClick:t._moveDown.bind(t,n),className:"btn btn-primary",ariaLabel:"Move down"},r.createElement(a,{glyph:"arrow-down"}))),r.createElement("div",{key:n},r.createElement("input",{type:"text",value:e,onChange:t._updateChoice.bind(t,n),placeholder:"Choice "+(n+1)}),r.createElement(i,{onClick:t._removeChoice.bind(t,n),bsStyle:"danger",ariaLabel:"Remove choice"},r.createElement(a,{glyph:"remove"})),o,s)});return this.state.questionText&&this._areChoicesValid()&&(e=r.createElement("button",{onClick:this._save},"Done")),r.createElement("div",{className:"well"},r.createElement("p",null,this.props.questionText?"Edit":"Add"," choice field"),r.createElement("input",{type:"text",value:this.state.questionText,onChange:this._updateQuestionText,placeholder:"Enter question text"}),n,r.createElement(i,{onClick:this._addChoice,bsStyle:"success",ariaLabel:"Add choice"},r.createElement(a,{glyph:"plus"})),e)},_updateQuestionText:function(e){this.setState({questionText:e.target.value})},_updateChoice:function(e,t){var n={};n[e]={$set:t.target.value},this.setState(o(this.state,{choices:n}))},_addChoice:function(){this.setState(o(this.state,{choices:{$push:[""]}}))},_moveUp:function(e){var t=this.state.choices.slice(0,e-1),n=this.state.choices[e],r=this.state.choices[e-1],o=this.state.choices.slice(e+1,this.state.choices.length),i=t.concat([n,r]);i=i.concat(o),this.setState({choices:i})},_moveDown:function(e){var t=this.state.choices.slice(0,e),n=this.state.choices[e],r=this.state.choices[e+1],o=this.state.choices.slice(e+2,this.state.choices.length),i=t.concat([r,n]);i=i.concat(o),this.setState({choices:i})},_removeChoice:function(e){this.setState(o(this.state,{choices:{$splice:[[e,1]]}}))},_areChoicesValid:function(){return this._hasAtLeastTwoChoices()&&!this._hasBlankChoiceInTheMiddle()},_hasAtLeastTwoChoices:function(){return this.state.choices.filter(function(e){return""!==e}).length>1},_hasBlankChoiceInTheMiddle:function(){for(var e=!1,t=this.state.choices,n=0;n<t.length;n+=1){if(e&&t[n])return!0;t[n]||(e=!0)}return!1},_save:function(){this.props.onSave(this.state.questionText,this.state.choices),this.setState(this.getInitialState())}});e.exports=s},function(e,t,n){"use strict";var r,o=n(12),i=n(30),a=n(18).EventEmitter,s=n(13),u=i.ActionTypes,l="change",c=[],p=s({},a.prototype,{emitChange:function(){this.emit(l)},addChangeListener:function(e){this.on(l,e)},removeChangeListener:function(e){this.removeListener(l,e)},getAll:function(){return c},get:function(e){var t=c.findIndex(function(t){return t.slug===e});return c[t]},getCurrentID:function(){return r}});p.dispatchToken=o.register(function(e){switch(e.type){case u.RECEIVE_CHATROOMS:c=e.rooms,p.emitChange();break;case u.CREATE_ROOM2:c.splice(0,0,e.room),p.emitChange();break;case u.UPDATE_ROOM:var t=p.get(e.room);t.isPending=!0,p.emitChange();break;case u.UPDATE_ROOM_SUCESS:var t=p.get(e.room);s(t,e.update),t.isPending=!1,p.emitChange();break;case u.UPDATE_ROOM_FAILURE:var t=p.get(e.room);t.isPending=!1,t.failed=!0,p.emitChange();break;case u.UPDATE_ROOM_REVERT:var t=p.get(e.room);t.isPending=!1,t.failed=!1,p.emitChange();break;case u.DELETE_ROOM:var t=p.get(e.room);t.isDeleting=!0,p.emitChange();break;case u.DELETE_ROOM_SUCCESS:console.log("room deleted successfully");var n=c.findIndex(function(t){return t.slug===e.room});console.log("removing room",n),c.splice(n,1),p.emitChange();break;case u.CHANGE_ROOM:r=e.room,p.emitChange()}}),e.exports=p},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(53),a=n(45),s=o.ActionTypes;e.exports={changeChatroom:function(e){var t=e.split("/"),n=t[t.length-2];if("chatroom"!==n){var o=n+"@muc."+Strophe.getDomainFromJid(chatConf.me);i.joinChatroom(o),r.dispatch({type:s.CHANGE_CHATROOM,roomJID:o,roomID:n})}},changePrivateChat:function(e){e=decodeURIComponent(e);var t,n=e.split("/"),o=n[n.length-2];if(5===n.length){var u=a.getMessageOther(o);t="messages"===n[n.length-3]?"message":"session",i.addFriend(u),i.startSession(o,[Strophe.getNodeFromJid(chatConf.me),u]),r.dispatch({type:s.CHANGE_PRIVATE_CHAT,threadType:t,threadID:o})}else t="messages"===n[n.length-2]?"message":"session",r.dispatch({type:s.CHANGE_PRIVATE_CHAT_TYPE,threadType:t})}}},function(e,t,n){"use strict";function r(){return{userProfiles:a.get()}}var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=n(116),s=n(113),u=i.createClass({displayName:"AvatarContainer",propTypes:{username:i.PropTypes.string.isRequired},getInitialState:function(){return r()},componentDidMount:function(){a.addChangeListener(this._onChange)},componentWillUnmount:function(){a.removeChangeListener(this._onChange)},render:function(){var e=this.state.userProfiles[this.props.username];return e?i.createElement(s,o({},this.props,{avatar:e.avatar})):null},_onChange:function(){this.setState(r())}});e.exports=u},function(e,t,n){"use strict";var r=n(290),o=n(1),i=n(11),a=13,s=o.createClass({displayName:"MessageComposer",propTypes:{threadID:o.PropTypes.string.isRequired,isGroup:o.PropTypes.bool},getInitialState:function(){return{text:""}},componentDidMount:function(){this.composedMessageChangeAt=null},componentWillUnmount:function(){this._timeout&&clearTimeout(this._timeout)},render:function(){return o.createElement("textarea",{className:"message-composer form-control",name:"message",value:this.state.text,onChange:this._onChange,onKeyDown:this._onKeyDown})},_onChange:function(e,t){r.startTyping(this.props.threadID),this.composedMessageChangeAt=new Date,this._timeout=setTimeout(this._checkImStillTyping,i.stillTypingTimeout),this.setState({text:e.target.value})},_onKeyDown:function(e){if(e.keyCode===a){e.preventDefault();var t=this.state.text.trim();t&&(this.composedMessageChangeAt=null,r.createMessage(t,this.props.threadID,this.props.isGroup)),this.setState({text:""})}},_checkImStillTyping:function(){if(this.composedMessageChangeAt){var e=new Date;e-this.composedMessageChangeAt>i.stillTypingTimeout?(this.composedMessageChangeAt=null,r.stopTyping(this.props.threadID)):this._timeout=setTimeout(this._checkImStillTyping,i.stillTypingTimeout)}}});e.exports=s},function(e,t,n){"use strict";var r=n(1),o=r.PropTypes,i=n(177),a=n(68),s=n(173),u=r.createClass({displayName:"MessageListItem",propTypes:{message:o.object},render:function(){var e=this.props.message;return r.createElement("div",{className:"media"},r.createElement("div",{className:"media-left"},r.createElement(s,{username:e.authorName,size:25})),r.createElement("div",{className:"media-body"},r.createElement("div",{className:"media-heading clearfix"},r.createElement("p",{style:{"float":"left"}},r.createElement("small",{className:"messageAuthor"},r.createElement("b",null,e.authorName)," ",r.createElement("i",null,"[",r.createElement(i,{user:e.authorName}),"]"))),r.createElement("p",{style:{"float":"right"}},r.createElement("small",{className:"messageTimestamp"},r.createElement(a,{when:e.date})))),e.text))}});e.exports=u},function(e,t,n){"use strict";function r(){return{messages:u.getAllForCurrentThread(),thread:c.getCurrent(),whosTyping:p.getForCurrentThread()}}function o(e){return l.createElement(a,{key:e.id,message:e})}var i=n(174),a=n(175),s=n(299),u=n(83),l=n(1),c=n(31),p=n(302),f=n(119),d=l.createClass({displayName:"MessageSection",mixins:[f],getInitialState:function(){return r()},componentDidMount:function(){u.addChangeListener(this._onChange),c.addChangeListener(this._onChange),p.addChangeListener(this._onChange)},componentWillUnmount:function(){u.removeChangeListener(this._onChange),c.removeChangeListener(this._onChange),p.removeChangeListener(this._onChange)},render:function(){if(this.state.thread&&this.state.thread.isEnded&&null===this.state.thread.rating)return null;var e,t=this.state.messages.map(o);return this.state.thread&&this.state.thread.id&&(e={height:this.state.height}),l.createElement("div",{className:"message-section"},e?l.createElement("ul",{style:e,className:"message-list",ref:"messageList"},t):null,l.createElement(s,{users:this.state.whosTyping}),this.state.thread&&!this.state.thread.isEnded?l.createElement(i,{threadID:this.state.thread.id,isGroup:this.props.isGroup}):null)},componentDidUpdate:function(){this._scrollToBottom()},_scrollToBottom:function(){if(this.refs.messageList){var e=this.refs.messageList.getDOMNode();e.scrollTop=e.scrollHeight}},_onChange:function(){this.setState(r())}});e.exports=d},function(e,t,n){"use strict";function r(){return{userProfiles:i.get()}}var o=n(1),i=n(116),a="/"+DITTO.tenant+"/about/",s=o.createClass({displayName:"Role",getInitialState:function(){return r()},componentDidMount:function(){i.addChangeListener(this._onChange)},componentWillUnmount:function(){i.removeChangeListener(this._onChange)},render:function(){var e,t=this.state.userProfiles[this.props.user];return e=t?t.role:"-",o.createElement("a",{href:a+"#"+e},e)},_onChange:function(){this.setState(r())}});e.exports=s},function(e,t,n){"use strict";var r=n(10),o=n(11),i=n(53),a=r.createClass({displayName:"SetMyStatus",getInitialState:function(){return{prevStatus:{status:"",message:""},status:"",message:""}},handleMessageChange:function(e){this.setState({message:e.target.value})},handleStatusChange:function(e){e.preventDefault();var t=this.refs.message.getDOMNode().value.trim(),n=this.refs.status.getDOMNode().value;i.setStatus(n,t),this.setState({prevStatus:{status:n,message:t}})},render:function(){var e=[],t=this._isChanged(),n=r.addons.classSet({"form-control":!0,btn:!0,"col-md-6":!0,"btn-success":t,"btn-disabled":!t});for(var i in o.chatStatus)e.push(r.createElement("option",{value:i,key:i},o.chatStatus[i]));return r.createElement("form",{className:"form-horizontal",onSubmit:this.handleStatusChange},r.createElement("div",{className:"form-group"},r.createElement("div",{className:"col-md-6"},r.createElement("input",{className:"form-control",value:this.state.message,onChange:this.handleMessageChange,type:"text",placeholder:"Custom status...",ref:"message"})),r.createElement("div",{className:"col-md-6"},r.createElement("select",{value:this.state.status,onChange:this._updateStatus,className:"form-control",ref:"status"},r.createElement("option",{value:""},"Online"),e))),r.createElement("div",{className:"form-group"},r.createElement("div",{className:"col-md-6"},r.createElement("input",{disabled:!this._isChanged(),className:n,type:"submit",value:"Set status"}))))},_updateStatus:function(e){this.setState({status:e.target.value})},_isChanged:function(){return this.state.status!==this.state.prevStatus.status||this.state.message!==this.state.prevStatus.message}});e.exports=a},function(e,t,n){"use strict";function r(){return{status:i.get()}}var o=n(1),i=n(300),a=(n(11),n(297)),s=o.createClass({displayName:"Status",getInitialState:function(){return r()},componentDidMount:function(){i.addChangeListener(this._onChange)},componentWillUnmount:function(){i.removeChangeListener(this._onChange)},render:function(){var e,t,n=this.state.status[this.props.user];return n&&n.hasOwnProperty("code")?(e=n.code||"online",t=n.message):e="offline",o.createElement(a,{code:e,message:t})},_onChange:function(){this.setState(r())}});e.exports=s},function(e,t,n){"use strict";function r(){return{threads:s.getAllChrono(),currentThreadID:s.getCurrentID(),currentChatID:s.getCurrentChatID(),currentSessionID:s.getCurrentSessionID(),unreadCount:u.getCount(),threadType:s.getThreadType()}}var o=n(28),i=n(1),a=(n(83),n(298)),s=n(31),u=n(181),l=n(119),c=(n(52),n(19)),p=i.createClass({displayName:"ThreadSection",mixins:[l],getInitialState:function(){return r()},componentDidMount:function(){s.addChangeListener(this._onChange),u.addChangeListener(this._onChange)},componentWillUnmount:function(){s.removeChangeListener(this._onChange),u.removeChangeListener(this._onChange)},render:function(){var e={height:this.state.height,overflowY:"scroll"},t=this.state.threads.map(function(e){return i.createElement(a,{key:e.id,thread:e,currentThreadID:this.state.currentThreadID,threadType:this.state.threadType})},this),n=0===this.state.unreadCount?null:i.createElement("span",null,"Unread threads: ",this.state.unreadCount);return i.createElement("div",{className:"thread-section"},i.createElement("ul",{className:"nav nav-tabs"},i.createElement("li",{role:"presentation",className:this.state.threadType===s.message?"active":""},this.state.currentChatID?i.createElement(o.Link,{to:c.message(this.state.currentChatID)},"My chats"):i.createElement(o.Link,{to:c.messages()},"My chats")),i.createElement("li",{role:"presentation",className:this.state.threadType===s.session?"active":""},this.state.currentSessionID?i.createElement(o.Link,{to:c.session(this.state.currentSessionID)},"My sessions"):i.createElement(o.Link,{to:c.sessions()},"My sessions"))),i.createElement("div",{className:"thread-count"},n),i.createElement("div",{className:"list-group",style:e},t),this.state.threadType===s.session&&this.state.currentSessionID?i.createElement(o.Link,{className:"btn btn-primary",to:c.sessions()},"New session"):null,this.state.threadType!==s.session&&this.state.currentChatID?i.createElement(o.Link,{className:"btn btn-primary",to:c.messages()},"New chat"):null)},_onChange:function(){this.setState(r())}});e.exports=p},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(18).EventEmitter,a=n(83),s=n(31),u=n(13),l=o.ActionTypes,c="change",p=u({},i.prototype,{emitChange:function(){this.emit(c)},addChangeListener:function(e){this.on(c,e)},removeChangeListener:function(e){this.removeListener(c,e)},getCount:function(){var e=s.getAll(),t=0;for(var n in e)e[n].lastMessage&&!e[n].lastMessage.isRead&&t++;return t}});p.dispatchToken=r.register(function(e){switch(r.waitFor([s.dispatchToken,a.dispatchToken]),e.type){case l.CHANGE_PRIVATE_CHAT:p.emitChange();break;case l.RECEIVE_RAW_MESSAGES:p.emitChange();break;case l.RECEIVE_RAW_PRIVATE_MESSAGE:r.waitFor([s.dispatchToken]),p.emitChange()}}),e.exports=p},function(e,t,n){"use strict";var r=n(10),o=n(84),i=r.createClass({displayName:"Text",render:function(){}});i.Displayer=r.createClass({displayName:"Displayer",propTypes:{questionText:r.PropTypes.string,isRequired:r.PropTypes.bool},render:function(){return r.createElement("p",null,r.createElement("label",null,this.props.questionText,this.props.isRequired?"*":"",r.createElement("input",{type:"text"})))}}),i.Editor=r.createClass({displayName:"Editor",mixins:[r.addons.LinkedStateMixin],propTypes:{questionText:r.PropTypes.string,isRequired:r.PropTypes.bool,onSave:r.PropTypes.func},getInitialState:function(){return{config:{questionText:this.props.questionText||"",isRequired:this.props.hasOwnProperty("isRequired")?this.props.isRequired:!1}}},render:function(){var e;return this.state.config.questionText&&(e=r.createElement("button",{onClick:this._onSave},"Done")),r.createElement(o,{state:this.state.config,onUndo:this._unredo,onRedo:this._unredo},r.createElement("p",null,r.createElement("label",null,"Enter question text:",r.createElement("input",{autoFocus:!0,type:"text",value:this.state.config.questionText,onChange:this._updateText})),r.createElement("br",null),r.createElement("label",null,"Required?",r.createElement("input",{type:"checkbox",value:this.state.config.isRequired,onChange:this._updateRequired}))),e)},_updateText:function(e){this.setState(r.addons.update(this.state,{config:{questionText:{$set:e.target.value}}}))},_updateRequired:function(e){this.setState(r.addons.update(this.state,{config:{isRequired:{$set:e.target.checked}}}))},_unredo:function(e){this.setState({config:e})},_onSave:function(){this.props.onSave({questionText:this.state.config.questionText,isRequired:this.state.config.isRequired})}}),e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),a(t,[{key:"render",value:function(){var e="/"+DITTO.tenant+"/users/"+this.props.username+"/";return l["default"].createElement("a",{href:e},this.props.children)}}]),t}(l["default"].Component);t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a={caseNotes:i["default"].PropTypes.arrayOf(i["default"].PropTypes.shape({author:i["default"].PropTypes.string.isRequired,created_at:i["default"].PropTypes.string.isRequired,title:i["default"].PropTypes.string.isRequired}))};t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},l=n(386),c=r(l),p=n(1),f=r(p),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={value:this.props.children.props.value,errors:null}}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this.setState({errors:this._validate(this.state.value)})}},{key:"componentWillReceiveProps",value:function(e){var t=e.children.props.value,n=null;(""!==t||this.state.errors)&&(n=this._validate(t)),this.setState({value:t,errors:n})}},{key:"render",value:function(){var e=void 0,t=void 0;null!==this.state.errors&&(t=this.state.errors.length?"remove":"ok",e=this.state.errors.length?"error":"success");var n=c["default"]("form-group",o({"has-feedback":e},"has-"+e,e)),r=c["default"]("glyphicon","form-control-feedback","glyphicon-"+t),i="inputStatus-"+this.props.id,a=f["default"].cloneElement(this.props.children,{id:this.props.id,"aria-describedby":i,value:this.state.value,onChange:this._onChange.bind(this),onBlur:this._onBlur.bind(this)});return f["default"].createElement("div",{className:n},f["default"].createElement("label",{className:"control-label",htmlFor:this.props.id},this.props.id),a,t?f["default"].createElement("span",{className:r,"aria-hidden":"true"}):null,t?f["default"].createElement("span",{id:i,className:"sr-only"},"(",e,")"):null,this.state.errors&&this.state.errors.map(function(e){return f["default"].createElement("p",{key:e[0],className:"help-block"},e[1])}))}},{key:"_onChange",value:function(e){var t=e.target.value;this.state.wasBlurred||""!==this.props.children.props.value?this.setState({value:t},this._pendValidation.bind(this,t)):this.setState({value:t}),this.props.children.props.onChange(e)}},{key:"_onBlur",value:function(e){var t=e.target.value;this.setState({value:t,errors:this._validate(t),wasBlurred:!0})}},{key:"_pendValidation",value:function(e){var t=this;this._pendingValidaton&&clearTimeout(this._pendingValidaton),this._pendingValidaton=setTimeout(function(){t.setState({errors:t._validate(e)})},this.props.typingDelay)}},{key:"_validate",value:function(e){var t=[];if(this.props.isRequired&&""===e&&t.push(["isRequired",this._errorMsg("isRequired")]),this.props.maxWords&&""!==e){var n=e.trim().split(/\s+/);console.log("word count",n.length),n.length>this.props.maxWords&&t.push(["maxWords",this._errorMsg("maxWords")(this.props.maxWords)])}return this._isValidationStateChanged(t)&&this.props.onChange&&this.props.onChange(!t.length),t}},{key:"_isValidationStateChanged",value:function(e){return null===this.state.errors||!e.length!=!this.state.errors.length}},{key:"_errorMsg",value:function(e){return this.props.messages[e]}}],[{key:"propTypes",value:{id:f["default"].PropTypes.string.isRequired,isRequired:f["default"].PropTypes.bool,maxWords:f["default"].PropTypes.number,onChange:f["default"].PropTypes.func,typingDelay:f["default"].PropTypes.number,messages:f["default"].PropTypes.shape({isRequired:f["default"].PropTypes.string})},enumerable:!0},{key:"defaultProps",value:{typingDelay:300,messages:{isRequired:"Please enter a value",maxWords:function(e){return"Please enter at most "+e+" words"}}},enumerable:!0}]),t}(f["default"].Component);t["default"]=d,e.exports=t["default"]},function(e,t,n){var r=n(2);e.exports=function(e){return function(t,n,o){var i,a=r.toObject(t),s=r.toLength(a.length),u=r.toIndex(o,s);if(e&&n!=n){for(;s>u;)if(i=a[u++],i!=i)return!0}else for(;s>u;u++)if((e||u in a)&&a[u]===n)return e||u;return!e&&-1}}},function(e,t,n){"use strict";function r(e,t){if(!d(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!p(e,v)){if(!m(e))return"F";if(!t)return"E";h(e,v,++C)}return"O"+e[v]}function o(e,t){var n,o=r(t);if("F"!==o)return e[g][o];for(n=e[b];n;n=n.n)if(n.k==t)return n}var i=n(2),a=n(44),s=n(32).safe,u=n(17),l=n(69),c=n(35).step,p=i.has,f=i.set,d=i.isObject,h=i.hide,m=Object.isExtensible||d,v=s("id"),g=s("O1"),y=s("last"),b=s("first"),_=s("iter"),E=i.DESC?s("size"):"size",C=0;e.exports={getConstructor:function(e,t,r,s){var c=e(function(e,n){u.inst(e,c,t),f(e,g,i.create(null)),f(e,E,0),f(e,y,void 0),f(e,b,void 0),void 0!=n&&l(n,r,e[s],e)});return n(88)(c.prototype,{clear:function(){for(var e=this,t=e[g],n=e[b];n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e[b]=e[y]=void 0,e[E]=0},"delete":function(e){var t=this,n=o(t,e);if(n){var r=n.n,i=n.p;delete t[g][n.i],n.r=!0,i&&(i.n=r),r&&(r.p=i),t[b]==n&&(t[b]=r),t[y]==n&&(t[y]=i),t[E]--}return!!n},forEach:function(e){for(var t,n=a(e,arguments[1],3);t=t?t.n:this[b];)for(n(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!o(this,e)}}),i.DESC&&i.setDesc(c.prototype,"size",{get:function(){return u.def(this[E])}}),c},def:function(e,t,n){var i,a,s=o(e,t);return s?s.v=n:(e[y]=s={i:a=r(t,!0),k:t,v:n,p:i=e[y],n:void 0,r:!1},e[b]||(e[b]=s),i&&(i.n=s),e[E]++,"F"!==a&&(e[g][a]=s)),e},getEntry:o,setIter:function(e,t,r){n(120)(e,t,function(e,t){f(this,_,{o:e,k:t})},function(){for(var e=this[_],t=e.k,n=e.l;n&&n.r;)n=n.p;return e.o&&(e.l=n=n?n.n:e.o[b])?"keys"==t?c(0,n.k):"values"==t?c(0,n.v):c(0,[n.k,n.v]):(e.o=void 0,c(1))},r?"entries":"values",!r,!0)}}},function(e,t,n){var r=n(5),o=n(69);e.exports=function(e){r(r.P,e,{toJSON:function(){var e=[];return o(this,!1,e.push,e),e}})}},function(e,t,n){"use strict";function r(e,t){return y(e.array,function(e){return e[0]===t})}function o(e){return e[v]||p(e,v,{array:[],get:function(e){var t=r(this,e);return t?t[1]:void 0},has:function(e){return!!r(this,e)},set:function(e,t){var n=r(this,e);n?n[1]=t:this.array.push([e,t])},"delete":function(e){var t=b(this.array,function(t){return t[0]===e});return~t&&this.array.splice(t,1),!!~t}})[v]}var i=n(2),a=n(32).safe,s=n(17),u=n(69),l=i.has,c=i.isObject,p=i.hide,f=Object.isExtensible||c,d=0,h=a("id"),m=a("weak"),v=a("leak"),g=n(85),y=g(5),b=g(6);e.exports={getConstructor:function(e,t,r,a){var p=e(function(e,n){i.set(s.inst(e,p,t),h,d++),void 0!=n&&u(n,r,e[a],e)});return n(88)(p.prototype,{"delete":function(e){return c(e)?f(e)?l(e,m)&&l(e[m],this[h])&&delete e[m][this[h]]:o(this)["delete"](e):!1},has:function(e){return c(e)?f(e)?l(e,m)&&l(e[m],this[h]):o(this).has(e):!1}}),p},def:function(e,t,n){return f(s.obj(t))?(l(t,m)||p(t,m,{}),t[m][e[h]]=n):o(e).set(t,n),e},leakStore:o,WEAK:m,ID:h}},function(e,t,n){var r=n(2),o=r.g.document,i=r.isObject,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,n){var r=n(2);e.exports=function(e){var t=r.getKeys(e),n=r.getDesc,o=r.getSymbols;return o&&r.each.call(o(e),function(r){n(e,r).enumerable&&t.push(r)}),t}},function(e,t,n){function r(e){try{return a(e)}catch(t){return s.slice()}}var o=n(2),i={}.toString,a=o.getNames,s="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.get=function(e){return s&&"[object Window]"==i.call(e)?r(e):a(o.toObject(e))}},function(e,t,n){function r(e){var t=e["return"];void 0!==t&&i(t.call(e))}function o(e,t,n,o){try{return o?t(i(n)[0],n[1]):t(n)}catch(a){throw r(e),a}}var i=n(17).obj;o.close=r,e.exports=o},function(e,t,n){var r=n(2),o=n(17).obj;e.exports=function(e){o(e);var t=r.getNames(e),n=r.getSymbols;return n?t.concat(n(e)):t}},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},function(e,t,n){var r=n(2),o=n(197);e.exports=function(e,t,n,i){var a=String(r.assertDefined(e));if(void 0===t)return a;var s=r.toInteger(t),u=s-a.length;if(0>u||u===1/0)throw new RangeError("Cannot satisfy string length "+t+" for string: "+a);var l=void 0===n?" ":String(n),c=o.call(l,Math.ceil(u/l.length));return c.length>u&&(c=i?c.slice(c.length-u):c.slice(0,u)),i?c.concat(a):a.concat(c)}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e){var t=String(r.assertDefined(this)),n="",o=r.toInteger(e);if(0>o||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t,n){"use strict";function r(){var e=+this;if(u.has(E,e)){var t=E[e];delete E[e],t()}}function o(e){r.call(e.data)}var i,a,s,u=n(2),l=n(44),c=n(20),p=n(87),f=n(190),d=u.g,h=u.isFunction,m=u.html,v=d.process,g=d.setImmediate,y=d.clearImmediate,b=d.MessageChannel,_=0,E={},C="onreadystatechange";h(g)&&h(y)||(g=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return E[++_]=function(){p(h(e)?e:Function(e),t)},i(_),_},y=function(e){delete E[e]},"process"==c(v)?i=function(e){v.nextTick(l(r,e,1))}:d.addEventListener&&h(d.postMessage)&&!d.importScripts?(i=function(e){d.postMessage(e,"*")},d.addEventListener("message",o,!1)):h(b)?(a=new b,s=a.port2,a.port1.onmessage=o,i=l(s.postMessage,s,1)):i=C in f("script")?function(e){m.appendChild(f("script"))[C]=function(){m.removeChild(this),r.call(e)}}:function(e){setTimeout(l(r,e,1),0)}),e.exports={set:g,clear:y}},function(e,t,n){var r=n(2),o=n(55),i=n(32).safe("iter"),a=n(35),s=a.step,u=a.Iterators;n(120)(Array,"Array",function(e,t){r.set(this,i,{o:r.toObject(e),i:0,k:t})},function(){var e=this[i],t=e.o,n=e.k,r=e.i++;return!t||r>=t.length?(e.o=void 0,s(1)):"keys"==n?s(0,r):"values"==n?s(0,t[r]):s(0,[r,t[r]])},"values"),u.Arguments=u.Array,o("keys"),o("values"),o("entries")},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(388),a=n(406),s=n(210),u=function(){function e(t,n,o){r(this,e),this._isDragging=!1,this._animationFrameID=null,this._domNode=o,this._onMove=t,this._onMoveEnd=n,this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._didMouseMove=this._didMouseMove.bind(this)}return o(e,[{key:"captureMouseMoves",value:function(e){this._eventMoveToken||this._eventUpToken||(this._eventMoveToken=i.listen(this._domNode,"mousemove",this._onMouseMove),this._eventUpToken=i.listen(this._domNode,"mouseup",this._onMouseUp)),this._isDragging||(this._deltaX=0,this._deltaY=0,this._isDragging=!0,this._x=e.clientX,this._y=e.clientY),e.preventDefault()}},{key:"releaseMouseMoves",value:function(){this._eventMoveToken&&this._eventUpToken&&(this._eventMoveToken.remove(),this._eventMoveToken=null,this._eventUpToken.remove(),this._eventUpToken=null),null!==this._animationFrameID&&(a(this._animationFrameID),this._animationFrameID=null),this._isDragging&&(this._isDragging=!1,this._x=null,this._y=null)}},{key:"isDragging",value:function(){return this._isDragging}},{key:"_onMouseMove",value:function(e){var t=e.clientX,n=e.clientY;this._deltaX+=t-this._x,this._deltaY+=n-this._y,null===this._animationFrameID&&(this._animationFrameID=s(this._didMouseMove)),this._x=t,this._y=n,e.preventDefault()}},{key:"_didMouseMove",value:function(){this._animationFrameID=null,this._onMove(this._deltaX,this._deltaY),
this._deltaX=0,this._deltaY=0}},{key:"_onMouseUp",value:function(){this._animationFrameID&&this._didMouseMove(),this._onMoveEnd()}}]),e}();e.exports=u},function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r},function(e,t,n){"use strict";var r=n(26),o=r.PropTypes,i=r.createClass({displayName:"FixedDataTableColumn",statics:{__TableColumn__:!0},propTypes:{align:o.oneOf(["left","center","right"]),headerClassName:o.string,footerClassName:o.string,cellClassName:o.string,cellRenderer:o.func,cellDataGetter:o.func,dataKey:o.oneOfType([o.string,o.number]).isRequired,fixed:o.bool,headerRenderer:o.func,footerRenderer:o.func,columnData:o.object,label:o.string,width:o.number.isRequired,minWidth:o.number,maxWidth:o.number,flexGrow:o.number,isResizable:o.bool,allowCellsRecycling:o.bool},getDefaultProps:function(){return{allowCellsRecycling:!1,fixed:!1}},render:function(){return null}});e.exports=i},function(e,t,n){"use strict";var r=n(26),o=r.PropTypes,i=r.createClass({displayName:"FixedDataTableColumnGroup",statics:{__TableColumnGroup__:!0},propTypes:{align:o.oneOf(["left","center","right"]),fixed:o.bool,columnGroupData:o.object,label:o.string,groupHeaderRenderer:o.func},getDefaultProps:function(){return{fixed:!1}},render:function(){return null}});e.exports=i},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(26),i=n(56),a=n(392),s=n(46),u=n(91),l=n(70),c=o.PropTypes,p=o.createClass({displayName:"FixedDataTableRowImpl",mixins:[i],propTypes:{data:c.oneOfType([c.object,c.array]),fixedColumns:c.array.isRequired,height:c.number.isRequired,index:c.number.isRequired,scrollableColumns:c.array.isRequired,scrollLeft:c.number.isRequired,width:c.number.isRequired,onClick:c.func,onDoubleClick:c.func,onColumnResize:c.func},render:function(){var e={width:this.props.width,height:this.props.height},t=s({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),n=-1===this.props.index;if(!this.props.data&&!n)return o.createElement("div",{className:u(t,this.props.className),style:e});var r=this._getColumnsWidth(this.props.fixedColumns),i=o.createElement(a,{key:"fixed_cells",height:this.props.height,left:0,width:r,zIndex:2,columns:this.props.fixedColumns,data:this.props.data,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),l=this._renderColumnsShadow(r),c=o.createElement(a,{key:"scrollable_cells",height:this.props.height,left:this.props.scrollLeft,offsetLeft:r,width:this.props.width-r,zIndex:0,columns:this.props.scrollableColumns,data:this.props.data,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return o.createElement("div",{className:u(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},o.createElement("div",{className:s("fixedDataTableRowLayout/body")},i,c,l))},_getColumnsWidth:function(e){for(var t=0,n=0;n<e.length;++n)t+=e[n].props.width;return t},_renderColumnsShadow:function(e){if(e>0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),n={left:e,height:this.props.height};return o.createElement("div",{className:t,style:n})}},_onClick:function(e){this.props.onClick(e,this.props.index,this.props.data)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index,this.props.data)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index,this.props.data)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index,this.props.data)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index,this.props.data)}}),f=o.createClass({displayName:"FixedDataTableRow",mixins:[i],propTypes:{height:c.number.isRequired,zIndex:c.number,offsetTop:c.number.isRequired,width:c.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),o.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},o.createElement(p,r({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function i(e){c(e instanceof l,"ImmutableObject: Attempted to set fields on an object that is not an instance of ImmutableValue.")}function a(e,t){d(e,t);for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var i=r[o];t.hasOwnProperty(i)?h(e[i])||h(t[i])?n[i]=t[i]:n[i]=a(e[i],t[i]):n[i]=e[i]}var s=Object.keys(t);for(o=0;o<s.length;o++){var u=s[o];e.hasOwnProperty(u)||(n[u]=t[u])}return e instanceof l?new v(n):t instanceof l?new v(n):n}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1;var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},l=n(399),c=n(37),p=n(209),f=n(412),d=f.checkMergeObjectArgs,h=f.isTerminal,m=p({_DONT_EVER_TYPE_THIS_SECRET_KEY:null}),v=function(e){function t(){r(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,l[m]),l.mergeAllPropertiesInto(this,arguments)}return o(t,e),s(t,null,[{key:"create",value:function(){var e=Object.create(t.prototype);return t.apply(e,arguments),e}},{key:"set",value:function(e,n){return i(e),c("object"==typeof n&&void 0!==n&&!Array.isArray(n),"Invalid ImmutableMap.set argument `put`"),new t(e,n)}},{key:"setProperty",value:function(e,n,r){var o={};return o[n]=r,t.set(e,o)}},{key:"deleteProperty",value:function(e,n){var r={};for(var o in e)o!==n&&e.hasOwnProperty(o)&&(r[o]=e[o]);return new t(r)}},{key:"setDeep",value:function(e,t){return i(e),a(e,t)}},{key:"values",value:function(e){return Object.keys(e).map(function(t){return e[t]})}}]),t}(l);e.exports=v},function(e,t){"use strict";var n={isRTL:function(){return!1},getDirection:function(){return"LTR"}};e.exports=n},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(57),a=n(414),s=n(210),u=function(){function e(t,n,o,a){r(this,e),this._animationFrameID=null,this._deltaX=0,this._deltaY=0,this._didWheel=this._didWheel.bind(this),"function"!=typeof n&&(n=n?i.thatReturnsTrue:i.thatReturnsFalse),"function"!=typeof o&&(o=o?i.thatReturnsTrue:i.thatReturnsFalse),"function"!=typeof a&&(a=a?i.thatReturnsTrue:i.thatReturnsFalse),this._handleScrollX=n,this._handleScrollY=o,this._stopPropagation=a,this._onWheelCallback=t,this.onWheel=this.onWheel.bind(this)}return o(e,[{key:"onWheel",value:function(e){var t=a(e),n=this._deltaX+t.pixelX,r=this._deltaY+t.pixelY,o=this._handleScrollX(n,r),i=this._handleScrollY(r,n);if(o||i){this._deltaX+=o?t.pixelX:0,this._deltaY+=i?t.pixelY:0,e.preventDefault();var u;(0!==this._deltaX||0!==this._deltaY)&&(this._stopPropagation()&&e.stopPropagation(),u=!0),u===!0&&null===this._animationFrameID&&(this._animationFrameID=s(this._didWheel))}}},{key:"_didWheel",value:function(){this._animationFrameID=null,this._onWheelCallback(this._deltaX,this._deltaY),this._deltaX=0,this._deltaY=0}}]),e}();e.exports=u},function(e,t,n){"use strict";function r(e){for(var t=0;t<l.length;t++){var n=l[t]+e;if(n in p)return n}return null}function o(e){var t=a(e);if(void 0===u[t]){var n=t.charAt(0).toUpperCase()+t.slice(1);c.test(n)&&s(!1,"getVendorPrefixedName must only be called with unprefixedCSS property names. It was called with %s",e),u[t]=t in p?t:r(n)}return u[t]}var i=n(201),a=n(405),s=n(37),u={},l=["Webkit","ms","Moz","O"],c=new RegExp("^("+l.join("|")+")"),p=i.canUseDOM?document.createElement("div").style:{};e.exports=o},function(e,t){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){(function(t){"use strict";var r=n(57),o=n(413),i=0,a=o||function(e){var n=Date.now(),r=Math.max(0,16-(n-i));return i=n+r,t.setTimeout(function(){e(Date.now())},r)};a(r),e.exports=a}).call(t,function(){return this}())},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return o;if("undefined"==typeof t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)};case 5:return function(n,r,o,i,a){return e.call(t,n,r,o,i,a)}}return function(){return e.apply(t,arguments)}}var o=n(448);e.exports=r},function(e,t){function n(e,t){return e=+e,t=null==t?r:t,e>-1&&e%1==0&&t>e}var r=Math.pow(2,53)-1;e.exports=n},function(e,t,n){function r(e){var t=i(e)?e.length:void 0;return o(t)&&u.call(e)==a}var o=n(58),i=n(92),a="[object Arguments]",s=Object.prototype,u=s.toString;e.exports=r},function(e,t){(function(t){var n=Object.prototype,r=(r=t.window)&&r.document,o=n.propertyIsEnumerable,i={};!function(e){i.funcDecomp=/\bthis\b/.test(function(){return this}),i.funcNames="string"==typeof Function.name;try{i.dom=11===r.createDocumentFragment().nodeType}catch(t){i.dom=!1}try{i.nonEnumArgs=!o.call(arguments,1)}catch(t){i.nonEnumArgs=!0}}(0,0),e.exports=i}).call(t,function(){return this}())},function(e,t){function n(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&r()}function r(){if(!l){var e=setTimeout(n);l=!0;for(var t=u.length;t;){for(a=u,u=[];++c<t;)a[c].run();c=-1,t=u.length}a=null,l=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var a,s=e.exports={},u=[],l=!1,c=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new o(e,t)),1!==u.length||l||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=i,s.addListener=i,s.once=i,s.off=i,s.removeListener=i,s.removeAllListeners=i,s.emit=i,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(22),s=r(a),u=n(100),l=r(u),c={propTypes:{offset:i["default"].PropTypes.number,offsetTop:i["default"].PropTypes.number,offsetBottom:i["default"].PropTypes.number},getInitialState:function(){return{affixClass:"affix-top"}},getPinnedOffset:function(e){return this.pinnedOffset?this.pinnedOffset:(e.className=e.className.replace(/affix-top|affix-bottom|affix/,""),e.className+=e.className.length?" affix":"affix",this.pinnedOffset=s["default"].getOffset(e).top-window.pageYOffset,this.pinnedOffset)},checkPosition:function(){var e=void 0,t=void 0,n=void 0,r=void 0,o=void 0,a=void 0,u=void 0,l=void 0,c=void 0;this.isMounted()&&(e=i["default"].findDOMNode(this),t=document.documentElement.offsetHeight,n=window.pageYOffset,r=s["default"].getOffset(e),"top"===this.affixed&&(r.top+=n),o=null!=this.props.offsetTop?this.props.offsetTop:this.props.offset,a=null!=this.props.offsetBottom?this.props.offsetBottom:this.props.offset,(null!=o||null!=a)&&(null==o&&(o=0),null==a&&(a=0),u=null!=this.unpin&&n+this.unpin<=r.top?!1:null!=a&&r.top+e.offsetHeight>=t-a?"bottom":null!=o&&o>=n?"top":!1,this.affixed!==u&&(null!=this.unpin&&(e.style.top=""),l="affix"+(u?"-"+u:""),this.affixed=u,this.unpin="bottom"===u?this.getPinnedOffset(e):null,"bottom"===u&&(e.className=e.className.replace(/affix-top|affix-bottom|affix/,"affix-bottom"),c=t-a-e.offsetHeight-s["default"].getOffset(e).top),this.setState({affixClass:l,affixPositionTop:c}))))},checkPositionWithEventLoop:function(){setTimeout(this.checkPosition,0)},componentDidMount:function(){this._onWindowScrollListener=l["default"].listen(window,"scroll",this.checkPosition),this._onDocumentClickListener=l["default"].listen(s["default"].ownerDocument(this),"click",this.checkPositionWithEventLoop)},componentWillUnmount:function(){this._onWindowScrollListener&&this._onWindowScrollListener.remove(),this._onDocumentClickListener&&this._onDocumentClickListener.remove()},componentDidUpdate:function(e,t){t.affixClass===this.state.affixClass&&this.checkPositionWithEventLoop()}};t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(1),c=r(l),p=n(47),f=r(p),d=n(219),h=r(d),m=n(137),v=r(m),g=n(141),y=r(g),b=function(e){function t(){i(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),u(t,[{key:"renderFormGroup",value:function(e){var t=this.props,n=(t.bsStyle,t.value,o(t,["bsStyle","value"]));return c["default"].createElement(h["default"],n,e)}},{key:"renderInput",value:function(){var e=this.props,t=e.children,n=e.value,r=o(e,["children","value"]),i=t?t:n;return c["default"].createElement(f["default"],s({},r,{componentClass:"input",ref:"input",key:"input",value:i}))}}]),t}(v["default"]);b.types=["button","reset","submit"],b.defaultProps={type:"button"},b.propTypes={type:c["default"].PropTypes.oneOf(b.types),bsStyle:function(e){return null},children:y["default"],value:y["default"]},t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(457),i=r(o);t["default"]={Static:i["default"]},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),u=r(s),l=n(3),c=r(l),p=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),a(t,[{key:"render",value:function(){var e={"form-group":!this.props.standalone,"form-group-lg":!this.props.standalone&&"large"===this.props.bsSize,"form-group-sm":!this.props.standalone&&"small"===this.props.bsSize,"has-feedback":this.props.hasFeedback,"has-success":"success"===this.props.bsStyle,"has-warning":"warning"===this.props.bsStyle,"has-error":"error"===this.props.bsStyle};return u["default"].createElement("div",{className:c["default"](e,this.props.groupClassName)},this.props.children)}}]),t}(u["default"].Component);p.defaultProps={standalone:!1},p.propTypes={standalone:u["default"].PropTypes.bool,hasFeedback:u["default"].PropTypes.bool,bsSize:function(e){return e.standalone&&void 0!==e.bsSize?new Error("bsSize will not be used when `standalone` is set."):u["default"].PropTypes.oneOf(["small","medium","large"]).apply(null,arguments)},bsStyle:u["default"].PropTypes.oneOf(["success","warning","error"]),groupClassName:u["default"].PropTypes.string},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(15),u=r(s),l=/\%\((.+?)\)s/,c=a["default"].createClass({displayName:"Interpolate",propTypes:{component:a["default"].PropTypes.node,format:a["default"].PropTypes.string,unsafe:a["default"].PropTypes.bool},getDefaultProps:function(){return{component:"span"}},render:function(){var e=u["default"].hasValidComponent(this.props.children)||"string"==typeof this.props.children?this.props.children:this.props.format,t=this.props.component,n=this.props.unsafe===!0,r=o({},this.props);if(delete r.children,delete r.format,delete r.component,delete r.unsafe,n){var i=e.split(l).reduce(function(e,t,n){var o=void 0;if(n%2===0?o=t:(o=r[t],delete r[t]),a["default"].isValidElement(o))throw new Error("cannot interpolate a React component into unsafe text");return e+=o},"");return r.dangerouslySetInnerHTML={__html:i},a["default"].createElement(t,r)}var s=e.split(l).reduce(function(e,t,n){var o=void 0;if(n%2===0){if(0===t.length)return e;o=t}else o=r[t],delete r[t];return e.push(o),e},[]);return a["default"].createElement(t,r,s)}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",a({},this.props,{className:p["default"](this.props.className,this.props.modalClassName)}),this.props.children)}}]),t}(l["default"].Component);f.propTypes={modalClassName:l["default"].PropTypes.string},f.defaultProps={modalClassName:"modal-body"},t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",a({},this.props,{className:p["default"](this.props.className,this.props.modalClassName)}),this.props.children)}}]),t}(l["default"].Component);f.propTypes={modalClassName:l["default"].PropTypes.string},f.defaultProps={modalClassName:"modal-footer"},t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",a({},this.props,{className:p["default"](this.props.className,this.props.modalClassName)}),this.props.closeButton&&l["default"].createElement("button",{className:"close","aria-label":this.props["aria-label"]||"Close",onClick:this.props.onHide,style:{marginTop:-2}},l["default"].createElement("span",{"aria-hidden":"true"},"×")),this.props.children)}}]),t}(l["default"].Component);f.__isModalHeader=!0,f.propTypes={modalClassName:l["default"].PropTypes.string,closeButton:l["default"].PropTypes.bool,onHide:l["default"].PropTypes.func},f.defaultProps={modalClassName:"modal-header",closeButton:!1},t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("h4",a({},this.props,{className:p["default"](this.props.className,"modal-title")}),this.props.children)}}]),t}(l["default"].Component);f.propTypes={modalClassName:l["default"].PropTypes.string},f.defaultProps={modalClassName:"modal-title"},t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(6),u=r(s),l=n(96),c=r(l),p=n(3),f=r(p),d=n(22),h=r(d),m=n(15),v=r(m),g=n(27),y=r(g),b=a["default"].createClass({displayName:"Nav",mixins:[u["default"],c["default"]],propTypes:{activeHref:a["default"].PropTypes.string,activeKey:a["default"].PropTypes.any,bsStyle:a["default"].PropTypes.oneOf(["tabs","pills"]),stacked:a["default"].PropTypes.bool,justified:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,collapsible:a["default"].PropTypes.bool,expanded:a["default"].PropTypes.bool,navbar:a["default"].PropTypes.bool,eventKey:a["default"].PropTypes.any,pullRight:a["default"].PropTypes.bool,right:a["default"].PropTypes.bool},getDefaultProps:function(){return{bsClass:"nav"}},getCollapsibleDOMNode:function(){return a["default"].findDOMNode(this)},getCollapsibleDimensionValue:function(){var e=a["default"].findDOMNode(this.refs.ul),t=e.offsetHeight,n=h["default"].getComputedStyles(e);return t+parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)},render:function(){var e=this.props.collapsible?this.getCollapsibleClassSet("navbar-collapse"):null;return this.props.navbar&&!this.props.collapsible?this.renderUl():a["default"].createElement("nav",o({},this.props,{className:f["default"](this.props.className,e)}),this.renderUl())},renderUl:function(){var e=this.getBsClassSet();return e["nav-stacked"]=this.props.stacked,e["nav-justified"]=this.props.justified,e["navbar-nav"]=this.props.navbar,e["pull-right"]=this.props.pullRight,e["navbar-right"]=this.props.right,a["default"].createElement("ul",o({},this.props,{role:"tabs"===this.props.bsStyle?"tablist":null,className:f["default"](this.props.className,e),ref:"ul"}),v["default"].map(this.props.children,this.renderNavItem))},getChildActiveProp:function(e){return e.props.active?!0:null!=this.props.activeKey&&e.props.eventKey===this.props.activeKey?!0:null!=this.props.activeHref&&e.props.href===this.props.activeHref?!0:e.props.active},renderNavItem:function(e,t){return i.cloneElement(e,{role:"tabs"===this.props.bsStyle?"tab":null,active:this.getChildActiveProp(e),activeKey:this.props.activeKey,activeHref:this.props.activeHref,onSelect:y["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t,navItem:!0})}});t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=s["default"].createClass({displayName:"NavItem",mixins:[p["default"]],propTypes:{linkId:s["default"].PropTypes.string,onSelect:s["default"].PropTypes.func,active:s["default"].PropTypes.bool,disabled:s["default"].PropTypes.bool,href:s["default"].PropTypes.string,role:s["default"].PropTypes.string,title:s["default"].PropTypes.node,eventKey:s["default"].PropTypes.any,target:s["default"].PropTypes.string,"aria-controls":s["default"].PropTypes.string},getDefaultProps:function(){return{href:"#"}},render:function(){var e=this.props,t=e.role,n=e.linkId,r=e.disabled,a=e.active,u=e.href,c=e.title,p=e.target,f=e.children,d=e["aria-controls"],h=o(e,["role","linkId","disabled","active","href","title","target","children","aria-controls"]),m={active:a,disabled:r},v={role:t,href:u,title:c,target:p,id:n,onClick:this.handleClick,ref:"anchor"};return t||"#"!==u||(v.role="button"),s["default"].createElement("li",i({},h,{role:"presentation",className:l["default"](h.className,m)}),s["default"].createElement("a",i({},v,{"aria-selected":a,"aria-controls":d}),f))},handleClick:function(e){this.props.onSelect&&(e.preventDefault(),this.props.disabled||this.props.onSelect(this.props.eventKey,this.props.href,this.props.target))}});t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1;var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},c=n(1),p=r(c),f=n(139),d=r(f),h=n(229),m=r(h),v=n(476),g=r(v),y=function(e){function t(e,n){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n)}return a(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.container,n=e.containerPadding,r=e.target,i=e.placement,a=e.rootClose,s=o(e,["container","containerPadding","target","placement","rootClose"]),u=p["default"].createElement(m["default"],{container:t,containerPadding:n,target:r,placement:i},this.props.children);return a&&(u=p["default"].createElement(g["default"],{onRootClose:this.props.onHide},u)),p["default"].createElement(d["default"],{container:t,rootClose:a,onRootClose:this.props.onHide},s.show&&u)}}]),t}(p["default"].Component);y.propTypes=s({},d["default"].propTypes,m["default"].propTypes,{show:p["default"].PropTypes.bool,rootClose:p["default"].PropTypes.bool,onHide:p["default"].PropTypes.func}),t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(15),f=r(p),d=a["default"].createClass({displayName:"PanelGroup",mixins:[c["default"]],
propTypes:{accordion:a["default"].PropTypes.bool,activeKey:a["default"].PropTypes.any,className:a["default"].PropTypes.string,children:a["default"].PropTypes.node,defaultActiveKey:a["default"].PropTypes.any,onSelect:a["default"].PropTypes.func},getDefaultProps:function(){return{bsClass:"panel-group"}},getInitialState:function(){var e=this.props.defaultActiveKey;return{activeKey:e}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e),onSelect:null}),f["default"].map(this.props.children,this.renderPanel))},renderPanel:function(e,t){var n=null!=this.props.activeKey?this.props.activeKey:this.state.activeKey,r={bsStyle:e.props.bsStyle||this.props.bsStyle,key:e.key?e.key:t,ref:e.ref};return this.props.accordion&&(r.collapsible=!0,r.expanded=e.props.eventKey===n,r.onSelect=this.handleSelect),i.cloneElement(e,r)},shouldComponentUpdate:function(){return!this._isChanging},handleSelect:function(e,t){e.preventDefault(),this.props.onSelect&&(this._isChanging=!0,this.props.onSelect(t),this._isChanging=!1),this.state.activeKey===t&&(t=null),this.setState({activeKey:t})}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1;var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},c=n(1),p=r(c),f=n(22),d=r(f),h=n(231),m=n(14),v=r(m),g=function(e){function t(e,n){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n),this.state={positionLeft:null,positionTop:null,arrowOffsetLeft:null,arrowOffsetTop:null}}return a(t,e),u(t,[{key:"componentWillMount",value:function(){this._needsFlush=!0}},{key:"componentWillRecieveProps",value:function(){this._needsFlush=!0}},{key:"componentDidMount",value:function(){this._maybeUpdatePosition()}},{key:"componentDidUpate",value:function(){this._maybeUpdatePosition()}},{key:"render",value:function(){var e=this.props,t=e.placement,n=e.children,r=this.props.target?this.state:{},i=r.positionLeft,a=r.positionTop,u=o(r,["positionLeft","positionTop"]);return c.cloneElement(p["default"].Children.only(n),s({},u,{placement:t,positionTop:a,positionLeft:i,style:s({},n.props.style,{left:i,top:a})}))}},{key:"_maybeUpdatePosition",value:function(){this._needsFlush&&(this._needsFlush=!1,this._updatePosition())}},{key:"_updatePosition",value:function(){if(null!=this.props.target){var e=p["default"].findDOMNode(this.props.target(this.props)),t=p["default"].findDOMNode(this.props.container)||d["default"].ownerDocument(this).body;this.setState(h.calcOverlayPosition(this.props.placement,p["default"].findDOMNode(this),e,t,this.props.containerPadding))}}}]),t}(p["default"].Component);g.propTypes={target:p["default"].PropTypes.func,container:v["default"].mountable,containerPadding:p["default"].PropTypes.number,placement:p["default"].PropTypes.oneOf(["top","right","bottom","left"])},g.defaultProps={containerPadding:0,placement:"right"},t["default"]=g,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function s(e,t){return function(n){var r=function(e){function t(){i(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),l(t,[{key:"getChildContext",value:function(){return this.props.context}},{key:"render",value:function(){var e=this.props,t=e.wrapped,n=(e.context,o(e,["wrapped","context"]));return p["default"].cloneElement(t,n)}}]),t}(p["default"].Component);r.childContextTypes=n;var s=function(){function n(){i(this,n)}return l(n,[{key:"render",value:function(){var n=u({},this.props);return n[t]=this.getWrappedOverlay(),p["default"].createElement(e,n,this.props.children)}},{key:"getWrappedOverlay",value:function(){return p["default"].createElement(r,{context:this.context,wrapped:this.props[t]})}}]),n}();return s.contextTypes=n,s}}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=s;var c=n(1),p=r(c);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n,r){var o=l.getContainerDimensions(n),i=o.scroll,a=o.height,s=e-r-i,u=e+r-i+t;return 0>s?-s:u>a?a-u:0}function i(e,t,n,r){var o=l.getContainerDimensions(n),i=o.width,a=e-r,s=e+r+t;return 0>a?-a:s>i?i-s:0}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(22),u=r(s),l={getContainerDimensions:function(e){var t=void 0,n=void 0,r=void 0;return"BODY"===e.tagName?(t=window.innerWidth,n=window.innerHeight,r=u["default"].ownerDocument(e).documentElement.scrollTop||e.scrollTop):(t=e.offsetWidth,n=e.offsetHeight,r=e.scrollTop),{width:t,height:n,scroll:r}},getPosition:function(e,t){var n="BODY"===t.tagName?u["default"].getOffset(e):u["default"].getPosition(e,t);return a({},n,{height:e.offsetHeight,width:e.offsetWidth})},calcOverlayPosition:function(e,t,n,r,a){var s=l.getPosition(n,r),u=t.offsetHeight,c=t.offsetWidth,p=void 0,f=void 0,d=void 0,h=void 0;if("left"===e||"right"===e){f=s.top+(s.height-u)/2,p="left"===e?s.left-c:s.left+s.width;var m=o(f,u,r,a);f+=m,h=50*(1-2*m/u)+"%",d=null}else{if("top"!==e&&"bottom"!==e)throw new Error('calcOverlayPosition(): No such placement of "'+e+'" found.');p=s.left+(s.width-c)/2,f="top"===e?s.top-u:s.top+s.height;var v=i(p,c,r,a);p+=v,d=50*(1-2*v/c)+"%",h=null}return{positionLeft:p,positionTop:f,arrowOffsetLeft:d,arrowOffsetTop:h}}};t["default"]=l,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){function r(){a=!0,n.apply(this,arguments)}function o(){a||(e>i?(i+=1,t.call(this,i-1,o,r)):r.apply(this,arguments))}var i=0,a=!1;o()}function r(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(i[e]=r,a=++s===o,a&&n(null,i)))}var o=e.length,i=[];if(0===o)return n(null,i);var a=!1,s=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}function o(e,t,n){var o=Object.keys(e);r(o,function(n,r,o){t(e[n],o)},function(e,t){if(e)n(e);else{var r=t.reduce(function(e,t,n){return e[o[n]]=t,e},{});n(null,r)}})}t.__esModule=!0,t.loopAsync=n,t.mapAsync=r,t.hashAsync=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){return Math.random().toString(36).substr(2)}t.__esModule=!0;var a=n(49),s=r(a),u=n(102),l=n(144),c=r(l),p=["pushState","replaceState","go"],f=function(){function e(){var t=void 0===arguments[0]?{}:arguments[0];o(this,e),p.forEach(function(e){s["default"]("function"==typeof this[e],'%s needs a "%s" method',this.constructor.name,e)},this),this.parseQueryString=t.parseQueryString||u.parseQueryString,this.changeListeners=[],this.location=null}return e.prototype._notifyChange=function(){for(var e=0,t=this.changeListeners.length;t>e;++e)this.changeListeners[e].call(this)},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){this.changeListeners=this.changeListeners.filter(function(t){return t!==e})},e.prototype.back=function(){this.go(-1)},e.prototype.forward=function(){this.go(1)},e.prototype._createState=function(e){return e=e||{},e.key||(e.key=i()),e},e.prototype.createLocation=function(e,t,n){var r=u.getPathname(e),o=u.getQueryString(e),i=o?this.parseQueryString(o):null;return new c["default"](r,i,t,n)},e}();t["default"]=f,e.exports=t["default"]},function(e,t){t.arrayToObject=function(e){for(var t={},n=0,r=e.length;r>n;++n)"undefined"!=typeof e[n]&&(t[n]=e[n]);return t},t.merge=function(e,n){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):e[n]=!0,e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],s=n[a];e[a]?e[a]=t.merge(e[a],s):e[a]=s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],i=0,a=e.length;a>i;++i)"undefined"!=typeof e[i]&&o.push(e[i]);return o}var s=Object.keys(e);for(i=0,a=s.length;a>i;++i){var u=s[i];e[u]=t.compact(e[u],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[n(t,e)]=r[e]})});var i={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},a={isUnitlessNumber:r,shorthandPropertyExpansions:i};e.exports=a},function(e,t,n){"use strict";var r=n(235),o=n(16),i=(n(567),n(571)),a=n(578),s=n(582),u=(n(8),s(function(e){return a(e)})),l="cssFloat";o.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(l="styleFloat");var c={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=u(n)+":",t+=i(n,r)+";")}return t||null},setValueForStyles:function(e,t){var n=e.style;for(var o in t)if(t.hasOwnProperty(o)){var a=i(o,t[o]);if("float"===o&&(o=l),a)n[o]=a;else{var s=r.shorthandPropertyExpansions[o];if(s)for(var u in s)n[u]="";else n[o]=""}}}};e.exports=c},function(e,t,n){"use strict";function r(){if(s)for(var e in u){var t=u[e],n=s.indexOf(e);if(a(n>-1),!l.plugins[n]){a(t.extractEvents),l.plugins[n]=t;var r=t.eventTypes;for(var i in r)a(o(r[i],t,i))}}}function o(e,t,n){a(!l.eventNameDispatchConfigs.hasOwnProperty(n)),l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];i(s,t,n)}return!0}return e.registrationName?(i(e.registrationName,t,n),!0):!1}function i(e,t,n){a(!l.registrationNameModules[e]),l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(4),s=null,u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){a(!s),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(a(!u[n]),u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=l},function(e,t,n){"use strict";function r(e,t){this.forEachFunction=e,this.forEachContext=t}function o(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function i(e,t,n){if(null==e)return e;var i=r.getPooled(t,n);d(e,o,i),r.release(i)}function a(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function s(e,t,n,r){var o=e,i=o.mapResult,a=!i.hasOwnProperty(n);if(a){var s=o.mapFunction.call(o.mapContext,t,r);i[n]=s}}function u(e,t,n){if(null==e)return e;var r={},o=a.getPooled(r,t,n);return d(e,s,o),a.release(o),f.create(r)}function l(e,t,n,r){return null}function c(e,t){return d(e,l,null)}var p=n(38),f=n(63),d=n(262),h=(n(8),p.twoArgumentPooler),m=p.threeArgumentPooler;p.addPoolingTo(r,h),p.addPoolingTo(a,m);var v={forEach:i,map:u,count:c};e.exports=v},function(e,t,n){"use strict";function r(e,t){this.props=e,this.context=t}var o=n(157),i=n(4);n(8),r.prototype.setState=function(e,t){i("object"==typeof e||"function"==typeof e||null==e),o.enqueueSetState(this,e),t&&o.enqueueCallback(this,t)},r.prototype.forceUpdate=function(e){o.enqueueForceUpdate(this),e&&o.enqueueCallback(this,e)},e.exports=r},function(e,t,n){"use strict";var r=n(261),o={shouldComponentUpdate:function(e,t){return!r(this.props,e)||!r(this.state,t)}};e.exports=o},function(e,t,n){"use strict";var r=n(236),o=n(512),i=n(76),a=n(41),s=n(50),u=n(4),l=n(167),c={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},p={updatePropertyByID:function(e,t,n){var r=a.getNode(e);u(!c.hasOwnProperty(t)),null!=n?i.setValueForProperty(r,t,n):i.deleteValueForProperty(r,t)},deletePropertyByID:function(e,t,n){var r=a.getNode(e);u(!c.hasOwnProperty(t)),i.deleteValueForProperty(r,t,n)},updateStylesByID:function(e,t){var n=a.getNode(e);r.setValueForStyles(n,t)},updateInnerHTMLByID:function(e,t){var n=a.getNode(e);l(n,t)},updateTextContentByID:function(e,t){var n=a.getNode(e);o.updateTextContent(n,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=a.getNode(e);o.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=a.getNode(e[n].parentID);o.processUpdates(e,t)}};s.measureMethods(p,"ReactDOMIDOperations",{updatePropertyByID:"updatePropertyByID",deletePropertyByID:"deletePropertyByID",updateStylesByID:"updateStylesByID",updateInnerHTMLByID:"updateInnerHTMLByID",updateTextContentByID:"updateTextContentByID",dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),e.exports=p},function(e,t,n){"use strict";var r=n(76),o=n(150),i=n(153),a=n(7),s=n(110),u=function(e){};a(u.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){this._rootNodeID=e;var o=s(this._stringText);return t.renderToStaticMarkup?o:"<span "+r.createMarkupForID(e)+">"+o+"</span>"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;n!==this._stringText&&(this._stringText=n,i.BackendIDOperations.updateTextContentByID(this._rootNodeID,n))}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=u},function(e,t,n){"use strict";function r(e){return i(document.documentElement,e)}var o=n(533),i=n(251),a=n(253),s=n(254),u={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,o=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,o),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if("undefined"==typeof r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",r-n),i.select()}else o.setOffsets(e,t)}};e.exports=u},function(e,t,n){"use strict";var r=n(565),o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(">"," "+o.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var n=t.getAttribute(o.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var i=r(e);return i===n}};e.exports=o},function(e,t,n){"use strict";var r=n(81),o=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=o},function(e,t,n){"use strict";function r(e){function t(t,n,r,o,i){if(o=o||E,null==n[r]){var a=b[i];return t?new Error("Required "+a+" `"+r+"` was not specified in "+("`"+o+"`.")):null}return e(n,r,o,i)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){function t(t,n,r,o){var i=t[n],a=m(i);if(a!==e){var s=b[o],u=v(i);return new Error("Invalid "+s+" `"+n+"` of type `"+u+"` "+("supplied to `"+r+"`, expected `"+e+"`."))}return null}return r(t)}function i(){return r(_.thatReturns(null))}function a(e){function t(t,n,r,o){var i=t[n];if(!Array.isArray(i)){var a=b[o],s=m(i);return new Error("Invalid "+a+" `"+n+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var u=0;u<i.length;u++){var l=e(i,u,r,o);if(l instanceof Error)return l}return null}return r(t)}function s(){function e(e,t,n,r){if(!g.isValidElement(e[t])){var o=b[r];return new Error("Invalid "+o+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactElement."))}return null}return r(e)}function u(e){function t(t,n,r,o){if(!(t[n]instanceof e)){var i=b[o],a=e.name||E;return new Error("Invalid "+i+" `"+n+"` supplied to "+("`"+r+"`, expected instance of `"+a+"`."))}return null}return r(t)}function l(e){function t(t,n,r,o){for(var i=t[n],a=0;a<e.length;a++)if(i===e[a])return null;var s=b[o],u=JSON.stringify(e);return new Error("Invalid "+s+" `"+n+"` of value `"+i+"` "+("supplied to `"+r+"`, expected one of "+u+"."))}return r(t)}function c(e){function t(t,n,r,o){var i=t[n],a=m(i);if("object"!==a){var s=b[o];return new Error("Invalid "+s+" `"+n+"` of type "+("`"+a+"` supplied to `"+r+"`, expected an object."))}for(var u in i)if(i.hasOwnProperty(u)){var l=e(i,u,r,o);if(l instanceof Error)return l}return null}return r(t)}function p(e){function t(t,n,r,o){for(var i=0;i<e.length;i++){var a=e[i];if(null==a(t,n,r,o))return null}var s=b[o];return new Error("Invalid "+s+" `"+n+"` supplied to "+("`"+r+"`."))}return r(t)}function f(){function e(e,t,n,r){if(!h(e[t])){var o=b[r];return new Error("Invalid "+o+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return null}return r(e)}function d(e){function t(t,n,r,o){var i=t[n],a=m(i);if("object"!==a){var s=b[o];return new Error("Invalid "+s+" `"+n+"` of type `"+a+"` "+("supplied to `"+r+"`, expected `object`."))}for(var u in e){var l=e[u];if(l){var c=l(i,u,r,o);if(c)return c}}return null}return r(t)}function h(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(h);if(null===e||g.isValidElement(e))return!0;e=y.extractIfFragment(e);for(var t in e)if(!h(e[t]))return!1;return!0;default:return!1}}function m(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function v(e){var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}var g=n(9),y=n(63),b=n(106),_=n(33),E="<<anonymous>>",C=s(),T=f(),w={array:o("array"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),any:i(),arrayOf:a,element:C,instanceOf:u,node:T,objectOf:c,oneOf:l,oneOfType:p,shape:d};e.exports=w},function(e,t,n){"use strict";function r(){this.listenersToPut=[]}var o=n(38),i=n(62),a=n(7);a(r.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e<this.listenersToPut.length;e++){var t=this.listenersToPut[e];i.putListener(t.rootNodeID,t.propKey,t.propValue)}},reset:function(){this.listenersToPut.length=0},destructor:function(){this.reset()}}),o.addPoolingTo(r),e.exports=r},function(e,t){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};e.exports=r},function(e,t,n){"use strict";var r=n(61),o=n(550),i=n(7),a=n(159),s=n(33),u=r.createClass({displayName:"ReactTransitionGroup",propTypes:{component:r.PropTypes.any,childFactory:r.PropTypes.func},getDefaultProps:function(){return{component:"span",childFactory:s.thatReturnsArgument}},getInitialState:function(){return{children:o.getChildMapping(this.props.children)}},componentWillMount:function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},componentDidMount:function(){var e=this.state.children;for(var t in e)e[t]&&this.performAppear(t)},componentWillReceiveProps:function(e){var t=o.getChildMapping(e.children),n=this.state.children;this.setState({children:o.mergeChildMappings(n,t)});var r;for(r in t){var i=n&&n.hasOwnProperty(r);!t[r]||i||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(r in n){var a=t&&t.hasOwnProperty(r);!n[r]||a||this.currentlyTransitioningKeys[r]||this.keysToLeave.push(r)}},componentDidUpdate:function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var t=this.keysToLeave;this.keysToLeave=[],t.forEach(this.performLeave)},performAppear:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)},_handleDoneAppearing:function(e){var t=this.refs[e];t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e];var n=o.getChildMapping(this.props.children);n&&n.hasOwnProperty(e)||this.performLeave(e)},performEnter:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)},_handleDoneEntering:function(e){var t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e];var n=o.getChildMapping(this.props.children);n&&n.hasOwnProperty(e)||this.performLeave(e)},performLeave:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)},_handleDoneLeaving:function(e){var t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];var n=o.getChildMapping(this.props.children);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{var r=i({},this.state.children);delete r[e],this.setState({children:r})}},render:function(){var e=[];for(var t in this.state.children){var n=this.state.children[t];n&&e.push(a(this.props.childFactory(n),{ref:t,key:t}))}return r.createElement(this.props.component,this.props,e)}});e.exports=u},function(e,t){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};e.exports=n},function(e,t,n){function r(e,t){return e&&t?e===t?!0:o(e)?!1:o(t)?r(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var o=n(579);e.exports=r},function(e,t,n){"use strict";function r(e){return null==e?null:s(e)?e:o.has(e)?i.getNodeFromInstance(e):(a(null==e.render||"function"!=typeof e.render),void a(!1))}var o=(n(40),n(65)),i=n(41),a=n(4),s=n(258);n(8),e.exports=r},function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}e.exports=n},function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}e.exports=n},function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[o]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=n},function(e,t,n){function r(e){return i(!!a),f.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||("*"===e?a.innerHTML="<link />":a.innerHTML="<"+e+"></"+e+">",s[e]=!a.firstChild),s[e]?f[e]:null}var o=n(16),i=n(4),a=o.canUseDOM?document.createElement("div"):null,s={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},u=[1,'<select multiple="true">',"</select>"],l=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],p=[1,"<svg>","</svg>"],f={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c,circle:p,defs:p,ellipse:p,g:p,line:p,linearGradient:p,path:p,polygon:p,polyline:p,radialGradient:p,rect:p,stop:p,text:p};e.exports=r},function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=n(16),i=null;e.exports=r},function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t){"use strict";function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},function(e,t,n){"use strict";function r(e){return i(o.isValidElement(e)),e}var o=n(9),i=n(4);e.exports=r},function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}e.exports=n},function(e,t,n){"use strict";function r(e){return v[e]}function o(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function i(e){return(""+e).replace(g,r)}function a(e){return"$"+i(e)}function s(e,t,n,r,i){var u=typeof e;if(("undefined"===u||"boolean"===u)&&(e=null),null===e||"string"===u||"number"===u||l.isValidElement(e))return r(i,e,""===t?h+o(e,0):t,n),1;var p,v,g,y=0;if(Array.isArray(e))for(var b=0;b<e.length;b++)p=e[b],v=(""!==t?t+m:h)+o(p,b),g=n+y,y+=s(p,v,g,r,i);else{var _=f(e);if(_){var E,C=_.call(e);if(_!==e.entries)for(var T=0;!(E=C.next()).done;)p=E.value,v=(""!==t?t+m:h)+o(p,T++),g=n+y,y+=s(p,v,g,r,i);else for(;!(E=C.next()).done;){var w=E.value;w&&(p=w[1],v=(""!==t?t+m:h)+a(w[0])+m+o(p,0),g=n+y,y+=s(p,v,g,r,i))}}else if("object"===u){d(1!==e.nodeType);var S=c.extract(e);for(var O in S)S.hasOwnProperty(O)&&(p=S[O],v=(""!==t?t+m:h)+a(O)+m+o(p,0),g=n+y,y+=s(p,v,g,r,i))}}return y}function u(e,t,n){return null==e?0:s(e,"",0,t,n)}var l=n(9),c=n(63),p=n(64),f=n(255),d=n(4),h=(n(8),p.SEPARATOR),m=":",v={"=":"=0",".":"=1",":":"=2"},g=/[=.:]/g;e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(588),p=r(c),f=n(587),d=r(f);t.itemStatus=d["default"];var h=function(){function e(t){a(this,e),this.url=t}return l(e,[{key:"list",value:function(e){return p["default"].get(this.url).query(e)}},{key:"retrieve",value:function(e){return p["default"].get(this._getObjectURL(e))}},{key:"create",value:function(e){return this._setCRSFHeader(p["default"].post(this.url)).send(e)}},{key:"update",value:function(e,t){return this._setCRSFHeader(p["default"].put(this._getObjectURL(t))).send(e)}},{key:"_getObjectURL",value:function(e){var t="";return this.url.endsWith("/")||(t="/"),""+this.url+t+e}},{key:"_setCRSFHeader",value:function(e){return this._csrfSafeMethod(e.method)||e.set("X-CSRFToken",this._getCookie("csrftoken")),e}},{key:"_getCookie",value:function(e){var t=null;if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),r=0;r<n.length;r++){var o=jQuery.trim(n[r]);if(o.substring(0,e.length+1)===e+"="){t=decodeURIComponent(o.substring(e.length+1));break}}return t}},{key:"_csrfSafeMethod",value:function(e){return/^(GET|HEAD|OPTIONS|TRACE)$/.test(e)}}]),e}();t.Endpoint=h;var m=function(){function e(t){var n=this;a(this,e),this.endpointName=t,["list","retrieve","create","update"].forEach(function(e){n[""+e]=n.getConstant(e),["success","failure"].forEach(function(t){n[e+"_"+t]=n.getConstant(e,t)})})}return l(e,[{key:"getConstant",
value:function(e,t){var n=this.endpointName+"_"+e;return t&&(n=n+"_"+t),n}}]),e}();t.ActionTypes=m;var v=function(){function e(t,n,r){var o=this;a(this,e),this.actionTypes=r,this._pendingID=0,["list","retrieve","create","update"].forEach(function(e){o[e]=o._createAction.bind(o,e,n[e].bind(n))})}return l(e,[{key:"_createAction",value:function(e,t,n,r){var o=this;return function(i){var a=o._getPendingID(),s=t(n,r).end(function(t,n){i(t?o._failure(e,"error",a):o._success(e,n.body,a))});return i(o._pending(e,n,a)),s}}},{key:"_success",value:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return this._makeActionObject.apply(this,t.concat(["success"]))}},{key:"_failure",value:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return this._makeActionObject.apply(this,t.concat(["failure"]))}},{key:"_pending",value:function(){return this._makeActionObject.apply(this,arguments)}},{key:"_makeActionObject",value:function(e,t,n,r){var o=this.actionTypes.getConstant(e,r);return{type:o,payload:t,pendingID:n}}},{key:"_getPendingID",value:function(){return this._pendingID+=1,this._pendingID}}]),e}();t.ActionCreators=v;var g=function(){function e(t){a(this,e),this.actionTypes=t}return l(e,[{key:"getReducer",value:function(){return this._reducer.bind(this)}},{key:"_getItem",value:function(e,t,n){return e.find(function(e){return e[t]===n})}},{key:"_replaceItem",value:function(e,t,n,r){var i=e.findIndex(function(e){return e[t]===n}),a=[].concat(o(e));return a.splice(i,1,r),a}}]),e}(),y=function(e){function t(){a(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),l(t,[{key:"_reducer",value:function(e,t){void 0===e&&(e=[]);var n=void 0;return t.type===this.actionTypes.create?(n=s({},t.payload,{status:d["default"].pending,pendingID:t.pendingID}),[].concat(o(e),[n])):t.type===this.actionTypes.create_success?(n=s({},t.payload,{status:d["default"].saved}),this._replaceItem(e,"pendingID",t.pendingID,n)):t.type===this.actionTypes.create_failure?(n=this._getItem(e,"pendingID",t.pendingID),n.status=d["default"].failed,this._replaceItem(e,"pendingID",t.pendingID,n)):t.type===this.actionTypes.update?(n=s({},t.payload,{status:d["default"].pending}),this._replaceItem(e,"id",n.id,n)):t.type===this.actionTypes.update_success?(n=s({},t.payload,{status:d["default"].saved}),this._replaceItem(e,"id",n.id,n)):t.type===this.actionTypes.update_failure?(n=s({},t.payload,{status:d["default"].failed}),this._replaceItem(e,"id",n.id,n)):t.type===this.actionTypes.list_success?[].concat(o(t.payload)):e}}]),t}(g);t.ItemReducer=y;var b=function(e){function t(){a(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),l(t,[{key:"_reducer",value:function(e,t){void 0===e&&(e=[]);var n=void 0;return t.type===this.actionTypes.list?(n={action:"list",status:d["default"].pending,pendingID:t.pendingID},[].concat(o(e),[n])):t.type===this.actionTypes.list_success?(n={action:"list",status:d["default"].saved},this._replaceItem(e,"pendingID",t.pendingID,n)):t.type===this.actionTypes.list_failure?(n={action:"list",status:d["default"].failed},this._replaceItem(e,"pendingID",t.pendingID,n)):e}}]),t}(g);t.CollectionReducer=b;var _=function E(e){a(this,E),this.API={},this.actionTypes={},this.actionCreators={},this.reducers={};for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];this.API[t]=new h(n),this.actionTypes[t]=new m(t),this.actionCreators[t]=new v(t,this.API[t],this.actionTypes[t]),this.reducers[t+"_items"]=new y(this.actionTypes[t]).getReducer(),this.reducers[t+"_collection"]=new b(this.actionTypes[t]).getReducer()}};t["default"]=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=void 0===arguments[1]?[]:arguments[1];return function(n,r){function o(t){return u=r(e(u,t)),t}function i(){return u}var u=r(e(n,s)),l="function"==typeof t?t(i):t;return a["default"].apply(void 0,l.concat([o]))}}t.__esModule=!0,t["default"]=o;var i=n(265),a=r(i),s={type:"@@INIT"};e.exports=t["default"]},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.reduceRight(function(e,t){return t(e)})}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=u["default"](e,function(e){return"function"==typeof e});return function(e,n){return void 0===e&&(e={}),a["default"](t,function(t,r){return t(e[r],n)})}}t.__esModule=!0,t["default"]=o;var i=n(268),a=r(i),s=n(604),u=r(s);e.exports=t["default"]},function(e,t){"use strict";function n(e){return e.displayName||e.name||"Component"}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=window.location.href.split("/");return e[e.length-2]}var i=n(311),a=r(i),s=n(295),u=r(s);n(385);var l=n(293),c=n(294),p=n(53),f=n(112),d=n(173),h=n(179),m=n(309),v=n(114),g=(n(174),n(312)),y=n(281),b=n(276),_=(n(306),n(322)),E=n(118),C=n(316),T=n(328),w=n(1);window.React=w,window.AvatarContainer=d,chatConf.me&&(p.connect(chatConf.server,chatConf.me,chatConf.password,chatConf.nick),f.loadRoles());var S=Strophe.getNodeFromJid(chatConf.me),O=document.getElementById("nav-avatar");O&&w.render(w.createElement(d,{username:S}),O);var x=document.getElementById("change-avatar");x&&w.render(w.createElement(m,null),x);var P=document.getElementById("profile-avatar");P&&w.render(w.createElement(d,{username:o(),size:150}),P);var D=document.getElementById("chat-module");D&&w.render(w.createElement(g,{fluidHeight:!1,heightOffset:300}),D||chatroom);var N=document.getElementById("chatrooms");N&&w.render(c,N);var M=document.getElementById("presence");M&&w.render(w.createElement(v,{stacked:!1}),M);var k=document.getElementById("react");k&&w.render(l,k);var R=document.getElementById("evaluation");R&&w.render(w.createElement(y,null),R);var I=document.getElementById("chatroomsettings");I&&w.render(b,I);var A=document.getElementById("casenotes");A&&w.render(w.createElement(_,null),A);var j=document.getElementById("my-status");j&&w.render(w.createElement(h,{user:o()}),j);var L=document.getElementsByClassName("user-autocomplete");Array.prototype.forEach.call(L,function(e){w.render(w.createElement(E,{name:e.dataset.perm,multi:!0,value:e.dataset.value&&e.dataset.value.split("|")}),e)});var F=document.getElementById("tickets");F&&w.render(C,F);var H=document.getElementById("user-mgmt");H&&w.render(T,H);var U=document.getElementById("user-bio");U&&w.render(w.createElement(a["default"],null),U);var B=document.getElementById("new-message-count");B&&w.render(w.createElement(u["default"],null),B)},function(e,t,n){"use strict";var r=n(12),o=n(30),i=o.ActionTypes;e.exports={changeChatroom:function(e){var t=e.split("/"),n=t[t.length-2];console.log("changing room",n),"chatroom"!==n&&r.dispatch({type:i.CHANGE_ROOM,room:n})}}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(54),i=n(25),a=n(19);e.exports={getRegFormSettings:function(e){o.get(a.api.forms(e)).done(function(t){i.receiveRegFormSettings(e,t)})},updateRegFormSettings:function(e,t){o.put(a.api.forms(e),t)},getValues:function(e){o.get(a.api.values(e)).done(function(t){i.receiveValues(e,t)})},updateValues:function(e,t,n){o.patch(a.api.values(e),r({},t,n))}}},function(e,t,n){"use strict";function r(){return{role:a.getCurrent(),settings:s.getCaseNotesSettingsForCurrentRole()}}var o=n(1),i=n(48),a=n(42),s=n(67),u=n(25),l=n(82),c=o.createClass({displayName:"CaseNotes",getInitialState:function(){var e=r();return e.isEditing=!1,e},componentDidMount:function(){a.addChangeListener(this._onChange),s.addChangeListener(this._onChange)},componentWillUnmount:function(){a.removeChangeListener(this._onChange),s.removeChangeListener(this._onChange)},render:function(){var e,t="Editing ‘"+this.state.role+"’ Case Notes";return e=this.state.isEditing?o.createElement(l,{className:"edit",onSave:this._onSave,value:this.state.settings.title}):o.createElement("span",null,this.state.settings.title," ",o.createElement("button",{type:"button",className:"btn btn-default btn-sm","aria-label":"Edit display name of case notes",title:"Edit display name of case notes",onClick:this._onDoubleClick},o.createElement("span",{className:"glyphicon glyphicon-pencil","aria-hidden":"true"}))),o.createElement(i,{header:t,bsStyle:"primary"},o.createElement("em",null,"Case notes appear on a person’s profile page. You can call them something else, and professionals can share them with other roles."),o.createElement("div",{className:"panel panel-default"},o.createElement("div",{className:"panel-heading"},e),o.createElement("div",{style:{height:200},className:"panel-body"})))},_onChange:function(){this.setState(r())},_onDoubleClick:function(){this.setState({isEditing:!0})},_onSave:function(e){u.updateCaseNotesTitle(this.state.role,e),this.setState({isEditing:!1})}});e.exports=c},function(e,t,n){"use strict";var r=n(10),o=n(43),i=r.createClass({displayName:"ChatHours",propTypes:{start:r.PropTypes.number,end:r.PropTypes.number,onChange:r.PropTypes.func.isRequired},render:function(){console.log("render",this.props.start,this.props.end);for(var e=[],t=[],n=this.props.start||0,i=o.uniqueID(),s=o.uniqueID(),u=0;24>u;u+=1)e.push(u);for(var u=n+1;24>=u;u+=1)t.push(u);for(var u=1;n>u;u+=1)t.push(u);return r.createElement("div",{style:{display:"inline"}},r.createElement(a,{id:i,label:"Start",hours:e,value:this.props.start,onChange:this._handleChange.bind(this,"start")}),r.createElement(a,{id:s,label:"End",hours:t,value:this.props.end,onChange:this._handleChange.bind(this,"end")}))},_handleChange:function(e,t){var n=parseInt(t.target.value,10);this.props.onChange(e,n)}}),a=r.createClass({displayName:"TimeSelect",render:function(){return r.createElement("div",{className:"form-group"},r.createElement("label",{forHtml:this.props.id},this.props.label),r.createElement("select",{id:this.props.id,className:"form-control",onChange:this.props.onChange,value:this.props.value},r.createElement("option",{value:""},"---"),this.props.hours.map(function(e){return r.createElement("option",{value:e,key:e},o.displayTime(e))})))}});e.exports=i},function(e,t,n){"use strict";var r=n(10),o=(r.addons.update,n(30)),i=n(13),a=n(43),s=r.createClass({displayName:"ChatroomScheduleViewer",getDefaultProps:function(){return{width:800,rowHeight:20,dayLabelWidth:50}},render:function(){var e=this;console.log("viewing",this.props.slots);var t=a.slotsToDayIntervals(this.props.slots),n=[];return t.forEach(function(t,o){var i=[e._renderDayLabel(o)];n.push(i),t.forEach(function(t){i.push(r.createElement(l,{dayLabelWidth:e.props.dayLabelWidth,rowWidth:e.props.width,start:t.start,end:t.end,isPending:t.isPending,index:t.index,onClick:e.props.onSlotClick}))})}),r.createElement("div",null,this._renderHeader(),n.map(function(t,n){return r.createElement(u,{key:n,width:e.props.width,height:e.props.rowHeight},t)}))},_renderDayLabel:function(e){return r.createElement("div",{style:{"float":"left",width:this.props.dayLabelWidth,height:this.props.rowHeight}},o.days[e])},_renderHeader:function(){for(var e=[],t=0;24>t;t+=1){var n=a.displayTime(t);e.push(r.createElement("div",{key:t,style:{width:1/24*this.props.width,height:this.props.rowHeight,"float":"left",textAlign:"center"}},r.createElement("small",null,n)))}return r.createElement(u,{width:this.props.width,height:this.props.rowHeight,style:{marginLeft:-.5/24*this.props.width+this.props.dayLabelWidth}},e)}}),u=r.createClass({displayName:"Row",render:function(){var e={clear:"both",width:this.props.width,height:this.props.height,marginTop:3,position:"relative"},t=i(e,this.props.style);return r.createElement("div",{style:t},this.props.children)}}),l=r.createClass({displayName:"Slot",propTypes:{rowWidth:r.PropTypes.number.isRequired,dayLabelWidth:r.PropTypes.number.isRequired,start:function(e,t,n){var r=e[t];return 0>r||r>23?new Error("Start time must be 0..23"):void 0},end:function(e,t,n){var r=e[t];if(1>r||r>24)return new Error("Start time must be 1..24");var o=e.start;return o+1>r?new Error("End must be greater than start"):void 0},isPending:r.PropTypes.bool,onClick:r.PropTypes.func},render:function(){var e=this.props.rowWidth*this.props.start/24+this.props.dayLabelWidth,t=this.props.rowWidth*(this.props.end-this.props.start)/24;return r.createElement("div",{style:{position:"absolute",cursor:"pointer",left:e,width:t,height:"100%",backgroundColor:this.props.isPending?"orange":"blue",margin:this.props.isPending?2:0},onClick:this._onClick.bind(this,this.props.index)})},_onClick:function(e){console.log("clicked",e),this.props.onClick(e)}});e.exports=s},function(e,t,n){"use strict";function r(e){return e.replace(/[^\w]/g,"-").replace(/^\-+/,"").replace(/\-+$/,"")}function o(){return{chatrooms:d.getAll(),currentRoomID:d.getCurrentID()}}var i=n(28),a=n(59),s=n(10),u=(s.addons.update,n(169),n(287)),l=n(283),c=(n(111),n(94)),p=n(48),f=n(112),d=n(171),h=n(95),m=n(25),v=n(271),g=n(13),y=n(19),b=s.createClass({displayName:"ChatroomSettings",mixins:[s.addons.LinkedStateMixin,i.Navigation],getInitialState:function(){var e=o();return g({newChatroomName:"",newChatroomFormErrors:[],currentRoomID:e.currentRoomID},e)},componentWillMount:function(){v.changeChatroom(this.props.location.pathname)},componentDidMount:function(){f.loadChatrooms(),f.loadSlots(),d.addChangeListener(this._onChange)},componentWillReceiveProps:function(e){v.changeChatroom(e.location.pathname)},componentWillUnmount:function(){d.removeChangeListener(this._onChange)},_onChange:function(){this.setState(o())},render:function(){var e=this;return console.log("rendering settings for room",this.state.currentRoomID),s.createElement("div",null,this.state.newChatroomFormErrors.map(function(e){return s.createElement(h,{bsStyle:"danger"},e)}),s.createElement("div",{className:"form-inline"},s.createElement("div",{className:"form-group"},s.createElement("label",null,s.createElement("input",{className:"form-control",type:"checkbox",checkedLink:this.linkState("isNewChatroomRegular")}),"Regular scheduled room?")),s.createElement("div",{className:"form-group"},s.createElement("input",{className:"form-control",type:"text",valueLink:this.linkState("newChatroomName"),placeholder:"Enter name"})),s.createElement("div",{className:"form-group"},s.createElement("button",{className:"btn btn-success",onClick:this._addChatroom},"Add chatroom"))),this.state.chatrooms.length?s.createElement(c,{activeKey:this.state.currentRoomID,onSelect:this._changeRoom},this.state.chatrooms.map(function(t){return s.createElement(p,{key:t.slug,eventKey:t.slug,header:t.name},t.is_regular?s.createElement(u,{room:t.slug}):s.createElement(l,{room:t.slug}),s.createElement("p",null,e.state.confirmDelete?null:s.createElement("button",{className:"btn btn-danger",disabled:t.isDeleting,onClick:e._confirmDeleteChatroom.bind(e,t.slug)},t.isDeleting?"Deleting ...":"Delete room"),e.state.confirmDelete===t.slug?s.createElement("span",null,"Are you sure? ",s.createElement("button",{className:"btn btn-danger",onClick:e._deleteChatroom.bind(e,t.slug)},"Yes"),s.createElement("button",{className:"btn btn-default",onClick:e._cancelDeleteChatroom.bind(e,t.slug)},"Cancel")):null))})):null)},_changeRoom:function(e){this.transitionTo(y.chatroomConfig(e))},_addChatroom:function(){var e=this._validateNewChatroom();e.length?this.setState({newChatroomFormErrors:e}):(m.createChatroom({is_regular:this.state.isNewChatroomRegular,slug:r(this.state.newChatroomName),name:this.state.newChatroomName,roles:[],users:[]}),this.setState({newChatroomName:"",newChatroomFormErrors:[],isNewChatroomRegular:!1}))},_validateNewChatroom:function(){var e=[],t=r(this.state.newChatroomName);return this.state.chatrooms.findIndex(function(e){return e.slug===t})>-1&&e.push("Room with id "+t+" already exists"),e},_confirmDeleteChatroom:function(e){this.setState({confirmDelete:e})},_cancelDeleteChatroom:function(e){this.setState({confirmDelete:null})},_deleteChatroom:function(e){m.deleteChatroom(e),this.setState({confirmDelete:null})}}),_=s.createElement(i.Router,{history:a.history},s.createElement(i.Route,{path:y.chatroomConfig(":id"),component:b,ignoreScrollBehavior:!0}));e.exports=_},function(e,t,n){"use strict";var r=n(1),o=n(25),i=n(278),a=n(170),s=r.createClass({displayName:"CustomField",addTextField:function(e){e&&(o.addTextField(this.props.role,e),this.setState({adding:null}))},addChoiceField:function(e,t){o.addChoiceField(this.props.role,e,t),this.setState({adding:null})},addMultipleChoiceField:function(e,t){o.addMultipleChoiceField(this.props.role,e,t),this.setState({adding:null})},FIELD_TYPES:[{name:"Text",widget:i,creator:"addTextField"},{name:"Single choice",widget:a,creator:"addChoiceField"},{name:"Multiple choice",widget:a,creator:"addMultipleChoiceField"}],getFieldType:function(e){var t=this.FIELD_TYPES.filter(function(t){return t.name==e});return t[0]},getInitialState:function(){return{adding:null}},render:function(){var e,t,n,o,i=this.FIELD_TYPES.map(function(e){var t=e.name;return r.createElement("option",{key:t,value:t},t)});return this.state.adding?(n=this.getFieldType(this.state.adding),t=r.createElement(n.widget,{onSave:this[n.creator]}),o=r.createElement("button",{onClick:this._cancelAddField,className:"btn btn-primary"},"Cancel")):e=r.createElement("select",{onChange:this._addField,className:"form-control"},r.createElement("option",null,"Add new custom field"),i),r.createElement("div",null,e,t,o)},_addField:function(e){var t=e.target.value;this.setState({adding:t})},_cancelAddField:function(){this.setState({adding:null})}});e.exports=s},function(e,t,n){"use strict";var r=n(1),o=n(82),i=r.createClass({displayName:"CustomTextField",render:function(){return r.createElement(o,{onSave:this.props.onSave,placeholder:"Add question text"})}});e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){console.log("converting",e);var t=e.getFullYear(),n=l["default"](e.getMonth()+1,2,0),r=l["default"](e.getDate(),2,0),o=l["default"](e.getHours(),2,0),i=l["default"](e.getMinutes(),2,0),a=t+"-"+n+"-"+r+"T"+o+":"+i;return console.log("locale string",a),a}function i(e){if(!e)return e;var t=""+e+p,n=Date.parse(t),r=new Date;return r.setTime(n),r}function a(){var e=new Date,t=e.getTimezoneOffset(),n=t>=0?"-":"+";t=Math.abs(t);var r=l["default"](Math.floor(t/60),2,0),o=l["default"](t%60,2,0);return""+n+r+":"+o}var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(445),l=r(u),c=n(10),p=a(),f=c.createClass({displayName:"DateTime",propTypes:{min:c.PropTypes.object,max:c.PropTypes.object,value:c.PropTypes.object,onChange:c.PropTypes.func},render:function(){var e=this,t={};return["min","max","value"].forEach(function(n){var r=e.props[n];r?t[n]=o(e.props[n]):t[n]=r}),c.createElement("input",s({},this.props,{ref:"input",type:"datetime-local",value:t.value,min:t.min,max:t.max,onChange:this._onChange}))},_onChange:function(e){var t=i(e.target.value);this.props.onChange(t)}});e.exports=f},function(e,t,n){"use strict";var r=n(10),o=n(279),i=n(43),a=n(95),s=r.createClass({displayName:"DateTimeRange",propTypes:{min:r.PropTypes.object,max:r.PropTypes.object,start:r.PropTypes.object,end:r.PropTypes.object,minDelta:r.PropTypes.number,onChange:r.PropTypes.func},getDefaultProps:function(){return{minDelta:1}},componentWillMount:function(){this.startID=i.uniqueID(),this.endID=i.uniqueID()},render:function(){var e;return this.props.start&&(e=i.addHours(this.props.start,this.props.minDelta)),r.createElement("div",{className:"form-inline"},this._validate().map(function(e){return r.createElement(a,{key:e,bsStyle:"danger"},e)}),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:this.startID},"Start"),r.createElement(o,{id:this.startID,value:this.props.start,min:this.props.min,onChange:this._onChangeStart})),r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:this.endID},"End"),r.createElement(o,{id:this.endID,disabled:!this.props.start,value:this.props.end,min:e,onChange:this._onChangeEnd})))},_validate:function(){var e=[];return this.props.start&&this.props.end<i.addHours(this.props.start,this.props.minDelta)&&e.push("Please select a later end time"),e},_onChangeStart:function(e){var t=this.props.end;e&&t&&e>=t?this.props.onChange(e,null):this.props.onChange(e,t)},_onChangeEnd:function(e){this.props.onChange(this.props.start,e)}});e.exports=s},function(e,t,n){"use strict";function r(){return{roles:c.getAll(),currentRole:c.getCurrent(),items:p.getAll(),currentItem:p.getCurrent()}}var o=n(1),i=n(94),a=n(48),s=n(284),u=n(73),l=n(72),c=n(42),p=n(288),f=n(25),d=o.createClass({displayName:"EvaluationSettings",getInitialState:function(){return r()},componentDidMount:function(){c.addChangeListener(this._onChange),p.addChangeListener(this._onChange)},componentWillUnmount:function(){c.removeChangeListener(this._onChange),p.removeChangeListener(this._onChange)},handleItemClick:function(e){f.clickItem(e)},handleSelect:function(e){var t=this.state.roles[e];f.clickRole(t)},render:function(){var e,t=this,n=this.state.roles.indexOf(this.state.currentRole),r=this.state.roles.map(function(e,r){var i=t.state.items.map(function(e,n){return o.createElement(s,{key:n,item:e.name,desc:e.edit,handleClick:t.handleItemClick})});return o.createElement(a,{key:r,header:e,eventKey:r,bsStyle:n===r?"primary":"default"},i)});return this.state.currentItem&&(e=p.getComponentForCurrent(),e&&(e=o.createElement(e,{role:this.state.currentRole}))),o.createElement(u,null,o.createElement(l,{md:6},o.createElement(i,{activeKey:n,onSelect:this.handleSelect},r)),o.createElement(l,{md:6},e))},_onChange:function(){this.setState(r())}});e.exports=d},function(e,t,n){"use strict";function r(){return{role:a.getCurrent(),settings:s.getImpactFootprintSettingsForCurrentRole()}}var o=n(1),i=n(48),a=n(42),s=n(67),u=n(25),l=n(73),c=n(72),p=o.createClass({displayName:"ImpactFootprint",getInitialState:function(){return r()},componentDidMount:function(){a.addChangeListener(this._onChange),s.addChangeListener(this._onChange)},componentWillUnmount:function(){a.removeChangeListener(this._onChange),s.removeChangeListener(this._onChange)},render:function(){var e=this,t="Editing ‘"+this.state.role+"’ Impact Footprint",n=this.state.settings.map(function(t,n){var r;return r=t.on?o.createElement("input",{type:"checkbox",checked:t.showContent,onChange:e._toggleItemContent.bind(e,t)}):o.createElement("input",{type:"checkbox",checked:t.showContent,readOnly:!0}),o.createElement("div",{key:n},o.createElement(c,{md:3},t.name),o.createElement(c,{md:3},o.createElement("input",{type:"checkbox",checked:t.on,onChange:e._toggleItem.bind(e,t)})),o.createElement(c,{md:3},o.createElement("em",null,"Show content?")),o.createElement(c,{md:3},r))});return o.createElement(i,{header:t,bsStyle:"primary"},o.createElement("p",null,o.createElement("em",null,"Turn on/off the events you wish to track for ‘",this.state.role,"’. The detail or content of the event can also be displayed below the timeline.")),o.createElement(i,{header:"IMPACT FOOTPRINT"},o.createElement(l,null,n)))},_onChange:function(){this.setState(r())},_toggleItem:function(e){u.toggleImpactFootprintItem(this.state.role,e)},_toggleItemContent:function(e){u.toggleImpactFootprintItemContent(this.state.role,e)}});e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=c.get(e),n=f({},t);return{initial:t,current:n}}var i=n(441),a=r(i),s=n(10),u=n(111),l=n(43),c=n(171),p=n(25),f=n(13),d=n(95),h=n(47),m=n(280),v=s.createClass({displayName:"OneOffChatroomSchedule",getInitialState:function(){return o(this.props.room)},componentDidMount:function(){c.addChangeListener(this._onChange)},componentWillUnmount:function(){c.removeChangeListener(this._onChange)},_onChange:function(){this.setState(o(this.props.room))},componentWillUpdate:function(e,t){var n=this;if(this.state.pendingSince&&!t.initial.isPending){var r=new Date-this.state.pendingSince,o=Math.max(0,500-r);setTimeout(function(){return n.setState({pendingSince:null})},o)}},render:function(){return l.uniqueID(),l.uniqueID(),this.state.current.failed?s.createElement("div",null,s.createElement(d,{bsStyle:"danger",onDismiss:this.handleAlertDismiss},s.createElement("h4",null,"Error saving changes!"),s.createElement("p",null,"There was a server error trying to save your changes. Close this to revert your changes and try again."),s.createElement("p",null,"If the problem persists ..."),s.createElement("p",null,s.createElement(h,{bsStyle:"danger",onClick:this._revert},"Revert changes")))):s.createElement("div",null,s.createElement(m,{min:new Date,start:this.state.current.start,end:this.state.current.end,onChange:this._updateDateTimeRange}),s.createElement("p",null,"You can make this a private room by selecting roles and users below."),s.createElement(u,{selectedRoles:this.state.current.roles,users:this.state.current.users,onChangeRoles:this._update.bind(this,"roles"),onChangeUsers:this._update.bind(this,"users")}),s.createElement("button",{disabled:this.state.pendingSince||!this._isChanged()||!this._isValid(),className:"btn btn-success",onClick:this._save},this.state.pendingSince?"Saving...":"Save"),this._isChanged()?s.createElement("button",{className:"btn btn-default",onClick:this._cancel},"Cancel"):null)},_isChanged:function(){return!a["default"](this.state.current,this.state.initial)},_isValid:function(){return this.state.current.start&&this.state.current.end},_update:function(e,t){var n=this.state.current;n[e]=t,this.setState({current:n})},_updateDateTimeRange:function(e,t){console.log("setting",e,t);var n=this.state.current;n.start=e,n.end=t,this.setState({current:n})},_cancel:function(){var e=f({},this.state.initial);this.setState({current:e})},_revert:function(){p.revertChatroom(this.props.room),this._cancel()},_save:function(){p.updateChatroom(this.props.room,{start:this.state.current.start,end:this.state.current.end,users:this.state.current.users,roles:this.state.current.roles}),this.setState({pendingSince:new Date})}});e.exports=v},function(e,t,n){"use strict";var r=n(1),o=n(73),i=n(72),a=r.createClass({displayName:"Placeholder",render:function(){return r.createElement(o,null,r.createElement(i,{md:4},this.props.item),r.createElement(i,{md:2},r.createElement("input",{type:"checkbox",defaultChecked:!0})),r.createElement(i,{md:6},r.createElement("em",null,r.createElement("a",{href:"#",onClick:this.props.handleClick.bind(null,this.props.item)},this.props.desc))))}});e.exports=a},function(e,t,n){"use strict";function r(){return{role:a.getCurrent(),settings:s.getPostSessionFeedbackSettingsForCurrentRole()}}var o=n(1),i=n(48),a=n(42),s=n(67),u=n(25),l=n(82),c=o.createClass({displayName:"PostSessionFeedback",getInitialState:function(){var e=r();return e.isEditing=new Set,e},componentDidMount:function(){a.addChangeListener(this._onChange),s.addChangeListener(this._onChange)},componentWillUnmount:function(){a.removeChangeListener(this._onChange),s.removeChangeListener(this._onChange)},render:function(){var e=this,t="Editing ‘"+this.state.role+"’ Post-session feedback",n={};return["title","question"].forEach(function(t){var r,i="updatePostSessionFeedback"+t.charAt(0).toUpperCase()+t.slice(1);if(e.state.isEditing.has(t))r=o.createElement(l,{className:"edit",onSave:e._onSave.bind(e,t,i),value:e.state.settings[t]});else{var a="Edit post session feedback "+t;r=o.createElement("span",null,e.state.settings[t]," ",o.createElement("button",{type:"button",className:"btn btn-default btn-sm","aria-label":a,title:a,onClick:e._onDoubleClick.bind(e,t)},o.createElement("span",{className:"glyphicon glyphicon-pencil","aria-hidden":"true"})))}n[t]=r}),o.createElement(i,{header:t,bsStyle:"primary"},o.createElement("div",{className:"panel panel-default"},o.createElement("div",{className:"panel-heading"},n.title),o.createElement("div",{className:"panel-body"},o.createElement("p",null,n.question),o.createElement("p",null,o.createElement("img",{alt:"1",src:"/static/images/ratings/1-rainy.png"}),o.createElement("img",{alt:"2",src:"/static/images/ratings/2-cloudy.png"}),o.createElement("img",{alt:"3",src:"/static/images/ratings/3-peeping.png"}),o.createElement("img",{alt:"4",src:"/static/images/ratings/4-sunny.png"}),o.createElement("img",{alt:"5",src:"/static/images/ratings/5-bright.png"})))))},_onChange:function(){this.setState(r())},_onDoubleClick:function(e){var t=this.state.isEditing;t.add(e),this.setState({isEditing:t})},_onSave:function(e,t,n){u[t](this.state.role,n);var r=this.state.isEditing;r["delete"](e),this.setState({isEditing:r})}});e.exports=c},function(e,t,n){"use strict";function r(){return{role:a.getCurrent(),settings:s.getRegFormSettingsForCurrentRole()}}var o=n(1),i=n(48),a=n(42),s=n(67),u=n(25),l=(n(73),n(72),n(277)),c=n(170),p=o.createClass({displayName:"RegForm",getInitialState:function(){return r()},componentDidMount:function(){a.addChangeListener(this._onChange),s.addChangeListener(this._onChange)},componentWillUnmount:function(){a.removeChangeListener(this._onChange),s.removeChangeListener(this._onChange)},render:function(){var e="Editing ‘"+this.state.role+"’ Registration Form";return this.state.settings?o.createElement(i,{header:e,bsStyle:"primary"},o.createElement("p",null,o.createElement("em",null,"Fields in grey are mandatory")),o.createElement("div",{className:"form-horizontal"},o.createElement("div",{className:"form-group"},o.createElement("div",{className:"col-md-8"},o.createElement("input",{className:"form-control",placeholder:"Username",style:{backgroundColor:"#f5f5f5"}}))),o.createElement("div",{className:"form-group"},o.createElement("div",{className:"col-md-8"},o.createElement("input",{className:"form-control",placeholder:"Email address",style:{backgroundColor:"#f5f5f5"}}))),o.createElement("div",{className:"form-group"},o.createElement("div",{className:"col-md-4"},o.createElement("input",{className:"form-control",placeholder:"Password",style:{backgroundColor:"#f5f5f5"}})),o.createElement("div",{className:"col-md-4"},o.createElement("input",{className:"form-control",placeholder:"Verify password",style:{backgroundColor:"#f5f5f5"}}))),this._renderFields(),this._renderAddableFields(),o.createElement(l,{role:this.state.role}))):o.createElement(i,{header:e,bsStyle:"primary"},"Loading...")},_renderFields:function(){var e=this,t=this.state.settings.filter(function(e){return e.on||e.required});return t.map(function(t){var n,r;return n=t.hasOwnProperty("fields")?e._renderFieldGroup(t):o.createElement("div",{className:"col-md-8"},e._renderField(t)),t.required||(r=e._renderRemoveButton(t)),o.createElement("div",{className:"form-group",key:t.name},n," ",r)})},_renderAddableFields:function(){var e=this.state.settings.filter(function(e){return!e.on&&!e.required}),t=e.map(function(e){return o.createElement("option",{key:e.name,value:e.name},e.name)});return t.length?o.createElement("div",{className:"form-group"},o.createElement("div",{className:"col-md-8"},o.createElement("select",{className:"form-control",onChange:this._addField},o.createElement("option",null,"Select field to add"),t))):null},_renderFieldGroup:function(e){var t=this,n=e.required,r=e.fields.map(function(e){return o.createElement("div",{className:"col-md-4",key:e.name},t._renderField(e,n))});return r},_renderField:function(e,t){return e.options?this._renderChoiceField(e):this._renderTextField(e,t);
},_renderChoiceField:function(e){if(this.state.isEditing&&this.state.isEditing.name===e.name)return o.createElement(c,{questionText:e.name,choices:e.options,onSave:this._updateChoiceField.bind(this,e.name)});var t=e.multiple?"checkbox":"radio",n=e.options.map(function(n){return o.createElement("div",{key:n},o.createElement("label",null,o.createElement("input",{type:t,name:e.name})," ",n," "))});return o.createElement("div",{className:"col-md-8"},o.createElement("p",{onDoubleClick:this._editField.bind(this,e)},e.name),n)},_editField:function(e){this.setState({isEditing:e})},_updateChoiceField:function(e,t,n){u.updateChoiceField(this.state.role,e,t,n),this.setState({isEditing:null})},_renderTextField:function(e,t){return o.createElement("input",{className:"form-control",type:"text",placeholder:e.name,style:{backgroundColor:e.required||t?"#f4c1cf":"#fa8072"}})},_renderRemoveButton:function(e){return o.createElement("button",{className:"btn btn-primary",onClick:this._removeField.bind(this,e)},o.createElement("span",{ariaHidden:!0,className:"glyphicon glyphicon-minus"}),o.createElement("span",{className:"sr-only"},"remove"))},_onChange:function(){this.setState(r())},_addField:function(e){var t=e.target.value;u.addRegField(this.state.role,t)},_removeField:function(e){u.removeRegField(this.state.role,e.name)}});e.exports=p},function(e,t,n){"use strict";function r(e){return l.getForRoom(e)}var o=n(10),i=o.addons.update,a=n(275),s=n(274),u=n(30),l=n(289),c=n(43),p=n(13),f=n(25),d=o.createClass({displayName:"RegularChatroomSchedule",getInitialState:function(){return{slots:r(this.props.room),editingSlot:null,pendingSlot:null}},componentDidMount:function(){l.addChangeListener(this._onChange)},componentWillUnmount:function(){l.removeChangeListener(this._onChange)},_onChange:function(){var e=r(this.props.room);this.setState({slots:e})},render:function(){var e=this.state.slots.slice();return this.state.pendingSlot&&e.push(this.state.pendingSlot),o.createElement("div",null,this.state.pendingSlot?null:o.createElement("p",null,o.createElement("button",{className:"btn btn-success",onClick:this._addPendingSlot},"Add slot")),this.state.pendingSlot||this._isEditingExistingSlot()?this._renderPendingSlotEditor():null,o.createElement(a,{slots:e,onSlotClick:this._editSlot}))},_addPendingSlot:function(){this.setState({pendingSlot:{day:0,start:9,end:17,isPending:!0}})},_renderPendingSlotEditor:function(){var e=this.state.pendingSlot,t=e?this._validatePendingSlot(e):[];return o.createElement("div",null,o.createElement("div",{className:"form-inline"},o.createElement("div",{className:"form-group"},o.createElement("label",{forHtml:"day"},"Day"),o.createElement("select",{id:"day",className:"form-control",onChange:this._updatePendingSlotDay,value:e.day},u.days.map(function(e,t){return o.createElement("option",{key:e,value:t},e)}))),o.createElement(s,{onChange:this._updatePendingSlotTime,start:e.start,end:e.end}),o.createElement("button",{className:"btn btn-success",disabled:0!==t.length,onClick:this._savePendingSlot},"Save"),o.createElement("button",{className:"btn btn-default",onClick:this._cancelPendingSlot},"Cancel"),this._isEditingExistingSlot()?o.createElement("button",{className:"btn btn-danger",onClick:this._deleteSlot},"Delete"):null),t.map(function(e){return o.createElement("p",{key:[e.day,e.slot.start,e.slot.end].join(",")},"Slot overlaps ",u.days[e.day]," ",c.displayTime(e.slot.start)," to"," ",c.displayTime(e.slot.end))}))},_isEditingExistingSlot:function(){return null!==this.state.editingSlot},_updatePendingSlotDay:function(e){var t=parseInt(e.target.value,10),n={pendingSlot:{}};n.pendingSlot.day={$set:t},this.setState(i(this.state,n))},_updatePendingSlotTime:function(e,t){var n={pendingSlot:{}};n.pendingSlot[e]={$set:t},this.setState(i(this.state,n))},_validatePendingSlot:function(e){var t=this,n=c.slotsToDayIntervals([e]),r=c.slotsToDayIntervals(this.state.slots),o=[];return r.forEach(function(e,r){e.forEach(function(e){n[r].forEach(function(n){t._overlaps(e,n)&&(null===t.state.editingSlot||e.index!==t.state.editingSlot)&&o.push({day:r,slot:e})})})}),o},_savePendingSlot:function(){this.setState({pendingSlot:null,editingSlot:null});var e=p({room:this.props.room},this.state.pendingSlot);delete e.isPending,this._isEditingExistingSlot()?f.updateSlot(e):f.createSlot(e)},_cancelPendingSlot:function(){this.setState({pendingSlot:null,editingSlot:null})},_editSlot:function(e){var t=p({},this.state.slots[e]);t.isPending=!0,this.setState({editingSlot:e,pendingSlot:t})},_deleteSlot:function(){f.deleteSlot(this.state.pendingSlot.id),this.setState({pendingSlot:null,editingSlot:null})},_overlaps:function(e,t){return e.start>=t.start&&e.start<=t.end||e.end>=t.start&&e.start<=t.end||e.start<=t.start&&e.end>=t.end}});e.exports=d},function(e,t,n){"use strict";var r,o=n(12),i=n(30),a=n(18).EventEmitter,s=n(13),u=i.ActionTypes,l=n(273),c=n(285),p=(n(282),n(286)),f="change",d=[{name:"Registration",edit:"Edit Registration form",component:p},{name:"Case Notes",edit:"Edit Case Note form",component:l},{name:"Post-session feedback",edit:"Edit Post-session feedback form",component:c}],h=s({},a.prototype,{emitChange:function(){this.emit(f)},addChangeListener:function(e){this.on(f,e)},removeChangeListener:function(e){this.removeListener(f,e)},getAll:function(){return d},getCurrent:function(){return r},getComponentForCurrent:function(){for(var e=0;e<d.length;e+=1)if(d[e].name===r)return d[e].component}});h.dispatchToken=o.register(function(e){switch(e.type){case u.CLICK_ITEM:r=e.item,h.emitChange()}}),e.exports=h},function(e,t,n){"use strict";var r=n(12),o=n(30),i=n(18).EventEmitter,a=n(13),s=o.ActionTypes,u="change",l=[],c=a({},i.prototype,{emitChange:function(){this.emit(u)},addChangeListener:function(e){this.on(u,e)},removeChangeListener:function(e){this.removeListener(u,e)},getForRoom:function(e){console.log("slots for",e,l);var t=function(){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=l[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;s.room===e&&t.push(s)}}catch(u){r=!0,o=u}finally{try{!n&&a["return"]&&a["return"]()}finally{if(r)throw o}}return t}();return console.log(t),t}});c.dispatchToken=r.register(function(e){switch(e.type){case s.RECEIVE_SLOTS:l=e.slots,c.emitChange();break;case s.RECEIVE_CREATE_SLOT_SUCCESS:e.slot.id=e.slotID,c.emitChange();break;case s.CREATE_SLOT:l.push(e.slot),c.emitChange();break;case s.UPDATE_SLOT:var t=l.findIndex(function(t){return t.id===e.slot.id});l.splice(t,1,e.slot),c.emitChange();break;case s.DELETE_SLOT:var t=l.findIndex(function(t){return t.id===e.slotID});l.splice(t,1),c.emitChange()}}),e.exports=c},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(53),a=n(45),s=o.ActionTypes;e.exports={createMessage:function(e,t,n){r.dispatch({type:s.CREATE_MESSAGE,text:e,currentThreadID:t,isGroup:n});var o=a.getCreatedMessageData(e,t);i.createMessage(o)},startTyping:function(e){r.dispatch({type:s.START_TYPING,currentThreadID:e}),i.startTyping(e)},stopTyping:function(e){r.dispatch({type:s.STOP_TYPING,currentThreadID:e}),i.stopTyping(e)}}},function(e,t,n){"use strict";var r=n(12),o=n(11),i=o.ActionTypes;e.exports={connect:function(e){r.dispatch({type:i.CONNECT,connection:e})},disconnect:function(){r.dispatch({type:i.DISCONNECT})},receivePrivateMessage:function(e,t){r.dispatch({type:i.RECEIVE_RAW_PRIVATE_MESSAGE,rawMessage:e,isArchived:t})},receiveCreatedMessage:function(e){r.dispatch({type:i.RECEIVE_RAW_CREATED_MESSAGE,rawMessage:e})},receiveUserProfile:function(e){r.dispatch({type:i.RECEIVE_USER_PROFILE,userProfile:e})},receiveChatStatus:function(e){r.dispatch({type:i.RECEIVE_CHAT_STATUS,status:e})},receiveStartTyping:function(e,t){r.dispatch({type:i.RECEIVE_START_TYPING,user:e,threadID:t})},receiveStopTyping:function(e,t){r.dispatch({type:i.RECEIVE_STOP_TYPING,user:e,threadID:t})},receiveOnline:function(e,t){r.dispatch({type:i.RECEIVE_ONLINE,user:e,room:t})},receiveOffline:function(e,t){r.dispatch({type:i.RECEIVE_OFFLINE,user:e,room:t})},joinChatroom:function(e){r.dispatch({type:i.JOIN_ROOM,roomJID:e})},leaveChatroom:function(e){r.dispatch({type:i.LEAVE_ROOM,roomJID:e})},receiveChatrooms:function(e){r.dispatch({type:i.RECEIVE_ROOM_LIST,rooms:e})},receiveEndThread:function(e,t){r.dispatch({type:i.RECEIVE_END_THREAD,threadID:e,rating:t})},receiveSessionRating:function(e,t){r.dispatch({type:i.RECEIVE_SESSION_RATING,threadID:e,rating:t})}}},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(53),a=o.ActionTypes;e.exports={changeAvatar:function(e){r.dispatch({type:a.CHANGE_AVATAR,user:Strophe.getNodeFromJid(chatConf.me),avatarName:e}),i.changeAvatar(e)}}},function(e,t,n){"use strict";function r(){return{connection:l.get()}}var o=n(28),i=n(59),a=n(176),s=n(1),u=n(180),l=n(115),c=(n(31),n(178)),p=(n(114),n(11)),f=n(314),d=n(172),h=n(19),m=s.createClass({displayName:"ChatApp",getInitialState:function(){return r()},componentWillMount:function(){d.changePrivateChat(this.props.location.pathname)},componentDidMount:function(){l.addChangeListener(this._onChange)},componentWillReceiveProps:function(e){d.changePrivateChat(e.location.pathname)},componentWillUnmount:function(){l.removeChangeListener(this._onChange)},render:function(){return this.state.connection==p.connected?s.createElement("div",{className:"row"},s.createElement("div",{className:"col-md-3"},s.createElement(u,{heightOffset:250})),s.createElement("div",{className:"col-md-6"},s.createElement(a,{heightOffset:230}),s.createElement(f,null)),s.createElement("div",{className:"col-md-3"},s.createElement("h3",null,"My Tools"),s.createElement(c,null))):this.state.connection==p.disconnected?s.createElement("div",{className:"chatapp"},s.createElement("p",null,"Disconnected"),s.createElement("a",{href:""},"Reconnect?")):s.createElement("div",{className:"chatapp"},"connecting...")},_onChange:function(){this.setState(r())}}),v=s.createElement(o.Router,{history:i.history},s.createElement(o.Route,{path:h.messages(),component:m}),s.createElement(o.Route,{path:h.message(":id"),component:m}),s.createElement(o.Route,{path:h.sessions(),component:m}),s.createElement(o.Route,{path:h.session(":id"),component:m}));e.exports=v},function(e,t,n){"use strict";function r(){return{connection:u.get(),thread:l.getCurrent()}}var o=n(28),i=n(59),a=n(176),s=n(1),u=(n(180),n(115)),l=n(31),c=(n(178),n(114)),p=n(296),f=n(11),d=(n(52),n(172)),h=n(19),m=s.createClass({displayName:"ChatRoomApp",getInitialState:function(){return r()},componentWillMount:function(){d.changeChatroom(this.props.location.pathname)},componentDidMount:function(){u.addChangeListener(this._onChange),l.addChangeListener(this._onChange)},componentWillUnmount:function(){u.removeChangeListener(this._onChange),l.removeChangeListener(this._onChange)},componentWillReceiveProps:function(e){d.changeChatroom(e.location.pathname)},render:function(){return this.state.connection==f.connected?this.state.thread&&!this.state.thread.isJoined?s.createElement("p",null,"This chatroom is closed"):s.createElement("div",{className:"row"},s.createElement("div",{className:"col-md-6"},s.createElement("h3",null,"Chatroom ",this.state.thread.id),s.createElement("div",{className:"chatroomMessages"},s.createElement(a,{heightOffset:300,isGroup:!0}))),s.createElement("div",{className:"col-md-3"},s.createElement("h3",null,"Who’s in chatroom ",this.state.thread.id),s.createElement("div",{className:"chatroomPresence"},s.createElement(c,{stacked:!0}))),s.createElement("div",{className:"col-md-3"},s.createElement("h3",null,"Other chatrooms"),s.createElement(p,null))):this.state.connection==f.disconnected?s.createElement("div",{className:"chatapp"},s.createElement("p",null,"Disconnected"),s.createElement("a",{href:""},"Reconnect?")):s.createElement("div",{className:"chatapp"},"connecting...")},_onChange:function(){this.setState(r())}}),v=s.createClass({displayName:"DefaultChatroom",mixins:[o.Navigation],componentDidMount:function(){l.addChangeListener(this._onChange)},componentWillUnmount:function(){l.removeChangeListener(this._onChange)},_onChange:function(){var e=this,t=l.getRooms();t.length&&(l.removeChangeListener(this._onChange),setTimeout(function(){e.transitionTo(h.chatroom(Strophe.getNodeFromJid(t[0])))},0))},render:function(){return null}}),g=s.createElement(o.Router,{history:i.history},s.createElement(o.Route,{path:h.chatrooms(),component:v}),s.createElement(o.Route,{path:h.chatroom(":id"),component:m}));e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(){return{unreadCount:f["default"].getCount()}}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},l=n(1),c=r(l),p=n(181),f=r(p),d=function(e){function t(){var e=this;o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state=a(),this._onChange=function(){e.setState(a())}}return i(t,e),s(t,[{key:"componentDidMount",value:function(){f["default"].addChangeListener(this._onChange)}},{key:"componentWillUnmount",value:function(){f["default"].removeChangeListener(this._onChange)}},{key:"render",value:function(){return this.state.unreadCount?c["default"].createElement("span",{className:"badge"},c["default"].createElement("b",null,this.state.unreadCount)):null}}]),t}(c["default"].Component);t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(){return{rooms:a.getRooms(),currentRoomJID:a.getCurrentRoomJID()}}var o=n(28),i=n(1),a=n(31),s=(n(52),n(160),n(19)),u=i.createClass({displayName:"RoomSection",getInitialState:function(){return r()},componentDidMount:function(){a.addChangeListener(this._onChange)},componentWillUnmount:function(){a.removeChangeListener(this._onChange)},render:function(){var e=this.state.rooms.map(function(e){var t=e.split("@")[0];return i.createElement(o.Link,{key:t,className:"list-group-item",to:s.chatroom(t)},Strophe.getNodeFromJid(e))});return i.createElement("div",null,i.createElement("div",{className:"list-group"},e))},_onChange:function(){this.setState(r())}});e.exports=u},function(e,t,n){"use strict";var r=n(1),o=n(11),i=r.createClass({displayName:"ShowStatus",propTypes:{code:r.PropTypes.oneOf(["online","away","chat","dnd","xa","offline"]).isRequired,message:r.PropTypes.string},render:function(){var e,t={width:15,height:15,borderRadius:"50%",display:"inline-block"};return"offline"==this.props.code?(t.border="1px solid grey",e="Offline"):"online"==this.props.code?(t.backgroundColor="green",e="Online"):"away"==this.props.code||"xa"==this.props.code?t.backgroundColor="yellow":t.backgroundColor="red",e=e||o.chatStatus[code],r.createElement("span",null,r.createElement("i",{style:t}),r.createElement("span",{className:"sr-only"},e),this.props.message?r.createElement("em",null,this.props.message):null)}});e.exports=i},function(e,t,n){"use strict";var r=n(28),o=(n(52),n(1)),i=n(160),a=n(68),s=(n(113),n(179)),u=n(45),l=n(313),c=o.PropTypes,p=n(19),f=o.createClass({displayName:"ThreadListItem",propTypes:{thread:c.object,currentThreadID:c.string,threadType:c.string.isRequired},render:function(){var e=this.props.thread,t=e.lastMessage,n=u.getMessageOther(this.props.thread.id);return o.createElement(r.Link,{className:i({"list-group-item":!0,active:e.id===this.props.currentThreadID}),to:p[this.props.threadType](e.id)},o.createElement("p",null,this.props.thread.name),o.createElement(l,null,o.createElement("p",null,o.createElement("b",null,n)," ",o.createElement("em",null,"[",o.createElement(s,{user:n}),"]")),o.createElement("p",{className:"messageTimestamp"},o.createElement(a,{when:t?t.date:new Date}))),t&&t.text)}});e.exports=f},function(e,t,n){"use strict";var r=n(1),o=r.createClass({displayName:"WhosTyping",render:function(){if(!this.props.users||0===this.props.users.length)return null;var e=this.props.users.join(", ");return r.createElement("div",null,e," is typing ...")}});e.exports=o},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(18).EventEmitter,a=n(13),s=o.ActionTypes,u="change",l={},c=a({},i.prototype,{emitChange:function(){this.emit(u)},addChangeListener:function(e){this.on(u,e)},removeChangeListener:function(e){this.removeListener(u,e)},get:function(e){return l}});c.dispatchToken=r.register(function(e){switch(e.type){case s.RECEIVE_CHAT_STATUS:l[e.status.user]=e.status,c.emitChange()}}),e.exports=c},function(e,t,n){"use strict";function r(e,t){p[t].splice(p[t].indexOf(e),1)}var o=n(12),i=n(11),a=n(18).EventEmitter,s=n(13),u=n(31),l=i.ActionTypes,c="change",p={},f=s({},a.prototype,{emitChange:function(){this.emit(c)},addChangeListener:function(e){this.on(c,e)},removeChangeListener:function(e){this.removeListener(c,e)},get:function(){return p[u.getCurrentRoomJID()]||[]}});f.dispatchToken=o.register(function(e){switch(e.type){case l.RECEIVE_ONLINE:var t=p[e.room];t||(p[e.room]=[]),-1===p[e.room].indexOf(e.user)&&(p[e.room].push(e.user),f.emitChange());break;case l.RECEIVE_OFFLINE:r(e.user,e.room),f.emitChange()}}),e.exports=f},function(e,t,n){"use strict";function r(e,t){var n=p[e];n&&n.splice(n.indexOf(t),1)}var o=n(12),i=n(11),a=n(18).EventEmitter,s=n(13),u=n(31),l=i.ActionTypes,c="change",p={},f=s({},a.prototype,{emitChange:function(){this.emit(c)},addChangeListener:function(e){this.on(c,e)},removeChangeListener:function(e){this.removeListener(c,e)},getForCurrentThread:function(e){var t=u.getCurrentID();if(t){var n=t.split(":").slice(0,2).join(":");return p[n]}return[]}});f.dispatchToken=o.register(function(e){switch(e.type){case l.RECEIVE_START_TYPING:var t=p[e.threadID];t||(t=[],p[e.threadID]=t),t.push(e.user),console.log("typing",p),f.emitChange();break;case l.RECEIVE_STOP_TYPING:r(e.threadID,e.user),console.log("typing",p),f.emitChange()}}),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){return u++}function i(e){var t=[e.from,e.to];t.sort(),e.threadID||(e.threadID=t.join(":")),e.threadName=e.threadID?s["default"].getMessageThreadName(e.threadID):t.join(" and "),e.authorName=e.from}var a=n(45),s=r(a),u=0;e.exports={create:{privateMessage:function(e,t,n){return $msg({from:t,to:n,type:"chat"}).c("body").t(e).up()}},parse:{privateMessage:function(e){var e=$(e),t={id:e.find("archived").attr("id"),text:e.find("body:first").text(),from:Strophe.getNodeFromJid(e.attr("from")),to:Strophe.getNodeFromJid(e.attr("to")),timestamp:new Date,composing:e.find("composing"),active:e.find("active"),threadID:e.find("thread").text(),ended:e.find("ended")};return i(t),t},archivedPrivateMessage:function(e){var e=$(e),t=e.find("[type=groupchat]").length,n=e.find("delay").attr("from");if(!t&&n){var r={id:e.find("result").attr("id"),text:e.find("body:first").text(),from:Strophe.getNodeFromJid(n),to:Strophe.getNodeFromJid(e.find("message").attr("to")),timestamp:new Date(e.find("delay").attr("stamp")),threadID:e.find("thread").text(),ended:e.find("ended")};return i(r),r}},vCard:function(e){e=$(e);var t=e.find("ROLE").text(),n=e.find("PHOTO").text();return{role:t,avatar:n}},presence:function(e){var t,n,r,o=$(e),i=Strophe.getNodeFromJid(o.attr("from")),a=o.attr("type");return"unavailable"===a?r={user:i}:(t=o.find("show").text(),n=o.find("status").text(),r={user:i,code:t,message:n}),r},groupPresence:function(e){var t,n,r,o,i=$(e),a=Strophe.getResourceFromJid(i.attr("from")),s=Strophe.getBareJidFromJid(i.attr("from")),u=i.find("status[code=201]").length;return r={user:a,isNewRoom:u,room:s},t=i.find("item[role!=none]"),t.length&&(r.added=!0),n=i.find("item[role=none]"),n.length&&(r.removed=!0),o=i.find("destroy"),o.length&&(r.destroyed=!0),r},groupMessage:function(e){var e=$(e),t=e.find("body:first").text(),n=Strophe.getResourceFromJid(e.attr("from")),r=Strophe.getNodeFromJid(e.attr("from")),i=e.find("delay");return i=i.length?new Date(i.attr("stamp")):new Date,{id:o(),from:n,to:r,text:t,timestamp:i}},roomList:function(e){var e=$(e),t=e.find("item").map(function(){return $(this).attr("jid")});return $.makeArray(t)},RSM:function(e){e=$(e);var t=e.find("first");return"0"!==t.attr("index")?t.text():void 0}}}},function(e,t,n){"use strict";var r=n(10),o=r.createClass({displayName:"Address",render:function(){}});o.Displayer=r.createClass({displayName:"Displayer",render:function(){return r.createElement("div",null,r.createElement("p",null,"Please enter your address"),r.createElement("p",null,r.createElement("label",null,"House name or number ",r.createElement("input",{type:"text"}))),r.createElement("p",null,r.createElement("label",null,"Street ",r.createElement("input",{type:"text"}))),r.createElement("p",null,r.createElement("label",null,"Postcode ",r.createElement("input",{type:"text"}))))}}),e.exports=o},function(e,t,n){"use strict";var r=n(10),o=r.addons.update,i=n(47),a=n(98),s=n(142),u=n(117),l=n(84),c=r.createClass({displayName:"Choice",render:function(){}});c.Displayer=r.createClass({displayName:"Displayer",propTypes:{isMultiple:r.PropTypes.bool,isRequired:r.PropTypes.bool,hasOther:r.PropTypes.bool,questionText:r.PropTypes.string,choices:r.PropTypes.array,otherText:r.PropTypes.string},render:function(){var e,t=this,n=this.props.isMultiple?"checkbox":"radio",o=this.props.choices.map(function(e){return r.createElement("li",{key:e},r.createElement("label",null,r.createElement("input",{type:n,name:t.props.questionText}),e))});return this.props.hasOther&&(e=r.createElement("label",null,this.props.otherText||"Other",":"," ",r.createElement("input",{type:"text"}))),r.createElement("div",null,r.createElement("p",null,this.props.questionText,this.props.isRequired?" *":""),r.createElement("ul",null,o),e)}}),c.Editor=r.createClass({displayName:"Editor",propTypes:{isMultiple:r.PropTypes.bool,isRequired:r.PropTypes.bool,hasOther:r.PropTypes.bool,questionText:r.PropTypes.string,choices:r.PropTypes.array,otherText:r.PropTypes.string,onSave:r.PropTypes.func},getInitialState:function(){return{config:{questionText:this.props.questionText||"",choices:this.props.choices||["","",""],isRequired:this.props.hasOwnProperty("isRequired")?this.props.isRequired:!1,isMultiple:this.props.hasOwnProperty("isMultiple")?this.props.isMultiple:!1,hasOther:this.props.hasOther||!1,otherText:this.props.otherText||"Other"}}},render:function(){var e,t,n=this.state.config.choices.map(this._renderChoice);return this.state.config.questionText&&this._areChoicesValid()&&(t=r.createElement("button",{onClick:this._onSave},"Done")),this.state.config.hasOther&&(e=r.createElement("p",null,r.createElement("label",null,"Enter 'Other' text ",r.createElement("input",{type:"text",value:this.state.config.otherText,onChange:this._linkText.bind(this,"otherText"),defaultValue:"Other"})))),r.createElement(l,{state:this.state.config,onUndo:this._onUndoOrRedo,onRedo:this._onUndoOrRedo},r.createElement("p",null,r.createElement("label",null,"Required? ",r.createElement("input",{type:"checkbox",checked:this.state.config.isRequired,onChange:this._linkBool.bind(this,"isRequired")}))),r.createElement("p",null,r.createElement("label",null,"Multiple? ",r.createElement("input",{type:"checkbox",checked:this.state.config.isMultiple,onChange:this._linkBool.bind(this,"isMultiple")}))),r.createElement("label",null,"Enter question text: ",r.createElement("input",{type:"text",value:this.state.config.questionText,onChange:this._linkText.bind(this,"questionText"),placeholder:"Enter question text"})),r.createElement("p",null,"Specify choices:"),r.createElement(s,{components:n,onReorder:this._reorderChoices,verify:function(){return!0}}),r.createElement("p",null,r.createElement(i,{onClick:this._addChoice,bsStyle:"success",ariaLabel:"Add choice",title:"Add choice"},r.createElement(a,{glyph:"plus"}))),r.createElement("p",null,r.createElement("label",null,"Has other? ",r.createElement("input",{type:"checkbox",checked:this.state.config.hasOther,onChange:this._linkBool.bind(this,"hasOther")}))),e,t)},_linkText:function(e,t){var n={config:{}};n.config[e]={$set:t.target.value},this.setState(o(this.state,n))},_linkBool:function(e,t){var n={config:{}};n.config[e]={$set:t.target.checked},this.setState(o(this.state,n))},_onUndoOrRedo:function(e){this.setState({config:e})},_renderChoice:function(e,t){return r.createElement("div",{draggable:!0,key:t,choice:e},r.createElement("input",{onChange:this._updateChoice.bind(this,t),value:e,type:"text"}),r.createElement(i,{onClick:this._removeChoice.bind(this,t),bsStyle:"danger",ariaLabel:"Remove choice",title:"Remove choice"},r.createElement(a,{glyph:"remove"})))},_updateChoice:function(e,t){var n={choices:{}};n.choices[e]={$set:t.target.value},u.updateState(this,n)},_addChoice:function(){var e={config:{choices:{$push:[""]}}};u.updateState(this,e)},_removeChoice:function(e){var t={config:{choices:{$splice:[[e,1]]}}};u.updateState(this,t)},_reorderChoices:function(e){var t={config:{choices:{$set:e.map(function(e){return e.props.choice})}}};this.setState(o(this.state,t))},_areChoicesValid:function(){return this._hasAtLeastTwoChoices()&&!this._hasBlankChoiceInTheMiddle()},_hasAtLeastTwoChoices:function(){return this.state.config.choices.filter(function(e){return""!==e}).length>1},_hasBlankChoiceInTheMiddle:function(){return!u.areItemsContiguous(this.state.config.choices)},_onSave:function(){var e=this.state.config.choices.filter(function(e){return""!==e}),t={questionText:this.state.config.questionText,isMultiple:this.state.config.isMultiple,isRequired:this.state.config.isRequired,choices:e};this.state.config.hasOther&&(t.hasOther=!0,t.otherText=this.state.config.otherText),this.props.onSave(t)}}),e.exports=c},function(e,t,n){"use strict";function r(e){return i(e).Displayer}function o(e){return i(e).Editor}function i(e){return"Text"===e?c:"Choice"===e?p:"Paragraph"===e?f:"Score group"===e?d:"Address"===e?h:void 0}var a=n(13),s=n(10),u=s.addons.update,l=n(142),c=n(182),p=n(305),f=n(307),d=n(308),h=n(304),m=n(117),v=n(84),g=["Text","Paragraph","Choice","Score group"],y=[{id:"gender",type:"Choice",props:{questionText:"Gender",choices:["Male","Female","Other"]}},{id:"address",type:"Address"}],b=s.createClass({displayName:"FormBuilder",getDefaultProps:function(){return{cannedQuestions:y}},getInitialState:function(){return{isEditing:null,form:this.props.form||[{type:"Score group",props:{questionText:"Please rate the following",scores:[{label:"Disagree"},{label:"Unsure"},{label:"Agree"}],questions:[{text:"Mark is awesome"},{text:"React is awesome"},{text:"Porto is awesome"}]}},{type:"Text",props:{questionText:"Who's the daddy?"}},{type:"Choice",props:{isRequired:!1,isMultiple:!0,questionText:"Favourite Rainbow characters?",choices:["rod","jane","freddy"],hasOther:!0,otherText:"Other"}},{type:"Paragraph",props:{questionText:"Please enter your life story"}}]}},_isEditing:function(){return null!==this.state.isEditing},render:function(){var e=this.state.form.map(this._renderField);return this._isEditing()||(e=s.createElement(l,{components:e,onReorder:this._reorderFields,verify:function(){return!0}})),s.createElement(v,{state:this.state.form,onUndo:this._onUndo,onRedo:this._onUndo},e,this._newFieldMenu())},_onUndo:function(e){this.setState({form:e})},_renderField:function(e,t){var n,i,u,l=this.state.isEditing===t;l?(n=o(e.type),u=s.createElement("button",{className:"btn",onClick:this._cancelEditField},"Cancel")):n=r(e.type),e.cannedID||this._isEditing()||(i=s.createElement("button",{className:"btn btn-success",onClick:this._editField.bind(this,t)},"Edit"));var c=a({},e.props,{onSave:this._saveField.bind(this,t)});return n=s.createElement(n,c),s.createElement("div",{draggable:!this._isEditing(),field:e,key:t,style:{border:"2px solid #f8f8f8",padding:5,margin:"10px 0px"}},s.createElement("div",{className:l?"well":""},n),i," ",u,this._isEditing()?null:s.createElement("button",{className:"btn btn-danger",onClick:this._removeField.bind(this,t)},"Remove"))},_newFieldMenu:function(){var e=this.state.form.filter(function(e){return e.cannedID}).map(function(e){return e.cannedID}),t=this.props.cannedQuestions.filter(function(t){return-1===e.indexOf(t.id)});return s.createElement("select",{className:"form-control",onChange:this._addField},s.createElement("option",{value:""},"Select question type to add"),s.createElement("optgroup",{label:"New field"},g.map(function(e){return s.createElement("option",{key:e,value:e},e)})),t.length?s.createElement("optgroup",{label:"Canned field"},t.map(function(e){return s.createElement("option",{value:e.id,key:e.id},e.id)})):null)},_addField:function(e){var t,n,r=e.target.value,o=this.props.cannedQuestions.filter(function(e){return e.id===r});e.target.value="",o.length?(n=o[0],t={form:{$push:[{cannedID:n.id,type:n.type,props:n.props}]}}):t={isEditing:{$set:this.state.form.length},form:{$push:[{type:r}]}},m.updateState(this,t)},_editField:function(e){this.setState({isEditing:e})},_cancelEditField:function(){this.setState({isEditing:null})},_removeField:function(e){var t={form:{$splice:[[e,1]]}};e===this.state.isEditing&&(t.isEditing={$set:null}),m.updateState(this,t)},_reorderFields:function(e){var t={form:e.map(function(e){return e.props.field})};this.setState(t,function(){console.log(t.form===this.state.form)})},_saveField:function(e,t){var n={form:{},isEditing:{$set:null}};n.form[e]={props:{$set:t}},this.setState(u(this.state,n))}});e.exports=b},function(e,t,n){"use strict";var r=n(10),o=n(182),i=r.createClass({displayName:"Paragraph",render:function(){}});i.Displayer=r.createClass({displayName:"Displayer",propTypes:{questionText:r.PropTypes.string,isRequired:r.PropTypes.bool},render:function(){return r.createElement("div",null,r.createElement("label",null,this.props.questionText,this.props.isRequired?"*":""),r.createElement("p",null,r.createElement("textarea",null)))}}),i.Editor=o.Editor,e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={},r=n;return e.forEach(function(n,o){var i={};o===e.length-1&&(i=t),r[n]=i,r=i}),n}var i=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{!r&&s["return"]&&s["return"]()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(440),s=r(a),u=n(10),l=u.addons.update,c=n(117),p=/^\d+$/,f=n(142),d=n(84),h=u.createClass({displayName:"ScoreGroup",render:function(){}});h.Displayer=u.createClass({displayName:"Displayer",propTypes:{questionText:u.PropTypes.string,isRequired:u.PropTypes.bool,scores:u.PropTypes.arrayOf(u.PropTypes.shape({label:u.PropTypes.string,value:u.PropTypes.number})),questions:u.PropTypes.arrayOf(u.PropTypes.shape({text:u.PropTypes.string,scores:u.PropTypes.arrayOf(u.PropTypes.number)}))},render:function(){var e=this.props.scores||[],t=e.map(function(e,t){var n=u.addons.classSet({"col-md-1":!0,"col-md-offset-3":0==t});return u.createElement("div",{className:n},e.label)}),n=this.props.questions.map(function(t,n){var r=e.map(function(e){return u.createElement("div",{className:"col-md-1"},u.createElement("input",{name:t.text,type:"radio"}))});return u.createElement("div",{
className:"row"},u.createElement("div",{className:"col-md-3"},t.text),r)});return u.createElement("div",null,u.createElement("p",null,this.props.questionText,this.props.isRequired?"*":""),u.createElement("div",{className:"row"},t),n)}}),h.Editor=u.createClass({displayName:"Editor",propTypes:{questionText:u.PropTypes.string,isRequired:u.PropTypes.bool,scores:u.PropTypes.arrayOf(u.PropTypes.shape({label:u.PropTypes.string,value:u.PropTypes.number})),questions:u.PropTypes.arrayOf(u.PropTypes.shape({text:u.PropTypes.string,scores:u.PropTypes.arrayOf(u.PropTypes.number)})),onSave:u.PropTypes.func},getInitialState:function(){var e=s["default"](this.props);return e.scores||(e.scores=["","",""].map(function(e,t){return{label:e}})),e.questions||(e.questions=["","",""].map(function(e,t){return{text:e}})),delete e.onSave,{config:e}},render:function(){var e;return this._isValid()&&(e=u.createElement("p",null,u.createElement("button",{onClick:this._onSave},"Done"))),u.createElement(d,{state:this.state.config,onUndo:this._onunredo,onRedo:this._onunredo},u.createElement("p",null,u.createElement("label",null,"Required? ",u.createElement("input",{type:"checkbox",checked:this.state.config.isRequired,onChange:this._updateRequired}))),u.createElement("label",null,"Enter question text: ",u.createElement("input",{type:"text",value:this.state.config.questionText,onChange:this._updateText,placeholder:"Enter question text"})),u.createElement("p",null,"Specify scores:"),this._renderScores(),u.createElement("button",{onClick:this._addScore},"Add"),u.createElement("p",null,"Specify questions:"),this._renderQuestions(),u.createElement("button",{onClick:this._addQuestion},"Add"),e)},_onunredo:function(e){this.setState({config:e})},_renderScores:function(){var e=this.state.config.scores.map(this._renderScore);return u.createElement(f,{components:e,onReorder:this._reorderItems.bind(this,"scores"),verify:function(){return!0}})},_renderScore:function(e,t){return u.createElement("div",{item:e,key:t,draggable:!0},"Label ",u.createElement("input",{type:"text",value:e.label,onChange:this._update.bind(this,"scores","label",t)})," Value ",u.createElement("input",{type:"number",value:e.value,onChange:this._update.bind(this,"scores","value",t)})," (default ",t,") ",u.createElement("button",{onClick:this._removeItem.bind(this,"scores",t)},"Remove"))},_renderQuestions:function(){var e=this.state.config.questions.map(this._renderQuestion);return u.createElement(f,{components:e,onReorder:this._reorderItems.bind(this,"questions"),verify:function(){return!0}})},_renderQuestion:function(e,t){return u.createElement("div",{item:e,draggable:!0,key:t},"Question ",u.createElement("input",{type:"text",value:e.text,onChange:this._update.bind(this,"questions","text",t)}),u.createElement("button",{onClick:this._removeItem.bind(this,"questions",t)},"Remove"))},_updateText:function(e){this.setState(l(this.state,{config:{questionText:{$set:e.target.value}}}))},_updateRequired:function(e){this.setState(l(this.state,{config:{isRequired:{$set:e.target.checked}}}))},_update:function(e,t,n,r){var i=r.target.value,a=o(["config",e,n,t],{$set:i});this.setState(l(this.state,a))},_addScore:function(){var e={config:{scores:{$push:[{label:""}]}}};c.updateState(this,e)},_addQuestion:function(){var e={config:{questions:{$push:[{text:""}]}}};c.updateState(this,e)},_removeItem:function(e,t){var n=o(["config",e],{$splice:[[t,1]]});c.updateState(this,n)},_reorderItems:function(e,t){var n=o(["config",e],{$set:t.map(function(e){return e.props.item})});c.updateState(this,n)},_isValid:function(){return this.state.config.questionText&&this._hasAtLeastTwoScores()&&this._hasAtLeastOneQuestion()&&this._areScoresContiguous()&&this._areQuestionsContiguous()&&this._hasValueForEachScore()&&this._areScoresAndQuestionsUnique()},_hasAtLeastTwoScores:function(){return this.state.config.scores.filter(function(e){return""!==e.label}).length>1},_hasAtLeastOneQuestion:function(){return this.state.config.questions.filter(function(e){return""!==e.text}).length>0},_areScoresContiguous:function(){return this._areItemsContiguous("scores","label")&&this._areItemsContiguous("scores","value")},_areQuestionsContiguous:function(){return this._areItemsContiguous("questions","text")},_hasValueForEachScore:function(){return this._areAllValuesEmpty()||this._hasIntValueForEachScore()},_areScoresAndQuestionsUnique:function(){var e=this;return[["scores","label"],["scores","value"],["questions","text"]].every(function(t){var n=i(t,2),r=n[0],o=n[1],a=e.state.config[r].map(function(e){return e[o]}).filter(function(e){return!c.isBlank(e)});return new Set(a).size===a.length})},_areAllValuesEmpty:function(){var e=this.state.config.scores.map(function(e){return e.value});return c.areAllValuesEmpty(e)},_hasIntValueForEachScore:function(){return this.state.config.scores.every(function(e){return c.isBlank(e.label)||p.test(e.value)})},_areItemsContiguous:function(e,t){var n=this.state.config[e].map(function(e){return e[t]});return c.areItemsContiguous(n)},_onSave:function(){var e=s["default"](this.state.config);this.props.onSave(e)}}),e.exports=h},function(e,t,n){"use strict";var r=n(1),o=n(292),i=r.createClass({displayName:"AvatarPicker",getAvatars:function(){var e=$($("#avatar_svgs").text()),t=[];return e.find("g").show(),e.find(">g[id!=guides]").each(function(){var n=e.clone();n.find(">g").remove(),n.append($(this)),t.push([$(this).attr("id"),n.get(0).outerHTML])}),t},render:function(){var e=this.getAvatars().map(function(e){var t=e[0],n=function(){o.changeAvatar(t)};return r.createElement("li",{key:t},r.createElement("a",{onClick:n,dangerouslySetInnerHTML:{__html:e[1]},href:"#"}))});return r.createElement("div",{className:"btn-group"},r.createElement("button",{type:"button",className:"btn btn-default dropdown-toggle","data-toggle":"dropdown","aria-expanded":"false"},"Change avatar ",r.createElement("span",{className:"caret"})),r.createElement("ul",{className:"dropdown-menu",role:"menu"},e))}});e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=function(e){function t(e){var n=this;o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._edit=function(){n.setState({isEditing:!0},function(){return l["default"].findDOMNode(n.refs.bio).focus()})},this._cancelEdit=function(){n.setState({isEditing:!1,currentValue:n.props.bio})},this._save=function(){n.setState({isEditing:!1}),n.props.onSave(n.state.currentValue)},this.state={isEditing:!1,currentValue:this.props.bio}}return i(t,e),a(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({currentValue:e.bio})}},{key:"render",value:function(){var e=this;return this.state.isEditing?l["default"].createElement("div",null,l["default"].createElement("div",{className:"form-group"},l["default"].createElement("textarea",{className:"form-control",ref:"bio",value:this.state.currentValue,onChange:function(t){return e.setState({currentValue:t.target.value})}})),l["default"].createElement("div",{className:"form-group"},l["default"].createElement("button",{type:"button",className:"btn btn-default",onClick:this._cancelEdit},"Cancel")," ",l["default"].createElement("button",{type:"button",className:"btn btn-success",onClick:this._save,disabled:!this.state.currentValue||this.state.currentValue===this.props.bio},"Save"))):l["default"].createElement("div",null,l["default"].createElement("button",{type:"button",className:"btn btn-default btn-xs","aria-label":"Edit",onClick:this._edit},l["default"].createElement("span",{className:"glyphicon glyphicon-pencil","aria-hidden":"true"})),l["default"].createElement("p",null,this.state.currentValue))}}],[{key:"propTypes",value:{bio:u.PropTypes.string.isRequired,onSave:u.PropTypes.func.isRequired},enumerable:!0}]),t}(l["default"].Component);t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(310),p=r(c),f=n(54),d=function(e){function t(){var e=this;o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={bio:null,status:null},this._save=function(t){var n=e.state.bio;n.bio=t,e.setState({bio:n,status:"saving"},function(){f.put("/di/api/users/"+DITTO.user+"/",n).done(function(){e.setState({status:"saved"})}).fail(function(){e.setState({status:"failed"})})})}}return i(t,e),a(t,[{key:"componentDidMount",value:function(){var e=this;f.get("/di/api/users/"+DITTO.user+"/").done(function(t){console.log("got bio",t),e.setState({bio:t})})}},{key:"render",value:function(){var e=this.state.status,t=void 0,n=void 0;return"saving"===e?(t="info",n="Saving..."):"failed"===e?(t="danger",n="An error occurred while saving, please try again"):"saved"===e&&(t="success",n="Changes saved"),l["default"].createElement("div",null,null!==e?l["default"].createElement("p",{className:"bg-"+t},n):null,l["default"].createElement(p["default"],{bio:null===this.state.bio?"Loading...":this.state.bio.bio,onSave:this._save}))}}]),t}(l["default"].Component);t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){return{messages:p.getAllForCurrentThread(),connection:s["default"].get()}}function i(e){return d.createElement(c,{key:e.id,message:e})}var a=n(115),s=r(a),u=n(11),l=r(u),c=n(175),p=n(83),f=n(119),d=n(1),h=d.createClass({displayName:"ChatModule",mixins:[f],getInitialState:function(){return o()},componentDidMount:function(){this._scrollToBottom(),p.addChangeListener(this._onChange),s["default"].addChangeListener(this._onChange)},componentWillUnmount:function(){p.removeChangeListener(this._onChange),s["default"].removeChangeListener(this._onChange)},render:function(){if(console.log("status",this.state.connection),this.state.connection===l["default"].disconnected)return d.createElement("div",{style:e,ref:"messageList"},d.createElement("p",null,"Sorry, there was an error connecting to chat."));if(this.state.connection!==l["default"].connected)return d.createElement("div",{style:e,ref:"messageList"},d.createElement("p",null,"Loading ..."));var e,t=this.state.messages.map(i);return this.props.fluidHeight&&(e={height:this.state.height}),this.state.messages.length?d.createElement("div",{className:"message-section"},d.createElement("ul",{style:e,className:"message-list",ref:"messageList"},t)):d.createElement("div",{style:e,ref:"messageList"},d.createElement("p",null,"There is no one in the chatroom."))},componentDidUpdate:function(){this._scrollToBottom()},_scrollToBottom:function(){var e=this.refs.messageList.getDOMNode();e.scrollTop=e.scrollHeight},_onChange:function(){this.setState(o())}});e.exports=h},function(e,t,n){"use strict";var r=n(1),o=r.createClass({displayName:"LeftRightAlign",render:function(){var e=r.cloneElement(this.props.children[0],{style:{"float":"left"}}),t=r.cloneElement(this.props.children[1],{style:{"float":"right"}});return r.createElement("div",{className:"clearfix"},e," ",t)}});e.exports=o},function(e,t,n){"use strict";function r(){return{currentID:u.getCurrentID(),threadType:u.getThreadType(),thread:u.getCurrent()}}var o=n(28),i=n(52),a=n(1),s=n(118),u=n(31),l=n(315),c=n(19),p=a.createClass({displayName:"SessionCreator",mixins:[o.Navigation],componentDidMount:function(){u.addChangeListener(this._onStoreChange)},componentWillUnmount:function(){u.removeChangeListener(this._onStoreChange)},getInitialState:function(){var e=r();return e.text="",e.user=null,e},render:function(){return this.state.currentID?this.state.threadType==u.session?this.state.thread.isEnded?a.createElement(l,{sessionID:this.state.currentID,rating:this.state.thread.rating}):a.createElement("button",{onClick:this._endSession,className:"btn btn-primary"},"End session"):null:a.createElement("form",{className:"form-horizontal",onSubmit:this._onSubmit},a.createElement("h4",null,"Start new ",this.state.threadType===u.session?"session":"chat"),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"col-md-3"},a.createElement("label",null,this.state.threadType===u.session?"With":"Recipient")),a.createElement("div",{className:"col-md-9"},a.createElement(s,{value:this.state.user,onChange:this._onUserChange}))),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"col-md-3"},a.createElement("label",{forHtml:"id-message"},this.state.threadType===u.session?"Session title":"Subject (optional)")),a.createElement("div",{className:"col-md-9"},a.createElement("input",{id:"id-message",className:"form-control",name:"message",value:this.state.text,onChange:this._onChange}))),a.createElement("input",{disabled:!this._isValid(),className:"btn btn-success",type:"submit",value:"Create "+(this.state.threadType===u.session?"session":"chat")}))},_isValid:function(){return this.state.threadType===u.message&&this.state.user||this.state.text&&this.state.user},_onChange:function(e,t){this.setState({text:e.target.value})},_onUserChange:function(e){this.setState({user:e})},_onSubmit:function(e){e.preventDefault();var t,n,r=this.state.text.trim();t=[DITTO.user,this.state.user],t.sort(),t=t.join(":"),n=t,r&&(n=t+":"+r),this.state.threadType===u.session&&(n="session:"+n),this.transitionTo(c[this.state.threadType](n)),this.setState({text:"",user:null})},_endSession:function(){i.endThread(this.state.currentID)},_onStoreChange:function(){this.setState(r())}});e.exports=p},function(e,t,n){"use strict";var r=n(1),o=n(52),i=n(11),a=r.createClass({displayName:"SessionRating",propTypes:{sessionID:r.PropTypes.string.isRequired,rating:r.PropTypes.number},getInitialState:function(){return{rating:null}},render:function(){var e,t=this;return e=this._isPending()?"Loading rating...":this._isRated()?r.createElement("p",null,'You rated this session "',i.sessionRatings[this.props.rating],'".'):r.createElement("form",{onSubmit:this._onSubmit},r.createElement("p",null,DITTO.postSessionQuestion),i.sessionRatings.map(function(e,n){return r.createElement("p",{key:e},r.createElement("label",null,r.createElement("input",{checked:n===t.state.rating,onChange:t._updateRating.bind(t,n),value:n,name:"rating",type:"radio"})," ",e))}),r.createElement("input",{disabled:null===this.state.rating,className:"btn btn-primary",type:"submit"})),r.createElement("div",null,r.createElement("p",null,"This session has ended."),e)},_isPending:function(){return void 0===this.props.rating},_isRated:function(){return null!==this.props.rating},_updateRating:function(e){this.setState({rating:e})},_onSubmit:function(e){e.preventDefault(),o.rateThread(this.props.sessionID,this.state.rating)}});e.exports=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(28),i=n(59),a=n(54),s=n(317),u=r(s),l=n(10),c=n(129),p=n(43),f=n(609),d=n(19),h=l.addons.update,m=c.Table,v=c.Column,g=l.createClass({displayName:"TicketTable",getInitialState:function(){return{dataList:[]}},componentDidMount:function(){var e=this;a.get(d.api.tickets()).done(function(t){e.setState({dataList:t})})},_rowGetter:function(e){return this.state.dataList[e]},_cellDataGetter:function(e,t){return t.case_note[e]},_renderDate:function(e){var t=p.ISODateStringToDate(e);return f("%d/%m/%Y | %I:%M%p",t)},_renderTitle:function(e,t,n,r){return l.createElement(o.Link,{to:d.ticket(n.id)},e)},render:function(){var e,t=this;return void 0!==this.props.params.id&&(e=this.state.dataList.find(function(e){return e.id==t.props.params.id})),l.createElement("div",null,e?null:l.createElement(m,{rowHeight:50,rowGetter:this._rowGetter,rowsCount:this.state.dataList.length,width:900,maxHeight:600,headerHeight:50},l.createElement(v,{label:"CLIENT",width:150,dataKey:"client",cellDataGetter:this._cellDataGetter}),l.createElement(v,{label:"PROFESSIONAL",width:150,dataKey:"author",cellDataGetter:this._cellDataGetter}),l.createElement(v,{label:"TITLE",width:150,dataKey:"title",cellDataGetter:this._cellDataGetter,cellRenderer:this._renderTitle}),l.createElement(v,{label:"CREATED AT",width:150,dataKey:"created_at",cellRenderer:this._renderDate}),l.createElement(v,{label:"ASSIGNED TO",width:150,dataKey:"assigned_to"}),l.createElement(v,{label:"RESOLVED?",width:150,dataKey:"is_resolved"})),e?l.createElement("div",null,l.createElement(u["default"],{ticket:e}),l.createElement(o.Link,{className:"btn btn-default",to:d.tickets()},"Close"),this._isResolvable(e)?l.createElement("button",{className:"btn btn-success",onClick:this._resolve.bind(this,e)},"Resolve"):null,this._isClaimable(e)?l.createElement("button",{className:"btn btn-success",onClick:this._claim.bind(this,e)},"Claim"):null):null)},_isClaimable:function(e){return!e.assigned_to},_isResolvable:function(e){return e.assigned_to===DITTO.user&&!e.is_resolved},_claim:function(e){var t=this.state.dataList[e],n={};n[e]={assigned_to:{$set:DITTO.user}},this.setState({dataList:h(this.state.dataList,n)},function(){return a.post(t.claim_url)})},_resolve:function(e){var t=this.state.dataList[e],n={};n[e]={is_resolved:{$set:!0}},this.setState({dataList:h(this.state.dataList,n)},function(){return a.post(t.resolve_url)})}}),y=l.createElement(o.Router,{history:i.history},l.createElement(o.Route,{path:d.tickets(),component:g}),l.createElement(o.Route,{path:d.ticket(":id"),component:g}));e.exports=y},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},s=n(10),u=function(e){function t(){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.ticket;return s.createElement("div",null,s.createElement("h3",null,e.case_note.title),e.assigned_to?s.createElement("p",null,s.createElement("strong",null,"Assigned to")," ",e.assigned_to):null,e.assigned_to?s.createElement("p",null,s.createElement("strong",null,"Resolved?")," ",String(e.is_resolved)):null,s.createElement("p",null,e.case_note.text))}}],[{key:"propTypes",value:{ticket:s.PropTypes.object.isRequired},enumerable:!0}]),t}(s.Component);t["default"]=u,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={casenotes:"/"+DITTO.tenant+"/api/casenotes/"};t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(185),i=r(o),a=n(10),s=n(111),u=a.createClass({displayName:"CaseNoteEditor",mixins:[a.addons.LinkedStateMixin],getInitialState:function(){return{text:this.props.initialText||"",title:this.props.initialText||"",shareRoles:this.props.initialShareRoles||[],shareUsers:this.props.initialShareUsers||[],isValid:{title:!1,text:!1}}},render:function(){return a.createElement("div",null,a.createElement(i["default"],{id:"title",isRequired:!0,messages:{isRequired:"Please enter a title"},onChange:this._updateValidation.bind(this,"title")},a.createElement("input",{className:"form-control",placeholder:"Enter note title",value:this.state.title,onChange:this._updateSharing.bind(this,"title")})),a.createElement(i["default"],{id:"text",isRequired:!0,maxWords:150,onChange:this._updateValidation.bind(this,"text")},a.createElement("textarea",{className:"form-control",placeholder:"Enter note text",value:this.state.text,onChange:this._updateSharing.bind(this,"text")})),a.createElement("p",null,"Select any roles and/or users you want to share this note with."),a.createElement(s,{onChangeRoles:this._updateSharing.bind(this,"shareRoles"),onChangeUsers:this._updateSharing.bind(this,"shareUsers"),selectedRoles:this.state.shareRoles,users:this.state.shareUsers}),a.createElement("p",null,a.createElement("button",{className:"btn btn-success",disabled:!this.state.isValid.title||!this.state.isValid.text,onClick:this._onSave},"save"),a.createElement("button",{className:"btn btn-default",onClick:this._onCancel},"cancel")))},_onCancel:function(){this.setState(this.getInitialState())},_updateSharing:function(e,t){var n={};n[e]=t,this.setState(n)},_updateValidation:function(e,t){var n=this.state.isValid,r=n[e];console.log("update validation",e,r,t),n[e]=t,this.setState({isValid:n})},_onSave:function(){this.props.onSave(this.state.title,this.state.text,this.state.shareUsers,this.state.shareRoles),this.setState({title:"",text:"",shareRoles:[],shareUsers:[]})}});e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(68),p=r(c),f=n(326),d=r(f),h=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),a(t,[{key:"render",value:function(){return l["default"].createElement("div",null,l["default"].createElement("dl",null,l["default"].createElement("dt",null,"Author:"),l["default"].createElement("dd",null,this.props.caseNote.author),l["default"].createElement("dt",null,"On:"),l["default"].createElement("dd",null,l["default"].createElement(p["default"],{when:this.props.caseNote.created_at})),l["default"].createElement("dt",null,"Title:"),l["default"].createElement("dd",null,this.props.caseNote.title),l["default"].createElement("dt",null,"Note:"),l["default"].createElement("dd",null,this.props.caseNote.text)),l["default"].createElement("h3",null,"Comments"),l["default"].createElement(d["default"],{contentType:"casenote",objectID:this.props.caseNote.id}))}}]),t}(l["default"].Component);t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(485),p=n(263),f=n(184),d=r(f),h=n(323),m=r(h),v=n(319),g=r(v),y=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),a(t,[{key:"render",value:function(){return l["default"].createElement(c.TabbedArea,{defaultActiveKey:2,bsStyle:"tabs"},l["default"].createElement(c.TabPane,{tab:"New note",eventKey:1},this.props.caseNotes.map(function(e){return console.log(e.title,e.status),e.status===p.itemStatus.pending?l["default"].createElement(c.Alert,{key:e.id,bsStyle:"warning"},"Saving note '",e.title,"'..."):e.status===p.itemStatus.saved?l["default"].createElement(c.Alert,{key:e.id,bsStyle:"success"},"Saved note '",e.title,"'"):e.status===p.itemStatus.failed?l["default"].createElement(c.Alert,{key:e.id,bsStyle:"danger"},"Error saving note '",e.title,"'"):void 0}),l["default"].createElement(g["default"],{onSave:this.props.onSave})),l["default"].createElement(c.TabPane,{tab:"View case history",eventKey:2},this.props.caseNotes?l["default"].createElement(m["default"],{caseNotes:this.props.caseNotes,showNote:this.props.showNote}):"Loading...",l["default"].createElement("input",{type:"search",placeholder:"Search"})))}}],[{key:"propTypes",value:{showNote:l["default"].PropTypes.number,caseNotes:d["default"].caseNotes,onSave:l["default"].PropTypes.func.isRequired},enumerable:!0},{key:"defaultProps",value:{caseNotes:[]},enumerable:!0}]),t}(l["default"].Component);t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(){return c["default"].createElement(d.Router,{history:h.history},c["default"].createElement(d.Route,{path:"/di/users/",ignoreScrollBehavior:!0},c["default"].createElement(d.Route,{path:":client/",component:_,ignoreScrollBehavior:!0}),c["default"].createElement(d.Route,{path:":client/:id/",component:_,ignoreScrollBehavior:!0})))}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},l=n(1),c=r(l),p=n(608),f=n(598),d=n(28),h=n(59),m=n(321),v=r(m),g=n(327),y=r(g),b=f.createRedux(y["default"].reducers),_=function(e){function t(){o(this,n),u(Object.getPrototypeOf(n.prototype),"constructor",this).apply(this,arguments)}i(t,e),s(t,[{key:"componentDidMount",value:function(){this.props.dispatch(y["default"].actionCreators.casenotes.list({client__username:this.props.params.client}))}},{key:"render",value:function(){var e=this.props,t=e.caseNotes,n=e.dispatch;return c["default"].createElement(v["default"],{caseNotes:t,showNote:parseInt(this.props.params.id,10),dispatch:n,onSave:this._saveNote.bind(this)})}},{key:"_saveNote",value:function(e,t,n,r){this.props.dispatch(y["default"].actionCreators.casenotes.create({client:this.props.params.client,title:e,text:t,shared_with_roles:r,shared_with_users:n}))}}]);var n=t;return t=p.connect(function(e){return{caseNotes:e.casenotes_items}})(t)||t}(c["default"].Component),E=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){return c["default"].createElement(p.Provider,{redux:b},a)}}]),t}(c["default"].Component);t["default"]=E,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(e){var t=v["default"].parse(window.location.href).pathname;return v["default"].resolve(t,e)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},l=n(1),c=r(l),p=n(129),f=n(28),d=n(68),h=r(d),m=n(616),v=r(m),g=n(320),y=r(g),b=n(184),_=r(b),E=function(e){function t(){var e=this;o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this._rowGetter=function(t){return e.props.caseNotes[t]},this._renderDateTime=function(e){return c["default"].createElement(h["default"],{when:e})},this._renderTitle=function(e,t,n,r){return c["default"].createElement(f.Link,{to:a("../"+n.client+"/"+n.id+"/")
},e)}}return i(t,e),s(t,[{key:"render",value:function(){var e=this,t=void 0;return void 0!==this.props.showNote&&(t=this.props.caseNotes.find(function(t){return t.id==e.props.showNote})),c["default"].createElement("div",null,t?c["default"].createElement("div",null,c["default"].createElement(f.Link,{to:a("../"),className:"btn btn-default"},"Back"),c["default"].createElement(y["default"],{caseNote:t})):c["default"].createElement(p.Table,{rowHeight:50,rowGetter:this._rowGetter,rowsCount:this.props.caseNotes.length,width:600,maxHeight:600,headerHeight:50},c["default"].createElement(p.Column,{label:"AUTHOR",width:150,dataKey:"author"}),c["default"].createElement(p.Column,{label:"CREATED",width:150,dataKey:"created_at",cellRenderer:this._renderDateTime}),c["default"].createElement(p.Column,{label:"TITLE",width:150,dataKey:"title",cellRenderer:this._renderTitle}),c["default"].createElement(p.Column,{label:"STATUS",width:150,dataKey:"status"})))}}],[{key:"propTypes",value:{caseNotes:_["default"].caseNotes.isRequired,showNote:c["default"].PropTypes.number},enumerable:!0}]),t}(c["default"].Component);t["default"]=E,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(68),p=r(c),f=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),a(t,[{key:"render",value:function(){return l["default"].createElement("dl",null,l["default"].createElement("dt",null,"by:"),l["default"].createElement("dd",null,this.props.comment.user),l["default"].createElement("dt",null,"on:"),l["default"].createElement("dd",null,l["default"].createElement(p["default"],{when:this.props.comment.submit_date})),l["default"].createElement("dt",null,"comment:"),l["default"].createElement("dd",null,this.props.comment.comment))}}]),t}(l["default"].Component);t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(185),p=r(c),f=function(e){function t(){var e=this;o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={comment:""},this._onSubmit=function(t){t.preventDefault(),e.props.onSubmit(e.state.comment),e.setState({comment:""})}}return i(t,e),a(t,[{key:"render",value:function(){var e=this;return l["default"].createElement("form",{onSubmit:this._onSubmit},l["default"].createElement("div",{className:"form-group"},l["default"].createElement(p["default"],{isRequired:!0,id:"comment"},l["default"].createElement("textarea",{className:"form-control",ref:"text",value:this.state.comment,onChange:function(t){return e.setState({comment:t})}})),l["default"].createElement("input",{className:"btn btn-success",disabled:!this.state.comment,type:"submit"})))}}],[{key:"propTypes",value:{onSubmit:l["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(l["default"].Component);t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(54),p=n(324),f=r(p),d=n(325),h=r(d),m="/di/api/comments/",v=function(e){function t(){var e=this;o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={comments:[]},this._onSubmit=function(t){c.post(m,{comment:t,object_pk:String(e.props.objectID),content_type:e.props.contentType}).done(function(t){e.setState({comments:t})}).fail(function(){alert("error saving comment")})}}return i(t,e),a(t,[{key:"componentDidMount",value:function(){var e=this;c.get(m,{content_type__model:this.props.contentType,object_pk:this.props.objectID}).done(function(t){e.setState({comments:t})})}},{key:"render",value:function(){return l["default"].createElement("div",null,l["default"].createElement(h["default"],{onSubmit:this._onSubmit}),this.state.comments.map(function(e){return l["default"].createElement(f["default"],{key:e.id,comment:e})}))}}],[{key:"propTypes",value:{contentType:l["default"].PropTypes.string.isRequired,objectID:l["default"].PropTypes.number.isRequired},enumerable:!0}]),t}(l["default"].Component);t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(263),i=r(o),a=n(318),s=r(a),u=new i["default"](s["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},s=n(28),u=n(59),l=n(54),c=n(10),p=n(129),f=(n(43),n(19)),d=function(e){function t(){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),i(t,[{key:"render",value:function(){return c.createElement("p",null,"ta da!")}}]),t}(c.Component),h=(c.addons.update,p.Table),m=p.Column,v=c.createClass({displayName:"UserTable",getInitialState:function(){return{rows:[],filteredRows:[],filteredBy:null}},componentDidMount:function(){var e=this;l.get(f.api.users()).done(function(t){e.isMounted()&&e.setState({rows:t,filteredRows:[],filterBy:null},function(){return e._filterRowsBy(e.state.filterBy)})})},_filterRowsBy:function(e){var t=this.state.rows.slice(),n=e?t.filter(function(t){return t.username.toLowerCase().indexOf(e.toLowerCase())>=0}):t;this.setState({filteredRows:n,filterBy:e})},_rowGetter:function(e){return this.state.filteredRows[e]},_onFilterChange:function(e){this._filterRowsBy(e.target.value)},_renderUsername:function(e,t,n,r){return c.createElement(s.Link,{to:f.user(e)},e)},render:function(){var e,t=this;return void 0!==this.props.params.username&&(e=this.state.rows.find(function(e){return e.username==t.props.params.username})),c.createElement("div",null,c.createElement("input",{onChange:this._onFilterChange,placeholder:"Filter by username"}),e?null:c.createElement(h,{rowHeight:50,rowGetter:this._rowGetter,rowsCount:this.state.rows.length,width:750,maxHeight:600,headerHeight:50},c.createElement(m,{label:"USER NAME",width:150,dataKey:"username",cellRenderer:this._renderUsername}),c.createElement(m,{label:"FIRST NAME",width:150,dataKey:"first_name"}),c.createElement(m,{label:"LAST NAME",width:150,dataKey:"last_name"}),c.createElement(m,{label:"EMAIL",width:150,dataKey:"email"}),c.createElement(m,{label:"ROLE",width:150,dataKey:"role"})),e?c.createElement("div",null,c.createElement(d,{user:e}),c.createElement(s.Link,{className:"btn btn-default",to:f.users()},"Close")):null)}}),g=c.createElement(s.Router,{history:u.history},c.createElement(s.Route,{path:f.users(),component:v}),c.createElement(s.Route,{path:f.user(":username"),component:v}));e.exports=g},function(e,t,n){(function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(330),i=r(o);if(n(382),n(383),i["default"](e),t._babelPolyfill)throw new Error("only one instance of babel/polyfill is allowed");t._babelPolyfill=!0}).call(t,n(269)(e),function(){return this}())},function(e,t,n){(function(r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(449),a=o(i),s=a["default"].resolve(r,"../../../");t["default"]=function(e){if(e.parent&&0!==e.parent.filename.indexOf(s))throw new Error("Don't hotlink internal Babel files.")},e.exports=t["default"]}).call(t,"/")},function(e,t,n){var r=n(2),o=n(191);e.exports=Object.assign||function(e,t){for(var n=Object(r.assertDefined(e)),i=arguments.length,a=1;i>a;)for(var s,u=r.ES5Object(arguments[a++]),l=o(u),c=l.length,p=0;c>p;)n[s=l[p++]]=u[s];return n}},function(e,t){e.exports=function(e){return e.FW=!0,e.path=e.g,e}},function(e,t,n){var r=n(2);e.exports=function(e,t){for(var n,o=r.toObject(e),i=r.getKeys(o),a=i.length,s=0;a>s;)if(o[n=i[s++]]===t)return n}},function(e,t,n){"use strict";var r=n(2),o=n(87),i=n(17).fn;e.exports=function(){for(var e=i(this),t=arguments.length,n=Array(t),a=0,s=r.path._,u=!1;t>a;)(n[a]=arguments[a++])===s&&(u=!0);return function(){var r,i=this,a=arguments.length,l=0,c=0;if(!u&&!a)return o(e,n,i);if(r=n.slice(),u)for(;t>l;l++)r[l]===s&&(r[l]=arguments[c++]);for(;a>c;)r.push(arguments[c++]);return o(e,r,i)}}},function(e,t,n){function r(e,t){return function(n){var r,o=P(n),i=0,a=[];for(r in o)r!=d&&C(o,r)&&a.push(r);for(;t>i;)C(o,r=e[i++])&&(~k(a,r)||a.push(r));return a}}function o(){}function i(e){return function(t,n){h.fn(t);var r=P(this),o=D(r.length),i=e?o-1:0,a=e?-1:1;if(arguments.length<2)for(;;){if(i in r){n=r[i],i+=a;break}i+=a,h(e?i>=0:o>i,"Reduce of empty array with no initial value")}for(;e?i>=0:o>i;i+=a)i in r&&(n=t(n,r[i],i,this));return n}}function a(e){return e>9?e:"0"+e}var s=n(2),u=n(190),l=n(20),c=n(5),p=n(87),f=n(85),d=n(32).safe("__proto__"),h=n(17),m=h.obj,v=Object.prototype,g=s.html,y=[],b=y.slice,_=y.join,E=l.classof,C=s.has,T=s.setDesc,w=s.getDesc,S=s.setDescs,O=s.isFunction,x=s.isObject,P=s.toObject,D=s.toLength,N=s.toIndex,M=!1,k=n(186)(!1),R=f(0),I=f(1),A=f(2),j=f(3),L=f(4);if(!s.DESC){try{M=8==T(u("div"),"x",{get:function(){return 8}}).x}catch(F){}s.setDesc=function(e,t,n){if(M)try{return T(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(m(e)[t]=n.value),e},s.getDesc=function(e,t){if(M)try{return w(e,t)}catch(n){}return C(e,t)?s.desc(!v.propertyIsEnumerable.call(e,t),e[t]):void 0},s.setDescs=S=function(e,t){m(e);for(var n,r=s.getKeys(t),o=r.length,i=0;o>i;)s.setDesc(e,n=r[i++],t[n]);return e}}c(c.S+c.F*!s.DESC,"Object",{getOwnPropertyDescriptor:s.getDesc,defineProperty:s.setDesc,defineProperties:S});var H="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),U=H.concat("length","prototype"),B=H.length,V=function(){var e,t=u("iframe"),n=B,r=">";for(t.style.display="none",g.appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object</script"+r),e.close(),V=e.F;n--;)delete V.prototype[H[n]];return V()};c(c.S,"Object",{getPrototypeOf:s.getProto=s.getProto||function(e){return e=Object(h.def(e)),C(e,d)?e[d]:O(e.constructor)&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?v:null},getOwnPropertyNames:s.getNames=s.getNames||r(U,U.length,!0),create:s.create=s.create||function(e,t){var n;return null!==e?(o.prototype=m(e),n=new o,o.prototype=null,n[d]=e):n=V(),void 0===t?n:S(n,t)},keys:s.getKeys=s.getKeys||r(H,B,!1),seal:function(e){return e},freeze:function(e){return e},preventExtensions:function(e){return e},isSealed:function(e){return!x(e)},isFrozen:function(e){return!x(e)},isExtensible:function(e){return x(e)}}),c(c.P,"Function",{bind:function(e){function t(){var o=r.concat(b.call(arguments)),i=this instanceof t,a=i?s.create(n.prototype):e,u=p(n,o,a);return i?a:u}var n=h.fn(this),r=b.call(arguments,1);return n.prototype&&(t.prototype=n.prototype),t}}),0 in Object("z")&&"z"=="z"[0]||(s.ES5Object=function(e){return"String"==l(e)?e.split(""):Object(e)});var W=!0;try{g&&b.call(g),W=!1}catch(F){}c(c.P+c.F*W,"Array",{slice:function(e,t){var n=D(this.length),r=l(this);if(t=void 0===t?n:t,"Array"==r)return b.call(this,e,t);for(var o=N(e,n),i=N(t,n),a=D(i-o),s=Array(a),u=0;a>u;u++)s[u]="String"==r?this.charAt(o+u):this[o+u];return s}}),c(c.P+c.F*(s.ES5Object!=Object),"Array",{join:function(){return _.apply(s.ES5Object(this),arguments)}}),c(c.S,"Array",{isArray:function(e){return"Array"==l(e)}}),c(c.P,"Array",{forEach:s.each=s.each||function(e){return R(this,e,arguments[1])},map:function(e){return I(this,e,arguments[1])},filter:function(e){return A(this,e,arguments[1])},some:function(e){return j(this,e,arguments[1])},every:function(e){return L(this,e,arguments[1])},reduce:i(!1),reduceRight:i(!0),indexOf:function(e){return k(this,e,arguments[1])},lastIndexOf:function(e,t){var n=P(this),r=D(n.length),o=r-1;for(arguments.length>1&&(o=Math.min(o,s.toInteger(t))),0>o&&(o=D(r+o));o>=0;o--)if(o in n&&n[o]===e)return o;return-1}}),c(c.P,"String",{trim:n(122)(/^\s*([\s\S]*\S)?\s*$/,"$1")}),c(c.S,"Date",{now:function(){return+new Date}});var q=new Date(-5e13-1),z=!(q.toISOString&&"0385-07-25T07:06:39.999Z"==q.toISOString()&&n(126)(function(){new Date(NaN).toISOString()}));c(c.P+c.F*z,"Date",{toISOString:function(){if(!isFinite(this))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=0>t?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}}),"Object"==E(function(){return arguments}())&&(l.classof=function(e){var t=E(e);return"Object"==t&&O(e.callee)?"Arguments":t})},function(e,t,n){"use strict";var r=n(2),o=n(5),i=r.toIndex;o(o.P,"Array",{copyWithin:function(e,t){var n=Object(r.assertDefined(this)),o=r.toLength(n.length),a=i(e,o),s=i(t,o),u=arguments[2],l=void 0===u?o:i(u,o),c=Math.min(l-s,o-a),p=1;for(a>s&&s+c>a&&(p=-1,s=s+c-1,a=a+c-1);c-->0;)s in n?n[a]=n[s]:delete n[a],a+=p,s+=p;return n}}),n(55)("copyWithin")},function(e,t,n){"use strict";var r=n(2),o=n(5),i=r.toIndex;o(o.P,"Array",{fill:function(e){for(var t=Object(r.assertDefined(this)),n=r.toLength(t.length),o=i(arguments[1],n),a=arguments[2],s=void 0===a?n:i(a,n);s>o;)t[o++]=e;return t}}),n(55)("fill")},function(e,t,n){"use strict";var r="findIndex",o=n(5),i=!0,a=n(85)(6);r in[]&&Array(1)[r](function(){i=!1}),o(o.P+o.F*i,"Array",{findIndex:function(e){return a(this,e,arguments[1])}}),n(55)(r)},function(e,t,n){"use strict";var r="find",o=n(5),i=!0,a=n(85)(5);r in[]&&Array(1)[r](function(){i=!1}),o(o.P+o.F*i,"Array",{find:function(e){return a(this,e,arguments[1])}}),n(55)(r)},function(e,t,n){var r=n(2),o=n(44),i=n(5),a=n(35),s=n(193);i(i.S+i.F*!n(121)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,u,l=Object(r.assertDefined(e)),c=arguments[1],p=void 0!==c,f=p?o(c,arguments[2],2):void 0,d=0;if(a.is(l))for(u=a.get(l),n=new("function"==typeof this?this:Array);!(i=u.next()).done;d++)n[d]=p?s(u,f,[i.value,d],!0):i.value;else for(n=new("function"==typeof this?this:Array)(t=r.toLength(l.length));t>d;d++)n[d]=p?f(l[d],d):l[d];return n.length=d,n}})},function(e,t,n){var r=n(5);r(r.S,"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)n[e]=arguments[e++];return n.length=t,n}})},function(e,t,n){n(89)(Array)},function(e,t,n){var r=n(2),o=n(21)("hasInstance"),i=Function.prototype;o in i||r.setDesc(i,o,{value:function(e){if(!r.isFunction(this)||!r.isObject(e))return!1;if(!r.isObject(this.prototype))return e instanceof this;for(;e=r.getProto(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){"use strict";var r=n(2),o="name",i=r.setDesc,a=Function.prototype;o in a||r.FW&&r.DESC&&i(a,o,{configurable:!0,get:function(){var e=String(this).match(/^\s*function ([^ (]*)/),t=e?e[1]:"";return r.has(this,o)||i(this,o,r.desc(5,t)),t},set:function(e){r.has(this,o)||i(this,o,r.desc(0,e))}})},function(e,t,n){"use strict";var r=n(187);n(86)("Map",function(e){return function(){return e(this,arguments[0])}},{get:function(e){var t=r.getEntry(this,e);return t&&t.v},set:function(e,t){return r.def(this,0===e?0:e,t)}},r,!0)},function(e,t,n){function r(e){return e+1/g-1/g}function o(e){return 0==(e=+e)||e!=e?e:0>e?-1:1}function i(e){return isFinite(e=+e)&&0!=e?0>e?-i(-e):d(e+h(e*e+1)):e}function a(e){return 0==(e=+e)?e:e>-1e-6&&1e-6>e?e+e*e/2:f(e)-1}var s=1/0,u=n(5),l=Math.E,c=Math.pow,p=Math.abs,f=Math.exp,d=Math.log,h=Math.sqrt,m=Math.ceil,v=Math.floor,g=c(2,-52),y=c(2,-23),b=c(2,127)*(2-y),_=c(2,-126);u(u.S,"Math",{acosh:function(e){return(e=+e)<1?NaN:isFinite(e)?d(e/l+h(e+1)*h(e-1)/l)+1:e},asinh:i,atanh:function(e){return 0==(e=+e)?e:d((1+e)/(1-e))/2},cbrt:function(e){return o(e=+e)*c(p(e),1/3)},clz32:function(e){return(e>>>=0)?31-v(d(e+.5)*Math.LOG2E):32},cosh:function(e){return(f(e=+e)+f(-e))/2},expm1:a,fround:function(e){var t,n,i=p(e),a=o(e);return _>i?a*r(i/_/y)*_*y:(t=(1+y/g)*i,n=t-(t-i),n>b||n!=n?a*s:a*n)},hypot:function(e,t){for(var n,r,o=0,i=0,a=arguments.length,u=0;a>i;)n=p(arguments[i++]),n>u?(r=u/n,o=o*r*r+1,u=n):n>0?(r=n/u,o+=r*r):o+=n;return u===s?s:u*h(o)},imul:function(e,t){var n=65535,r=+e,o=+t,i=n&r,a=n&o;return 0|i*a+((n&r>>>16)*a+i*(n&o>>>16)<<16>>>0)},log1p:function(e){return(e=+e)>-1e-8&&1e-8>e?e-e*e/2:d(1+e)},log10:function(e){return d(e)/Math.LN10},log2:function(e){return d(e)/Math.LN2},sign:o,sinh:function(e){return p(e=+e)<1?(a(e)-a(-e))/2:(f(e-1)-f(-e-1))*(l/2)},tanh:function(e){var t=a(e=+e),n=a(-e);return t==s?1:n==s?-1:(t-n)/(f(e)+f(-e))},trunc:function(e){return(e>0?v:m)(e)}})},function(e,t,n){"use strict";function r(e){var t,n;if(s(t=e.valueOf)&&!a(n=t.call(e)))return n;if(s(t=e.toString)&&!a(n=t.call(e)))return n;throw TypeError("Can't convert object to number")}function o(e){if(a(e)&&(e=r(e)),"string"==typeof e&&e.length>2&&48==e.charCodeAt(0)){var t=!1;switch(e.charCodeAt(1)){case 66:case 98:t=!0;case 79:case 111:return parseInt(e.slice(2),t?2:8)}}return+e}var i=n(2),a=i.isObject,s=i.isFunction,u="Number",l=i.g[u],c=l,p=l.prototype;!i.FW||l("0o1")&&l("0b1")||(l=function(e){return this instanceof l?new c(o(e)):o(e)},i.each.call(i.DESC?i.getNames(c):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),function(e){i.has(c,e)&&!i.has(l,e)&&i.setDesc(l,e,i.getDesc(c,e))}),l.prototype=p,p.constructor=l,n(36)(i.g,u,l))},function(e,t,n){function r(e){return!o.isObject(e)&&u(e)&&s(e)===e}var o=n(2),i=n(5),a=Math.abs,s=Math.floor,u=o.g.isFinite,l=9007199254740991;i(i.S,"Number",{EPSILON:Math.pow(2,-52),isFinite:function(e){return"number"==typeof e&&u(e)},isInteger:r,isNaN:function(e){return e!=e},isSafeInteger:function(e){return r(e)&&a(e)<=l},MAX_SAFE_INTEGER:l,MIN_SAFE_INTEGER:-l,parseFloat:parseFloat,parseInt:parseInt})},function(e,t,n){var r=n(5);r(r.S,"Object",{assign:n(331)})},function(e,t,n){var r=n(5);r(r.S,"Object",{is:n(195)})},function(e,t,n){var r=n(5);r(r.S,"Object",{setPrototypeOf:n(123).set})},function(e,t,n){var r=n(2),o=n(5),i=r.isObject,a=r.toObject;r.each.call("freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames".split(","),function(e,t){var s=(r.core.Object||{})[e]||Object[e],u=0,l={};l[e]=0==t?function(e){return i(e)?s(e):e}:1==t?function(e){return i(e)?s(e):e}:2==t?function(e){return i(e)?s(e):e}:3==t?function(e){return i(e)?s(e):!0}:4==t?function(e){return i(e)?s(e):!0}:5==t?function(e){return i(e)?s(e):!1}:6==t?function(e,t){return s(a(e),t)}:7==t?function(e){return s(Object(r.assertDefined(e)))}:8==t?function(e){return s(a(e))}:n(192).get;try{s("z")}catch(c){u=1}o(o.S+o.F*u,"Object",l)})},function(e,t,n){"use strict";var r=n(20),o={};o[n(21)("toStringTag")]="z",n(2).FW&&"z"!=r(o)&&n(36)(Object.prototype,"toString",function(){return"[object "+r.classof(this)+"]"},!0)},function(e,t,n){"use strict";function r(e){var t=new D(function(){});return e&&(t.constructor=Object),D.resolve(t)===t}function o(e){return M(e)&&(I?"Promise"==m.classof(e):T in e)}function i(e,t){return d.FW||e!==D||t!==f?_(e,t):!0}function a(e){var t=R(e)[C];return void 0!=t?t:e}function s(e){var t;return M(e)&&(t=e.then),N(t)?t:!1}function u(e){var t=e.c;t.length&&P.call(S,function(){function n(t){var n,i,a=o?t.ok:t.fail;try{a?(o||(e.h=!0),n=a===!0?r:a(r),n===t.P?t.rej(TypeError("Promise-chain cycle")):(i=s(n))?i.call(n,t.res,t.rej):t.res(n)):t.rej(r)}catch(u){t.rej(u)}}for(var r=e.v,o=1==e.s,i=0;t.length>i;)n(t[i++]);t.length=0})}function l(e){var t,n=e[T],r=n.a||n.c,o=0;if(n.h)return!1;for(;r.length>o;)if(t=r[o++],t.fail||!l(t.P))return!1;return!0}function c(e){var t,n=this;n.d||(n.d=!0,n=n.r||n,n.v=e,n.s=2,n.a=n.c.slice(),setTimeout(function(){P.call(S,function(){l(t=n.p)&&(x?O.emit("unhandledRejection",e,t):S.console&&console.error&&console.error("Unhandled promise rejection",e)),n.a=void 0})},1),u(n))}function p(e){var t,n=this;if(!n.d){n.d=!0,n=n.r||n;try{(t=s(e))?P.call(S,function(){var r={r:n,d:!1};try{t.call(e,h(p,r,1),h(c,r,1))}catch(o){c.call(r,o)}}):(n.v=e,n.s=1,u(n))}catch(r){c.call({r:n,d:!1},r)}}}var f,d=n(2),h=n(44),m=n(20),v=n(5),g=n(17),y=n(69),b=n(123).set,_=n(195),E=n(89),C=n(21)("species"),T=n(32).safe("record"),w="Promise",S=d.g,O=S.process,x="process"==m(O),P=O&&O.nextTick||n(198).set,D=S[w],N=d.isFunction,M=d.isObject,k=g.fn,R=g.obj,I=function(){function e(t){var n=new D(t);return b(n,e.prototype),n}var t=!1;try{if(t=N(D)&&N(D.resolve)&&r(),b(e,D),e.prototype=d.create(D.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(t=!1),t&&d.DESC){var n=!1;D.resolve(d.setDesc({},"then",{get:function(){n=!0}})),t=n}}catch(o){t=!1}return t}();I||(D=function(e){k(e);var t={p:g.inst(this,D,w),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1};d.hide(this,T,t);try{e(h(p,t,1),h(c,t,1))}catch(n){c.call(t,n)}},n(88)(D.prototype,{then:function(e,t){var n=R(R(this).constructor)[C],r={ok:N(e)?e:!0,fail:N(t)?t:!1},o=r.P=new(void 0!=n?n:D)(function(e,t){r.res=k(e),r.rej=k(t)}),i=this[T];return i.c.push(r),i.a&&i.a.push(r),i.s&&u(i),o},"catch":function(e){return this.then(void 0,e)}})),v(v.G+v.W+v.F*!I,{Promise:D}),m.set(D,w),E(D),E(f=d.core[w]),v(v.S+v.F*!I,w,{reject:function(e){return new(a(this))(function(t,n){n(e)})}}),v(v.S+v.F*(!I||r(!0)),w,{resolve:function(e){return o(e)&&i(e.constructor,this)?e:new this(function(t){t(e)})}}),v(v.S+v.F*!(I&&n(121)(function(e){D.all(e)["catch"](function(){})})),w,{all:function(e){var t=a(this),n=[];return new t(function(r,o){y(e,!1,n.push,n);var i=n.length,a=Array(i);i?d.each.call(n,function(e,n){t.resolve(e).then(function(e){a[n]=e,--i||r(a)},o)}):r(a)})},race:function(e){var t=a(this);return new t(function(n,r){y(e,!1,function(e){t.resolve(e).then(n,r)})})}})},function(e,t,n){function r(e){o.set(this,l,{o:e,k:void 0,i:0})}var o=n(2),i=n(5),a=n(123),s=n(35),u=n(21)("iterator"),l=n(32).safe("iter"),c=s.step,p=n(17),f=o.isObject,d=o.getProto,h=o.g.Reflect,m=Function.apply,v=p.obj,g=Object.isExtensible||f,y=Object.preventExtensions,b=!(h&&h.enumerate&&u in h.enumerate({}));s.create(r,"Object",function(){var e,t=this[l],n=t.k;if(void 0==n){t.k=n=[];for(e in t.o)n.push(e)}do if(t.i>=n.length)return c(1);while(!((e=n[t.i++])in t.o));return c(0,e)});var _={apply:function(e,t,n){return m.call(e,t,n)},construct:function(e,t){var n=p.fn(arguments.length<3?e:arguments[2]).prototype,r=o.create(f(n)?n:Object.prototype),i=m.call(e,r,t);return f(i)?i:r},defineProperty:function(e,t,n){v(e);try{return o.setDesc(e,t,n),!0}catch(r){return!1}},deleteProperty:function(e,t){var n=o.getDesc(v(e),t);return n&&!n.configurable?!1:delete e[t]},get:function E(e,t){var n,r=arguments.length<3?e:arguments[2],i=o.getDesc(v(e),t);return i?o.has(i,"value")?i.value:void 0===i.get?void 0:i.get.call(r):f(n=d(e))?E(n,t,r):void 0},getOwnPropertyDescriptor:function(e,t){return o.getDesc(v(e),t)},getPrototypeOf:function(e){return d(v(e))},has:function(e,t){return t in e},isExtensible:function(e){return g(v(e))},ownKeys:n(194),preventExtensions:function(e){v(e);try{return y&&y(e),!0}catch(t){return!1}},set:function C(e,t,n){var r,i,a=arguments.length<4?e:arguments[3],s=o.getDesc(v(e),t);if(!s){if(f(i=d(e)))return C(i,t,n,a);s=o.desc(0)}return o.has(s,"value")?s.writable!==!1&&f(a)?(r=o.getDesc(a,t)||o.desc(0),r.value=n,o.setDesc(a,t,r),!0):!1:void 0===s.set?!1:(s.set.call(a,n),!0)}};a&&(_.setPrototypeOf=function(e,t){a.check(e,t);try{return a.set(e,t),!0}catch(n){return!1}}),i(i.G,{Reflect:{}}),i(i.S+i.F*b,"Reflect",{enumerate:function(e){return new r(v(e))}}),i(i.S,"Reflect",_)},function(e,t,n){var r=n(2),o=n(20),i=r.g.RegExp,a=i,s=i.prototype,u=/a/g,l=new i(u)!==u,c=function(){try{return"/a/i"==i(u,"i")}catch(e){}}();r.FW&&r.DESC&&(l&&c||(i=function(e,t){var n="RegExp"==o(e),r=void 0===t;return this instanceof i||!n||!r?l?new a(n&&!r?e.source:e,t):new a(n?e.source:e,n&&r?e.flags:t):e},r.each.call(r.getNames(a),function(e){e in i||r.setDesc(i,e,{configurable:!0,get:function(){return a[e]},set:function(t){a[e]=t}})}),s.constructor=i,i.prototype=s,n(36)(r.g,"RegExp",i)),"g"!=/./g.flags&&r.setDesc(s,"flags",{configurable:!0,get:n(122)(/^.*\/(\w*)$/,"$1")})),n(89)(i)},function(e,t,n){"use strict";var r=n(187);n(86)("Set",function(e){return function(){return e(this,arguments[0])}},{add:function(e){return r.def(this,e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r=n(5),o=n(125)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(2),o=n(20),i=n(5),a=r.toLength;i(i.P+i.F*!n(126)(function(){"q".endsWith(/./)}),"String",{endsWith:function(e){if("RegExp"==o(e))throw TypeError();var t=String(r.assertDefined(this)),n=arguments[1],i=a(t.length),s=void 0===n?i:Math.min(a(n),i);return e+="",t.slice(s-e.length,s)===e}})},function(e,t,n){var r=n(5),o=n(2).toIndex,i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(65536>t?i(t):i(((t-=65536)>>10)+55296,t%1024+56320))}return n.join("")}})},function(e,t,n){"use strict";var r=n(2),o=n(20),i=n(5);i(i.P,"String",{includes:function(e){if("RegExp"==o(e))throw TypeError();return!!~String(r.assertDefined(this)).indexOf(e,arguments[1])}})},function(e,t,n){var r=n(2).set,o=n(125)(!0),i=n(32).safe("iter"),a=n(35),s=a.step;n(120)(String,"String",function(e){r(this,i,{o:String(e),i:0})},function(){var e,t=this[i],n=t.o,r=t.i;return r>=n.length?s(1):(e=o(n,r),t.i+=e.length,s(0,e))})},function(e,t,n){var r=n(2),o=n(5);o(o.S,"String",{raw:function(e){for(var t=r.toObject(e.raw),n=r.toLength(t.length),o=arguments.length,i=[],a=0;n>a;)i.push(String(t[a++])),o>a&&i.push(String(arguments[a]));return i.join("")}})},function(e,t,n){var r=n(5);r(r.P,"String",{repeat:n(197)})},function(e,t,n){"use strict";var r=n(2),o=n(20),i=n(5);i(i.P+i.F*!n(126)(function(){"q".startsWith(/./)}),"String",{startsWith:function(e){if("RegExp"==o(e))throw TypeError();var t=String(r.assertDefined(this)),n=r.toLength(Math.min(arguments[1],t.length));return e+="",t.slice(n,n+e.length)===e}})},function(e,t,n){"use strict";function r(e){var t=j[e]=p.set(T(N.prototype),k,e);return E&&M&&F(_,e,{configurable:!0,set:function(t){C(this,R)&&C(this[R],e)&&(this[R][e]=!1),F(this,e,O(1,t))}}),t}function o(e,t,n){return n&&C(j,t)?(n.enumerable?(C(e,R)&&e[R][t]&&(e[R][t]=!1),n=T(n,{enumerable:O(0,!1)})):(C(e,R)||S(e,R,O(1,{})),e[R][t]=!0),F(e,t,n)):S(e,t,n)}function i(e,t){b(e);for(var n,r=y(t=D(t)),i=0,a=r.length;a>i;)o(e,n=r[i++],t[n]);return e}function a(e,t){return void 0===t?T(e):i(T(e),t)}function s(e){var t=I.call(this,e);return t||!C(this,e)||!C(j,e)||C(this,R)&&this[R][e]?t:!0}function u(e,t){var n=w(e=D(e),t);return!n||!C(j,t)||C(e,R)&&e[R][t]||(n.enumerable=!0),n}function l(e){for(var t,n=P(D(e)),r=[],o=0;n.length>o;)C(j,t=n[o++])||t==R||r.push(t);return r}function c(e){for(var t,n=P(D(e)),r=[],o=0;n.length>o;)C(j,t=n[o++])&&r.push(j[t]);return r}var p=n(2),f=n(20).set,d=n(32),h=n(124),m=n(5),v=n(36),g=n(333),y=n(191),b=n(17).obj,_=Object.prototype,E=p.DESC,C=p.has,T=p.create,w=p.getDesc,S=p.setDesc,O=p.desc,x=n(192),P=x.get,D=p.toObject,N=p.g.Symbol,M=!1,k=d("tag"),R=d("hidden"),I={}.propertyIsEnumerable,A=h("symbol-registry"),j=h("symbols"),L=p.isFunction(N),F=E?function(){try{return T(S({},R,{get:function(){return S(this,R,{value:!1})[R]}}))[R]||S}catch(e){return function(e,t,n){var r=w(_,t);r&&delete _[t],S(e,t,n),r&&e!==_&&S(_,t,r)}}}():S;L||(N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor");return r(d(arguments[0]))},v(N.prototype,"toString",function(){return this[k]}),p.create=a,p.setDesc=o,p.getDesc=u,p.setDescs=i,p.getNames=x.get=l,p.getSymbols=c,p.DESC&&p.FW&&v(_,"propertyIsEnumerable",s,!0));var H={"for":function(e){return C(A,e+="")?A[e]:A[e]=N(e)},keyFor:function(e){return g(A,e)},useSetter:function(){M=!0},useSimple:function(){M=!1}};p.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(e){var t=n(21)(e);H[e]=L?t:r(t)}),M=!0,m(m.G+m.W,{Symbol:N}),m(m.S,"Symbol",H),m(m.S+m.F*!L,"Object",{
create:a,defineProperty:o,defineProperties:i,getOwnPropertyDescriptor:u,getOwnPropertyNames:l,getOwnPropertySymbols:c}),f(N,"Symbol"),f(Math,"Math",!0),f(p.g.JSON,"JSON",!0)},function(e,t,n){"use strict";var r=n(2),o=n(189),i=o.leakStore,a=o.ID,s=o.WEAK,u=r.has,l=r.isObject,c=Object.isExtensible||l,p={},f=n(86)("WeakMap",function(e){return function(){return e(this,arguments[0])}},{get:function(e){if(l(e)){if(!c(e))return i(this).get(e);if(u(e,s))return e[s][this[a]]}},set:function(e,t){return o.def(this,e,t)}},o,!0,!0);7!=(new f).set((Object.freeze||Object)(p),7).get(p)&&r.each.call(["delete","has","get","set"],function(e){var t=f.prototype,r=t[e];n(36)(t,e,function(t,n){if(l(t)&&!c(t)){var o=i(this)[e](t,n);return"set"==e?this:o}return r.call(this,t,n)})})},function(e,t,n){"use strict";var r=n(189);n(86)("WeakSet",function(e){return function(){return e(this,arguments[0])}},{add:function(e){return r.def(this,e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(5),o=n(186)(!0);r(r.P,"Array",{includes:function(e){return o(this,e,arguments[1])}}),n(55)("includes")},function(e,t,n){n(188)("Map")},function(e,t,n){var r=n(2),o=n(5),i=n(194);o(o.S,"Object",{getOwnPropertyDescriptors:function(e){var t=r.toObject(e),n={};return r.each.call(i(t),function(e){r.setDesc(n,e,r.desc(0,r.getDesc(t,e)))}),n}})},function(e,t,n){function r(e){return function(t){var n,r=o.toObject(t),i=o.getKeys(r),a=i.length,s=0,u=Array(a);if(e)for(;a>s;)u[s]=[n=i[s++],r[n]];else for(;a>s;)u[s]=r[i[s++]];return u}}var o=n(2),i=n(5);i(i.S,"Object",{values:r(!1),entries:r(!0)})},function(e,t,n){var r=n(5);r(r.S,"RegExp",{escape:n(122)(/[\\^$*+?.()|[\]{}]/g,"\\$&",!0)})},function(e,t,n){n(188)("Set")},function(e,t,n){"use strict";var r=n(5),o=n(125)(!0);r(r.P,"String",{at:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(5),o=n(196);r(r.P,"String",{lpad:function(e){return o(this,e,arguments[1],!0)}})},function(e,t,n){"use strict";var r=n(5),o=n(196);r(r.P,"String",{rpad:function(e){return o(this,e,arguments[1],!1)}})},function(e,t,n){function r(e,t){o.each.call(e.split(","),function(e){void 0==t&&e in a?s[e]=a[e]:e in[]&&(s[e]=n(44)(Function.call,[][e],t))})}var o=n(2),i=n(5),a=o.core.Array||Array,s={};r("pop,reverse,shift,keys,values,entries",1),r("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),r("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill,turn"),i(i.S,"Array",s)},function(e,t,n){n(199);var r=n(2),o=n(35).Iterators,i=n(21)("iterator"),a=o.Array,s=r.g.NodeList,u=r.g.HTMLCollection,l=s&&s.prototype,c=u&&u.prototype;r.FW&&(!s||i in l||r.hide(l,i,a),!u||i in c||r.hide(c,i,a)),o.NodeList=o.HTMLCollection=a},function(e,t,n){var r=n(5),o=n(198);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},function(e,t,n){function r(e){return l?function(t,n){return e(a(s,[].slice.call(arguments,2),o.isFunction(t)?t:Function(t)),n)}:e}var o=n(2),i=n(5),a=n(87),s=n(334),u=o.g.navigator,l=!!u&&/MSIE .\./.test(u.userAgent);i(i.G+i.B+i.F*l,{setTimeout:r(o.g.setTimeout),setInterval:r(o.g.setInterval)})},function(e,t,n){n(335),n(366),n(349),n(350),n(351),n(353),n(352),n(344),n(343),n(347),n(348),n(346),n(360),n(363),n(362),n(358),n(359),n(361),n(364),n(365),n(340),n(341),n(199),n(342),n(336),n(337),n(339),n(338),n(356),n(354),n(345),n(357),n(367),n(368),n(355),n(369),n(375),n(376),n(377),n(373),n(371),n(372),n(370),n(374),n(378),n(381),n(380),n(379),e.exports=n(2).core},function(e,t,n){(function(t,n){!function(t){"use strict";function r(e,t,n,r){var o=Object.create((t||i).prototype);return o._invoke=p(e,n||null,new h(r||[])),o}function o(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}function i(){}function a(){}function s(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){this.arg=e}function c(e){function t(t,n){var r=e[t](n),o=r.value;return o instanceof l?Promise.resolve(o.arg).then(i,a):Promise.resolve(o).then(function(e){return r.value=e,r})}function r(e,n){var r=o?o.then(function(){return t(e,n)}):new Promise(function(r){r(t(e,n))});return o=r["catch"](function(e){}),r}"object"==typeof n&&n.domain&&(t=n.domain.bind(t));var o,i=t.bind(e,"next"),a=t.bind(e,"throw");t.bind(e,"return"),this._invoke=r}function p(e,t,n){var r=C;return function(i,a){if(r===w)throw new Error("Generator is already running");if(r===S){if("throw"===i)throw a;return v()}for(;;){var s=n.delegate;if(s){if("return"===i||"throw"===i&&s.iterator[i]===g){n.delegate=null;var u=s.iterator["return"];if(u){var l=o(u,s.iterator,a);if("throw"===l.type){i="throw",a=l.arg;continue}}if("return"===i)continue}var l=o(s.iterator[i],s.iterator,a);if("throw"===l.type){n.delegate=null,i="throw",a=l.arg;continue}i="next",a=g;var c=l.arg;if(!c.done)return r=T,c;n[s.resultName]=c.value,n.next=s.nextLoc,n.delegate=null}if("next"===i)r===T?n.sent=a:n.sent=g;else if("throw"===i){if(r===C)throw r=S,a;n.dispatchException(a)&&(i="next",a=g)}else"return"===i&&n.abrupt("return",a);r=w;var l=o(e,t,n);if("normal"===l.type){r=n.done?S:T;var c={value:l.arg,done:n.done};if(l.arg!==O)return c;n.delegate&&"next"===i&&(a=g)}else"throw"===l.type&&(r=S,i="throw",a=l.arg)}}}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function d(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function m(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function o(){for(;++n<e.length;)if(y.call(e,n))return o.value=e[n],o.done=!1,o;return o.value=g,o.done=!0,o};return r.next=r}}return{next:v}}function v(){return{value:g,done:!0}}var g,y=Object.prototype.hasOwnProperty,b="function"==typeof Symbol&&Symbol.iterator||"@@iterator",_="object"==typeof e,E=t.regeneratorRuntime;if(E)return void(_&&(e.exports=E));E=t.regeneratorRuntime=_?e.exports:{},E.wrap=r;var C="suspendedStart",T="suspendedYield",w="executing",S="completed",O={},x=s.prototype=i.prototype;a.prototype=x.constructor=s,s.constructor=a,a.displayName="GeneratorFunction",E.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return t?t===a||"GeneratorFunction"===(t.displayName||t.name):!1},E.mark=function(e){return e.__proto__=s,e.prototype=Object.create(x),e},E.awrap=function(e){return new l(e)},u(c.prototype),E.async=function(e,t,n,o){var i=new c(r(e,t,n,o));return E.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},u(x),x[b]=function(){return this},x.toString=function(){return"[object Generator]"},E.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},E.values=m,h.prototype={constructor:h,reset:function(e){if(this.prev=0,this.next=0,this.sent=g,this.done=!1,this.delegate=null,this.tryEntries.forEach(d),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=g)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=y.call(o,"catchLoc"),s=y.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?this.next=o.finallyLoc:this.complete(i),O},complete:function(e,t){if("throw"===e.type)throw e.arg;"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=e.arg,this.next="end"):"normal"===e.type&&t&&(this.next=t)},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),d(n),O}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;d(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:m(e),resultName:t,nextLoc:n},O}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,function(){return this}(),n(215))},function(e,t,n){e.exports=n(329)},function(e,t,n){e.exports=n(384)},function(e,t,n){var r;/*!
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e+=" "+n;else if(Array.isArray(n))e+=" "+o.apply(null,n);else if("object"===r)for(var i in n)n.hasOwnProperty(i)&&n[i]&&(e+=" "+i)}}return e.substr(1)}"undefined"!=typeof e&&e.exports?e.exports=o:(r=function(){return o}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}()},function(e,t,n){"use strict";var r=n(208),o={hasCSSAnimations:function(){return!!r("animationName")},hasCSSTransforms:function(){return!!r("transform")},hasCSS3DTransforms:function(){return!!r("perspective")},hasCSSTransitions:function(){return!!r("transition")}};e.exports=o},function(e,t,n){"use strict";var r=n(57),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(127),i=n(26),a=n(56),s=n(207),u=n(403),l=n(390),c=n(393),p=n(204),f=n(396),d=n(397),h=n(90),m=n(46),v=n(408),g=n(57),y=n(37),b=n(91),_=n(415),E=n(70),C=i.PropTypes,T=i.Children,w=o.renderToString,S={},O=1,x=i.createClass({displayName:"FixedDataTable",propTypes:{width:C.number.isRequired,height:C.number,maxHeight:C.number,ownerHeight:C.number,overflowX:C.oneOf(["hidden","auto"]),overflowY:C.oneOf(["hidden","auto"]),rowsCount:C.number.isRequired,rowHeight:C.number.isRequired,rowHeightGetter:C.func,rowGetter:C.func.isRequired,rowClassNameGetter:C.func,groupHeaderHeight:C.number,headerHeight:C.number.isRequired,headerDataGetter:C.func,footerHeight:C.number,footerData:C.oneOfType([C.object,C.array]),footerDataGetter:C.func,scrollLeft:C.number,scrollToColumn:C.number,scrollTop:C.number,scrollToRow:C.number,onScrollStart:C.func,onScrollEnd:C.func,onContentHeightChange:C.func,onRowClick:C.func,onRowDoubleClick:C.func,onRowMouseDown:C.func,onRowMouseEnter:C.func,onRowMouseLeave:C.func,onColumnResizeEndCallback:C.func,isColumnResizing:C.bool},getDefaultProps:function(){return{footerHeight:0,groupHeaderHeight:0,headerHeight:0,scrollLeft:0,scrollTop:0}},getInitialState:function(){var e=this.props,t=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);return this._scrollHelper=new f(e.rowsCount,e.rowHeight,t,e.rowHeightGetter),e.scrollTop&&this._scrollHelper.scrollTo(e.scrollTop),this._didScrollStop=v(this._didScrollStop,160,this),this._calculateState(this.props)},componentWillMount:function(){var e=this.props.scrollToRow;void 0!==e&&null!==e&&(this._rowToScrollTo=e);var t=this.props.scrollToColumn;void 0!==t&&null!==t&&(this._columnToScrollTo=t),this._wheelHandler=new s(this._onWheel,this._shouldHandleWheelX,this._shouldHandleWheelY)},_shouldHandleWheelX:function(e){return"hidden"===this.props.overflowX?!1:(e=Math.round(e),0===e?!1:0>e&&this.state.scrollX>0||e>=0&&this.state.scrollX<this.state.maxScrollX)},_shouldHandleWheelY:function(e){return"hidden"===this.props.overflowY||0===e?!1:(e=Math.round(e),0===e?!1:0>e&&this.state.scrollY>0||e>=0&&this.state.scrollY<this.state.maxScrollY)},_reportContentHeight:function(){var e,t=this.state.scrollContentHeight,n=this.state.reservedHeight,r=t+n,o=void 0===this.props.height;e=o&&this.props.maxHeight>r?r:this.state.height>r&&this.props.ownerHeight?Math.max(r,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var n=e.scrollToColumn;void 0!==n&&null!==n&&(this._columnToScrollTo=n);var r=e.overflowX,o=e.overflowY;(r!==this.props.overflowX||o!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==r,"hidden"!==o)),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,n=this.props;t.useGroupHeader&&(e=i.createElement(p,{key:"group_header",className:b(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),data:t.groupHeaderData,width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns}));var r=this.state.maxScrollY,o=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,s=o?u.SIZE:0,l=t.height-s-2*O-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;l-=d;var h=0,v=null!=n.maxHeight?d+t.bodyHeight:d+l,g=v+t.footerHeight;void 0!==n.ownerHeight&&n.ownerHeight<t.height&&(h=n.ownerHeight-t.height,v=Math.min(v,n.ownerHeight-t.footerHeight-s),l=Math.max(0,v-d));var y;a&&(y=i.createElement(u,{size:l,contentSize:l+r,onScroll:this._onVerticalScroll,verticalTop:d,position:t.scrollY}));var _;if(o){var E=t.width;_=i.createElement(P,{contentSize:E+t.maxScrollX,offset:h,onScroll:this._onHorizontalScroll,position:t.scrollX,size:E})}var C=i.createElement(c,{height:t.height,initialWidth:t.columnResizingData.width||0,minWidth:t.columnResizingData.minWidth||0,maxWidth:t.columnResizingData.maxWidth||Number.MAX_VALUE,visible:!!t.isColumnResizing,leftOffset:t.columnResizingData.left||0,knobHeight:t.headerHeight,initialEvent:t.columnResizingData.initialEvent,onColumnResizeEnd:n.onColumnResizeEndCallback,columnKey:t.columnResizingData.key}),T=null;if(t.footerHeight){var w=n.footerDataGetter?n.footerDataGetter():n.footerData;T=i.createElement(p,{key:"footer",className:b(m("fixedDataTableLayout/footer"),m("public/fixedDataTable/footer")),data:w,fixedColumns:t.footFixedColumns,height:t.footerHeight,index:-1,zIndex:1,offsetTop:v,scrollableColumns:t.footScrollableColumns,scrollLeft:t.scrollX,width:t.width})}var S,x,D=this._renderRows(d),N=i.createElement(p,{key:"header",className:b(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),data:t.headData,width:t.width,height:t.headerHeight,index:-1,zIndex:1,offsetTop:f,scrollLeft:t.scrollX,fixedColumns:t.headFixedColumns,scrollableColumns:t.headScrollableColumns,onColumnResize:this._onColumnResize});return t.scrollY&&(S=i.createElement("div",{className:b(m("fixedDataTableLayout/topShadow"),m("public/fixedDataTable/topShadow")),style:{top:d}})),(null!=t.ownerHeight&&t.ownerHeight<t.height&&t.scrollContentHeight+t.reservedHeight>t.ownerHeight||t.scrollY<r)&&(x=i.createElement("div",{className:b(m("fixedDataTableLayout/bottomShadow"),m("public/fixedDataTable/bottomShadow")),style:{top:v}})),i.createElement("div",{className:b(m("fixedDataTableLayout/main"),m("public/fixedDataTable/main")),onWheel:this._wheelHandler.onWheel,style:{height:t.height,width:t.width}},i.createElement("div",{className:m("fixedDataTableLayout/rowsContainer"),style:{height:g,width:t.width}},C,e,N,D,T,S,x),y,_)},_renderRows:function(e){var t=this.state;return i.createElement(l,{defaultRowHeight:t.rowHeight,firstRowIndex:t.firstRowIndex,firstRowOffset:t.firstRowOffset,fixedColumns:t.bodyFixedColumns,height:t.bodyHeight,offsetTop:e,onRowClick:t.onRowClick,onRowDoubleClick:t.onRowDoubleClick,onRowMouseDown:t.onRowMouseDown,onRowMouseEnter:t.onRowMouseEnter,onRowMouseLeave:t.onRowMouseLeave,rowClassNameGetter:t.rowClassNameGetter,rowsCount:t.rowsCount,rowGetter:t.rowGetter,rowHeightGetter:t.rowHeightGetter,scrollLeft:t.scrollX,scrollableColumns:t.bodyScrollableColumns,showLastRowBorder:!0,width:t.width,rowPositionGetter:this._scrollHelper.getRowPosition})},_onColumnResize:function(e,t,n,r,o,i,a){this.setState({isColumnResizing:!0,columnResizingData:{left:t+e-n,width:n,minWidth:r,maxWidth:o,initialEvent:{clientX:a.clientX,clientY:a.clientY,preventDefault:g},key:i}})},_areColumnSettingsIdentical:function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!_(e[n].props,t[n].props))return!1;return!0},_populateColumnsAndColumnData:function(e,t,n){var r=!1,o=!1;n&&n.columns&&(r=this._areColumnSettingsIdentical(e,n.columns)),n&&n.columnGroups&&t&&(o=this._areColumnSettingsIdentical(t,n.columnGroups));var i={};if(r)i.bodyFixedColumns=n.bodyFixedColumns,i.bodyScrollableColumns=n.bodyScrollableColumns,i.headFixedColumns=n.headFixedColumns,i.headScrollableColumns=n.headScrollableColumns,i.footFixedColumns=n.footFixedColumns,i.footScrollableColumns=n.footScrollableColumns;else{var a=this._splitColumnTypes(e);i.bodyFixedColumns=a.fixed,i.bodyScrollableColumns=a.scrollable;var s=this._splitColumnTypes(this._createHeadColumns(e));i.headFixedColumns=s.fixed,i.headScrollableColumns=s.scrollable;var u=this._splitColumnTypes(this._createFootColumns(e));i.footFixedColumns=u.fixed,i.footScrollableColumns=u.scrollable}if(o)i.groupHeaderFixedColumns=n.groupHeaderFixedColumns,i.groupHeaderScrollableColumns=n.groupHeaderScrollableColumns;else if(t){i.groupHeaderData=this._getGroupHeaderData(t),t=this._createGroupHeaderColumns(t);var l=this._splitColumnTypes(t);i.groupHeaderFixedColumns=l.fixed,i.groupHeaderScrollableColumns=l.scrollable}return i.headData=this._getHeadData(e),i},_calculateState:function(e,t){y(void 0!==e.height||void 0!==e.maxHeight,"You must set either a height or a maxHeight");var n=[];T.forEach(e.children,function(e,t){null!=e&&(y(e.type.__TableColumnGroup__||e.type.__TableColumn__,"child type should be <FixedDataTableColumn /> or <FixedDataTableColumnGroup />"),n.push(e))});var o=!1;n.length&&n[0].type.__TableColumnGroup__&&(o=!0);var i,a,s=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?a=t.scrollY:(h=this._scrollHelper.scrollTo(e.scrollTop),s=h.index,l=h.offset,a=h.position),void 0!==this._rowToScrollTo&&(h=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),s=h.index,l=h.offset,a=h.position,delete this._rowToScrollTo);var c=o?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new f(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var h=this._scrollHelper.scrollToRow(s,l);s=h.index,l=h.offset,a=h.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:S;var v,g;if(o){var b=d.adjustColumnGroupWidths(n,e.width);v=b.columns,g=b.columnGroups}else v=d.adjustColumnWidths(n,e.width);var E=this._populateColumnsAndColumnData(v,g,t);if(void 0!==this._columnToScrollTo){var C=E.bodyFixedColumns.length;if(this._columnToScrollTo>=C){var w,x,P=0;for(w=0;w<E.bodyFixedColumns.length;++w)x=E.bodyFixedColumns[w],P+=x.props.width;var D=this._columnToScrollTo-C,N=0;for(w=0;D>w;++w)x=E.bodyScrollableColumns[w],N+=x.props.width;var M=e.width-P,k=E.bodyScrollableColumns[this._columnToScrollTo-C].props.width,R=N+k-M;R>i&&(i=R),i>N&&(i=N)}delete this._columnToScrollTo}var I=void 0===e.height,A=Math.round(I?e.maxHeight:e.height),j=e.footerHeight+e.headerHeight+c+2*O,L=A-j,F=this._scrollHelper.getContentHeight(),H=F+j,U=d.getTotalWidth(v),B=U>e.width&&"hidden"!==e.overflowX;B&&(L-=u.SIZE,H+=u.SIZE,j+=u.SIZE);var V=Math.max(0,U-e.width),W=Math.max(0,F-L);i=Math.min(i,V),a=Math.min(a,W),W||(I&&(A=H),L=H-j),this._scrollHelper.setViewportHeight(L);var q=r({isColumnResizing:t&&t.isColumnResizing},E,e,{columns:v,columnGroups:g,columnResizingData:m,firstRowIndex:s,firstRowOffset:l,horizontalScrollbarVisible:B,maxScrollX:V,maxScrollY:W,reservedHeight:j,scrollContentHeight:F,scrollX:i,scrollY:a,bodyHeight:L,height:A,groupHeaderHeight:c,useGroupHeader:o});return t&&(t.headData&&q.headData&&_(t.headData,q.headData)&&(q.headData=t.headData),t.groupHeaderData&&q.groupHeaderData&&_(t.groupHeaderData,q.groupHeaderData)&&(q.groupHeaderData=t.groupHeaderData)),q},_createGroupHeaderColumns:function(e){for(var t=[],n=0;n<e.length;++n)t[n]=h(e[n],{dataKey:n,children:void 0,columnData:e[n].props.columnGroupData,cellRenderer:e[n].props.groupHeaderRenderer||w,isHeaderCell:!0});return t},_createHeadColumns:function(e){for(var t=[],n=0;n<e.length;++n){var r=e[n].props;t.push(h(e[n],{cellRenderer:r.headerRenderer||w,columnData:r.columnData,dataKey:r.dataKey,isHeaderCell:!0,label:r.label}))}return t},_createFootColumns:function(e){for(var t=[],n=0;n<e.length;++n){var r=e[n].props;t.push(h(e[n],{cellRenderer:r.footerRenderer||w,columnData:r.columnData,dataKey:r.dataKey,isFooterCell:!0}))}return t},_getHeadData:function(e){if(!this.props.headerDataGetter)return null;for(var t={},n=0;n<e.length;++n){var r=e[n].props;t[r.dataKey]=this.props.headerDataGetter(r.dataKey)}return t},_getGroupHeaderData:function(e){for(var t=[],n=0;n<e.length;++n)t[n]=e[n].props.label||"";return t},_splitColumnTypes:function(e){for(var t=[],n=[],r=0;r<e.length;++r)e[r].props.fixed?t.push(e[r]):n.push(e[r]);return{fixed:t,scrollable:n}},_onWheel:function(e,t){if(this.isMounted()){this._isScrolling||this._didScrollStart();var n=this.state.scrollX;if(Math.abs(t)>Math.abs(e)&&"hidden"!==this.props.overflowY){var r=this._scrollHelper.scrollBy(Math.round(t)),o=Math.max(0,r.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:r.index,firstRowOffset:r.offset,scrollY:r.position,scrollContentHeight:r.contentHeight,maxScrollY:o})}else e&&"hidden"!==this.props.overflowX&&(n+=e,n=0>n?0:n,n=n>this.state.maxScrollX?this.state.maxScrollX:n,this.setState({scrollX:n}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),P=i.createClass({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:C.number.isRequired,offset:C.number.isRequired,onScroll:C.func.isRequired,position:C.number.isRequired,size:C.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return E(t,0,this.props.offset),i.createElement("div",{className:b(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,r({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=x},function(e,t,n){"use strict";var r=n(26),o=n(395),i=n(204),a=n(46),s=n(57),u=n(91),l=n(70),c=r.PropTypes,p=r.createClass({displayName:"FixedDataTableBufferedRows",propTypes:{defaultRowHeight:c.number.isRequired,firstRowIndex:c.number.isRequired,firstRowOffset:c.number.isRequired,fixedColumns:c.array.isRequired,height:c.number.isRequired,offsetTop:c.number.isRequired,onRowClick:c.func,onRowDoubleClick:c.func,onRowMouseDown:c.func,onRowMouseEnter:c.func,onRowMouseLeave:c.func,rowClassNameGetter:c.func,rowsCount:c.number.isRequired,rowGetter:c.func.isRequired,rowHeightGetter:c.func,rowPositionGetter:c.func.isRequired,scrollLeft:c.number.isRequired,scrollableColumns:c.array.isRequired,showLastRowBorder:c.bool,width:c.number.isRequired},getInitialState:function(){return this._rowBuffer=new o(this.props.rowsCount,this.props.defaultRowHeight,this.props.height,this._getRowHeight),{rowsToRender:this._rowBuffer.getRows(this.props.firstRowIndex,this.props.firstRowOffset)}},componentWillMount:function(){this._staticRowArray=[]},componentDidMount:function(){this._bufferUpdateTimer=setTimeout(this._updateBuffer,1e3)},componentWillReceiveProps:function(e){(e.rowsCount!==this.props.rowsCount||e.defaultRowHeight!==this.props.defaultRowHeight||e.height!==this.props.height)&&(this._rowBuffer=new o(e.rowsCount,e.defaultRowHeight,e.height,this._getRowHeight)),this.setState({rowsToRender:this._rowBuffer.getRows(e.firstRowIndex,e.firstRowOffset)}),this._bufferUpdateTimer&&clearTimeout(this._bufferUpdateTimer),this._bufferUpdateTimer=setTimeout(this._updateBuffer,400)},_updateBuffer:function(){this._bufferUpdateTimer=null,this.isMounted()&&this.setState({rowsToRender:this._rowBuffer.getRowsWithUpdatedBuffer()})},shouldComponentUpdate:function(){return!0},componentWillUnmount:function(){this._staticRowArray.length=0},render:function(){var e=this.props,t=e.rowClassNameGetter||s,n=e.rowGetter,o=e.rowPositionGetter,c=this.state.rowsToRender;this._staticRowArray.length=c.length;for(var p=0;p<c.length;++p){var f=c[p],d=this._getRowHeight(f),h=o(f),m=f===e.rowsCount-1&&e.showLastRowBorder;this._staticRowArray[p]=r.createElement(i,{key:p,index:f,data:n(f),width:e.width,height:d,scrollLeft:Math.round(e.scrollLeft),offsetTop:Math.round(h),fixedColumns:e.fixedColumns,scrollableColumns:e.scrollableColumns,onClick:e.onRowClick,onMouseDown:e.onRowMouseDown,onMouseEnter:e.onRowMouseEnter,onMouseLeave:e.onRowMouseLeave,className:u(t(f),a("public/fixedDataTable/bodyRow"),a({"fixedDataTableLayout/hasBottomBorder":m,"public/fixedDataTable/hasBottomBorder":m}))})}var v=e.rowPositionGetter(e.firstRowIndex),g={position:"absolute"};return l(g,0,e.firstRowOffset-v+e.offsetTop),r.createElement("div",{style:g},this._staticRowArray)},_getRowHeight:function(e){return this.props.rowHeightGetter?this.props.rowHeightGetter(e):this.props.defaultRowHeight}});e.exports=p},function(e,t,n){"use strict";var r=n(127),o=n(205),i=n(26),a=n(56),s=n(90),u=n(46),l=n(91),c=r.DIR_SIGN,p=i.PropTypes,f=new o({align:"left",highlighted:!1,isFooterCell:!1,isHeaderCell:!1}),d=i.createClass({displayName:"FixedDataTableCell",mixins:[a],propTypes:{align:p.oneOf(["left","center","right"]),className:p.string,highlighted:p.bool,isFooterCell:p.bool,isHeaderCell:p.bool,width:p.number.isRequired,minWidth:p.number,maxWidth:p.number,height:p.number.isRequired,cellData:p.any,cellDataKey:p.oneOfType([p.string.isRequired,p.number.isRequired]),cellRenderer:p.func.isRequired,columnData:p.any,rowData:p.oneOfType([p.object.isRequired,p.array.isRequired]),rowIndex:p.number.isRequired,onColumnResize:p.func,left:p.number},getDefaultProps:function(){return f},render:function(){var e=this.props,t={height:e.height,width:e.width};1===c?t.left=e.left:t.right=e.left;var n,r=l(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":e.lastChild,"fixedDataTableCellLayout/alignRight":"right"===e.align,"fixedDataTableCellLayout/alignCenter":"center"===e.align,"public/fixedDataTableCell/alignRight":"right"===e.align,"public/fixedDataTableCell/highlighted":e.highlighted,"public/fixedDataTableCell/main":!0}),e.className);n=e.isHeaderCell||e.isFooterCell?e.cellRenderer(e.cellData,e.cellDataKey,e.columnData,e.rowData,e.width):e.cellRenderer(e.cellData,e.cellDataKey,e.rowData,e.rowIndex,e.columnData,e.width);var o=u("public/fixedDataTableCell/cellContent");n=i.isValidElement(n)?s(n,{key:n.key,className:o}):i.createElement("div",{className:o},n);var a;if(e.onColumnResize){var p={height:e.height};a=i.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:p,onMouseDown:this._onColumnResizerMouseDown},i.createElement("div",{className:l(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:p}))}var f={height:e.height,width:e.width};return i.createElement("div",{className:r,style:t},a,i.createElement("div",{className:l(u("fixedDataTableCellLayout/wrap1"),u("public/fixedDataTableCell/wrap1")),style:f},i.createElement("div",{className:l(u("fixedDataTableCellLayout/wrap2"),u("public/fixedDataTableCell/wrap2"))},i.createElement("div",{className:l(u("fixedDataTableCellLayout/wrap3"),u("public/fixedDataTableCell/wrap3"))},n))))},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.cellDataKey,e)}});e.exports=d},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(127),a=n(205),s=n(26),u=n(56),l=n(391),c=n(46),p=i.renderToString,f=n(70),d=s.PropTypes,h=i.DIR_SIGN,m=new a({}),v=s.createClass({displayName:"FixedDataTableCellGroupImpl",mixins:[u],propTypes:{columns:d.array.isRequired,data:d.oneOfType([d.object,d.array]),left:d.number,onColumnResize:d.func,rowHeight:d.number.isRequired,rowIndex:d.number.isRequired,width:d.number.isRequired,zIndex:d.number.isRequired},render:function(){for(var e=this.props,t=e.columns,n=new Array(t.length),r=0,o=0,i=t.length;i>o;o++){var a=t[o].props;if(!a.allowCellsRecycling||r-e.left<=e.width&&r-e.left+a.width>=0){var u="cell_"+o;n[o]=this._renderCell(e.data,e.rowIndex,e.rowHeight,a,r,u)}r+=a.width}var l=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:l,zIndex:e.zIndex};return f(p,-1*h*e.left,0),s.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},n)},_renderCell:function(e,t,n,r,o,i){var a,u=r.cellRenderer||p,c=r.columnData||m,f=r.dataKey,d=r.isFooterCell,h=r.isHeaderCell;if(h||d)a=null==e||null==e[f]?r.label:e[f];else{var v=r.cellDataGetter;a=v?v(f,e):e[f]}var g,y=r.isResizable&&this.props.onColumnResize,b=y?this.props.onColumnResize:null;return g=h||d?h?r.headerClassName:r.footerClassName:r.cellClassName,s.createElement(l,{align:r.align,cellData:a,cellDataKey:f,cellRenderer:u,className:g,columnData:c,height:n,isFooterCell:d,isHeaderCell:h,key:i,maxWidth:r.maxWidth,minWidth:r.minWidth,onColumnResize:b,rowData:e,rowIndex:t,width:r.width,left:o})},_getColumnsWidth:function(e){for(var t=0,n=0;n<e.length;++n)t+=e[n].props.width;return t}}),g=s.createClass({displayName:"FixedDataTableCellGroup",mixins:[u],propTypes:{height:d.number.isRequired,offsetLeft:d.number,zIndex:d.number.isRequired},getDefaultProps:function(){return{offsetLeft:0}},render:function(){var e=this.props,t=e.offsetLeft,n=r(e,["offsetLeft"]),i={height:n.height};1===h?i.left=t:i.right=t;var a=n.onColumnResize?this._onColumnResize:null;return s.createElement("div",{style:i,className:c("fixedDataTableCellGroupLayout/cellGroupWrapper")},s.createElement(v,o({},n,{onColumnResize:a})))},_onColumnResize:function(e,t,n,r,o,i){this.props.onColumnResize&&this.props.onColumnResize(this.props.offsetLeft,e-this.props.left+t,t,n,r,o,i)}});e.exports=g},function(e,t,n){"use strict";var r=n(200),o=n(206),i=n(26),a=n(56),s=n(128),u=n(46),l=i.PropTypes,c=i.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[a],propTypes:{visible:l.bool.isRequired,height:l.number.isRequired,leftOffset:l.number.isRequired,knobHeight:l.number.isRequired,initialWidth:l.number,minWidth:l.number,maxWidth:l.number,initialEvent:l.object,onColumnResizeEnd:l.func,columnKey:l.oneOfType([l.string,l.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new r(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return o.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,i.createElement("div",{className:u({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},i.createElement("div",{className:u("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){o.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,n=s(this.props.minWidth,t,this.props.maxWidth);this.setState({width:n,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=c},function(e,t,n){"use strict";var r=n(389),o=n(202),i=n(203),a={Column:o,ColumnGroup:i,Table:r};a.version="0.4.0",e.exports=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(400),a=n(128),s=n(37),u=3,l=6,c=function(){function e(t,n,o,c){r(this,e),s(0!==n,"defaultRowHeight musn't be equal 0 in FixedDataTableRowBuffer"),this._bufferSet=new i,this._defaultRowHeight=n,this._viewportRowsBegin=0,this._viewportRowsEnd=0,this._maxVisibleRowCount=Math.ceil(o/n)+1,this._bufferRowsCount=a(u,Math.floor(this._maxVisibleRowCount/2),l),this._rowsCount=t,this._rowHeightGetter=c,this._rows=[],this._viewportHeight=o,this.getRows=this.getRows.bind(this),this.getRowsWithUpdatedBuffer=this.getRowsWithUpdatedBuffer.bind(this)}return o(e,[{key:"getRowsWithUpdatedBuffer",value:function(){for(var e=2*this._bufferRowsCount,t=Math.max(this._viewportRowsBegin-this._bufferRowsCount,0);t<this._viewportRowsBegin;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;for(t=this._viewportRowsEnd;t<this._rowsCount&&e>0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var n=t,r=n,o=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;i>o||r<this._viewportHeight&&o<this._rowsCount;)this._addRowToBuffer(o,e,i-1),r+=this._rowHeightGetter(o),++o,this._viewportRowsEnd=o;return this._rows}},{key:"_addRowToBuffer",value:function(e,t,n){var r=this._bufferSet.getValuePosition(e),o=n-t+1,i=o+2*this._bufferRowsCount;null===r&&this._bufferSet.getSize()>=i&&(r=this._bufferSet.replaceFurthestValuePosition(t,n,e)),null===r?(r=this._bufferSet.getNewPositionForValue(e),this._rows[r]=e):this._rows[r]=e}}]),e}();e.exports=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(402),a=n(128),s=5,u={index:0,offset:0,position:0,contentHeight:0},l=function(){function e(t,n,o,a){r(this,e),this._rowOffsets=i.uniform(t,n),this._storedHeights=new Array(t);for(var s=0;t>s;++s)this._storedHeights[s]=n;this._rowCount=t,this._position=0,this._contentHeight=t*n,this._defaultRowHeight=n,this._rowHeightGetter=a?a:function(){return n},this._viewportHeight=o,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return o(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var n=t,r=e;n<=this._viewportHeight&&r<this._rowCount;)this._updateRowHeight(r),n+=this._storedHeights[r],r++}},{key:"_updateHeightsAboveViewport",value:function(e){for(var t=e-1;t>=0&&t>=e-s;){var n=this._updateRowHeight(t);this._position+=n,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var n=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=n,n}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return u;var t=this._rowOffsets.greatestLowerBound(this._position);t=a(0,t,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(t),r=t,o=this._position,i=this._updateRowHeight(r);0!==n&&(o+=i);var s=this._storedHeights[r]-(o-n);if(e>=0)for(;e>0&&r<this._rowCount;)s>e?(o+=e,e=0):(e-=s,o+=s,r++),r<this._rowCount&&(this._updateRowHeight(r),s=this._storedHeights[r]);else if(0>e){e=-e;for(var l=this._storedHeights[r]-s;e>0&&r>=0;)if(l>e?(o-=e,e=0):(o-=l,e-=l,r--),r>=0){var c=this._updateRowHeight(r);l=this._storedHeights[r],o+=c}}var p=this._contentHeight-this._viewportHeight;o=a(0,o,p),this._position=o;var f=this._rowOffsets.greatestLowerBound(o);f=a(0,f,Math.max(this._rowCount-1,0)),n=this._rowOffsets.sumUntil(f);var d=n-o;return this._updateHeightsInViewport(f,d),this._updateHeightsAboveViewport(f),{index:f,offset:d,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,n=this._storedHeights[t];n<this._viewportHeight&&t>=0;)t--,t>=0&&(this._updateRowHeight(t),n+=this._storedHeights[t]);var r=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>r&&(r=0),r}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return u;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var n=this._rowOffsets.greatestLowerBound(e);n=a(0,n,Math.max(this._rowCount-1,0));var r=this._rowOffsets.sumUntil(n),o=r-e;return this._updateHeightsInViewport(n,o),this._updateHeightsAboveViewport(n),{index:n,offset:o,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=a(0,e,Math.max(this._rowCount-1,0)),t=a(-this._storedHeights[e],t,0);var n=this._rowOffsets.sumUntil(e);return this.scrollTo(n-t)}},{key:"scrollRowIntoView",value:function(e){e=a(0,e,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),n=t+this._storedHeights[e];if(t<this._position)return this.scrollTo(t);if(this._position+this._viewportHeight<n){var r=this._getRowAtEndPosition(e);return this.scrollTo(r)}return this.scrollTo(this._position)}}]),e}();e.exports=l},function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;++n)t+=e[n].props.width;return t}function o(e){for(var t=0,n=0;n<e.length;++n)t+=e[n].props.flexGrow||0;return t}function i(e,t){if(0>=t)return{columns:e,width:r(e)};for(var n=o(e),i=t,a=[],s=0,u=0;u<e.length;++u){var c=e[u];if(c.props.flexGrow){var p=Math.floor(c.props.flexGrow/n*i),f=Math.floor(c.props.width+p);s+=f,n-=c.props.flexGrow,i-=p,a.push(l(c,{
width:f}))}else s+=c.props.width,a.push(c)}return{columns:a,width:s}}function a(e,t){var n,a=[];for(n=0;n<e.length;++n)u.Children.forEach(e[n].props.children,function(e){a.push(e)});var s=r(a),c=o(a),p=Math.max(t-s,0),f=[],d=[];for(n=0;n<e.length;++n){var h=e[n],m=[];u.Children.forEach(h.props.children,function(e){m.push(e)});var v=o(m),g=Math.floor(v/c*p),y=i(m,g);c-=v,p-=g;for(var b=0;b<y.columns.length;++b)f.push(y.columns[b]);d.push(l(h,{width:y.width}))}return{columns:f,columnGroups:d}}function s(e,t){var n=r(e);return t>n?i(e,t-n).columns:e}var u=n(26),l=n(90),c={getTotalWidth:r,getTotalFlexGrow:o,distributeFlexWidth:i,adjustColumnWidths:s,adjustColumnGroupWidths:a};e.exports=c},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){return t>e}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,o){n(this,e),this._items=t||[],this._size=this._items.length,this._comparator=o||r,this._heapify()}return o(e,[{key:"empty",value:function(){return 0===this._size}},{key:"pop",value:function(){if(0!==this._size){var e=this._items[0],t=this._items.pop();return this._size--,this._size>0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var n=Math.floor((e+1)/2)-1,r=this._items[n];if(this._comparator(r,t))return;this._items[n]=t,this._items[e]=r,e=n}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var n=2*(e+1)-1,r=2*(e+1),o=-1;if(n<this._size){var i=this._items[n];this._comparator(i,t)&&(o=n)}if(r<this._size){var a=this._items[r];this._comparator(a,t)&&(-1===o||this._comparator(a,this._items[o]))&&(o=r)}if(-1===o)return;this._items[e]=this._items[o],this._items[o]=t,e=o}}}]),e}();e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(37),s=n(410),u=n(209),l=u({_DONT_EVER_TYPE_THIS_SECRET_KEY:null}),c=function(){function e(t){r(this,e),a(t===e[l],"Only certain classes should create instances of `ImmutableValue`.You probably want something like ImmutableValueObject.create.")}return o(e,null,[{key:"mergeAllPropertiesInto",value:function(e,t){for(var n=t.length,r=0;n>r;r++)i(e,t[r])}},{key:"deepFreezeRootNode",value:function(t){if(!s(t)){Object.freeze(t);for(var n in t)t.hasOwnProperty(n)&&e.recurseDeepFreeze(t[n]);Object.seal(t)}}},{key:"recurseDeepFreeze",value:function(t){if(!s(t)&&e.shouldRecurseFreeze(t)){Object.freeze(t);for(var n in t)t.hasOwnProperty(n)&&e.recurseDeepFreeze(t[n]);Object.seal(t)}}},{key:"shouldRecurseFreeze",value:function(t){return"object"==typeof t&&!(t instanceof e)&&null!==t}}]),e}();c._DONT_EVER_TYPE_THIS_SECRET_KEY=Math.random(),e.exports=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(398),a=n(37),s=function(){function e(){r(this,e),this._valueToPositionMap={},this._size=0,this._smallValues=new i([],this._smallerComparator),this._largeValues=new i([],this._greaterComparator),this.getNewPositionForValue=this.getNewPositionForValue.bind(this),this.getValuePosition=this.getValuePosition.bind(this),this.getSize=this.getSize.bind(this),this.replaceFurthestValuePosition=this.replaceFurthestValuePosition.bind(this)}return o(e,[{key:"getSize",value:function(){return this._size}},{key:"getValuePosition",value:function(e){return void 0===this._valueToPositionMap[e]?null:this._valueToPositionMap[e]}},{key:"getNewPositionForValue",value:function(e){a(void 0===this._valueToPositionMap[e],"Shouldn't try to find new position for value already stored in BufferSet");var t=this._size;return this._size++,this._pushToHeaps(t,e),this._valueToPositionMap[e]=t,t}},{key:"replaceFurthestValuePosition",value:function(e,t,n){if(a(void 0===this._valueToPositionMap[n],"Shouldn't try to replace values with value already stored value in BufferSet"),this._cleanHeaps(),this._smallValues.empty()||this._largeValues.empty())return null;var r=this._smallValues.peek().value,o=this._largeValues.peek().value;if(r>=e&&t>=o)return null;var i;e-r>o-t?(i=r,this._smallValues.pop()):(i=o,this._largeValues.pop());var s=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[n]=s,this._pushToHeaps(s,n),s}},{key:"_pushToHeaps",value:function(e,t){var n={position:e,value:t};this._smallValues.push(n),this._largeValues.push(n)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()<this._largeValues.size()?this._smallValues:this._largeValues,t=new i([],this._smallerComparator),n=new i([],this._greaterComparator);!e.empty();){var r=e.pop();void 0!==this._valueToPositionMap[r.value]&&(t.push(r),n.push(r))}this._smallValues=t,this._largeValues=n}},{key:"_cleanHeap",value:function(e){for(;!e.empty()&&void 0===this._valueToPositionMap[e.peek().value];)e.pop()}},{key:"_smallerComparator",value:function(e,t){return e.value<t.value}},{key:"_greaterComparator",value:function(e,t){return e.value>t.value}}]),e}();e.exports=s},function(e,t){"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(e,t,n){(function(t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){for(var t=1;e>t;)t*=2;return t}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(37),s=function(e){return Math.floor(e/2)},u=t.Int32Array||function(e){for(var t=[],n=e-1;n>=0;--n)t[n]=0;return t},l=function(){function e(t){r(this,e),this._size=t.length,this._half=o(this._size),this._heap=new u(2*this._half);var n;for(n=0;n<this._size;++n)this._heap[this._half+n]=t[n];for(n=this._half-1;n>0;--n)this._heap[n]=this._heap[2*n]+this._heap[2*n+1]}return i(e,[{key:"set",value:function(e,t){a(e>=0&&e<this._size,"Index out of range %s",e);var n=this._half+e;for(this._heap[n]=t,n=s(n);0!==n;n=s(n))this._heap[n]=this._heap[2*n]+this._heap[2*n+1]}},{key:"get",value:function(e){a(e>=0&&e<this._size,"Index out of range %s",e);var t=this._half+e;return this._heap[t]}},{key:"getSize",value:function(){return this._size}},{key:"sumUntil",value:function(e){if(a(e>=0&&e<this._size+1,"Index out of range %s",e),0===e)return 0;for(var t=this._half+e-1,n=this._heap[t];1!==t;t=s(t))t%2===1&&(n+=this._heap[t-1]);return n}},{key:"sumTo",value:function(e){return a(e>=0&&e<this._size,"Index out of range %s",e),this.sumUntil(e+1)}},{key:"sum",value:function(e,t){return a(t>=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;t<this._half;){var n=this._heap[2*t];n>e?t=2*t:(t=2*t+1,e-=n)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]<e)return this._size;for(;t<this._half;){var n=this._heap[2*t];n>=e?t=2*t:(t=2*t+1,e-=n)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,n){for(var r=[],o=t-1;o>=0;--o)r[o]=n;return new e(r)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=l}).call(t,function(){return this}())},function(e,t,n){"use strict";var r=n(200),o=n(401),i=n(26),a=n(56),s=n(207),u=n(407),l=n(46),c=n(57),p=n(70),f=i.PropTypes,d={position:0,scrollable:!1},h=parseInt(u("scrollbar-face-margin"),10),m=2*h,v=30,g=40,y=null,b=i.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:f.number.isRequired,defaultPosition:f.number,isOpaque:f.bool,orientation:f.oneOf(["vertical","horizontal"]),onScroll:f.func,position:f.number,size:f.number.isRequired,trackColor:f.oneOf(["gray"]),zIndex:f.number,verticalTop:f.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,n=this.props.size,r=this.state.isHorizontal,o=!r,a=this.state.focused||this.state.isDragging,s=this.state.faceSize,c=this.props.isOpaque,f=this.props.verticalTop||0,d=l({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":o,"ScrollbarLayout/mainHorizontal":r,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":c,"public/Scrollbar/mainActive":a}),v=l({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":r,"ScrollbarLayout/faceVertical":o,"public/Scrollbar/faceActive":a,"public/Scrollbar/face":!0}),g=this.state.position*this.state.scale+h;return r?(e={width:n},t={width:s-m},p(t,g,0)):(e={top:f,height:n},t={height:s-m},p(t,0,g)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),i.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:d,style:e,tabIndex:0},i.createElement("div",{ref:"face",className:v,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new s(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new r(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),y===this&&(y=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,n,r){if(1>t||t>=n)return d;var o=""+e+"_"+t+"_"+n+"_"+r;if(this._stateKey===o)return this._stateForKey;var i="horizontal"===r,a=t/n,s=t*a;v>s&&(a=(t-v)/(n-v),s=v);var u=!0,l=n-t;0>e?e=0:e>l&&(e=l);var c=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,p={faceSize:s,isDragging:c,isHorizontal:i,position:e,scale:a,scrollable:u};return this._stateKey=o,this._stateForKey=p,p},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==i.findDOMNode(this.refs.face)){var n=e.nativeEvent,r=this.state.isHorizontal?n.offsetX||n.layerX:n.offsetY||n.layerY,o=this.props;r/=this.state.scale,t=this._calculateState(r-.5*this.state.faceSize/this.state.scale,o.size,o.contentSize,o.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),i.findDOMNode(this).focus()},_onMouseMove:function(e,t){var n=this.props,r=this.state.isHorizontal?e:t;r/=this.state.scale,this._setNextState(this._calculateState(this.state.position+r,n.size,n.contentSize,n.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==o.TAB){var n=g,r=0;if(this.state.isHorizontal)switch(t){case o.HOME:r=-1,n=this.props.contentSize;break;case o.LEFT:r=-1;break;case o.RIGHT:r=1;break;default:return}if(!this.state.isHorizontal)switch(t){case o.SPACE:r=e.shiftKey?-1:1;break;case o.HOME:r=-1,n=this.props.contentSize;break;case o.UP:r=-1;break;case o.DOWN:r=1;break;case o.PAGE_UP:r=-1,n=this.props.size;break;case o.PAGE_DOWN:r=1,n=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+n*r,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),i.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var n=t.position,r=this.state.position!==e.position;if(void 0===n){var o=r?this._didScroll:void 0;this.setState(e,o)}else{if(n!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}r&&y!==this&&(y&&y._blur(),y=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t){"use strict";function n(){if(!y){y=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(h=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),v=/FBAN\/\w+;/i.exec(e),g=/Mobile/i.exec(e),d=!!/Win64/.exec(e),t){r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,r&&document&&document.documentMode&&(r=document.documentMode);var b=/(?:Trident\/(\d+.\d+))/.exec(e);u=b?parseFloat(b[1])+4:r,o=t[2]?parseFloat(t[2]):NaN,i=t[3]?parseFloat(t[3]):NaN,a=t[4]?parseFloat(t[4]):NaN,a?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),s=t&&t[1]?parseFloat(t[1]):NaN):s=NaN}else r=o=i=s=a=NaN;if(n){if(n[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=_?parseFloat(_[1].replace("_",".")):!0}else l=!1;c=!!n[2],p=!!n[3]}else l=c=p=!1}}var r,o,i,a,s,u,l,c,p,f,d,h,m,v,g,y=!1,b={ie:function(){return n()||r},ieCompatibilityMode:function(){return n()||u>r},ie64:function(){return b.ie()&&d},firefox:function(){return n()||o},opera:function(){return n()||i},webkit:function(){return n()||a},safari:function(){return b.webkit()},chrome:function(){return n()||s},windows:function(){return n()||c},osx:function(){return n()||l},linux:function(){return n()||p},iphone:function(){return n()||h},mobile:function(){return n()||h||m||f||g},nativeApp:function(){return n()||v},android:function(){return n()||f},ipad:function(){return n()||m}};e.exports=b},function(e,t){"use strict";function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=n},function(e,t){(function(t){"use strict";var n=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||t.msCancelAnimationFrame||t.clearTimeout;e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){if(r.hasOwnProperty(e))return r[e];throw new Error('cssVar("'+e+'"): Unexpected class transformation.')}var r={"scrollbar-face-active-color":"#7d7d7d","scrollbar-face-color":"#c2c2c2","scrollbar-face-margin":"4px","scrollbar-face-radius":"6px","scrollbar-size":"15px","scrollbar-size-large":"17px","scrollbar-track-color":"rgba(255, 255, 255, 0.8)","fbui-white":"#fff","fbui-desktop-background-light":"#f6f7f8"};n.CSS_VARS=r,e.exports=n},function(e,t){"use strict";function n(e,t,n,r,o){function i(){for(var o=arguments.length,s=Array(o),u=0;o>u;u++)s[u]=arguments[u];i.reset();var l=function(){e.apply(n,s)};l.__SMmeta=e.__SMmeta,a=r(l,t)}r=r||setTimeout,o=o||clearTimeout;var a;return i.reset=function(){o(a)},i}e.exports=n},function(e,t,n){"use strict";/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(201);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t){"use strict";function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t,n){"use strict";var r=n(37),o=function(e){var t,n={};r(e instanceof Object&&!Array.isArray(e),"keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=o},function(e,t,n){"use strict";var r=n(37),o=n(411),i=36,a=function(e){return"object"!=typeof e||e instanceof Date||null===e},s={MAX_MERGE_DEPTH:i,isTerminal:a,normalizeMergeArg:function(e){return void 0===e||null===e?{}:e},checkMergeArrayArgs:function(e,t){r(Array.isArray(e)&&Array.isArray(t),"Tried to merge arrays, instead got %s and %s.",e,t)},checkMergeObjectArgs:function(e,t){s.checkMergeObjectArg(e),s.checkMergeObjectArg(t)},checkMergeObjectArg:function(e){r(!a(e)&&!Array.isArray(e),"Tried to merge an object, instead got %s.",e)},checkMergeIntoObjectArg:function(e){r(!(a(e)&&"function"!=typeof e||Array.isArray(e)),"Tried to merge into an object, instead got %s.",e)},checkMergeLevel:function(e){r(i>e,"Maximum deep merge depth exceeded. You may be attempting to merge circular structures in an unsupported way.")},checkArrayStrategy:function(e){r(void 0===e||e in s.ArrayStrategies,"You must provide an array strategy to deep merge functions to instruct the deep merge how to resolve merging two arrays.")},ArrayStrategies:o({Clobber:!0,IndexByIndex:!0})};e.exports=s},function(e,t){(function(t){"use strict";var n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=n}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*a,o=n*a,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=s,o*=s):(r*=u,o*=u)),r&&!t&&(t=1>r?-1:1),o&&!n&&(n=1>o?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}var o=n(404),i=n(409),a=10,s=40,u=800;r.getEventType=function(){return o.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},e.exports=r},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),i=0;i<n.length;i++)if(!o(n[i])||e[n[i]]!==t[n[i]])return!1;return!0}e.exports=n},function(e,t,n){e.exports.Dispatcher=n(417)},function(e,t,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var o=n(418),i=1,a="ID_";r.prototype.register=function(e){var t=a+i++;return this.$Dispatcher_callbacks[t]=e,t},r.prototype.unregister=function(e){o(this.$Dispatcher_callbacks[e],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",e),delete this.$Dispatcher_callbacks[e]},r.prototype.waitFor=function(e){o(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var t=0;t<e.length;t++){var n=e[t];this.$Dispatcher_isPending[n]?o(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(o(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(e){o(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(e);try{for(var t in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[t]||this.$Dispatcher_invokeCallback(t)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(e){this.$Dispatcher_isPending[e]=!0,this.$Dispatcher_callbacks[e](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[e]=!0},r.prototype.$Dispatcher_startDispatching=function(e){for(var t in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[t]=!1,this.$Dispatcher_isHandled[t]=!1;this.$Dispatcher_pendingPayload=e,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},e.exports=r},function(e,t){"use strict";var n=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw u.framesToPop=1,u}};e.exports=n},function(e,t){function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}e.exports=n},function(e,t,n){function r(e,t,n,m,v,g,y){var _;if(n&&(_=v?n(e,m,v):n(e)),"undefined"!=typeof _)return _;if(!f(e))return e;var E=p(e);if(E){if(_=u(e),!t)return o(e,_)}else{var T=H.call(e),w=T==b;if(T!=C&&T!=h&&(!w||v))return L[T]?l(e,T,t):v?e:{};if(_=c(w?{}:e),!t)return a(e,_,d(e))}g||(g=[]),y||(y=[]);for(var S=g.length;S--;)if(g[S]==e)return y[S];return g.push(e),y.push(_),(E?i:s)(e,function(o,i){_[i]=r(o,t,n,i,e,g,y)}),_}var o=n(419),i=n(420),a=n(422),s=n(424),u=n(434),l=n(435),c=n(436),p=n(93),f=n(71),d=n(133),h="[object Arguments]",m="[object Array]",v="[object Boolean]",g="[object Date]",y="[object Error]",b="[object Function]",_="[object Map]",E="[object Number]",C="[object Object]",T="[object RegExp]",w="[object Set]",S="[object String]",O="[object WeakMap]",x="[object ArrayBuffer]",P="[object Float32Array]",D="[object Float64Array]",N="[object Int8Array]",M="[object Int16Array]",k="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",A="[object Uint16Array]",j="[object Uint32Array]",L={};L[h]=L[m]=L[x]=L[v]=L[g]=L[P]=L[D]=L[N]=L[M]=L[k]=L[E]=L[C]=L[T]=L[S]=L[R]=L[I]=L[A]=L[j]=!0,L[y]=L[b]=L[_]=L[w]=L[O]=!1;var F=Object.prototype,H=F.toString;e.exports=r},function(e,t){function n(e,t,n){n||(n=t,t={});for(var r=-1,o=n.length;++r<o;){var i=n[r];t[i]=e[i]}return t}e.exports=n},function(e,t,n){var r=n(428),o=r();e.exports=o},function(e,t,n){function r(e,t){return o(e,t,i)}var o=n(423),i=n(133);e.exports=r},function(e,t,n){function r(e,t,n,i,a,s){if(e===t)return 0!==e||1/e==1/t;var u=typeof e,l=typeof t;return"function"!=u&&"object"!=u&&"function"!=l&&"object"!=l||null==e||null==t?e!==e&&t!==t:o(e,t,r,n,i,a,s)}var o=n(426);e.exports=r},function(e,t,n){function r(e,t,n,r,d,v,g){var y=s(e),b=s(t),_=c,E=c;y||(_=m.call(e),_==l?_=f:_!=f&&(y=u(e))),b||(E=m.call(t),E==l?E=f:E!=f&&(b=u(t)));var C=_==f||d&&_==p,T=E==f||d&&E==p,w=_==E;if(w&&!y&&!C)return i(e,t,_);if(d){if(!(w||C&&T))return!1}else{var S=C&&h.call(e,"__wrapped__"),O=T&&h.call(t,"__wrapped__");if(S||O)return n(S?e.value():e,O?t.value():t,r,d,v,g);if(!w)return!1}v||(v=[]),g||(g=[]);for(var x=v.length;x--;)if(v[x]==e)return g[x]==t;v.push(e),g.push(t);var P=(y?o:a)(e,t,n,r,d,v,g);return v.pop(),g.pop(),P}var o=n(431),i=n(432),a=n(433),s=n(93),u=n(442),l="[object Arguments]",c="[object Array]",p="[object Function]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty,m=d.toString;e.exports=r},function(e,t,n){(function(t){function r(e){return s.call(e,0)}var o=n(447),i=n(132),a=i(a=t.ArrayBuffer)&&a,s=i(s=a&&new a(0).slice)&&s,u=Math.floor,l=i(l=t.Uint8Array)&&l,c=function(){try{var e=i(e=t.Float64Array)&&e,n=new e(new a(10),0,1)&&e}catch(r){}return n}(),p=c?c.BYTES_PER_ELEMENT:0;s||(r=a&&l?function(e){var t=e.byteLength,n=c?u(t/p):0,r=n*p,o=new a(t);if(n){var i=new c(o,0,n);i.set(new c(e,0,n))}return t!=r&&(i=new l(o,r),i.set(new l(e,r))),o}:o(null)),e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){return function(t,n,r){for(var i=o(t),a=r(t),s=a.length,u=e?s:-1;e?u--:++u<s;){var l=a[u];if(n(i[l],l,i)===!1)break}return t}}var o=n(439);e.exports=r},function(e,t,n){function r(e){return function(t,n,r){return t=o(t),t&&(e?t:"")+i(t,n,r)+(e?"":t)}}var o=n(131),i=n(430);e.exports=r},function(e,t,n){(function(t){function r(e,t,n){var r=e.length;if(t=+t,r>=t||!a(t))return"";var s=t-r;return n=null==n?" ":n+"",o(n,i(s/n.length)).slice(0,s)}var o=n(446),i=Math.ceil,a=t.isFinite;e.exports=r}).call(t,function(){return this}())},function(e,t){function n(e,t,n,r,o,i,a){var s=-1,u=e.length,l=t.length,c=!0;if(u!=l&&!(o&&l>u))return!1;for(;c&&++s<u;){var p=e[s],f=t[s];if(c=void 0,r&&(c=o?r(f,p,s):r(p,f,s)),"undefined"==typeof c)if(o)for(var d=l;d--&&(f=t[d],!(c=p&&p===f||n(p,f,r,o,i,a))););else c=p&&p===f||n(p,f,r,o,i,a)}return!!c}e.exports=n},function(e,t){function n(e,t,n){switch(n){case r:case o:return+e==+t;case i:return e.name==t.name&&e.message==t.message;case a:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case s:case u:return e==t+""}return!1}var r="[object Boolean]",o="[object Date]",i="[object Error]",a="[object Number]",s="[object RegExp]",u="[object String]";e.exports=n},function(e,t,n){function r(e,t,n,r,i,s,u){var l=o(e),c=l.length,p=o(t),f=p.length;if(c!=f&&!i)return!1;for(var d=i,h=-1;++h<c;){var m=l[h],v=i?m in t:a.call(t,m);if(v){var g=e[m],y=t[m];v=void 0,r&&(v=i?r(y,g,m):r(g,y,m)),"undefined"==typeof v&&(v=g&&g===y||n(g,y,r,i,s,u))}if(!v)return!1;d||(d="constructor"==m)}if(!d){var b=e.constructor,_=t.constructor;if(b!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _))return!1}return!0}var o=n(133),i=Object.prototype,a=i.hasOwnProperty;e.exports=r},function(e,t){function n(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&o.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var r=Object.prototype,o=r.hasOwnProperty;e.exports=n},function(e,t,n){function r(e,t,n){var r=e.constructor;switch(t){case c:return o(e);case i:case a:return new r(+e);case p:case f:case d:case h:case m:case v:case g:case y:case b:var E=e.buffer;return new r(n?o(E):E,e.byteOffset,e.length);case s:case l:return new r(e);case u:var C=new r(e.source,_.exec(e));C.lastIndex=e.lastIndex}return C}var o=n(427),i="[object Boolean]",a="[object Date]",s="[object Number]",u="[object RegExp]",l="[object String]",c="[object ArrayBuffer]",p="[object Float32Array]",f="[object Float64Array]",d="[object Int8Array]",h="[object Int16Array]",m="[object Int32Array]",v="[object Uint8Array]",g="[object Uint8ClampedArray]",y="[object Uint16Array]",b="[object Uint32Array]",_=/\w*$/;e.exports=r},function(e,t){function n(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}e.exports=n},function(e,t,n){function r(e){return e===e&&(0===e?1/e>0:!o(e))}var o=n(71);e.exports=r},function(e,t,n){function r(e){for(var t=u(e),n=t.length,r=n&&e.length,c=r&&s(r)&&(i(e)||l.nonEnumArgs&&o(e)),f=-1,d=[];++f<n;){var h=t[f];(c&&a(h,r)||p.call(e,h))&&d.push(h)}return d}var o=n(213),i=n(93),a=n(212),s=n(58),u=n(443),l=n(214),c=Object.prototype,p=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)?e:Object(e)}var o=n(71);e.exports=r},function(e,t,n){function r(e,t,n){return t="function"==typeof t&&i(t,n,1),o(e,!0,t)}var o=n(421),i=n(211);e.exports=r},function(e,t,n){function r(e,t,n,r){if(n="function"==typeof n&&i(n,r,3),!n&&a(e)&&a(t))return e===t;var s=n?n(e,t):void 0;return"undefined"==typeof s?o(e,t,n):!!s}var o=n(425),i=n(211),a=n(437);e.exports=r},function(e,t,n){function r(e){return i(e)&&o(e.length)&&!!D[M.call(e)]}var o=n(58),i=n(92),a="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",p="[object Function]",f="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",v="[object Set]",g="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",_="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",S="[object Uint8Array]",O="[object Uint8ClampedArray]",x="[object Uint16Array]",P="[object Uint32Array]",D={};D[_]=D[E]=D[C]=D[T]=D[w]=D[S]=D[O]=D[x]=D[P]=!0,D[a]=D[s]=D[b]=D[u]=D[l]=D[c]=D[p]=D[f]=D[d]=D[h]=D[m]=D[v]=D[g]=D[y]=!1;var N=Object.prototype,M=N.toString;e.exports=r},function(e,t,n){function r(e){if(null==e)return[];u(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(i(e)||l.nonEnumArgs&&o(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,f=Array(t),d=t>0;++r<t;)f[r]=r+"";for(var h in e)d&&a(h,t)||"constructor"==h&&(c||!p.call(e,h))||f.push(h);return f}var o=n(213),i=n(93),a=n(212),s=n(58),u=n(71),l=n(214),c=Object.prototype,p=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return e=o(e),e&&a.test(e)?e.replace(i,"\\$&"):e}var o=n(131),i=/[.*+?^${}()|[\]\/\\]/g,a=RegExp(i.source);e.exports=r},function(e,t,n){var r=n(429),o=r();e.exports=o},function(e,t,n){(function(t){function r(e,t){var n="";if(e=o(e),t=+t,1>t||!e||!a(t))return n;do t%2&&(n+=e),t=i(t/2),e+=e;while(t);return n}var o=n(131),i=Math.floor,a=t.isFinite;e.exports=r}).call(t,function(){return this}())},function(e,t){function n(e){return function(){return e}}e.exports=n},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return o.exec(e).slice(1)};t.resolve=function(){for(var t="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+t||"."},t.normalize=function(e){var o=t.isAbsolute(e),i="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var o=r(e.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),s=a,u=0;a>u;u++)if(o[u]!==i[u]){s=u;break}for(var l=[],u=s;u<o.length;u++)l.push("..");return l=l.concat(i.slice(s)),l.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return i(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(215))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(216),c=r(l),p=n(22),f=r(p),d=a["default"].createClass({displayName:"Affix",statics:{domUtils:f["default"]},mixins:[c["default"]],render:function(){var e={top:this.state.affixPositionTop};return a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,this.state.affixClass),style:e}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(15),u=r(s),l=n(3),c=r(l),p=a["default"].createClass({displayName:"Badge",propTypes:{pullRight:a["default"].PropTypes.bool},hasContent:function(){return u["default"].hasValidComponent(this.props.children)||a["default"].Children.count(this.props.children)>1||"string"==typeof this.props.children||"number"==typeof this.props.children},render:function(){var e={"pull-right":this.props.pullRight,badge:this.hasContent()};return a["default"].createElement("span",o({},this.props,{className:c["default"](this.props.className,e)}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=a["default"].createClass({displayName:"ButtonToolbar",mixins:[c["default"]],getDefaultProps:function(){return{bsClass:"button-toolbar"}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("div",o({},this.props,{role:"toolbar",className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(15),f=r(p),d=n(98),h=r(d),m=a["default"].createClass({displayName:"Carousel",mixins:[c["default"]],propTypes:{slide:a["default"].PropTypes.bool,indicators:a["default"].PropTypes.bool,interval:a["default"].PropTypes.number,controls:a["default"].PropTypes.bool,pauseOnHover:a["default"].PropTypes.bool,wrap:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,onSlideEnd:a["default"].PropTypes.func,activeIndex:a["default"].PropTypes.number,defaultActiveIndex:a["default"].PropTypes.number,direction:a["default"].PropTypes.oneOf(["prev","next"]),prevIcon:a["default"].PropTypes.node,nextIcon:a["default"].PropTypes.node},getDefaultProps:function(){return{slide:!0,interval:5e3,pauseOnHover:!0,wrap:!0,indicators:!0,controls:!0,prevIcon:a["default"].createElement(h["default"],{glyph:"chevron-left"}),nextIcon:a["default"].createElement(h["default"],{glyph:"chevron-right"})}},getInitialState:function(){return{activeIndex:null==this.props.defaultActiveIndex?0:this.props.defaultActiveIndex,previousActiveIndex:null,direction:null}},getDirection:function(e,t){return e===t?null:e>t?"prev":"next"},componentWillReceiveProps:function(e){var t=this.getActiveIndex();null!=e.activeIndex&&e.activeIndex!==t&&(clearTimeout(this.timeout),this.setState({previousActiveIndex:t,direction:null!=e.direction?e.direction:this.getDirection(t,e.activeIndex)}))},componentDidMount:function(){this.waitForNext()},componentWillUnmount:function(){clearTimeout(this.timeout)},next:function(e){e&&e.preventDefault();var t=this.getActiveIndex()+1,n=f["default"].numberOf(this.props.children);if(t>n-1){if(!this.props.wrap)return;t=0}this.handleSelect(t,"next")},prev:function(e){e&&e.preventDefault();var t=this.getActiveIndex()-1;if(0>t){if(!this.props.wrap)return;t=f["default"].numberOf(this.props.children)-1}this.handleSelect(t,"prev")},pause:function(){this.isPaused=!0,clearTimeout(this.timeout)},play:function(){this.isPaused=!1,this.waitForNext()},waitForNext:function(){!this.isPaused&&this.props.slide&&this.props.interval&&null==this.props.activeIndex&&(this.timeout=setTimeout(this.next,this.props.interval))},handleMouseOver:function(){this.props.pauseOnHover&&this.pause()},handleMouseOut:function(){this.isPaused&&this.play()},render:function(){var e={carousel:!0,slide:this.props.slide};return a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e),onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut}),this.props.indicators?this.renderIndicators():null,a["default"].createElement("div",{className:"carousel-inner",ref:"inner"},f["default"].map(this.props.children,this.renderItem)),this.props.controls?this.renderControls():null)},renderPrev:function(){return a["default"].createElement("a",{className:"left carousel-control",href:"#prev",key:0,onClick:this.prev},this.props.prevIcon)},renderNext:function(){return a["default"].createElement("a",{className:"right carousel-control",href:"#next",key:1,onClick:this.next},this.props.nextIcon)},renderControls:function(){if(!this.props.wrap){var e=this.getActiveIndex(),t=f["default"].numberOf(this.props.children);return[0!==e?this.renderPrev():null,e!==t-1?this.renderNext():null]}return[this.renderPrev(),this.renderNext()]},renderIndicator:function(e,t){var n=t===this.getActiveIndex()?"active":null;return a["default"].createElement("li",{key:t,className:n,onClick:this.handleSelect.bind(this,t,null)})},renderIndicators:function(){var e=[];return f["default"].forEach(this.props.children,function(t,n){e.push(this.renderIndicator(t,n)," ")},this),a["default"].createElement("ol",{className:"carousel-indicators"},e)},getActiveIndex:function(){return null!=this.props.activeIndex?this.props.activeIndex:this.state.activeIndex},handleItemAnimateOutEnd:function(){this.setState({previousActiveIndex:null,direction:null},function(){this.waitForNext(),this.props.onSlideEnd&&this.props.onSlideEnd()})},renderItem:function(e,t){var n=this.getActiveIndex(),r=t===n,o=null!=this.state.previousActiveIndex&&this.state.previousActiveIndex===t&&this.props.slide;return i.cloneElement(e,{active:r,ref:e.ref,key:e.key?e.key:t,index:t,animateOut:o,animateIn:r&&null!=this.state.previousActiveIndex&&this.props.slide,direction:this.state.direction,onAnimateOutEnd:o?this.handleItemAnimateOutEnd:null})},handleSelect:function(e,t){clearTimeout(this.timeout);var n=this.getActiveIndex();if(t=t||this.getDirection(n,e),this.props.onSelect&&this.props.onSelect(e,t),null==this.props.activeIndex&&e!==n){if(null!=this.state.previousActiveIndex)return;this.setState({activeIndex:e,previousActiveIndex:n,direction:t})}}});t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(140),c=r(l),p=a["default"].createClass({displayName:"CarouselItem",propTypes:{direction:a["default"].PropTypes.oneOf(["prev","next"]),onAnimateOutEnd:a["default"].PropTypes.func,active:a["default"].PropTypes.bool,animateIn:a["default"].PropTypes.bool,animateOut:a["default"].PropTypes.bool,caption:a["default"].PropTypes.node,index:a["default"].PropTypes.number},getInitialState:function(){return{direction:null}},getDefaultProps:function(){return{animation:!0}},handleAnimateOutEnd:function(){this.props.onAnimateOutEnd&&this.isMounted()&&this.props.onAnimateOutEnd(this.props.index)},componentWillReceiveProps:function(e){this.props.active!==e.active&&this.setState({direction:null})},componentDidUpdate:function(e){!this.props.active&&e.active&&c["default"].addEndEventListener(a["default"].findDOMNode(this),this.handleAnimateOutEnd),this.props.active!==e.active&&setTimeout(this.startAnimation,20)},startAnimation:function(){this.isMounted()&&this.setState({direction:"prev"===this.props.direction?"right":"left"})},render:function(){var e={item:!0,active:this.props.active&&!this.props.animateIn||this.props.animateOut,next:this.props.active&&this.props.animateIn&&"next"===this.props.direction,prev:this.props.active&&this.props.animateIn&&"prev"===this.props.direction};return this.state.direction&&(this.props.animateIn||this.props.animateOut)&&(e[this.state.direction]=!0),a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children,this.props.caption?this.renderCaption():null)},renderCaption:function(){return a["default"].createElement("div",{className:"carousel-caption"},this.props.caption)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(6),s=r(a),u=n(96),l=r(u),c=n(3),p=r(c),f=n(22),d=r(f),h=n(15),m=r(h),v=n(27),g=r(v),y=i["default"].createClass({displayName:"CollapsibleNav",mixins:[s["default"],l["default"]],propTypes:{onSelect:i["default"].PropTypes.func,activeHref:i["default"].PropTypes.string,activeKey:i["default"].PropTypes.any,collapsible:i["default"].PropTypes.bool,expanded:i["default"].PropTypes.bool,eventKey:i["default"].PropTypes.any},getCollapsibleDOMNode:function(){return i["default"].findDOMNode(this)},getCollapsibleDimensionValue:function(){var e=0,t=this.refs;for(var n in t)if(t.hasOwnProperty(n)){var r=i["default"].findDOMNode(t[n]),o=r.offsetHeight,a=d["default"].getComputedStyles(r);e+=o+parseInt(a.marginTop,10)+parseInt(a.marginBottom,10)}return e},render:function(){var e=this.props.collapsible?this.getCollapsibleClassSet("navbar-collapse"):null,t=this.props.collapsible?this.renderCollapsibleNavChildren:this.renderChildren;return i["default"].createElement("div",{eventKey:this.props.eventKey,className:p["default"](this.props.className,e)},m["default"].map(this.props.children,t))},getChildActiveProp:function(e){return e.props.active?!0:null!=this.props.activeKey&&e.props.eventKey===this.props.activeKey?!0:null!=this.props.activeHref&&e.props.href===this.props.activeHref?!0:e.props.active},renderChildren:function(e,t){var n=e.key?e.key:t;return o.cloneElement(e,{activeKey:this.props.activeKey,activeHref:this.props.activeHref,ref:"nocollapse_"+n,key:n,navItem:!0})},renderCollapsibleNavChildren:function(e,t){var n=e.key?e.key:t;return o.cloneElement(e,{active:this.getChildActiveProp(e),activeKey:this.props.activeKey,activeHref:this.props.activeHref,onSelect:g["default"](e.props.onSelect,this.props.onSelect),ref:"collapsible_"+n,key:n,navItem:!0})}});t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(27),c=r(l),p=n(6),f=r(p),d=n(136),h=r(d),m=n(47),v=r(m),g=n(134),y=r(g),b=n(135),_=r(b),E=n(15),C=r(E),T=a["default"].createClass({displayName:"DropdownButton",mixins:[f["default"],h["default"]],propTypes:{pullRight:a["default"].PropTypes.bool,dropup:a["default"].PropTypes.bool,title:a["default"].PropTypes.node,href:a["default"].PropTypes.string,id:a["default"].PropTypes.string,onClick:a["default"].PropTypes.func,onSelect:a["default"].PropTypes.func,navItem:a["default"].PropTypes.bool,noCaret:a["default"].PropTypes.bool,buttonClassName:a["default"].PropTypes.string,className:a["default"].PropTypes.string,children:a["default"].PropTypes.node},render:function(){var e=this.props.navItem?"renderNavItem":"renderButtonGroup",t=this.props.noCaret?null:a["default"].createElement("span",{className:"caret"});return this[e]([a["default"].createElement(v["default"],o({},this.props,{ref:"dropdownButton",className:u["default"]("dropdown-toggle",this.props.buttonClassName),onClick:c["default"](this.props.onClick,this.handleDropdownClick),key:0,navDropdown:this.props.navItem,navItem:null,title:null,pullRight:null,dropup:null}),this.props.title," ",t),a["default"].createElement(_["default"],{ref:"menu","aria-labelledby":this.props.id,pullRight:this.props.pullRight,key:1},C["default"].map(this.props.children,this.renderMenuItem))])},renderButtonGroup:function(e){var t={open:this.state.open,dropup:this.props.dropup};return a["default"].createElement(y["default"],{bsSize:this.props.bsSize,className:u["default"](this.props.className,t)},e)},renderNavItem:function(e){var t={dropdown:!0,open:this.state.open,dropup:this.props.dropup};return a["default"].createElement("li",{className:u["default"](this.props.className,t)},e)},renderMenuItem:function(e,t){var n=this.props.onSelect||e.props.onSelect?this.handleOptionSelect:null;return i.cloneElement(e,{onSelect:c["default"](e.props.onSelect,n),key:e.key?e.key:t})},handleDropdownClick:function(e){e.preventDefault(),this.setDropdownState(!this.state.open)},handleOptionSelect:function(e){this.props.onSelect&&this.props.onSelect(e),this.setDropdownState(!1)}});t["default"]=T,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=n(137),d=r(f),h=n(141),m=r(h),v=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"getValue",value:function(){var e=this.props,t=e.children,n=e.value;return t?t:n}},{key:"renderInput",value:function(){return l["default"].createElement("p",a({},this.props,{className:p["default"](this.props.className,"form-control-static"),ref:"input",key:"input"}),this.getValue())}}]),t}(d["default"]);v.propTypes={value:m["default"],children:m["default"]},t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(14),c=r(l),p=a["default"].createClass({displayName:"Grid",propTypes:{fluid:a["default"].PropTypes.bool,componentClass:c["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass,t=this.props.fluid?"container-fluid":"container";return a["default"].createElement(e,o({},this.props,{className:u["default"](this.props.className,t)}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){
"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1;var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(137),p=r(c),f=n(217),d=r(f),h=n(218),m=r(h),v=n(74),g=r(v),y=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),a(t,[{key:"render",value:function(){return d["default"].types.indexOf(this.props.type)>-1?(g["default"]("Input type="+this.props.type,"ButtonInput"),l["default"].createElement(d["default"],this.props)):"static"===this.props.type?(g["default"]("Input type=static","StaticText"),l["default"].createElement(m["default"].Static,this.props)):s(Object.getPrototypeOf(t.prototype),"render",this).call(this)}}]),t}(p["default"]);t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(14),c=r(l),p=a["default"].createClass({displayName:"Jumbotron",propTypes:{componentClass:c["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass;return a["default"].createElement(e,o({},this.props,{className:u["default"](this.props.className,"jumbotron")}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=a["default"].createClass({displayName:"Label",mixins:[c["default"]],getDefaultProps:function(){return{bsClass:"label",bsStyle:"default"}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("span",o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=r(u),c=n(3),p=r(c),f=n(15),d=r(f),h=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){var e=this,t=d["default"].map(this.props.children,function(e,t){return u.cloneElement(e,{key:e.key?e.key:t})}),n=!1;if(!this.props.children)return this.renderDiv(t);if(1!==l["default"].Children.count(this.props.children)||Array.isArray(this.props.children))n=Array.prototype.some.call(this.props.children,function(t){return Array.isArray(t)?Array.prototype.some.call(t,function(t){return e.isAnchor(t.props)}):e.isAnchor(t.props)});else{var r=this.props.children;n=this.isAnchor(r.props)}return n?this.renderDiv(t):this.renderUL(t)}},{key:"isAnchor",value:function(e){return e.href||e.onClick}},{key:"renderUL",value:function(e){var t=d["default"].map(e,function(e,t){return u.cloneElement(e,{listItem:!0})});return l["default"].createElement("ul",a({},this.props,{className:p["default"](this.props.className,"list-group")}),t)}},{key:"renderDiv",value:function(e){return l["default"].createElement("div",a({},this.props,{className:p["default"](this.props.className,"list-group")}),e)}}]),t}(l["default"].Component);h.propTypes={className:l["default"].PropTypes.string,id:l["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(6),u=r(s),l=n(3),c=r(l),p=a["default"].createClass({displayName:"ListGroupItem",mixins:[u["default"]],propTypes:{bsStyle:a["default"].PropTypes.oneOf(["danger","info","success","warning"]),className:a["default"].PropTypes.string,active:a["default"].PropTypes.any,disabled:a["default"].PropTypes.any,header:a["default"].PropTypes.node,listItem:a["default"].PropTypes.bool,onClick:a["default"].PropTypes.func,eventKey:a["default"].PropTypes.any,href:a["default"].PropTypes.string,target:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"list-group-item"}},render:function(){var e=this.getBsClassSet();return e.active=this.props.active,e.disabled=this.props.disabled,this.props.href||this.props.onClick?this.renderAnchor(e):this.props.listItem?this.renderLi(e):this.renderSpan(e)},renderLi:function(e){return a["default"].createElement("li",o({},this.props,{className:c["default"](this.props.className,e)}),this.props.header?this.renderStructuredContent():this.props.children)},renderAnchor:function(e){return a["default"].createElement("a",o({},this.props,{className:c["default"](this.props.className,e)}),this.props.header?this.renderStructuredContent():this.props.children)},renderSpan:function(e){return a["default"].createElement("span",o({},this.props,{className:c["default"](this.props.className,e)}),this.props.header?this.renderStructuredContent():this.props.children)},renderStructuredContent:function(){var e=void 0;e=a["default"].isValidElement(this.props.header)?i.cloneElement(this.props.header,{key:"header",className:c["default"](this.props.header.props.className,"list-group-item-heading")}):a["default"].createElement("h4",{key:"header",className:"list-group-item-heading"},this.props.header);var t=a["default"].createElement("p",{key:"content",className:"list-group-item-text"},this.props.children);return[e,t]}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=a["default"].createClass({displayName:"MenuItem",propTypes:{header:a["default"].PropTypes.bool,divider:a["default"].PropTypes.bool,href:a["default"].PropTypes.string,title:a["default"].PropTypes.string,target:a["default"].PropTypes.string,onSelect:a["default"].PropTypes.func,eventKey:a["default"].PropTypes.any,active:a["default"].PropTypes.bool,disabled:a["default"].PropTypes.bool},getDefaultProps:function(){return{href:"#",active:!1}},handleClick:function(e){return this.props.disabled?void e.preventDefault():void(this.props.onSelect&&(e.preventDefault(),this.props.onSelect(this.props.eventKey,this.props.href,this.props.target)))},renderAnchor:function(){return a["default"].createElement("a",{onClick:this.handleClick,href:this.props.href,target:this.props.target,title:this.props.title,tabIndex:"-1"},this.props.children)},render:function(){var e={"dropdown-header":this.props.header,divider:this.props.divider,active:this.props.active,disabled:this.props.disabled},t=null;return this.props.header?t=this.props.children:this.props.divider||(t=this.renderAnchor()),a["default"].createElement("li",o({},this.props,{role:"presentation",title:null,href:null,className:u["default"](this.props.className,e)}),t)}});t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){var n=T["default"].ownerDocument(t);return e===n.body||e===n.documentElement?n.documentElement.clientHeight:e.clientHeight}function a(e){return e.props.container&&d["default"].findDOMNode(e.props.container)||T["default"].ownerDocument(e).body}function s(e,t){return function(n,r,o){var i=t;return void 0===n[e]&&(i=i.isRequired),i(n,r,o)}}function u(e){var t=[];return d["default"].Children.forEach(e,function(e){return t.push(e)}),t}function l(e,t){var n=T["default"].ownerDocument(e),r=!n.addEventListener,o=void 0;return F&&F.remove(),r?(document.attachEvent("onfocusin",t),o=function(){return document.detachEvent("onfocusin",t)}):(document.addEventListener("focus",t,!0),o=function(){return document.removeEventListener("focus",t,!0)}),F={remove:o}}function c(){if(void 0!==H)return H;var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),H=e.offsetWidth-e.clientWidth,document.body.removeChild(e),e=null}Object.defineProperty(t,"__esModule",{value:!0});var p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=n(1),d=r(f),h=n(3),m=r(h),v=n(27),g=r(v),y=n(6),b=r(y),_=n(97),E=r(_),C=n(22),T=r(C),w=n(100),S=r(w),O=n(74),x=r(O),P=n(139),D=r(P),N=n(221),M=r(N),k=n(223),R=r(k),I=n(224),A=r(I),j=n(222),L=r(j),F=void 0,H=void 0,U=d["default"].createClass({displayName:"ModalMarkup",mixins:[b["default"],E["default"]],propTypes:{title:d["default"].PropTypes.node,backdrop:d["default"].PropTypes.oneOf(["static",!0,!1]),keyboard:d["default"].PropTypes.bool,closeButton:d["default"].PropTypes.bool,animation:d["default"].PropTypes.bool,onHide:s("onRequestHide",d["default"].PropTypes.func),onRequestHide:d["default"].PropTypes.func,dialogClassName:d["default"].PropTypes.string,autoFocus:d["default"].PropTypes.bool,enforceFocus:d["default"].PropTypes.bool},getDefaultProps:function(){return{bsClass:"modal",backdrop:!0,keyboard:!0,animation:!0,closeButton:!0,autoFocus:!0,enforceFocus:!0}},getInitialState:function(){return{}},render:function(){var e=this.state,t=p({},e.dialogStyles,{display:"block"}),n=this.getBsClassSet();delete n.modal,n["modal-dialog"]=!0;var r={modal:!0,fade:this.props.animation,"in":!this.props.animation},o=d["default"].createElement("div",p({},this.props,{title:null,tabIndex:"-1",role:"dialog",style:t,className:m["default"](this.props.className,r),onClick:this.props.backdrop===!0?this.handleBackdropClick:null,ref:"modal"}),d["default"].createElement("div",{className:m["default"](this.props.dialogClassName,n)},d["default"].createElement("div",{className:"modal-content",role:"document"},this.renderContent())));return this.props.backdrop?this.renderBackdrop(o,e.backdropStyles):o},renderContent:function(){var e=this,t=u(this.props.children),n=t.some(function(e){return e.type.__isModalHeader});return n||null==this.props.title||(x["default"]("Specifying `closeButton` or `title` Modal props","the new Modal.Header, and Modal.Title components"),t.unshift(d["default"].createElement(R["default"],{closeButton:this.props.closeButton,onHide:this._getHide()},this.props.title&&d["default"].createElement(A["default"],null,this.props.title)))),d["default"].Children.map(t,function(t){return t.type.__isModalHeader?f.cloneElement(t,{onHide:g["default"](e._getHide(),t.props.onHide)}):t})},renderBackdrop:function(e){var t={"modal-backdrop":!0,fade:this.props.animation,"in":!this.props.animation},n=this.props.backdrop===!0?this.handleBackdropClick:null;return d["default"].createElement("div",null,d["default"].createElement("div",{className:m["default"](t),ref:"backdrop",onClick:n}),e)},_getHide:function(){return!this.props.onHide&&this.props.onRequestHide&&x["default"]("The Modal prop `onRequestHide`","the `onHide` prop"),this.props.onHide||this.props.onRequestHide},iosClickHack:function(){d["default"].findDOMNode(this.refs.modal).onclick=function(){},d["default"].findDOMNode(this.refs.backdrop).onclick=function(){}},componentWillMount:function(){this.checkForFocus()},componentDidMount:function(){var e=this,t=T["default"].ownerDocument(this),n=T["default"].ownerWindow(this);this._onDocumentKeyupListener=S["default"].listen(t,"keyup",this.handleDocumentKeyUp),this._onWindowResizeListener=S["default"].listen(n,"resize",this.handleWindowResize),this.props.enforceFocus&&(this._onFocusinListener=l(this,this.enforceFocus));var r=a(this);r.className+=r.className.length?" modal-open":"modal-open",this._containerIsOverflowing=r.scrollHeight>i(r,this),this._originalPadding=r.style.paddingRight,this._containerIsOverflowing&&(r.style.paddingRight=parseInt(this._originalPadding||0,10)+c()+"px"),this.props.backdrop&&this.iosClickHack(),this.setState(this._getStyles(),function(){return e.focusModalContent()})},componentDidUpdate:function(e){if(this.props.backdrop&&this.props.backdrop!==e.backdrop&&(this.iosClickHack(),this.setState(this._getStyles())),this.props.container!==e.container){var t=a(this);this._containerIsOverflowing=t.scrollHeight>i(t,this)}},componentWillUnmount:function(){this._onDocumentKeyupListener.remove(),this._onWindowResizeListener.remove(),this._onFocusinListener&&this._onFocusinListener.remove();var e=a(this);e.style.paddingRight=this._originalPadding,e.className=e.className.replace(/ ?modal-open/,""),this.restoreLastFocus()},handleBackdropClick:function(e){e.target===e.currentTarget&&this._getHide()()},handleDocumentKeyUp:function(e){this.props.keyboard&&27===e.keyCode&&this._getHide()()},handleWindowResize:function(){this.setState(this._getStyles())},checkForFocus:function(){if(T["default"].canUseDom)try{this.lastFocus=document.activeElement}catch(e){}},focusModalContent:function(){var e=d["default"].findDOMNode(this.refs.modal),t=T["default"].activeElement(this),n=t&&T["default"].contains(e,t);this.props.autoFocus&&!n&&(this.lastFocus=t,e.focus())},restoreLastFocus:function(){this.lastFocus&&(this.lastFocus.focus(),this.lastFocus=null)},enforceFocus:function(){if(this.isMounted()){var e=T["default"].activeElement(this),t=d["default"].findDOMNode(this.refs.modal);t===e||T["default"].contains(t,e)||t.focus()}},_getStyles:function(){if(!T["default"].canUseDom)return{};var e=d["default"].findDOMNode(this.refs.modal),t=e.scrollHeight,n=a(this),r=this._containerIsOverflowing,o=t>i(n,this);return{dialogStyles:{paddingRight:r&&!o?c():void 0,paddingLeft:!r&&o?c():void 0}}}}),B=d["default"].createClass({displayName:"Modal",propTypes:p({},D["default"].propTypes,U.propTypes),defaultProps:{show:null},render:function(){var e=this.props,t=e.show,n=o(e,["show"]),r=d["default"].createElement(U,n,this.props.children);return this.props.__isUsedInModalTrigger||null==t?r:d["default"].createElement(D["default"],{container:n.container},t&&r)}});B.Body=M["default"],B.Header=R["default"],B.Title=A["default"],B.Footer=L["default"],t["default"]=B,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return c["default"]("The Modal prop `onRequestHide`","the `onHide` prop"),e.apply(void 0,n)}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),s=n(14),u=r(s),l=n(74),c=r(l),p=n(27),f=r(p),d=n(230),h=r(d),m=n(138),v=a["default"].createClass({displayName:"ModalTrigger",mixins:[m.OverlayMixin],propTypes:{modal:a["default"].PropTypes.node.isRequired,container:u["default"].mountable,onBlur:a["default"].PropTypes.func,onFocus:a["default"].PropTypes.func,onMouseOut:a["default"].PropTypes.func,onMouseOver:a["default"].PropTypes.func},getInitialState:function(){return{isOverlayShown:!1}},show:function(){this.setState({isOverlayShown:!0})},hide:function(){this.setState({isOverlayShown:!1})},toggle:function(){this.setState({isOverlayShown:!this.state.isOverlayShown})},renderOverlay:function(){var e=this.props.modal;return this.state.isOverlayShown?i.cloneElement(e,{onHide:this.hide,onRequestHide:o(this.hide),__isUsedInModalTrigger:!0}):a["default"].createElement("span",null)},render:function(){var e=a["default"].Children.only(this.props.children),t={};return t.onClick=f["default"](e.props.onClick,this.toggle),t.onMouseOver=f["default"](e.props.onMouseOver,this.props.onMouseOver),t.onMouseOut=f["default"](e.props.onMouseOut,this.props.onMouseOut),t.onFocus=f["default"](e.props.onFocus,this.props.onFocus),t.onBlur=f["default"](e.props.onBlur,this.props.onBlur),i.cloneElement(e,t)}});v.withContext=h["default"](v,"modal");var g=a["default"].createClass({displayName:"DepreciatedModalTrigger",componentWillMount:function(){c["default"]("The `ModalTrigger` component","the `Modal` component directly","http://react-bootstrap.github.io/components.html#modals")},render:function(){return a["default"].createElement(v,this.props)}});g.withContext=v.withContext,g.ModalTrigger=v,t["default"]=g,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(6),u=r(s),l=n(3),c=r(l),p=n(15),f=r(p),d=n(27),h=r(d),m=n(14),v=r(m),g=a["default"].createClass({displayName:"Navbar",mixins:[u["default"]],propTypes:{fixedTop:a["default"].PropTypes.bool,fixedBottom:a["default"].PropTypes.bool,staticTop:a["default"].PropTypes.bool,inverse:a["default"].PropTypes.bool,fluid:a["default"].PropTypes.bool,role:a["default"].PropTypes.string,componentClass:v["default"].elementType,brand:a["default"].PropTypes.node,toggleButton:a["default"].PropTypes.node,toggleNavKey:a["default"].PropTypes.oneOfType([a["default"].PropTypes.string,a["default"].PropTypes.number]),onToggle:a["default"].PropTypes.func,navExpanded:a["default"].PropTypes.bool,defaultNavExpanded:a["default"].PropTypes.bool},getDefaultProps:function(){return{bsClass:"navbar",bsStyle:"default",role:"navigation",componentClass:"nav"}},getInitialState:function(){return{navExpanded:this.props.defaultNavExpanded}},shouldComponentUpdate:function(){return!this._isChanging},handleToggle:function(){this.props.onToggle&&(this._isChanging=!0,this.props.onToggle(),this._isChanging=!1),this.setState({navExpanded:!this.state.navExpanded})},isNavExpanded:function(){return null!=this.props.navExpanded?this.props.navExpanded:this.state.navExpanded},render:function(){var e=this.getBsClassSet(),t=this.props.componentClass;return e["navbar-fixed-top"]=this.props.fixedTop,e["navbar-fixed-bottom"]=this.props.fixedBottom,e["navbar-static-top"]=this.props.staticTop,e["navbar-inverse"]=this.props.inverse,a["default"].createElement(t,o({},this.props,{className:c["default"](this.props.className,e)}),a["default"].createElement("div",{className:this.props.fluid?"container-fluid":"container"},this.props.brand||this.props.toggleButton||null!=this.props.toggleNavKey?this.renderHeader():null,f["default"].map(this.props.children,this.renderChild)))},renderChild:function(e,t){return i.cloneElement(e,{navbar:!0,collapsible:null!=this.props.toggleNavKey&&this.props.toggleNavKey===e.props.eventKey,expanded:null!=this.props.toggleNavKey&&this.props.toggleNavKey===e.props.eventKey&&this.isNavExpanded(),key:e.key?e.key:t})},renderHeader:function(){var e=void 0;return this.props.brand&&(e=a["default"].isValidElement(this.props.brand)?i.cloneElement(this.props.brand,{className:c["default"](this.props.brand.props.className,"navbar-brand")}):a["default"].createElement("span",{className:"navbar-brand"},this.props.brand)),a["default"].createElement("div",{className:"navbar-header"},e,this.props.toggleButton||null!=this.props.toggleNavKey?this.renderToggleButton():null)},renderToggleButton:function(){var e=void 0;return a["default"].isValidElement(this.props.toggleButton)?i.cloneElement(this.props.toggleButton,{className:c["default"](this.props.toggleButton.props.className,"navbar-toggle"),onClick:h["default"](this.handleToggle,this.props.toggleButton.props.onClick)}):(e=null!=this.props.toggleButton?this.props.toggleButton:[a["default"].createElement("span",{className:"sr-only",key:0},"Toggle navigation"),a["default"].createElement("span",{className:"icon-bar",key:1}),a["default"].createElement("span",{className:"icon-bar",key:2}),a["default"].createElement("span",{className:"icon-bar",key:3})],a["default"].createElement("button",{className:"navbar-toggle",type:"button",onClick:this.handleToggle},e))}});t["default"]=g,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return Array.isArray(t)?t.indexOf(e)>=0:e===t}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(27),l=r(u),c=n(230),p=r(c),f=n(227),d=r(f),h=n(231),m=r(h),v=n(74),g=r(v),y=n(8),b=r(y),_=s["default"].createClass({displayName:"OverlayTrigger",propTypes:i({},d["default"].propTypes,{trigger:s["default"].PropTypes.oneOfType([s["default"].PropTypes.oneOf(["manual","click","hover","focus"]),s["default"].PropTypes.arrayOf(s["default"].PropTypes.oneOf(["click","hover","focus"]))]),delay:s["default"].PropTypes.number,delayShow:s["default"].PropTypes.number,delayHide:s["default"].PropTypes.number,defaultOverlayShown:s["default"].PropTypes.bool,overlay:s["default"].PropTypes.node.isRequired,onBlur:s["default"].PropTypes.func,onClick:s["default"].PropTypes.func,onFocus:s["default"].PropTypes.func,onMouseEnter:s["default"].PropTypes.func,onMouseLeave:s["default"].PropTypes.func,target:function(){},onHide:function(){},show:function(){}}),getDefaultProps:function(){return{trigger:["hover","focus"]}},getInitialState:function(){return{isOverlayShown:null==this.props.defaultOverlayShown?!1:this.props.defaultOverlayShown}},show:function(){this.setState({isOverlayShown:!0})},hide:function(){this.setState({isOverlayShown:!1})},toggle:function(){this.state.isOverlayShown?this.hide():this.show()},componentDidMount:function(){this._mountNode=document.createElement("div"),s["default"].render(this._overlay,this._mountNode)},componentWillUnmount:function(){s["default"].unmountComponentAtNode(this._mountNode),this._mountNode=null,clearTimeout(this._hoverDelay)},componentDidUpdate:function(){s["default"].render(this._overlay,this._mountNode)},getOverlay:function(){var e=this,t={show:this.state.isOverlayShown,onHide:this.hide,rootClose:this.props.rootClose,target:function(){return s["default"].findDOMNode(e)},placement:this.props.placement,container:this.props.container,containerPadding:this.props.containerPadding},n=a.cloneElement(this.props.overlay,{placement:t.placement,container:t.container});return s["default"].createElement(d["default"],t,n)},render:function(){var e=s["default"].Children.only(this.props.children),t={"aria-describedby":this.props.overlay.props.id};return this._overlay=this.getOverlay(),"manual"!==this.props.trigger?(t.onClick=l["default"](e.props.onClick,this.props.onClick),o("click",this.props.trigger)&&(t.onClick=l["default"](this.toggle,t.onClick)),o("hover",this.props.trigger)&&(b["default"](!("hover"===this.props.trigger),'[react-bootstrap] Specifying only the `"hover"` trigger limits the visibilty of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'),t.onMouseOver=l["default"](this.handleDelayedShow,this.props.onMouseOver),t.onMouseOut=l["default"](this.handleDelayedHide,this.props.onMouseOut)),o("focus",this.props.trigger)&&(t.onFocus=l["default"](this.handleDelayedShow,this.props.onFocus),t.onBlur=l["default"](this.handleDelayedHide,this.props.onBlur))):g["default"]('"manual" trigger type'," the Overlay component"),a.cloneElement(e,t)},handleDelayedShow:function(){var e=this;if(null!=this._hoverDelay)return clearTimeout(this._hoverDelay),void(this._hoverDelay=null);var t=null!=this.props.delayShow?this.props.delayShow:this.props.delay;return t?void(this._hoverDelay=setTimeout(function(){e._hoverDelay=null,e.show()},t)):void this.show()},handleDelayedHide:function(){var e=this;if(null!=this._hoverDelay)return clearTimeout(this._hoverDelay),void(this._hoverDelay=null);var t=null!=this.props.delayHide?this.props.delayHide:this.props.delay;return t?void(this._hoverDelay=setTimeout(function(){e._hoverDelay=null,e.hide()},t)):void this.hide()},calcOverlayPosition:function(){var e=this.props.overlay;return g["default"]("OverlayTrigger.calcOverlayPosition()","utils/overlayPositionUtils"),m["default"].calcOverlayPosition(e.props.placement||this.props.placement,s["default"].findDOMNode(e),s["default"].findDOMNode(this),s["default"].findDOMNode(e.props.container||this.props.container),e.props.containerPadding||this.props.containerPadding)},getPosition:function(){g["default"]("OverlayTrigger.getPosition()","utils/overlayPositionUtils");var e=this.props.overlay;return m["default"].getPosition(s["default"].findDOMNode(this),s["default"].findDOMNode(e.props.container||this.props.container))}});_.withContext=p["default"](_,"overlay"),t["default"]=_,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=a["default"].createClass({displayName:"PageHeader",render:function(){return a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,"page-header")}),a["default"].createElement("h1",null,this.props.children))}});t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=a["default"].createClass({displayName:"PageItem",propTypes:{href:a["default"].PropTypes.string,target:a["default"].PropTypes.string,title:a["default"].PropTypes.string,disabled:a["default"].PropTypes.bool,previous:a["default"].PropTypes.bool,next:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,eventKey:a["default"].PropTypes.any},getDefaultProps:function(){return{href:"#"}},render:function(){var e={disabled:this.props.disabled,previous:this.props.previous,next:this.props.next};return a["default"].createElement("li",o({},this.props,{className:u["default"](this.props.className,e)}),a["default"].createElement("a",{href:this.props.href,title:this.props.title,target:this.props.target,onClick:this.handleSelect,ref:"anchor"},this.props.children))},handleSelect:function(e){this.props.onSelect&&(e.preventDefault(),this.props.disabled||this.props.onSelect(this.props.eventKey,this.props.href,this.props.target))}});t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(15),c=r(l),p=n(27),f=r(p),d=a["default"].createClass({displayName:"Pager",propTypes:{onSelect:a["default"].PropTypes.func},render:function(){return a["default"].createElement("ul",o({},this.props,{className:u["default"](this.props.className,"pager")}),c["default"].map(this.props.children,this.renderPageItem))},renderPageItem:function(e,t){return i.cloneElement(e,{onSelect:f["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t})}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(473),f=r(p),d=a["default"].createClass({displayName:"Pagination",mixins:[c["default"]],propTypes:{activePage:a["default"].PropTypes.number,items:a["default"].PropTypes.number,maxButtons:a["default"].PropTypes.number,ellipsis:a["default"].PropTypes.bool,first:a["default"].PropTypes.bool,last:a["default"].PropTypes.bool,prev:a["default"].PropTypes.bool,next:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func},getDefaultProps:function(){return{activePage:1,items:1,maxButtons:0,first:!1,last:!1,prev:!1,next:!1,ellipsis:!0,bsClass:"pagination"}},renderPageButtons:function(){var e=[],t=void 0,n=void 0,r=void 0,o=this.props,i=o.maxButtons,s=o.activePage,u=o.items,l=o.onSelect,c=o.ellipsis;if(i){var p=s-parseInt(i/2);t=p>1?p:1,r=u>=t+i,r?n=t+i-1:(n=u,t=u-i+1)}else t=1,n=u;for(var d=t;n>=d;d++)e.push(a["default"].createElement(f["default"],{key:d,eventKey:d,active:d===s,onSelect:l},d));return i&&r&&c&&e.push(a["default"].createElement(f["default"],{key:"ellipsis",disabled:!0},a["default"].createElement("span",{"aria-label":"More"},"..."))),e},renderPrev:function(){return this.props.prev?a["default"].createElement(f["default"],{key:"prev",eventKey:this.props.activePage-1,disabled:1===this.props.activePage,onSelect:this.props.onSelect},a["default"].createElement("span",{"aria-label":"Previous"},"‹")):null},renderNext:function(){return this.props.next?a["default"].createElement(f["default"],{key:"next",eventKey:this.props.activePage+1,disabled:this.props.activePage===this.props.items,onSelect:this.props.onSelect},a["default"].createElement("span",{"aria-label":"Next"},"›")):null},renderFirst:function(){return this.props.first?a["default"].createElement(f["default"],{key:"first",eventKey:1,disabled:1===this.props.activePage,onSelect:this.props.onSelect},a["default"].createElement("span",{"aria-label":"First"},"«")):null},renderLast:function(){return this.props.last?a["default"].createElement(f["default"],{key:"last",eventKey:this.props.items,disabled:this.props.activePage===this.props.items,onSelect:this.props.onSelect},a["default"].createElement("span",{"aria-label":"Last"},"»")):null},render:function(){return a["default"].createElement("ul",o({},this.props,{className:u["default"](this.props.className,this.getBsClassSet())
}),this.renderFirst(),this.renderPrev(),this.renderPageButtons(),this.renderNext(),this.renderLast())}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(3),s=r(a),u=n(6),l=r(u),c=n(486),p=r(c),f=i["default"].createClass({displayName:"PaginationButton",mixins:[l["default"]],propTypes:{className:i["default"].PropTypes.string,eventKey:i["default"].PropTypes.oneOfType([i["default"].PropTypes.string,i["default"].PropTypes.number]),onSelect:i["default"].PropTypes.func,disabled:i["default"].PropTypes.bool,active:i["default"].PropTypes.bool},getDefaultProps:function(){return{active:!1,disabled:!1}},handleClick:function(e){if(e.preventDefault(),this.props.onSelect){var t=p["default"](this.props.eventKey);this.props.onSelect(e,t)}},render:function(){var e=this.getBsClassSet();return e.active=this.props.active,e.disabled=this.props.disabled,i["default"].createElement("li",{className:s["default"](this.props.className,e)},i["default"].createElement("a",{href:"#",onClick:this.handleClick},this.props.children))}});t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(97),d=r(f),h=n(14),m=r(h),v=s["default"].createClass({displayName:"Popover",mixins:[p["default"],d["default"]],propTypes:{id:m["default"].isRequiredForA11y(s["default"].PropTypes.string),placement:s["default"].PropTypes.oneOf(["top","right","bottom","left"]),positionLeft:s["default"].PropTypes.number,positionTop:s["default"].PropTypes.number,arrowOffsetLeft:s["default"].PropTypes.oneOfType([s["default"].PropTypes.number,s["default"].PropTypes.string]),arrowOffsetTop:s["default"].PropTypes.oneOfType([s["default"].PropTypes.number,s["default"].PropTypes.string]),title:s["default"].PropTypes.node,animation:s["default"].PropTypes.bool},getDefaultProps:function(){return{placement:"right",animation:!0}},render:function(){var e,t=(e={popover:!0},o(e,this.props.placement,!0),o(e,"in",!this.props.animation&&(null!=this.props.positionLeft||null!=this.props.positionTop)),o(e,"fade",this.props.animation),e),n={left:this.props.positionLeft,top:this.props.positionTop,display:"block"},r={left:this.props.arrowOffsetLeft,top:this.props.arrowOffsetTop};return s["default"].createElement("div",i({role:"tooltip"},this.props,{className:l["default"](this.props.className,t),style:n,title:null}),s["default"].createElement("div",{className:"arrow",style:r}),this.props.title?this.renderTitle():null,s["default"].createElement("div",{className:"popover-content"},this.props.children))},renderTitle:function(){return s["default"].createElement("h3",{className:"popover-title"},this.props.title)}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){if(e[t]){var r=function(){var r=void 0,o=void 0;return s["default"].Children.forEach(e[t],function(e){e.type!==v&&(o=e.type.displayName?e.type.displayName:e.type,r=new Error("Children of "+n+" can contain only ProgressBar components. Found "+o))}),{v:r}}();if("object"==typeof r)return r.v}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(220),l=r(u),c=n(6),p=r(c),f=n(3),d=r(f),h=n(15),m=r(h),v=s["default"].createClass({displayName:"ProgressBar",propTypes:{min:a.PropTypes.number,now:a.PropTypes.number,max:a.PropTypes.number,label:a.PropTypes.node,srOnly:a.PropTypes.bool,striped:a.PropTypes.bool,active:a.PropTypes.bool,children:o,className:s["default"].PropTypes.string,interpolateClass:a.PropTypes.node,isChild:a.PropTypes.bool},mixins:[p["default"]],getDefaultProps:function(){return{bsClass:"progress-bar",min:0,max:100}},getPercentage:function(e,t,n){var r=1e3;return Math.round((e-t)/(n-t)*100*r)/r},render:function(){if(this.props.isChild)return this.renderProgressBar();var e={active:this.props.active,progress:!0,"progress-striped":this.props.active||this.props.striped},t=void 0;return t=this.props.children?m["default"].map(this.props.children,this.renderChildBar):this.renderProgressBar(),s["default"].createElement("div",i({},this.props,{className:d["default"](this.props.className,e)}),t)},renderChildBar:function(e,t){return a.cloneElement(e,{isChild:!0,key:e.key?e.key:t})},renderProgressBar:function(){var e=this.getPercentage(this.props.now,this.props.min,this.props.max),t=void 0;return t="string"==typeof this.props.label?this.renderLabel(e):this.props.label,this.props.srOnly&&(t=s["default"].createElement("span",{className:"sr-only"},t)),s["default"].createElement("div",i({},this.props,{className:d["default"](this.props.className,this.getBsClassSet()),role:"progressbar",style:{width:e+"%"},"aria-valuenow":this.props.now,"aria-valuemin":this.props.min,"aria-valuemax":this.props.max}),t)},renderLabel:function(e){var t=this.props.interpolateClass||l["default"];return s["default"].createElement(t,{now:this.props.now,min:this.props.min,max:this.props.max,percent:e,bsStyle:this.props.bsStyle},this.props.label)}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;s=l=u=void 0,r=!1;var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;e=l,t=i,n=a,r=!0}},u=n(1),l=r(u),c=n(22),p=r(c),f=n(100),d=r(f),h=function(e){function t(e){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.handleDocumentClick=this.handleDocumentClick.bind(this),this.handleDocumentKeyUp=this.handleDocumentKeyUp.bind(this)}return i(t,e),a(t,[{key:"bindRootCloseHandlers",value:function(){var e=p["default"].ownerDocument(this);this._onDocumentClickListener=d["default"].listen(e,"click",this.handleDocumentClick),this._onDocumentKeyupListener=d["default"].listen(e,"keyup",this.handleDocumentKeyUp)}},{key:"handleDocumentClick",value:function(e){var t=e.target||e.srcElement;p["default"].contains(l["default"].findDOMNode(this),t)||this.props.onRootClose()}},{key:"handleDocumentKeyUp",value:function(e){27===e.keyCode&&this.props.onRootClose()}},{key:"unbindRootCloseHandlers",value:function(){this._onDocumentClickListener&&this._onDocumentClickListener.remove(),this._onDocumentKeyupListener&&this._onDocumentKeyupListener.remove()}},{key:"componentDidMount",value:function(){this.bindRootCloseHandlers()}},{key:"render",value:function(){return l["default"].Children.only(this.props.children)}},{key:"componentWillUnmount",value:function(){this.unbindRootCloseHandlers()}}]),t}(l["default"].Component);t["default"]=h,h.propTypes={onRootClose:l["default"].PropTypes.func.isRequired},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=n(136),f=r(p),d=n(47),h=r(d),m=n(134),v=r(m),g=n(135),y=r(g),b=a["default"].createClass({displayName:"SplitButton",mixins:[c["default"],f["default"]],propTypes:{pullRight:a["default"].PropTypes.bool,title:a["default"].PropTypes.node,href:a["default"].PropTypes.string,id:a["default"].PropTypes.string,target:a["default"].PropTypes.string,dropdownTitle:a["default"].PropTypes.node,dropup:a["default"].PropTypes.bool,onClick:a["default"].PropTypes.func,onSelect:a["default"].PropTypes.func,disabled:a["default"].PropTypes.bool,className:a["default"].PropTypes.string,children:a["default"].PropTypes.node},getDefaultProps:function(){return{dropdownTitle:"Toggle dropdown"}},render:function(){var e={open:this.state.open,dropup:this.props.dropup},t=a["default"].createElement(h["default"],o({},this.props,{ref:"button",onClick:this.handleButtonClick,title:null,id:null}),this.props.title),n=a["default"].createElement(h["default"],o({},this.props,{ref:"dropdownButton",className:u["default"](this.props.className,"dropdown-toggle"),onClick:this.handleDropdownClick,title:null,href:null,target:null,id:null}),a["default"].createElement("span",{className:"sr-only"},this.props.dropdownTitle),a["default"].createElement("span",{className:"caret"}),a["default"].createElement("span",{style:{letterSpacing:"-.3em"}}," "));return a["default"].createElement(v["default"],{bsSize:this.props.bsSize,className:u["default"](e),id:this.props.id},t,n,a["default"].createElement(y["default"],{ref:"menu",onSelect:this.handleOptionSelect,"aria-labelledby":this.props.id,pullRight:this.props.pullRight},this.props.children))},handleButtonClick:function(e){this.state.open&&this.setDropdownState(!1),this.props.onClick&&this.props.onClick(e,this.props.href,this.props.target)},handleDropdownClick:function(e){e.preventDefault(),this.setDropdownState(!this.state.open)},handleOptionSelect:function(e){this.props.onSelect&&this.props.onSelect(e),this.setDropdownState(!1)}});t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(15),c=r(l),p=n(27),f=r(p),d=n(6),h=r(d),m=a["default"].createClass({displayName:"SubNav",mixins:[h["default"]],propTypes:{onSelect:a["default"].PropTypes.func,active:a["default"].PropTypes.bool,activeHref:a["default"].PropTypes.string,activeKey:a["default"].PropTypes.any,disabled:a["default"].PropTypes.bool,eventKey:a["default"].PropTypes.any,href:a["default"].PropTypes.string,title:a["default"].PropTypes.string,text:a["default"].PropTypes.node,target:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"nav"}},handleClick:function(e){this.props.onSelect&&(e.preventDefault(),this.props.disabled||this.props.onSelect(this.props.eventKey,this.props.href,this.props.target))},isActive:function(){return this.isChildActive(this)},isChildActive:function(e){if(e.props.active)return!0;if(null!=this.props.activeKey&&this.props.activeKey===e.props.eventKey)return!0;if(null!=this.props.activeHref&&this.props.activeHref===e.props.href)return!0;if(e.props.children){var t=!1;return c["default"].forEach(e.props.children,function(e){this.isChildActive(e)&&(t=!0)},this),t}return!1},getChildActiveProp:function(e){return e.props.active?!0:null!=this.props.activeKey&&e.props.eventKey===this.props.activeKey?!0:null!=this.props.activeHref&&e.props.href===this.props.activeHref?!0:e.props.active},render:function(){var e={active:this.isActive(),disabled:this.props.disabled};return a["default"].createElement("li",o({},this.props,{className:u["default"](this.props.className,e)}),a["default"].createElement("a",{href:this.props.href,title:this.props.title,target:this.props.target,onClick:this.handleClick,ref:"anchor"},this.props.text),a["default"].createElement("ul",{className:"nav"},c["default"].map(this.props.children,this.renderNavItem)))},renderNavItem:function(e,t){return i.cloneElement(e,{active:this.getChildActiveProp(e),onSelect:f["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t})}});t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(140),c=r(l),p=a["default"].createClass({displayName:"TabPane",propTypes:{active:a["default"].PropTypes.bool,animation:a["default"].PropTypes.bool,onAnimateOutEnd:a["default"].PropTypes.func,disabled:a["default"].PropTypes.bool},getDefaultProps:function(){return{animation:!0}},getInitialState:function(){return{animateIn:!1,animateOut:!1}},componentWillReceiveProps:function(e){this.props.animation&&(this.state.animateIn||!e.active||this.props.active?this.state.animateOut||e.active||!this.props.active||this.setState({animateOut:!0}):this.setState({animateIn:!0}))},componentDidUpdate:function(){this.state.animateIn&&setTimeout(this.startAnimateIn,0),this.state.animateOut&&c["default"].addEndEventListener(a["default"].findDOMNode(this),this.stopAnimateOut)},startAnimateIn:function(){this.isMounted()&&this.setState({animateIn:!1})},stopAnimateOut:function(){this.isMounted()&&(this.setState({animateOut:!1}),this.props.onAnimateOutEnd&&this.props.onAnimateOutEnd())},render:function(){var e={"tab-pane":!0,fade:!0,active:this.props.active||this.state.animateOut,"in":this.props.active&&!this.state.animateIn};return a["default"].createElement("div",o({},this.props,{role:"tabpanel","aria-hidden":!this.props.active,className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){var t=void 0;return f["default"].forEach(e,function(e){null==t&&(t=e.props.eventKey)}),t}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(1),u=r(s),l=n(6),c=r(l),p=n(15),f=r(p),d=n(225),h=r(d),m=n(226),v=r(m),g=function(e,t){return t.props.id?t.props.id:e.id&&e.id+"___panel___"+t.props.eventKey},y=function(e,t){return t.props.id?t.props.id+"___tab":e.id&&e.id+"___tab___"+t.props.eventKey},b=u["default"].createClass({displayName:"TabbedArea",mixins:[c["default"]],propTypes:{activeKey:u["default"].PropTypes.any,defaultActiveKey:u["default"].PropTypes.any,bsStyle:u["default"].PropTypes.oneOf(["tabs","pills"]),animation:u["default"].PropTypes.bool,id:u["default"].PropTypes.string,onSelect:u["default"].PropTypes.func},getDefaultProps:function(){return{bsStyle:"tabs",animation:!0}},getInitialState:function(){var e=null!=this.props.defaultActiveKey?this.props.defaultActiveKey:i(this.props.children);return{activeKey:e,previousActiveKey:null}},componentWillReceiveProps:function(e){null!=e.activeKey&&e.activeKey!==this.props.activeKey&&this.setState({previousActiveKey:this.props.activeKey})},handlePaneAnimateOutEnd:function(){this.setState({previousActiveKey:null})},render:function(){function e(e){return null!=e.props.tab?this.renderTab(e):null}var t=this.props,n=t.id,r=o(t,["id"]),i=null!=this.props.activeKey?this.props.activeKey:this.state.activeKey,s=u["default"].createElement(h["default"],a({},r,{activeKey:i,onSelect:this.handleSelect,ref:"tabs"}),f["default"].map(this.props.children,e,this));return u["default"].createElement("div",null,s,u["default"].createElement("div",{id:n,className:"tab-content",ref:"panes"},f["default"].map(this.props.children,this.renderPane)))},getActiveKey:function(){return null!=this.props.activeKey?this.props.activeKey:this.state.activeKey},renderPane:function(e,t){var n=this.getActiveKey(),r=e.props.eventKey===n&&(null==this.state.previousActiveKey||!this.props.animation);return s.cloneElement(e,{active:r,id:g(this.props,e),"aria-labelledby":y(this.props,e),key:e.key?e.key:t,animation:this.props.animation,onAnimateOutEnd:null!=this.state.previousActiveKey&&e.props.eventKey===this.state.previousActiveKey?this.handlePaneAnimateOutEnd:null})},renderTab:function(e){var t=e.props,n=t.eventKey,r=t.className,o=t.tab,i=t.disabled;return u["default"].createElement(v["default"],{linkId:y(this.props,e),ref:"tab"+n,"aria-controls":g(this.props,e),eventKey:n,className:r,disabled:i},o)},shouldComponentUpdate:function(){return!this._isChanging},handleSelect:function(e){this.props.onSelect?(this._isChanging=!0,this.props.onSelect(e),this._isChanging=!1):e!==this.getActiveKey()&&this.setState({activeKey:e,previousActiveKey:this.getActiveKey()})}});t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=a["default"].createClass({displayName:"Table",propTypes:{striped:a["default"].PropTypes.bool,bordered:a["default"].PropTypes.bool,condensed:a["default"].PropTypes.bool,hover:a["default"].PropTypes.bool,responsive:a["default"].PropTypes.bool},render:function(){var e={table:!0,"table-striped":this.props.striped,"table-bordered":this.props.bordered,"table-condensed":this.props.condensed,"table-hover":this.props.hover},t=a["default"].createElement("table",o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children);return this.props.responsive?a["default"].createElement("div",{className:"table-responsive"},t):t}});t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=a["default"].createClass({displayName:"Thumbnail",mixins:[c["default"]],propTypes:{alt:a["default"].PropTypes.string,href:a["default"].PropTypes.string,src:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"thumbnail"}},render:function(){var e=this.getBsClassSet();return this.props.href?a["default"].createElement("a",o({},this.props,{href:this.props.href,className:u["default"](this.props.className,e)}),a["default"].createElement("img",{src:this.props.src,alt:this.props.alt})):this.props.children?a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e)}),a["default"].createElement("img",{src:this.props.src,alt:this.props.alt}),a["default"].createElement("div",{className:"caption"},this.props.children)):a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e)}),a["default"].createElement("img",{src:this.props.src,alt:this.props.alt}))}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(97),d=r(f),h=n(14),m=r(h),v=s["default"].createClass({displayName:"Tooltip",mixins:[p["default"],d["default"]],propTypes:{id:m["default"].isRequiredForA11y(s["default"].PropTypes.string),placement:s["default"].PropTypes.oneOf(["top","right","bottom","left"]),positionLeft:s["default"].PropTypes.number,positionTop:s["default"].PropTypes.number,arrowOffsetLeft:s["default"].PropTypes.oneOfType([s["default"].PropTypes.number,s["default"].PropTypes.string]),arrowOffsetTop:s["default"].PropTypes.oneOfType([s["default"].PropTypes.number,s["default"].PropTypes.string]),title:s["default"].PropTypes.node,animation:s["default"].PropTypes.bool},getDefaultProps:function(){return{placement:"right",animation:!0}},render:function(){var e,t=(e={tooltip:!0},o(e,this.props.placement,!0),o(e,"in",!this.props.animation&&(null!=this.props.positionLeft||null!=this.props.positionTop)),o(e,"fade",this.props.animation),e),n={left:this.props.positionLeft,top:this.props.positionTop},r={left:this.props.arrowOffsetLeft,top:this.props.arrowOffsetTop};return s["default"].createElement("div",i({role:"tooltip"},this.props,{className:l["default"](this.props.className,t),style:n}),s["default"].createElement("div",{className:"tooltip-arrow",style:r}),s["default"].createElement("div",{className:"tooltip-inner"},this.props.children))}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),a=r(i),s=n(3),u=r(s),l=n(6),c=r(l),p=a["default"].createClass({displayName:"Well",mixins:[c["default"]],getDefaultProps:function(){return{bsClass:"well"}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("div",o({},this.props,{className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(94),i=r(o),a=n(450),s=r(a),u=n(216),l=r(u),c=n(95),p=r(c),f=n(6),d=r(f),h=n(451),m=r(h),v=n(47),g=r(v),y=n(134),b=r(y),_=n(217),E=r(_),C=n(452),T=r(C),w=n(455),S=r(w),O=n(453),x=r(O),P=n(454),D=r(P),N=n(72),M=r(N),k=n(96),R=r(k),I=n(456),A=r(I),j=n(135),L=r(j),F=n(136),H=r(F),U=n(97),B=r(U),V=n(218),W=r(V),q=n(98),z=r(q),K=n(458),G=r(K),Y=n(459),$=r(Y),X=n(220),Q=r(X),J=n(460),Z=r(J),ee=n(461),te=r(ee),ne=n(462),re=r(ne),oe=n(463),ie=r(oe),ae=n(464),se=r(ae),ue=n(465),le=r(ue),ce=n(223),pe=r(ce),fe=n(224),de=r(fe),he=n(221),me=r(he),ve=n(222),ge=r(ve),ye=n(225),be=r(ye),_e=n(467),Ee=r(_e),Ce=n(226),Te=r(Ce),we=n(466),Se=r(we),Oe=n(468),xe=r(Oe),Pe=n(138),De=r(Pe),Ne=n(227),Me=r(Ne),ke=n(469),Re=r(ke),Ie=n(472),Ae=r(Ie),je=n(48),Le=r(je),Fe=n(228),He=r(Fe),Ue=n(470),Be=r(Ue),Ve=n(471),We=r(Ve),qe=n(474),ze=r(qe),Ke=n(475),Ge=r(Ke),Ye=n(73),$e=r(Ye),Xe=n(477),Qe=r(Xe),Je=n(478),Ze=r(Je),et=n(480),tt=r(et),nt=n(481),rt=r(nt),ot=n(479),it=r(ot),at=n(482),st=r(at),ut=n(483),lt=r(ut),ct=n(487),pt=r(ct),ft=n(484),dt=r(ft),ht=n(99),mt=r(ht),vt=n(139),gt=r(vt),yt=n(229),bt=r(yt);t["default"]={Accordion:i["default"],Affix:s["default"],AffixMixin:l["default"],Alert:p["default"],BootstrapMixin:d["default"],Badge:m["default"],Button:g["default"],ButtonGroup:b["default"],ButtonInput:E["default"],ButtonToolbar:T["default"],CollapsibleNav:S["default"],Carousel:x["default"],CarouselItem:D["default"],Col:M["default"],CollapsibleMixin:R["default"],DropdownButton:A["default"],DropdownMenu:L["default"],DropdownStateMixin:H["default"],FadeMixin:B["default"],FormControls:W["default"],Glyphicon:z["default"],Grid:G["default"],Input:$["default"],Interpolate:Q["default"],Jumbotron:Z["default"],Label:te["default"],ListGroup:re["default"],ListGroupItem:ie["default"],MenuItem:se["default"],Modal:le["default"],ModalHeader:pe["default"],ModalTitle:de["default"],ModalBody:me["default"],ModalFooter:ge["default"],Nav:be["default"],Navbar:Ee["default"],NavItem:Te["default"],ModalTrigger:Se["default"],Overlay:Me["default"],OverlayTrigger:xe["default"],OverlayMixin:De["default"],PageHeader:Re["default"],Panel:Le["default"],PanelGroup:He["default"],PageItem:Be["default"],Pager:We["default"],Pagination:Ae["default"],Popover:ze["default"],Portal:gt["default"],Position:bt["default"],ProgressBar:Ge["default"],Row:$e["default"],SplitButton:Qe["default"],SubNav:Ze["default"],TabbedArea:tt["default"],Table:rt["default"],TabPane:it["default"],Thumbnail:st["default"],Tooltip:lt["default"],utils:pt["default"],Well:dt["default"],styleMaps:mt["default"]},e.exports=t["default"]},function(e,t){"use strict";function n(e){var t=!1;return{eventKey:e,preventSelection:function(){t=!0},isSelectionPrevented:function(){return t}}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(141),i=r(o),a=n(27),s=r(a),u=n(14),l=r(u),c=n(22),p=r(c),f=n(15),d=r(f);t["default"]={childrenValueInputValidation:i["default"],createChainedFunction:s["default"],CustomPropTypes:l["default"],domUtils:p["default"],ValidComponentChildren:d["default"]},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}t.__esModule=!0;var a=n(233),s=r(a),u=n(143),l=function(e){function t(){var n=void 0===arguments[0]?{}:arguments[0];o(this,t),e.call(this,n),this.getScrollPosition=n.getScrollPosition||u.getWindowScrollPosition}return i(t,e),t.prototype.go=function(e){0!==e&&window.history.go(e)},t}(s["default"]);t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return 0===e.button}function i(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(1),u=r(s),l=u["default"].PropTypes,c=l.object,p=l.string,f=l.func,d=u["default"].createClass({displayName:"Link",contextTypes:{router:c},propTypes:{activeStyle:c,activeClassName:p,to:p.isRequired,query:c,state:c,onClick:f},getDefaultProps:function(){return{className:"",activeClassName:"active",style:{}}},handleClick:function(e){var t,n=!0;this.props.onClick&&(t=this.props.onClick(e)),!i(e)&&o(e)&&((t===!1||e.defaultPrevented===!0)&&(n=!1),e.preventDefault(),n&&this.context.router.transitionTo(this.props.to,this.props.query,this.props.state))},render:function(){var e=this.context.router,t=this.props,n=t.to,r=t.query,o=a({},this.props,{href:e.makeHref(n,r),onClick:this.handleClick});return e&&e.isActive(n,r)&&(o.activeClassName&&(o.className+=""!==o.className?" "+o.activeClassName:o.activeClassName),o.activeStyle&&(o.style=a({},o.style,o.activeStyle))),u["default"].createElement("a",o)}});t.Link=d,t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=i["default"].PropTypes.object,s={contextTypes:{router:a.isRequired}},u=["makePath","makeHref","transitionTo","replaceWith","go","goBack","goForward"];u.forEach(function(e){s[e]=function(){var t=this.context.router;return t[e].apply(t,arguments)}}),t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(49),s=r(a),u=n(75),l=n(102),c=n(101),p=i["default"].PropTypes,f=p.string,d=p.object,h=i["default"].createClass({displayName:"Redirect",statics:{createRouteFromReactElement:function(e){var t=u.createRouteFromReactElement(e);return t.from&&(t.path=t.from),t.onEnter=function(e,n){var r=e.location,o=e.params,i=t.to?l.formatPattern(t.to,o):r.pathname;n.to(i,t.query||r.query,t.state||r.state)},t}},propTypes:{path:f,from:f,to:f.isRequired,query:d,state:d,onEnter:c.falsy,children:c.falsy},render:function(){s["default"](!1,"<Redirect> elements are for router configuration only and should not be rendered")}});t.Redirect=h,t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(49),s=r(a),u=n(75),l=n(101),c=n(103),p=r(c),f=i["default"].PropTypes,d=f.string,h=f.bool,m=f.func,v=i["default"].createClass({displayName:"Route",statics:{createRouteFromReactElement:function(e){var t=u.createRouteFromReactElement(e);return t.handler&&(p["default"](!1,"<Route handler> is deprecated, use <Route component> instead"),t.component=t.handler,delete t.handler),t}},propTypes:{path:d,ignoreScrollBehavior:h,handler:l.component,component:l.component,components:l.components,getComponents:m},render:function(){s["default"](!1,"<Route> elements are for router configuration only and should not be rendered")}});t.Route=v,t["default"]=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n,r,o){var i=new C["default"];h.getState(t,n,function(t,a){if(t||null==a||i.isCancelled)o(t,null,i);else{a.location=n;var s=h.getTransitionHooks(e,a);Array.isArray(r)&&s.unshift.apply(s,r),f.loopAsync(s.length,function(e,t,n){s[e](a,i,function(e){e||i.isCancelled?n(e):t()})},function(e){e||i.isCancelled?o(e,null,i):h.getComponents(a.branch,function(e,t){e||i.isCancelled?o(e,null,i):(a.components=t,o(null,a,i))})})}})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(103),l=r(u),c=n(49),p=r(c),f=n(232),d=n(75),h=n(495),m=n(101),v=n(494),g=r(v),y=n(496),b=r(y),_=n(144),E=n(498),C=r(E),T=s["default"].PropTypes,w=T.arrayOf,S=T.func,O=T.object,x=s["default"].createClass({displayName:"Router",mixins:[g["default"],b["default"]],statics:{run:function(e,t,n,r){"function"==typeof n&&(r=n,n=null),p["default"]("function"==typeof r,"Router.run needs a callback"),o(null,e,t,n,r)}},propTypes:{createElement:S.isRequired,onAbort:S,onError:S,onUpdate:S,history:m.history,routes:m.routes,children:m.routes,location:m.location,branch:m.routes,params:O,components:w(m.components)},getDefaultProps:function(){return{createElement:a.createElement}},getInitialState:function(){return{isTransitioning:!1,location:null,branch:null,params:null,components:null}},_updateState:function(e){var t=this;p["default"](_.isLocation(e),"A <Router> needs a valid Location");var n=this.transitionHooks;n&&(n=n.map(function(e){return h.createTransitionHook(e,t)})),this.setState({isTransitioning:!0}),o(this.state,this.routes,e,n,function(n,r,o){if(n)t.handleError(n);else if(o.isCancelled)if(o.redirectInfo){var i=o.redirectInfo,a=i.pathname,s=i.query,r=i.state;t.replaceWith(a,s,r)}else p["default"](t.state.location,"You may not abort the initial transition"),t.handleAbort(o.abortReason);else null==r?l["default"](!1,'Location "%s" did not match any routes',e.pathname):t.setState(r,t.props.onUpdate);t.setState({isTransitioning:!1})})},addTransitionHook:function(e){this.transitionHooks||(this.transitionHooks=[]),this.transitionHooks.push(e)},removeTransitionHook:function(e){this.transitionHooks&&(this.transitionHooks=this.transitionHooks.filter(function(t){
return t!==e}))},handleAbort:function(e){this.props.onAbort?this.props.onAbort.call(this,e):(this._ignoreNextHistoryChange=!0,this.goBack())},handleError:function(e){if(!this.props.onError)throw e;this.props.onError.call(this,e)},handleHistoryChange:function(){this._ignoreNextHistoryChange?this._ignoreNextHistoryChange=!1:this._updateState(this.props.history.location)},componentWillMount:function(){var e=this.props,t=e.history,n=e.routes,r=e.children,o=e.location,i=e.branch,a=e.params,s=e.components;t?(p["default"](n||r,"Client-side <Router>s need routes. Try using <Router routes> or passing your routes as nested <Route> children"),this.routes=d.createRoutes(n||r),"function"==typeof t.setup&&t.setup(),t.addChangeListener&&t.addChangeListener(this.handleHistoryChange),this._updateState(t.location)):(p["default"](o&&i&&a&&s,"Server-side <Router>s need location, branch, params, and components props. Try using Router.run to get all the props you need"),this.setState({location:o,branch:i,params:a,components:s}))},componentWillReceiveProps:function(e){if(p["default"](this.props.history===e.history,"<Router history> may not be changed"),e.history){var t=this.props.routes||this.props.children,n=e.routes||e.children;t!==n&&(this.routes=d.createRoutes(n),e.history.location&&this._updateState(e.history.location))}},componentWillUnmount:function(){var e=this.props.history;e&&e.removeChangeListener&&e.removeChangeListener(this.handleHistoryChange)},_createElement:function(e,t){return"function"==typeof e?this.props.createElement(e,t):null},render:function(){var e=this,t=this.state,n=t.branch,r=t.params,o=t.components,s=null;return o&&(s=o.reduceRight(function(t,o,s){if(null==o)return t;var u=n[s],l=h.getRouteParams(u,r),c=i({},e.state,{route:u,routeParams:l});if(a.isValidElement(t)?c.children=t:t&&i(c,t),"object"==typeof o){var p={};for(var f in o)o.hasOwnProperty(f)&&(p[f]=e._createElement(o[f],c));return p}return e._createElement(o,c)},s)),p["default"](null===s||s===!1||a.isValidElement(s),"The root route must render a single element"),s}});t["default"]=x,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return 0===c.stripLeadingSlashes(t).indexOf(c.stripLeadingSlashes(e))?!0:!1}function i(e,t){if(null==t)return null==e;if(null==e)return!0;for(var n in e)if(e.hasOwnProperty(n)&&String(e[n])!==String(t[n]))return!1;return!0}t.__esModule=!0;var a=n(1),s=r(a),u=n(49),l=r(u),c=n(102),p=s["default"].PropTypes,f=p.func,d=p.object,h={propTypes:{stringifyQuery:f.isRequired},getDefaultProps:function(){return{stringifyQuery:c.stringifyQuery}},childContextTypes:{router:d.isRequired},getChildContext:function(){return{router:this}},makePath:function(e,t){return t&&("string"!=typeof t&&(t=this.props.stringifyQuery(t)),""!==t)?e+"?"+t:e},makeHref:function(e,t){var n=this.makePath(e,t),r=this.props.history;return r&&r.makeHref?r.makeHref(n):n},transitionTo:function(e,t){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;l["default"](r,"Router#transitionTo is client-side only (needs history)"),r.pushState(n,this.makePath(e,t))},replaceWith:function(e,t){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;l["default"](r,"Router#replaceWith is client-side only (needs history)"),r.replaceState(n,this.makePath(e,t))},go:function(e){var t=this.props.history;l["default"](t,"Router#go is client-side only (needs history)"),t.go(e)},goBack:function(){this.go(-1)},goForward:function(){this.go(1)},isActive:function(e,t){var n=this.state.location;return null==n?!1:o(e,n.pathname)&&i(t,n.query)}};t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){e.childRoutes?n(null,e.childRoutes):e.getChildRoutes?e.getChildRoutes(t,n):n()}function i(e,t,n){e.indexRoute?n(null,e.indexRoute):e.getIndexRoute?e.getIndexRoute(n,t):n()}function a(e,t,n){return t.reduceRight(function(e,t,r){var o=n[r];return Array.isArray(e[t])?e[t].unshift(o):t in e?e[t]=[o,e[t]]:e[t]=o,e},e)}function s(e,t){return a({},e,t)}function u(e,t,n,r){var u=E.matchPattern(e.path,t),c=u.remainingPathname,p=u.paramNames,f=u.paramValues,d=""===c;if(d&&e.path){var h=s(p,f),m=[e];i(e,n,function(e,t){e?r(e):(t&&m.push(t),r(null,{params:h,branch:m}))})}else null!=c?o(e,n,function(t,o){t?r(t):o?l(o,c,n,function(t,n){t?r(t):n?(a(n.params,p,f),n.branch.unshift(e),r(null,n)):r()}):r()}):r()}function l(e,t,n,r){e=_.createRoutes(e),C.loopAsync(e.length,function(r,o,i){u(e[r],t,n,function(e,t){e||t?i(e,t):o()})},r)}function c(e,t,n){l(e,E.stripLeadingSlashes(t.pathname),t.state,n)}function p(e,t,n){if(!e.path)return!1;var r=E.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function f(e,t){var n,r,o=e&&e.branch,i=t.branch;return o?(n=o.filter(function(n){return-1===i.indexOf(n)||p(n,e,t)}),n.reverse(),r=i.filter(function(e){return-1===o.indexOf(e)||-1!==n.indexOf(e)})):(n=[],r=i),[n,r]}function d(e,t){return function(n,r,o){e.length>2?e.call(t,n,r,o):(e.call(t,n,r),o())}}function h(e,t){return e.reduce(function(e,n){return n[t]&&e.push(d(n[t],n)),e},[])}function m(e,t){var n=f(e,t),r=n[0],o=n[1],i=h(r,"onLeave");return i.push.apply(i,h(o,"onEnter")),i}function v(e,t){e.component||e.components?t(null,e.component||e.components):e.getComponents?e.getComponents(t):t()}function g(e,t){C.mapAsync(e,function(e,t,n){v(e,n)},t)}function y(e,t){var n={};if(!e.path)return n;var r=E.getParamNames(e.path);for(var o in t)t.hasOwnProperty(o)&&-1!==r.indexOf(o)&&(n[o]=t[o]);return n}t.__esModule=!0,t.getState=c,t.createTransitionHook=d,t.getTransitionHooks=m,t.getComponents=g,t.getRouteParams=y;var b=n(49),_=(r(b),n(75)),E=n(102),C=n(232)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return e.filter(function(e){return-1!==t.indexOf(e)})}function i(e,t){var n=e.location,r=e.branch,i=t.location,a=t.branch;if(null===i)return!1;if(n.pathname===i.pathname)return!1;var s=o(r,a);return s.some(function(e){return e.ignoreScrollBehavior})?!1:!0}function a(e,t,n){l.canUseDOM&&(e===p["default"].POP?l.setWindowScrollPosition(t,n):l.setWindowScrollPosition(0,0))}t.__esModule=!0;var s=n(1),u=r(s),l=n(143),c=n(145),p=r(c),f=u["default"].PropTypes.func,d={propTypes:{shouldUpdateScrollPosition:f.isRequired,updateScrollPosition:f.isRequired},getDefaultProps:function(){return{shouldUpdateScrollPosition:i,updateScrollPosition:a}},componentDidUpdate:function(e,t){var n=this.state.location,r=n&&n.state;if(r&&this.props.shouldUpdateScrollPosition(this.state,t)){var o=r.scrollX,i=r.scrollY;this.props.updateScrollPosition(n.navigationType,o||0,i||0)}}};t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=i["default"].PropTypes.object,s={contextTypes:{router:a.isRequired}},u=["isActive"];u.forEach(function(e){s[e]=function(){var t=this.context.router;return t[e].apply(t,arguments)}}),t["default"]=s,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e),this.isCancelled=!1,this.redirectInfo=null,this.abortReason=null}return e.prototype.to=function(e,t,n){this.redirectInfo={pathname:e,query:t,state:n},this.isCancelled=!0},e.prototype.abort=function(e){this.abortReason=e,this.isCancelled=!0},e}();t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(103),s=r(a),u=i["default"].PropTypes.object,l={contextTypes:{router:u.isRequired},componentDidMount:function(){s["default"]("function"==typeof this.routerWillLeave,"Components that mixin TransitionHook should have a routerWillLeave method, check %s",this.constructor.displayName||this.constructor.name),this.routerWillLeave&&this.context.router.addTransitionHook(this.routerWillLeave)},componentWillUnmount:function(){this.routerWillLeave&&this.context.router.removeTransitionHook(this.routerWillLeave)}};t["default"]=l,e.exports=t["default"]},function(e,t,n){e.exports=n(501)},function(e,t,n){var r=n(503),o=n(502);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(234),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),i=0,a=o.length;a>i;++i){var s=o[i],u=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===u)n[r.decode(s)]="";else{var l=r.decode(s.slice(0,u)),c=r.decode(s.slice(u+1));if(Object.prototype.hasOwnProperty(l))continue;n.hasOwnProperty(l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r=e.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(e,t,n));else{var a="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,s=parseInt(a,10),u=""+s;!isNaN(s)&&r!==a&&u===a&&s>=0&&s<=n.arrayLimit?(i=[],i[s]=o.parseObject(e,t,n)):i[a]=o.parseObject(e,t,n)}return i},o.parseKeys=function(e,t,n){if(e){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(e);if(!Object.prototype.hasOwnProperty(a[1])){var s=[];a[1]&&s.push(a[1]);for(var u=0;null!==(a=i.exec(e))&&u<n.depth;)++u,Object.prototype.hasOwnProperty(a[1].replace(/\[|\]/g,""))||s.push(a[1]);return a&&s.push("["+e.slice(a.index)+"]"),o.parseObject(s,t,n)}}},e.exports=function(e,t){if(""===e||null===e||"undefined"==typeof e)return{};t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit;for(var n="string"==typeof e?o.parseValues(e,t):e,i={},a=Object.keys(n),s=0,u=a.length;u>s;++s){var l=a[s],c=o.parseKeys(l,n[l],t);i=r.merge(i,c)}return r.compact(i)}},function(e,t,n){var r=n(234),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}}};o.stringify=function(e,t,n){if(r.isBuffer(e)?e=e.toString():e instanceof Date?e=e.toISOString():null===e&&(e=""),"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[encodeURIComponent(t)+"="+encodeURIComponent(e)];var i=[];if("undefined"==typeof e)return i;for(var a=Object.keys(e),s=0,u=a.length;u>s;++s){var l=a[s];i=Array.isArray(e)?i.concat(o.stringify(e[l],n(t,l),n)):i.concat(o.stringify(e[l],t+"["+l+"]",n))}return i},e.exports=function(e,t){t=t||{};var n="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,r=[];if("object"!=typeof e||null===e)return"";var i;i=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";for(var a=o.arrayPrefixGenerators[i],s=Object.keys(e),u=0,l=s.length;l>u;++u){var c=s[u];r=r.concat(o.stringify(e[c],c,a))}return r.join(n)}},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(1),i=n(507),a=n(506),s=n(505),u=0,l=o.createClass({displayName:"Select",propTypes:{value:o.PropTypes.any,multi:o.PropTypes.bool,disabled:o.PropTypes.bool,options:o.PropTypes.array,delimiter:o.PropTypes.string,asyncOptions:o.PropTypes.func,autoload:o.PropTypes.bool,placeholder:o.PropTypes.string,noResultsText:o.PropTypes.string,clearable:o.PropTypes.bool,clearValueText:o.PropTypes.string,clearAllText:o.PropTypes.string,searchable:o.PropTypes.bool,searchPromptText:o.PropTypes.string,name:o.PropTypes.string,onChange:o.PropTypes.func,onFocus:o.PropTypes.func,onBlur:o.PropTypes.func,className:o.PropTypes.string,filterOption:o.PropTypes.func,filterOptions:o.PropTypes.func,matchPos:o.PropTypes.string,matchProp:o.PropTypes.string,inputProps:o.PropTypes.object,onOptionLabelClick:o.PropTypes.func},getDefaultProps:function(){return{value:void 0,options:void 0,disabled:!1,delimiter:",",asyncOptions:void 0,autoload:!0,placeholder:"Select...",noResultsText:"No results found",clearable:!0,clearValueText:"Clear value",clearAllText:"Clear all",searchable:!0,searchPromptText:"Type to search",name:void 0,onChange:void 0,className:void 0,matchPos:"any",matchProp:"any",inputProps:{},onOptionLabelClick:void 0}},getInitialState:function(){return{options:this.props.options,isFocused:!1,isOpen:!1,isLoading:!1}},componentWillMount:function(){this._optionsCache={},this._optionsFilterString="",this.setState(this.getStateFromValue(this.props.value)),this.props.asyncOptions&&this.props.autoload&&this.autoloadAsyncOptions();var e=this;this._closeMenuIfClickedOutside=function(t){if(e.state.isOpen){var n=e.refs.selectMenuContainer.getDOMNode(),r=e.refs.control.getDOMNode(),o=e.clickedOutsideElement(n,t),i=e.clickedOutsideElement(r,t);o&&i&&e.setState({isOpen:!1},e._unbindCloseMenuIfClickedOutside)}},this._bindCloseMenuIfClickedOutside=function(){document.addEventListener("click",e._closeMenuIfClickedOutside)},this._unbindCloseMenuIfClickedOutside=function(){document.removeEventListener("click",e._closeMenuIfClickedOutside)}},componentWillUnmount:function(){clearTimeout(this._blurTimeout),clearTimeout(this._focusTimeout),this.state.isOpen&&this._unbindCloseMenuIfClickedOutside()},componentWillReceiveProps:function(e){JSON.stringify(e.options)!==JSON.stringify(this.props.options)&&this.setState({options:e.options,filteredOptions:this.filterOptions(e.options)}),e.value!==this.state.value&&this.setState(this.getStateFromValue(e.value,e.options))},componentDidUpdate:function(){var e=this;if(!this.props.disabled&&this._focusAfterUpdate&&(clearTimeout(this._blurTimeout),this._focusTimeout=setTimeout(function(){e.getInputNode().focus(),e._focusAfterUpdate=!1},50)),this._focusedOptionReveal){if(this.refs.focused&&this.refs.menu){var t=this.refs.focused.getDOMNode(),n=this.refs.menu.getDOMNode(),r=t.getBoundingClientRect(),o=n.getBoundingClientRect();(r.bottom>o.bottom||r.top<o.top)&&(n.scrollTop=t.offsetTop+t.clientHeight-n.offsetHeight)}this._focusedOptionReveal=!1}},focus:function(){this.getInputNode().focus()},clickedOutsideElement:function(e,t){for(var n=t.target?t.target:t.srcElement;null!=n;){if(n===e)return!1;n=n.offsetParent}return!0},getStateFromValue:function(e,t){t||(t=this.state.options),this._optionsFilterString="";var n=this.initValuesArray(e,t),r=this.filterOptions(t,n);return{value:n.map(function(e){return e.value}).join(this.props.delimiter),values:n,inputValue:"",filteredOptions:r,placeholder:!this.props.multi&&n.length?n[0].label:this.props.placeholder,focusedOption:!this.props.multi&&n.length?n[0]:r[0]}},initValuesArray:function(e,t){return Array.isArray(e)||(e="string"==typeof e?e.split(this.props.delimiter):e?[e]:[]),e.map(function(e){if("string"==typeof e){for(var n in t)if(t.hasOwnProperty(n)&&t[n]&&t[n].value===e)return t[n];return{value:e,label:e}}return e})},setValue:function(e,t){(t||void 0===t)&&(this._focusAfterUpdate=!0);var n=this.getStateFromValue(e);n.isOpen=!1,this.fireChangeEvent(n),this.setState(n)},selectValue:function(e){this.props.multi?e&&this.addValue(e):this.setValue(e),this._unbindCloseMenuIfClickedOutside()},addValue:function(e){this.setValue(this.state.values.concat(e))},popValue:function(){this.setValue(this.state.values.slice(0,this.state.values.length-1))},removeValue:function(e){this.setValue(this.state.values.filter(function(t){return t!==e}))},clearValue:function(e){e&&"mousedown"===e.type&&0!==e.button||this.setValue(null)},resetValue:function(){this.setValue(this.state.value)},getInputNode:function(){var e=this.refs.input;return this.props.searchable?e:e.getDOMNode()},fireChangeEvent:function(e){e.value!==this.state.value&&this.props.onChange&&this.props.onChange(e.value,e.values)},handleMouseDown:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),this.state.isFocused?this.setState({isOpen:!0},this._bindCloseMenuIfClickedOutside):(this._openAfterFocus=!0,this.getInputNode().focus()))},handleInputFocus:function(e){var t=this.state.isOpen||this._openAfterFocus;this.setState({isFocused:!0,isOpen:t},function(){t?this._bindCloseMenuIfClickedOutside():this._unbindCloseMenuIfClickedOutside()}),this._openAfterFocus=!1,this.props.onFocus&&this.props.onFocus(e)},handleInputBlur:function(e){var t=this;this._blurTimeout=setTimeout(function(){t._focusAfterUpdate||t.setState({isFocused:!1})},50),this.props.onBlur&&this.props.onBlur(e)},handleKeyDown:function(e){if(!this.state.disabled){switch(e.keyCode){case 8:return void(this.state.inputValue||this.popValue());case 9:if(e.shiftKey||!this.state.isOpen||!this.state.focusedOption)return;this.selectFocusedOption();break;case 13:this.selectFocusedOption();break;case 27:this.state.isOpen?this.resetValue():this.clearValue();break;case 38:this.focusPreviousOption();break;case 40:this.focusNextOption();break;default:return}e.preventDefault()}},_getNewFocusedOption:function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t]===this.state.focusedOption)return e[t];return e[0]},handleInputChange:function(e){if(this._optionsFilterString=e.target.value,this.props.asyncOptions)this.setState({isLoading:!0,inputValue:e.target.value}),this.loadAsyncOptions(e.target.value,{isLoading:!1,isOpen:!0},this._bindCloseMenuIfClickedOutside);else{var t=this.filterOptions(this.state.options);this.setState({isOpen:!0,inputValue:e.target.value,filteredOptions:t,focusedOption:this._getNewFocusedOption(t)},this._bindCloseMenuIfClickedOutside)}},autoloadAsyncOptions:function(){var e=this;this.loadAsyncOptions("",{},function(){e.setValue(e.props.value,!1)})},loadAsyncOptions:function(e,t,n){for(var r=this._currentRequestId=u++,o=0;o<=e.length;o++){var i=e.slice(0,o);if(this._optionsCache[i]&&(e===i||this._optionsCache[i].complete)){var a=this._optionsCache[i].options,s=this.filterOptions(a),l={options:a,filteredOptions:s,focusedOption:this._getNewFocusedOption(s)};for(var c in t)t.hasOwnProperty(c)&&(l[c]=t[c]);return this.setState(l),void(n&&n({}))}}var p=this;this.props.asyncOptions(e,function(o,i){if(o)throw o;if(p._optionsCache[e]=i,r===p._currentRequestId){var a=p.filterOptions(i.options),s={options:i.options,filteredOptions:a,focusedOption:p._getNewFocusedOption(a)};for(var u in t)t.hasOwnProperty(u)&&(s[u]=t[u]);p.setState(s),n&&n({})}})},filterOptions:function(e,t){if(!this.props.searchable)return e;var n=this._optionsFilterString,r=(t||this.state.values).map(function(e){return e.value});if(this.props.filterOptions)return this.props.filterOptions.call(this,e,n,r);var o=function(e){if(this.props.multi&&r.indexOf(e.value)>-1)return!1;if(this.props.filterOption)return this.props.filterOption.call(this,e,n);var t=String(e.value),o=String(e.label);return n&&"start"!==this.props.matchPos?"label"!==this.props.matchProp&&t.toLowerCase().indexOf(n.toLowerCase())>=0||"value"!==this.props.matchProp&&o.toLowerCase().indexOf(n.toLowerCase())>=0:"label"!==this.props.matchProp&&t.toLowerCase().substr(0,n.length)===n||"value"!==this.props.matchProp&&o.toLowerCase().substr(0,n.length)===n};return(e||[]).filter(o,this)},selectFocusedOption:function(){return this.selectValue(this.state.focusedOption)},focusOption:function(e){this.setState({focusedOption:e})},focusNextOption:function(){this.focusAdjacentOption("next")},focusPreviousOption:function(){this.focusAdjacentOption("previous")},focusAdjacentOption:function(e){this._focusedOptionReveal=!0;var t=this.state.filteredOptions;if(!this.state.isOpen)return void this.setState({isOpen:!0,inputValue:"",focusedOption:this.state.focusedOption||t["next"===e?0:t.length-1]},this._bindCloseMenuIfClickedOutside);if(t.length){for(var n=-1,r=0;r<t.length;r++)if(this.state.focusedOption===t[r]){n=r;break}var o=t[0];"next"===e&&n>-1&&n<t.length-1?o=t[n+1]:"previous"===e&&(o=n>0?t[n-1]:t[t.length-1]),this.setState({focusedOption:o})}},unfocusOption:function(e){this.state.focusedOption===e&&this.setState({focusedOption:null})},buildMenu:function(){var e=this.state.focusedOption?this.state.focusedOption.value:null;this.state.filteredOptions.length>0&&(e=null==e?this.state.filteredOptions[0]:e);var t=Object.keys(this.state.filteredOptions).map(function(t){var n=this.state.filteredOptions[t],r=e===n.value,i=a({"Select-option":!0,"is-focused":r,"is-disabled":n.disabled}),s=r?"focused":null,u=this.focusOption.bind(this,n),l=this.unfocusOption.bind(this,n),c=this.selectValue.bind(this,n);return n.disabled?o.createElement("div",{ref:s,key:"option-"+n.value,className:i},n.label):o.createElement("div",{ref:s,key:"option-"+n.value,className:i,onMouseEnter:u,onMouseLeave:l,onMouseDown:c,onClick:c},n.label)},this);return t.length?t:o.createElement("div",{className:"Select-noresults"},this.props.asyncOptions&&!this.state.inputValue?this.props.searchPromptText:this.props.noResultsText)},handleOptionLabelClick:function(e,t){var n=this.props.onOptionLabelClick;n&&n(e,t)},render:function(){var e=a("Select",this.props.className,{"is-multi":this.props.multi,"is-searchable":this.props.searchable,"is-open":this.state.isOpen,"is-focused":this.state.isFocused,"is-loading":this.state.isLoading,"is-disabled":this.props.disabled,"has-value":this.state.value}),t=[];this.props.multi&&this.state.values.forEach(function(e){var n={key:e.value,optionLabelClick:!!this.props.onOptionLabelClick,onOptionLabelClick:this.handleOptionLabelClick.bind(this,e),onRemove:this.removeValue.bind(this,e)};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);t.push(o.createElement(s,n))},this),!this.props.disabled&&(this.state.inputValue||this.props.multi&&t.length)||t.push(o.createElement("div",{className:"Select-placeholder",key:"placeholder"},this.state.placeholder));var n,u,l=this.state.isLoading?o.createElement("span",{className:"Select-loading","aria-hidden":"true"}):null,c=this.props.clearable&&this.state.value&&!this.props.disabled?o.createElement("span",{className:"Select-clear",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onClick:this.clearValue,dangerouslySetInnerHTML:{__html:"×"}}):null;this.state.isOpen&&(u={ref:"menu",className:"Select-menu"},this.props.multi&&(u.onMouseDown=this.handleMouseDown),n=o.createElement("div",{ref:"selectMenuContainer",className:"Select-menu-outer"},o.createElement("div",u,this.buildMenu())));var p,f={ref:"input",className:"Select-input",tabIndex:this.props.tabIndex||0,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};for(var d in this.props.inputProps)this.props.inputProps.hasOwnProperty(d)&&(f[d]=this.props.inputProps[d]);return p=this.props.searchable&&!this.props.disabled?o.createElement(i,r({value:this.state.inputValue,onChange:this.handleInputChange,minWidth:"5"},f)):o.createElement("div",f," "),o.createElement("div",{ref:"wrapper",className:e},o.createElement("input",{type:"hidden",ref:"value",name:this.props.name,value:this.state.value,disabled:this.props.disabled}),o.createElement("div",{className:"Select-control",ref:"control",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},t,p,o.createElement("span",{className:"Select-arrow"}),l,c),n)}});e.exports=l},function(e,t,n){"use strict";var r=n(1),o=r.createClass({displayName:"Value",propTypes:{label:r.PropTypes.string.isRequired},blockEvent:function(e){e.stopPropagation()},render:function(){var e=this.props.label;return this.props.optionLabelClick&&(e=r.createElement("a",{className:"Select-item-label__a",onMouseDown:this.blockEvent,onTouchEnd:this.props.onOptionLabelClick,onClick:this.props.onOptionLabelClick},e)),r.createElement("div",{className:"Select-item"},r.createElement("span",{className:"Select-item-icon",onMouseDown:this.blockEvent,onClick:this.props.onRemove,onTouchEnd:this.props.onRemove},"×"),r.createElement("span",{className:"Select-item-label"},e))}});e.exports=o},function(e,t,n){/*!
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
function r(){"use strict";for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e+=" "+n;else if(Array.isArray(n))e+=" "+r.apply(null,n);else if("object"===o)for(var i in n)n.hasOwnProperty(i)&&n[i]&&(e+=" "+i)}}return e.substr(1)}var o,i;"undefined"!=typeof e&&e.exports&&(e.exports=r),o=[],i=function(){return r}.apply(t,o),!(void 0!==i&&(e.exports=i))},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(1),i={position:"absolute",visibility:"hidden",height:0,width:0,overflow:"scroll",whiteSpace:"nowrap"},a=o.createClass({displayName:"AutosizeInput",propTypes:{value:o.PropTypes.any,defaultValue:o.PropTypes.any,onChange:o.PropTypes.func,style:o.PropTypes.object,className:o.PropTypes.string,minWidth:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.string]),inputStyle:o.PropTypes.object,inputClassName:o.PropTypes.string},getDefaultProps:function(){return{minWidth:1}},getInitialState:function(){return{inputWidth:this.props.minWidth}},componentDidMount:function(){this.copyInputStyles(),this.updateInputWidth()},componentDidUpdate:function(){this.updateInputWidth()},copyInputStyles:function(){if(this.isMounted()&&window.getComputedStyle){var e=window.getComputedStyle(this.refs.input.getDOMNode()),t=this.refs.sizer.getDOMNode();if(t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,this.props.placeholder){var n=this.refs.placeholderSizer.getDOMNode();n.style.fontSize=e.fontSize,n.style.fontFamily=e.fontFamily}}},updateInputWidth:function(){if(this.isMounted()&&"undefined"!=typeof this.refs.sizer.getDOMNode().scrollWidth){var e;e=this.props.placeholder?Math.max(this.refs.sizer.getDOMNode().scrollWidth,this.refs.placeholderSizer.getDOMNode().scrollWidth)+2:this.refs.sizer.getDOMNode().scrollWidth+2,e<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}},getInput:function(){return this.refs.input},focus:function(){this.refs.input.getDOMNode().focus()},select:function(){this.refs.input.getDOMNode().select()},render:function(){var e=(this.props.value||"").replace(/ /g," "),t=this.props.style||{};t.display="inline-block";var n=this.props.inputStyle||{};n.width=this.state.inputWidth;var a=this.props.placeholder?o.createElement("div",{ref:"placeholderSizer",style:i},this.props.placeholder):null;return o.createElement("div",{className:this.props.className,style:t},o.createElement("input",r({},this.props,{ref:"input",className:this.props.inputClassName,style:n})),o.createElement("div",{ref:"sizer",style:i,dangerouslySetInnerHTML:{__html:e}}),a)}});e.exports=a},function(e,t,n){"use strict";function r(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function o(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function i(e){switch(e){case P.topCompositionStart:return D.compositionStart;case P.topCompositionEnd:return D.compositionEnd;case P.topCompositionUpdate:return D.compositionUpdate}}function a(e,t){return e===P.topKeyDown&&t.keyCode===E}function s(e,t){switch(e){case P.topKeyUp:return-1!==_.indexOf(t.keyCode);case P.topKeyDown:return t.keyCode!==E;case P.topKeyPress:case P.topMouseDown:case P.topBlur:return!0;default:return!1}}function u(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function l(e,t,n,r){var o,l;if(C?o=i(e):M?s(e,r)&&(o=D.compositionEnd):a(e,r)&&(o=D.compositionStart),!o)return null;S&&(M||o!==D.compositionStart?o===D.compositionEnd&&M&&(l=M.getData()):M=v.getPooled(t));var c=g.getPooled(o,n,r);if(l)c.data=l;else{var p=u(r);null!==p&&(c.data=p)}return h.accumulateTwoPhaseDispatches(c),c}function c(e,t){switch(e){case P.topCompositionEnd:return u(t);case P.topKeyPress:var n=t.which;return n!==O?null:(N=!0,x);case P.topTextInput:var r=t.data;return r===x&&N?null:r;default:return null}}function p(e,t){if(M){if(e===P.topCompositionEnd||s(e,t)){var n=M.getData();return v.release(M),M=null,n}return null}switch(e){case P.topPaste:return null;case P.topKeyPress:return t.which&&!o(t)?String.fromCharCode(t.which):null;case P.topCompositionEnd:return S?null:t.data;default:return null}}function f(e,t,n,r){var o;if(o=w?c(e,r):p(e,r),!o)return null;var i=y.getPooled(D.beforeInput,n,r);return i.data=o,h.accumulateTwoPhaseDispatches(i),i}var d=n(23),h=n(78),m=n(16),v=n(517),g=n(558),y=n(561),b=n(34),_=[9,13,27,32],E=229,C=m.canUseDOM&&"CompositionEvent"in window,T=null;m.canUseDOM&&"documentMode"in document&&(T=document.documentMode);var w=m.canUseDOM&&"TextEvent"in window&&!T&&!r(),S=m.canUseDOM&&(!C||T&&T>8&&11>=T),O=32,x=String.fromCharCode(O),P=d.topLevelTypes,D={beforeInput:{phasedRegistrationNames:{bubbled:b({onBeforeInput:null}),captured:b({onBeforeInputCapture:null})},dependencies:[P.topCompositionEnd,P.topKeyPress,P.topTextInput,P.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:b({onCompositionEnd:null}),captured:b({onCompositionEndCapture:null})},dependencies:[P.topBlur,P.topCompositionEnd,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:b({onCompositionStart:null}),captured:b({onCompositionStartCapture:null})},dependencies:[P.topBlur,P.topCompositionStart,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:b({onCompositionUpdate:null}),captured:b({onCompositionUpdateCapture:null})},dependencies:[P.topBlur,P.topCompositionUpdate,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]}},N=!1,M=null,k={eventTypes:D,extractEvents:function(e,t,n,r){return[l(e,t,n,r),f(e,t,n,r)]}};e.exports=k},function(e,t,n){var r=n(4),o={addClass:function(e,t){return r(!/\s/.test(t)),t&&(e.classList?e.classList.add(t):o.hasClass(e,t)||(e.className=e.className+" "+t)),e},removeClass:function(e,t){return r(!/\s/.test(t)),t&&(e.classList?e.classList.remove(t):o.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),e},conditionClass:function(e,t,n){return(n?o.addClass:o.removeClass)(e,t)},hasClass:function(e,t){return r(!/\s/.test(t)),e.classList?!!t&&e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}};e.exports=o},function(e,t,n){"use strict";function r(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function o(e){var t=T.getPooled(P.change,N,e);_.accumulateTwoPhaseDispatches(t),C.batchedUpdates(i,t)}function i(e){b.enqueueEvents(e),b.processEventQueue()}function a(e,t){D=e,N=t,D.attachEvent("onchange",o)}function s(){D&&(D.detachEvent("onchange",o),D=null,N=null)}function u(e,t,n){return e===x.topChange?n:void 0}function l(e,t,n){e===x.topFocus?(s(),a(t,n)):e===x.topBlur&&s()}function c(e,t){D=e,N=t,M=e.value,k=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(D,"value",A),D.attachEvent("onpropertychange",f)}function p(){D&&(delete D.value,D.detachEvent("onpropertychange",f),D=null,N=null,M=null,k=null)}function f(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==M&&(M=t,o(e))}}function d(e,t,n){return e===x.topInput?n:void 0}function h(e,t,n){e===x.topFocus?(p(),c(t,n)):e===x.topBlur&&p()}function m(e,t,n){return e!==x.topSelectionChange&&e!==x.topKeyUp&&e!==x.topKeyDown||!D||D.value===M?void 0:(M=D.value,N)}function v(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function g(e,t,n){return e===x.topClick?n:void 0}var y=n(23),b=n(77),_=n(78),E=n(16),C=n(29),T=n(51),w=n(166),S=n(259),O=n(34),x=y.topLevelTypes,P={change:{phasedRegistrationNames:{bubbled:O({onChange:null}),captured:O({onChangeCapture:null})},dependencies:[x.topBlur,x.topChange,x.topClick,x.topFocus,x.topInput,x.topKeyDown,x.topKeyUp,x.topSelectionChange]}},D=null,N=null,M=null,k=null,R=!1;E.canUseDOM&&(R=w("change")&&(!("documentMode"in document)||document.documentMode>8));var I=!1;E.canUseDOM&&(I=w("input")&&(!("documentMode"in document)||document.documentMode>9));var A={get:function(){return k.get.call(this)},set:function(e){M=""+e,k.set.call(this,e)}},j={eventTypes:P,extractEvents:function(e,t,n,o){var i,a;if(r(t)?R?i=u:a=l:S(t)?I?i=d:(i=m,a=h):v(t)&&(i=g),i){var s=i(e,t,n);if(s){var c=T.getPooled(P.change,s,o);return _.accumulateTwoPhaseDispatches(c),c}}a&&a(e,t,n)}};e.exports=j},function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};e.exports=r},function(e,t,n){"use strict";function r(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var o=n(513),i=n(245),a=n(584),s=n(4),u={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:a,processUpdates:function(e,t){for(var n,u=null,l=null,c=0;c<e.length;c++)if(n=e[c],n.type===i.MOVE_EXISTING||n.type===i.REMOVE_NODE){var p=n.fromIndex,f=n.parentNode.childNodes[p],d=n.parentID;s(f),u=u||{},u[d]=u[d]||[],u[d][p]=f,l=l||[],l.push(f)}var h=o.dangerouslyRenderMarkup(t);if(l)for(var m=0;m<l.length;m++)l[m].parentNode.removeChild(l[m]);for(var v=0;v<e.length;v++)switch(n=e[v],n.type){case i.INSERT_MARKUP:r(n.parentNode,h[n.markupIndex],n.toIndex);break;case i.MOVE_EXISTING:r(n.parentNode,u[n.parentID][n.fromIndex],n.toIndex);break;case i.TEXT_CONTENT:a(n.parentNode,n.textContent);break;case i.REMOVE_NODE:}}};e.exports=u},function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var o=n(16),i=n(570),a=n(33),s=n(256),u=n(4),l=/^(<[^ \/>]+)/,c="data-danger-index",p={dangerouslyRenderMarkup:function(e){u(o.canUseDOM);for(var t,n={},p=0;p<e.length;p++)u(e[p]),t=r(e[p]),t=s(t)?t:"*",n[t]=n[t]||[],n[t][p]=e[p];var f=[],d=0;for(t in n)if(n.hasOwnProperty(t)){var h,m=n[t];for(h in m)if(m.hasOwnProperty(h)){var v=m[h];m[h]=v.replace(l,"$1 "+c+'="'+h+'" ')}for(var g=i(m.join(""),a),y=0;y<g.length;++y){var b=g[y];b.hasAttribute&&b.hasAttribute(c)&&(h=+b.getAttribute(c),b.removeAttribute(c),u(!f.hasOwnProperty(h)),f[h]=b,d+=1)}}return u(d===f.length),u(f.length===e.length),f},dangerouslyReplaceNodeWithMarkup:function(e,t){u(o.canUseDOM),u(t),u("html"!==e.tagName.toLowerCase());var n=i(t,a)[0];e.parentNode.replaceChild(n,e)}};e.exports=p},function(e,t,n){"use strict";var r=n(34),o=[r({ResponderEventPlugin:null}),r({SimpleEventPlugin:null}),r({TapEventPlugin:null}),r({EnterLeaveEventPlugin:null}),r({ChangeEventPlugin:null}),r({SelectEventPlugin:null}),r({BeforeInputEventPlugin:null}),r({AnalyticsEventPlugin:null}),r({MobileSafariClickEventPlugin:null})];e.exports=o},function(e,t,n){"use strict";var r=n(23),o=n(78),i=n(107),a=n(41),s=n(34),u=r.topLevelTypes,l=a.getFirstReactDOM,c={mouseEnter:{registrationName:s({onMouseEnter:null}),dependencies:[u.topMouseOut,u.topMouseOver]},mouseLeave:{registrationName:s({onMouseLeave:null}),dependencies:[u.topMouseOut,u.topMouseOver]}},p=[null,null],f={eventTypes:c,extractEvents:function(e,t,n,r){if(e===u.topMouseOver&&(r.relatedTarget||r.fromElement))return null;if(e!==u.topMouseOut&&e!==u.topMouseOver)return null;var s;if(t.window===t)s=t;else{var f=t.ownerDocument;s=f?f.defaultView||f.parentWindow:window}var d,h;if(e===u.topMouseOut?(d=t,h=l(r.relatedTarget||r.toElement)||s):(d=s,h=t),d===h)return null;var m=d?a.getID(d):"",v=h?a.getID(h):"",g=i.getPooled(c.mouseLeave,m,r);g.type="mouseleave",g.target=d,g.relatedTarget=h;var y=i.getPooled(c.mouseEnter,v,r);return y.type="mouseenter",y.target=h,y.relatedTarget=d,o.accumulateEnterLeaveDispatches(g,y,m,v),p[0]=g,p[1]=y,p}};e.exports=f},function(e,t,n){var r=n(33),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=n(38),i=n(7),a=n(257);i(r.prototype,{getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;r>e&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r,o=n(60),i=n(16),a=o.injection.MUST_USE_ATTRIBUTE,s=o.injection.MUST_USE_PROPERTY,u=o.injection.HAS_BOOLEAN_VALUE,l=o.injection.HAS_SIDE_EFFECTS,c=o.injection.HAS_NUMERIC_VALUE,p=o.injection.HAS_POSITIVE_NUMERIC_VALUE,f=o.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(i.canUseDOM){var d=document.implementation;r=d&&d.hasFeature&&d.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:a|u,allowTransparency:a,alt:null,async:u,autoComplete:null,autoPlay:u,cellPadding:null,cellSpacing:null,charSet:a,checked:s|u,classID:a,className:r?a:s,cols:a|p,colSpan:null,content:null,contentEditable:null,contextMenu:a,controls:s|u,coords:null,crossOrigin:null,data:null,dateTime:a,defer:u,dir:null,disabled:a|u,download:f,draggable:null,encType:null,form:a,formAction:a,formEncType:a,formMethod:a,formNoValidate:u,formTarget:a,frameBorder:a,headers:null,height:a,hidden:a|u,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,label:null,lang:null,list:a,loop:s|u,manifest:a,marginHeight:null,marginWidth:null,max:null,maxLength:a,media:a,mediaGroup:null,method:null,min:null,multiple:s|u,muted:s|u,name:null,noValidate:u,open:u,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|u,rel:null,required:u,role:a,rows:a|p,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:a|u,selected:s|u,shape:null,size:a|p,sizes:a,span:p,spellCheck:null,src:null,srcDoc:s,srcSet:a,start:c,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|l,width:a,wmode:a,autoCapitalize:null,autoCorrect:null,itemProp:a,itemScope:a|u,itemType:a,itemID:a,itemRef:a,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=n(541),o=n(549),i={linkState:function(e){return new r(this.state[e],o.createStateKeySetter(this,e))}};e.exports=i},function(e,t,n){"use strict";var r=n(23),o=n(33),i=r.topLevelTypes,a={eventTypes:null,extractEvents:function(e,t,n,r){if(e===i.topTouchStart){var a=r.target;a&&!a.onclick&&(a.onclick=o)}}};e.exports=a},function(e,t,n){"use strict";var r=n(61),o=n(7),i=r.createFactory(n(249)),a=r.createFactory(n(522)),s=r.createClass({displayName:"ReactCSSTransitionGroup",propTypes:{transitionName:r.PropTypes.string.isRequired,transitionAppear:r.PropTypes.bool,transitionEnter:r.PropTypes.bool,transitionLeave:r.PropTypes.bool},getDefaultProps:function(){return{transitionAppear:!1,transitionEnter:!0,transitionLeave:!0}},_wrapChild:function(e){return a({name:this.props.transitionName,appear:this.props.transitionAppear,enter:this.props.transitionEnter,leave:this.props.transitionLeave},e)},render:function(){return i(o({},this.props,{childFactory:this._wrapChild}))}});e.exports=s},function(e,t,n){"use strict";var r=n(61),o=n(509),i=n(551),a=n(260),s=(n(8),17),u=r.createClass({displayName:"ReactCSSTransitionGroupChild",transition:function(e,t){var n=this.getDOMNode(),r=this.props.name+"-"+e,a=r+"-active",s=function(e){e&&e.target!==n||(o.removeClass(n,r),o.removeClass(n,a),i.removeEndEventListener(n,s),t&&t())};i.addEndEventListener(n,s),o.addClass(n,r),this.queueClass(a)},queueClass:function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,s))},flushClassNameQueue:function(){this.isMounted()&&this.classNameQueue.forEach(o.addClass.bind(o,this.getDOMNode())),this.classNameQueue.length=0,this.timeout=null},componentWillMount:function(){this.classNameQueue=[]},componentWillUnmount:function(){this.timeout&&clearTimeout(this.timeout)},componentWillAppear:function(e){this.props.appear?this.transition("appear",e):e()},componentWillEnter:function(e){this.props.enter?this.transition("enter",e):e()},componentWillLeave:function(e){this.props.leave?this.transition("leave",e):e()},render:function(){return a(this.props.children)}});e.exports=u},function(e,t,n){"use strict";var r=n(66),o=n(572),i=n(165),a=n(168),s={instantiateChildren:function(e,t,n){var r=o(e);for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=i(s,null);r[a]=u}return r},updateChildren:function(e,t,n,s){var u=o(t);if(!u&&!e)return null;var l;for(l in u)if(u.hasOwnProperty(l)){var c=e&&e[l],p=c&&c._currentElement,f=u[l];if(a(p,f))r.receiveComponent(c,f,n,s),u[l]=c;else{c&&r.unmountComponent(c,l);var d=i(f,null);u[l]=d}}for(l in e)!e.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||r.unmountComponent(e[l]);return u},unmountChildren:function(e){for(var t in e){var n=e[t];r.unmountComponent(n)}}};e.exports=s},function(e,t,n){"use strict";function r(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}var o=n(151),i=n(152),a=n(40),s=n(9),u=(n(79),n(65)),l=n(155),c=n(105),p=n(50),f=n(156),d=(n(106),n(66)),h=n(29),m=n(7),v=n(109),g=n(4),y=n(168),b=(n(8),1),_={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._isTopLevel=!1,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=b++,this._rootNodeID=e;var r=this._processProps(this._currentElement.props),o=this._processContext(this._currentElement._context),i=c.getComponentClassForElement(this._currentElement),a=new i(r,o);a.props=r,a.context=o,a.refs=v,this._instance=a,u.set(a,this);var s=a.state;void 0===s&&(a.state=s=null),g("object"==typeof s&&!Array.isArray(s)),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var p,f=l.currentlyMountingInstance;l.currentlyMountingInstance=this;try{a.componentWillMount&&(a.componentWillMount(),this._pendingStateQueue&&(a.state=this._processPendingState(a.props,a.context))),p=this._renderValidatedComponent()}finally{l.currentlyMountingInstance=f}this._renderedComponent=this._instantiateReactComponent(p,this._currentElement.type);var h=d.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return a.componentDidMount&&t.getReactMountReady().enqueue(a.componentDidMount,a),h},unmountComponent:function(){var e=this._instance;if(e.componentWillUnmount){var t=l.currentlyUnmountingInstance;l.currentlyUnmountingInstance=this;try{e.componentWillUnmount()}finally{l.currentlyUnmountingInstance=t}}d.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,u.remove(e)},_setPropsInternal:function(e,t){var n=this._pendingElement||this._currentElement;this._pendingElement=s.cloneAndReplaceProps(n,m({},n.props,e)),h.enqueueUpdate(this,t)},_maskContext:function(e){var t=null;if("string"==typeof this._currentElement.type)return v;var n=this._currentElement.type.contextTypes;if(!n)return v;t={};for(var r in n)t[r]=e[r];return t},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t=this._instance,n=t.getChildContext&&t.getChildContext();if(n){g("object"==typeof t.constructor.childContextTypes);for(var r in n)g(r in t.constructor.childContextTypes);return m({},e,n)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,n){var o=this.getName();for(var i in e)if(e.hasOwnProperty(i)){var a;try{g("function"==typeof e[i]),a=e[i](t,i,o,n)}catch(s){a=s}a instanceof Error&&(r(this),n===f.prop)}},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&d.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},_warnIfContextsDiffer:function(e,t){e=this._maskContext(e),t=this._maskContext(t);for(var n=Object.keys(t).sort(),r=(this.getName()||"ReactCompositeComponent",0);r<n.length;r++)n[r]},updateComponent:function(e,t,n,r,o){var i=this._instance,a=i.context,s=i.props;t!==n&&(a=this._processContext(n._context),s=this._processProps(n.props),i.componentWillReceiveProps&&i.componentWillReceiveProps(s,a));var u=this._processPendingState(s,a),l=this._pendingForceUpdate||!i.shouldComponentUpdate||i.shouldComponentUpdate(s,u,a);l?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,s,u,a,e,o)):(this._currentElement=n,this._context=o,i.props=s,i.state=u,i.context=a)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;for(var i=m({},o?r[0]:n.state),a=o?1:0;a<r.length;a++){var s=r[a];m(i,"function"==typeof s?s.call(n,i,e,t):s)}return i},_performComponentUpdate:function(e,t,n,r,o,i){var a=this._instance,s=a.props,u=a.state,l=a.context;a.componentWillUpdate&&a.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,a.props=t,a.state=n,a.context=r,this._updateRenderedComponent(o,i),a.componentDidUpdate&&o.getReactMountReady().enqueue(a.componentDidUpdate.bind(a,s,u,l),a)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(y(r,o))d.receiveComponent(n,o,e,this._processChildContext(t));else{var i=this._rootNodeID,a=n._rootNodeID;d.unmountComponent(n),this._renderedComponent=this._instantiateReactComponent(o,this._currentElement.type);var s=d.mountComponent(this._renderedComponent,i,e,t);this._replaceNodeWithMarkupByID(a,s)}},_replaceNodeWithMarkupByID:function(e,t){o.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return t},_renderValidatedComponent:function(){var e,t=i.current;i.current=this._processChildContext(this._currentElement._context),a.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{i.current=t,a.current=null}return g(null===e||e===!1||s.isValidElement(e)),e},attachRef:function(e,t){var n=this.getPublicInstance(),r=n.refs===v?n.refs={}:n.refs;r[e]=t.getPublicInstance()},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){return this._instance},_instantiateReactComponent:null};p.measureMethods(_,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var E={Mixin:_};e.exports=E},function(e,t,n){"use strict";function r(e){return o.createFactory(e)}var o=n(9),i=(n(79),n(581)),a=i({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",defs:"defs",ellipse:"ellipse",g:"g",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);e.exports=a},function(e,t,n){"use strict";var r=n(104),o=n(39),i=n(24),a=n(9),s=n(81),u=a.createFactory("button"),l=s({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),c=i.createClass({displayName:"ReactDOMButton",tagName:"BUTTON",mixins:[r,o],render:function(){var e={};for(var t in this.props)!this.props.hasOwnProperty(t)||this.props.disabled&&l[t]||(e[t]=this.props[t]);return u(e,this.props.children)}});e.exports=c},function(e,t,n){"use strict";var r=n(23),o=n(149),i=n(39),a=n(24),s=n(9),u=s.createFactory("form"),l=a.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[i,o],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(r.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(r.topLevelTypes.topSubmit,"submit")}});e.exports=l},function(e,t,n){"use strict";var r=n(23),o=n(149),i=n(39),a=n(24),s=n(9),u=s.createFactory("iframe"),l=a.createClass({displayName:"ReactDOMIframe",tagName:"IFRAME",mixins:[i,o],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(r.topLevelTypes.topLoad,"load")}});e.exports=l},function(e,t,n){"use strict";var r=n(23),o=n(149),i=n(39),a=n(24),s=n(9),u=s.createFactory("img"),l=a.createClass({displayName:"ReactDOMImg",tagName:"IMG",mixins:[i,o],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(r.topLevelTypes.topLoad,"load"),this.trapBubbledEvent(r.topLevelTypes.topError,"error")}});e.exports=l},function(e,t,n){"use strict";function r(){this.isMounted()&&this.forceUpdate()}var o=n(104),i=n(76),a=n(148),s=n(39),u=n(24),l=n(9),c=n(41),p=n(29),f=n(7),d=n(4),h=l.createFactory("input"),m={},v=u.createClass({displayName:"ReactDOMInput",tagName:"INPUT",mixins:[o,a.Mixin,s],getInitialState:function(){var e=this.props.defaultValue;return{initialChecked:this.props.defaultChecked||!1,initialValue:null!=e?e:null}},render:function(){var e=f({},this.props);e.defaultChecked=null,e.defaultValue=null;var t=a.getValue(this);e.value=null!=t?t:this.state.initialValue;var n=a.getChecked(this);return e.checked=null!=n?n:this.state.initialChecked,e.onChange=this._handleChange,h(e,this.props.children)},componentDidMount:function(){var e=c.getID(this.getDOMNode());m[e]=this},componentWillUnmount:function(){var e=this.getDOMNode(),t=c.getID(e);delete m[t]},componentDidUpdate:function(e,t,n){var r=this.getDOMNode();null!=this.props.checked&&i.setValueForProperty(r,"checked",this.props.checked||!1);var o=a.getValue(this);null!=o&&i.setValueForProperty(r,"value",""+o)},_handleChange:function(e){var t,n=a.getOnChange(this);n&&(t=n.call(this,e)),p.asap(r,this);var o=this.props.name;if("radio"===this.props.type&&null!=o){for(var i=this.getDOMNode(),s=i;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),l=0,f=u.length;f>l;l++){var h=u[l];if(h!==i&&h.form===i.form){var v=c.getID(h);d(v);var g=m[v];d(g),p.asap(r,g)}}}return t}});e.exports=v},function(e,t,n){"use strict";var r=n(39),o=n(24),i=n(9),a=(n(8),i.createFactory("option")),s=o.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[r],componentWillMount:function(){},render:function(){return a(this.props,this.props.children)}});e.exports=s},function(e,t,n){"use strict";function r(){if(this._pendingUpdate){this._pendingUpdate=!1;var e=s.getValue(this);null!=e&&this.isMounted()&&i(this,e)}}function o(e,t,n){if(null==e[t])return null;if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be an array if `multiple` is true.")}else if(Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be a scalar value if `multiple` is false.")}function i(e,t){var n,r,o,i=e.getDOMNode().options;if(e.props.multiple){for(n={},r=0,o=t.length;o>r;r++)n[""+t[r]]=!0;for(r=0,o=i.length;o>r;r++){var a=n.hasOwnProperty(i[r].value);i[r].selected!==a&&(i[r].selected=a)}}else{for(n=""+t,r=0,o=i.length;o>r;r++)if(i[r].value===n)return void(i[r].selected=!0);i.length&&(i[0].selected=!0)}}var a=n(104),s=n(148),u=n(39),l=n(24),c=n(9),p=n(29),f=n(7),d=c.createFactory("select"),h=l.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[a,s.Mixin,u],propTypes:{defaultValue:o,value:o},render:function(){var e=f({},this.props);return e.onChange=this._handleChange,e.value=null,d(e,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var e=s.getValue(this);null!=e?i(this,e):null!=this.props.defaultValue&&i(this,this.props.defaultValue)},componentDidUpdate:function(e){var t=s.getValue(this);null!=t?(this._pendingUpdate=!1,i(this,t)):!e.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?i(this,this.props.defaultValue):i(this,this.props.multiple?[]:""))},_handleChange:function(e){var t,n=s.getOnChange(this);return n&&(t=n.call(this,e)),this._pendingUpdate=!0,p.asap(r,this),t}});e.exports=h},function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function o(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var i=o.text.length,a=i+r;return{start:i,end:a}}function i(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0),u=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=u?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var p=r(c.startContainer,c.startOffset,c.endContainer,c.endOffset),f=p?0:c.toString().length,d=f+l,h=document.createRange();h.setStart(n,o),h.setEnd(i,a);var m=h.collapsed;return{start:m?d:f,end:m?f:d}}function a(e,t){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),i="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,
o=a}var s=l(e,o),u=l(e,i);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=n(16),l=n(574),c=n(257),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?o:i,setOffsets:p?a:s};e.exports=f},function(e,t,n){"use strict";function r(){this.isMounted()&&this.forceUpdate()}var o=n(104),i=n(76),a=n(148),s=n(39),u=n(24),l=n(9),c=n(29),p=n(7),f=n(4),d=(n(8),l.createFactory("textarea")),h=u.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[o,a.Mixin,s],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(f(null==e),Array.isArray(t)&&(f(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=a.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=p({},this.props);return f(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,d(e,this.state.initialValue)},componentDidUpdate:function(e,t,n){var r=a.getValue(this);if(null!=r){var o=this.getDOMNode();i.setValueForProperty(o,"value",""+r)}},_handleChange:function(e){var t,n=a.getOnChange(this);return n&&(t=n.call(this,e)),c.asap(r,this),t}});e.exports=h},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=n(29),i=n(108),a=n(7),s=n(33),u={initialize:s,close:function(){f.isBatchingUpdates=!1}},l={initialize:s,close:o.flushBatchedUpdates.bind(o)},c=[l,u];a(r.prototype,i.Mixin,{getTransactionWrappers:function(){return c}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o){var i=f.isBatchingUpdates;f.isBatchingUpdates=!0,i?e(t,n,r,o):p.perform(e,null,t,n,r,o)}};e.exports=f},function(e,t,n){"use strict";function r(e){return h.createClass({tagName:e.toUpperCase(),render:function(){return new P(e,null,null,null,null,this.props)}})}function o(){N.EventEmitter.injectReactEventListener(D),N.EventPluginHub.injectEventPluginOrder(u),N.EventPluginHub.injectInstanceHandle(M),N.EventPluginHub.injectMount(k),N.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:j,EnterLeaveEventPlugin:l,ChangeEventPlugin:a,MobileSafariClickEventPlugin:f,SelectEventPlugin:I,BeforeInputEventPlugin:i}),N.NativeComponent.injectGenericComponentClass(g),N.NativeComponent.injectTextComponentClass(x),N.NativeComponent.injectAutoWrapper(r),N.Class.injectMixin(d),N.NativeComponent.injectComponentClasses({button:y,form:b,iframe:C,img:_,input:T,option:w,select:S,textarea:O,html:F("html"),head:F("head"),body:F("body")}),N.DOMProperty.injectDOMPropertyConfig(p),N.DOMProperty.injectDOMPropertyConfig(L),N.EmptyComponent.injectEmptyComponent("noscript"),N.Updates.injectReconcileTransaction(R),N.Updates.injectBatchingStrategy(v),N.RootIndex.injectCreateReactRootIndex(c.canUseDOM?s.createReactRootIndex:A.createReactRootIndex),N.Component.injectEnvironment(m),N.DOMComponent.injectIDOperations(E)}var i=n(508),a=n(510),s=n(511),u=n(514),l=n(515),c=n(16),p=n(518),f=n(520),d=n(39),h=n(24),m=n(150),v=n(535),g=n(153),y=n(526),b=n(527),_=n(529),E=n(241),C=n(528),T=n(530),w=n(531),S=n(532),O=n(534),x=n(242),P=n(9),D=n(539),N=n(540),M=n(64),k=n(41),R=n(545),I=n(554),A=n(555),j=n(556),L=n(553),F=n(569);e.exports={inject:o}},function(e,t){"use strict";var n={guard:function(e,t){return e}};e.exports=n},function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue()}var o=n(77),i={handleTopLevel:function(e,t,n,i){var a=o.extractEvents(e,t,n,i);r(a)}};e.exports=i},function(e,t,n){"use strict";function r(e){var t=p.getID(e),n=c.getReactRootIDFromNodeID(t),r=p.findReactContainerForID(n),o=p.getFirstReactDOM(r);return o}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function i(e){for(var t=p.getFirstReactDOM(h(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=r(n);for(var o=0,i=e.ancestors.length;i>o;o++){t=e.ancestors[o];var a=p.getID(t)||"";v._handleTopLevel(e.topLevelType,t,a,e.nativeEvent)}}function a(e){var t=m(window);e(t)}var s=n(516),u=n(16),l=n(38),c=n(64),p=n(41),f=n(29),d=n(7),h=n(164),m=n(576);d(o.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),l.addPoolingTo(o,l.twoArgumentPooler);var v={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:u.canUseDOM?window:null,setHandleTopLevel:function(e){v._handleTopLevel=e},setEnabled:function(e){v._enabled=!!e},isEnabled:function(){return v._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?s.listen(r,t,v.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var r=n;return r?s.capture(r,t,v.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=a.bind(null,e);s.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(v._enabled){var n=o.getPooled(e,t);try{f.batchedUpdates(i,n)}finally{o.release(n)}}}};e.exports=v},function(e,t,n){"use strict";var r=n(60),o=n(77),i=n(151),a=n(24),s=n(154),u=n(62),l=n(105),c=n(153),p=n(50),f=n(248),d=n(29),h={Component:i.injection,Class:a.injection,DOMComponent:c.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventEmitter:u.injection,NativeComponent:l.injection,Perf:p.injection,RootIndex:f.injection,Updates:d.injection};e.exports=h},function(e,t,n){"use strict";function r(e,t){this.value=e,this.requestChange=t}function o(e){var t={value:"undefined"==typeof e?i.PropTypes.any.isRequired:e.isRequired,requestChange:i.PropTypes.func.isRequired};return i.PropTypes.shape(t)}var i=n(61);r.PropTypes={link:o},e.exports=r},function(e,t,n){"use strict";function r(e,t,n){h.push({parentID:e,parentNode:null,type:c.INSERT_MARKUP,markupIndex:m.push(t)-1,textContent:null,fromIndex:null,toIndex:n})}function o(e,t,n){h.push({parentID:e,parentNode:null,type:c.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:t,toIndex:n})}function i(e,t){h.push({parentID:e,parentNode:null,type:c.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:t,toIndex:null})}function a(e,t){h.push({parentID:e,parentNode:null,type:c.TEXT_CONTENT,markupIndex:null,textContent:t,fromIndex:null,toIndex:null})}function s(){h.length&&(l.processChildrenUpdates(h,m),u())}function u(){h.length=0,m.length=0}var l=n(151),c=n(245),p=n(66),f=n(523),d=0,h=[],m=[],v={Mixin:{mountChildren:function(e,t,n){var r=f.instantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=this._rootNodeID+a,l=p.mountComponent(s,u,t,n);s._mountIndex=i,o.push(l),i++}return o},updateTextContent:function(e){d++;var t=!0;try{var n=this._renderedChildren;f.unmountChildren(n);for(var r in n)n.hasOwnProperty(r)&&this._unmountChildByName(n[r],r);this.setTextContent(e),t=!1}finally{d--,d||(t?u():s())}},updateChildren:function(e,t,n){d++;var r=!0;try{this._updateChildren(e,t,n),r=!1}finally{d--,d||(r?u():s())}},_updateChildren:function(e,t,n){var r=this._renderedChildren,o=f.updateChildren(r,e,t,n);if(this._renderedChildren=o,o||r){var i,a=0,s=0;for(i in o)if(o.hasOwnProperty(i)){var u=r&&r[i],l=o[i];u===l?(this.moveChild(u,s,a),a=Math.max(u._mountIndex,a),u._mountIndex=s):(u&&(a=Math.max(u._mountIndex,a),this._unmountChildByName(u,i)),this._mountChildByNameAtIndex(l,i,s,t,n)),s++}for(i in r)!r.hasOwnProperty(i)||o&&o.hasOwnProperty(i)||this._unmountChildByName(r[i],i)}},unmountChildren:function(){var e=this._renderedChildren;f.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&o(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){r(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){i(this._rootNodeID,e._mountIndex)},setTextContent:function(e){a(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,r,o){var i=this._rootNodeID+t,a=p.mountComponent(e,i,r,o);e._mountIndex=n,this.createChild(e,a)},_unmountChildByName:function(e,t){this.removeChild(e),e._mountIndex=null}}};e.exports=v},function(e,t,n){"use strict";var r=n(4),o={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,n){r(o.isValidOwner(n)),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(o.isValidOwner(n)),n.getPublicInstance().refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=o},function(e,t,n){"use strict";function r(e){return function(t,n,r){t.hasOwnProperty(n)?t[n]=e(t[n],r):t[n]=r}}function o(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=l[n];r&&l.hasOwnProperty(n)?r(e,n,t[n]):e.hasOwnProperty(n)||(e[n]=t[n])}return e}var i=n(7),a=n(33),s=n(580),u=r(function(e,t){return i({},t,e)}),l={children:a,className:r(s),style:u},c={mergeProps:function(e,t){return o(i({},e),t)}};e.exports=c},function(e,t,n){"use strict";function r(){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.putListenerQueue=u.getPooled()}var o=n(146),i=n(38),a=n(62),s=n(243),u=n(247),l=n(108),c=n(7),p={initialize:s.getSelectionInformation,close:s.restoreSelection},f={initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h={initialize:function(){this.putListenerQueue.reset()},close:function(){this.putListenerQueue.putListeners()}},m=[h,p,f,d],v={getTransactionWrappers:function(){return m},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null,u.release(this.putListenerQueue),this.putListenerQueue=null}};c(r.prototype,l.Mixin,v),i.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):i.addComponentAsRefTo(t,e,n)}function o(e,t,n){"function"==typeof e?e(null):i.removeComponentAsRefFrom(t,e,n)}var i=n(543),a={};a.attachRefs=function(e,t){var n=t.ref;null!=n&&r(n,e,t._owner)},a.shouldUpdateRefs=function(e,t){return t._owner!==e._owner||t.ref!==e.ref},a.detachRefs=function(e,t){var n=t.ref;null!=n&&o(n,e,t._owner)},e.exports=a},function(e,t,n){"use strict";function r(e){p(i.isValidElement(e));var t;try{var n=a.createReactRootID();return t=u.getPooled(!1),t.perform(function(){var r=c(e,null),o=r.mountComponent(n,t,l);return s.addChecksumToMarkup(o)},null)}finally{u.release(t)}}function o(e){p(i.isValidElement(e));var t;try{var n=a.createReactRootID();return t=u.getPooled(!0),t.perform(function(){var r=c(e,null);return r.mountComponent(n,t,l)},null)}finally{u.release(t)}}var i=n(9),a=n(64),s=n(244),u=n(548),l=n(109),c=n(165),p=n(4);e.exports={renderToString:r,renderToStaticMarkup:o}},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=i.getPooled(null),this.putListenerQueue=a.getPooled()}var o=n(38),i=n(146),a=n(247),s=n(108),u=n(7),l=n(33),c={initialize:function(){this.reactMountReady.reset()},close:l},p={initialize:function(){this.putListenerQueue.reset()},close:l},f=[p,c],d={getTransactionWrappers:function(){return f},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null,a.release(this.putListenerQueue),this.putListenerQueue=null}};u(r.prototype,s.Mixin,d),o.addPoolingTo(r),e.exports=r},function(e,t){"use strict";function n(e,t){var n={};return function(r){n[t]=r,e.setState(n)}}var r={createStateSetter:function(e,t){return function(n,r,o,i,a,s){var u=t.call(e,n,r,o,i,a,s);u&&e.setState(u)}},createStateKeySetter:function(e,t){var r=e.__keySetters||(e.__keySetters={});return r[t]||(r[t]=n(e,t))}};r.Mixin={createStateSetter:function(e){return r.createStateSetter(this,e)},createStateKeySetter:function(e){return r.createStateKeySetter(this,e)}},e.exports=r},function(e,t,n){"use strict";var r=n(238),o=n(63),i={getChildMapping:function(e){return e?o.extract(r.map(e,function(e){return e})):e},mergeChildMappings:function(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},o=[];for(var i in e)t.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var u in t){if(r.hasOwnProperty(u))for(a=0;a<r[u].length;a++){var l=r[u][a];s[r[u][a]]=n(l)}s[u]=n(u)}for(a=0;a<o.length;a++)s[o[a]]=n(o[a]);return s}};e.exports=i},function(e,t,n){"use strict";function r(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete s.animationend.animation,"TransitionEvent"in window||delete s.transitionend.transition;for(var n in s){var r=s[n];for(var o in r)if(o in t){u.push(r[o]);break}}}function o(e,t,n){e.addEventListener(t,n,!1)}function i(e,t,n){e.removeEventListener(t,n,!1)}var a=n(16),s={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},u=[];a.canUseDOM&&r();var l={addEndEventListener:function(e,t){return 0===u.length?void window.setTimeout(t,0):void u.forEach(function(n){o(e,n,t)})},removeEndEventListener:function(e,t){0!==u.length&&u.forEach(function(n){i(e,n,t)})}};e.exports=l},function(e,t,n){"use strict";var r=n(519),o=n(61),i=n(240),a=n(521),s=n(63),u=n(249),l=n(29),c=n(160),p=n(159),f=n(586);o.addons={CSSTransitionGroup:a,LinkedStateMixin:r,PureRenderMixin:i,TransitionGroup:u,batchedUpdates:l.batchedUpdates,classSet:c,cloneWithProps:p,createFragment:s.create,update:f},e.exports=o},function(e,t,n){"use strict";var r=n(60),o=r.injection.MUST_USE_ATTRIBUTE,i={Properties:{cx:o,cy:o,d:o,dx:o,dy:o,fill:o,fillOpacity:o,fontFamily:o,fontSize:o,fx:o,fy:o,gradientTransform:o,gradientUnits:o,markerEnd:o,markerMid:o,markerStart:o,offset:o,opacity:o,patternContentUnits:o,patternUnits:o,points:o,preserveAspectRatio:o,r:o,rx:o,ry:o,spreadMethod:o,stopColor:o,stopOpacity:o,stroke:o,strokeDasharray:o,strokeLinecap:o,strokeOpacity:o,strokeWidth:o,textAnchor:o,transform:o,version:o,viewBox:o,x1:o,x2:o,x:o,y1:o,y2:o,y:o},DOMAttributeNames:{fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox"}};e.exports=i},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&s.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function o(e){if(y||null==m||m!==l())return null;var t=r(m);if(!g||!f(g,t)){g=t;var n=u.getPooled(h.select,v,e);return n.type="select",n.target=m,a.accumulateTwoPhaseDispatches(n),n}}var i=n(23),a=n(78),s=n(243),u=n(51),l=n(254),c=n(259),p=n(34),f=n(261),d=i.topLevelTypes,h={select:{phasedRegistrationNames:{bubbled:p({onSelect:null}),captured:p({onSelectCapture:null})},dependencies:[d.topBlur,d.topContextMenu,d.topFocus,d.topKeyDown,d.topMouseDown,d.topMouseUp,d.topSelectionChange]}},m=null,v=null,g=null,y=!1,b={eventTypes:h,extractEvents:function(e,t,n,r){switch(e){case d.topFocus:(c(t)||"true"===t.contentEditable)&&(m=t,v=n,g=null);break;case d.topBlur:m=null,v=null,g=null;break;case d.topMouseDown:y=!0;break;case d.topContextMenu:case d.topMouseUp:return y=!1,o(r);case d.topSelectionChange:case d.topKeyDown:case d.topKeyUp:return o(r)}}};e.exports=b},function(e,t){"use strict";var n=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*n)}};e.exports=r},function(e,t,n){"use strict";var r=n(23),o=n(147),i=n(78),a=n(557),s=n(51),u=n(560),l=n(562),c=n(107),p=n(559),f=n(563),d=n(80),h=n(564),m=n(162),v=n(4),g=n(34),y=(n(8),r.topLevelTypes),b={blur:{phasedRegistrationNames:{bubbled:g({onBlur:!0}),captured:g({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:g({onClick:!0}),captured:g({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:g({onContextMenu:!0}),captured:g({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:g({onCopy:!0}),captured:g({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:g({onCut:!0}),captured:g({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:g({onDoubleClick:!0}),captured:g({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:g({onDrag:!0}),captured:g({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:g({onDragEnd:!0}),captured:g({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:g({onDragEnter:!0}),captured:g({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:g({onDragExit:!0}),captured:g({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:g({onDragLeave:!0}),captured:g({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:g({onDragOver:!0}),captured:g({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:g({onDragStart:!0}),captured:g({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:g({onDrop:!0}),captured:g({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:g({onFocus:!0}),captured:g({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:g({onInput:!0}),captured:g({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:g({onKeyDown:!0}),captured:g({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:g({onKeyPress:!0}),captured:g({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:g({onKeyUp:!0}),captured:g({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:g({onLoad:!0}),captured:g({onLoadCapture:!0})}},error:{phasedRegistrationNames:{bubbled:g({onError:!0}),captured:g({onErrorCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:g({onMouseDown:!0}),captured:g({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:g({onMouseMove:!0}),captured:g({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:g({onMouseOut:!0}),captured:g({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:g({onMouseOver:!0}),captured:g({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:g({onMouseUp:!0}),captured:g({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:g({onPaste:!0}),captured:g({onPasteCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:g({onReset:!0}),captured:g({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:g({onScroll:!0}),captured:g({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:g({onSubmit:!0}),captured:g({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:g({onTouchCancel:!0}),captured:g({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:g({onTouchEnd:!0}),captured:g({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:g({onTouchMove:!0}),captured:g({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:g({onTouchStart:!0}),captured:g({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:g({onWheel:!0}),captured:g({onWheelCapture:!0})}}},_={topBlur:b.blur,topClick:b.click,topContextMenu:b.contextMenu,topCopy:b.copy,topCut:b.cut,topDoubleClick:b.doubleClick,topDrag:b.drag,topDragEnd:b.dragEnd,topDragEnter:b.dragEnter,topDragExit:b.dragExit,topDragLeave:b.dragLeave,topDragOver:b.dragOver,topDragStart:b.dragStart,topDrop:b.drop,topError:b.error,topFocus:b.focus,topInput:b.input,topKeyDown:b.keyDown,topKeyPress:b.keyPress,topKeyUp:b.keyUp,topLoad:b.load,topMouseDown:b.mouseDown,topMouseMove:b.mouseMove,topMouseOut:b.mouseOut,topMouseOver:b.mouseOver,topMouseUp:b.mouseUp,topPaste:b.paste,topReset:b.reset,topScroll:b.scroll,topSubmit:b.submit,topTouchCancel:b.touchCancel,topTouchEnd:b.touchEnd,topTouchMove:b.touchMove,topTouchStart:b.touchStart,topWheel:b.wheel};for(var E in _)_[E].dependencies=[E];var C={eventTypes:b,executeDispatch:function(e,t,n){var r=o.executeDispatch(e,t,n);r===!1&&(e.stopPropagation(),e.preventDefault())},extractEvents:function(e,t,n,r){var o=_[e];if(!o)return null;var g;switch(e){case y.topInput:case y.topLoad:case y.topError:case y.topReset:case y.topSubmit:g=s;break;case y.topKeyPress:if(0===m(r))return null;case y.topKeyDown:case y.topKeyUp:g=l;break;case y.topBlur:case y.topFocus:g=u;break;case y.topClick:if(2===r.button)return null;case y.topContextMenu:case y.topDoubleClick:case y.topMouseDown:case y.topMouseMove:case y.topMouseOut:case y.topMouseOver:case y.topMouseUp:g=c;break;case y.topDrag:case y.topDragEnd:case y.topDragEnter:case y.topDragExit:case y.topDragLeave:case y.topDragOver:case y.topDragStart:case y.topDrop:g=p;break;case y.topTouchCancel:case y.topTouchEnd:case y.topTouchMove:case y.topTouchStart:g=f;break;case y.topScroll:g=d;break;case y.topWheel:g=h;break;case y.topCopy:case y.topCut:case y.topPaste:g=a}v(g);var b=g.getPooled(o,n,r);return i.accumulateTwoPhaseDispatches(b),b}};e.exports=C},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(51),i={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(51),i={data:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(107),i={dataTransfer:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(80),i={relatedTarget:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(51),i={data:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(80),i=n(162),a=n(573),s=n(163),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?i(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?i(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};o.augmentClass(r,u),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(80),i=n(163),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:i};o.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){o.call(this,e,t,n)}var o=n(107),i={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};o.augmentClass(r,i),e.exports=r},function(e,t){"use strict";function n(e){for(var t=1,n=0,o=0;o<e.length;o++)t=(t+e.charCodeAt(o))%r,n=(n+t)%r;return t|n<<16}var r=65521;e.exports=n},function(e,t){function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=n},function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=n(566),i=/^-ms-/;e.exports=r},function(e,t,n){function r(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function o(e){return r(e)?Array.isArray(e)?e.slice():i(e):[e]}var i=n(585);e.exports=o},function(e,t,n){"use strict";function r(e){var t=i.createFactory(e),n=o.createClass({tagName:e.toUpperCase(),displayName:"ReactFullPageComponent"+e,componentWillUnmount:function(){a(!1)},render:function(){return t(this.props)}});return n}var o=n(24),i=n(9),a=n(4);e.exports=r},function(e,t,n){function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function o(e,t){var n=l;u(!!l);var o=r(e),i=o&&s(o);if(i){n.innerHTML=i[1]+e+i[2];for(var c=i[0];c--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(u(t),a(p).forEach(t));for(var f=a(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}var i=n(16),a=n(568),s=n(256),u=n(4),l=i.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=o},function(e,t,n){"use strict";function r(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var o=n(235),i=o.isUnitlessNumber;e.exports=r},function(e,t,n){"use strict";function r(e,t,n){var r=e,o=!r.hasOwnProperty(n);o&&null!=t&&(r[n]=t)}function o(e){if(null==e)return e;var t={};return i(e,r,t),t}var i=n(262);n(8),e.exports=o},function(e,t,n){"use strict";function r(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var o=n(162),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),i=0,a=0;o;){if(3===o.nodeType){if(a=i+o.textContent.length,t>=i&&a>=t)return{node:o,offset:t-i};i=a}o=n(r(o))}}e.exports=o},function(e,t){"use strict";function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;e.exports=n},function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=n(577),i=/^ms-/;e.exports=r},function(e,t,n){function r(e){return o(e)&&3==e.nodeType}var o=n(258);e.exports=r},function(e,t){"use strict";function n(e){e||(e="");var t,n=arguments.length;if(n>1)for(var r=1;n>r;r++)t=arguments[r],t&&(e=(e?e+" ":"")+t);return e}e.exports=n},function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var i in e)r.call(e,i)&&(o[i]=t.call(n,e[i],i,e));return o}var r=Object.prototype.hasOwnProperty;e.exports=n},function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=n},function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=n(110);e.exports=r},function(e,t,n){"use strict";var r=n(16),o=n(110),i=n(167),a=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){i(e,o(t))})),e.exports=a},function(e,t,n){function r(e){var t=e.length;if(o(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),o("number"==typeof t),o(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),i=0;t>i;i++)r[i]=e[i];return r}var o=n(4);e.exports=r},function(e,t,n){"use strict";function r(e){return Array.isArray(e)?e.concat():e&&"object"==typeof e?a(new e.constructor,e):e}function o(e,t,n){u(Array.isArray(e));var r=t[n];u(Array.isArray(r))}function i(e,t){if(u("object"==typeof t),t.hasOwnProperty(f))return u(1===Object.keys(t).length),t[f];var n=r(e);if(t.hasOwnProperty(d)){var s=t[d];u(s&&"object"==typeof s),u(n&&"object"==typeof n),a(n,t[d])}t.hasOwnProperty(l)&&(o(e,t,l),t[l].forEach(function(e){n.push(e)})),t.hasOwnProperty(c)&&(o(e,t,c),t[c].forEach(function(e){n.unshift(e)})),t.hasOwnProperty(p)&&(u(Array.isArray(e)),u(Array.isArray(t[p])),t[p].forEach(function(e){u(Array.isArray(e)),n.splice.apply(n,e)})),t.hasOwnProperty(h)&&(u("function"==typeof t[h]),n=t[h](n));for(var m in t)v.hasOwnProperty(m)&&v[m]||(n[m]=i(e[m],t[m]));return n}var a=n(7),s=n(34),u=n(4),l=s({$push:null}),c=s({$unshift:null}),p=s({$splice:null}),f=s({$set:null}),d=s({$merge:null}),h=s({$apply:null}),m=[l,c,p,f,d,h],v={};m.forEach(function(e){v[e]=!0}),e.exports=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={pending:"pending",saved:"saved",failed:"failed"};t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(){}function o(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function i(e){return e===Object(e)}function a(e){if(!i(e))return e;var t=[];for(var n in e)null!=e[n]&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function s(e){for(var t,n,r={},o=e.split("&"),i=0,a=o.length;a>i;++i)n=o[i],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function u(e){var t,n,r,o,i=e.split(/\r?\n/),a={};i.pop();for(var s=0,u=i.length;u>s;++s)n=i[s],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),o=g(n.slice(t+1)),a[r]=o;return a}function l(e){return e.split(/ *; */).shift()}function c(e){return m(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),o=n.shift();return r&&o&&(e[r]=o),e},{})}function p(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function f(e,t){var n=this;h.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new p(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var o=new Error(t.statusText||"Unsuccessful HTTP response");o.original=e,o.response=t,o.status=t.status,n.callback(e||o,t)})}function d(e,t){return"function"==typeof t?new f("GET",e).end(t):1==arguments.length?new f("GET",e):new f(e,t)}var h=n(589),m=n(590),v="undefined"==typeof window?this||self:window;d.getXHR=function(){if(!(!v.XMLHttpRequest||v.location&&"file:"==v.location.protocol&&v.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var g="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"");
};d.serializeObject=a,d.parseString=s,d.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},d.serialize={"application/x-www-form-urlencoded":a,"application/json":JSON.stringify},d.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=l(t);var n=c(t);for(var r in n)this[r]=n[r]},p.prototype.parseBody=function(e){var t=d.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},d.Response=p,h(f.prototype),f.prototype.use=function(e){return e(this),this},f.prototype.timeout=function(e){return this._timeout=e,this},f.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},f.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},f.prototype.set=function(e,t){if(i(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},f.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},f.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},f.prototype.type=function(e){return this.set("Content-Type",d.types[e]||e),this},f.prototype.accept=function(e){return this.set("Accept",d.types[e]||e),this},f.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},f.prototype.query=function(e){return"string"!=typeof e&&(e=a(e)),e&&this._query.push(e),this},f.prototype.field=function(e,t){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t),this},f.prototype.attach=function(e,t,n){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t,n),this},f.prototype.send=function(e){var t=i(e),n=this.getHeader("Content-Type");if(t&&i(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||o(e)?this:(n||this.type("json"),this)},f.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},f.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},f.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},f.prototype.withCredentials=function(){return this._withCredentials=!0,this},f.prototype.end=function(e){var t=this,n=this.xhr=d.getXHR(),i=this._query.join("&"),a=this._timeout,s=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var u=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=u);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=u)}catch(l){}if(a&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},a)),i&&(i=d.serializeObject(i),this.url+=~this.url.indexOf("?")?"&"+i:"?"+i),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!o(s)){var c=d.serialize[this.getHeader("Content-Type")];c&&(s=c(s))}for(var p in this.header)null!=this.header[p]&&n.setRequestHeader(p,this.header[p]);return this.emit("request",this),n.send(s),this},d.Request=f,d.get=function(e,t,n){var r=d("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},d.head=function(e,t,n){var r=d("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.del=function(e,t){var n=d("DELETE",e);return t&&n.end(t),n},d.patch=function(e,t,n){var r=d("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.post=function(e,t,n){var r=d("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.put=function(e,t,n){var r=d("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},e.exports=d},function(e,t){function n(e){return e?r(e):void 0}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,o=n.length;o>r;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){e.exports=function(e,t,n){for(var r=0,o=e.length,i=3==arguments.length?n:e[r++];o>r;)i=t.call(null,i,e[r],++r,e);return i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n(264),a=r(i),s=n(266),u=r(s),l=n(599),c=r(l),p=function(){function e(t,n){o(this,e);var r=t;"object"==typeof t&&(r=a["default"](u["default"](t),function(e){return[c["default"](e)]})),this.state=n,this.listeners=[],this.replaceDispatcher(r)}return e.prototype.getDispatcher=function(){return this.dispatcher},e.prototype.replaceDispatcher=function(e){this.dispatcher=e,this.dispatchFn=e(this.state,this.setState.bind(this))},e.prototype.dispatch=function(e){return this.dispatchFn(e)},e.prototype.getState=function(){return this.state},e.prototype.setState=function(e){return this.state=e,this.listeners.forEach(function(e){return e()}),e},e.prototype.subscribe=function(e){var t=this.listeners;return t.push(e),function(){var n=t.indexOf(e);t.splice(n,1)}},e}();t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=a["default"](e),n=c["default"](e),r=u["default"](e,t),o=f["default"](e,n);return{Provider:t,Connector:n,provide:r,connect:o}}t.__esModule=!0,t["default"]=o;var i=n(596),a=r(i),s=n(595),u=r(s),l=n(594),c=r(l),p=n(593),f=r(p);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(e,t){var n=e.Component;return function(r){return function(a){return function(n){function l(){o(this,l),null!=n&&n.apply(this,arguments)}return i(l,n),l.prototype.shouldComponentUpdate=function(e){return!f["default"](this.props,e)},l.prototype.render=function(){var n=this;return e.createElement(t,{select:function(e){return r(e,n.props)}},function(t){return e.createElement(a,s({},t,n.props))})},u(l,null,[{key:"displayName",value:"Connector("+c["default"](a)+")",enumerable:!0},{key:"DecoratedComponent",value:a,enumerable:!0}]),l}(n)}}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var l=n(267),c=r(l),p=n(606),f=r(p);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(e){var t=e.Component,n=e.PropTypes;return function(e){function t(n,r){o(this,t),e.call(this,n,r),this.unsubscribe=r.redux.subscribe(this.handleChange.bind(this)),this.state=this.selectState(n,r)}return i(t,e),t.prototype.shouldComponentUpdate=function(e,t){return!this.isSliceEqual(this.state.slice,t.slice)||!f["default"](this.props,e)},t.prototype.isSliceEqual=function(e,t){var n=e===t;return n?!0:"object"!=typeof e||"object"!=typeof t?n:f["default"](e,t)},t.prototype.componentWillReceiveProps=function(e){e.select!==this.props.select&&this.handleChange(e)},t.prototype.componentWillUnmount=function(){this.unsubscribe()},t.prototype.handleChange=function(){var e=void 0===arguments[0]?this.props:arguments[0],t=this.selectState(e,this.context);this.setState(t)},t.prototype.selectState=function(e,t){var n=t.redux.getState(),r=e.select(n);return v["default"](h["default"](r),"The return value of `select` prop must be an object. Instead received %s.",r),{slice:r}},t.prototype.render=function(){var e=this.props.children,t=this.state.slice,n=this.context.redux.dispatch;return e(s({dispatch:n},t))},u(t,null,[{key:"contextTypes",value:{redux:n.object.isRequired},enumerable:!0},{key:"propTypes",value:{children:n.func.isRequired,select:n.func.isRequired},enumerable:!0},{key:"defaultProps",value:{select:c["default"]},enumerable:!0}]),t}(t)}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var l=n(602),c=r(l),p=n(605),f=r(p),d=n(603),h=r(d),m=n(607),v=r(m);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function a(e,t){var n=e.Component;return function(r){return function(a){return function(n){function u(){o(this,u),null!=n&&n.apply(this,arguments)}return i(u,n),u.prototype.render=function(){var n=this;return e.createElement(t,{redux:r},function(){return e.createElement(a,n.props)})},s(u,null,[{key:"displayName",value:"Provider("+l["default"](a)+")",enumerable:!0},{key:"DecoratedComponent",value:a,enumerable:!0}]),u}(n)}}}t.__esModule=!0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(267),l=r(u);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}function o(e){var t=e.Component,o=e.PropTypes,a=o.shape({subscribe:o.func.isRequired,dispatch:o.func.isRequired,getState:o.func.isRequired});return function(e){function t(r,o){n(this,t),e.call(this,r,o),this.state={redux:r.redux}}return r(t,e),t.prototype.getChildContext=function(){return{redux:this.state.redux}},t.prototype.componentWillReceiveProps=function(e){var t=this.state.redux,n=e.redux;if(t!==n){var r=n.getDispatcher();t.replaceDispatcher(r)}},t.prototype.render=function(){var e=this.props.children;return e()},i(t,null,[{key:"propTypes",value:{redux:a.isRequired,children:o.func.isRequired},enumerable:!0},{key:"childContextTypes",value:{redux:a.isRequired},enumerable:!0}]),t}(t)}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];var r=new(i.apply(s["default"],[null].concat(t)));return{subscribe:r.subscribe.bind(r),dispatch:r.dispatch.bind(r),getState:r.getState.bind(r),getDispatcher:r.getDispatcher.bind(r),replaceDispatcher:r.replaceDispatcher.bind(r)}}t.__esModule=!0;var i=Function.prototype.bind;t["default"]=o;var a=n(591),s=r(a);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(597),i=r(o),a=n(264),s=r(a),u=n(265),l=r(u),c=n(266),p=r(c),f=n(601),d=r(f);t.createRedux=i["default"],t.createDispatcher=s["default"],t.composeMiddleware=l["default"],t.composeStores=p["default"],t.bindActionCreators=d["default"]},function(e,t){"use strict";function n(e){return function(t){var n=function r(n){return"function"==typeof n?n(r,e):t(n)};return n}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(592),s=r(a),u=s["default"](i["default"]),l=u.Provider,c=u.Connector,p=u.provide,f=u.connect;t.Provider=l,t.Connector=c,t.provide=p,t.connect=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return a["default"](e,function(e){return function(){for(var n=arguments.length,r=Array(n),o=0;n>o;o++)r[o]=arguments[o];return t(e.apply(void 0,r))}})}t.__esModule=!0,t["default"]=o;var i=n(268),a=r(i);e.exports=t["default"]},function(e,t){"use strict";function n(e){return e}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e){return e?"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype:!1}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){return Object.keys(e).reduce(function(n,r){return t(e[r])&&(n[r]=e[r]),n},{})}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++){if(!o.call(t,n[i]))return!1;var a=e[n[i]],s=t[n[i]];if(a!==s||"object"==typeof a||"object"==typeof s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw u.framesToPop=1,u}};e.exports=r},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var o=n[r],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}t.__esModule=!0;var i=n(600);o(t,r(i))},function(e,t){!function(){function t(e,t){_[e]||("undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("[WARNING] "+e+" is deprecated and will be removed in version 1.0. Instead, use `"+t+"`."),_[e]=!0)}function n(e){e.localize=g.localize.bind(g),e.timezone=g.timezone.bind(g),e.utc=g.utc.bind(g)}function r(e,n,r){n&&n.days&&(r=n,n=void 0),r&&t("`"+b+"(format, [date], [locale])`","var s = "+b+".localize(locale); s(format, [date])");var o=r?g.localize(r):g;return o(e,n)}function o(e,n,r){r?t("`"+b+".strftime(format, [date], [locale])`","var s = "+b+".localize(locale); s(format, [date])"):t("`"+b+".strftime(format, [date])`",b+"(format, [date])");var o=r?g.localize(r):g;return o(e,n)}function i(e,n,r,o){"number"!=typeof r&&"string"!=typeof r||null!=o||(o=r,r=void 0),r?t("`"+b+".strftimeTZ(format, date, locale, tz)`","var s = "+b+".localize(locale).timezone(tz); s(format, [date])` or `var s = "+b+".localize(locale); s.timezone(tz)(format, [date])"):t("`"+b+".strftimeTZ(format, date, tz)`","var s = "+b+".timezone(tz); s(format, [date])` or `"+b+".timezone(tz)(format, [date])");var i=(r?g.localize(r):g).timezone(o);return i(e,n)}function a(e,n,r){r?t("`"+b+".strftimeUTC(format, date, locale)`","var s = "+b+".localize(locale).utc(); s(format, [date])"):t("`"+b+".strftimeUTC(format, [date])`","var s = "+b+".utc(); s(format, [date])");var o=r?E.localize(r):E;return o(e,n)}function s(e){return t("`"+b+".localizedStrftime(locale)`",b+".localize(locale)"),g.localize(e)}function u(e,t,n){function r(e,t){var n;if(t)n=t.getTime(),m&&(t=new Date(t.getTime()+h(t)+s));else{var r=Date.now();r>g?(g=r,i=new Date(g),n=g,m&&(i=new Date(g+h(i)+s))):n=g,t=i}return o(e,t,a,n)}function o(e,t,n,r){for(var i="",a=null,u=!1,h=e.length,v=!1,g=0;h>g;g++){var y=e.charCodeAt(g);if(u!==!0)37!==y?i+=e[g]:u=!0;else{if(45===y){a="";continue}if(95===y){a=" ";continue}if(48===y){a="0";continue}if(58===y){v&&"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),v=!0;continue}switch(y){case 65:i+=n.days[t.getDay()];break;case 66:i+=n.months[t.getMonth()];break;case 67:i+=l(Math.floor(t.getFullYear()/100),a);break;case 68:i+=o(n.formats.D,t,n,r);break;case 70:i+=o(n.formats.F,t,n,r);break;case 72:i+=l(t.getHours(),a);break;case 73:i+=l(p(t.getHours()),a);break;case 76:i+=c(Math.floor(r%1e3));break;case 77:i+=l(t.getMinutes(),a);break;case 80:i+=t.getHours()<12?n.am:n.pm;break;case 82:i+=o(n.formats.R,t,n,r);break;case 83:i+=l(t.getSeconds(),a);break;case 84:i+=o(n.formats.T,t,n,r);break;case 85:i+=l(f(t,"sunday"),a);break;case 87:i+=l(f(t,"monday"),a);break;case 88:i+=o(n.formats.X,t,n,r);break;case 89:i+=t.getFullYear();break;case 90:if(m&&0===s)i+="GMT";else{var b=t.toString().match(/\(([\w\s]+)\)/);i+=b&&b[1]||""}break;case 97:i+=n.shortDays[t.getDay()];break;case 98:i+=n.shortMonths[t.getMonth()];break;case 99:i+=o(n.formats.c,t,n,r);break;case 100:i+=l(t.getDate(),a);break;case 101:i+=l(t.getDate(),null==a?" ":a);break;case 104:i+=n.shortMonths[t.getMonth()];break;case 106:var _=new Date(t.getFullYear(),0,1),E=Math.ceil((t.getTime()-_.getTime())/864e5);i+=c(E);break;case 107:i+=l(t.getHours(),null==a?" ":a);break;case 108:i+=l(p(t.getHours()),null==a?" ":a);break;case 109:i+=l(t.getMonth()+1,a);break;case 110:i+="\n";break;case 111:i+=String(t.getDate())+d(t.getDate());break;case 112:i+=t.getHours()<12?n.AM:n.PM;break;case 114:i+=o(n.formats.r,t,n,r);break;case 115:i+=Math.floor(r/1e3);break;case 116:i+=" ";break;case 117:var E=t.getDay();i+=0===E?7:E;break;case 118:i+=o(n.formats.v,t,n,r);break;case 119:i+=t.getDay();break;case 120:i+=o(n.formats.x,t,n,r);break;case 121:i+=(""+t.getFullYear()).slice(2);break;case 122:if(m&&0===s)i+=v?"+00:00":"+0000";else{var C;C=0!==s?s/6e4:-t.getTimezoneOffset();var T=0>C?"-":"+",w=v?":":"",S=Math.floor(Math.abs(C/60)),O=Math.abs(C%60);i+=T+l(S)+w+l(O)}break;default:i+=e[g]}a=null,u=!1}}return i}var i,a=e||v,s=t||0,m=n||!1,g=0,y=r;return y.localize=function(e){return new u(e||a,s,m)},y.timezone=function(e){var t=s,n=m,r=typeof e;if("number"===r||"string"===r)if(n=!0,"string"===r){var o="-"===e[0]?-1:1,i=parseInt(e.slice(1,3),10),l=parseInt(e.slice(3,5),10);t=o*(60*i+l)*60*1e3}else"number"===r&&(t=60*e*1e3);return new u(a,t,n)},y.utc=function(){return new u(a,s,!0)},y}function l(e,t){return""===t||e>9?e:(null==t&&(t="0"),t+e)}function c(e){return e>99?e:e>9?"0"+e:"00"+e}function p(e){return 0===e?12:e>12?e-12:e}function f(e,t){t=t||"sunday";var n=e.getDay();"monday"===t&&(0===n?n=6:n--);var r=Date.UTC(e.getFullYear(),0,1),o=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),i=Math.floor((o-r)/864e5),a=(i+7-n)/7;return Math.floor(a)}function d(e){var t=e%10,n=e%100;if(n>=11&&13>=n||0===t||t>=4)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function h(e){return 6e4*(e.getTimezoneOffset()||0)}var m,v={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",T:"%H:%M:%S",X:"%T",c:"%a %b %d %X %Y",r:"%I:%M:%S %p",v:"%e-%b-%Y",x:"%D"}},g=new u(v,0,!1),y="undefined"!=typeof e;y?(m=e.exports=r,m.strftime=o):(m=function(){return this||(1,eval)("this")}(),m.strftime=r);var b=y?"require('strftime')":"strftime",_={};m.strftimeTZ=i,m.strftimeUTC=a,m.localizedStrftime=s,n(r),n(o);var E=g.utc();"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},function(e,t){function n(e){if(e){var t=e.trim();return t=t.replace(/\.\d\d\d+/,""),t=t.replace(/-/,"/").replace(/-/,"/"),t=t.replace(/T/," ").replace(/Z/," UTC"),t=t.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),new Date(t)}}function r(e){return a.inWords(o(e))}function o(e){return(new Date).getTime()-e.getTime()}/*
* node-timeago
* Cam Pedersen
* <diffference@gmail.com>
* Oct 6, 2011
* Timeago is a jQuery plugin that makes it easy to support automatically
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
*
* @name timeago
* @version 0.10.0
* @requires jQuery v1.2.3+
* @author Ryan McGeary
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
*
* For usage and examples, visit:
* http://timeago.yarp.com/
*
* Copyright (c) 2008-2011, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org)
*/
e.exports=function(e){return e instanceof Date?r(e):"string"==typeof e?r(n(e)):"number"==typeof e?r(new Date(e)):void 0};var i={allowFuture:!1,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",numbers:[]}},a=i.strings;e.exports.settings=i,a.inWords=function(e){function t(t,n){var r="function"==typeof t?t(n,e):t,o=a.numbers&&a.numbers[n]||n;return r.replace(/%d/i,o)}var n=a.prefixAgo,r=a.suffixAgo;i.allowFuture&&0>e&&(n=a.prefixFromNow,r=a.suffixFromNow);var o=Math.abs(e)/1e3,s=o/60,u=s/60,l=u/24,c=l/365,p=45>o&&t(a.seconds,Math.round(o))||90>o&&t(a.minute,1)||45>s&&t(a.minutes,Math.round(s))||90>s&&t(a.hour,1)||24>u&&t(a.hours,Math.round(u))||48>u&&t(a.day,1)||30>l&&t(a.days,Math.floor(l))||60>l&&t(a.month,1)||365>l&&t(a.months,Math.floor(l/30))||2>c&&t(a.year,1)||t(a.years,Math.floor(c));return[n,p,r].join(" ").toString().trim()},a.parse=n},function(e,t,n){var r,o;(function(){function n(e){function t(t,n,r,o,i,a){for(;i>=0&&a>i;i+=e){var s=o?o[i]:i;r=n(r,t[s],s,t)}return r}return function(n,r,o,i){r=T(r,i,4);var a=!N(n)&&C.keys(n),s=(a||n).length,u=e>0?0:s-1;return arguments.length<3&&(o=n[a?a[u]:u],u+=e),t(n,r,o,a,u,s)}}function i(e){return function(t,n,r){n=w(n,r);for(var o=D(t),i=e>0?0:o-1;i>=0&&o>i;i+=e)if(n(t[i],i,t))return i;return-1}}function a(e,t,n){return function(r,o,i){var a=0,s=D(r);if("number"==typeof i)e>0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return i=n(r,o),r[i]===o?i:-1;if(o!==o)return i=t(h.call(r,a,s),C.isNaN),i>=0?i+a:-1;for(i=e>0?a:s-1;i>=0&&s>i;i+=e)if(r[i]===o)return i;return-1}}function s(e,t){var n=A.length,r=e.constructor,o=C.isFunction(r)&&r.prototype||p,i="constructor";for(C.has(e,i)&&!C.contains(t,i)&&t.push(i);n--;)i=A[n],i in e&&e[i]!==o[i]&&!C.contains(t,i)&&t.push(i)}var u=this,l=u._,c=Array.prototype,p=Object.prototype,f=Function.prototype,d=c.push,h=c.slice,m=p.toString,v=p.hasOwnProperty,g=Array.isArray,y=Object.keys,b=f.bind,_=Object.create,E=function(){},C=function(e){return e instanceof C?e:this instanceof C?void(this._wrapped=e):new C(e)};"undefined"!=typeof e&&e.exports&&(t=e.exports=C),t._=C,C.VERSION="1.8.3";var T=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)}}return function(){return e.apply(t,arguments)}},w=function(e,t,n){return null==e?C.identity:C.isFunction(e)?T(e,t,n):C.isObject(e)?C.matcher(e):C.property(e)};C.iteratee=function(e,t){return w(e,t,1/0)};var S=function(e,t){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var o=1;r>o;o++)for(var i=arguments[o],a=e(i),s=a.length,u=0;s>u;u++){var l=a[u];t&&void 0!==n[l]||(n[l]=i[l])}return n}},O=function(e){if(!C.isObject(e))return{};if(_)return _(e);E.prototype=e;var t=new E;return E.prototype=null,t},x=function(e){return function(t){return null==t?void 0:t[e]}},P=Math.pow(2,53)-1,D=x("length"),N=function(e){var t=D(e);return"number"==typeof t&&t>=0&&P>=t};C.each=C.forEach=function(e,t,n){t=T(t,n);var r,o;if(N(e))for(r=0,o=e.length;o>r;r++)t(e[r],r,e);else{var i=C.keys(e);for(r=0,o=i.length;o>r;r++)t(e[i[r]],i[r],e)}return e},C.map=C.collect=function(e,t,n){t=w(t,n);for(var r=!N(e)&&C.keys(e),o=(r||e).length,i=Array(o),a=0;o>a;a++){var s=r?r[a]:a;i[a]=t(e[s],s,e)}return i},C.reduce=C.foldl=C.inject=n(1),C.reduceRight=C.foldr=n(-1),C.find=C.detect=function(e,t,n){var r;return r=N(e)?C.findIndex(e,t,n):C.findKey(e,t,n),void 0!==r&&-1!==r?e[r]:void 0},C.filter=C.select=function(e,t,n){var r=[];return t=w(t,n),C.each(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r},C.reject=function(e,t,n){return C.filter(e,C.negate(w(t)),n)},C.every=C.all=function(e,t,n){t=w(t,n);for(var r=!N(e)&&C.keys(e),o=(r||e).length,i=0;o>i;i++){var a=r?r[i]:i;if(!t(e[a],a,e))return!1}return!0},C.some=C.any=function(e,t,n){t=w(t,n);for(var r=!N(e)&&C.keys(e),o=(r||e).length,i=0;o>i;i++){var a=r?r[i]:i;if(t(e[a],a,e))return!0}return!1},C.contains=C.includes=C.include=function(e,t,n,r){return N(e)||(e=C.values(e)),("number"!=typeof n||r)&&(n=0),C.indexOf(e,t,n)>=0},C.invoke=function(e,t){var n=h.call(arguments,2),r=C.isFunction(t);return C.map(e,function(e){var o=r?t:e[t];return null==o?o:o.apply(e,n)})},C.pluck=function(e,t){return C.map(e,C.property(t))},C.where=function(e,t){return C.filter(e,C.matcher(t))},C.findWhere=function(e,t){return C.find(e,C.matcher(t))},C.max=function(e,t,n){var r,o,i=-(1/0),a=-(1/0);if(null==t&&null!=e){e=N(e)?e:C.values(e);for(var s=0,u=e.length;u>s;s++)r=e[s],r>i&&(i=r)}else t=w(t,n),C.each(e,function(e,n,r){o=t(e,n,r),(o>a||o===-(1/0)&&i===-(1/0))&&(i=e,a=o)});return i},C.min=function(e,t,n){var r,o,i=1/0,a=1/0;if(null==t&&null!=e){e=N(e)?e:C.values(e);for(var s=0,u=e.length;u>s;s++)r=e[s],i>r&&(i=r)}else t=w(t,n),C.each(e,function(e,n,r){o=t(e,n,r),(a>o||o===1/0&&i===1/0)&&(i=e,a=o)});return i},C.shuffle=function(e){for(var t,n=N(e)?e:C.values(e),r=n.length,o=Array(r),i=0;r>i;i++)t=C.random(0,i),t!==i&&(o[i]=o[t]),o[t]=n[i];return o},C.sample=function(e,t,n){return null==t||n?(N(e)||(e=C.values(e)),e[C.random(e.length-1)]):C.shuffle(e).slice(0,Math.max(0,t))},C.sortBy=function(e,t,n){return t=w(t,n),C.pluck(C.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return e.index-t.index}),"value")};var M=function(e){return function(t,n,r){var o={};return n=w(n,r),C.each(t,function(r,i){var a=n(r,i,t);e(o,r,a)}),o}};C.groupBy=M(function(e,t,n){C.has(e,n)?e[n].push(t):e[n]=[t]}),C.indexBy=M(function(e,t,n){e[n]=t}),C.countBy=M(function(e,t,n){C.has(e,n)?e[n]++:e[n]=1}),C.toArray=function(e){return e?C.isArray(e)?h.call(e):N(e)?C.map(e,C.identity):C.values(e):[]},C.size=function(e){return null==e?0:N(e)?e.length:C.keys(e).length},C.partition=function(e,t,n){t=w(t,n);var r=[],o=[];return C.each(e,function(e,n,i){(t(e,n,i)?r:o).push(e)}),[r,o]},C.first=C.head=C.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:C.initial(e,e.length-t)},C.initial=function(e,t,n){return h.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},C.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:C.rest(e,Math.max(0,e.length-t))},C.rest=C.tail=C.drop=function(e,t,n){return h.call(e,null==t||n?1:t)},C.compact=function(e){return C.filter(e,C.identity)};var k=function(e,t,n,r){for(var o=[],i=0,a=r||0,s=D(e);s>a;a++){var u=e[a];if(N(u)&&(C.isArray(u)||C.isArguments(u))){t||(u=k(u,t,n));var l=0,c=u.length;for(o.length+=c;c>l;)o[i++]=u[l++]}else n||(o[i++]=u)}return o};C.flatten=function(e,t){return k(e,t,!1)},C.without=function(e){return C.difference(e,h.call(arguments,1))},C.uniq=C.unique=function(e,t,n,r){C.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=w(n,r));for(var o=[],i=[],a=0,s=D(e);s>a;a++){var u=e[a],l=n?n(u,a,e):u;t?(a&&i===l||o.push(u),i=l):n?C.contains(i,l)||(i.push(l),o.push(u)):C.contains(o,u)||o.push(u)}return o},C.union=function(){return C.uniq(k(arguments,!0,!0))},C.intersection=function(e){for(var t=[],n=arguments.length,r=0,o=D(e);o>r;r++){var i=e[r];if(!C.contains(t,i)){for(var a=1;n>a&&C.contains(arguments[a],i);a++);a===n&&t.push(i)}}return t},C.difference=function(e){var t=k(arguments,!0,!0,1);return C.filter(e,function(e){return!C.contains(t,e)})},C.zip=function(){return C.unzip(arguments)},C.unzip=function(e){for(var t=e&&C.max(e,D).length||0,n=Array(t),r=0;t>r;r++)n[r]=C.pluck(e,r);return n},C.object=function(e,t){for(var n={},r=0,o=D(e);o>r;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},C.findIndex=i(1),C.findLastIndex=i(-1),C.sortedIndex=function(e,t,n,r){n=w(n,r,1);for(var o=n(t),i=0,a=D(e);a>i;){var s=Math.floor((i+a)/2);n(e[s])<o?i=s+1:a=s}return i},C.indexOf=a(1,C.findIndex,C.sortedIndex),C.lastIndexOf=a(-1,C.findLastIndex),C.range=function(e,t,n){null==t&&(t=e||0,e=0),n=n||1;for(var r=Math.max(Math.ceil((t-e)/n),0),o=Array(r),i=0;r>i;i++,e+=n)o[i]=e;return o};var R=function(e,t,n,r,o){if(!(r instanceof t))return e.apply(n,o);var i=O(e.prototype),a=e.apply(i,o);return C.isObject(a)?a:i};C.bind=function(e,t){if(b&&e.bind===b)return b.apply(e,h.call(arguments,1));if(!C.isFunction(e))throw new TypeError("Bind must be called on a function");var n=h.call(arguments,2),r=function(){return R(e,r,t,this,n.concat(h.call(arguments)))};return r},C.partial=function(e){var t=h.call(arguments,1),n=function(){for(var r=0,o=t.length,i=Array(o),a=0;o>a;a++)i[a]=t[a]===C?arguments[r++]:t[a];for(;r<arguments.length;)i.push(arguments[r++]);return R(e,n,this,this,i)};return n},C.bindAll=function(e){var t,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(t=1;r>t;t++)n=arguments[t],e[n]=C.bind(e[n],e);return e},C.memoize=function(e,t){var n=function(r){var o=n.cache,i=""+(t?t.apply(this,arguments):r);return C.has(o,i)||(o[i]=e.apply(this,arguments)),o[i]};return n.cache={},n},C.delay=function(e,t){var n=h.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},C.defer=C.partial(C.delay,C,1),C.throttle=function(e,t,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:C.now(),a=null,i=e.apply(r,o),a||(r=o=null)};return function(){var l=C.now();s||n.leading!==!1||(s=l);var c=t-(l-s);return r=this,o=arguments,0>=c||c>t?(a&&(clearTimeout(a),a=null),s=l,i=e.apply(r,o),a||(r=o=null)):a||n.trailing===!1||(a=setTimeout(u,c)),i}},C.debounce=function(e,t,n){var r,o,i,a,s,u=function(){var l=C.now()-a;t>l&&l>=0?r=setTimeout(u,t-l):(r=null,n||(s=e.apply(i,o),r||(i=o=null)))};return function(){i=this,o=arguments,a=C.now();var l=n&&!r;return r||(r=setTimeout(u,t)),l&&(s=e.apply(i,o),i=o=null),s}},C.wrap=function(e,t){return C.partial(t,e)},C.negate=function(e){return function(){return!e.apply(this,arguments)}},C.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},C.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},C.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},C.once=C.partial(C.before,2);var I=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];C.keys=function(e){if(!C.isObject(e))return[];if(y)return y(e);var t=[];for(var n in e)C.has(e,n)&&t.push(n);return I&&s(e,t),t},C.allKeys=function(e){if(!C.isObject(e))return[];var t=[];for(var n in e)t.push(n);return I&&s(e,t),t},C.values=function(e){for(var t=C.keys(e),n=t.length,r=Array(n),o=0;n>o;o++)r[o]=e[t[o]];return r},C.mapObject=function(e,t,n){t=w(t,n);for(var r,o=C.keys(e),i=o.length,a={},s=0;i>s;s++)r=o[s],a[r]=t(e[r],r,e);return a},C.pairs=function(e){for(var t=C.keys(e),n=t.length,r=Array(n),o=0;n>o;o++)r[o]=[t[o],e[t[o]]];return r},C.invert=function(e){for(var t={},n=C.keys(e),r=0,o=n.length;o>r;r++)t[e[n[r]]]=n[r];return t},C.functions=C.methods=function(e){var t=[];for(var n in e)C.isFunction(e[n])&&t.push(n);return t.sort()},C.extend=S(C.allKeys),C.extendOwn=C.assign=S(C.keys),C.findKey=function(e,t,n){t=w(t,n);for(var r,o=C.keys(e),i=0,a=o.length;a>i;i++)if(r=o[i],t(e[r],r,e))return r},C.pick=function(e,t,n){var r,o,i={},a=e;if(null==a)return i;C.isFunction(t)?(o=C.allKeys(a),r=T(t,n)):(o=k(arguments,!1,!1,1),r=function(e,t,n){return t in n},a=Object(a));for(var s=0,u=o.length;u>s;s++){var l=o[s],c=a[l];r(c,l,a)&&(i[l]=c)}return i},C.omit=function(e,t,n){if(C.isFunction(t))t=C.negate(t);else{var r=C.map(k(arguments,!1,!1,1),String);t=function(e,t){return!C.contains(r,t)}}return C.pick(e,t,n)},C.defaults=S(C.allKeys,!0),C.create=function(e,t){var n=O(e);return t&&C.extendOwn(n,t),n},C.clone=function(e){return C.isObject(e)?C.isArray(e)?e.slice():C.extend({},e):e},C.tap=function(e,t){return t(e),e},C.isMatch=function(e,t){var n=C.keys(t),r=n.length;if(null==e)return!r;for(var o=Object(e),i=0;r>i;i++){var a=n[i];if(t[a]!==o[a]||!(a in o))return!1}return!0};var j=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof C&&(e=e._wrapped),t instanceof C&&(t=t._wrapped);var o=m.call(e);if(o!==m.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(C.isFunction(a)&&a instanceof a&&C.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!j(e[u],t[u],n,r))return!1}else{var l,c=C.keys(e);if(u=c.length,C.keys(t).length!==u)return!1;for(;u--;)if(l=c[u],!C.has(t,l)||!j(e[l],t[l],n,r))return!1}return n.pop(),r.pop(),!0};C.isEqual=function(e,t){return j(e,t)},C.isEmpty=function(e){return null==e?!0:N(e)&&(C.isArray(e)||C.isString(e)||C.isArguments(e))?0===e.length:0===C.keys(e).length},C.isElement=function(e){return!(!e||1!==e.nodeType)},C.isArray=g||function(e){return"[object Array]"===m.call(e)},C.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},C.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){C["is"+e]=function(t){return m.call(t)==="[object "+e+"]"}}),C.isArguments(arguments)||(C.isArguments=function(e){return C.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(C.isFunction=function(e){return"function"==typeof e||!1}),C.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},C.isNaN=function(e){return C.isNumber(e)&&e!==+e},C.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===m.call(e)},C.isNull=function(e){return null===e},C.isUndefined=function(e){return void 0===e},C.has=function(e,t){return null!=e&&v.call(e,t)},C.noConflict=function(){return u._=l,this},C.identity=function(e){return e},C.constant=function(e){return function(){return e}},C.noop=function(){},C.property=x,C.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},C.matcher=C.matches=function(e){return e=C.extendOwn({},e),function(t){return C.isMatch(t,e)}},C.times=function(e,t,n){var r=Array(Math.max(0,e));t=T(t,n,1);for(var o=0;e>o;o++)r[o]=t(o);return r},C.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},C.now=Date.now||function(){return(new Date).getTime()};var L={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},F=C.invert(L),H=function(e){var t=function(t){return e[t]},n="(?:"+C.keys(e).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(o,t):e}};C.escape=H(L),C.unescape=H(F),C.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),C.isFunction(r)?r.call(e):r};var U=0;C.uniqueId=function(e){var t=++U+"";return e?e+t:t},C.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,q=function(e){return"\\"+V[e]};C.template=function(e,t,n){!t&&n&&(t=n),t=C.defaults({},t,C.templateSettings);var r=RegExp([(t.escape||B).source,(t.interpolate||B).source,(t.evaluate||B).source].join("|")+"|$","g"),o=0,i="__p+='";e.replace(r,function(t,n,r,a,s){return i+=e.slice(o,s).replace(W,q),o=s+t.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(s){throw s.source=i,s}var u=function(e){return a.call(this,e,C)},l=t.variable||"obj";return u.source="function("+l+"){\n"+i+"}",u},C.chain=function(e){var t=C(e);return t._chain=!0,t};var z=function(e,t){return e._chain?C(t).chain():t};C.mixin=function(e){C.each(C.functions(e),function(t){var n=C[t]=e[t];C.prototype[t]=function(){var e=[this._wrapped];return d.apply(e,arguments),z(this,n.apply(C,e))}})},C.mixin(C),C.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=c[e];C.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],z(this,n)}}),C.each(["concat","join","slice"],function(e){var t=c[e];C.prototype[e]=function(){return z(this,t.apply(this._wrapped,arguments))}}),C.prototype.value=function(){return this._wrapped},C.prototype.valueOf=C.prototype.toJSON=C.prototype.value,C.prototype.toString=function(){return""+this._wrapped},r=[],o=function(){return C}.apply(t,r),!(void 0!==o&&(e.exports=o))}).call(this)},function(e,t,n){var r;(function(e,o){!function(i){function a(e){throw RangeError(k[e])}function s(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function u(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(M,".");var o=e.split("."),i=s(o,t).join(".");return r+i}function l(e){for(var t,n,r=[],o=0,i=e.length;i>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&i>o?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function c(e){return s(e,function(e){var t="";return e>65535&&(e-=65536,t+=A(e>>>10&1023|55296),e=56320|1023&e),t+=A(e)}).join("")}function p(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:E}function f(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function d(e,t,n){var r=0;for(e=n?I(e/S):e>>1,e+=I(e/t);e>R*T>>1;r+=E)e=I(e/R);return I(r+(R+1)*e/(e+w))}function h(e){var t,n,r,o,i,s,u,l,f,h,m=[],v=e.length,g=0,y=x,b=O;for(n=e.lastIndexOf(P),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&a("not-basic"),m.push(e.charCodeAt(r));for(o=n>0?n+1:0;v>o;){for(i=g,s=1,u=E;o>=v&&a("invalid-input"),l=p(e.charCodeAt(o++)),(l>=E||l>I((_-g)/s))&&a("overflow"),g+=l*s,f=b>=u?C:u>=b+T?T:u-b,!(f>l);u+=E)h=E-f,s>I(_/h)&&a("overflow"),s*=h;t=m.length+1,b=d(g-i,t,0==i),I(g/t)>_-y&&a("overflow"),y+=I(g/t),g%=t,m.splice(g++,0,y)}return c(m)}function m(e){var t,n,r,o,i,s,u,c,p,h,m,v,g,y,b,w=[];for(e=l(e),v=e.length,t=x,n=0,i=O,s=0;v>s;++s)m=e[s],128>m&&w.push(A(m));for(r=o=w.length,o&&w.push(P);v>r;){for(u=_,s=0;v>s;++s)m=e[s],m>=t&&u>m&&(u=m);for(g=r+1,u-t>I((_-n)/g)&&a("overflow"),n+=(u-t)*g,t=u,s=0;v>s;++s)if(m=e[s],t>m&&++n>_&&a("overflow"),m==t){for(c=n,p=E;h=i>=p?C:p>=i+T?T:p-i,!(h>c);p+=E)b=c-h,y=E-h,w.push(A(f(h+b%y,0))),c=I(b/y);w.push(A(f(c,0))),i=d(n,g,r==o),n=0,++r}++n,++t}return w.join("")}function v(e){return u(e,function(e){return D.test(e)?h(e.slice(4).toLowerCase()):e})}function g(e){return u(e,function(e){return N.test(e)?"xn--"+m(e):e})}var y=("object"==typeof t&&t&&!t.nodeType&&t,"object"==typeof e&&e&&!e.nodeType&&e,"object"==typeof o&&o);(y.global===y||y.window===y||y.self===y)&&(i=y);var b,_=2147483647,E=36,C=1,T=26,w=38,S=700,O=72,x=128,P="-",D=/^xn--/,N=/[^\x20-\x7E]/,M=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=E-C,I=Math.floor,A=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:l,encode:c},decode:h,encode:m,toASCII:g,toUnicode:v},r=function(){return b}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}(this)}).call(t,n(269)(e),function(){return this}())},function(e,t){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var s=1e3;o&&"number"==typeof o.maxKeys&&(s=o.maxKeys);var u=e.length;s>0&&u>s&&(u=s);for(var l=0;u>l;++l){var c,p,f,d,h=e[l].replace(a,"%20"),m=h.indexOf(r);m>=0?(c=h.substr(0,m),p=h.substr(m+1)):(c=h,p=""),f=decodeURIComponent(c),d=decodeURIComponent(p),n(i,f)?Array.isArray(i[f])?i[f].push(d):i[f]=[i[f],d]:i[f]=d}return i}},function(e,t){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,o){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(o){var i=encodeURIComponent(n(o))+r;return Array.isArray(e[o])?e[o].map(function(e){return i+encodeURIComponent(n(e))}).join(t):i+encodeURIComponent(n(e[o]))}).join(t):o?encodeURIComponent(n(o))+r+encodeURIComponent(n(e)):""}},function(e,t,n){"use strict";t.decode=t.parse=n(613),t.encode=t.stringify=n(614)},function(e,t,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(e,t,n){if(e&&l(e)&&e instanceof r)return e;var o=new r;return o.parse(e,t,n),o}function i(e){return u(e)&&(e=o(e)),e instanceof r?e.format():r.prototype.format.call(e)}function a(e,t){return o(e,!1,!0).resolve(t)}function s(e,t){return e?o(e,!1,!0).resolveObject(t):t}function u(e){return"string"==typeof e}function l(e){return"object"==typeof e&&null!==e}function c(e){return null===e}function p(e){return null==e}var f=n(612);t.parse=o,t.resolve=a,t.resolveObject=s,t.format=i,t.Url=r;var d=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,m=["<",">",'"',"`"," ","\r","\n"," "],v=["{","}","|","\\","^","`"].concat(m),g=["'"].concat(v),y=["%","/","?",";","#"].concat(g),b=["/","?","#"],_=255,E=/^[a-z0-9A-Z_-]{0,63}$/,C=/^([a-z0-9A-Z_-]{0,63})(.*)$/,T={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=n(615);r.prototype.parse=function(e,t,n){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var o=d.exec(r);if(o){o=o[0];var i=o.toLowerCase();this.protocol=i,r=r.substr(o.length)}if(n||o||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var a="//"===r.substr(0,2);!a||o&&w[o]||(r=r.substr(2),this.slashes=!0)}if(!w[o]&&(a||o&&!S[o])){for(var s=-1,l=0;l<b.length;l++){var c=r.indexOf(b[l]);-1!==c&&(-1===s||s>c)&&(s=c)}var p,h;h=-1===s?r.lastIndexOf("@"):r.lastIndexOf("@",s),-1!==h&&(p=r.slice(0,h),r=r.slice(h+1),this.auth=decodeURIComponent(p)),s=-1;for(var l=0;l<y.length;l++){var c=r.indexOf(y[l]);-1!==c&&(-1===s||s>c)&&(s=c)}-1===s&&(s=r.length),this.host=r.slice(0,s),r=r.slice(s),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var v=this.hostname.split(/\./),l=0,x=v.length;x>l;l++){var P=v[l];if(P&&!P.match(E)){for(var D="",N=0,M=P.length;M>N;N++)D+=P.charCodeAt(N)>127?"x":P[N];if(!D.match(E)){var k=v.slice(0,l),R=v.slice(l+1),I=P.match(C);I&&(k.push(I[1]),R.unshift(I[2])),R.length&&(r="/"+R.join(".")+r),this.hostname=k.join(".");break}}}if(this.hostname.length>_?this.hostname="":this.hostname=this.hostname.toLowerCase(),!m){for(var A=this.hostname.split("."),j=[],l=0;l<A.length;++l){var L=A[l];j.push(L.match(/[^A-Za-z0-9_-]/)?"xn--"+f.encode(L):L)}this.hostname=j.join(".")}var F=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+F,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!T[i])for(var l=0,x=g.length;x>l;l++){var U=g[l],B=encodeURIComponent(U);B===U&&(B=escape(U)),r=r.split(U).join(B)}var V=r.indexOf("#");-1!==V&&(this.hash=r.substr(V),r=r.slice(0,V));var W=r.indexOf("?");if(-1!==W?(this.search=r.substr(W),this.query=r.substr(W+1),t&&(this.query=O.parse(this.query)),r=r.slice(0,W)):t&&(this.search="",this.query={}),r&&(this.pathname=r),S[i]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",L=this.search||"";this.path=F+L}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&l(this.query)&&Object.keys(this.query).length&&(i=O.stringify(this.query));var a=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||S[t])&&o!==!1?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+o+n+a+r},r.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(u(e)){var t=new r;t.parse(e,!1,!0),e=t}var n=new r;if(Object.keys(this).forEach(function(e){n[e]=this[e]},this),n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(n[t]=e[t])}),S[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(e.protocol&&e.protocol!==n.protocol){if(!S[e.protocol])return Object.keys(e).forEach(function(t){n[t]=e[t]}),n.href=n.format(),n;if(n.protocol=e.protocol,e.host||w[e.protocol])n.pathname=e.pathname;else{for(var o=(e.pathname||"").split("/");o.length&&!(e.host=o.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==o[0]&&o.unshift(""),o.length<2&&o.unshift(""),n.pathname=o.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var i=n.pathname||"",a=n.search||"";n.path=i+a}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var s=n.pathname&&"/"===n.pathname.charAt(0),l=e.host||e.pathname&&"/"===e.pathname.charAt(0),f=l||s||n.host&&e.pathname,d=f,h=n.pathname&&n.pathname.split("/")||[],o=e.pathname&&e.pathname.split("/")||[],m=n.protocol&&!S[n.protocol];if(m&&(n.hostname="",n.port=null,n.host&&(""===h[0]?h[0]=n.host:h.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===o[0]?o[0]=e.host:o.unshift(e.host)),e.host=null),f=f&&(""===o[0]||""===h[0])),l)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,h=o;else if(o.length)h||(h=[]),h.pop(),h=h.concat(o),n.search=e.search,n.query=e.query;else if(!p(e.search)){if(m){n.hostname=n.host=h.shift();var v=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;v&&(n.auth=v.shift(),n.host=n.hostname=v.shift())}return n.search=e.search,n.query=e.query,c(n.pathname)&&c(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!h.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var g=h.slice(-1)[0],y=(n.host||e.host)&&("."===g||".."===g)||""===g,b=0,_=h.length;_>=0;_--)g=h[_],"."==g?h.splice(_,1):".."===g?(h.splice(_,1),b++):b&&(h.splice(_,1),b--);if(!f&&!d)for(;b--;b)h.unshift("..");!f||""===h[0]||h[0]&&"/"===h[0].charAt(0)||h.unshift(""),y&&"/"!==h.join("/").substr(-1)&&h.push("");var E=""===h[0]||h[0]&&"/"===h[0].charAt(0);if(m){n.hostname=n.host=E?"":h.length?h.shift():"";var v=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;v&&(n.auth=v.shift(),n.host=n.hostname=v.shift())}return f=f||n.host&&h.length,f&&!E&&h.unshift(""),h.length?n.pathname=h.join("/"):(n.pathname=null,n.path=null),c(n.pathname)&&c(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){e.exports=n(619)},function(e,t){!function(t){"use strict";var n=-1,r={onVisible:function(e){var t=r.isSupported();if(!t||!r.hidden())return e(),t;var n=r.change(function(t,o){r.hidden()||(r.unbind(n),e())});return n},change:function(e){if(!r.isSupported())return!1;n+=1;var t=n;return r._callbacks[t]=e,r._listen(),t},unbind:function(e){delete r._callbacks[e]},afterPrerendering:function(e){var t=r.isSupported(),n="prerender";if(!t||n!=r.state())return e(),t;var o=r.change(function(t,i){n!=i&&(r.unbind(o),e())});return o},hidden:function(){return!(!r._doc.hidden&&!r._doc.webkitHidden)},state:function(){return r._doc.visibilityState||r._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!r._doc.visibilityState&&!r._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(e){var t=r.state();for(var n in r._callbacks)r._callbacks[n].call(r._doc,e,t)},_listen:function(){if(!r._init){var e="visibilitychange";r._doc.webkitVisibilityState&&(e="webkit"+e);var t=function(){r._change.apply(r,arguments)};r._doc.addEventListener?r._doc.addEventListener(e,t):r._doc.attachEvent(e,t),r._init=!0}}};"undefined"!=typeof e&&e.exports?e.exports=r:t.Visibility=r}(this)},function(e,t,n){!function(t){"use strict";var r=-1,o=function(e){return e.every=function(t,n,o){e._time(),o||(o=n,n=null),r+=1;var i=r;return e._timers[i]={visible:t,hidden:n,callback:o},e._run(i,!1),e.isSupported()&&e._listen(),i},e.stop=function(t){return e._timers[t]?(e._stop(t),delete e._timers[t],!0):!1},e._timers={},e._time=function(){e._timed||(e._timed=!0,e._wasHidden=e.hidden(),e.change(function(){e._stopRun(),e._wasHidden=e.hidden()}))},e._run=function(n,r){var o,i=e._timers[n];if(e.hidden()){if(null===i.hidden)return;o=i.hidden}else o=i.visible;var a=function(){i.last=new Date,i.callback.call(t)};if(r){var s=new Date,u=s-i.last;o>u?i.delay=setTimeout(function(){a(),i.id=setInterval(a,o)},o-u):(a(),i.id=setInterval(a,o))}else i.id=setInterval(a,o)},e._stop=function(t){var n=e._timers[t];clearInterval(n.id),clearTimeout(n.delay),delete n.id,delete n.delay},e._stopRun=function(t){var n=e.hidden(),r=e._wasHidden;if(n&&!r||!n&&r)for(var o in e._timers)e._stop(o),e._run(o,!n)},e};"undefined"!=typeof e&&e.exports?e.exports=o(n(618)):o(t.Visibility)}(window)}]);
|
chrome/extension/newtab.js
|
aaggarwa88/AlwaysOn
|
import React from 'react'
import Root from '../../app/containers/Root';
class AlwaysOn extends React.Component {
constructor () {
super()
}
render () {
return <div>
<Root />
</div>
}
}
window.addEventListener('load', () => {
React.render(<AlwaysOn />, document.querySelector('#reactApp'));
});
|
DemoApp/lib/modal-custom/index.js
|
andyfen/react-native-UIKit
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
Modal,
StyleSheet,
SwitchIOS,
Text,
TouchableHighlight,
View,
} from 'react-native';
var Button = React.createClass({
getInitialState() {
return {
active: false,
};
},
_onHighlight() {
this.setState({active: true});
},
_onUnhighlight() {
this.setState({active: false});
},
render() {
var colorStyle = {
color: this.state.active ? '#fff' : '#000',
};
return (
<TouchableHighlight
onHideUnderlay={this._onUnhighlight}
onPress={this.props.onPress}
onShowUnderlay={this._onHighlight}
style={[styles.button, this.props.style]}
underlayColor="#a9d9d4">
<Text style={[styles.buttonText, colorStyle]}>{this.props.children}</Text>
</TouchableHighlight>
);
}
});
var ModalCustom = React.createClass({
getInitialState() {
return {
animated: true,
modalVisible: false,
transparent: false,
};
},
_setModalVisible(visible) {
this.setState({modalVisible: visible});
},
_toggleAnimated() {
this.setState({animated: !this.state.animated});
},
_toggleTransparent() {
this.setState({transparent: !this.state.transparent});
},
render() {
var modalBackgroundStyle = {
backgroundColor: this.state.transparent ? 'rgba(0, 0, 0, 0.5)' : '#f5fcff',
};
var innerContainerTransparentStyle = this.state.transparent
? {backgroundColor: '#fff', padding: 20}
: null;
return (
<View>
<Modal
animated={this.state.animated}
transparent={this.state.transparent}
visible={this.state.modalVisible}>
<View style={[styles.container, modalBackgroundStyle]}>
<View style={[styles.innerContainer, innerContainerTransparentStyle]}>
<Text>This modal was presented {this.state.animated ? 'with' : 'without'} animation.</Text>
<Button
onPress={this._setModalVisible.bind(this, false)}
style={styles.modalButton}>
Close
</Button>
</View>
</View>
</Modal>
<View style={styles.row}>
<Text style={styles.rowTitle}>Animated</Text>
<SwitchIOS value={this.state.animated} onValueChange={this._toggleAnimated} />
</View>
<View style={styles.row}>
<Text style={styles.rowTitle}>Transparent</Text>
<SwitchIOS value={this.state.transparent} onValueChange={this._toggleTransparent} />
</View>
<Button onPress={this._setModalVisible.bind(this, true)}>
Present
</Button>
</View>
);
},
});
exports.examples = [
{
title: 'Modal Presentation',
description: 'Modals can be presented with or without animation',
render: () => <ModalExample />,
},
];
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
padding: 20,
},
innerContainer: {
borderRadius: 10,
alignItems: 'center',
},
row: {
alignItems: 'center',
flex: 1,
flexDirection: 'row',
marginBottom: 20,
},
rowTitle: {
flex: 1,
fontWeight: 'bold',
},
button: {
borderRadius: 5,
flex: 1,
height: 44,
alignSelf: 'stretch',
justifyContent: 'center',
overflow: 'hidden',
},
buttonText: {
fontSize: 18,
margin: 5,
textAlign: 'center',
},
modalButton: {
marginTop: 10,
},
});
module.exports = ModalCustom;
|
src/pages/404.js
|
maciejziaja/lutech-www
|
import React from 'react';
const NotFoundPage = () => (
<div>
<h1>Page not found</h1>
<p>Route doesn't exist...</p>
</div>
);
export default NotFoundPage;
|
ajax/libs/6to5/2.6.3/browser-polyfill.js
|
TerryMooreII/cdnjs
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){require("core-js/shim");require("regenerator/runtime")},{"core-js/shim":2,"regenerator/runtime":3}],2:[function(require,module,exports){!function(returnThis,framework,undefined){"use strict";var global=returnThis(),OBJECT="Object",FUNCTION="Function",ARRAY="Array",STRING="String",NUMBER="Number",REGEXP="RegExp",DATE="Date",MAP="Map",SET="Set",WEAKMAP="WeakMap",WEAKSET="WeakSet",SYMBOL="Symbol",PROMISE="Promise",MATH="Math",ARGUMENTS="Arguments",PROTOTYPE="prototype",CONSTRUCTOR="constructor",TO_STRING="toString",TO_STRING_TAG=TO_STRING+"Tag",TO_LOCALE="toLocaleString",HAS_OWN="hasOwnProperty",FOR_EACH="forEach",ITERATOR="iterator",FF_ITERATOR="@@"+ITERATOR,PROCESS="process",CREATE_ELEMENT="createElement",Function=global[FUNCTION],Object=global[OBJECT],Array=global[ARRAY],String=global[STRING],Number=global[NUMBER],RegExp=global[REGEXP],Date=global[DATE],Map=global[MAP],Set=global[SET],WeakMap=global[WEAKMAP],WeakSet=global[WEAKSET],Symbol=global[SYMBOL],Math=global[MATH],TypeError=global.TypeError,setTimeout=global.setTimeout,setImmediate=global.setImmediate,clearImmediate=global.clearImmediate,process=global[PROCESS],nextTick=process&&process.nextTick,document=global.document,html=document&&document.documentElement,navigator=global.navigator,define=global.define,ArrayProto=Array[PROTOTYPE],ObjectProto=Object[PROTOTYPE],FunctionProto=Function[PROTOTYPE],Infinity=1/0,DOT=".";function isObject(it){return it!=null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}var isNative=ctx(/./.test,/\[native code\]\s*\}\s*$/,1);var buildIn={Undefined:1,Null:1,Array:1,String:1,Arguments:1,Function:1,Error:1,Boolean:1,Number:1,Date:1,RegExp:1},toString=ObjectProto[TO_STRING];function setToStringTag(it,tag,stat){if(it&&!has(it=stat?it:it[PROTOTYPE],SYMBOL_TAG))hidden(it,SYMBOL_TAG,tag)}function cof(it){return it==undefined?it===undefined?"Undefined":"Null":toString.call(it).slice(8,-1)}function classof(it){var klass=cof(it),tag;return klass==OBJECT&&(tag=it[SYMBOL_TAG])?has(buildIn,tag)?"~"+tag:tag:klass}var call=FunctionProto.call,apply=FunctionProto.apply,REFERENCE_GET;function part(){var length=arguments.length,args=Array(length),i=0,_=path._,holder=false;while(length>i)if((args[i]=arguments[i++])===_)holder=true;return partial(this,args,length,holder,_,false)}function partial(fn,argsPart,lengthPart,holder,_,bind,context){assertFunction(fn);return function(){var that=bind?context:this,length=arguments.length,i=0,j=0,args;if(!holder&&!length)return invoke(fn,argsPart,that);args=argsPart.slice();if(holder)for(;lengthPart>i;i++)if(args[i]===_)args[i]=arguments[j++];while(length>j)args.push(arguments[j++]);return invoke(fn,args,that)}}function ctx(fn,that,length){assertFunction(fn);if(~length&&that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}function invoke(fn,args,that){var un=that===undefined;switch(args.length|0){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}function construct(target,argumentsList){var instance=create(target[PROTOTYPE]),result=apply.call(target,instance,argumentsList);return isObject(result)?result:instance}var create=Object.create,getPrototypeOf=Object.getPrototypeOf,setPrototypeOf=Object.setPrototypeOf,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,getOwnDescriptor=Object.getOwnPropertyDescriptor,getKeys=Object.keys,getNames=Object.getOwnPropertyNames,getSymbols=Object.getOwnPropertySymbols,has=ctx(call,ObjectProto[HAS_OWN],2),ES5Object=Object;function returnIt(it){return it}function get(object,key){if(has(object,key))return object[key]}function ownKeys(it){return getSymbols?getNames(it).concat(getSymbols(it)):getNames(it)}var assign=Object.assign||function(target,source){var T=Object(assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=ES5Object(arguments[i++]),keys=getKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T};function keyOf(object,el){var O=ES5Object(object),keys=getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}function array(it){return String(it).split(",")}var push=ArrayProto.push,unshift=ArrayProto.unshift,slice=ArrayProto.slice,splice=ArrayProto.splice,indexOf=ArrayProto.indexOf,forEach=ArrayProto[FOR_EACH];function createArrayMethod(type){var isMap=type==1,isFilter=type==2,isSome=type==3,isEvery=type==4,isFindIndex=type==6,noholes=type==5||isFindIndex;return function(callbackfn){var O=Object(assertDefined(this)),that=arguments[1],self=ES5Object(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=isMap?Array(length):isFilter?[]:undefined,val,res;for(;length>index;index++)if(noholes||index in self){val=self[index];res=f(val,index,O);if(type){if(isMap)result[index]=res;else if(res)switch(type){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(isEvery)return false}}return isFindIndex?-1:isSome||isEvery?isEvery:result}}function createArrayContains(isContains){return function(el,fromIndex){var O=ES5Object(assertDefined(this)),length=toLength(O.length),index=toIndex(fromIndex,length);if(isContains&&el!=el){for(;length>index;index++)if(sameNaN(O[index]))return isContains||index}else for(;length>index;index++)if(isContains||index in O){if(O[index]===el)return isContains||index}return!isContains&&-1}}function generic(A,B){return typeof A=="function"?A:B}var MAX_SAFE_INTEGER=9007199254740991,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min,random=Math.random,trunc=Math.trunc||function(it){return(it>0?floor:ceil)(it)};function sameNaN(number){return number!=number}function toInteger(it){return isNaN(it)?0:trunc(it)}function toLength(it){return it>0?min(toInteger(it),MAX_SAFE_INTEGER):0}function toIndex(index,length){var index=toInteger(index);return index<0?max(index+length,0):min(index,length)}function createReplacer(regExp,replace,isStatic){var replacer=isObject(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}function createPointAt(toString){return function(pos){var s=String(assertDefined(this)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return toString?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?toString?s.charAt(i):a:toString?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}var REDUCE_ERROR="Reduce of empty object with no initial value";function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1)}function assertDefined(it){if(it==undefined)throw TypeError("Function called on null or undefined");return it}function assertFunction(it){assert(isFunction(it),it," is not a function!");return it}function assertObject(it){assert(isObject(it),it," is not an object!");return it}function assertInstance(it,Constructor,name){assert(it instanceof Constructor,name,": use the 'new' operator!")}function descriptor(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return defineProperty(object,key,descriptor(bitmap,value))}:simpleSet}function uid(key){return SYMBOL+"("+key+")_"+(++sid+random())[TO_STRING](36)}function getWellKnownSymbol(name,setter){return Symbol&&Symbol[name]||(setter?Symbol:safeSymbol)(SYMBOL+DOT+name)}var DESC=!!function(){try{return defineProperty({},0,ObjectProto)}catch(e){}}(),sid=0,hidden=createDefiner(1),set=Symbol?simpleSet:hidden,safeSymbol=Symbol||uid;function assignHidden(target,src){for(var key in src)hidden(target,key,src[key]);return target}var SYMBOL_ITERATOR=getWellKnownSymbol(ITERATOR),SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG),SUPPORT_FF_ITER=FF_ITERATOR in ArrayProto,ITER=safeSymbol("iter"),KEY=1,VALUE=2,Iterators={},IteratorPrototype={},NATIVE_ITERATORS=SYMBOL_ITERATOR in ArrayProto,BUGGY_ITERATORS="keys"in ArrayProto&&!("next"in[].keys());setIterator(IteratorPrototype,returnThis);function setIterator(O,value){hidden(O,SYMBOL_ITERATOR,value);SUPPORT_FF_ITER&&hidden(O,FF_ITERATOR,value)}function createIterator(Constructor,NAME,next,proto){Constructor[PROTOTYPE]=create(proto||IteratorPrototype,{next:descriptor(1,next)});setToStringTag(Constructor,NAME+" Iterator")}function defineIterator(Constructor,NAME,value,DEFAULT){var proto=Constructor[PROTOTYPE],iter=get(proto,SYMBOL_ITERATOR)||get(proto,FF_ITERATOR)||DEFAULT&&get(proto,DEFAULT)||value;if(framework){setIterator(proto,iter);if(iter!==value){var iterProto=getPrototypeOf(iter.call(new Constructor));setToStringTag(iterProto,NAME+" Iterator",true);has(proto,FF_ITERATOR)&&setIterator(iterProto,returnThis)}}Iterators[NAME]=iter;Iterators[NAME+" Iterator"]=returnThis;return iter}function defineStdIterators(Base,NAME,Constructor,next,DEFAULT,IS_SET){function createIter(kind){return function(){return new Constructor(this,kind)}}createIterator(Constructor,NAME,next);var DEF_VAL=DEFAULT==VALUE,entries=createIter(KEY+VALUE),keys=createIter(KEY),values=createIter(VALUE);if(DEF_VAL)values=defineIterator(Base,NAME,values,"values");else entries=defineIterator(Base,NAME,entries,"entries");if(DEFAULT){$define(PROTO+FORCED*BUGGY_ITERATORS,NAME,{entries:entries,keys:IS_SET?values:keys,values:values})}}function iterResult(done,value){return{value:value,done:!!done}}function isIterable(it){var O=Object(it),Symbol=global[SYMBOL],hasExt=!!(Symbol&&Symbol[ITERATOR]&&Symbol[ITERATOR]in O);return hasExt||SYMBOL_ITERATOR in O||has(Iterators,classof(O))}function getIterator(it){var Symbol=global[SYMBOL],ext=Symbol&&Symbol[ITERATOR]&&it[Symbol[ITERATOR]],getIter=ext||it[SYMBOL_ITERATOR]||Iterators[classof(it)];return assertObject(getIter.call(it))}function stepCall(fn,value,entries){return entries?invoke(fn,value):fn(value)}function forOf(iterable,entries,fn,that){var iterator=getIterator(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done)if(stepCall(f,step.value,entries)===false)return}var NODE=cof(process)==PROCESS,core={},path=framework?global:core,old=global.core,FORCED=1,GLOBAL=2,STATIC=4,PROTO=8,BIND=16,WRAP=32;function $define(type,name,source){var key,own,out,exp,isGlobal=type&GLOBAL,target=isGlobal?global:type&STATIC?global[name]:(global[name]||ObjectProto)[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&FORCED)&&target&&key in target&&(!isFunction(target[key])||isNative(target[key]));out=(own?target:source)[key];if(type&BIND&&own)exp=ctx(out,global);else if(type&WRAP&&!framework&&target[key]==out){exp=function(param){return this instanceof out?new out(param):out(param)};exp[PROTOTYPE]=out[PROTOTYPE]}else exp=type&PROTO&&isFunction(out)?ctx(call,out):out;if(exports[key]!=out)hidden(exports,key,exp);if(framework&&target&&!own){if(isGlobal)target[key]=out;else delete target[key]&&hidden(target,key,out)}}}if(typeof module!="undefined"&&module.exports)module.exports=core;if(isFunction(define)&&define.amd)define(function(){return core});if(!NODE||framework){core.noConflict=function(){global.core=old;return core};global.core=core}$define(GLOBAL+FORCED,{global:global});!function(TAG,SymbolRegistry,setter){if(!isNative(Symbol)){Symbol=function(description){assert(!(this instanceof Symbol),SYMBOL+" is not a "+CONSTRUCTOR);var tag=uid(description);setter&&defineProperty(ObjectProto,tag,{configurable:true,set:function(value){hidden(this,tag,value)}});return set(create(Symbol[PROTOTYPE]),TAG,tag)};hidden(Symbol[PROTOTYPE],TO_STRING,function(){return this[TAG]})}$define(GLOBAL+WRAP,{Symbol:Symbol});var symbolStatics={"for":function(key){return has(SymbolRegistry,key+="")?SymbolRegistry[key]:SymbolRegistry[key]=Symbol(key)},iterator:SYMBOL_ITERATOR,keyFor:part.call(keyOf,SymbolRegistry),toStringTag:SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG,true),pure:safeSymbol,set:set,useSetter:function(){setter=true},useSimple:function(){setter=false}};forEach.call(array("hasInstance,isConcatSpreadable,match,replace,search,"+"species,split,toPrimitive,unscopables"),function(it){symbolStatics[it]=getWellKnownSymbol(it)});$define(STATIC,SYMBOL,symbolStatics);setToStringTag(Symbol,SYMBOL);$define(GLOBAL,{Reflect:{ownKeys:ownKeys}})}(safeSymbol("tag"),{},true);!function(isFinite,tmp){var RangeError=global.RangeError,isInteger=Number.isInteger||function(it){return!isObject(it)&&isFinite(it)&&floor(it)===it},sign=Math.sign||function sign(it){return(it=+it)==0||it!=it?it:it<0?-1:1},pow=Math.pow,abs=Math.abs,exp=Math.exp,log=Math.log,sqrt=Math.sqrt,fcc=String.fromCharCode,at=createPointAt(true);var objectStatic={assign:assign,is:function(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}};"__proto__"in ObjectProto&&function(buggy,set){try{set=ctx(call,getOwnDescriptor(ObjectProto,"__proto__").set,2);set({},ArrayProto)}catch(e){buggy=true}objectStatic.setPrototypeOf=setPrototypeOf=setPrototypeOf||function(O,proto){assertObject(O);assert(proto===null||isObject(proto),proto,": can't set as prototype!");if(buggy)O.__proto__=proto;else set(O,proto);return O}}();$define(STATIC,OBJECT,objectStatic);function asinh(x){return!isFinite(x=+x)||x==0?x:x<0?-asinh(-x):log(x+sqrt(x*x+1))}$define(STATIC,NUMBER,{EPSILON:pow(2,-52),isFinite:function(it){return typeof it=="number"&&isFinite(it)},isInteger:isInteger,isNaN:sameNaN,isSafeInteger:function(number){return isInteger(number)&&abs(number)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER:MAX_SAFE_INTEGER,MIN_SAFE_INTEGER:-MAX_SAFE_INTEGER,parseFloat:parseFloat,parseInt:parseInt});$define(STATIC,MATH,{acosh:function(x){return x<1?NaN:log(x+sqrt(x*x-1))},asinh:asinh,atanh:function(x){return x==0?+x:log((1+ +x)/(1-x))/2},cbrt:function(x){return sign(x)*pow(abs(x),1/3)},clz32:function(x){return(x>>>=0)?32-x[TO_STRING](2).length:32},cosh:function(x){return(exp(x)+exp(-x))/2},expm1:function(x){return x==0?+x:x>-1e-6&&x<1e-6?+x+x*x/2:exp(x)-1},fround:function(x){return new Float32Array([x])[0]},hypot:function(value1,value2){var sum=0,length=arguments.length,value;while(length--){value=+arguments[length];if(value==Infinity||value==-Infinity)return Infinity;sum+=value*value}return sqrt(sum)},imul:function(x,y){var UInt16=65535,xl=UInt16&x,yl=UInt16&y;return 0|xl*yl+((UInt16&x>>>16)*yl+xl*(UInt16&y>>>16)<<16>>>0)},log1p:function(x){return x>-1e-8&&x<1e-8?x-x*x/2:log(1+ +x)},log10:function(x){return log(x)/Math.LN10},log2:function(x){return log(x)/Math.LN2},sign:sign,sinh:function(x){return x==0?+x:(exp(x)-exp(-x))/2},tanh:function(x){return isFinite(x)?x==0?+x:(exp(x)-exp(-x))/(exp(x)+exp(-x)):sign(x)},trunc:trunc});setToStringTag(Math,MATH,true);function assertNotRegExp(it){if(isObject(it)&&it instanceof RegExp)throw TypeError()}$define(STATIC,STRING,{fromCodePoint:function(){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fcc(code):fcc(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")},raw:function(callSite){var raw=ES5Object(assertDefined(callSite.raw)),len=toLength(raw.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(raw[i++]));if(i<sln)res.push(String(arguments[i]))}return res.join("")}});$define(PROTO,STRING,{codePointAt:createPointAt(false),endsWith:function(searchString){assertNotRegExp(searchString);var that=String(assertDefined(this)),endPosition=arguments[1],len=toLength(that.length),end=endPosition===undefined?len:min(toLength(endPosition),len);searchString+="";return that.slice(end-searchString.length,end)===searchString},includes:function(searchString){var position=arguments[1];assertNotRegExp(searchString);return!!~String(assertDefined(this)).indexOf(searchString,position)},repeat:function(count){var str=String(assertDefined(this)),res="",n=toInteger(count);if(0>n||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res},startsWith:function(searchString,position){assertNotRegExp(searchString);var that=String(assertDefined(this)),index=toLength(min(position,that.length));searchString+="";return that.slice(index,index+searchString.length)===searchString}});defineStdIterators(String,STRING,function(iterated){set(this,ITER,{o:String(iterated),i:0})},function(){var iter=this[ITER],O=iter.o,index=iter.i,point;if(index>=O.length)return iterResult(1);point=at.call(O,index);iter.i+=point.length;return iterResult(0,point)});$define(STATIC,ARRAY,{from:function(arrayLike){var O=Object(assertDefined(arrayLike)),result=new(generic(this,Array)),mapfn=arguments[1],that=arguments[2],mapping=mapfn!==undefined,f=mapping?ctx(mapfn,that,2):undefined,index=0,length;if(isIterable(O))for(var iter=getIterator(O),step;!(step=iter.next()).done;index++){result[index]=mapping?f(step.value,index):step.value}else for(length=toLength(O.length);length>index;index++){result[index]=mapping?f(O[index],index):O[index]}result.length=index;return result},of:function(){var index=0,length=arguments.length,result=new(generic(this,Array))(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}});$define(PROTO,ARRAY,{copyWithin:function(target,start,end){var O=Object(assertDefined(this)),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),fin=end===undefined?len:toIndex(end,len),count=min(fin-from,len-to),inc=1;if(from<to&&to<from+count){inc=-1;from=from+count-1;to=to+count-1}while(count-->0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O},fill:function(value,start,end){var O=Object(assertDefined(this)),length=toLength(O.length),index=toIndex(start,length),endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O},find:createArrayMethod(5),findIndex:createArrayMethod(6)});defineStdIterators(Array,ARRAY,function(iterated,kind){set(this,ITER,{o:ES5Object(iterated),i:0,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,index=iter.i++;if(!O||index>=O.length)return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,index);if(kind==VALUE)return iterResult(0,O[index]);return iterResult(0,[index,O[index]])},VALUE);Iterators[ARGUMENTS]=Iterators[ARRAY];setToStringTag(global.JSON,"JSON",true);if(framework){tmp[SYMBOL_TAG]=DOT;if(cof(tmp)!=DOT)hidden(ObjectProto,TO_STRING,function(){return"[object "+classof(this)+"]"});if(/./g.flags!="g")defineProperty(RegExp[PROTOTYPE],"flags",{configurable:true,get:createReplacer(/^.*\/(\w*)$/,"$1")})}}(isFinite,{});isFunction(setImmediate)&&isFunction(clearImmediate)||function(ONREADYSTATECHANGE){var postMessage=global.postMessage,addEventListener=global.addEventListener,MessageChannel=global.MessageChannel,counter=0,queue={},defer,channel,port;setImmediate=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearImmediate=function(id){delete queue[id]};function run(id){if(has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run(event.data)}if(NODE){defer=function(id){nextTick(part.call(run,id))}}else if(addEventListener&&isFunction(postMessage)&&!global.importScripts){defer=function(id){postMessage(id,"*")};addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(document&&ONREADYSTATECHANGE in document[CREATE_ELEMENT]("script")){defer=function(id){html.appendChild(document[CREATE_ELEMENT]("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run(id)}}}else{defer=function(id){setTimeout(part.call(run,id),0)}}}("onreadystatechange");$define(GLOBAL+BIND,{setImmediate:setImmediate,clearImmediate:clearImmediate});!function(Promise,test){isFunction(Promise)&&isFunction(Promise.resolve)&&Promise.resolve(test=new Promise(Function()))==test||function(asap,DEF){function isThenable(o){var then;if(isObject(o))then=o.then;return isFunction(then)?then:false}function notify(def){var chain=def.chain;chain.length&&asap(function(){var msg=def.msg,ok=def.state==1,i=0;while(chain.length>i)!function(react){var cb=ok?react.ok:react.fail,ret,then;try{if(cb){ret=cb===true?msg:cb(msg);if(ret===react.P){react.rej(TypeError(PROMISE+"-chain cycle"))}else if(then=isThenable(ret)){then.call(ret,react.res,react.rej)}else react.res(ret)}else react.rej(msg)}catch(err){react.rej(err)}}(chain[i++]);chain.length=0})}function resolve(msg){var def=this,then,wrapper;if(def.done)return;def.done=true;def=def.def||def;try{if(then=isThenable(msg)){wrapper={def:def,done:false};then.call(msg,ctx(resolve,wrapper,1),ctx(reject,wrapper,1))}else{def.msg=msg;def.state=1;notify(def)}}catch(err){reject.call(wrapper||{def:def,done:false},err)}}function reject(msg){var def=this;if(def.done)return;def.done=true;def=def.def||def;def.msg=msg;def.state=2;notify(def)}Promise=function(executor){assertFunction(executor);assertInstance(this,Promise,PROMISE);var def={chain:[],state:0,done:false,msg:undefined};hidden(this,DEF,def);try{executor(ctx(resolve,def,1),ctx(reject,def,1))}catch(err){reject.call(def,err)}};assignHidden(Promise[PROTOTYPE],{then:function(onFulfilled,onRejected){var react={ok:isFunction(onFulfilled)?onFulfilled:true,fail:isFunction(onRejected)?onRejected:false},P=react.P=new this[CONSTRUCTOR](function(resolve,reject){react.res=assertFunction(resolve);react.rej=assertFunction(reject)}),def=this[DEF];def.chain.push(react);def.state&¬ify(def);return P},"catch":function(onRejected){return this.then(undefined,onRejected)}});assignHidden(Promise,{all:function(iterable){var Promise=this,values=[];return new Promise(function(resolve,reject){forOf(iterable,false,push,values);var remaining=values.length,results=Array(remaining);if(remaining)forEach.call(values,function(promise,index){Promise.resolve(promise).then(function(value){results[index]=value;--remaining||resolve(results)},reject)});else resolve(results)})},race:function(iterable){var Promise=this;return new Promise(function(resolve,reject){forOf(iterable,false,function(promise){Promise.resolve(promise).then(resolve,reject)})})},reject:function(r){return new this(function(resolve,reject){reject(r)})},resolve:function(x){return isObject(x)&&getPrototypeOf(x)===this[PROTOTYPE]?x:new this(function(resolve,reject){resolve(x)})}})}(nextTick||setImmediate,safeSymbol("def"));setToStringTag(Promise,PROMISE);$define(GLOBAL+FORCED*!isNative(Promise),{Promise:Promise})}(global[PROMISE]);!function(){var UID=safeSymbol("uid"),DATA=safeSymbol("data"),WEAK=safeSymbol("weak"),LAST=safeSymbol("last"),FIRST=safeSymbol("first"),SIZE=DESC?safeSymbol("size"):"size",uid=0;function getCollection(C,NAME,methods,commonMethods,isMap,isWeak){var ADDER=isMap?"set":"add",proto=C&&C[PROTOTYPE],O={};function initFromIterable(that,iterable){if(iterable!=undefined)forOf(iterable,isMap,that[ADDER],that);return that}function fixSVZ(key,chain){var method=proto[key];framework&&hidden(proto,key,function(a,b){var result=method.call(this,a===0?0:a,b);return chain?this:result})}if(!isNative(C)||!(isWeak||!BUGGY_ITERATORS&&has(proto,"entries"))){C=isWeak?function(iterable){assertInstance(this,C,NAME);set(this,UID,uid++);initFromIterable(this,iterable)}:function(iterable){var that=this;assertInstance(that,C,NAME);set(that,DATA,create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);initFromIterable(that,iterable)};assignHidden(assignHidden(C[PROTOTYPE],methods),commonMethods);isWeak||defineProperty(C[PROTOTYPE],"size",{get:function(){return assertDefined(this[SIZE])}})}else{var Native=C,inst=new C,chain=inst[ADDER](isWeak?{}:-0,1),buggyZero;if(!NATIVE_ITERATORS||!C.length){C=function(iterable){assertInstance(this,C,NAME);return initFromIterable(new Native,iterable)};C[PROTOTYPE]=proto}isWeak||inst[FOR_EACH](function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixSVZ("delete");fixSVZ("has");isMap&&fixSVZ("get")}if(buggyZero||chain!==inst)fixSVZ(ADDER,true)}setToStringTag(C,NAME);O[NAME]=C;$define(GLOBAL+WRAP+FORCED*!isNative(C),O);isWeak||defineStdIterators(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!O||!(iter.l=entry=entry?entry.n:O[FIRST]))return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,entry.k);if(kind==VALUE)return iterResult(0,entry.v);return iterResult(0,[entry.k,entry.v])},isMap?KEY+VALUE:VALUE,!isMap);return C}function fastKey(it,create){if(!isObject(it))return(typeof it=="string"?"S":"P")+it;if(!has(it,UID)){if(create)hidden(it,UID,++uid);else return""}return"O"+it[UID]}function def(that,key,value){var index=fastKey(key,true),data=that[DATA],last=that[LAST],entry;if(index in data)data[index].v=value;else{entry=data[index]={k:key,v:value,p:last};if(!that[FIRST])that[FIRST]=entry;if(last)last.n=entry;that[LAST]=entry;that[SIZE]++}return that}function del(that,index){var data=that[DATA],entry=data[index],next=entry.n,prev=entry.p;delete data[index];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}var collectionMethods={clear:function(){for(var index in this[DATA])del(this,index)},"delete":function(key){var index=fastKey(key),contains=index in this[DATA];if(contains)del(this,index);return contains},forEach:function(callbackfn,that){var f=ctx(callbackfn,that,3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function(key){return fastKey(key)in this[DATA]}};Map=getCollection(Map,MAP,{get:function(key){var entry=this[DATA][fastKey(key)];return entry&&entry.v},set:function(key,value){return def(this,key===0?0:key,value)}},collectionMethods,true);Set=getCollection(Set,SET,{add:function(value){return def(this,value=value===0?0:value,value)}},collectionMethods);function setWeak(that,key,value){has(assertObject(key),WEAK)||hidden(key,WEAK,{});key[WEAK][that[UID]]=value;return that}function hasWeak(key){return isObject(key)&&has(key,WEAK)&&has(key[WEAK],this[UID])}var weakMethods={"delete":function(key){return hasWeak.call(this,key)&&delete key[WEAK][this[UID]]},has:hasWeak};WeakMap=getCollection(WeakMap,WEAKMAP,{get:function(key){if(isObject(key)&&has(key,WEAK))return key[WEAK][this[UID]]},set:function(key,value){return setWeak(this,key,value)}},weakMethods,true,true);WeakSet=getCollection(WeakSet,WEAKSET,{add:function(value){return setWeak(this,value,true)}},weakMethods,false,true)}();!function(){function Enumerate(iterated){var keys=[],key;for(key in iterated)keys.push(key);set(this,ITER,{o:iterated,a:keys,i:0})}createIterator(Enumerate,OBJECT,function(){var iter=this[ITER],keys=iter.a,key;do{if(iter.i>=keys.length)return iterResult(1)}while(!((key=keys[iter.i++])in iter.o));return iterResult(0,key)});function wrap(fn){return function(it){assertObject(it);try{return fn.apply(undefined,arguments),true}catch(e){return false}}}function reflectGet(target,propertyKey,receiver){if(receiver===undefined)receiver=target;var desc=getOwnDescriptor(assertObject(target),propertyKey),proto;if(desc)return desc.get?desc.get.call(receiver):desc.value;return isObject(proto=getPrototypeOf(target))?reflectGet(proto,propertyKey,receiver):undefined}function reflectSet(target,propertyKey,V,receiver){if(receiver===undefined)receiver=target;var desc=getOwnDescriptor(assertObject(target),propertyKey),proto;if(desc){if(desc.writable===false)return false;if(desc.set)return desc.set.call(receiver,V),true}if(isObject(proto=getPrototypeOf(target)))return reflectSet(proto,propertyKey,V,receiver);desc=getOwnDescriptor(receiver,propertyKey)||descriptor(0);desc.value=V;return defineProperty(receiver,propertyKey,desc),true}var reflect={apply:ctx(call,apply,3),construct:construct,defineProperty:wrap(defineProperty),deleteProperty:function(target,propertyKey){var desc=getOwnDescriptor(assertObject(target),propertyKey);return desc&&!desc.configurable?false:delete target[propertyKey]},enumerate:function(target){return new Enumerate(assertObject(target))},get:reflectGet,getOwnPropertyDescriptor:getOwnDescriptor,getPrototypeOf:getPrototypeOf,has:function(target,propertyKey){return propertyKey in target},isExtensible:Object.isExtensible||function(target){return!!assertObject(target)},ownKeys:ownKeys,preventExtensions:wrap(Object.preventExtensions||returnIt),set:reflectSet};if(setPrototypeOf)reflect.setPrototypeOf=function(target,proto){return setPrototypeOf(assertObject(target),proto),true};$define(GLOBAL,{Reflect:{}});$define(STATIC,"Reflect",reflect)}();!function(){$define(PROTO,ARRAY,{includes:createArrayContains(true)});$define(PROTO,STRING,{at:createPointAt(true)});function createObjectToArray(isEntries){return function(object){var O=ES5Object(object),keys=getKeys(object),length=keys.length,i=0,result=Array(length),key;if(isEntries)while(length>i)result[i]=[key=keys[i++],O[key]];else while(length>i)result[i]=O[keys[i++]];return result}}$define(STATIC,OBJECT,{values:createObjectToArray(false),entries:createObjectToArray(true)});$define(STATIC,REGEXP,{escape:createReplacer(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",true)})}();!function(REFERENCE){REFERENCE_GET=getWellKnownSymbol(REFERENCE+"Get",true);var REFERENCE_SET=getWellKnownSymbol(REFERENCE+SET,true),REFERENCE_DELETE=getWellKnownSymbol(REFERENCE+"Delete",true);$define(STATIC,SYMBOL,{referenceGet:REFERENCE_GET,referenceSet:REFERENCE_SET,referenceDelete:REFERENCE_DELETE});hidden(FunctionProto,REFERENCE_GET,returnThis);function setMapMethods(Constructor){if(Constructor){var MapProto=Constructor[PROTOTYPE];hidden(MapProto,REFERENCE_GET,MapProto.get);hidden(MapProto,REFERENCE_SET,MapProto.set);hidden(MapProto,REFERENCE_DELETE,MapProto["delete"])}}setMapMethods(Map);setMapMethods(WeakMap)}("reference");!function(arrayStatics){function setArrayStatics(keys,length){forEach.call(array(keys),function(key){if(key in ArrayProto)arrayStatics[key]=ctx(call,ArrayProto[key],length)})}setArrayStatics("pop,reverse,shift,keys,values,entries",1);setArrayStatics("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3);setArrayStatics("join,slice,concat,push,splice,unshift,sort,lastIndexOf,"+"reduce,reduceRight,copyWithin,fill,turn");$define(STATIC,ARRAY,arrayStatics)}({})}(Function("return this"),true)},{}],3:[function(require,module,exports){!function(){var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";if(typeof regeneratorRuntime==="object"){return}var runtime=regeneratorRuntime=typeof exports==="undefined"?{}:exports;function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])
}runtime.wrap=wrap;var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype;GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName="GeneratorFunction";runtime.isGeneratorFunction=function(genFun){var ctor=typeof genFun==="function"&&genFun.constructor;return ctor?ctor===GeneratorFunction||(ctor.displayName||ctor.name)==="GeneratorFunction":false};runtime.mark=function(genFun){genFun.__proto__=GeneratorFunctionPrototype;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){try{var info=this(arg);var value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){return doneResult()}while(true){var delegate=context.delegate;if(delegate){try{var info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;var info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod){return iteratorMethod.call(iterable)}if(typeof iterable.next==="function"){return iterable}if(!isNaN(iterable.length)){var i=-1;function next(){while(++i<iterable.length){if(hasOwn.call(iterable,i)){next.value=iterable[i];next.done=false;return next}}next.value=undefined;next.done=true;return next}return next.next=next}}return{next:doneResult}}runtime.values=values;function doneResult(){return{value:undefined,done:true}}Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}()},{}]},{},[1]);
|
src/tabs/notifs/AddItemFailNotif.js
|
dash-/netjumpio-tabs-web
|
///
// Dependencies
///
import React, { Component } from 'react';
import FailRetryNotif from '../../elements/FailRetryNotif';
import * as actions from '../actions';
///
// View
///
class AddItemFailNotifView extends Component {
///
// Rendering
///
renderMessage(action, userMessage) {
return (
'Adding tab "' + action.payload.name +
'" failed. ' + userMessage
);
}
render() {
return (
<FailRetryNotif
triggeredBy={actions.ADD_ITEM_FAIL}
renderMessage={this.renderMessage}
/>
);
}
}
AddItemFailNotifView.propTypes = {};
export default AddItemFailNotifView;
|
src/Parser/RestoDruid/Modules/Features/PowerOfTheArchdruid.js
|
mwwscott0/WoWAnalyzer
|
import React from 'react';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import { formatPercentage } from 'common/format';
import SpellIcon from 'common/SpellIcon';
import SPELLS from 'common/SPELLS';
import Module from 'Parser/Core/Module';
import Combatants from 'Parser/Core/Modules/Combatants';
import Rejuvenation from './Rejuvenation';
class PowerOfTheArchdruid extends Module {
static dependencies = {
combatants: Combatants,
rejuvenation: Rejuvenation,
};
potaRejuvs = 0;
regrowths = 0;
lastPotaRemovedTimestamp = null;
lastPotaRegrowthTimestamp = null;
proccs = 0;
regrowthDirect = 0;
potaRegrowthCounter = 0;
on_initialized() {
this.active = this.combatants.selected.traitsBySpellId[SPELLS.POWER_OF_THE_ARCHDRUID.id] > 0;
}
on_byPlayer_applybuff(event) {
const spellId = event.ability.guid;
if (SPELLS.POWER_OF_THE_ARCHDRUID_BUFF.id !== spellId) {
return;
}
this.proccs += 1;
// Our 4PT19 can procc PotA
if (this.lastPotaRemovedTimestamp !== null && Math.abs(event.timestamp - this.lastPotaRemovedTimestamp) < 32) {
if (SPELLS.REJUVENATION.id === spellId) {
this.potaRejuvs = this.potaRejuvs + 2;
} else if (SPELLS.REGROWTH.id === spellId) {
this.regrowths = this.regrowths + 2;
this.lastPotaRegrowthTimestamp = event.timestamp;
}
this.lastPotaRemovedTimestamp = null;
}
}
on_byPlayer_removebuff(event) {
const spellId = event.ability.guid;
if (SPELLS.POWER_OF_THE_ARCHDRUID_BUFF.id !== spellId) {
return;
}
this.lastPotaRemovedTimestamp = event.timestamp;
}
on_byPlayer_cast(event) {
const spellId = event.ability.guid;
if (this.lastPotaRemovedTimestamp !== null && Math.abs(event.timestamp - this.lastPotaRemovedTimestamp) < 32) {
if (SPELLS.REJUVENATION.id === spellId) {
this.potaRejuvs = this.potaRejuvs + 2;
} else if (SPELLS.REGROWTH.id === spellId) {
this.regrowths = this.regrowths + 2;
this.lastPotaRegrowthTimestamp = event.timestamp;
}
this.lastPotaRemovedTimestamp = null;
}
}
on_byPlayer_heal(event) {
const spellId = event.ability.guid;
if (SPELLS.REGROWTH.id !== spellId) {
return;
}
if (this.lastPotaRegrowthTimestamp !== null) {
// Skipping the first regrowth, only taking the 2 other.
if (this.potaRegrowthCounter > 0) {
this.regrowthDirect += event.amount + (event.absorbed || 0);
}
this.potaRegrowthCounter += 1;
if (this.potaRegrowthCounter === 3) {
this.lastPotaRegrowthTimestamp = null;
this.potaRegrowthCounter = 0;
}
}
}
statistic() {
const potaHealing = (this.rejuvenation.avgRejuvHealing * this.potaRejuvs) + this.regrowthDirect;
const potaHealingPercent = this.owner.getPercentageOfTotalHealingDone(potaHealing);
return(
<StatisticBox
icon={<SpellIcon id={SPELLS.POWER_OF_THE_ARCHDRUID.id} />}
value={`${formatPercentage(potaHealingPercent)} %`}
label="Power of the Archdruid"
tooltip={`Power of the Archdruid gave you ${this.potaRejuvs} bonus rejuvenations, ${this.regrowths} bonus regrowths`}
/>
);
}
statisticOrder = STATISTIC_ORDER.CORE(20);
}
export default PowerOfTheArchdruid;
|
client/src/components/Discussion.js
|
codefordenver/Circular
|
import React, { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Well } from 'react-bootstrap';
import { fetchComments, postComment } from '../redux/actions/comments';
import Comment from './Comment';
import PostBox from './PostBox';
class Discussion extends Component {
constructor(props) {
super(props);
this.state = { error: false };
this.comments = this.props.comments;
}
componentDidMount() {
this.props.fetchComments(this.props.campaignID);
}
shouldComponentUpdate(nextProps, nextState) {
return (
nextProps.comments.commentsLoaded === true || nextProps.comments.fetchError !== undefined
);
}
componentWillUpdate(nextProps, nextState) {
if (this.props.campaignID !== nextProps.campaignID) {
nextProps.fetchComments(nextProps.campaignID);
}
}
renderMainPostBox() {
if (this.props.auth && this.props.auth._id) {
return (
<PostBox
className="main-post-box"
campaignID={this.props.campaignID}
fetchComments={this.props.fetchComments}
isAReply={false}
/>
);
}
return <Well className="login-post-box">Log in to join the discussion!</Well>;
}
renderComments() {
const comments = this.props.comments;
if (comments.commentsLoaded === true) {
return (
<div>
{Object.keys(comments.campaignComments).map(u => (
<div key={comments.campaignComments[u]._id}>
<Comment
userName={comments.campaignComments[u].userName}
message={comments.campaignComments[u].message}
dateAdded={comments.campaignComments[u].createdAt}
passedChildren={comments.campaignComments[u].children}
campaignID={this.props.campaignID}
commentID={comments.campaignComments[u]._id}
authorized={this.props.auth !== undefined && this.props.auth._id !== undefined}
/>
</div>
))}
</div>
);
}
return <div />;
}
render() {
return (
<div className="discussion">
<div className="discussion-header">COMMENTS</div>
<div className="comment-box">{this.renderComments()}</div>
<div>{this.renderMainPostBox()}</div>
</div>
);
}
}
Discussion.defaultProps = {
signatureObj: { signatures: [] },
auth: {}
};
Discussion.propTypes = {
auth: PropTypes.shape({
_id: PropTypes.string,
googleID: PropTypes.string
}),
comments: PropTypes.shape({
campaignComments: PropTypes.Object,
commentsLoaded: PropTypes.bool,
fetchError: PropTypes.Object
}).isRequired,
campaignID: PropTypes.string.isRequired,
fetchComments: PropTypes.func.isRequired
};
export default connect(
({ activeCampaign, auth, comments }) => ({ activeCampaign, auth, comments }),
{
fetchComments,
postComment
}
)(Discussion);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.