vendor.min.js 223 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294
  1. /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
  2. !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
  3. return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},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(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
  4. void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.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){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,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",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
  5. /*!
  6. * Bootstrap v3.3.6 (http://getbootstrap.com)
  7. * Copyright 2011-2015 Twitter, Inc.
  8. * Licensed under the MIT license
  9. */
  10. if (typeof jQuery === 'undefined') {
  11. throw new Error('Bootstrap\'s JavaScript requires jQuery')
  12. }
  13. +function ($) {
  14. 'use strict';
  15. var version = $.fn.jquery.split(' ')[0].split('.')
  16. if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
  17. throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
  18. }
  19. }(jQuery);
  20. /* ========================================================================
  21. * Bootstrap: transition.js v3.3.6
  22. * http://getbootstrap.com/javascript/#transitions
  23. * ========================================================================
  24. * Copyright 2011-2015 Twitter, Inc.
  25. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  26. * ======================================================================== */
  27. +function ($) {
  28. 'use strict';
  29. // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
  30. // ============================================================
  31. function transitionEnd() {
  32. var el = document.createElement('bootstrap')
  33. var transEndEventNames = {
  34. WebkitTransition : 'webkitTransitionEnd',
  35. MozTransition : 'transitionend',
  36. OTransition : 'oTransitionEnd otransitionend',
  37. transition : 'transitionend'
  38. }
  39. for (var name in transEndEventNames) {
  40. if (el.style[name] !== undefined) {
  41. return { end: transEndEventNames[name] }
  42. }
  43. }
  44. return false // explicit for ie8 ( ._.)
  45. }
  46. // http://blog.alexmaccaw.com/css-transitions
  47. $.fn.emulateTransitionEnd = function (duration) {
  48. var called = false
  49. var $el = this
  50. $(this).one('bsTransitionEnd', function () { called = true })
  51. var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
  52. setTimeout(callback, duration)
  53. return this
  54. }
  55. $(function () {
  56. $.support.transition = transitionEnd()
  57. if (!$.support.transition) return
  58. $.event.special.bsTransitionEnd = {
  59. bindType: $.support.transition.end,
  60. delegateType: $.support.transition.end,
  61. handle: function (e) {
  62. if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
  63. }
  64. }
  65. })
  66. }(jQuery);
  67. /* ========================================================================
  68. * Bootstrap: alert.js v3.3.6
  69. * http://getbootstrap.com/javascript/#alerts
  70. * ========================================================================
  71. * Copyright 2011-2015 Twitter, Inc.
  72. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  73. * ======================================================================== */
  74. +function ($) {
  75. 'use strict';
  76. // ALERT CLASS DEFINITION
  77. // ======================
  78. var dismiss = '[data-dismiss="alert"]'
  79. var Alert = function (el) {
  80. $(el).on('click', dismiss, this.close)
  81. }
  82. Alert.VERSION = '3.3.6'
  83. Alert.TRANSITION_DURATION = 150
  84. Alert.prototype.close = function (e) {
  85. var $this = $(this)
  86. var selector = $this.attr('data-target')
  87. if (!selector) {
  88. selector = $this.attr('href')
  89. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  90. }
  91. var $parent = $(selector)
  92. if (e) e.preventDefault()
  93. if (!$parent.length) {
  94. $parent = $this.closest('.alert')
  95. }
  96. $parent.trigger(e = $.Event('close.bs.alert'))
  97. if (e.isDefaultPrevented()) return
  98. $parent.removeClass('in')
  99. function removeElement() {
  100. // detach from parent, fire event then clean up data
  101. $parent.detach().trigger('closed.bs.alert').remove()
  102. }
  103. $.support.transition && $parent.hasClass('fade') ?
  104. $parent
  105. .one('bsTransitionEnd', removeElement)
  106. .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
  107. removeElement()
  108. }
  109. // ALERT PLUGIN DEFINITION
  110. // =======================
  111. function Plugin(option) {
  112. return this.each(function () {
  113. var $this = $(this)
  114. var data = $this.data('bs.alert')
  115. if (!data) $this.data('bs.alert', (data = new Alert(this)))
  116. if (typeof option == 'string') data[option].call($this)
  117. })
  118. }
  119. var old = $.fn.alert
  120. $.fn.alert = Plugin
  121. $.fn.alert.Constructor = Alert
  122. // ALERT NO CONFLICT
  123. // =================
  124. $.fn.alert.noConflict = function () {
  125. $.fn.alert = old
  126. return this
  127. }
  128. // ALERT DATA-API
  129. // ==============
  130. $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
  131. }(jQuery);
  132. /* ========================================================================
  133. * Bootstrap: button.js v3.3.6
  134. * http://getbootstrap.com/javascript/#buttons
  135. * ========================================================================
  136. * Copyright 2011-2015 Twitter, Inc.
  137. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  138. * ======================================================================== */
  139. +function ($) {
  140. 'use strict';
  141. // BUTTON PUBLIC CLASS DEFINITION
  142. // ==============================
  143. var Button = function (element, options) {
  144. this.$element = $(element)
  145. this.options = $.extend({}, Button.DEFAULTS, options)
  146. this.isLoading = false
  147. }
  148. Button.VERSION = '3.3.6'
  149. Button.DEFAULTS = {
  150. loadingText: 'loading...'
  151. }
  152. Button.prototype.setState = function (state) {
  153. var d = 'disabled'
  154. var $el = this.$element
  155. var val = $el.is('input') ? 'val' : 'html'
  156. var data = $el.data()
  157. state += 'Text'
  158. if (data.resetText == null) $el.data('resetText', $el[val]())
  159. // push to event loop to allow forms to submit
  160. setTimeout($.proxy(function () {
  161. $el[val](data[state] == null ? this.options[state] : data[state])
  162. if (state == 'loadingText') {
  163. this.isLoading = true
  164. $el.addClass(d).attr(d, d)
  165. } else if (this.isLoading) {
  166. this.isLoading = false
  167. $el.removeClass(d).removeAttr(d)
  168. }
  169. }, this), 0)
  170. }
  171. Button.prototype.toggle = function () {
  172. var changed = true
  173. var $parent = this.$element.closest('[data-toggle="buttons"]')
  174. if ($parent.length) {
  175. var $input = this.$element.find('input')
  176. if ($input.prop('type') == 'radio') {
  177. if ($input.prop('checked')) changed = false
  178. $parent.find('.active').removeClass('active')
  179. this.$element.addClass('active')
  180. } else if ($input.prop('type') == 'checkbox') {
  181. if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
  182. this.$element.toggleClass('active')
  183. }
  184. $input.prop('checked', this.$element.hasClass('active'))
  185. if (changed) $input.trigger('change')
  186. } else {
  187. this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
  188. this.$element.toggleClass('active')
  189. }
  190. }
  191. // BUTTON PLUGIN DEFINITION
  192. // ========================
  193. function Plugin(option) {
  194. return this.each(function () {
  195. var $this = $(this)
  196. var data = $this.data('bs.button')
  197. var options = typeof option == 'object' && option
  198. if (!data) $this.data('bs.button', (data = new Button(this, options)))
  199. if (option == 'toggle') data.toggle()
  200. else if (option) data.setState(option)
  201. })
  202. }
  203. var old = $.fn.button
  204. $.fn.button = Plugin
  205. $.fn.button.Constructor = Button
  206. // BUTTON NO CONFLICT
  207. // ==================
  208. $.fn.button.noConflict = function () {
  209. $.fn.button = old
  210. return this
  211. }
  212. // BUTTON DATA-API
  213. // ===============
  214. $(document)
  215. .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
  216. var $btn = $(e.target)
  217. if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
  218. Plugin.call($btn, 'toggle')
  219. if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
  220. })
  221. .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
  222. $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
  223. })
  224. }(jQuery);
  225. /* ========================================================================
  226. * Bootstrap: carousel.js v3.3.6
  227. * http://getbootstrap.com/javascript/#carousel
  228. * ========================================================================
  229. * Copyright 2011-2015 Twitter, Inc.
  230. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  231. * ======================================================================== */
  232. +function ($) {
  233. 'use strict';
  234. // CAROUSEL CLASS DEFINITION
  235. // =========================
  236. var Carousel = function (element, options) {
  237. this.$element = $(element)
  238. this.$indicators = this.$element.find('.carousel-indicators')
  239. this.options = options
  240. this.paused = null
  241. this.sliding = null
  242. this.interval = null
  243. this.$active = null
  244. this.$items = null
  245. this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
  246. this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
  247. .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
  248. .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
  249. }
  250. Carousel.VERSION = '3.3.6'
  251. Carousel.TRANSITION_DURATION = 600
  252. Carousel.DEFAULTS = {
  253. interval: 5000,
  254. pause: 'hover',
  255. wrap: true,
  256. keyboard: true
  257. }
  258. Carousel.prototype.keydown = function (e) {
  259. if (/input|textarea/i.test(e.target.tagName)) return
  260. switch (e.which) {
  261. case 37: this.prev(); break
  262. case 39: this.next(); break
  263. default: return
  264. }
  265. e.preventDefault()
  266. }
  267. Carousel.prototype.cycle = function (e) {
  268. e || (this.paused = false)
  269. this.interval && clearInterval(this.interval)
  270. this.options.interval
  271. && !this.paused
  272. && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
  273. return this
  274. }
  275. Carousel.prototype.getItemIndex = function (item) {
  276. this.$items = item.parent().children('.item')
  277. return this.$items.index(item || this.$active)
  278. }
  279. Carousel.prototype.getItemForDirection = function (direction, active) {
  280. var activeIndex = this.getItemIndex(active)
  281. var willWrap = (direction == 'prev' && activeIndex === 0)
  282. || (direction == 'next' && activeIndex == (this.$items.length - 1))
  283. if (willWrap && !this.options.wrap) return active
  284. var delta = direction == 'prev' ? -1 : 1
  285. var itemIndex = (activeIndex + delta) % this.$items.length
  286. return this.$items.eq(itemIndex)
  287. }
  288. Carousel.prototype.to = function (pos) {
  289. var that = this
  290. var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
  291. if (pos > (this.$items.length - 1) || pos < 0) return
  292. if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
  293. if (activeIndex == pos) return this.pause().cycle()
  294. return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
  295. }
  296. Carousel.prototype.pause = function (e) {
  297. e || (this.paused = true)
  298. if (this.$element.find('.next, .prev').length && $.support.transition) {
  299. this.$element.trigger($.support.transition.end)
  300. this.cycle(true)
  301. }
  302. this.interval = clearInterval(this.interval)
  303. return this
  304. }
  305. Carousel.prototype.next = function () {
  306. if (this.sliding) return
  307. return this.slide('next')
  308. }
  309. Carousel.prototype.prev = function () {
  310. if (this.sliding) return
  311. return this.slide('prev')
  312. }
  313. Carousel.prototype.slide = function (type, next) {
  314. var $active = this.$element.find('.item.active')
  315. var $next = next || this.getItemForDirection(type, $active)
  316. var isCycling = this.interval
  317. var direction = type == 'next' ? 'left' : 'right'
  318. var that = this
  319. if ($next.hasClass('active')) return (this.sliding = false)
  320. var relatedTarget = $next[0]
  321. var slideEvent = $.Event('slide.bs.carousel', {
  322. relatedTarget: relatedTarget,
  323. direction: direction
  324. })
  325. this.$element.trigger(slideEvent)
  326. if (slideEvent.isDefaultPrevented()) return
  327. this.sliding = true
  328. isCycling && this.pause()
  329. if (this.$indicators.length) {
  330. this.$indicators.find('.active').removeClass('active')
  331. var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
  332. $nextIndicator && $nextIndicator.addClass('active')
  333. }
  334. var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
  335. if ($.support.transition && this.$element.hasClass('slide')) {
  336. $next.addClass(type)
  337. $next[0].offsetWidth // force reflow
  338. $active.addClass(direction)
  339. $next.addClass(direction)
  340. $active
  341. .one('bsTransitionEnd', function () {
  342. $next.removeClass([type, direction].join(' ')).addClass('active')
  343. $active.removeClass(['active', direction].join(' '))
  344. that.sliding = false
  345. setTimeout(function () {
  346. that.$element.trigger(slidEvent)
  347. }, 0)
  348. })
  349. .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
  350. } else {
  351. $active.removeClass('active')
  352. $next.addClass('active')
  353. this.sliding = false
  354. this.$element.trigger(slidEvent)
  355. }
  356. isCycling && this.cycle()
  357. return this
  358. }
  359. // CAROUSEL PLUGIN DEFINITION
  360. // ==========================
  361. function Plugin(option) {
  362. return this.each(function () {
  363. var $this = $(this)
  364. var data = $this.data('bs.carousel')
  365. var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
  366. var action = typeof option == 'string' ? option : options.slide
  367. if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
  368. if (typeof option == 'number') data.to(option)
  369. else if (action) data[action]()
  370. else if (options.interval) data.pause().cycle()
  371. })
  372. }
  373. var old = $.fn.carousel
  374. $.fn.carousel = Plugin
  375. $.fn.carousel.Constructor = Carousel
  376. // CAROUSEL NO CONFLICT
  377. // ====================
  378. $.fn.carousel.noConflict = function () {
  379. $.fn.carousel = old
  380. return this
  381. }
  382. // CAROUSEL DATA-API
  383. // =================
  384. var clickHandler = function (e) {
  385. var href
  386. var $this = $(this)
  387. var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
  388. if (!$target.hasClass('carousel')) return
  389. var options = $.extend({}, $target.data(), $this.data())
  390. var slideIndex = $this.attr('data-slide-to')
  391. if (slideIndex) options.interval = false
  392. Plugin.call($target, options)
  393. if (slideIndex) {
  394. $target.data('bs.carousel').to(slideIndex)
  395. }
  396. e.preventDefault()
  397. }
  398. $(document)
  399. .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
  400. .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
  401. $(window).on('load', function () {
  402. $('[data-ride="carousel"]').each(function () {
  403. var $carousel = $(this)
  404. Plugin.call($carousel, $carousel.data())
  405. })
  406. })
  407. }(jQuery);
  408. /* ========================================================================
  409. * Bootstrap: collapse.js v3.3.6
  410. * http://getbootstrap.com/javascript/#collapse
  411. * ========================================================================
  412. * Copyright 2011-2015 Twitter, Inc.
  413. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  414. * ======================================================================== */
  415. +function ($) {
  416. 'use strict';
  417. // COLLAPSE PUBLIC CLASS DEFINITION
  418. // ================================
  419. var Collapse = function (element, options) {
  420. this.$element = $(element)
  421. this.options = $.extend({}, Collapse.DEFAULTS, options)
  422. this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
  423. '[data-toggle="collapse"][data-target="#' + element.id + '"]')
  424. this.transitioning = null
  425. if (this.options.parent) {
  426. this.$parent = this.getParent()
  427. } else {
  428. this.addAriaAndCollapsedClass(this.$element, this.$trigger)
  429. }
  430. if (this.options.toggle) this.toggle()
  431. }
  432. Collapse.VERSION = '3.3.6'
  433. Collapse.TRANSITION_DURATION = 350
  434. Collapse.DEFAULTS = {
  435. toggle: true
  436. }
  437. Collapse.prototype.dimension = function () {
  438. var hasWidth = this.$element.hasClass('width')
  439. return hasWidth ? 'width' : 'height'
  440. }
  441. Collapse.prototype.show = function () {
  442. if (this.transitioning || this.$element.hasClass('in')) return
  443. var activesData
  444. var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
  445. if (actives && actives.length) {
  446. activesData = actives.data('bs.collapse')
  447. if (activesData && activesData.transitioning) return
  448. }
  449. var startEvent = $.Event('show.bs.collapse')
  450. this.$element.trigger(startEvent)
  451. if (startEvent.isDefaultPrevented()) return
  452. if (actives && actives.length) {
  453. Plugin.call(actives, 'hide')
  454. activesData || actives.data('bs.collapse', null)
  455. }
  456. var dimension = this.dimension()
  457. this.$element
  458. .removeClass('collapse')
  459. .addClass('collapsing')[dimension](0)
  460. .attr('aria-expanded', true)
  461. this.$trigger
  462. .removeClass('collapsed')
  463. .attr('aria-expanded', true)
  464. this.transitioning = 1
  465. var complete = function () {
  466. this.$element
  467. .removeClass('collapsing')
  468. .addClass('collapse in')[dimension]('')
  469. this.transitioning = 0
  470. this.$element
  471. .trigger('shown.bs.collapse')
  472. }
  473. if (!$.support.transition) return complete.call(this)
  474. var scrollSize = $.camelCase(['scroll', dimension].join('-'))
  475. this.$element
  476. .one('bsTransitionEnd', $.proxy(complete, this))
  477. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
  478. }
  479. Collapse.prototype.hide = function () {
  480. if (this.transitioning || !this.$element.hasClass('in')) return
  481. var startEvent = $.Event('hide.bs.collapse')
  482. this.$element.trigger(startEvent)
  483. if (startEvent.isDefaultPrevented()) return
  484. var dimension = this.dimension()
  485. this.$element[dimension](this.$element[dimension]())[0].offsetHeight
  486. this.$element
  487. .addClass('collapsing')
  488. .removeClass('collapse in')
  489. .attr('aria-expanded', false)
  490. this.$trigger
  491. .addClass('collapsed')
  492. .attr('aria-expanded', false)
  493. this.transitioning = 1
  494. var complete = function () {
  495. this.transitioning = 0
  496. this.$element
  497. .removeClass('collapsing')
  498. .addClass('collapse')
  499. .trigger('hidden.bs.collapse')
  500. }
  501. if (!$.support.transition) return complete.call(this)
  502. this.$element
  503. [dimension](0)
  504. .one('bsTransitionEnd', $.proxy(complete, this))
  505. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
  506. }
  507. Collapse.prototype.toggle = function () {
  508. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  509. }
  510. Collapse.prototype.getParent = function () {
  511. return $(this.options.parent)
  512. .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
  513. .each($.proxy(function (i, element) {
  514. var $element = $(element)
  515. this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
  516. }, this))
  517. .end()
  518. }
  519. Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
  520. var isOpen = $element.hasClass('in')
  521. $element.attr('aria-expanded', isOpen)
  522. $trigger
  523. .toggleClass('collapsed', !isOpen)
  524. .attr('aria-expanded', isOpen)
  525. }
  526. function getTargetFromTrigger($trigger) {
  527. var href
  528. var target = $trigger.attr('data-target')
  529. || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
  530. return $(target)
  531. }
  532. // COLLAPSE PLUGIN DEFINITION
  533. // ==========================
  534. function Plugin(option) {
  535. return this.each(function () {
  536. var $this = $(this)
  537. var data = $this.data('bs.collapse')
  538. var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
  539. if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
  540. if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
  541. if (typeof option == 'string') data[option]()
  542. })
  543. }
  544. var old = $.fn.collapse
  545. $.fn.collapse = Plugin
  546. $.fn.collapse.Constructor = Collapse
  547. // COLLAPSE NO CONFLICT
  548. // ====================
  549. $.fn.collapse.noConflict = function () {
  550. $.fn.collapse = old
  551. return this
  552. }
  553. // COLLAPSE DATA-API
  554. // =================
  555. $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
  556. var $this = $(this)
  557. if (!$this.attr('data-target')) e.preventDefault()
  558. var $target = getTargetFromTrigger($this)
  559. var data = $target.data('bs.collapse')
  560. var option = data ? 'toggle' : $this.data()
  561. Plugin.call($target, option)
  562. })
  563. }(jQuery);
  564. /* ========================================================================
  565. * Bootstrap: dropdown.js v3.3.6
  566. * http://getbootstrap.com/javascript/#dropdowns
  567. * ========================================================================
  568. * Copyright 2011-2015 Twitter, Inc.
  569. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  570. * ======================================================================== */
  571. +function ($) {
  572. 'use strict';
  573. // DROPDOWN CLASS DEFINITION
  574. // =========================
  575. var backdrop = '.dropdown-backdrop'
  576. var toggle = '[data-toggle="dropdown"]'
  577. var Dropdown = function (element) {
  578. $(element).on('click.bs.dropdown', this.toggle)
  579. }
  580. Dropdown.VERSION = '3.3.6'
  581. function getParent($this) {
  582. var selector = $this.attr('data-target')
  583. if (!selector) {
  584. selector = $this.attr('href')
  585. selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  586. }
  587. var $parent = selector && $(selector)
  588. return $parent && $parent.length ? $parent : $this.parent()
  589. }
  590. function clearMenus(e) {
  591. if (e && e.which === 3) return
  592. $(backdrop).remove()
  593. $(toggle).each(function () {
  594. var $this = $(this)
  595. var $parent = getParent($this)
  596. var relatedTarget = { relatedTarget: this }
  597. if (!$parent.hasClass('open')) return
  598. if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
  599. $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
  600. if (e.isDefaultPrevented()) return
  601. $this.attr('aria-expanded', 'false')
  602. $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
  603. })
  604. }
  605. Dropdown.prototype.toggle = function (e) {
  606. var $this = $(this)
  607. if ($this.is('.disabled, :disabled')) return
  608. var $parent = getParent($this)
  609. var isActive = $parent.hasClass('open')
  610. clearMenus()
  611. if (!isActive) {
  612. if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
  613. // if mobile we use a backdrop because click events don't delegate
  614. $(document.createElement('div'))
  615. .addClass('dropdown-backdrop')
  616. .insertAfter($(this))
  617. .on('click', clearMenus)
  618. }
  619. var relatedTarget = { relatedTarget: this }
  620. $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
  621. if (e.isDefaultPrevented()) return
  622. $this
  623. .trigger('focus')
  624. .attr('aria-expanded', 'true')
  625. $parent
  626. .toggleClass('open')
  627. .trigger($.Event('shown.bs.dropdown', relatedTarget))
  628. }
  629. return false
  630. }
  631. Dropdown.prototype.keydown = function (e) {
  632. if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
  633. var $this = $(this)
  634. e.preventDefault()
  635. e.stopPropagation()
  636. if ($this.is('.disabled, :disabled')) return
  637. var $parent = getParent($this)
  638. var isActive = $parent.hasClass('open')
  639. if (!isActive && e.which != 27 || isActive && e.which == 27) {
  640. if (e.which == 27) $parent.find(toggle).trigger('focus')
  641. return $this.trigger('click')
  642. }
  643. var desc = ' li:not(.disabled):visible a'
  644. var $items = $parent.find('.dropdown-menu' + desc)
  645. if (!$items.length) return
  646. var index = $items.index(e.target)
  647. if (e.which == 38 && index > 0) index-- // up
  648. if (e.which == 40 && index < $items.length - 1) index++ // down
  649. if (!~index) index = 0
  650. $items.eq(index).trigger('focus')
  651. }
  652. // DROPDOWN PLUGIN DEFINITION
  653. // ==========================
  654. function Plugin(option) {
  655. return this.each(function () {
  656. var $this = $(this)
  657. var data = $this.data('bs.dropdown')
  658. if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
  659. if (typeof option == 'string') data[option].call($this)
  660. })
  661. }
  662. var old = $.fn.dropdown
  663. $.fn.dropdown = Plugin
  664. $.fn.dropdown.Constructor = Dropdown
  665. // DROPDOWN NO CONFLICT
  666. // ====================
  667. $.fn.dropdown.noConflict = function () {
  668. $.fn.dropdown = old
  669. return this
  670. }
  671. // APPLY TO STANDARD DROPDOWN ELEMENTS
  672. // ===================================
  673. $(document)
  674. .on('click.bs.dropdown.data-api', clearMenus)
  675. .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  676. .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
  677. .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
  678. .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
  679. }(jQuery);
  680. /* ========================================================================
  681. * Bootstrap: modal.js v3.3.6
  682. * http://getbootstrap.com/javascript/#modals
  683. * ========================================================================
  684. * Copyright 2011-2015 Twitter, Inc.
  685. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  686. * ======================================================================== */
  687. +function ($) {
  688. 'use strict';
  689. // MODAL CLASS DEFINITION
  690. // ======================
  691. var Modal = function (element, options) {
  692. this.options = options
  693. this.$body = $(document.body)
  694. this.$element = $(element)
  695. this.$dialog = this.$element.find('.modal-dialog')
  696. this.$backdrop = null
  697. this.isShown = null
  698. this.originalBodyPad = null
  699. this.scrollbarWidth = 0
  700. this.ignoreBackdropClick = false
  701. if (this.options.remote) {
  702. this.$element
  703. .find('.modal-content')
  704. .load(this.options.remote, $.proxy(function () {
  705. this.$element.trigger('loaded.bs.modal')
  706. }, this))
  707. }
  708. }
  709. Modal.VERSION = '3.3.6'
  710. Modal.TRANSITION_DURATION = 300
  711. Modal.BACKDROP_TRANSITION_DURATION = 150
  712. Modal.DEFAULTS = {
  713. backdrop: true,
  714. keyboard: true,
  715. show: true
  716. }
  717. Modal.prototype.toggle = function (_relatedTarget) {
  718. return this.isShown ? this.hide() : this.show(_relatedTarget)
  719. }
  720. Modal.prototype.show = function (_relatedTarget) {
  721. var that = this
  722. var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
  723. this.$element.trigger(e)
  724. if (this.isShown || e.isDefaultPrevented()) return
  725. this.isShown = true
  726. this.checkScrollbar()
  727. this.setScrollbar()
  728. this.$body.addClass('modal-open')
  729. this.escape()
  730. this.resize()
  731. this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
  732. this.$dialog.on('mousedown.dismiss.bs.modal', function () {
  733. that.$element.one('mouseup.dismiss.bs.modal', function (e) {
  734. if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
  735. })
  736. })
  737. this.backdrop(function () {
  738. var transition = $.support.transition && that.$element.hasClass('fade')
  739. if (!that.$element.parent().length) {
  740. that.$element.appendTo(that.$body) // don't move modals dom position
  741. }
  742. that.$element
  743. .show()
  744. .scrollTop(0)
  745. that.adjustDialog()
  746. if (transition) {
  747. that.$element[0].offsetWidth // force reflow
  748. }
  749. that.$element.addClass('in')
  750. that.enforceFocus()
  751. var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
  752. transition ?
  753. that.$dialog // wait for modal to slide in
  754. .one('bsTransitionEnd', function () {
  755. that.$element.trigger('focus').trigger(e)
  756. })
  757. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  758. that.$element.trigger('focus').trigger(e)
  759. })
  760. }
  761. Modal.prototype.hide = function (e) {
  762. if (e) e.preventDefault()
  763. e = $.Event('hide.bs.modal')
  764. this.$element.trigger(e)
  765. if (!this.isShown || e.isDefaultPrevented()) return
  766. this.isShown = false
  767. this.escape()
  768. this.resize()
  769. $(document).off('focusin.bs.modal')
  770. this.$element
  771. .removeClass('in')
  772. .off('click.dismiss.bs.modal')
  773. .off('mouseup.dismiss.bs.modal')
  774. this.$dialog.off('mousedown.dismiss.bs.modal')
  775. $.support.transition && this.$element.hasClass('fade') ?
  776. this.$element
  777. .one('bsTransitionEnd', $.proxy(this.hideModal, this))
  778. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  779. this.hideModal()
  780. }
  781. Modal.prototype.enforceFocus = function () {
  782. $(document)
  783. .off('focusin.bs.modal') // guard against infinite focus loop
  784. .on('focusin.bs.modal', $.proxy(function (e) {
  785. if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
  786. this.$element.trigger('focus')
  787. }
  788. }, this))
  789. }
  790. Modal.prototype.escape = function () {
  791. if (this.isShown && this.options.keyboard) {
  792. this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
  793. e.which == 27 && this.hide()
  794. }, this))
  795. } else if (!this.isShown) {
  796. this.$element.off('keydown.dismiss.bs.modal')
  797. }
  798. }
  799. Modal.prototype.resize = function () {
  800. if (this.isShown) {
  801. $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
  802. } else {
  803. $(window).off('resize.bs.modal')
  804. }
  805. }
  806. Modal.prototype.hideModal = function () {
  807. var that = this
  808. this.$element.hide()
  809. this.backdrop(function () {
  810. that.$body.removeClass('modal-open')
  811. that.resetAdjustments()
  812. that.resetScrollbar()
  813. that.$element.trigger('hidden.bs.modal')
  814. })
  815. }
  816. Modal.prototype.removeBackdrop = function () {
  817. this.$backdrop && this.$backdrop.remove()
  818. this.$backdrop = null
  819. }
  820. Modal.prototype.backdrop = function (callback) {
  821. var that = this
  822. var animate = this.$element.hasClass('fade') ? 'fade' : ''
  823. if (this.isShown && this.options.backdrop) {
  824. var doAnimate = $.support.transition && animate
  825. this.$backdrop = $(document.createElement('div'))
  826. .addClass('modal-backdrop ' + animate)
  827. .appendTo(this.$body)
  828. this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
  829. if (this.ignoreBackdropClick) {
  830. this.ignoreBackdropClick = false
  831. return
  832. }
  833. if (e.target !== e.currentTarget) return
  834. this.options.backdrop == 'static'
  835. ? this.$element[0].focus()
  836. : this.hide()
  837. }, this))
  838. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  839. this.$backdrop.addClass('in')
  840. if (!callback) return
  841. doAnimate ?
  842. this.$backdrop
  843. .one('bsTransitionEnd', callback)
  844. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  845. callback()
  846. } else if (!this.isShown && this.$backdrop) {
  847. this.$backdrop.removeClass('in')
  848. var callbackRemove = function () {
  849. that.removeBackdrop()
  850. callback && callback()
  851. }
  852. $.support.transition && this.$element.hasClass('fade') ?
  853. this.$backdrop
  854. .one('bsTransitionEnd', callbackRemove)
  855. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  856. callbackRemove()
  857. } else if (callback) {
  858. callback()
  859. }
  860. }
  861. // these following methods are used to handle overflowing modals
  862. Modal.prototype.handleUpdate = function () {
  863. this.adjustDialog()
  864. }
  865. Modal.prototype.adjustDialog = function () {
  866. var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
  867. this.$element.css({
  868. paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
  869. paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
  870. })
  871. }
  872. Modal.prototype.resetAdjustments = function () {
  873. this.$element.css({
  874. paddingLeft: '',
  875. paddingRight: ''
  876. })
  877. }
  878. Modal.prototype.checkScrollbar = function () {
  879. var fullWindowWidth = window.innerWidth
  880. if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
  881. var documentElementRect = document.documentElement.getBoundingClientRect()
  882. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
  883. }
  884. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
  885. this.scrollbarWidth = this.measureScrollbar()
  886. }
  887. Modal.prototype.setScrollbar = function () {
  888. var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
  889. this.originalBodyPad = document.body.style.paddingRight || ''
  890. if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
  891. }
  892. Modal.prototype.resetScrollbar = function () {
  893. this.$body.css('padding-right', this.originalBodyPad)
  894. }
  895. Modal.prototype.measureScrollbar = function () { // thx walsh
  896. var scrollDiv = document.createElement('div')
  897. scrollDiv.className = 'modal-scrollbar-measure'
  898. this.$body.append(scrollDiv)
  899. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
  900. this.$body[0].removeChild(scrollDiv)
  901. return scrollbarWidth
  902. }
  903. // MODAL PLUGIN DEFINITION
  904. // =======================
  905. function Plugin(option, _relatedTarget) {
  906. return this.each(function () {
  907. var $this = $(this)
  908. var data = $this.data('bs.modal')
  909. var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
  910. if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
  911. if (typeof option == 'string') data[option](_relatedTarget)
  912. else if (options.show) data.show(_relatedTarget)
  913. })
  914. }
  915. var old = $.fn.modal
  916. $.fn.modal = Plugin
  917. $.fn.modal.Constructor = Modal
  918. // MODAL NO CONFLICT
  919. // =================
  920. $.fn.modal.noConflict = function () {
  921. $.fn.modal = old
  922. return this
  923. }
  924. // MODAL DATA-API
  925. // ==============
  926. $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
  927. var $this = $(this)
  928. var href = $this.attr('href')
  929. var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
  930. var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
  931. if ($this.is('a')) e.preventDefault()
  932. $target.one('show.bs.modal', function (showEvent) {
  933. if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
  934. $target.one('hidden.bs.modal', function () {
  935. $this.is(':visible') && $this.trigger('focus')
  936. })
  937. })
  938. Plugin.call($target, option, this)
  939. })
  940. }(jQuery);
  941. /* ========================================================================
  942. * Bootstrap: tooltip.js v3.3.6
  943. * http://getbootstrap.com/javascript/#tooltip
  944. * Inspired by the original jQuery.tipsy by Jason Frame
  945. * ========================================================================
  946. * Copyright 2011-2015 Twitter, Inc.
  947. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  948. * ======================================================================== */
  949. +function ($) {
  950. 'use strict';
  951. // TOOLTIP PUBLIC CLASS DEFINITION
  952. // ===============================
  953. var Tooltip = function (element, options) {
  954. this.type = null
  955. this.options = null
  956. this.enabled = null
  957. this.timeout = null
  958. this.hoverState = null
  959. this.$element = null
  960. this.inState = null
  961. this.init('tooltip', element, options)
  962. }
  963. Tooltip.VERSION = '3.3.6'
  964. Tooltip.TRANSITION_DURATION = 150
  965. Tooltip.DEFAULTS = {
  966. animation: true,
  967. placement: 'top',
  968. selector: false,
  969. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  970. trigger: 'hover focus',
  971. title: '',
  972. delay: 0,
  973. html: false,
  974. container: false,
  975. viewport: {
  976. selector: 'body',
  977. padding: 0
  978. }
  979. }
  980. Tooltip.prototype.init = function (type, element, options) {
  981. this.enabled = true
  982. this.type = type
  983. this.$element = $(element)
  984. this.options = this.getOptions(options)
  985. this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
  986. this.inState = { click: false, hover: false, focus: false }
  987. if (this.$element[0] instanceof document.constructor && !this.options.selector) {
  988. throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
  989. }
  990. var triggers = this.options.trigger.split(' ')
  991. for (var i = triggers.length; i--;) {
  992. var trigger = triggers[i]
  993. if (trigger == 'click') {
  994. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  995. } else if (trigger != 'manual') {
  996. var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
  997. var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
  998. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  999. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  1000. }
  1001. }
  1002. this.options.selector ?
  1003. (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  1004. this.fixTitle()
  1005. }
  1006. Tooltip.prototype.getDefaults = function () {
  1007. return Tooltip.DEFAULTS
  1008. }
  1009. Tooltip.prototype.getOptions = function (options) {
  1010. options = $.extend({}, this.getDefaults(), this.$element.data(), options)
  1011. if (options.delay && typeof options.delay == 'number') {
  1012. options.delay = {
  1013. show: options.delay,
  1014. hide: options.delay
  1015. }
  1016. }
  1017. return options
  1018. }
  1019. Tooltip.prototype.getDelegateOptions = function () {
  1020. var options = {}
  1021. var defaults = this.getDefaults()
  1022. this._options && $.each(this._options, function (key, value) {
  1023. if (defaults[key] != value) options[key] = value
  1024. })
  1025. return options
  1026. }
  1027. Tooltip.prototype.enter = function (obj) {
  1028. var self = obj instanceof this.constructor ?
  1029. obj : $(obj.currentTarget).data('bs.' + this.type)
  1030. if (!self) {
  1031. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  1032. $(obj.currentTarget).data('bs.' + this.type, self)
  1033. }
  1034. if (obj instanceof $.Event) {
  1035. self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
  1036. }
  1037. if (self.tip().hasClass('in') || self.hoverState == 'in') {
  1038. self.hoverState = 'in'
  1039. return
  1040. }
  1041. clearTimeout(self.timeout)
  1042. self.hoverState = 'in'
  1043. if (!self.options.delay || !self.options.delay.show) return self.show()
  1044. self.timeout = setTimeout(function () {
  1045. if (self.hoverState == 'in') self.show()
  1046. }, self.options.delay.show)
  1047. }
  1048. Tooltip.prototype.isInStateTrue = function () {
  1049. for (var key in this.inState) {
  1050. if (this.inState[key]) return true
  1051. }
  1052. return false
  1053. }
  1054. Tooltip.prototype.leave = function (obj) {
  1055. var self = obj instanceof this.constructor ?
  1056. obj : $(obj.currentTarget).data('bs.' + this.type)
  1057. if (!self) {
  1058. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  1059. $(obj.currentTarget).data('bs.' + this.type, self)
  1060. }
  1061. if (obj instanceof $.Event) {
  1062. self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
  1063. }
  1064. if (self.isInStateTrue()) return
  1065. clearTimeout(self.timeout)
  1066. self.hoverState = 'out'
  1067. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  1068. self.timeout = setTimeout(function () {
  1069. if (self.hoverState == 'out') self.hide()
  1070. }, self.options.delay.hide)
  1071. }
  1072. Tooltip.prototype.show = function () {
  1073. var e = $.Event('show.bs.' + this.type)
  1074. if (this.hasContent() && this.enabled) {
  1075. this.$element.trigger(e)
  1076. var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
  1077. if (e.isDefaultPrevented() || !inDom) return
  1078. var that = this
  1079. var $tip = this.tip()
  1080. var tipId = this.getUID(this.type)
  1081. this.setContent()
  1082. $tip.attr('id', tipId)
  1083. this.$element.attr('aria-describedby', tipId)
  1084. if (this.options.animation) $tip.addClass('fade')
  1085. var placement = typeof this.options.placement == 'function' ?
  1086. this.options.placement.call(this, $tip[0], this.$element[0]) :
  1087. this.options.placement
  1088. var autoToken = /\s?auto?\s?/i
  1089. var autoPlace = autoToken.test(placement)
  1090. if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
  1091. $tip
  1092. .detach()
  1093. .css({ top: 0, left: 0, display: 'block' })
  1094. .addClass(placement)
  1095. .data('bs.' + this.type, this)
  1096. this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
  1097. this.$element.trigger('inserted.bs.' + this.type)
  1098. var pos = this.getPosition()
  1099. var actualWidth = $tip[0].offsetWidth
  1100. var actualHeight = $tip[0].offsetHeight
  1101. if (autoPlace) {
  1102. var orgPlacement = placement
  1103. var viewportDim = this.getPosition(this.$viewport)
  1104. placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
  1105. placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
  1106. placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
  1107. placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
  1108. placement
  1109. $tip
  1110. .removeClass(orgPlacement)
  1111. .addClass(placement)
  1112. }
  1113. var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
  1114. this.applyPlacement(calculatedOffset, placement)
  1115. var complete = function () {
  1116. var prevHoverState = that.hoverState
  1117. that.$element.trigger('shown.bs.' + that.type)
  1118. that.hoverState = null
  1119. if (prevHoverState == 'out') that.leave(that)
  1120. }
  1121. $.support.transition && this.$tip.hasClass('fade') ?
  1122. $tip
  1123. .one('bsTransitionEnd', complete)
  1124. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  1125. complete()
  1126. }
  1127. }
  1128. Tooltip.prototype.applyPlacement = function (offset, placement) {
  1129. var $tip = this.tip()
  1130. var width = $tip[0].offsetWidth
  1131. var height = $tip[0].offsetHeight
  1132. // manually read margins because getBoundingClientRect includes difference
  1133. var marginTop = parseInt($tip.css('margin-top'), 10)
  1134. var marginLeft = parseInt($tip.css('margin-left'), 10)
  1135. // we must check for NaN for ie 8/9
  1136. if (isNaN(marginTop)) marginTop = 0
  1137. if (isNaN(marginLeft)) marginLeft = 0
  1138. offset.top += marginTop
  1139. offset.left += marginLeft
  1140. // $.fn.offset doesn't round pixel values
  1141. // so we use setOffset directly with our own function B-0
  1142. $.offset.setOffset($tip[0], $.extend({
  1143. using: function (props) {
  1144. $tip.css({
  1145. top: Math.round(props.top),
  1146. left: Math.round(props.left)
  1147. })
  1148. }
  1149. }, offset), 0)
  1150. $tip.addClass('in')
  1151. // check to see if placing tip in new offset caused the tip to resize itself
  1152. var actualWidth = $tip[0].offsetWidth
  1153. var actualHeight = $tip[0].offsetHeight
  1154. if (placement == 'top' && actualHeight != height) {
  1155. offset.top = offset.top + height - actualHeight
  1156. }
  1157. var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
  1158. if (delta.left) offset.left += delta.left
  1159. else offset.top += delta.top
  1160. var isVertical = /top|bottom/.test(placement)
  1161. var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
  1162. var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
  1163. $tip.offset(offset)
  1164. this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
  1165. }
  1166. Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
  1167. this.arrow()
  1168. .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
  1169. .css(isVertical ? 'top' : 'left', '')
  1170. }
  1171. Tooltip.prototype.setContent = function () {
  1172. var $tip = this.tip()
  1173. var title = this.getTitle()
  1174. $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
  1175. $tip.removeClass('fade in top bottom left right')
  1176. }
  1177. Tooltip.prototype.hide = function (callback) {
  1178. var that = this
  1179. var $tip = $(this.$tip)
  1180. var e = $.Event('hide.bs.' + this.type)
  1181. function complete() {
  1182. if (that.hoverState != 'in') $tip.detach()
  1183. that.$element
  1184. .removeAttr('aria-describedby')
  1185. .trigger('hidden.bs.' + that.type)
  1186. callback && callback()
  1187. }
  1188. this.$element.trigger(e)
  1189. if (e.isDefaultPrevented()) return
  1190. $tip.removeClass('in')
  1191. $.support.transition && $tip.hasClass('fade') ?
  1192. $tip
  1193. .one('bsTransitionEnd', complete)
  1194. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  1195. complete()
  1196. this.hoverState = null
  1197. return this
  1198. }
  1199. Tooltip.prototype.fixTitle = function () {
  1200. var $e = this.$element
  1201. if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
  1202. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
  1203. }
  1204. }
  1205. Tooltip.prototype.hasContent = function () {
  1206. return this.getTitle()
  1207. }
  1208. Tooltip.prototype.getPosition = function ($element) {
  1209. $element = $element || this.$element
  1210. var el = $element[0]
  1211. var isBody = el.tagName == 'BODY'
  1212. var elRect = el.getBoundingClientRect()
  1213. if (elRect.width == null) {
  1214. // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
  1215. elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
  1216. }
  1217. var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
  1218. var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
  1219. var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
  1220. return $.extend({}, elRect, scroll, outerDims, elOffset)
  1221. }
  1222. Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
  1223. return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  1224. placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  1225. placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
  1226. /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
  1227. }
  1228. Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
  1229. var delta = { top: 0, left: 0 }
  1230. if (!this.$viewport) return delta
  1231. var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
  1232. var viewportDimensions = this.getPosition(this.$viewport)
  1233. if (/right|left/.test(placement)) {
  1234. var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
  1235. var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
  1236. if (topEdgeOffset < viewportDimensions.top) { // top overflow
  1237. delta.top = viewportDimensions.top - topEdgeOffset
  1238. } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
  1239. delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
  1240. }
  1241. } else {
  1242. var leftEdgeOffset = pos.left - viewportPadding
  1243. var rightEdgeOffset = pos.left + viewportPadding + actualWidth
  1244. if (leftEdgeOffset < viewportDimensions.left) { // left overflow
  1245. delta.left = viewportDimensions.left - leftEdgeOffset
  1246. } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
  1247. delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
  1248. }
  1249. }
  1250. return delta
  1251. }
  1252. Tooltip.prototype.getTitle = function () {
  1253. var title
  1254. var $e = this.$element
  1255. var o = this.options
  1256. title = $e.attr('data-original-title')
  1257. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  1258. return title
  1259. }
  1260. Tooltip.prototype.getUID = function (prefix) {
  1261. do prefix += ~~(Math.random() * 1000000)
  1262. while (document.getElementById(prefix))
  1263. return prefix
  1264. }
  1265. Tooltip.prototype.tip = function () {
  1266. if (!this.$tip) {
  1267. this.$tip = $(this.options.template)
  1268. if (this.$tip.length != 1) {
  1269. throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
  1270. }
  1271. }
  1272. return this.$tip
  1273. }
  1274. Tooltip.prototype.arrow = function () {
  1275. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  1276. }
  1277. Tooltip.prototype.enable = function () {
  1278. this.enabled = true
  1279. }
  1280. Tooltip.prototype.disable = function () {
  1281. this.enabled = false
  1282. }
  1283. Tooltip.prototype.toggleEnabled = function () {
  1284. this.enabled = !this.enabled
  1285. }
  1286. Tooltip.prototype.toggle = function (e) {
  1287. var self = this
  1288. if (e) {
  1289. self = $(e.currentTarget).data('bs.' + this.type)
  1290. if (!self) {
  1291. self = new this.constructor(e.currentTarget, this.getDelegateOptions())
  1292. $(e.currentTarget).data('bs.' + this.type, self)
  1293. }
  1294. }
  1295. if (e) {
  1296. self.inState.click = !self.inState.click
  1297. if (self.isInStateTrue()) self.enter(self)
  1298. else self.leave(self)
  1299. } else {
  1300. self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
  1301. }
  1302. }
  1303. Tooltip.prototype.destroy = function () {
  1304. var that = this
  1305. clearTimeout(this.timeout)
  1306. this.hide(function () {
  1307. that.$element.off('.' + that.type).removeData('bs.' + that.type)
  1308. if (that.$tip) {
  1309. that.$tip.detach()
  1310. }
  1311. that.$tip = null
  1312. that.$arrow = null
  1313. that.$viewport = null
  1314. })
  1315. }
  1316. // TOOLTIP PLUGIN DEFINITION
  1317. // =========================
  1318. function Plugin(option) {
  1319. return this.each(function () {
  1320. var $this = $(this)
  1321. var data = $this.data('bs.tooltip')
  1322. var options = typeof option == 'object' && option
  1323. if (!data && /destroy|hide/.test(option)) return
  1324. if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
  1325. if (typeof option == 'string') data[option]()
  1326. })
  1327. }
  1328. var old = $.fn.tooltip
  1329. $.fn.tooltip = Plugin
  1330. $.fn.tooltip.Constructor = Tooltip
  1331. // TOOLTIP NO CONFLICT
  1332. // ===================
  1333. $.fn.tooltip.noConflict = function () {
  1334. $.fn.tooltip = old
  1335. return this
  1336. }
  1337. }(jQuery);
  1338. /* ========================================================================
  1339. * Bootstrap: popover.js v3.3.6
  1340. * http://getbootstrap.com/javascript/#popovers
  1341. * ========================================================================
  1342. * Copyright 2011-2015 Twitter, Inc.
  1343. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1344. * ======================================================================== */
  1345. +function ($) {
  1346. 'use strict';
  1347. // POPOVER PUBLIC CLASS DEFINITION
  1348. // ===============================
  1349. var Popover = function (element, options) {
  1350. this.init('popover', element, options)
  1351. }
  1352. if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
  1353. Popover.VERSION = '3.3.6'
  1354. Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
  1355. placement: 'right',
  1356. trigger: 'click',
  1357. content: '',
  1358. template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  1359. })
  1360. // NOTE: POPOVER EXTENDS tooltip.js
  1361. // ================================
  1362. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
  1363. Popover.prototype.constructor = Popover
  1364. Popover.prototype.getDefaults = function () {
  1365. return Popover.DEFAULTS
  1366. }
  1367. Popover.prototype.setContent = function () {
  1368. var $tip = this.tip()
  1369. var title = this.getTitle()
  1370. var content = this.getContent()
  1371. $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
  1372. $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
  1373. this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
  1374. ](content)
  1375. $tip.removeClass('fade top bottom left right in')
  1376. // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
  1377. // this manually by checking the contents.
  1378. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
  1379. }
  1380. Popover.prototype.hasContent = function () {
  1381. return this.getTitle() || this.getContent()
  1382. }
  1383. Popover.prototype.getContent = function () {
  1384. var $e = this.$element
  1385. var o = this.options
  1386. return $e.attr('data-content')
  1387. || (typeof o.content == 'function' ?
  1388. o.content.call($e[0]) :
  1389. o.content)
  1390. }
  1391. Popover.prototype.arrow = function () {
  1392. return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
  1393. }
  1394. // POPOVER PLUGIN DEFINITION
  1395. // =========================
  1396. function Plugin(option) {
  1397. return this.each(function () {
  1398. var $this = $(this)
  1399. var data = $this.data('bs.popover')
  1400. var options = typeof option == 'object' && option
  1401. if (!data && /destroy|hide/.test(option)) return
  1402. if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
  1403. if (typeof option == 'string') data[option]()
  1404. })
  1405. }
  1406. var old = $.fn.popover
  1407. $.fn.popover = Plugin
  1408. $.fn.popover.Constructor = Popover
  1409. // POPOVER NO CONFLICT
  1410. // ===================
  1411. $.fn.popover.noConflict = function () {
  1412. $.fn.popover = old
  1413. return this
  1414. }
  1415. }(jQuery);
  1416. /* ========================================================================
  1417. * Bootstrap: scrollspy.js v3.3.6
  1418. * http://getbootstrap.com/javascript/#scrollspy
  1419. * ========================================================================
  1420. * Copyright 2011-2015 Twitter, Inc.
  1421. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1422. * ======================================================================== */
  1423. +function ($) {
  1424. 'use strict';
  1425. // SCROLLSPY CLASS DEFINITION
  1426. // ==========================
  1427. function ScrollSpy(element, options) {
  1428. this.$body = $(document.body)
  1429. this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
  1430. this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
  1431. this.selector = (this.options.target || '') + ' .nav li > a'
  1432. this.offsets = []
  1433. this.targets = []
  1434. this.activeTarget = null
  1435. this.scrollHeight = 0
  1436. this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
  1437. this.refresh()
  1438. this.process()
  1439. }
  1440. ScrollSpy.VERSION = '3.3.6'
  1441. ScrollSpy.DEFAULTS = {
  1442. offset: 10
  1443. }
  1444. ScrollSpy.prototype.getScrollHeight = function () {
  1445. return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
  1446. }
  1447. ScrollSpy.prototype.refresh = function () {
  1448. var that = this
  1449. var offsetMethod = 'offset'
  1450. var offsetBase = 0
  1451. this.offsets = []
  1452. this.targets = []
  1453. this.scrollHeight = this.getScrollHeight()
  1454. if (!$.isWindow(this.$scrollElement[0])) {
  1455. offsetMethod = 'position'
  1456. offsetBase = this.$scrollElement.scrollTop()
  1457. }
  1458. this.$body
  1459. .find(this.selector)
  1460. .map(function () {
  1461. var $el = $(this)
  1462. var href = $el.data('target') || $el.attr('href')
  1463. var $href = /^#./.test(href) && $(href)
  1464. return ($href
  1465. && $href.length
  1466. && $href.is(':visible')
  1467. && [[$href[offsetMethod]().top + offsetBase, href]]) || null
  1468. })
  1469. .sort(function (a, b) { return a[0] - b[0] })
  1470. .each(function () {
  1471. that.offsets.push(this[0])
  1472. that.targets.push(this[1])
  1473. })
  1474. }
  1475. ScrollSpy.prototype.process = function () {
  1476. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  1477. var scrollHeight = this.getScrollHeight()
  1478. var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
  1479. var offsets = this.offsets
  1480. var targets = this.targets
  1481. var activeTarget = this.activeTarget
  1482. var i
  1483. if (this.scrollHeight != scrollHeight) {
  1484. this.refresh()
  1485. }
  1486. if (scrollTop >= maxScroll) {
  1487. return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
  1488. }
  1489. if (activeTarget && scrollTop < offsets[0]) {
  1490. this.activeTarget = null
  1491. return this.clear()
  1492. }
  1493. for (i = offsets.length; i--;) {
  1494. activeTarget != targets[i]
  1495. && scrollTop >= offsets[i]
  1496. && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
  1497. && this.activate(targets[i])
  1498. }
  1499. }
  1500. ScrollSpy.prototype.activate = function (target) {
  1501. this.activeTarget = target
  1502. this.clear()
  1503. var selector = this.selector +
  1504. '[data-target="' + target + '"],' +
  1505. this.selector + '[href="' + target + '"]'
  1506. var active = $(selector)
  1507. .parents('li')
  1508. .addClass('active')
  1509. if (active.parent('.dropdown-menu').length) {
  1510. active = active
  1511. .closest('li.dropdown')
  1512. .addClass('active')
  1513. }
  1514. active.trigger('activate.bs.scrollspy')
  1515. }
  1516. ScrollSpy.prototype.clear = function () {
  1517. $(this.selector)
  1518. .parentsUntil(this.options.target, '.active')
  1519. .removeClass('active')
  1520. }
  1521. // SCROLLSPY PLUGIN DEFINITION
  1522. // ===========================
  1523. function Plugin(option) {
  1524. return this.each(function () {
  1525. var $this = $(this)
  1526. var data = $this.data('bs.scrollspy')
  1527. var options = typeof option == 'object' && option
  1528. if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
  1529. if (typeof option == 'string') data[option]()
  1530. })
  1531. }
  1532. var old = $.fn.scrollspy
  1533. $.fn.scrollspy = Plugin
  1534. $.fn.scrollspy.Constructor = ScrollSpy
  1535. // SCROLLSPY NO CONFLICT
  1536. // =====================
  1537. $.fn.scrollspy.noConflict = function () {
  1538. $.fn.scrollspy = old
  1539. return this
  1540. }
  1541. // SCROLLSPY DATA-API
  1542. // ==================
  1543. $(window).on('load.bs.scrollspy.data-api', function () {
  1544. $('[data-spy="scroll"]').each(function () {
  1545. var $spy = $(this)
  1546. Plugin.call($spy, $spy.data())
  1547. })
  1548. })
  1549. }(jQuery);
  1550. /* ========================================================================
  1551. * Bootstrap: tab.js v3.3.6
  1552. * http://getbootstrap.com/javascript/#tabs
  1553. * ========================================================================
  1554. * Copyright 2011-2015 Twitter, Inc.
  1555. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1556. * ======================================================================== */
  1557. +function ($) {
  1558. 'use strict';
  1559. // TAB CLASS DEFINITION
  1560. // ====================
  1561. var Tab = function (element) {
  1562. // jscs:disable requireDollarBeforejQueryAssignment
  1563. this.element = $(element)
  1564. // jscs:enable requireDollarBeforejQueryAssignment
  1565. }
  1566. Tab.VERSION = '3.3.6'
  1567. Tab.TRANSITION_DURATION = 150
  1568. Tab.prototype.show = function () {
  1569. var $this = this.element
  1570. var $ul = $this.closest('ul:not(.dropdown-menu)')
  1571. var selector = $this.data('target')
  1572. if (!selector) {
  1573. selector = $this.attr('href')
  1574. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  1575. }
  1576. if ($this.parent('li').hasClass('active')) return
  1577. var $previous = $ul.find('.active:last a')
  1578. var hideEvent = $.Event('hide.bs.tab', {
  1579. relatedTarget: $this[0]
  1580. })
  1581. var showEvent = $.Event('show.bs.tab', {
  1582. relatedTarget: $previous[0]
  1583. })
  1584. $previous.trigger(hideEvent)
  1585. $this.trigger(showEvent)
  1586. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
  1587. var $target = $(selector)
  1588. this.activate($this.closest('li'), $ul)
  1589. this.activate($target, $target.parent(), function () {
  1590. $previous.trigger({
  1591. type: 'hidden.bs.tab',
  1592. relatedTarget: $this[0]
  1593. })
  1594. $this.trigger({
  1595. type: 'shown.bs.tab',
  1596. relatedTarget: $previous[0]
  1597. })
  1598. })
  1599. }
  1600. Tab.prototype.activate = function (element, container, callback) {
  1601. var $active = container.find('> .active')
  1602. var transition = callback
  1603. && $.support.transition
  1604. && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
  1605. function next() {
  1606. $active
  1607. .removeClass('active')
  1608. .find('> .dropdown-menu > .active')
  1609. .removeClass('active')
  1610. .end()
  1611. .find('[data-toggle="tab"]')
  1612. .attr('aria-expanded', false)
  1613. element
  1614. .addClass('active')
  1615. .find('[data-toggle="tab"]')
  1616. .attr('aria-expanded', true)
  1617. if (transition) {
  1618. element[0].offsetWidth // reflow for transition
  1619. element.addClass('in')
  1620. } else {
  1621. element.removeClass('fade')
  1622. }
  1623. if (element.parent('.dropdown-menu').length) {
  1624. element
  1625. .closest('li.dropdown')
  1626. .addClass('active')
  1627. .end()
  1628. .find('[data-toggle="tab"]')
  1629. .attr('aria-expanded', true)
  1630. }
  1631. callback && callback()
  1632. }
  1633. $active.length && transition ?
  1634. $active
  1635. .one('bsTransitionEnd', next)
  1636. .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
  1637. next()
  1638. $active.removeClass('in')
  1639. }
  1640. // TAB PLUGIN DEFINITION
  1641. // =====================
  1642. function Plugin(option) {
  1643. return this.each(function () {
  1644. var $this = $(this)
  1645. var data = $this.data('bs.tab')
  1646. if (!data) $this.data('bs.tab', (data = new Tab(this)))
  1647. if (typeof option == 'string') data[option]()
  1648. })
  1649. }
  1650. var old = $.fn.tab
  1651. $.fn.tab = Plugin
  1652. $.fn.tab.Constructor = Tab
  1653. // TAB NO CONFLICT
  1654. // ===============
  1655. $.fn.tab.noConflict = function () {
  1656. $.fn.tab = old
  1657. return this
  1658. }
  1659. // TAB DATA-API
  1660. // ============
  1661. var clickHandler = function (e) {
  1662. e.preventDefault()
  1663. Plugin.call($(this), 'show')
  1664. }
  1665. $(document)
  1666. .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
  1667. .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
  1668. }(jQuery);
  1669. /* ========================================================================
  1670. * Bootstrap: affix.js v3.3.6
  1671. * http://getbootstrap.com/javascript/#affix
  1672. * ========================================================================
  1673. * Copyright 2011-2015 Twitter, Inc.
  1674. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1675. * ======================================================================== */
  1676. +function ($) {
  1677. 'use strict';
  1678. // AFFIX CLASS DEFINITION
  1679. // ======================
  1680. var Affix = function (element, options) {
  1681. this.options = $.extend({}, Affix.DEFAULTS, options)
  1682. this.$target = $(this.options.target)
  1683. .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
  1684. .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
  1685. this.$element = $(element)
  1686. this.affixed = null
  1687. this.unpin = null
  1688. this.pinnedOffset = null
  1689. this.checkPosition()
  1690. }
  1691. Affix.VERSION = '3.3.6'
  1692. Affix.RESET = 'affix affix-top affix-bottom'
  1693. Affix.DEFAULTS = {
  1694. offset: 0,
  1695. target: window
  1696. }
  1697. Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
  1698. var scrollTop = this.$target.scrollTop()
  1699. var position = this.$element.offset()
  1700. var targetHeight = this.$target.height()
  1701. if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
  1702. if (this.affixed == 'bottom') {
  1703. if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
  1704. return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
  1705. }
  1706. var initializing = this.affixed == null
  1707. var colliderTop = initializing ? scrollTop : position.top
  1708. var colliderHeight = initializing ? targetHeight : height
  1709. if (offsetTop != null && scrollTop <= offsetTop) return 'top'
  1710. if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
  1711. return false
  1712. }
  1713. Affix.prototype.getPinnedOffset = function () {
  1714. if (this.pinnedOffset) return this.pinnedOffset
  1715. this.$element.removeClass(Affix.RESET).addClass('affix')
  1716. var scrollTop = this.$target.scrollTop()
  1717. var position = this.$element.offset()
  1718. return (this.pinnedOffset = position.top - scrollTop)
  1719. }
  1720. Affix.prototype.checkPositionWithEventLoop = function () {
  1721. setTimeout($.proxy(this.checkPosition, this), 1)
  1722. }
  1723. Affix.prototype.checkPosition = function () {
  1724. if (!this.$element.is(':visible')) return
  1725. var height = this.$element.height()
  1726. var offset = this.options.offset
  1727. var offsetTop = offset.top
  1728. var offsetBottom = offset.bottom
  1729. var scrollHeight = Math.max($(document).height(), $(document.body).height())
  1730. if (typeof offset != 'object') offsetBottom = offsetTop = offset
  1731. if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
  1732. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
  1733. var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
  1734. if (this.affixed != affix) {
  1735. if (this.unpin != null) this.$element.css('top', '')
  1736. var affixType = 'affix' + (affix ? '-' + affix : '')
  1737. var e = $.Event(affixType + '.bs.affix')
  1738. this.$element.trigger(e)
  1739. if (e.isDefaultPrevented()) return
  1740. this.affixed = affix
  1741. this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
  1742. this.$element
  1743. .removeClass(Affix.RESET)
  1744. .addClass(affixType)
  1745. .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
  1746. }
  1747. if (affix == 'bottom') {
  1748. this.$element.offset({
  1749. top: scrollHeight - height - offsetBottom
  1750. })
  1751. }
  1752. }
  1753. // AFFIX PLUGIN DEFINITION
  1754. // =======================
  1755. function Plugin(option) {
  1756. return this.each(function () {
  1757. var $this = $(this)
  1758. var data = $this.data('bs.affix')
  1759. var options = typeof option == 'object' && option
  1760. if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
  1761. if (typeof option == 'string') data[option]()
  1762. })
  1763. }
  1764. var old = $.fn.affix
  1765. $.fn.affix = Plugin
  1766. $.fn.affix.Constructor = Affix
  1767. // AFFIX NO CONFLICT
  1768. // =================
  1769. $.fn.affix.noConflict = function () {
  1770. $.fn.affix = old
  1771. return this
  1772. }
  1773. // AFFIX DATA-API
  1774. // ==============
  1775. $(window).on('load', function () {
  1776. $('[data-spy="affix"]').each(function () {
  1777. var $spy = $(this)
  1778. var data = $spy.data()
  1779. data.offset = data.offset || {}
  1780. if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
  1781. if (data.offsetTop != null) data.offset.top = data.offsetTop
  1782. Plugin.call($spy, data)
  1783. })
  1784. })
  1785. }(jQuery);
  1786. // Underscore.js 1.4.0
  1787. // http://underscorejs.org
  1788. // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
  1789. // Underscore may be freely distributed under the MIT license.
  1790. (function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=r.unshift,l=i.toString,c=i.hasOwnProperty,h=r.forEach,p=r.map,d=r.reduce,v=r.reduceRight,m=r.filter,g=r.every,y=r.some,b=r.indexOf,w=r.lastIndexOf,E=Array.isArray,S=Object.keys,x=s.bind,T=function(e){if(e instanceof T)return e;if(!(this instanceof T))return new T(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.4.0";var N=T.each=T.forEach=function(e,t,r){if(h&&e.forEach===h)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(T.has(e,o)&&t.call(r,e[o],o,e)===n)return};T.map=T.collect=function(e,t,n){var r=[];return p&&e.map===p?e.map(t,n):(N(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)},T.reduce=T.foldl=T.inject=function(e,t,n,r){var i=arguments.length>2;if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},T.shuffle=function(e){var t,n=0,r=[];return N(e,function(e){t=T.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return T.isFunction(e)?e:function(t){return t[e]}};T.sortBy=function(e,t,n){var r=k(t);return T.pluck(T.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t);return N(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};T.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(T.has(e,t)?e[t]:e[t]=[]).push(n)})},T.countBy=function(e,t,n){return L(e,t,n,function(e,t,n){T.has(e,t)||(e[t]=0),e[t]++})},T.sortedIndex=function(e,t,n,r){n=n==null?T.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},T.toArray=function(e){return e?e.length===+e.length?u.call(e):T.values(e):[]},T.size=function(e){return e.length===+e.length?e.length:T.keys(e).length},T.first=T.head=T.take=function(e,t,n){return t!=null&&!n?u.call(e,0,t):e[0]},T.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},T.last=function(e,t,n){return t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},T.rest=T.tail=T.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},T.compact=function(e){return T.filter(e,function(e){return!!e})};var A=function(e,t,n){return N(e,function(e){T.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};T.flatten=function(e,t){return A(e,t,[])},T.without=function(e){return T.difference(e,u.call(arguments,1))},T.uniq=T.unique=function(e,t,n,r){var i=n?T.map(e,n,r):e,s=[],o=[];return N(i,function(n,r){if(t?!r||o[o.length-1]!==n:!T.contains(o,n))o.push(n),s.push(e[r])}),s},T.union=function(){return T.uniq(a.apply(r,arguments))},T.intersection=function(e){var t=u.call(arguments,1);return T.filter(T.uniq(e),function(e){return T.every(t,function(t){return T.indexOf(t,e)>=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=T.pluck(e,""+r);return n},T.object=function(e,t){var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},T.indexOf=function(e,t,n){var r=0,i=e.length;if(n){if(typeof n!="number")return r=T.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(b&&e.indexOf===b)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},T.lastIndexOf=function(e,t,n){if(w&&e.lastIndexOf===w)return e.lastIndexOf(t,n);var r=n!=null?n:e.length;while(r--)if(e[r]===t)return r;return-1},T.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};T.bind=function(t,n){var r,i;if(t.bind===x&&x)return x.apply(t,u.call(arguments,1));if(!T.isFunction(t))throw new TypeError;return i=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=t.prototype;var e=new O,s=t.apply(e,i.concat(u.call(arguments)));return Object(s)===s?s:e}return t.apply(n,i.concat(u.call(arguments)))}},T.bindAll=function(e){var t=u.call(arguments,1);return t.length==0&&(t=T.functions(e)),N(t,function(t){e[t]=T.bind(e[t],e)}),e},T.memoize=function(e,t){var n={};return t||(t=T.identity),function(){var r=t.apply(this,arguments);return T.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},T.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},T.defer=function(e){return T.delay.apply(T,[e,1].concat(u.call(arguments,1)))},T.throttle=function(e,t){var n,r,i,s,o,u,a=T.debounce(function(){o=s=!1},t);return function(){n=this,r=arguments;var f=function(){i=null,o&&(u=e.apply(n,r)),a()};return i||(i=setTimeout(f,t)),s?o=!0:(s=!0,u=e.apply(n,r)),a(),u}},T.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},T.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},T.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},T.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r<e;r++)t.call(n,r)},T.random=function(e,t){return t==null&&(t=e,e=0),e+(0|Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
  1791. // lib/handlebars/base.js
  1792. /*jshint eqnull:true*/
  1793. this.Handlebars = {};
  1794. (function(Handlebars) {
  1795. Handlebars.VERSION = "1.0.rc.1";
  1796. Handlebars.helpers = {};
  1797. Handlebars.partials = {};
  1798. Handlebars.registerHelper = function(name, fn, inverse) {
  1799. if(inverse) { fn.not = inverse; }
  1800. this.helpers[name] = fn;
  1801. };
  1802. Handlebars.registerPartial = function(name, str) {
  1803. this.partials[name] = str;
  1804. };
  1805. Handlebars.registerHelper('helperMissing', function(arg) {
  1806. if(arguments.length === 2) {
  1807. return undefined;
  1808. } else {
  1809. throw new Error("Could not find property '" + arg + "'");
  1810. }
  1811. });
  1812. var toString = Object.prototype.toString, functionType = "[object Function]";
  1813. Handlebars.registerHelper('blockHelperMissing', function(context, options) {
  1814. var inverse = options.inverse || function() {}, fn = options.fn;
  1815. var ret = "";
  1816. var type = toString.call(context);
  1817. if(type === functionType) { context = context.call(this); }
  1818. if(context === true) {
  1819. return fn(this);
  1820. } else if(context === false || context == null) {
  1821. return inverse(this);
  1822. } else if(type === "[object Array]") {
  1823. if(context.length > 0) {
  1824. return Handlebars.helpers.each(context, options);
  1825. } else {
  1826. return inverse(this);
  1827. }
  1828. } else {
  1829. return fn(context);
  1830. }
  1831. });
  1832. Handlebars.K = function() {};
  1833. Handlebars.createFrame = Object.create || function(object) {
  1834. Handlebars.K.prototype = object;
  1835. var obj = new Handlebars.K();
  1836. Handlebars.K.prototype = null;
  1837. return obj;
  1838. };
  1839. Handlebars.registerHelper('each', function(context, options) {
  1840. var fn = options.fn, inverse = options.inverse;
  1841. var ret = "", data;
  1842. if (options.data) {
  1843. data = Handlebars.createFrame(options.data);
  1844. }
  1845. if(context && context.length > 0) {
  1846. for(var i=0, j=context.length; i<j; i++) {
  1847. if (data) { data.index = i; }
  1848. ret = ret + fn(context[i], { data: data });
  1849. }
  1850. } else {
  1851. ret = inverse(this);
  1852. }
  1853. return ret;
  1854. });
  1855. Handlebars.registerHelper('if', function(context, options) {
  1856. var type = toString.call(context);
  1857. if(type === functionType) { context = context.call(this); }
  1858. if(!context || Handlebars.Utils.isEmpty(context)) {
  1859. return options.inverse(this);
  1860. } else {
  1861. return options.fn(this);
  1862. }
  1863. });
  1864. Handlebars.registerHelper('unless', function(context, options) {
  1865. var fn = options.fn, inverse = options.inverse;
  1866. options.fn = inverse;
  1867. options.inverse = fn;
  1868. return Handlebars.helpers['if'].call(this, context, options);
  1869. });
  1870. Handlebars.registerHelper('with', function(context, options) {
  1871. return options.fn(context);
  1872. });
  1873. Handlebars.registerHelper('log', function(context) {
  1874. Handlebars.log(context);
  1875. });
  1876. }(this.Handlebars));
  1877. ;
  1878. // lib/handlebars/compiler/parser.js
  1879. /* Jison generated parser */
  1880. var handlebars = (function(){
  1881. var parser = {trace: function trace() { },
  1882. yy: {},
  1883. symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"DATA":27,"param":28,"STRING":29,"INTEGER":30,"BOOLEAN":31,"hashSegments":32,"hashSegment":33,"ID":34,"EQUALS":35,"pathSegments":36,"SEP":37,"$accept":0,"$end":1},
  1884. terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",27:"DATA",29:"STRING",30:"INTEGER",31:"BOOLEAN",34:"ID",35:"EQUALS",37:"SEP"},
  1885. productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[17,1],[25,2],[25,1],[28,1],[28,1],[28,1],[28,1],[28,1],[26,1],[32,2],[32,1],[33,3],[33,3],[33,3],[33,3],[33,3],[21,1],[36,3],[36,1]],
  1886. performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
  1887. var $0 = $$.length - 1;
  1888. switch (yystate) {
  1889. case 1: return $$[$0-1];
  1890. break;
  1891. case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
  1892. break;
  1893. case 3: this.$ = new yy.ProgramNode($$[$0]);
  1894. break;
  1895. case 4: this.$ = new yy.ProgramNode([]);
  1896. break;
  1897. case 5: this.$ = [$$[$0]];
  1898. break;
  1899. case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
  1900. break;
  1901. case 7: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
  1902. break;
  1903. case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
  1904. break;
  1905. case 9: this.$ = $$[$0];
  1906. break;
  1907. case 10: this.$ = $$[$0];
  1908. break;
  1909. case 11: this.$ = new yy.ContentNode($$[$0]);
  1910. break;
  1911. case 12: this.$ = new yy.CommentNode($$[$0]);
  1912. break;
  1913. case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
  1914. break;
  1915. case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
  1916. break;
  1917. case 15: this.$ = $$[$0-1];
  1918. break;
  1919. case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
  1920. break;
  1921. case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
  1922. break;
  1923. case 18: this.$ = new yy.PartialNode($$[$0-1]);
  1924. break;
  1925. case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
  1926. break;
  1927. case 20:
  1928. break;
  1929. case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
  1930. break;
  1931. case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null];
  1932. break;
  1933. case 23: this.$ = [[$$[$0-1]], $$[$0]];
  1934. break;
  1935. case 24: this.$ = [[$$[$0]], null];
  1936. break;
  1937. case 25: this.$ = [[new yy.DataNode($$[$0])], null];
  1938. break;
  1939. case 26: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
  1940. break;
  1941. case 27: this.$ = [$$[$0]];
  1942. break;
  1943. case 28: this.$ = $$[$0];
  1944. break;
  1945. case 29: this.$ = new yy.StringNode($$[$0]);
  1946. break;
  1947. case 30: this.$ = new yy.IntegerNode($$[$0]);
  1948. break;
  1949. case 31: this.$ = new yy.BooleanNode($$[$0]);
  1950. break;
  1951. case 32: this.$ = new yy.DataNode($$[$0]);
  1952. break;
  1953. case 33: this.$ = new yy.HashNode($$[$0]);
  1954. break;
  1955. case 34: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
  1956. break;
  1957. case 35: this.$ = [$$[$0]];
  1958. break;
  1959. case 36: this.$ = [$$[$0-2], $$[$0]];
  1960. break;
  1961. case 37: this.$ = [$$[$0-2], new yy.StringNode($$[$0])];
  1962. break;
  1963. case 38: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
  1964. break;
  1965. case 39: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
  1966. break;
  1967. case 40: this.$ = [$$[$0-2], new yy.DataNode($$[$0])];
  1968. break;
  1969. case 41: this.$ = new yy.IdNode($$[$0]);
  1970. break;
  1971. case 42: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
  1972. break;
  1973. case 43: this.$ = [$$[$0]];
  1974. break;
  1975. }
  1976. },
  1977. table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,27:[1,24],34:[1,26],36:25},{17:27,21:23,27:[1,24],34:[1,26],36:25},{17:28,21:23,27:[1,24],34:[1,26],36:25},{17:29,21:23,27:[1,24],34:[1,26],36:25},{21:30,34:[1,26],36:25},{1:[2,1]},{6:31,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,32],21:23,27:[1,24],34:[1,26],36:25},{10:33,20:[1,34]},{10:35,20:[1,34]},{18:[1,36]},{18:[2,24],21:41,25:37,26:38,27:[1,45],28:39,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,25]},{18:[2,41],27:[2,41],29:[2,41],30:[2,41],31:[2,41],34:[2,41],37:[1,48]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],37:[2,43]},{18:[1,49]},{18:[1,50]},{18:[1,51]},{18:[1,52],21:53,34:[1,26],36:25},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:54,34:[1,26],36:25},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:41,26:55,27:[1,45],28:56,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,23]},{18:[2,27],27:[2,27],29:[2,27],30:[2,27],31:[2,27],34:[2,27]},{18:[2,33],33:57,34:[1,58]},{18:[2,28],27:[2,28],29:[2,28],30:[2,28],31:[2,28],34:[2,28]},{18:[2,29],27:[2,29],29:[2,29],30:[2,29],31:[2,29],34:[2,29]},{18:[2,30],27:[2,30],29:[2,30],30:[2,30],31:[2,30],34:[2,30]},{18:[2,31],27:[2,31],29:[2,31],30:[2,31],31:[2,31],34:[2,31]},{18:[2,32],27:[2,32],29:[2,32],30:[2,32],31:[2,32],34:[2,32]},{18:[2,35],34:[2,35]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],35:[1,59],37:[2,43]},{34:[1,60]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,61]},{18:[1,62]},{18:[2,21]},{18:[2,26],27:[2,26],29:[2,26],30:[2,26],31:[2,26],34:[2,26]},{18:[2,34],34:[2,34]},{35:[1,59]},{21:63,27:[1,67],29:[1,64],30:[1,65],31:[1,66],34:[1,26],36:25},{18:[2,42],27:[2,42],29:[2,42],30:[2,42],31:[2,42],34:[2,42],37:[2,42]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,36],34:[2,36]},{18:[2,37],34:[2,37]},{18:[2,38],34:[2,38]},{18:[2,39],34:[2,39]},{18:[2,40],34:[2,40]}],
  1978. defaultActions: {16:[2,1],24:[2,25],38:[2,23],55:[2,21]},
  1979. parseError: function parseError(str, hash) {
  1980. throw new Error(str);
  1981. },
  1982. parse: function parse(input) {
  1983. var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
  1984. this.lexer.setInput(input);
  1985. this.lexer.yy = this.yy;
  1986. this.yy.lexer = this.lexer;
  1987. this.yy.parser = this;
  1988. if (typeof this.lexer.yylloc == "undefined")
  1989. this.lexer.yylloc = {};
  1990. var yyloc = this.lexer.yylloc;
  1991. lstack.push(yyloc);
  1992. var ranges = this.lexer.options && this.lexer.options.ranges;
  1993. if (typeof this.yy.parseError === "function")
  1994. this.parseError = this.yy.parseError;
  1995. function popStack(n) {
  1996. stack.length = stack.length - 2 * n;
  1997. vstack.length = vstack.length - n;
  1998. lstack.length = lstack.length - n;
  1999. }
  2000. function lex() {
  2001. var token;
  2002. token = self.lexer.lex() || 1;
  2003. if (typeof token !== "number") {
  2004. token = self.symbols_[token] || token;
  2005. }
  2006. return token;
  2007. }
  2008. var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
  2009. while (true) {
  2010. state = stack[stack.length - 1];
  2011. if (this.defaultActions[state]) {
  2012. action = this.defaultActions[state];
  2013. } else {
  2014. if (symbol === null || typeof symbol == "undefined") {
  2015. symbol = lex();
  2016. }
  2017. action = table[state] && table[state][symbol];
  2018. }
  2019. if (typeof action === "undefined" || !action.length || !action[0]) {
  2020. var errStr = "";
  2021. if (!recovering) {
  2022. expected = [];
  2023. for (p in table[state])
  2024. if (this.terminals_[p] && p > 2) {
  2025. expected.push("'" + this.terminals_[p] + "'");
  2026. }
  2027. if (this.lexer.showPosition) {
  2028. errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
  2029. } else {
  2030. errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
  2031. }
  2032. this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
  2033. }
  2034. }
  2035. if (action[0] instanceof Array && action.length > 1) {
  2036. throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
  2037. }
  2038. switch (action[0]) {
  2039. case 1:
  2040. stack.push(symbol);
  2041. vstack.push(this.lexer.yytext);
  2042. lstack.push(this.lexer.yylloc);
  2043. stack.push(action[1]);
  2044. symbol = null;
  2045. if (!preErrorSymbol) {
  2046. yyleng = this.lexer.yyleng;
  2047. yytext = this.lexer.yytext;
  2048. yylineno = this.lexer.yylineno;
  2049. yyloc = this.lexer.yylloc;
  2050. if (recovering > 0)
  2051. recovering--;
  2052. } else {
  2053. symbol = preErrorSymbol;
  2054. preErrorSymbol = null;
  2055. }
  2056. break;
  2057. case 2:
  2058. len = this.productions_[action[1]][1];
  2059. yyval.$ = vstack[vstack.length - len];
  2060. yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
  2061. if (ranges) {
  2062. yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
  2063. }
  2064. r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
  2065. if (typeof r !== "undefined") {
  2066. return r;
  2067. }
  2068. if (len) {
  2069. stack = stack.slice(0, -1 * len * 2);
  2070. vstack = vstack.slice(0, -1 * len);
  2071. lstack = lstack.slice(0, -1 * len);
  2072. }
  2073. stack.push(this.productions_[action[1]][0]);
  2074. vstack.push(yyval.$);
  2075. lstack.push(yyval._$);
  2076. newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
  2077. stack.push(newState);
  2078. break;
  2079. case 3:
  2080. return true;
  2081. }
  2082. }
  2083. return true;
  2084. }
  2085. };
  2086. /* Jison generated lexer */
  2087. var lexer = (function(){
  2088. var lexer = ({EOF:1,
  2089. parseError:function parseError(str, hash) {
  2090. if (this.yy.parser) {
  2091. this.yy.parser.parseError(str, hash);
  2092. } else {
  2093. throw new Error(str);
  2094. }
  2095. },
  2096. setInput:function (input) {
  2097. this._input = input;
  2098. this._more = this._less = this.done = false;
  2099. this.yylineno = this.yyleng = 0;
  2100. this.yytext = this.matched = this.match = '';
  2101. this.conditionStack = ['INITIAL'];
  2102. this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
  2103. if (this.options.ranges) this.yylloc.range = [0,0];
  2104. this.offset = 0;
  2105. return this;
  2106. },
  2107. input:function () {
  2108. var ch = this._input[0];
  2109. this.yytext += ch;
  2110. this.yyleng++;
  2111. this.offset++;
  2112. this.match += ch;
  2113. this.matched += ch;
  2114. var lines = ch.match(/(?:\r\n?|\n).*/g);
  2115. if (lines) {
  2116. this.yylineno++;
  2117. this.yylloc.last_line++;
  2118. } else {
  2119. this.yylloc.last_column++;
  2120. }
  2121. if (this.options.ranges) this.yylloc.range[1]++;
  2122. this._input = this._input.slice(1);
  2123. return ch;
  2124. },
  2125. unput:function (ch) {
  2126. var len = ch.length;
  2127. var lines = ch.split(/(?:\r\n?|\n)/g);
  2128. this._input = ch + this._input;
  2129. this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
  2130. //this.yyleng -= len;
  2131. this.offset -= len;
  2132. var oldLines = this.match.split(/(?:\r\n?|\n)/g);
  2133. this.match = this.match.substr(0, this.match.length-1);
  2134. this.matched = this.matched.substr(0, this.matched.length-1);
  2135. if (lines.length-1) this.yylineno -= lines.length-1;
  2136. var r = this.yylloc.range;
  2137. this.yylloc = {first_line: this.yylloc.first_line,
  2138. last_line: this.yylineno+1,
  2139. first_column: this.yylloc.first_column,
  2140. last_column: lines ?
  2141. (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
  2142. this.yylloc.first_column - len
  2143. };
  2144. if (this.options.ranges) {
  2145. this.yylloc.range = [r[0], r[0] + this.yyleng - len];
  2146. }
  2147. return this;
  2148. },
  2149. more:function () {
  2150. this._more = true;
  2151. return this;
  2152. },
  2153. less:function (n) {
  2154. this.unput(this.match.slice(n));
  2155. },
  2156. pastInput:function () {
  2157. var past = this.matched.substr(0, this.matched.length - this.match.length);
  2158. return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
  2159. },
  2160. upcomingInput:function () {
  2161. var next = this.match;
  2162. if (next.length < 20) {
  2163. next += this._input.substr(0, 20-next.length);
  2164. }
  2165. return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
  2166. },
  2167. showPosition:function () {
  2168. var pre = this.pastInput();
  2169. var c = new Array(pre.length + 1).join("-");
  2170. return pre + this.upcomingInput() + "\n" + c+"^";
  2171. },
  2172. next:function () {
  2173. if (this.done) {
  2174. return this.EOF;
  2175. }
  2176. if (!this._input) this.done = true;
  2177. var token,
  2178. match,
  2179. tempMatch,
  2180. index,
  2181. col,
  2182. lines;
  2183. if (!this._more) {
  2184. this.yytext = '';
  2185. this.match = '';
  2186. }
  2187. var rules = this._currentRules();
  2188. for (var i=0;i < rules.length; i++) {
  2189. tempMatch = this._input.match(this.rules[rules[i]]);
  2190. if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
  2191. match = tempMatch;
  2192. index = i;
  2193. if (!this.options.flex) break;
  2194. }
  2195. }
  2196. if (match) {
  2197. lines = match[0].match(/(?:\r\n?|\n).*/g);
  2198. if (lines) this.yylineno += lines.length;
  2199. this.yylloc = {first_line: this.yylloc.last_line,
  2200. last_line: this.yylineno+1,
  2201. first_column: this.yylloc.last_column,
  2202. last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
  2203. this.yytext += match[0];
  2204. this.match += match[0];
  2205. this.matches = match;
  2206. this.yyleng = this.yytext.length;
  2207. if (this.options.ranges) {
  2208. this.yylloc.range = [this.offset, this.offset += this.yyleng];
  2209. }
  2210. this._more = false;
  2211. this._input = this._input.slice(match[0].length);
  2212. this.matched += match[0];
  2213. token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
  2214. if (this.done && this._input) this.done = false;
  2215. if (token) return token;
  2216. else return;
  2217. }
  2218. if (this._input === "") {
  2219. return this.EOF;
  2220. } else {
  2221. return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
  2222. {text: "", token: null, line: this.yylineno});
  2223. }
  2224. },
  2225. lex:function lex() {
  2226. var r = this.next();
  2227. if (typeof r !== 'undefined') {
  2228. return r;
  2229. } else {
  2230. return this.lex();
  2231. }
  2232. },
  2233. begin:function begin(condition) {
  2234. this.conditionStack.push(condition);
  2235. },
  2236. popState:function popState() {
  2237. return this.conditionStack.pop();
  2238. },
  2239. _currentRules:function _currentRules() {
  2240. return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
  2241. },
  2242. topState:function () {
  2243. return this.conditionStack[this.conditionStack.length-2];
  2244. },
  2245. pushState:function begin(condition) {
  2246. this.begin(condition);
  2247. }});
  2248. lexer.options = {};
  2249. lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
  2250. var YYSTATE=YY_START
  2251. switch($avoiding_name_collisions) {
  2252. case 0:
  2253. if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
  2254. if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
  2255. if(yy_.yytext) return 14;
  2256. break;
  2257. case 1: return 14;
  2258. break;
  2259. case 2:
  2260. if(yy_.yytext.slice(-1) !== "\\") this.popState();
  2261. if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
  2262. return 14;
  2263. break;
  2264. case 3: return 24;
  2265. break;
  2266. case 4: return 16;
  2267. break;
  2268. case 5: return 20;
  2269. break;
  2270. case 6: return 19;
  2271. break;
  2272. case 7: return 19;
  2273. break;
  2274. case 8: return 23;
  2275. break;
  2276. case 9: return 23;
  2277. break;
  2278. case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
  2279. break;
  2280. case 11: return 22;
  2281. break;
  2282. case 12: return 35;
  2283. break;
  2284. case 13: return 34;
  2285. break;
  2286. case 14: return 34;
  2287. break;
  2288. case 15: return 37;
  2289. break;
  2290. case 16: /*ignore whitespace*/
  2291. break;
  2292. case 17: this.popState(); return 18;
  2293. break;
  2294. case 18: this.popState(); return 18;
  2295. break;
  2296. case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29;
  2297. break;
  2298. case 20: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29;
  2299. break;
  2300. case 21: yy_.yytext = yy_.yytext.substr(1); return 27;
  2301. break;
  2302. case 22: return 31;
  2303. break;
  2304. case 23: return 31;
  2305. break;
  2306. case 24: return 30;
  2307. break;
  2308. case 25: return 34;
  2309. break;
  2310. case 26: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 34;
  2311. break;
  2312. case 27: return 'INVALID';
  2313. break;
  2314. case 28: return 5;
  2315. break;
  2316. }
  2317. };
  2318. lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
  2319. lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,28],"inclusive":true}};
  2320. return lexer;})()
  2321. parser.lexer = lexer;
  2322. function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
  2323. return new Parser;
  2324. })();
  2325. if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
  2326. exports.parser = handlebars;
  2327. exports.Parser = handlebars.Parser;
  2328. exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
  2329. exports.main = function commonjsMain(args) {
  2330. if (!args[1])
  2331. throw new Error('Usage: '+args[0]+' FILE');
  2332. var source, cwd;
  2333. if (typeof process !== 'undefined') {
  2334. source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
  2335. } else {
  2336. source = require("file").path(require("file").cwd()).join(args[1]).read({charset: "utf-8"});
  2337. }
  2338. return exports.parser.parse(source);
  2339. }
  2340. if (typeof module !== 'undefined' && require.main === module) {
  2341. exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
  2342. }
  2343. };
  2344. ;
  2345. // lib/handlebars/compiler/base.js
  2346. Handlebars.Parser = handlebars;
  2347. Handlebars.parse = function(string) {
  2348. Handlebars.Parser.yy = Handlebars.AST;
  2349. return Handlebars.Parser.parse(string);
  2350. };
  2351. Handlebars.print = function(ast) {
  2352. return new Handlebars.PrintVisitor().accept(ast);
  2353. };
  2354. Handlebars.logger = {
  2355. DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
  2356. // override in the host environment
  2357. log: function(level, str) {}
  2358. };
  2359. Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
  2360. ;
  2361. // lib/handlebars/compiler/ast.js
  2362. (function() {
  2363. Handlebars.AST = {};
  2364. Handlebars.AST.ProgramNode = function(statements, inverse) {
  2365. this.type = "program";
  2366. this.statements = statements;
  2367. if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
  2368. };
  2369. Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
  2370. this.type = "mustache";
  2371. this.escaped = !unescaped;
  2372. this.hash = hash;
  2373. var id = this.id = rawParams[0];
  2374. var params = this.params = rawParams.slice(1);
  2375. // a mustache is an eligible helper if:
  2376. // * its id is simple (a single part, not `this` or `..`)
  2377. var eligibleHelper = this.eligibleHelper = id.isSimple;
  2378. // a mustache is definitely a helper if:
  2379. // * it is an eligible helper, and
  2380. // * it has at least one parameter or hash segment
  2381. this.isHelper = eligibleHelper && (params.length || hash);
  2382. // if a mustache is an eligible helper but not a definite
  2383. // helper, it is ambiguous, and will be resolved in a later
  2384. // pass or at runtime.
  2385. };
  2386. Handlebars.AST.PartialNode = function(id, context) {
  2387. this.type = "partial";
  2388. // TODO: disallow complex IDs
  2389. this.id = id;
  2390. this.context = context;
  2391. };
  2392. var verifyMatch = function(open, close) {
  2393. if(open.original !== close.original) {
  2394. throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
  2395. }
  2396. };
  2397. Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
  2398. verifyMatch(mustache.id, close);
  2399. this.type = "block";
  2400. this.mustache = mustache;
  2401. this.program = program;
  2402. this.inverse = inverse;
  2403. if (this.inverse && !this.program) {
  2404. this.isInverse = true;
  2405. }
  2406. };
  2407. Handlebars.AST.ContentNode = function(string) {
  2408. this.type = "content";
  2409. this.string = string;
  2410. };
  2411. Handlebars.AST.HashNode = function(pairs) {
  2412. this.type = "hash";
  2413. this.pairs = pairs;
  2414. };
  2415. Handlebars.AST.IdNode = function(parts) {
  2416. this.type = "ID";
  2417. this.original = parts.join(".");
  2418. var dig = [], depth = 0;
  2419. for(var i=0,l=parts.length; i<l; i++) {
  2420. var part = parts[i];
  2421. if(part === "..") { depth++; }
  2422. else if(part === "." || part === "this") { this.isScoped = true; }
  2423. else { dig.push(part); }
  2424. }
  2425. this.parts = dig;
  2426. this.string = dig.join('.');
  2427. this.depth = depth;
  2428. // an ID is simple if it only has one part, and that part is not
  2429. // `..` or `this`.
  2430. this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
  2431. };
  2432. Handlebars.AST.DataNode = function(id) {
  2433. this.type = "DATA";
  2434. this.id = id;
  2435. };
  2436. Handlebars.AST.StringNode = function(string) {
  2437. this.type = "STRING";
  2438. this.string = string;
  2439. };
  2440. Handlebars.AST.IntegerNode = function(integer) {
  2441. this.type = "INTEGER";
  2442. this.integer = integer;
  2443. };
  2444. Handlebars.AST.BooleanNode = function(bool) {
  2445. this.type = "BOOLEAN";
  2446. this.bool = bool;
  2447. };
  2448. Handlebars.AST.CommentNode = function(comment) {
  2449. this.type = "comment";
  2450. this.comment = comment;
  2451. };
  2452. })();;
  2453. // lib/handlebars/utils.js
  2454. Handlebars.Exception = function(message) {
  2455. var tmp = Error.prototype.constructor.apply(this, arguments);
  2456. for (var p in tmp) {
  2457. if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
  2458. }
  2459. this.message = tmp.message;
  2460. };
  2461. Handlebars.Exception.prototype = new Error();
  2462. // Build out our basic SafeString type
  2463. Handlebars.SafeString = function(string) {
  2464. this.string = string;
  2465. };
  2466. Handlebars.SafeString.prototype.toString = function() {
  2467. return this.string.toString();
  2468. };
  2469. (function() {
  2470. var escape = {
  2471. "&": "&amp;",
  2472. "<": "&lt;",
  2473. ">": "&gt;",
  2474. '"': "&quot;",
  2475. "'": "&#x27;",
  2476. "`": "&#x60;"
  2477. };
  2478. var badChars = /[&<>"'`]/g;
  2479. var possible = /[&<>"'`]/;
  2480. var escapeChar = function(chr) {
  2481. return escape[chr] || "&amp;";
  2482. };
  2483. Handlebars.Utils = {
  2484. escapeExpression: function(string) {
  2485. // don't escape SafeStrings, since they're already safe
  2486. if (string instanceof Handlebars.SafeString) {
  2487. return string.toString();
  2488. } else if (string == null || string === false) {
  2489. return "";
  2490. }
  2491. if(!possible.test(string)) { return string; }
  2492. return string.replace(badChars, escapeChar);
  2493. },
  2494. isEmpty: function(value) {
  2495. if (typeof value === "undefined") {
  2496. return true;
  2497. } else if (value === null) {
  2498. return true;
  2499. } else if (value === false) {
  2500. return true;
  2501. } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
  2502. return true;
  2503. } else {
  2504. return false;
  2505. }
  2506. }
  2507. };
  2508. })();;
  2509. // lib/handlebars/compiler/compiler.js
  2510. /*jshint eqnull:true*/
  2511. Handlebars.Compiler = function() {};
  2512. Handlebars.JavaScriptCompiler = function() {};
  2513. (function(Compiler, JavaScriptCompiler) {
  2514. // the foundHelper register will disambiguate helper lookup from finding a
  2515. // function in a context. This is necessary for mustache compatibility, which
  2516. // requires that context functions in blocks are evaluated by blockHelperMissing,
  2517. // and then proceed as if the resulting value was provided to blockHelperMissing.
  2518. Compiler.prototype = {
  2519. compiler: Compiler,
  2520. disassemble: function() {
  2521. var opcodes = this.opcodes, opcode, out = [], params, param;
  2522. for (var i=0, l=opcodes.length; i<l; i++) {
  2523. opcode = opcodes[i];
  2524. if (opcode.opcode === 'DECLARE') {
  2525. out.push("DECLARE " + opcode.name + "=" + opcode.value);
  2526. } else {
  2527. params = [];
  2528. for (var j=0; j<opcode.args.length; j++) {
  2529. param = opcode.args[j];
  2530. if (typeof param === "string") {
  2531. param = "\"" + param.replace("\n", "\\n") + "\"";
  2532. }
  2533. params.push(param);
  2534. }
  2535. out.push(opcode.opcode + " " + params.join(" "));
  2536. }
  2537. }
  2538. return out.join("\n");
  2539. },
  2540. guid: 0,
  2541. compile: function(program, options) {
  2542. this.children = [];
  2543. this.depths = {list: []};
  2544. this.options = options;
  2545. // These changes will propagate to the other compiler components
  2546. var knownHelpers = this.options.knownHelpers;
  2547. this.options.knownHelpers = {
  2548. 'helperMissing': true,
  2549. 'blockHelperMissing': true,
  2550. 'each': true,
  2551. 'if': true,
  2552. 'unless': true,
  2553. 'with': true,
  2554. 'log': true
  2555. };
  2556. if (knownHelpers) {
  2557. for (var name in knownHelpers) {
  2558. this.options.knownHelpers[name] = knownHelpers[name];
  2559. }
  2560. }
  2561. return this.program(program);
  2562. },
  2563. accept: function(node) {
  2564. return this[node.type](node);
  2565. },
  2566. program: function(program) {
  2567. var statements = program.statements, statement;
  2568. this.opcodes = [];
  2569. for(var i=0, l=statements.length; i<l; i++) {
  2570. statement = statements[i];
  2571. this[statement.type](statement);
  2572. }
  2573. this.isSimple = l === 1;
  2574. this.depths.list = this.depths.list.sort(function(a, b) {
  2575. return a - b;
  2576. });
  2577. return this;
  2578. },
  2579. compileProgram: function(program) {
  2580. var result = new this.compiler().compile(program, this.options);
  2581. var guid = this.guid++, depth;
  2582. this.usePartial = this.usePartial || result.usePartial;
  2583. this.children[guid] = result;
  2584. for(var i=0, l=result.depths.list.length; i<l; i++) {
  2585. depth = result.depths.list[i];
  2586. if(depth < 2) { continue; }
  2587. else { this.addDepth(depth - 1); }
  2588. }
  2589. return guid;
  2590. },
  2591. block: function(block) {
  2592. var mustache = block.mustache,
  2593. program = block.program,
  2594. inverse = block.inverse;
  2595. if (program) {
  2596. program = this.compileProgram(program);
  2597. }
  2598. if (inverse) {
  2599. inverse = this.compileProgram(inverse);
  2600. }
  2601. var type = this.classifyMustache(mustache);
  2602. if (type === "helper") {
  2603. this.helperMustache(mustache, program, inverse);
  2604. } else if (type === "simple") {
  2605. this.simpleMustache(mustache);
  2606. // now that the simple mustache is resolved, we need to
  2607. // evaluate it by executing `blockHelperMissing`
  2608. this.opcode('pushProgram', program);
  2609. this.opcode('pushProgram', inverse);
  2610. this.opcode('pushLiteral', '{}');
  2611. this.opcode('blockValue');
  2612. } else {
  2613. this.ambiguousMustache(mustache, program, inverse);
  2614. // now that the simple mustache is resolved, we need to
  2615. // evaluate it by executing `blockHelperMissing`
  2616. this.opcode('pushProgram', program);
  2617. this.opcode('pushProgram', inverse);
  2618. this.opcode('pushLiteral', '{}');
  2619. this.opcode('ambiguousBlockValue');
  2620. }
  2621. this.opcode('append');
  2622. },
  2623. hash: function(hash) {
  2624. var pairs = hash.pairs, pair, val;
  2625. this.opcode('push', '{}');
  2626. for(var i=0, l=pairs.length; i<l; i++) {
  2627. pair = pairs[i];
  2628. val = pair[1];
  2629. this.accept(val);
  2630. this.opcode('assignToHash', pair[0]);
  2631. }
  2632. },
  2633. partial: function(partial) {
  2634. var id = partial.id;
  2635. this.usePartial = true;
  2636. if(partial.context) {
  2637. this.ID(partial.context);
  2638. } else {
  2639. this.opcode('push', 'depth0');
  2640. }
  2641. this.opcode('invokePartial', id.original);
  2642. this.opcode('append');
  2643. },
  2644. content: function(content) {
  2645. this.opcode('appendContent', content.string);
  2646. },
  2647. mustache: function(mustache) {
  2648. var options = this.options;
  2649. var type = this.classifyMustache(mustache);
  2650. if (type === "simple") {
  2651. this.simpleMustache(mustache);
  2652. } else if (type === "helper") {
  2653. this.helperMustache(mustache);
  2654. } else {
  2655. this.ambiguousMustache(mustache);
  2656. }
  2657. if(mustache.escaped && !options.noEscape) {
  2658. this.opcode('appendEscaped');
  2659. } else {
  2660. this.opcode('append');
  2661. }
  2662. },
  2663. ambiguousMustache: function(mustache, program, inverse) {
  2664. var id = mustache.id, name = id.parts[0];
  2665. this.opcode('getContext', id.depth);
  2666. this.opcode('pushProgram', program);
  2667. this.opcode('pushProgram', inverse);
  2668. this.opcode('invokeAmbiguous', name);
  2669. },
  2670. simpleMustache: function(mustache, program, inverse) {
  2671. var id = mustache.id;
  2672. if (id.type === 'DATA') {
  2673. this.DATA(id);
  2674. } else if (id.parts.length) {
  2675. this.ID(id);
  2676. } else {
  2677. // Simplified ID for `this`
  2678. this.addDepth(id.depth);
  2679. this.opcode('getContext', id.depth);
  2680. this.opcode('pushContext');
  2681. }
  2682. this.opcode('resolvePossibleLambda');
  2683. },
  2684. helperMustache: function(mustache, program, inverse) {
  2685. var params = this.setupFullMustacheParams(mustache, program, inverse),
  2686. name = mustache.id.parts[0];
  2687. if (this.options.knownHelpers[name]) {
  2688. this.opcode('invokeKnownHelper', params.length, name);
  2689. } else if (this.knownHelpersOnly) {
  2690. throw new Error("You specified knownHelpersOnly, but used the unknown helper " + name);
  2691. } else {
  2692. this.opcode('invokeHelper', params.length, name);
  2693. }
  2694. },
  2695. ID: function(id) {
  2696. this.addDepth(id.depth);
  2697. this.opcode('getContext', id.depth);
  2698. var name = id.parts[0];
  2699. if (!name) {
  2700. this.opcode('pushContext');
  2701. } else {
  2702. this.opcode('lookupOnContext', id.parts[0]);
  2703. }
  2704. for(var i=1, l=id.parts.length; i<l; i++) {
  2705. this.opcode('lookup', id.parts[i]);
  2706. }
  2707. },
  2708. DATA: function(data) {
  2709. this.options.data = true;
  2710. this.opcode('lookupData', data.id);
  2711. },
  2712. STRING: function(string) {
  2713. this.opcode('pushString', string.string);
  2714. },
  2715. INTEGER: function(integer) {
  2716. this.opcode('pushLiteral', integer.integer);
  2717. },
  2718. BOOLEAN: function(bool) {
  2719. this.opcode('pushLiteral', bool.bool);
  2720. },
  2721. comment: function() {},
  2722. // HELPERS
  2723. opcode: function(name) {
  2724. this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
  2725. },
  2726. declare: function(name, value) {
  2727. this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
  2728. },
  2729. addDepth: function(depth) {
  2730. if(isNaN(depth)) { throw new Error("EWOT"); }
  2731. if(depth === 0) { return; }
  2732. if(!this.depths[depth]) {
  2733. this.depths[depth] = true;
  2734. this.depths.list.push(depth);
  2735. }
  2736. },
  2737. classifyMustache: function(mustache) {
  2738. var isHelper = mustache.isHelper;
  2739. var isEligible = mustache.eligibleHelper;
  2740. var options = this.options;
  2741. // if ambiguous, we can possibly resolve the ambiguity now
  2742. if (isEligible && !isHelper) {
  2743. var name = mustache.id.parts[0];
  2744. if (options.knownHelpers[name]) {
  2745. isHelper = true;
  2746. } else if (options.knownHelpersOnly) {
  2747. isEligible = false;
  2748. }
  2749. }
  2750. if (isHelper) { return "helper"; }
  2751. else if (isEligible) { return "ambiguous"; }
  2752. else { return "simple"; }
  2753. },
  2754. pushParams: function(params) {
  2755. var i = params.length, param;
  2756. while(i--) {
  2757. param = params[i];
  2758. if(this.options.stringParams) {
  2759. if(param.depth) {
  2760. this.addDepth(param.depth);
  2761. }
  2762. this.opcode('getContext', param.depth || 0);
  2763. this.opcode('pushStringParam', param.string);
  2764. } else {
  2765. this[param.type](param);
  2766. }
  2767. }
  2768. },
  2769. setupMustacheParams: function(mustache) {
  2770. var params = mustache.params;
  2771. this.pushParams(params);
  2772. if(mustache.hash) {
  2773. this.hash(mustache.hash);
  2774. } else {
  2775. this.opcode('pushLiteral', '{}');
  2776. }
  2777. return params;
  2778. },
  2779. // this will replace setupMustacheParams when we're done
  2780. setupFullMustacheParams: function(mustache, program, inverse) {
  2781. var params = mustache.params;
  2782. this.pushParams(params);
  2783. this.opcode('pushProgram', program);
  2784. this.opcode('pushProgram', inverse);
  2785. if(mustache.hash) {
  2786. this.hash(mustache.hash);
  2787. } else {
  2788. this.opcode('pushLiteral', '{}');
  2789. }
  2790. return params;
  2791. }
  2792. };
  2793. var Literal = function(value) {
  2794. this.value = value;
  2795. };
  2796. JavaScriptCompiler.prototype = {
  2797. // PUBLIC API: You can override these methods in a subclass to provide
  2798. // alternative compiled forms for name lookup and buffering semantics
  2799. nameLookup: function(parent, name, type) {
  2800. if (/^[0-9]+$/.test(name)) {
  2801. return parent + "[" + name + "]";
  2802. } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
  2803. return parent + "." + name;
  2804. }
  2805. else {
  2806. return parent + "['" + name + "']";
  2807. }
  2808. },
  2809. appendToBuffer: function(string) {
  2810. if (this.environment.isSimple) {
  2811. return "return " + string + ";";
  2812. } else {
  2813. return "buffer += " + string + ";";
  2814. }
  2815. },
  2816. initializeBuffer: function() {
  2817. return this.quotedString("");
  2818. },
  2819. namespace: "Handlebars",
  2820. // END PUBLIC API
  2821. compile: function(environment, options, context, asObject) {
  2822. this.environment = environment;
  2823. this.options = options || {};
  2824. Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
  2825. this.name = this.environment.name;
  2826. this.isChild = !!context;
  2827. this.context = context || {
  2828. programs: [],
  2829. aliases: { }
  2830. };
  2831. this.preamble();
  2832. this.stackSlot = 0;
  2833. this.stackVars = [];
  2834. this.registers = { list: [] };
  2835. this.compileStack = [];
  2836. this.compileChildren(environment, options);
  2837. var opcodes = environment.opcodes, opcode;
  2838. this.i = 0;
  2839. for(l=opcodes.length; this.i<l; this.i++) {
  2840. opcode = opcodes[this.i];
  2841. if(opcode.opcode === 'DECLARE') {
  2842. this[opcode.name] = opcode.value;
  2843. } else {
  2844. this[opcode.opcode].apply(this, opcode.args);
  2845. }
  2846. }
  2847. return this.createFunctionContext(asObject);
  2848. },
  2849. nextOpcode: function() {
  2850. var opcodes = this.environment.opcodes, opcode = opcodes[this.i + 1];
  2851. return opcodes[this.i + 1];
  2852. },
  2853. eat: function(opcode) {
  2854. this.i = this.i + 1;
  2855. },
  2856. preamble: function() {
  2857. var out = [];
  2858. if (!this.isChild) {
  2859. var namespace = this.namespace;
  2860. var copies = "helpers = helpers || " + namespace + ".helpers;";
  2861. if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
  2862. if (this.options.data) { copies = copies + " data = data || {};"; }
  2863. out.push(copies);
  2864. } else {
  2865. out.push('');
  2866. }
  2867. if (!this.environment.isSimple) {
  2868. out.push(", buffer = " + this.initializeBuffer());
  2869. } else {
  2870. out.push("");
  2871. }
  2872. // track the last context pushed into place to allow skipping the
  2873. // getContext opcode when it would be a noop
  2874. this.lastContext = 0;
  2875. this.source = out;
  2876. },
  2877. createFunctionContext: function(asObject) {
  2878. var locals = this.stackVars.concat(this.registers.list);
  2879. if(locals.length > 0) {
  2880. this.source[1] = this.source[1] + ", " + locals.join(", ");
  2881. }
  2882. // Generate minimizer alias mappings
  2883. if (!this.isChild) {
  2884. var aliases = [];
  2885. for (var alias in this.context.aliases) {
  2886. this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
  2887. }
  2888. }
  2889. if (this.source[1]) {
  2890. this.source[1] = "var " + this.source[1].substring(2) + ";";
  2891. }
  2892. // Merge children
  2893. if (!this.isChild) {
  2894. this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
  2895. }
  2896. if (!this.environment.isSimple) {
  2897. this.source.push("return buffer;");
  2898. }
  2899. var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
  2900. for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
  2901. params.push("depth" + this.environment.depths.list[i]);
  2902. }
  2903. if (asObject) {
  2904. params.push(this.source.join("\n "));
  2905. return Function.apply(this, params);
  2906. } else {
  2907. var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + this.source.join("\n ") + '}';
  2908. Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
  2909. return functionSource;
  2910. }
  2911. },
  2912. // [blockValue]
  2913. //
  2914. // On stack, before: hash, inverse, program, value
  2915. // On stack, after: return value of blockHelperMissing
  2916. //
  2917. // The purpose of this opcode is to take a block of the form
  2918. // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
  2919. // replace it on the stack with the result of properly
  2920. // invoking blockHelperMissing.
  2921. blockValue: function() {
  2922. this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
  2923. var params = ["depth0"];
  2924. this.setupParams(0, params);
  2925. this.replaceStack(function(current) {
  2926. params.splice(1, 0, current);
  2927. return current + " = blockHelperMissing.call(" + params.join(", ") + ")";
  2928. });
  2929. },
  2930. // [ambiguousBlockValue]
  2931. //
  2932. // On stack, before: hash, inverse, program, value
  2933. // Compiler value, before: lastHelper=value of last found helper, if any
  2934. // On stack, after, if no lastHelper: same as [blockValue]
  2935. // On stack, after, if lastHelper: value
  2936. ambiguousBlockValue: function() {
  2937. this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
  2938. var params = ["depth0"];
  2939. this.setupParams(0, params);
  2940. var current = this.topStack();
  2941. params.splice(1, 0, current);
  2942. this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
  2943. },
  2944. // [appendContent]
  2945. //
  2946. // On stack, before: ...
  2947. // On stack, after: ...
  2948. //
  2949. // Appends the string value of `content` to the current buffer
  2950. appendContent: function(content) {
  2951. this.source.push(this.appendToBuffer(this.quotedString(content)));
  2952. },
  2953. // [append]
  2954. //
  2955. // On stack, before: value, ...
  2956. // On stack, after: ...
  2957. //
  2958. // Coerces `value` to a String and appends it to the current buffer.
  2959. //
  2960. // If `value` is truthy, or 0, it is coerced into a string and appended
  2961. // Otherwise, the empty string is appended
  2962. append: function() {
  2963. var local = this.popStack();
  2964. this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
  2965. if (this.environment.isSimple) {
  2966. this.source.push("else { " + this.appendToBuffer("''") + " }");
  2967. }
  2968. },
  2969. // [appendEscaped]
  2970. //
  2971. // On stack, before: value, ...
  2972. // On stack, after: ...
  2973. //
  2974. // Escape `value` and append it to the buffer
  2975. appendEscaped: function() {
  2976. var opcode = this.nextOpcode(), extra = "";
  2977. this.context.aliases.escapeExpression = 'this.escapeExpression';
  2978. if(opcode && opcode.opcode === 'appendContent') {
  2979. extra = " + " + this.quotedString(opcode.args[0]);
  2980. this.eat(opcode);
  2981. }
  2982. this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
  2983. },
  2984. // [getContext]
  2985. //
  2986. // On stack, before: ...
  2987. // On stack, after: ...
  2988. // Compiler value, after: lastContext=depth
  2989. //
  2990. // Set the value of the `lastContext` compiler value to the depth
  2991. getContext: function(depth) {
  2992. if(this.lastContext !== depth) {
  2993. this.lastContext = depth;
  2994. }
  2995. },
  2996. // [lookupOnContext]
  2997. //
  2998. // On stack, before: ...
  2999. // On stack, after: currentContext[name], ...
  3000. //
  3001. // Looks up the value of `name` on the current context and pushes
  3002. // it onto the stack.
  3003. lookupOnContext: function(name) {
  3004. this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));
  3005. },
  3006. // [pushContext]
  3007. //
  3008. // On stack, before: ...
  3009. // On stack, after: currentContext, ...
  3010. //
  3011. // Pushes the value of the current context onto the stack.
  3012. pushContext: function() {
  3013. this.pushStackLiteral('depth' + this.lastContext);
  3014. },
  3015. // [resolvePossibleLambda]
  3016. //
  3017. // On stack, before: value, ...
  3018. // On stack, after: resolved value, ...
  3019. //
  3020. // If the `value` is a lambda, replace it on the stack by
  3021. // the return value of the lambda
  3022. resolvePossibleLambda: function() {
  3023. this.context.aliases.functionType = '"function"';
  3024. this.replaceStack(function(current) {
  3025. return "typeof " + current + " === functionType ? " + current + "() : " + current;
  3026. });
  3027. },
  3028. // [lookup]
  3029. //
  3030. // On stack, before: value, ...
  3031. // On stack, after: value[name], ...
  3032. //
  3033. // Replace the value on the stack with the result of looking
  3034. // up `name` on `value`
  3035. lookup: function(name) {
  3036. this.replaceStack(function(current) {
  3037. return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
  3038. });
  3039. },
  3040. // [lookupData]
  3041. //
  3042. // On stack, before: ...
  3043. // On stack, after: data[id], ...
  3044. //
  3045. // Push the result of looking up `id` on the current data
  3046. lookupData: function(id) {
  3047. this.pushStack(this.nameLookup('data', id, 'data'));
  3048. },
  3049. // [pushStringParam]
  3050. //
  3051. // On stack, before: ...
  3052. // On stack, after: string, currentContext, ...
  3053. //
  3054. // This opcode is designed for use in string mode, which
  3055. // provides the string value of a parameter along with its
  3056. // depth rather than resolving it immediately.
  3057. pushStringParam: function(string) {
  3058. this.pushStackLiteral('depth' + this.lastContext);
  3059. this.pushString(string);
  3060. },
  3061. // [pushString]
  3062. //
  3063. // On stack, before: ...
  3064. // On stack, after: quotedString(string), ...
  3065. //
  3066. // Push a quoted version of `string` onto the stack
  3067. pushString: function(string) {
  3068. this.pushStackLiteral(this.quotedString(string));
  3069. },
  3070. // [push]
  3071. //
  3072. // On stack, before: ...
  3073. // On stack, after: expr, ...
  3074. //
  3075. // Push an expression onto the stack
  3076. push: function(expr) {
  3077. this.pushStack(expr);
  3078. },
  3079. // [pushLiteral]
  3080. //
  3081. // On stack, before: ...
  3082. // On stack, after: value, ...
  3083. //
  3084. // Pushes a value onto the stack. This operation prevents
  3085. // the compiler from creating a temporary variable to hold
  3086. // it.
  3087. pushLiteral: function(value) {
  3088. this.pushStackLiteral(value);
  3089. },
  3090. // [pushProgram]
  3091. //
  3092. // On stack, before: ...
  3093. // On stack, after: program(guid), ...
  3094. //
  3095. // Push a program expression onto the stack. This takes
  3096. // a compile-time guid and converts it into a runtime-accessible
  3097. // expression.
  3098. pushProgram: function(guid) {
  3099. if (guid != null) {
  3100. this.pushStackLiteral(this.programExpression(guid));
  3101. } else {
  3102. this.pushStackLiteral(null);
  3103. }
  3104. },
  3105. // [invokeHelper]
  3106. //
  3107. // On stack, before: hash, inverse, program, params..., ...
  3108. // On stack, after: result of helper invocation
  3109. //
  3110. // Pops off the helper's parameters, invokes the helper,
  3111. // and pushes the helper's return value onto the stack.
  3112. //
  3113. // If the helper is not found, `helperMissing` is called.
  3114. invokeHelper: function(paramSize, name) {
  3115. this.context.aliases.helperMissing = 'helpers.helperMissing';
  3116. var helper = this.lastHelper = this.setupHelper(paramSize, name);
  3117. this.register('foundHelper', helper.name);
  3118. this.pushStack("foundHelper ? foundHelper.call(" +
  3119. helper.callParams + ") " + ": helperMissing.call(" +
  3120. helper.helperMissingParams + ")");
  3121. },
  3122. // [invokeKnownHelper]
  3123. //
  3124. // On stack, before: hash, inverse, program, params..., ...
  3125. // On stack, after: result of helper invocation
  3126. //
  3127. // This operation is used when the helper is known to exist,
  3128. // so a `helperMissing` fallback is not required.
  3129. invokeKnownHelper: function(paramSize, name) {
  3130. var helper = this.setupHelper(paramSize, name);
  3131. this.pushStack(helper.name + ".call(" + helper.callParams + ")");
  3132. },
  3133. // [invokeAmbiguous]
  3134. //
  3135. // On stack, before: hash, inverse, program, params..., ...
  3136. // On stack, after: result of disambiguation
  3137. //
  3138. // This operation is used when an expression like `{{foo}}`
  3139. // is provided, but we don't know at compile-time whether it
  3140. // is a helper or a path.
  3141. //
  3142. // This operation emits more code than the other options,
  3143. // and can be avoided by passing the `knownHelpers` and
  3144. // `knownHelpersOnly` flags at compile-time.
  3145. invokeAmbiguous: function(name) {
  3146. this.context.aliases.functionType = '"function"';
  3147. this.pushStackLiteral('{}');
  3148. var helper = this.setupHelper(0, name);
  3149. var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
  3150. this.register('foundHelper', helperName);
  3151. var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
  3152. var nextStack = this.nextStack();
  3153. this.source.push('if (foundHelper) { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');
  3154. this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '() : ' + nextStack + '; }');
  3155. },
  3156. // [invokePartial]
  3157. //
  3158. // On stack, before: context, ...
  3159. // On stack after: result of partial invocation
  3160. //
  3161. // This operation pops off a context, invokes a partial with that context,
  3162. // and pushes the result of the invocation back.
  3163. invokePartial: function(name) {
  3164. var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
  3165. if (this.options.data) {
  3166. params.push("data");
  3167. }
  3168. this.context.aliases.self = "this";
  3169. this.pushStack("self.invokePartial(" + params.join(", ") + ");");
  3170. },
  3171. // [assignToHash]
  3172. //
  3173. // On stack, before: value, hash, ...
  3174. // On stack, after: hash, ...
  3175. //
  3176. // Pops a value and hash off the stack, assigns `hash[key] = value`
  3177. // and pushes the hash back onto the stack.
  3178. assignToHash: function(key) {
  3179. var value = this.popStack();
  3180. var hash = this.topStack();
  3181. this.source.push(hash + "['" + key + "'] = " + value + ";");
  3182. },
  3183. // HELPERS
  3184. compiler: JavaScriptCompiler,
  3185. compileChildren: function(environment, options) {
  3186. var children = environment.children, child, compiler;
  3187. for(var i=0, l=children.length; i<l; i++) {
  3188. child = children[i];
  3189. compiler = new this.compiler();
  3190. this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
  3191. var index = this.context.programs.length;
  3192. child.index = index;
  3193. child.name = 'program' + index;
  3194. this.context.programs[index] = compiler.compile(child, options, this.context);
  3195. }
  3196. },
  3197. programExpression: function(guid) {
  3198. this.context.aliases.self = "this";
  3199. if(guid == null) {
  3200. return "self.noop";
  3201. }
  3202. var child = this.environment.children[guid],
  3203. depths = child.depths.list, depth;
  3204. var programParams = [child.index, child.name, "data"];
  3205. for(var i=0, l = depths.length; i<l; i++) {
  3206. depth = depths[i];
  3207. if(depth === 1) { programParams.push("depth0"); }
  3208. else { programParams.push("depth" + (depth - 1)); }
  3209. }
  3210. if(depths.length === 0) {
  3211. return "self.program(" + programParams.join(", ") + ")";
  3212. } else {
  3213. programParams.shift();
  3214. return "self.programWithDepth(" + programParams.join(", ") + ")";
  3215. }
  3216. },
  3217. register: function(name, val) {
  3218. this.useRegister(name);
  3219. this.source.push(name + " = " + val + ";");
  3220. },
  3221. useRegister: function(name) {
  3222. if(!this.registers[name]) {
  3223. this.registers[name] = true;
  3224. this.registers.list.push(name);
  3225. }
  3226. },
  3227. pushStackLiteral: function(item) {
  3228. this.compileStack.push(new Literal(item));
  3229. return item;
  3230. },
  3231. pushStack: function(item) {
  3232. this.source.push(this.incrStack() + " = " + item + ";");
  3233. this.compileStack.push("stack" + this.stackSlot);
  3234. return "stack" + this.stackSlot;
  3235. },
  3236. replaceStack: function(callback) {
  3237. var item = callback.call(this, this.topStack());
  3238. this.source.push(this.topStack() + " = " + item + ";");
  3239. return "stack" + this.stackSlot;
  3240. },
  3241. nextStack: function(skipCompileStack) {
  3242. var name = this.incrStack();
  3243. this.compileStack.push("stack" + this.stackSlot);
  3244. return name;
  3245. },
  3246. incrStack: function() {
  3247. this.stackSlot++;
  3248. if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
  3249. return "stack" + this.stackSlot;
  3250. },
  3251. popStack: function() {
  3252. var item = this.compileStack.pop();
  3253. if (item instanceof Literal) {
  3254. return item.value;
  3255. } else {
  3256. this.stackSlot--;
  3257. return item;
  3258. }
  3259. },
  3260. topStack: function() {
  3261. var item = this.compileStack[this.compileStack.length - 1];
  3262. if (item instanceof Literal) {
  3263. return item.value;
  3264. } else {
  3265. return item;
  3266. }
  3267. },
  3268. quotedString: function(str) {
  3269. return '"' + str
  3270. .replace(/\\/g, '\\\\')
  3271. .replace(/"/g, '\\"')
  3272. .replace(/\n/g, '\\n')
  3273. .replace(/\r/g, '\\r') + '"';
  3274. },
  3275. setupHelper: function(paramSize, name) {
  3276. var params = [];
  3277. this.setupParams(paramSize, params);
  3278. var foundHelper = this.nameLookup('helpers', name, 'helper');
  3279. return {
  3280. params: params,
  3281. name: foundHelper,
  3282. callParams: ["depth0"].concat(params).join(", "),
  3283. helperMissingParams: ["depth0", this.quotedString(name)].concat(params).join(", ")
  3284. };
  3285. },
  3286. // the params and contexts arguments are passed in arrays
  3287. // to fill in
  3288. setupParams: function(paramSize, params) {
  3289. var options = [], contexts = [], param, inverse, program;
  3290. options.push("hash:" + this.popStack());
  3291. inverse = this.popStack();
  3292. program = this.popStack();
  3293. // Avoid setting fn and inverse if neither are set. This allows
  3294. // helpers to do a check for `if (options.fn)`
  3295. if (program || inverse) {
  3296. if (!program) {
  3297. this.context.aliases.self = "this";
  3298. program = "self.noop";
  3299. }
  3300. if (!inverse) {
  3301. this.context.aliases.self = "this";
  3302. inverse = "self.noop";
  3303. }
  3304. options.push("inverse:" + inverse);
  3305. options.push("fn:" + program);
  3306. }
  3307. for(var i=0; i<paramSize; i++) {
  3308. param = this.popStack();
  3309. params.push(param);
  3310. if(this.options.stringParams) {
  3311. contexts.push(this.popStack());
  3312. }
  3313. }
  3314. if (this.options.stringParams) {
  3315. options.push("contexts:[" + contexts.join(",") + "]");
  3316. }
  3317. if(this.options.data) {
  3318. options.push("data:data");
  3319. }
  3320. params.push("{" + options.join(",") + "}");
  3321. return params.join(", ");
  3322. }
  3323. };
  3324. var reservedWords = (
  3325. "break else new var" +
  3326. " case finally return void" +
  3327. " catch for switch while" +
  3328. " continue function this with" +
  3329. " default if throw" +
  3330. " delete in try" +
  3331. " do instanceof typeof" +
  3332. " abstract enum int short" +
  3333. " boolean export interface static" +
  3334. " byte extends long super" +
  3335. " char final native synchronized" +
  3336. " class float package throws" +
  3337. " const goto private transient" +
  3338. " debugger implements protected volatile" +
  3339. " double import public let yield"
  3340. ).split(" ");
  3341. var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
  3342. for(var i=0, l=reservedWords.length; i<l; i++) {
  3343. compilerWords[reservedWords[i]] = true;
  3344. }
  3345. JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
  3346. if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
  3347. return true;
  3348. }
  3349. return false;
  3350. };
  3351. })(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
  3352. Handlebars.precompile = function(string, options) {
  3353. options = options || {};
  3354. var ast = Handlebars.parse(string);
  3355. var environment = new Handlebars.Compiler().compile(ast, options);
  3356. return new Handlebars.JavaScriptCompiler().compile(environment, options);
  3357. };
  3358. Handlebars.compile = function(string, options) {
  3359. options = options || {};
  3360. var compiled;
  3361. function compile() {
  3362. var ast = Handlebars.parse(string);
  3363. var environment = new Handlebars.Compiler().compile(ast, options);
  3364. var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
  3365. return Handlebars.template(templateSpec);
  3366. }
  3367. // Template is only compiled on first use and cached after that point.
  3368. return function(context, options) {
  3369. if (!compiled) {
  3370. compiled = compile();
  3371. }
  3372. return compiled.call(this, context, options);
  3373. };
  3374. };
  3375. ;
  3376. // lib/handlebars/runtime.js
  3377. Handlebars.VM = {
  3378. template: function(templateSpec) {
  3379. // Just add water
  3380. var container = {
  3381. escapeExpression: Handlebars.Utils.escapeExpression,
  3382. invokePartial: Handlebars.VM.invokePartial,
  3383. programs: [],
  3384. program: function(i, fn, data) {
  3385. var programWrapper = this.programs[i];
  3386. if(data) {
  3387. return Handlebars.VM.program(fn, data);
  3388. } else if(programWrapper) {
  3389. return programWrapper;
  3390. } else {
  3391. programWrapper = this.programs[i] = Handlebars.VM.program(fn);
  3392. return programWrapper;
  3393. }
  3394. },
  3395. programWithDepth: Handlebars.VM.programWithDepth,
  3396. noop: Handlebars.VM.noop
  3397. };
  3398. return function(context, options) {
  3399. options = options || {};
  3400. return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
  3401. };
  3402. },
  3403. programWithDepth: function(fn, data, $depth) {
  3404. var args = Array.prototype.slice.call(arguments, 2);
  3405. return function(context, options) {
  3406. options = options || {};
  3407. return fn.apply(this, [context, options.data || data].concat(args));
  3408. };
  3409. },
  3410. program: function(fn, data) {
  3411. return function(context, options) {
  3412. options = options || {};
  3413. return fn(context, options.data || data);
  3414. };
  3415. },
  3416. noop: function() { return ""; },
  3417. invokePartial: function(partial, name, context, helpers, partials, data) {
  3418. var options = { helpers: helpers, partials: partials, data: data };
  3419. if(partial === undefined) {
  3420. throw new Handlebars.Exception("The partial " + name + " could not be found");
  3421. } else if(partial instanceof Function) {
  3422. return partial(context, options);
  3423. } else if (!Handlebars.compile) {
  3424. throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
  3425. } else {
  3426. partials[name] = Handlebars.compile(partial, {data: data !== undefined});
  3427. return partials[name](context, options);
  3428. }
  3429. }
  3430. };
  3431. Handlebars.template = Handlebars.VM.template;
  3432. ;